[
  {
    "path": ".bowerrc",
    "content": "{\n  \"directory\": \"www/lib\"\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Specifies intentionally untracked files to ignore when using Git\n# http://git-scm.com/docs/gitignore\n\n#node_modules/\nplatforms/\nplugins/\n截图/\nioniclub-1.0.0.apk\nioniclub.keystore\n"
  },
  {
    "path": "README.md",
    "content": "# Ioniclub App\n\n[![Join the chat at https://gitter.im/IonicChina/ioniclub](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/IonicChina/ioniclub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n> [http://ionichina.com](http://ionichina.com) Ionichina社区客户端，采用Ionic Framework开发\n\n[![Download on the app store](https://devimages.apple.com.edgekey.net/app-store/marketing/guidelines/images/badge-download-on-the-app-store.svg)](https://itunes.apple.com/cn/app/id996999423)\n\n## 快速开始\n\n### 1. 首先安装ionic\n    $ sudo npm install -g cordova ionic\n\n### 2. 项目Clone到本地\n    $ git clone https://github.com/IonicChina/ioniclub.git\n\n### 3. 添加 android 或 ios 平台\n注： 真机调试，浏览器可以跳过此步骤；  \n ios 开发只能在 mac 下进行。\n    \n    $ cd ioniclub\n    $ ionic platform add ios\n    $ ionic platform add android\n\n### 4. 添加所有用到的插件\n\n    bower install moment --save\n    bower install ngCordova\n    bower install angular-moment --save\n    bower install angular-resource --save\n    cordova plugin add https://github.com/danwilson/google-analytics-plugin.git\n    cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git\n    cordova plugin add cordova-plugin-inappbrowser\n    cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git\n    cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git\n    cordova plugin add cordova-plugin-network-information\n    cordova plugin add https://github.com/wildabeast/BarcodeScanner.git\n    cordova plugin add https://github.com/VersoSolutions/CordovaClipboard.git\n\njpush 插件安装参考：[https://github.com/jpush/jpush-phonegap-plugin](https://github.com/jpush/jpush-phonegap-plugin\n\n  注：在添加了BarcodeScanner插件后android 打包会遇到个蛋疼error，解决方案是在platforms/android/build.gradle文件里 `android {}` 结点（243行）添加\n  ```lintOptions {\n    abortOnError false\n}```\n[#详情](http://forum.ionicframework.com/t/error-when-running-cordova-build-release-android/25136/4)\n### 5. 运行\n#### 浏览器\n    $  ionic serve\n#### ios\n    $  ionic build ios\n    $  ionic run ios\n#### android\n    $  ionic build android\n    $  ionic run android\n\n\n## 贡献\n[贡献者列表](https://github.com/IonicChina/ioniclub/graphs/contributors)\n\n有任何意见或建议都欢迎提 issue，或者直接在社区 [http://ionichina.com](http://ionichina.com) 提给 [@DongHongfei](http://ionichina.com/user/DongHongfei)\n\n## License\n[MIT](LICENSE)\n"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"ioniclub\",\n  \"private\": \"true\",\n  \"devDependencies\": {\n    \"ionic\": \"driftyco/ionic-bower#1.0.0\"\n  },\n  \"dependencies\": {\n    \"angular-moment\": \"~0.10.0\",\n    \"angular-resource\": \"~1.3.15\"\n  }\n}\n"
  },
  {
    "path": "config.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<widget id=\"com.ionichina.ioniclub\" version=\"1.0.0\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">\n  <name>ioniclub</name>\n  <description>\n    An Ionic Framework and Cordova project.\n  </description>\n  <author email=\"v@ionichina.com\" href=\"http://ionichina.com/\">\n    Ionic China Team\n  </author>\n  <content src=\"index.html\"/>\n  <access origin=\"*\"/>\n  <preference name=\"webviewbounce\" value=\"false\"/>\n  <preference name=\"UIWebViewBounce\" value=\"false\"/>\n  <preference name=\"DisallowOverscroll\" value=\"true\"/>\n  <preference name=\"BackupWebStorage\" value=\"none\"/>\n  <preference name=\"SplashScreen\" value=\"screen\"/>\n  <preference name=\"SplashScreenDelay\" value=\"3000\"/>\n  <feature name=\"StatusBar\">\n    <param name=\"ios-package\" value=\"CDVStatusBar\" onload=\"true\"/>\n  </feature>\n  <platform name=\"ios\">\n    <icon src=\"resources/ios/icon/icon.png\" width=\"57\" height=\"57\"/>\n    <icon src=\"resources/ios/icon/icon@2x.png\" width=\"114\" height=\"114\"/>\n    <icon src=\"resources/ios/icon/icon-40.png\" width=\"40\" height=\"40\"/>\n    <icon src=\"resources/ios/icon/icon-40@2x.png\" width=\"80\" height=\"80\"/>\n    <icon src=\"resources/ios/icon/icon-50.png\" width=\"50\" height=\"50\"/>\n    <icon src=\"resources/ios/icon/icon-50@2x.png\" width=\"100\" height=\"100\"/>\n    <icon src=\"resources/ios/icon/icon-60.png\" width=\"60\" height=\"60\"/>\n    <icon src=\"resources/ios/icon/icon-60@2x.png\" width=\"120\" height=\"120\"/>\n    <icon src=\"resources/ios/icon/icon-60@3x.png\" width=\"180\" height=\"180\"/>\n    <icon src=\"resources/ios/icon/icon-72.png\" width=\"72\" height=\"72\"/>\n    <icon src=\"resources/ios/icon/icon-72@2x.png\" width=\"144\" height=\"144\"/>\n    <icon src=\"resources/ios/icon/icon-76.png\" width=\"76\" height=\"76\"/>\n    <icon src=\"resources/ios/icon/icon-76@2x.png\" width=\"152\" height=\"152\"/>\n    <icon src=\"resources/ios/icon/icon-small.png\" width=\"29\" height=\"29\"/>\n    <icon src=\"resources/ios/icon/icon-small@2x.png\" width=\"58\" height=\"58\"/>\n    <icon src=\"resources/ios/icon/icon-small@3x.png\" width=\"87\" height=\"87\"/>\n    <splash src=\"resources/ios/splash/Default-568h@2x~iphone.png\" width=\"640\" height=\"1136\"/>\n    <splash src=\"resources/ios/splash/Default-667h.png\" width=\"750\" height=\"1334\"/>\n    <splash src=\"resources/ios/splash/Default-736h.png\" width=\"1242\" height=\"2208\"/>\n    <splash src=\"resources/ios/splash/Default-Landscape-736h.png\" width=\"2208\" height=\"1242\"/>\n    <splash src=\"resources/ios/splash/Default-Landscape@2x~ipad.png\" width=\"2048\" height=\"1536\"/>\n    <splash src=\"resources/ios/splash/Default-Landscape~ipad.png\" width=\"1024\" height=\"768\"/>\n    <splash src=\"resources/ios/splash/Default-Portrait@2x~ipad.png\" width=\"1536\" height=\"2048\"/>\n    <splash src=\"resources/ios/splash/Default-Portrait~ipad.png\" width=\"768\" height=\"1024\"/>\n    <splash src=\"resources/ios/splash/Default@2x~iphone.png\" width=\"640\" height=\"960\"/>\n    <splash src=\"resources/ios/splash/Default~iphone.png\" width=\"320\" height=\"480\"/>\n  </platform>\n  <platform name=\"android\">\n    <icon src=\"resources/android/icon/drawable-ldpi-icon.png\" density=\"ldpi\"/>\n    <icon src=\"resources/android/icon/drawable-mdpi-icon.png\" density=\"mdpi\"/>\n    <icon src=\"resources/android/icon/drawable-hdpi-icon.png\" density=\"hdpi\"/>\n    <icon src=\"resources/android/icon/drawable-xhdpi-icon.png\" density=\"xhdpi\"/>\n    <icon src=\"resources/android/icon/drawable-xxhdpi-icon.png\" density=\"xxhdpi\"/>\n    <icon src=\"resources/android/icon/drawable-xxxhdpi-icon.png\" density=\"xxxhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-ldpi-screen.png\" density=\"land-ldpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-mdpi-screen.png\" density=\"land-mdpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-hdpi-screen.png\" density=\"land-hdpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-xhdpi-screen.png\" density=\"land-xhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-xxhdpi-screen.png\" density=\"land-xxhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-land-xxxhdpi-screen.png\" density=\"land-xxxhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-ldpi-screen.png\" density=\"port-ldpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-mdpi-screen.png\" density=\"port-mdpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-hdpi-screen.png\" density=\"port-hdpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-xhdpi-screen.png\" density=\"port-xhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-xxhdpi-screen.png\" density=\"port-xxhdpi\"/>\n    <splash src=\"resources/android/splash/drawable-port-xxxhdpi-screen.png\" density=\"port-xxxhdpi\"/>\n  </platform>\n  <icon src=\"resources/android/icon/drawable-xhdpi-icon.png\"/>\n</widget>"
  },
  {
    "path": "gulpfile.js",
    "content": "var gulp = require('gulp');\nvar gutil = require('gulp-util');\nvar bower = require('bower');\nvar concat = require('gulp-concat');\nvar sass = require('gulp-sass');\nvar minifyCss = require('gulp-minify-css');\nvar rename = require('gulp-rename');\nvar sh = require('shelljs');\n\nvar paths = {\n  sass: ['./scss/**/*.scss']\n};\n\ngulp.task('default', ['sass']);\n\ngulp.task('sass', function(done) {\n  gulp.src('./scss/ionic.app.scss')\n    .pipe(sass())\n    .pipe(gulp.dest('./www/css/'))\n    .pipe(minifyCss({\n      keepSpecialComments: 0\n    }))\n    .pipe(rename({ extname: '.min.css' }))\n    .pipe(gulp.dest('./www/css/'))\n    .on('end', done);\n});\n\ngulp.task('watch', function() {\n  gulp.watch(paths.sass, ['sass']);\n});\n\ngulp.task('install', ['git-check'], function() {\n  return bower.commands.install()\n    .on('log', function(data) {\n      gutil.log('bower', gutil.colors.cyan(data.id), data.message);\n    });\n});\n\ngulp.task('git-check', function(done) {\n  if (!sh.which('git')) {\n    console.log(\n      '  ' + gutil.colors.red('Git is not installed.'),\n      '\\n  Git, the version control system, is required to download Ionic.',\n      '\\n  Download git here:', gutil.colors.cyan('http://git-scm.com/downloads') + '.',\n      '\\n  Once git is installed, run \\'' + gutil.colors.cyan('gulp install') + '\\' again.'\n    );\n    process.exit(1);\n  }\n  done();\n});\n"
  },
  {
    "path": "hooks/README.md",
    "content": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#  KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n-->\n# Cordova Hooks\n\nThis directory may contain scripts used to customize cordova commands. This\ndirectory used to exist at `.cordova/hooks`, but has now been moved to the\nproject root. Any scripts you add to these directories will be executed before\nand after the commands corresponding to the directory name. Useful for\nintegrating your own build systems or integrating with version control systems.\n\n__Remember__: Make your scripts executable.\n\n## Hook Directories\nThe following subdirectories will be used for hooks:\n\n    after_build/\n    after_compile/\n    after_docs/\n    after_emulate/\n    after_platform_add/\n    after_platform_rm/\n    after_platform_ls/\n    after_plugin_add/\n    after_plugin_ls/\n    after_plugin_rm/\n    after_plugin_search/\n    after_prepare/\n    after_run/\n    after_serve/\n    before_build/\n    before_compile/\n    before_docs/\n    before_emulate/\n    before_platform_add/\n    before_platform_rm/\n    before_platform_ls/\n    before_plugin_add/\n    before_plugin_ls/\n    before_plugin_rm/\n    before_plugin_search/\n    before_prepare/\n    before_run/\n    before_serve/\n    pre_package/ <-- Windows 8 and Windows Phone only.\n\n## Script Interface\n\nAll scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:\n\n* CORDOVA_VERSION - The version of the Cordova-CLI.\n* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).\n* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)\n* CORDOVA_HOOK - Path to the hook that is being executed.\n* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)\n\nIf a script returns a non-zero exit code, then the parent cordova command will be aborted.\n\n\n## Writing hooks\n\nWe highly recommend writting your hooks using Node.js so that they are\ncross-platform. Some good examples are shown here:\n\n[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)\n\n"
  },
  {
    "path": "hooks/after_prepare/010_add_platform_class.js",
    "content": "#!/usr/bin/env node\n\n// Add Platform Class\n// v1.0\n// Automatically adds the platform class to the body tag\n// after the `prepare` command. By placing the platform CSS classes\n// directly in the HTML built for the platform, it speeds up\n// rendering the correct layout/style for the specific platform\n// instead of waiting for the JS to figure out the correct classes.\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar rootdir = process.argv[2];\n\nfunction addPlatformBodyTag(indexPath, platform) {\n  // add the platform class to the body tag\n  try {\n    var platformClass = 'platform-' + platform;\n    var cordovaClass = 'platform-cordova platform-webview';\n\n    var html = fs.readFileSync(indexPath, 'utf8');\n\n    var bodyTag = findBodyTag(html);\n    if(!bodyTag) return; // no opening body tag, something's wrong\n\n    if(bodyTag.indexOf(platformClass) > -1) return; // already added\n\n    var newBodyTag = bodyTag;\n\n    var classAttr = findClassAttr(bodyTag);\n    if(classAttr) {\n      // body tag has existing class attribute, add the classname\n      var endingQuote = classAttr.substring(classAttr.length-1);\n      var newClassAttr = classAttr.substring(0, classAttr.length-1);\n      newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;\n      newBodyTag = bodyTag.replace(classAttr, newClassAttr);\n\n    } else {\n      // add class attribute to the body tag\n      newBodyTag = bodyTag.replace('>', ' class=\"' + platformClass + ' ' + cordovaClass + '\">');\n    }\n\n    html = html.replace(bodyTag, newBodyTag);\n\n    fs.writeFileSync(indexPath, html, 'utf8');\n\n    process.stdout.write('add to body class: ' + platformClass + '\\n');\n  } catch(e) {\n    process.stdout.write(e);\n  }\n}\n\nfunction findBodyTag(html) {\n  // get the body tag\n  try{\n    return html.match(/<body(?=[\\s>])(.*?)>/gi)[0];\n  }catch(e){}\n}\n\nfunction findClassAttr(bodyTag) {\n  // get the body tag's class attribute\n  try{\n    return bodyTag.match(/ class=[\"|'](.*?)[\"|']/gi)[0];\n  }catch(e){}\n}\n\nif (rootdir) {\n\n  // go through each of the platform directories that have been prepared\n  var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);\n\n  for(var x=0; x<platforms.length; x++) {\n    // open up the index.html file at the www root\n    try {\n      var platform = platforms[x].trim().toLowerCase();\n      var indexPath;\n\n      if(platform == 'android') {\n        indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');\n      } else {\n        indexPath = path.join('platforms', platform, 'www', 'index.html');\n      }\n\n      if(fs.existsSync(indexPath)) {\n        addPlatformBodyTag(indexPath, platform);\n      }\n\n    } catch(e) {\n      process.stdout.write(e);\n    }\n  }\n\n}\n"
  },
  {
    "path": "ionic.project",
    "content": "{\n  \"name\": \"ioniclub\",\n  \"app_id\": \"996999423\",\n  \"gulpStartupTasks\": [\n    \"sass\",\n    \"watch\"\n  ],\n  \"watchPatterns\": [\n    \"www/**/*\",\n    \"!www/lib/**/*\"\n  ]\n}"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"ioniclub\",\n  \"version\": \"1.0.0\",\n  \"description\": \"ioniclub: An Ionic project\",\n  \"dependencies\": {\n    \"angular-moment\": \"^0.10.0\",\n    \"gulp\": \"^3.5.6\",\n    \"gulp-concat\": \"^2.2.0\",\n    \"gulp-minify-css\": \"^0.3.0\",\n    \"gulp-rename\": \"^1.2.0\",\n    \"gulp-sass\": \"^1.3.3\"\n  },\n  \"devDependencies\": {\n    \"bower\": \"^1.3.3\",\n    \"gulp-util\": \"^2.2.14\",\n    \"shelljs\": \"^0.3.0\"\n  },\n  \"cordovaPlugins\": [\n    \"org.apache.cordova.device\",\n    \"org.apache.cordova.console\",\n    \"com.ionic.keyboard\",\n    \"cordova-plugin-whitelist\"\n  ],\n  \"cordovaPlatforms\": [\n    \"ios\",\n    \"android\"\n  ]\n}"
  },
  {
    "path": "scss/app/_header.scss",
    "content": "a {\n  color: #08c;\n  text-decoration: none;\n}\n#logo {\n  width: 128px;\n  height: 30px;\n  margin-left: 10px;\n}\n#devTag {\n  position: relative;\n  font-size: 14px;\n}\n"
  },
  {
    "path": "scss/app/_topic.scss",
    "content": ".topic {\n  .title {\n    margin: 0;\n  }\n  .summary {\n    margin: 8px 0;\n  }\n  .avatar {\n    width: 16px;\n    border-radius: 8px;\n    vertical-align: middle;\n  }\n}\n.replies {\n  .item {\n    padding-top: 10px;\n    padding-bottom: 10px;\n    white-space: normal;\n  }\n  .reply-content {\n    img {\n      max-width: 100%;\n    }\n    p {\n      overflow: visible !important;\n      white-space: normal !important;\n    }\n  }\n}\n.topic-create {\n  .topic-tabs {\n    position: relative;\n    padding-top: 8px;\n    padding-bottom: 8px;\n    padding-left: 0;\n  }\n}\n.reply-new {\n  input {\n    background: rgba(0, 0, 0, 0);\n  }\n}\n.center {\n  display: -webkit-box;\n  display: -moz-box;\n  display: -ms-flexbox;\n  display: -webkit-flex;\n  display: flex;\n  -webkit-box-direction: normal;\n  -moz-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -moz-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  -webkit-flex-wrap: nowrap;\n  -ms-flex-wrap: nowrap;\n  flex-wrap: nowrap;\n  -webkit-box-pack: center;\n  -moz-box-pack: center;\n  -webkit-justify-content: center;\n  -ms-flex-pack: center;\n  justify-content: center;\n  -webkit-align-content: stretch;\n  -ms-flex-line-pack: stretch;\n  align-content: stretch;\n  -webkit-box-align: center;\n  -moz-box-align: center;\n  -webkit-align-items: center;\n  -ms-flex-align: center;\n  align-items: center;\n}\n"
  },
  {
    "path": "scss/app/_topics.scss",
    "content": ".topics {\n  .item-content {\n    padding: 14px 16px 18px 72px;\n    > img {\n      &:not(:first-child) {\n        -webkit-transform: translate3d(-2000px, -2000px, 0px);\n        position: absolute;\n      }\n    }\n  }\n  .activated {\n    .tab {\n      &:not(.hl) {\n        background-color: #aeaeae;\n        color: #fff;\n      }\n    }\n  }\n  .ago,\n  .summary {\n    font-size: 12px;\n  }\n  .tab {\n    background-color: #E5E5E5;\n    color: #999;\n    border-radius: 2px;\n    padding: 2px 4px;\n  }\n  .hl {\n    background-color: $node-green;\n    color: #fff;\n  }\n}\n.topic-content {\n  img {\n    max-width: 100%;\n  }\n}\n"
  },
  {
    "path": "scss/app/_user.scss",
    "content": ".user {\n  .item-content {\n    padding-right: 16px;\n  }\n}\n"
  },
  {
    "path": "scss/base/_variables.scss",
    "content": "// Colors\n// -------------------------------\n\n$node-green: #80bd01;\n$node-black: #444;\n"
  },
  {
    "path": "scss/ionic.app.scss",
    "content": "/*\nTo customize the look and feel of Ionic, you can override the variables\nin ionic's _variables.scss file.\n\nFor example, you might change some of the default colors:\n\n$light:                           #fff !default;\n$stable:                          #f8f8f8 !default;\n$positive:                        #387ef5 !default;\n$calm:                            #11c1f3 !default;\n$balanced:                        #33cd5f !default;\n$energized:                       #ffc900 !default;\n$assertive:                       #ef473a !default;\n$royal:                           #886aea !default;\n$dark:                            #444 !default;\n*/\n\n// The path for our ionicons font files, relative to the built CSS in www/css\n$ionicons-font-path: \"../lib/ionic/fonts\" !default;\n\n// Include all of Ionic\n@import \"www/lib/ionic/scss/ionic\";\n\n// base\n@import \"base/_variables.scss\";\n\n// modules\n@import \"modules/_scaffolding.scss\";\n@import \"modules/_bar.scss\";\n@import \"modules/_items.scss\";\n@import \"modules/_markdown.scss\";\n\n// app\n@import \"app/_header.scss\";\n@import \"app/_topics.scss\";\n@import \"app/_topic.scss\";\n@import \"app/_user.scss\";\n\n\n.tabs-striped.tabs-color-assertive .tab-item{\n  color: black;\n}\n.tabs-striped.tabs-color-assertive .tab-item.active{\n  color: red;\n}\n.nav-bar-tabs-top.hide + .view-container > .tabs-top > .tabs, .tabs.tabs-top {\n  top: 0 !important;\n}\n\n.nav-bar-tabs-top.hide + .view-container > .tabs-top > .tab-content .pane .has-tabs-top {\n  top: 49px !important;\n}\n\n.tabs-hide .tabs {\n    display: none;\n}\n\n.spinner svg {\n  width: 28px;\n  height: 28px;\n  stroke: #444;\n  fill: #444;\n}\n\n// 话题详情部分的spinner\n.topic-spinner {\n  margin: 100px auto 0;\n  text-align: center;\n  font-size: 50px;\n  position: absolute;\n  top: 50px;\n  left: -webkit-calc(50% - 25px);\n  z-index: 2;\n  -webkit-transition:all .4s cubic-bezier(.6,-1.6,.92,.48);\n  transition:all .4s cubic-bezier(.6,-1.6,.92,.48);\n}\n.topic-spinner.ng-hide-add{\n  -webkit-transform: scale(1,1);\n  transform: scale(1,1);\n}\n.topic-spinner.ng-hide-add-active{\n  -webkit-transform: scale(0,0);\n  transform: scale(0,0);\n}\n\n.hide-tabs .has-tabs { bottom: 0px; }\n"
  },
  {
    "path": "scss/modules/_bar.scss",
    "content": ""
  },
  {
    "path": "scss/modules/_items.scss",
    "content": ".item {\n  left: 0;\n  right: 0;\n}\n.item-divider {\n  color: #555;\n  font-weight: normal;\n  font-size: 14px;\n}\n.item-gap {\n  border: 0 none;\n  min-height: 0;\n}\n.item-loading {\n  text-align: center;\n  color: #aaa;\n}\n.saverMode {\n  .item-avatar {\n    padding-left: 14px;\n    &.item-complex {\n      padding-left: 0;\n    }\n    > img {\n      &:first-child {\n        -webkit-transform: translate3d(-2000px, -2000px, 0px);\n      }\n    }\n    .item-content {\n      padding-left: 14px;\n      padding-right: 16px;\n      > img {\n        &:first-child {\n          -webkit-transform: translate3d(-2000px, -2000px, 0px);\n        }\n      }\n    }\n  }\n}\n.setting {\n  .avatar {\n    width: 50px;\n    border-radius: 10px;\n    vertical-align: middle;\n  }\n  .login {\n    text-align: center;\n    /* background-color: #4EB554; */\n  }\n}\n"
  },
  {
    "path": "scss/modules/_markdown.scss",
    "content": ".markdown-text {\n  a {\n    color: #778087;\n  }\n  ul {\n    list-style-type: disc;\n    margin-bottom: 5px;\n    margin-left: 15px;\n    ul {\n      list-style-type: circle;\n    }\n  }\n}\n"
  },
  {
    "path": "scss/modules/_scaffolding.scss",
    "content": "#copyright {\n  margin: 20px 0 10px;\n  text-align: center;\n  color: #aaa;\n  text-shadow: 0 1px 0 #fff;\n}\n.notifyBadge {\n  position: absolute;\n  top: 2px;\n  right: 2px;\n  background: #EF4E3A;\n  border-radius: 10px;\n  width: 10px;\n  height: 10px;\n}\n.badge {\n  &.messagesCount {\n    border-radius: 20px;\n    width: 20px;\n    height: 20px;\n    display: inline-block;\n    padding: 0;\n    text-align: center;\n    line-height: 20px;\n    font-size: 12px;\n  }\n}\n\n.bold {\n  font-weight: bold;\n}\n\n.pane {\n  background-color: #f5f5f5;\n}\n\n.cnode {\n  color: $node-green;\n}\n\n.cnode-bg {\n  background-color: $node-green;\n}\n"
  },
  {
    "path": "www/css/ionic.app.css",
    "content": "@charset \"UTF-8\";\n/*\nTo customize the look and feel of Ionic, you can override the variables\nin ionic's _variables.scss file.\n\nFor example, you might change some of the default colors:\n\n$light:                           #fff !default;\n$stable:                          #f8f8f8 !default;\n$positive:                        #387ef5 !default;\n$calm:                            #11c1f3 !default;\n$balanced:                        #33cd5f !default;\n$energized:                       #ffc900 !default;\n$assertive:                       #ef473a !default;\n$royal:                           #886aea !default;\n$dark:                            #444 !default;\n*/\n/*!\n  Ionicons, v2.0.1\n  Created by Ben Sperry for the Ionic Framework, http://ionicons.com/\n  https://twitter.com/benjsperry  https://twitter.com/ionicframework\n  MIT License: https://github.com/driftyco/ionicons\n\n  Android-style icons originally built by Google’s\n  Material Design Icons: https://github.com/google/material-design-icons\n  used under CC BY http://creativecommons.org/licenses/by/4.0/\n  Modified icons to fit ionicon’s grid from original.\n*/\n@font-face {\n  font-family: \"Ionicons\";\n  src: url(\"../lib/ionic/fonts/ionicons.eot?v=2.0.1\");\n  src: url(\"../lib/ionic/fonts/ionicons.eot?v=2.0.1#iefix\") format(\"embedded-opentype\"), url(\"../lib/ionic/fonts/ionicons.ttf?v=2.0.1\") format(\"truetype\"), url(\"../lib/ionic/fonts/ionicons.woff?v=2.0.1\") format(\"woff\"), url(\"../lib/ionic/fonts/ionicons.woff\") format(\"woff\"), url(\"../lib/ionic/fonts/ionicons.svg?v=2.0.1#Ionicons\") format(\"svg\");\n  font-weight: normal;\n  font-style: normal; }\n\n.ion, .ionicons, .ion-alert:before, .ion-alert-circled:before, .ion-android-add:before, .ion-android-add-circle:before, .ion-android-alarm-clock:before, .ion-android-alert:before, .ion-android-apps:before, .ion-android-archive:before, .ion-android-arrow-back:before, .ion-android-arrow-down:before, .ion-android-arrow-dropdown:before, .ion-android-arrow-dropdown-circle:before, .ion-android-arrow-dropleft:before, .ion-android-arrow-dropleft-circle:before, .ion-android-arrow-dropright:before, .ion-android-arrow-dropright-circle:before, .ion-android-arrow-dropup:before, .ion-android-arrow-dropup-circle:before, .ion-android-arrow-forward:before, .ion-android-arrow-up:before, .ion-android-attach:before, .ion-android-bar:before, .ion-android-bicycle:before, .ion-android-boat:before, .ion-android-bookmark:before, .ion-android-bulb:before, .ion-android-bus:before, .ion-android-calendar:before, .ion-android-call:before, .ion-android-camera:before, .ion-android-cancel:before, .ion-android-car:before, .ion-android-cart:before, .ion-android-chat:before, .ion-android-checkbox:before, .ion-android-checkbox-blank:before, .ion-android-checkbox-outline:before, .ion-android-checkbox-outline-blank:before, .ion-android-checkmark-circle:before, .ion-android-clipboard:before, .ion-android-close:before, .ion-android-cloud:before, .ion-android-cloud-circle:before, .ion-android-cloud-done:before, .ion-android-cloud-outline:before, .ion-android-color-palette:before, .ion-android-compass:before, .ion-android-contact:before, .ion-android-contacts:before, .ion-android-contract:before, .ion-android-create:before, .ion-android-delete:before, .ion-android-desktop:before, .ion-android-document:before, .ion-android-done:before, .ion-android-done-all:before, .ion-android-download:before, .ion-android-drafts:before, .ion-android-exit:before, .ion-android-expand:before, .ion-android-favorite:before, .ion-android-favorite-outline:before, .ion-android-film:before, .ion-android-folder:before, .ion-android-folder-open:before, .ion-android-funnel:before, .ion-android-globe:before, .ion-android-hand:before, .ion-android-hangout:before, .ion-android-happy:before, .ion-android-home:before, .ion-android-image:before, .ion-android-laptop:before, .ion-android-list:before, .ion-android-locate:before, .ion-android-lock:before, .ion-android-mail:before, .ion-android-map:before, .ion-android-menu:before, .ion-android-microphone:before, .ion-android-microphone-off:before, .ion-android-more-horizontal:before, .ion-android-more-vertical:before, .ion-android-navigate:before, .ion-android-notifications:before, .ion-android-notifications-none:before, .ion-android-notifications-off:before, .ion-android-open:before, .ion-android-options:before, .ion-android-people:before, .ion-android-person:before, .ion-android-person-add:before, .ion-android-phone-landscape:before, .ion-android-phone-portrait:before, .ion-android-pin:before, .ion-android-plane:before, .ion-android-playstore:before, .ion-android-print:before, .ion-android-radio-button-off:before, .ion-android-radio-button-on:before, .ion-android-refresh:before, .ion-android-remove:before, .ion-android-remove-circle:before, .ion-android-restaurant:before, .ion-android-sad:before, .ion-android-search:before, .ion-android-send:before, .ion-android-settings:before, .ion-android-share:before, .ion-android-share-alt:before, .ion-android-star:before, .ion-android-star-half:before, .ion-android-star-outline:before, .ion-android-stopwatch:before, .ion-android-subway:before, .ion-android-sunny:before, .ion-android-sync:before, .ion-android-textsms:before, .ion-android-time:before, .ion-android-train:before, .ion-android-unlock:before, .ion-android-upload:before, .ion-android-volume-down:before, .ion-android-volume-mute:before, .ion-android-volume-off:before, .ion-android-volume-up:before, .ion-android-walk:before, .ion-android-warning:before, .ion-android-watch:before, .ion-android-wifi:before, .ion-aperture:before, .ion-archive:before, .ion-arrow-down-a:before, .ion-arrow-down-b:before, .ion-arrow-down-c:before, .ion-arrow-expand:before, .ion-arrow-graph-down-left:before, .ion-arrow-graph-down-right:before, .ion-arrow-graph-up-left:before, .ion-arrow-graph-up-right:before, .ion-arrow-left-a:before, .ion-arrow-left-b:before, .ion-arrow-left-c:before, .ion-arrow-move:before, .ion-arrow-resize:before, .ion-arrow-return-left:before, .ion-arrow-return-right:before, .ion-arrow-right-a:before, .ion-arrow-right-b:before, .ion-arrow-right-c:before, .ion-arrow-shrink:before, .ion-arrow-swap:before, .ion-arrow-up-a:before, .ion-arrow-up-b:before, .ion-arrow-up-c:before, .ion-asterisk:before, .ion-at:before, .ion-backspace:before, .ion-backspace-outline:before, .ion-bag:before, .ion-battery-charging:before, .ion-battery-empty:before, .ion-battery-full:before, .ion-battery-half:before, .ion-battery-low:before, .ion-beaker:before, .ion-beer:before, .ion-bluetooth:before, .ion-bonfire:before, .ion-bookmark:before, .ion-bowtie:before, .ion-briefcase:before, .ion-bug:before, .ion-calculator:before, .ion-calendar:before, .ion-camera:before, .ion-card:before, .ion-cash:before, .ion-chatbox:before, .ion-chatbox-working:before, .ion-chatboxes:before, .ion-chatbubble:before, .ion-chatbubble-working:before, .ion-chatbubbles:before, .ion-checkmark:before, .ion-checkmark-circled:before, .ion-checkmark-round:before, .ion-chevron-down:before, .ion-chevron-left:before, .ion-chevron-right:before, .ion-chevron-up:before, .ion-clipboard:before, .ion-clock:before, .ion-close:before, .ion-close-circled:before, .ion-close-round:before, .ion-closed-captioning:before, .ion-cloud:before, .ion-code:before, .ion-code-download:before, .ion-code-working:before, .ion-coffee:before, .ion-compass:before, .ion-compose:before, .ion-connection-bars:before, .ion-contrast:before, .ion-crop:before, .ion-cube:before, .ion-disc:before, .ion-document:before, .ion-document-text:before, .ion-drag:before, .ion-earth:before, .ion-easel:before, .ion-edit:before, .ion-egg:before, .ion-eject:before, .ion-email:before, .ion-email-unread:before, .ion-erlenmeyer-flask:before, .ion-erlenmeyer-flask-bubbles:before, .ion-eye:before, .ion-eye-disabled:before, .ion-female:before, .ion-filing:before, .ion-film-marker:before, .ion-fireball:before, .ion-flag:before, .ion-flame:before, .ion-flash:before, .ion-flash-off:before, .ion-folder:before, .ion-fork:before, .ion-fork-repo:before, .ion-forward:before, .ion-funnel:before, .ion-gear-a:before, .ion-gear-b:before, .ion-grid:before, .ion-hammer:before, .ion-happy:before, .ion-happy-outline:before, .ion-headphone:before, .ion-heart:before, .ion-heart-broken:before, .ion-help:before, .ion-help-buoy:before, .ion-help-circled:before, .ion-home:before, .ion-icecream:before, .ion-image:before, .ion-images:before, .ion-information:before, .ion-information-circled:before, .ion-ionic:before, .ion-ios-alarm:before, .ion-ios-alarm-outline:before, .ion-ios-albums:before, .ion-ios-albums-outline:before, .ion-ios-americanfootball:before, .ion-ios-americanfootball-outline:before, .ion-ios-analytics:before, .ion-ios-analytics-outline:before, .ion-ios-arrow-back:before, .ion-ios-arrow-down:before, .ion-ios-arrow-forward:before, .ion-ios-arrow-left:before, .ion-ios-arrow-right:before, .ion-ios-arrow-thin-down:before, .ion-ios-arrow-thin-left:before, .ion-ios-arrow-thin-right:before, .ion-ios-arrow-thin-up:before, .ion-ios-arrow-up:before, .ion-ios-at:before, .ion-ios-at-outline:before, .ion-ios-barcode:before, .ion-ios-barcode-outline:before, .ion-ios-baseball:before, .ion-ios-baseball-outline:before, .ion-ios-basketball:before, .ion-ios-basketball-outline:before, .ion-ios-bell:before, .ion-ios-bell-outline:before, .ion-ios-body:before, .ion-ios-body-outline:before, .ion-ios-bolt:before, .ion-ios-bolt-outline:before, .ion-ios-book:before, .ion-ios-book-outline:before, .ion-ios-bookmarks:before, .ion-ios-bookmarks-outline:before, .ion-ios-box:before, .ion-ios-box-outline:before, .ion-ios-briefcase:before, .ion-ios-briefcase-outline:before, .ion-ios-browsers:before, .ion-ios-browsers-outline:before, .ion-ios-calculator:before, .ion-ios-calculator-outline:before, .ion-ios-calendar:before, .ion-ios-calendar-outline:before, .ion-ios-camera:before, .ion-ios-camera-outline:before, .ion-ios-cart:before, .ion-ios-cart-outline:before, .ion-ios-chatboxes:before, .ion-ios-chatboxes-outline:before, .ion-ios-chatbubble:before, .ion-ios-chatbubble-outline:before, .ion-ios-checkmark:before, .ion-ios-checkmark-empty:before, .ion-ios-checkmark-outline:before, .ion-ios-circle-filled:before, .ion-ios-circle-outline:before, .ion-ios-clock:before, .ion-ios-clock-outline:before, .ion-ios-close:before, .ion-ios-close-empty:before, .ion-ios-close-outline:before, .ion-ios-cloud:before, .ion-ios-cloud-download:before, .ion-ios-cloud-download-outline:before, .ion-ios-cloud-outline:before, .ion-ios-cloud-upload:before, .ion-ios-cloud-upload-outline:before, .ion-ios-cloudy:before, .ion-ios-cloudy-night:before, .ion-ios-cloudy-night-outline:before, .ion-ios-cloudy-outline:before, .ion-ios-cog:before, .ion-ios-cog-outline:before, .ion-ios-color-filter:before, .ion-ios-color-filter-outline:before, .ion-ios-color-wand:before, .ion-ios-color-wand-outline:before, .ion-ios-compose:before, .ion-ios-compose-outline:before, .ion-ios-contact:before, .ion-ios-contact-outline:before, .ion-ios-copy:before, .ion-ios-copy-outline:before, .ion-ios-crop:before, .ion-ios-crop-strong:before, .ion-ios-download:before, .ion-ios-download-outline:before, .ion-ios-drag:before, .ion-ios-email:before, .ion-ios-email-outline:before, .ion-ios-eye:before, .ion-ios-eye-outline:before, .ion-ios-fastforward:before, .ion-ios-fastforward-outline:before, .ion-ios-filing:before, .ion-ios-filing-outline:before, .ion-ios-film:before, .ion-ios-film-outline:before, .ion-ios-flag:before, .ion-ios-flag-outline:before, .ion-ios-flame:before, .ion-ios-flame-outline:before, .ion-ios-flask:before, .ion-ios-flask-outline:before, .ion-ios-flower:before, .ion-ios-flower-outline:before, .ion-ios-folder:before, .ion-ios-folder-outline:before, .ion-ios-football:before, .ion-ios-football-outline:before, .ion-ios-game-controller-a:before, .ion-ios-game-controller-a-outline:before, .ion-ios-game-controller-b:before, .ion-ios-game-controller-b-outline:before, .ion-ios-gear:before, .ion-ios-gear-outline:before, .ion-ios-glasses:before, .ion-ios-glasses-outline:before, .ion-ios-grid-view:before, .ion-ios-grid-view-outline:before, .ion-ios-heart:before, .ion-ios-heart-outline:before, .ion-ios-help:before, .ion-ios-help-empty:before, .ion-ios-help-outline:before, .ion-ios-home:before, .ion-ios-home-outline:before, .ion-ios-infinite:before, .ion-ios-infinite-outline:before, .ion-ios-information:before, .ion-ios-information-empty:before, .ion-ios-information-outline:before, .ion-ios-ionic-outline:before, .ion-ios-keypad:before, .ion-ios-keypad-outline:before, .ion-ios-lightbulb:before, .ion-ios-lightbulb-outline:before, .ion-ios-list:before, .ion-ios-list-outline:before, .ion-ios-location:before, .ion-ios-location-outline:before, .ion-ios-locked:before, .ion-ios-locked-outline:before, .ion-ios-loop:before, .ion-ios-loop-strong:before, .ion-ios-medical:before, .ion-ios-medical-outline:before, .ion-ios-medkit:before, .ion-ios-medkit-outline:before, .ion-ios-mic:before, .ion-ios-mic-off:before, .ion-ios-mic-outline:before, .ion-ios-minus:before, .ion-ios-minus-empty:before, .ion-ios-minus-outline:before, .ion-ios-monitor:before, .ion-ios-monitor-outline:before, .ion-ios-moon:before, .ion-ios-moon-outline:before, .ion-ios-more:before, .ion-ios-more-outline:before, .ion-ios-musical-note:before, .ion-ios-musical-notes:before, .ion-ios-navigate:before, .ion-ios-navigate-outline:before, .ion-ios-nutrition:before, .ion-ios-nutrition-outline:before, .ion-ios-paper:before, .ion-ios-paper-outline:before, .ion-ios-paperplane:before, .ion-ios-paperplane-outline:before, .ion-ios-partlysunny:before, .ion-ios-partlysunny-outline:before, .ion-ios-pause:before, .ion-ios-pause-outline:before, .ion-ios-paw:before, .ion-ios-paw-outline:before, .ion-ios-people:before, .ion-ios-people-outline:before, .ion-ios-person:before, .ion-ios-person-outline:before, .ion-ios-personadd:before, .ion-ios-personadd-outline:before, .ion-ios-photos:before, .ion-ios-photos-outline:before, .ion-ios-pie:before, .ion-ios-pie-outline:before, .ion-ios-pint:before, .ion-ios-pint-outline:before, .ion-ios-play:before, .ion-ios-play-outline:before, .ion-ios-plus:before, .ion-ios-plus-empty:before, .ion-ios-plus-outline:before, .ion-ios-pricetag:before, .ion-ios-pricetag-outline:before, .ion-ios-pricetags:before, .ion-ios-pricetags-outline:before, .ion-ios-printer:before, .ion-ios-printer-outline:before, .ion-ios-pulse:before, .ion-ios-pulse-strong:before, .ion-ios-rainy:before, .ion-ios-rainy-outline:before, .ion-ios-recording:before, .ion-ios-recording-outline:before, .ion-ios-redo:before, .ion-ios-redo-outline:before, .ion-ios-refresh:before, .ion-ios-refresh-empty:before, .ion-ios-refresh-outline:before, .ion-ios-reload:before, .ion-ios-reverse-camera:before, .ion-ios-reverse-camera-outline:before, .ion-ios-rewind:before, .ion-ios-rewind-outline:before, .ion-ios-rose:before, .ion-ios-rose-outline:before, .ion-ios-search:before, .ion-ios-search-strong:before, .ion-ios-settings:before, .ion-ios-settings-strong:before, .ion-ios-shuffle:before, .ion-ios-shuffle-strong:before, .ion-ios-skipbackward:before, .ion-ios-skipbackward-outline:before, .ion-ios-skipforward:before, .ion-ios-skipforward-outline:before, .ion-ios-snowy:before, .ion-ios-speedometer:before, .ion-ios-speedometer-outline:before, .ion-ios-star:before, .ion-ios-star-half:before, .ion-ios-star-outline:before, .ion-ios-stopwatch:before, .ion-ios-stopwatch-outline:before, .ion-ios-sunny:before, .ion-ios-sunny-outline:before, .ion-ios-telephone:before, .ion-ios-telephone-outline:before, .ion-ios-tennisball:before, .ion-ios-tennisball-outline:before, .ion-ios-thunderstorm:before, .ion-ios-thunderstorm-outline:before, .ion-ios-time:before, .ion-ios-time-outline:before, .ion-ios-timer:before, .ion-ios-timer-outline:before, .ion-ios-toggle:before, .ion-ios-toggle-outline:before, .ion-ios-trash:before, .ion-ios-trash-outline:before, .ion-ios-undo:before, .ion-ios-undo-outline:before, .ion-ios-unlocked:before, .ion-ios-unlocked-outline:before, .ion-ios-upload:before, .ion-ios-upload-outline:before, .ion-ios-videocam:before, .ion-ios-videocam-outline:before, .ion-ios-volume-high:before, .ion-ios-volume-low:before, .ion-ios-wineglass:before, .ion-ios-wineglass-outline:before, .ion-ios-world:before, .ion-ios-world-outline:before, .ion-ipad:before, .ion-iphone:before, .ion-ipod:before, .ion-jet:before, .ion-key:before, .ion-knife:before, .ion-laptop:before, .ion-leaf:before, .ion-levels:before, .ion-lightbulb:before, .ion-link:before, .ion-load-a:before, .ion-load-b:before, .ion-load-c:before, .ion-load-d:before, .ion-location:before, .ion-lock-combination:before, .ion-locked:before, .ion-log-in:before, .ion-log-out:before, .ion-loop:before, .ion-magnet:before, .ion-male:before, .ion-man:before, .ion-map:before, .ion-medkit:before, .ion-merge:before, .ion-mic-a:before, .ion-mic-b:before, .ion-mic-c:before, .ion-minus:before, .ion-minus-circled:before, .ion-minus-round:before, .ion-model-s:before, .ion-monitor:before, .ion-more:before, .ion-mouse:before, .ion-music-note:before, .ion-navicon:before, .ion-navicon-round:before, .ion-navigate:before, .ion-network:before, .ion-no-smoking:before, .ion-nuclear:before, .ion-outlet:before, .ion-paintbrush:before, .ion-paintbucket:before, .ion-paper-airplane:before, .ion-paperclip:before, .ion-pause:before, .ion-person:before, .ion-person-add:before, .ion-person-stalker:before, .ion-pie-graph:before, .ion-pin:before, .ion-pinpoint:before, .ion-pizza:before, .ion-plane:before, .ion-planet:before, .ion-play:before, .ion-playstation:before, .ion-plus:before, .ion-plus-circled:before, .ion-plus-round:before, .ion-podium:before, .ion-pound:before, .ion-power:before, .ion-pricetag:before, .ion-pricetags:before, .ion-printer:before, .ion-pull-request:before, .ion-qr-scanner:before, .ion-quote:before, .ion-radio-waves:before, .ion-record:before, .ion-refresh:before, .ion-reply:before, .ion-reply-all:before, .ion-ribbon-a:before, .ion-ribbon-b:before, .ion-sad:before, .ion-sad-outline:before, .ion-scissors:before, .ion-search:before, .ion-settings:before, .ion-share:before, .ion-shuffle:before, .ion-skip-backward:before, .ion-skip-forward:before, .ion-social-android:before, .ion-social-android-outline:before, .ion-social-angular:before, .ion-social-angular-outline:before, .ion-social-apple:before, .ion-social-apple-outline:before, .ion-social-bitcoin:before, .ion-social-bitcoin-outline:before, .ion-social-buffer:before, .ion-social-buffer-outline:before, .ion-social-chrome:before, .ion-social-chrome-outline:before, .ion-social-codepen:before, .ion-social-codepen-outline:before, .ion-social-css3:before, .ion-social-css3-outline:before, .ion-social-designernews:before, .ion-social-designernews-outline:before, .ion-social-dribbble:before, .ion-social-dribbble-outline:before, .ion-social-dropbox:before, .ion-social-dropbox-outline:before, .ion-social-euro:before, .ion-social-euro-outline:before, .ion-social-facebook:before, .ion-social-facebook-outline:before, .ion-social-foursquare:before, .ion-social-foursquare-outline:before, .ion-social-freebsd-devil:before, .ion-social-github:before, .ion-social-github-outline:before, .ion-social-google:before, .ion-social-google-outline:before, .ion-social-googleplus:before, .ion-social-googleplus-outline:before, .ion-social-hackernews:before, .ion-social-hackernews-outline:before, .ion-social-html5:before, .ion-social-html5-outline:before, .ion-social-instagram:before, .ion-social-instagram-outline:before, .ion-social-javascript:before, .ion-social-javascript-outline:before, .ion-social-linkedin:before, .ion-social-linkedin-outline:before, .ion-social-markdown:before, .ion-social-nodejs:before, .ion-social-octocat:before, .ion-social-pinterest:before, .ion-social-pinterest-outline:before, .ion-social-python:before, .ion-social-reddit:before, .ion-social-reddit-outline:before, .ion-social-rss:before, .ion-social-rss-outline:before, .ion-social-sass:before, .ion-social-skype:before, .ion-social-skype-outline:before, .ion-social-snapchat:before, .ion-social-snapchat-outline:before, .ion-social-tumblr:before, .ion-social-tumblr-outline:before, .ion-social-tux:before, .ion-social-twitch:before, .ion-social-twitch-outline:before, .ion-social-twitter:before, .ion-social-twitter-outline:before, .ion-social-usd:before, .ion-social-usd-outline:before, .ion-social-vimeo:before, .ion-social-vimeo-outline:before, .ion-social-whatsapp:before, .ion-social-whatsapp-outline:before, .ion-social-windows:before, .ion-social-windows-outline:before, .ion-social-wordpress:before, .ion-social-wordpress-outline:before, .ion-social-yahoo:before, .ion-social-yahoo-outline:before, .ion-social-yen:before, .ion-social-yen-outline:before, .ion-social-youtube:before, .ion-social-youtube-outline:before, .ion-soup-can:before, .ion-soup-can-outline:before, .ion-speakerphone:before, .ion-speedometer:before, .ion-spoon:before, .ion-star:before, .ion-stats-bars:before, .ion-steam:before, .ion-stop:before, .ion-thermometer:before, .ion-thumbsdown:before, .ion-thumbsup:before, .ion-toggle:before, .ion-toggle-filled:before, .ion-transgender:before, .ion-trash-a:before, .ion-trash-b:before, .ion-trophy:before, .ion-tshirt:before, .ion-tshirt-outline:before, .ion-umbrella:before, .ion-university:before, .ion-unlocked:before, .ion-upload:before, .ion-usb:before, .ion-videocamera:before, .ion-volume-high:before, .ion-volume-low:before, .ion-volume-medium:before, .ion-volume-mute:before, .ion-wand:before, .ion-waterdrop:before, .ion-wifi:before, .ion-wineglass:before, .ion-woman:before, .ion-wrench:before, .ion-xbox:before {\n  display: inline-block;\n  font-family: \"Ionicons\";\n  speak: none;\n  font-style: normal;\n  font-weight: normal;\n  font-variant: normal;\n  text-transform: none;\n  text-rendering: auto;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale; }\n\n.ion-alert:before {\n  content: \"\\f101\"; }\n\n.ion-alert-circled:before {\n  content: \"\\f100\"; }\n\n.ion-android-add:before {\n  content: \"\\f2c7\"; }\n\n.ion-android-add-circle:before {\n  content: \"\\f359\"; }\n\n.ion-android-alarm-clock:before {\n  content: \"\\f35a\"; }\n\n.ion-android-alert:before {\n  content: \"\\f35b\"; }\n\n.ion-android-apps:before {\n  content: \"\\f35c\"; }\n\n.ion-android-archive:before {\n  content: \"\\f2c9\"; }\n\n.ion-android-arrow-back:before {\n  content: \"\\f2ca\"; }\n\n.ion-android-arrow-down:before {\n  content: \"\\f35d\"; }\n\n.ion-android-arrow-dropdown:before {\n  content: \"\\f35f\"; }\n\n.ion-android-arrow-dropdown-circle:before {\n  content: \"\\f35e\"; }\n\n.ion-android-arrow-dropleft:before {\n  content: \"\\f361\"; }\n\n.ion-android-arrow-dropleft-circle:before {\n  content: \"\\f360\"; }\n\n.ion-android-arrow-dropright:before {\n  content: \"\\f363\"; }\n\n.ion-android-arrow-dropright-circle:before {\n  content: \"\\f362\"; }\n\n.ion-android-arrow-dropup:before {\n  content: \"\\f365\"; }\n\n.ion-android-arrow-dropup-circle:before {\n  content: \"\\f364\"; }\n\n.ion-android-arrow-forward:before {\n  content: \"\\f30f\"; }\n\n.ion-android-arrow-up:before {\n  content: \"\\f366\"; }\n\n.ion-android-attach:before {\n  content: \"\\f367\"; }\n\n.ion-android-bar:before {\n  content: \"\\f368\"; }\n\n.ion-android-bicycle:before {\n  content: \"\\f369\"; }\n\n.ion-android-boat:before {\n  content: \"\\f36a\"; }\n\n.ion-android-bookmark:before {\n  content: \"\\f36b\"; }\n\n.ion-android-bulb:before {\n  content: \"\\f36c\"; }\n\n.ion-android-bus:before {\n  content: \"\\f36d\"; }\n\n.ion-android-calendar:before {\n  content: \"\\f2d1\"; }\n\n.ion-android-call:before {\n  content: \"\\f2d2\"; }\n\n.ion-android-camera:before {\n  content: \"\\f2d3\"; }\n\n.ion-android-cancel:before {\n  content: \"\\f36e\"; }\n\n.ion-android-car:before {\n  content: \"\\f36f\"; }\n\n.ion-android-cart:before {\n  content: \"\\f370\"; }\n\n.ion-android-chat:before {\n  content: \"\\f2d4\"; }\n\n.ion-android-checkbox:before {\n  content: \"\\f374\"; }\n\n.ion-android-checkbox-blank:before {\n  content: \"\\f371\"; }\n\n.ion-android-checkbox-outline:before {\n  content: \"\\f373\"; }\n\n.ion-android-checkbox-outline-blank:before {\n  content: \"\\f372\"; }\n\n.ion-android-checkmark-circle:before {\n  content: \"\\f375\"; }\n\n.ion-android-clipboard:before {\n  content: \"\\f376\"; }\n\n.ion-android-close:before {\n  content: \"\\f2d7\"; }\n\n.ion-android-cloud:before {\n  content: \"\\f37a\"; }\n\n.ion-android-cloud-circle:before {\n  content: \"\\f377\"; }\n\n.ion-android-cloud-done:before {\n  content: \"\\f378\"; }\n\n.ion-android-cloud-outline:before {\n  content: \"\\f379\"; }\n\n.ion-android-color-palette:before {\n  content: \"\\f37b\"; }\n\n.ion-android-compass:before {\n  content: \"\\f37c\"; }\n\n.ion-android-contact:before {\n  content: \"\\f2d8\"; }\n\n.ion-android-contacts:before {\n  content: \"\\f2d9\"; }\n\n.ion-android-contract:before {\n  content: \"\\f37d\"; }\n\n.ion-android-create:before {\n  content: \"\\f37e\"; }\n\n.ion-android-delete:before {\n  content: \"\\f37f\"; }\n\n.ion-android-desktop:before {\n  content: \"\\f380\"; }\n\n.ion-android-document:before {\n  content: \"\\f381\"; }\n\n.ion-android-done:before {\n  content: \"\\f383\"; }\n\n.ion-android-done-all:before {\n  content: \"\\f382\"; }\n\n.ion-android-download:before {\n  content: \"\\f2dd\"; }\n\n.ion-android-drafts:before {\n  content: \"\\f384\"; }\n\n.ion-android-exit:before {\n  content: \"\\f385\"; }\n\n.ion-android-expand:before {\n  content: \"\\f386\"; }\n\n.ion-android-favorite:before {\n  content: \"\\f388\"; }\n\n.ion-android-favorite-outline:before {\n  content: \"\\f387\"; }\n\n.ion-android-film:before {\n  content: \"\\f389\"; }\n\n.ion-android-folder:before {\n  content: \"\\f2e0\"; }\n\n.ion-android-folder-open:before {\n  content: \"\\f38a\"; }\n\n.ion-android-funnel:before {\n  content: \"\\f38b\"; }\n\n.ion-android-globe:before {\n  content: \"\\f38c\"; }\n\n.ion-android-hand:before {\n  content: \"\\f2e3\"; }\n\n.ion-android-hangout:before {\n  content: \"\\f38d\"; }\n\n.ion-android-happy:before {\n  content: \"\\f38e\"; }\n\n.ion-android-home:before {\n  content: \"\\f38f\"; }\n\n.ion-android-image:before {\n  content: \"\\f2e4\"; }\n\n.ion-android-laptop:before {\n  content: \"\\f390\"; }\n\n.ion-android-list:before {\n  content: \"\\f391\"; }\n\n.ion-android-locate:before {\n  content: \"\\f2e9\"; }\n\n.ion-android-lock:before {\n  content: \"\\f392\"; }\n\n.ion-android-mail:before {\n  content: \"\\f2eb\"; }\n\n.ion-android-map:before {\n  content: \"\\f393\"; }\n\n.ion-android-menu:before {\n  content: \"\\f394\"; }\n\n.ion-android-microphone:before {\n  content: \"\\f2ec\"; }\n\n.ion-android-microphone-off:before {\n  content: \"\\f395\"; }\n\n.ion-android-more-horizontal:before {\n  content: \"\\f396\"; }\n\n.ion-android-more-vertical:before {\n  content: \"\\f397\"; }\n\n.ion-android-navigate:before {\n  content: \"\\f398\"; }\n\n.ion-android-notifications:before {\n  content: \"\\f39b\"; }\n\n.ion-android-notifications-none:before {\n  content: \"\\f399\"; }\n\n.ion-android-notifications-off:before {\n  content: \"\\f39a\"; }\n\n.ion-android-open:before {\n  content: \"\\f39c\"; }\n\n.ion-android-options:before {\n  content: \"\\f39d\"; }\n\n.ion-android-people:before {\n  content: \"\\f39e\"; }\n\n.ion-android-person:before {\n  content: \"\\f3a0\"; }\n\n.ion-android-person-add:before {\n  content: \"\\f39f\"; }\n\n.ion-android-phone-landscape:before {\n  content: \"\\f3a1\"; }\n\n.ion-android-phone-portrait:before {\n  content: \"\\f3a2\"; }\n\n.ion-android-pin:before {\n  content: \"\\f3a3\"; }\n\n.ion-android-plane:before {\n  content: \"\\f3a4\"; }\n\n.ion-android-playstore:before {\n  content: \"\\f2f0\"; }\n\n.ion-android-print:before {\n  content: \"\\f3a5\"; }\n\n.ion-android-radio-button-off:before {\n  content: \"\\f3a6\"; }\n\n.ion-android-radio-button-on:before {\n  content: \"\\f3a7\"; }\n\n.ion-android-refresh:before {\n  content: \"\\f3a8\"; }\n\n.ion-android-remove:before {\n  content: \"\\f2f4\"; }\n\n.ion-android-remove-circle:before {\n  content: \"\\f3a9\"; }\n\n.ion-android-restaurant:before {\n  content: \"\\f3aa\"; }\n\n.ion-android-sad:before {\n  content: \"\\f3ab\"; }\n\n.ion-android-search:before {\n  content: \"\\f2f5\"; }\n\n.ion-android-send:before {\n  content: \"\\f2f6\"; }\n\n.ion-android-settings:before {\n  content: \"\\f2f7\"; }\n\n.ion-android-share:before {\n  content: \"\\f2f8\"; }\n\n.ion-android-share-alt:before {\n  content: \"\\f3ac\"; }\n\n.ion-android-star:before {\n  content: \"\\f2fc\"; }\n\n.ion-android-star-half:before {\n  content: \"\\f3ad\"; }\n\n.ion-android-star-outline:before {\n  content: \"\\f3ae\"; }\n\n.ion-android-stopwatch:before {\n  content: \"\\f2fd\"; }\n\n.ion-android-subway:before {\n  content: \"\\f3af\"; }\n\n.ion-android-sunny:before {\n  content: \"\\f3b0\"; }\n\n.ion-android-sync:before {\n  content: \"\\f3b1\"; }\n\n.ion-android-textsms:before {\n  content: \"\\f3b2\"; }\n\n.ion-android-time:before {\n  content: \"\\f3b3\"; }\n\n.ion-android-train:before {\n  content: \"\\f3b4\"; }\n\n.ion-android-unlock:before {\n  content: \"\\f3b5\"; }\n\n.ion-android-upload:before {\n  content: \"\\f3b6\"; }\n\n.ion-android-volume-down:before {\n  content: \"\\f3b7\"; }\n\n.ion-android-volume-mute:before {\n  content: \"\\f3b8\"; }\n\n.ion-android-volume-off:before {\n  content: \"\\f3b9\"; }\n\n.ion-android-volume-up:before {\n  content: \"\\f3ba\"; }\n\n.ion-android-walk:before {\n  content: \"\\f3bb\"; }\n\n.ion-android-warning:before {\n  content: \"\\f3bc\"; }\n\n.ion-android-watch:before {\n  content: \"\\f3bd\"; }\n\n.ion-android-wifi:before {\n  content: \"\\f305\"; }\n\n.ion-aperture:before {\n  content: \"\\f313\"; }\n\n.ion-archive:before {\n  content: \"\\f102\"; }\n\n.ion-arrow-down-a:before {\n  content: \"\\f103\"; }\n\n.ion-arrow-down-b:before {\n  content: \"\\f104\"; }\n\n.ion-arrow-down-c:before {\n  content: \"\\f105\"; }\n\n.ion-arrow-expand:before {\n  content: \"\\f25e\"; }\n\n.ion-arrow-graph-down-left:before {\n  content: \"\\f25f\"; }\n\n.ion-arrow-graph-down-right:before {\n  content: \"\\f260\"; }\n\n.ion-arrow-graph-up-left:before {\n  content: \"\\f261\"; }\n\n.ion-arrow-graph-up-right:before {\n  content: \"\\f262\"; }\n\n.ion-arrow-left-a:before {\n  content: \"\\f106\"; }\n\n.ion-arrow-left-b:before {\n  content: \"\\f107\"; }\n\n.ion-arrow-left-c:before {\n  content: \"\\f108\"; }\n\n.ion-arrow-move:before {\n  content: \"\\f263\"; }\n\n.ion-arrow-resize:before {\n  content: \"\\f264\"; }\n\n.ion-arrow-return-left:before {\n  content: \"\\f265\"; }\n\n.ion-arrow-return-right:before {\n  content: \"\\f266\"; }\n\n.ion-arrow-right-a:before {\n  content: \"\\f109\"; }\n\n.ion-arrow-right-b:before {\n  content: \"\\f10a\"; }\n\n.ion-arrow-right-c:before {\n  content: \"\\f10b\"; }\n\n.ion-arrow-shrink:before {\n  content: \"\\f267\"; }\n\n.ion-arrow-swap:before {\n  content: \"\\f268\"; }\n\n.ion-arrow-up-a:before {\n  content: \"\\f10c\"; }\n\n.ion-arrow-up-b:before {\n  content: \"\\f10d\"; }\n\n.ion-arrow-up-c:before {\n  content: \"\\f10e\"; }\n\n.ion-asterisk:before {\n  content: \"\\f314\"; }\n\n.ion-at:before {\n  content: \"\\f10f\"; }\n\n.ion-backspace:before {\n  content: \"\\f3bf\"; }\n\n.ion-backspace-outline:before {\n  content: \"\\f3be\"; }\n\n.ion-bag:before {\n  content: \"\\f110\"; }\n\n.ion-battery-charging:before {\n  content: \"\\f111\"; }\n\n.ion-battery-empty:before {\n  content: \"\\f112\"; }\n\n.ion-battery-full:before {\n  content: \"\\f113\"; }\n\n.ion-battery-half:before {\n  content: \"\\f114\"; }\n\n.ion-battery-low:before {\n  content: \"\\f115\"; }\n\n.ion-beaker:before {\n  content: \"\\f269\"; }\n\n.ion-beer:before {\n  content: \"\\f26a\"; }\n\n.ion-bluetooth:before {\n  content: \"\\f116\"; }\n\n.ion-bonfire:before {\n  content: \"\\f315\"; }\n\n.ion-bookmark:before {\n  content: \"\\f26b\"; }\n\n.ion-bowtie:before {\n  content: \"\\f3c0\"; }\n\n.ion-briefcase:before {\n  content: \"\\f26c\"; }\n\n.ion-bug:before {\n  content: \"\\f2be\"; }\n\n.ion-calculator:before {\n  content: \"\\f26d\"; }\n\n.ion-calendar:before {\n  content: \"\\f117\"; }\n\n.ion-camera:before {\n  content: \"\\f118\"; }\n\n.ion-card:before {\n  content: \"\\f119\"; }\n\n.ion-cash:before {\n  content: \"\\f316\"; }\n\n.ion-chatbox:before {\n  content: \"\\f11b\"; }\n\n.ion-chatbox-working:before {\n  content: \"\\f11a\"; }\n\n.ion-chatboxes:before {\n  content: \"\\f11c\"; }\n\n.ion-chatbubble:before {\n  content: \"\\f11e\"; }\n\n.ion-chatbubble-working:before {\n  content: \"\\f11d\"; }\n\n.ion-chatbubbles:before {\n  content: \"\\f11f\"; }\n\n.ion-checkmark:before {\n  content: \"\\f122\"; }\n\n.ion-checkmark-circled:before {\n  content: \"\\f120\"; }\n\n.ion-checkmark-round:before {\n  content: \"\\f121\"; }\n\n.ion-chevron-down:before {\n  content: \"\\f123\"; }\n\n.ion-chevron-left:before {\n  content: \"\\f124\"; }\n\n.ion-chevron-right:before {\n  content: \"\\f125\"; }\n\n.ion-chevron-up:before {\n  content: \"\\f126\"; }\n\n.ion-clipboard:before {\n  content: \"\\f127\"; }\n\n.ion-clock:before {\n  content: \"\\f26e\"; }\n\n.ion-close:before {\n  content: \"\\f12a\"; }\n\n.ion-close-circled:before {\n  content: \"\\f128\"; }\n\n.ion-close-round:before {\n  content: \"\\f129\"; }\n\n.ion-closed-captioning:before {\n  content: \"\\f317\"; }\n\n.ion-cloud:before {\n  content: \"\\f12b\"; }\n\n.ion-code:before {\n  content: \"\\f271\"; }\n\n.ion-code-download:before {\n  content: \"\\f26f\"; }\n\n.ion-code-working:before {\n  content: \"\\f270\"; }\n\n.ion-coffee:before {\n  content: \"\\f272\"; }\n\n.ion-compass:before {\n  content: \"\\f273\"; }\n\n.ion-compose:before {\n  content: \"\\f12c\"; }\n\n.ion-connection-bars:before {\n  content: \"\\f274\"; }\n\n.ion-contrast:before {\n  content: \"\\f275\"; }\n\n.ion-crop:before {\n  content: \"\\f3c1\"; }\n\n.ion-cube:before {\n  content: \"\\f318\"; }\n\n.ion-disc:before {\n  content: \"\\f12d\"; }\n\n.ion-document:before {\n  content: \"\\f12f\"; }\n\n.ion-document-text:before {\n  content: \"\\f12e\"; }\n\n.ion-drag:before {\n  content: \"\\f130\"; }\n\n.ion-earth:before {\n  content: \"\\f276\"; }\n\n.ion-easel:before {\n  content: \"\\f3c2\"; }\n\n.ion-edit:before {\n  content: \"\\f2bf\"; }\n\n.ion-egg:before {\n  content: \"\\f277\"; }\n\n.ion-eject:before {\n  content: \"\\f131\"; }\n\n.ion-email:before {\n  content: \"\\f132\"; }\n\n.ion-email-unread:before {\n  content: \"\\f3c3\"; }\n\n.ion-erlenmeyer-flask:before {\n  content: \"\\f3c5\"; }\n\n.ion-erlenmeyer-flask-bubbles:before {\n  content: \"\\f3c4\"; }\n\n.ion-eye:before {\n  content: \"\\f133\"; }\n\n.ion-eye-disabled:before {\n  content: \"\\f306\"; }\n\n.ion-female:before {\n  content: \"\\f278\"; }\n\n.ion-filing:before {\n  content: \"\\f134\"; }\n\n.ion-film-marker:before {\n  content: \"\\f135\"; }\n\n.ion-fireball:before {\n  content: \"\\f319\"; }\n\n.ion-flag:before {\n  content: \"\\f279\"; }\n\n.ion-flame:before {\n  content: \"\\f31a\"; }\n\n.ion-flash:before {\n  content: \"\\f137\"; }\n\n.ion-flash-off:before {\n  content: \"\\f136\"; }\n\n.ion-folder:before {\n  content: \"\\f139\"; }\n\n.ion-fork:before {\n  content: \"\\f27a\"; }\n\n.ion-fork-repo:before {\n  content: \"\\f2c0\"; }\n\n.ion-forward:before {\n  content: \"\\f13a\"; }\n\n.ion-funnel:before {\n  content: \"\\f31b\"; }\n\n.ion-gear-a:before {\n  content: \"\\f13d\"; }\n\n.ion-gear-b:before {\n  content: \"\\f13e\"; }\n\n.ion-grid:before {\n  content: \"\\f13f\"; }\n\n.ion-hammer:before {\n  content: \"\\f27b\"; }\n\n.ion-happy:before {\n  content: \"\\f31c\"; }\n\n.ion-happy-outline:before {\n  content: \"\\f3c6\"; }\n\n.ion-headphone:before {\n  content: \"\\f140\"; }\n\n.ion-heart:before {\n  content: \"\\f141\"; }\n\n.ion-heart-broken:before {\n  content: \"\\f31d\"; }\n\n.ion-help:before {\n  content: \"\\f143\"; }\n\n.ion-help-buoy:before {\n  content: \"\\f27c\"; }\n\n.ion-help-circled:before {\n  content: \"\\f142\"; }\n\n.ion-home:before {\n  content: \"\\f144\"; }\n\n.ion-icecream:before {\n  content: \"\\f27d\"; }\n\n.ion-image:before {\n  content: \"\\f147\"; }\n\n.ion-images:before {\n  content: \"\\f148\"; }\n\n.ion-information:before {\n  content: \"\\f14a\"; }\n\n.ion-information-circled:before {\n  content: \"\\f149\"; }\n\n.ion-ionic:before {\n  content: \"\\f14b\"; }\n\n.ion-ios-alarm:before {\n  content: \"\\f3c8\"; }\n\n.ion-ios-alarm-outline:before {\n  content: \"\\f3c7\"; }\n\n.ion-ios-albums:before {\n  content: \"\\f3ca\"; }\n\n.ion-ios-albums-outline:before {\n  content: \"\\f3c9\"; }\n\n.ion-ios-americanfootball:before {\n  content: \"\\f3cc\"; }\n\n.ion-ios-americanfootball-outline:before {\n  content: \"\\f3cb\"; }\n\n.ion-ios-analytics:before {\n  content: \"\\f3ce\"; }\n\n.ion-ios-analytics-outline:before {\n  content: \"\\f3cd\"; }\n\n.ion-ios-arrow-back:before {\n  content: \"\\f3cf\"; }\n\n.ion-ios-arrow-down:before {\n  content: \"\\f3d0\"; }\n\n.ion-ios-arrow-forward:before {\n  content: \"\\f3d1\"; }\n\n.ion-ios-arrow-left:before {\n  content: \"\\f3d2\"; }\n\n.ion-ios-arrow-right:before {\n  content: \"\\f3d3\"; }\n\n.ion-ios-arrow-thin-down:before {\n  content: \"\\f3d4\"; }\n\n.ion-ios-arrow-thin-left:before {\n  content: \"\\f3d5\"; }\n\n.ion-ios-arrow-thin-right:before {\n  content: \"\\f3d6\"; }\n\n.ion-ios-arrow-thin-up:before {\n  content: \"\\f3d7\"; }\n\n.ion-ios-arrow-up:before {\n  content: \"\\f3d8\"; }\n\n.ion-ios-at:before {\n  content: \"\\f3da\"; }\n\n.ion-ios-at-outline:before {\n  content: \"\\f3d9\"; }\n\n.ion-ios-barcode:before {\n  content: \"\\f3dc\"; }\n\n.ion-ios-barcode-outline:before {\n  content: \"\\f3db\"; }\n\n.ion-ios-baseball:before {\n  content: \"\\f3de\"; }\n\n.ion-ios-baseball-outline:before {\n  content: \"\\f3dd\"; }\n\n.ion-ios-basketball:before {\n  content: \"\\f3e0\"; }\n\n.ion-ios-basketball-outline:before {\n  content: \"\\f3df\"; }\n\n.ion-ios-bell:before {\n  content: \"\\f3e2\"; }\n\n.ion-ios-bell-outline:before {\n  content: \"\\f3e1\"; }\n\n.ion-ios-body:before {\n  content: \"\\f3e4\"; }\n\n.ion-ios-body-outline:before {\n  content: \"\\f3e3\"; }\n\n.ion-ios-bolt:before {\n  content: \"\\f3e6\"; }\n\n.ion-ios-bolt-outline:before {\n  content: \"\\f3e5\"; }\n\n.ion-ios-book:before {\n  content: \"\\f3e8\"; }\n\n.ion-ios-book-outline:before {\n  content: \"\\f3e7\"; }\n\n.ion-ios-bookmarks:before {\n  content: \"\\f3ea\"; }\n\n.ion-ios-bookmarks-outline:before {\n  content: \"\\f3e9\"; }\n\n.ion-ios-box:before {\n  content: \"\\f3ec\"; }\n\n.ion-ios-box-outline:before {\n  content: \"\\f3eb\"; }\n\n.ion-ios-briefcase:before {\n  content: \"\\f3ee\"; }\n\n.ion-ios-briefcase-outline:before {\n  content: \"\\f3ed\"; }\n\n.ion-ios-browsers:before {\n  content: \"\\f3f0\"; }\n\n.ion-ios-browsers-outline:before {\n  content: \"\\f3ef\"; }\n\n.ion-ios-calculator:before {\n  content: \"\\f3f2\"; }\n\n.ion-ios-calculator-outline:before {\n  content: \"\\f3f1\"; }\n\n.ion-ios-calendar:before {\n  content: \"\\f3f4\"; }\n\n.ion-ios-calendar-outline:before {\n  content: \"\\f3f3\"; }\n\n.ion-ios-camera:before {\n  content: \"\\f3f6\"; }\n\n.ion-ios-camera-outline:before {\n  content: \"\\f3f5\"; }\n\n.ion-ios-cart:before {\n  content: \"\\f3f8\"; }\n\n.ion-ios-cart-outline:before {\n  content: \"\\f3f7\"; }\n\n.ion-ios-chatboxes:before {\n  content: \"\\f3fa\"; }\n\n.ion-ios-chatboxes-outline:before {\n  content: \"\\f3f9\"; }\n\n.ion-ios-chatbubble:before {\n  content: \"\\f3fc\"; }\n\n.ion-ios-chatbubble-outline:before {\n  content: \"\\f3fb\"; }\n\n.ion-ios-checkmark:before {\n  content: \"\\f3ff\"; }\n\n.ion-ios-checkmark-empty:before {\n  content: \"\\f3fd\"; }\n\n.ion-ios-checkmark-outline:before {\n  content: \"\\f3fe\"; }\n\n.ion-ios-circle-filled:before {\n  content: \"\\f400\"; }\n\n.ion-ios-circle-outline:before {\n  content: \"\\f401\"; }\n\n.ion-ios-clock:before {\n  content: \"\\f403\"; }\n\n.ion-ios-clock-outline:before {\n  content: \"\\f402\"; }\n\n.ion-ios-close:before {\n  content: \"\\f406\"; }\n\n.ion-ios-close-empty:before {\n  content: \"\\f404\"; }\n\n.ion-ios-close-outline:before {\n  content: \"\\f405\"; }\n\n.ion-ios-cloud:before {\n  content: \"\\f40c\"; }\n\n.ion-ios-cloud-download:before {\n  content: \"\\f408\"; }\n\n.ion-ios-cloud-download-outline:before {\n  content: \"\\f407\"; }\n\n.ion-ios-cloud-outline:before {\n  content: \"\\f409\"; }\n\n.ion-ios-cloud-upload:before {\n  content: \"\\f40b\"; }\n\n.ion-ios-cloud-upload-outline:before {\n  content: \"\\f40a\"; }\n\n.ion-ios-cloudy:before {\n  content: \"\\f410\"; }\n\n.ion-ios-cloudy-night:before {\n  content: \"\\f40e\"; }\n\n.ion-ios-cloudy-night-outline:before {\n  content: \"\\f40d\"; }\n\n.ion-ios-cloudy-outline:before {\n  content: \"\\f40f\"; }\n\n.ion-ios-cog:before {\n  content: \"\\f412\"; }\n\n.ion-ios-cog-outline:before {\n  content: \"\\f411\"; }\n\n.ion-ios-color-filter:before {\n  content: \"\\f414\"; }\n\n.ion-ios-color-filter-outline:before {\n  content: \"\\f413\"; }\n\n.ion-ios-color-wand:before {\n  content: \"\\f416\"; }\n\n.ion-ios-color-wand-outline:before {\n  content: \"\\f415\"; }\n\n.ion-ios-compose:before {\n  content: \"\\f418\"; }\n\n.ion-ios-compose-outline:before {\n  content: \"\\f417\"; }\n\n.ion-ios-contact:before {\n  content: \"\\f41a\"; }\n\n.ion-ios-contact-outline:before {\n  content: \"\\f419\"; }\n\n.ion-ios-copy:before {\n  content: \"\\f41c\"; }\n\n.ion-ios-copy-outline:before {\n  content: \"\\f41b\"; }\n\n.ion-ios-crop:before {\n  content: \"\\f41e\"; }\n\n.ion-ios-crop-strong:before {\n  content: \"\\f41d\"; }\n\n.ion-ios-download:before {\n  content: \"\\f420\"; }\n\n.ion-ios-download-outline:before {\n  content: \"\\f41f\"; }\n\n.ion-ios-drag:before {\n  content: \"\\f421\"; }\n\n.ion-ios-email:before {\n  content: \"\\f423\"; }\n\n.ion-ios-email-outline:before {\n  content: \"\\f422\"; }\n\n.ion-ios-eye:before {\n  content: \"\\f425\"; }\n\n.ion-ios-eye-outline:before {\n  content: \"\\f424\"; }\n\n.ion-ios-fastforward:before {\n  content: \"\\f427\"; }\n\n.ion-ios-fastforward-outline:before {\n  content: \"\\f426\"; }\n\n.ion-ios-filing:before {\n  content: \"\\f429\"; }\n\n.ion-ios-filing-outline:before {\n  content: \"\\f428\"; }\n\n.ion-ios-film:before {\n  content: \"\\f42b\"; }\n\n.ion-ios-film-outline:before {\n  content: \"\\f42a\"; }\n\n.ion-ios-flag:before {\n  content: \"\\f42d\"; }\n\n.ion-ios-flag-outline:before {\n  content: \"\\f42c\"; }\n\n.ion-ios-flame:before {\n  content: \"\\f42f\"; }\n\n.ion-ios-flame-outline:before {\n  content: \"\\f42e\"; }\n\n.ion-ios-flask:before {\n  content: \"\\f431\"; }\n\n.ion-ios-flask-outline:before {\n  content: \"\\f430\"; }\n\n.ion-ios-flower:before {\n  content: \"\\f433\"; }\n\n.ion-ios-flower-outline:before {\n  content: \"\\f432\"; }\n\n.ion-ios-folder:before {\n  content: \"\\f435\"; }\n\n.ion-ios-folder-outline:before {\n  content: \"\\f434\"; }\n\n.ion-ios-football:before {\n  content: \"\\f437\"; }\n\n.ion-ios-football-outline:before {\n  content: \"\\f436\"; }\n\n.ion-ios-game-controller-a:before {\n  content: \"\\f439\"; }\n\n.ion-ios-game-controller-a-outline:before {\n  content: \"\\f438\"; }\n\n.ion-ios-game-controller-b:before {\n  content: \"\\f43b\"; }\n\n.ion-ios-game-controller-b-outline:before {\n  content: \"\\f43a\"; }\n\n.ion-ios-gear:before {\n  content: \"\\f43d\"; }\n\n.ion-ios-gear-outline:before {\n  content: \"\\f43c\"; }\n\n.ion-ios-glasses:before {\n  content: \"\\f43f\"; }\n\n.ion-ios-glasses-outline:before {\n  content: \"\\f43e\"; }\n\n.ion-ios-grid-view:before {\n  content: \"\\f441\"; }\n\n.ion-ios-grid-view-outline:before {\n  content: \"\\f440\"; }\n\n.ion-ios-heart:before {\n  content: \"\\f443\"; }\n\n.ion-ios-heart-outline:before {\n  content: \"\\f442\"; }\n\n.ion-ios-help:before {\n  content: \"\\f446\"; }\n\n.ion-ios-help-empty:before {\n  content: \"\\f444\"; }\n\n.ion-ios-help-outline:before {\n  content: \"\\f445\"; }\n\n.ion-ios-home:before {\n  content: \"\\f448\"; }\n\n.ion-ios-home-outline:before {\n  content: \"\\f447\"; }\n\n.ion-ios-infinite:before {\n  content: \"\\f44a\"; }\n\n.ion-ios-infinite-outline:before {\n  content: \"\\f449\"; }\n\n.ion-ios-information:before {\n  content: \"\\f44d\"; }\n\n.ion-ios-information-empty:before {\n  content: \"\\f44b\"; }\n\n.ion-ios-information-outline:before {\n  content: \"\\f44c\"; }\n\n.ion-ios-ionic-outline:before {\n  content: \"\\f44e\"; }\n\n.ion-ios-keypad:before {\n  content: \"\\f450\"; }\n\n.ion-ios-keypad-outline:before {\n  content: \"\\f44f\"; }\n\n.ion-ios-lightbulb:before {\n  content: \"\\f452\"; }\n\n.ion-ios-lightbulb-outline:before {\n  content: \"\\f451\"; }\n\n.ion-ios-list:before {\n  content: \"\\f454\"; }\n\n.ion-ios-list-outline:before {\n  content: \"\\f453\"; }\n\n.ion-ios-location:before {\n  content: \"\\f456\"; }\n\n.ion-ios-location-outline:before {\n  content: \"\\f455\"; }\n\n.ion-ios-locked:before {\n  content: \"\\f458\"; }\n\n.ion-ios-locked-outline:before {\n  content: \"\\f457\"; }\n\n.ion-ios-loop:before {\n  content: \"\\f45a\"; }\n\n.ion-ios-loop-strong:before {\n  content: \"\\f459\"; }\n\n.ion-ios-medical:before {\n  content: \"\\f45c\"; }\n\n.ion-ios-medical-outline:before {\n  content: \"\\f45b\"; }\n\n.ion-ios-medkit:before {\n  content: \"\\f45e\"; }\n\n.ion-ios-medkit-outline:before {\n  content: \"\\f45d\"; }\n\n.ion-ios-mic:before {\n  content: \"\\f461\"; }\n\n.ion-ios-mic-off:before {\n  content: \"\\f45f\"; }\n\n.ion-ios-mic-outline:before {\n  content: \"\\f460\"; }\n\n.ion-ios-minus:before {\n  content: \"\\f464\"; }\n\n.ion-ios-minus-empty:before {\n  content: \"\\f462\"; }\n\n.ion-ios-minus-outline:before {\n  content: \"\\f463\"; }\n\n.ion-ios-monitor:before {\n  content: \"\\f466\"; }\n\n.ion-ios-monitor-outline:before {\n  content: \"\\f465\"; }\n\n.ion-ios-moon:before {\n  content: \"\\f468\"; }\n\n.ion-ios-moon-outline:before {\n  content: \"\\f467\"; }\n\n.ion-ios-more:before {\n  content: \"\\f46a\"; }\n\n.ion-ios-more-outline:before {\n  content: \"\\f469\"; }\n\n.ion-ios-musical-note:before {\n  content: \"\\f46b\"; }\n\n.ion-ios-musical-notes:before {\n  content: \"\\f46c\"; }\n\n.ion-ios-navigate:before {\n  content: \"\\f46e\"; }\n\n.ion-ios-navigate-outline:before {\n  content: \"\\f46d\"; }\n\n.ion-ios-nutrition:before {\n  content: \"\\f470\"; }\n\n.ion-ios-nutrition-outline:before {\n  content: \"\\f46f\"; }\n\n.ion-ios-paper:before {\n  content: \"\\f472\"; }\n\n.ion-ios-paper-outline:before {\n  content: \"\\f471\"; }\n\n.ion-ios-paperplane:before {\n  content: \"\\f474\"; }\n\n.ion-ios-paperplane-outline:before {\n  content: \"\\f473\"; }\n\n.ion-ios-partlysunny:before {\n  content: \"\\f476\"; }\n\n.ion-ios-partlysunny-outline:before {\n  content: \"\\f475\"; }\n\n.ion-ios-pause:before {\n  content: \"\\f478\"; }\n\n.ion-ios-pause-outline:before {\n  content: \"\\f477\"; }\n\n.ion-ios-paw:before {\n  content: \"\\f47a\"; }\n\n.ion-ios-paw-outline:before {\n  content: \"\\f479\"; }\n\n.ion-ios-people:before {\n  content: \"\\f47c\"; }\n\n.ion-ios-people-outline:before {\n  content: \"\\f47b\"; }\n\n.ion-ios-person:before {\n  content: \"\\f47e\"; }\n\n.ion-ios-person-outline:before {\n  content: \"\\f47d\"; }\n\n.ion-ios-personadd:before {\n  content: \"\\f480\"; }\n\n.ion-ios-personadd-outline:before {\n  content: \"\\f47f\"; }\n\n.ion-ios-photos:before {\n  content: \"\\f482\"; }\n\n.ion-ios-photos-outline:before {\n  content: \"\\f481\"; }\n\n.ion-ios-pie:before {\n  content: \"\\f484\"; }\n\n.ion-ios-pie-outline:before {\n  content: \"\\f483\"; }\n\n.ion-ios-pint:before {\n  content: \"\\f486\"; }\n\n.ion-ios-pint-outline:before {\n  content: \"\\f485\"; }\n\n.ion-ios-play:before {\n  content: \"\\f488\"; }\n\n.ion-ios-play-outline:before {\n  content: \"\\f487\"; }\n\n.ion-ios-plus:before {\n  content: \"\\f48b\"; }\n\n.ion-ios-plus-empty:before {\n  content: \"\\f489\"; }\n\n.ion-ios-plus-outline:before {\n  content: \"\\f48a\"; }\n\n.ion-ios-pricetag:before {\n  content: \"\\f48d\"; }\n\n.ion-ios-pricetag-outline:before {\n  content: \"\\f48c\"; }\n\n.ion-ios-pricetags:before {\n  content: \"\\f48f\"; }\n\n.ion-ios-pricetags-outline:before {\n  content: \"\\f48e\"; }\n\n.ion-ios-printer:before {\n  content: \"\\f491\"; }\n\n.ion-ios-printer-outline:before {\n  content: \"\\f490\"; }\n\n.ion-ios-pulse:before {\n  content: \"\\f493\"; }\n\n.ion-ios-pulse-strong:before {\n  content: \"\\f492\"; }\n\n.ion-ios-rainy:before {\n  content: \"\\f495\"; }\n\n.ion-ios-rainy-outline:before {\n  content: \"\\f494\"; }\n\n.ion-ios-recording:before {\n  content: \"\\f497\"; }\n\n.ion-ios-recording-outline:before {\n  content: \"\\f496\"; }\n\n.ion-ios-redo:before {\n  content: \"\\f499\"; }\n\n.ion-ios-redo-outline:before {\n  content: \"\\f498\"; }\n\n.ion-ios-refresh:before {\n  content: \"\\f49c\"; }\n\n.ion-ios-refresh-empty:before {\n  content: \"\\f49a\"; }\n\n.ion-ios-refresh-outline:before {\n  content: \"\\f49b\"; }\n\n.ion-ios-reload:before {\n  content: \"\\f49d\"; }\n\n.ion-ios-reverse-camera:before {\n  content: \"\\f49f\"; }\n\n.ion-ios-reverse-camera-outline:before {\n  content: \"\\f49e\"; }\n\n.ion-ios-rewind:before {\n  content: \"\\f4a1\"; }\n\n.ion-ios-rewind-outline:before {\n  content: \"\\f4a0\"; }\n\n.ion-ios-rose:before {\n  content: \"\\f4a3\"; }\n\n.ion-ios-rose-outline:before {\n  content: \"\\f4a2\"; }\n\n.ion-ios-search:before {\n  content: \"\\f4a5\"; }\n\n.ion-ios-search-strong:before {\n  content: \"\\f4a4\"; }\n\n.ion-ios-settings:before {\n  content: \"\\f4a7\"; }\n\n.ion-ios-settings-strong:before {\n  content: \"\\f4a6\"; }\n\n.ion-ios-shuffle:before {\n  content: \"\\f4a9\"; }\n\n.ion-ios-shuffle-strong:before {\n  content: \"\\f4a8\"; }\n\n.ion-ios-skipbackward:before {\n  content: \"\\f4ab\"; }\n\n.ion-ios-skipbackward-outline:before {\n  content: \"\\f4aa\"; }\n\n.ion-ios-skipforward:before {\n  content: \"\\f4ad\"; }\n\n.ion-ios-skipforward-outline:before {\n  content: \"\\f4ac\"; }\n\n.ion-ios-snowy:before {\n  content: \"\\f4ae\"; }\n\n.ion-ios-speedometer:before {\n  content: \"\\f4b0\"; }\n\n.ion-ios-speedometer-outline:before {\n  content: \"\\f4af\"; }\n\n.ion-ios-star:before {\n  content: \"\\f4b3\"; }\n\n.ion-ios-star-half:before {\n  content: \"\\f4b1\"; }\n\n.ion-ios-star-outline:before {\n  content: \"\\f4b2\"; }\n\n.ion-ios-stopwatch:before {\n  content: \"\\f4b5\"; }\n\n.ion-ios-stopwatch-outline:before {\n  content: \"\\f4b4\"; }\n\n.ion-ios-sunny:before {\n  content: \"\\f4b7\"; }\n\n.ion-ios-sunny-outline:before {\n  content: \"\\f4b6\"; }\n\n.ion-ios-telephone:before {\n  content: \"\\f4b9\"; }\n\n.ion-ios-telephone-outline:before {\n  content: \"\\f4b8\"; }\n\n.ion-ios-tennisball:before {\n  content: \"\\f4bb\"; }\n\n.ion-ios-tennisball-outline:before {\n  content: \"\\f4ba\"; }\n\n.ion-ios-thunderstorm:before {\n  content: \"\\f4bd\"; }\n\n.ion-ios-thunderstorm-outline:before {\n  content: \"\\f4bc\"; }\n\n.ion-ios-time:before {\n  content: \"\\f4bf\"; }\n\n.ion-ios-time-outline:before {\n  content: \"\\f4be\"; }\n\n.ion-ios-timer:before {\n  content: \"\\f4c1\"; }\n\n.ion-ios-timer-outline:before {\n  content: \"\\f4c0\"; }\n\n.ion-ios-toggle:before {\n  content: \"\\f4c3\"; }\n\n.ion-ios-toggle-outline:before {\n  content: \"\\f4c2\"; }\n\n.ion-ios-trash:before {\n  content: \"\\f4c5\"; }\n\n.ion-ios-trash-outline:before {\n  content: \"\\f4c4\"; }\n\n.ion-ios-undo:before {\n  content: \"\\f4c7\"; }\n\n.ion-ios-undo-outline:before {\n  content: \"\\f4c6\"; }\n\n.ion-ios-unlocked:before {\n  content: \"\\f4c9\"; }\n\n.ion-ios-unlocked-outline:before {\n  content: \"\\f4c8\"; }\n\n.ion-ios-upload:before {\n  content: \"\\f4cb\"; }\n\n.ion-ios-upload-outline:before {\n  content: \"\\f4ca\"; }\n\n.ion-ios-videocam:before {\n  content: \"\\f4cd\"; }\n\n.ion-ios-videocam-outline:before {\n  content: \"\\f4cc\"; }\n\n.ion-ios-volume-high:before {\n  content: \"\\f4ce\"; }\n\n.ion-ios-volume-low:before {\n  content: \"\\f4cf\"; }\n\n.ion-ios-wineglass:before {\n  content: \"\\f4d1\"; }\n\n.ion-ios-wineglass-outline:before {\n  content: \"\\f4d0\"; }\n\n.ion-ios-world:before {\n  content: \"\\f4d3\"; }\n\n.ion-ios-world-outline:before {\n  content: \"\\f4d2\"; }\n\n.ion-ipad:before {\n  content: \"\\f1f9\"; }\n\n.ion-iphone:before {\n  content: \"\\f1fa\"; }\n\n.ion-ipod:before {\n  content: \"\\f1fb\"; }\n\n.ion-jet:before {\n  content: \"\\f295\"; }\n\n.ion-key:before {\n  content: \"\\f296\"; }\n\n.ion-knife:before {\n  content: \"\\f297\"; }\n\n.ion-laptop:before {\n  content: \"\\f1fc\"; }\n\n.ion-leaf:before {\n  content: \"\\f1fd\"; }\n\n.ion-levels:before {\n  content: \"\\f298\"; }\n\n.ion-lightbulb:before {\n  content: \"\\f299\"; }\n\n.ion-link:before {\n  content: \"\\f1fe\"; }\n\n.ion-load-a:before {\n  content: \"\\f29a\"; }\n\n.ion-load-b:before {\n  content: \"\\f29b\"; }\n\n.ion-load-c:before {\n  content: \"\\f29c\"; }\n\n.ion-load-d:before {\n  content: \"\\f29d\"; }\n\n.ion-location:before {\n  content: \"\\f1ff\"; }\n\n.ion-lock-combination:before {\n  content: \"\\f4d4\"; }\n\n.ion-locked:before {\n  content: \"\\f200\"; }\n\n.ion-log-in:before {\n  content: \"\\f29e\"; }\n\n.ion-log-out:before {\n  content: \"\\f29f\"; }\n\n.ion-loop:before {\n  content: \"\\f201\"; }\n\n.ion-magnet:before {\n  content: \"\\f2a0\"; }\n\n.ion-male:before {\n  content: \"\\f2a1\"; }\n\n.ion-man:before {\n  content: \"\\f202\"; }\n\n.ion-map:before {\n  content: \"\\f203\"; }\n\n.ion-medkit:before {\n  content: \"\\f2a2\"; }\n\n.ion-merge:before {\n  content: \"\\f33f\"; }\n\n.ion-mic-a:before {\n  content: \"\\f204\"; }\n\n.ion-mic-b:before {\n  content: \"\\f205\"; }\n\n.ion-mic-c:before {\n  content: \"\\f206\"; }\n\n.ion-minus:before {\n  content: \"\\f209\"; }\n\n.ion-minus-circled:before {\n  content: \"\\f207\"; }\n\n.ion-minus-round:before {\n  content: \"\\f208\"; }\n\n.ion-model-s:before {\n  content: \"\\f2c1\"; }\n\n.ion-monitor:before {\n  content: \"\\f20a\"; }\n\n.ion-more:before {\n  content: \"\\f20b\"; }\n\n.ion-mouse:before {\n  content: \"\\f340\"; }\n\n.ion-music-note:before {\n  content: \"\\f20c\"; }\n\n.ion-navicon:before {\n  content: \"\\f20e\"; }\n\n.ion-navicon-round:before {\n  content: \"\\f20d\"; }\n\n.ion-navigate:before {\n  content: \"\\f2a3\"; }\n\n.ion-network:before {\n  content: \"\\f341\"; }\n\n.ion-no-smoking:before {\n  content: \"\\f2c2\"; }\n\n.ion-nuclear:before {\n  content: \"\\f2a4\"; }\n\n.ion-outlet:before {\n  content: \"\\f342\"; }\n\n.ion-paintbrush:before {\n  content: \"\\f4d5\"; }\n\n.ion-paintbucket:before {\n  content: \"\\f4d6\"; }\n\n.ion-paper-airplane:before {\n  content: \"\\f2c3\"; }\n\n.ion-paperclip:before {\n  content: \"\\f20f\"; }\n\n.ion-pause:before {\n  content: \"\\f210\"; }\n\n.ion-person:before {\n  content: \"\\f213\"; }\n\n.ion-person-add:before {\n  content: \"\\f211\"; }\n\n.ion-person-stalker:before {\n  content: \"\\f212\"; }\n\n.ion-pie-graph:before {\n  content: \"\\f2a5\"; }\n\n.ion-pin:before {\n  content: \"\\f2a6\"; }\n\n.ion-pinpoint:before {\n  content: \"\\f2a7\"; }\n\n.ion-pizza:before {\n  content: \"\\f2a8\"; }\n\n.ion-plane:before {\n  content: \"\\f214\"; }\n\n.ion-planet:before {\n  content: \"\\f343\"; }\n\n.ion-play:before {\n  content: \"\\f215\"; }\n\n.ion-playstation:before {\n  content: \"\\f30a\"; }\n\n.ion-plus:before {\n  content: \"\\f218\"; }\n\n.ion-plus-circled:before {\n  content: \"\\f216\"; }\n\n.ion-plus-round:before {\n  content: \"\\f217\"; }\n\n.ion-podium:before {\n  content: \"\\f344\"; }\n\n.ion-pound:before {\n  content: \"\\f219\"; }\n\n.ion-power:before {\n  content: \"\\f2a9\"; }\n\n.ion-pricetag:before {\n  content: \"\\f2aa\"; }\n\n.ion-pricetags:before {\n  content: \"\\f2ab\"; }\n\n.ion-printer:before {\n  content: \"\\f21a\"; }\n\n.ion-pull-request:before {\n  content: \"\\f345\"; }\n\n.ion-qr-scanner:before {\n  content: \"\\f346\"; }\n\n.ion-quote:before {\n  content: \"\\f347\"; }\n\n.ion-radio-waves:before {\n  content: \"\\f2ac\"; }\n\n.ion-record:before {\n  content: \"\\f21b\"; }\n\n.ion-refresh:before {\n  content: \"\\f21c\"; }\n\n.ion-reply:before {\n  content: \"\\f21e\"; }\n\n.ion-reply-all:before {\n  content: \"\\f21d\"; }\n\n.ion-ribbon-a:before {\n  content: \"\\f348\"; }\n\n.ion-ribbon-b:before {\n  content: \"\\f349\"; }\n\n.ion-sad:before {\n  content: \"\\f34a\"; }\n\n.ion-sad-outline:before {\n  content: \"\\f4d7\"; }\n\n.ion-scissors:before {\n  content: \"\\f34b\"; }\n\n.ion-search:before {\n  content: \"\\f21f\"; }\n\n.ion-settings:before {\n  content: \"\\f2ad\"; }\n\n.ion-share:before {\n  content: \"\\f220\"; }\n\n.ion-shuffle:before {\n  content: \"\\f221\"; }\n\n.ion-skip-backward:before {\n  content: \"\\f222\"; }\n\n.ion-skip-forward:before {\n  content: \"\\f223\"; }\n\n.ion-social-android:before {\n  content: \"\\f225\"; }\n\n.ion-social-android-outline:before {\n  content: \"\\f224\"; }\n\n.ion-social-angular:before {\n  content: \"\\f4d9\"; }\n\n.ion-social-angular-outline:before {\n  content: \"\\f4d8\"; }\n\n.ion-social-apple:before {\n  content: \"\\f227\"; }\n\n.ion-social-apple-outline:before {\n  content: \"\\f226\"; }\n\n.ion-social-bitcoin:before {\n  content: \"\\f2af\"; }\n\n.ion-social-bitcoin-outline:before {\n  content: \"\\f2ae\"; }\n\n.ion-social-buffer:before {\n  content: \"\\f229\"; }\n\n.ion-social-buffer-outline:before {\n  content: \"\\f228\"; }\n\n.ion-social-chrome:before {\n  content: \"\\f4db\"; }\n\n.ion-social-chrome-outline:before {\n  content: \"\\f4da\"; }\n\n.ion-social-codepen:before {\n  content: \"\\f4dd\"; }\n\n.ion-social-codepen-outline:before {\n  content: \"\\f4dc\"; }\n\n.ion-social-css3:before {\n  content: \"\\f4df\"; }\n\n.ion-social-css3-outline:before {\n  content: \"\\f4de\"; }\n\n.ion-social-designernews:before {\n  content: \"\\f22b\"; }\n\n.ion-social-designernews-outline:before {\n  content: \"\\f22a\"; }\n\n.ion-social-dribbble:before {\n  content: \"\\f22d\"; }\n\n.ion-social-dribbble-outline:before {\n  content: \"\\f22c\"; }\n\n.ion-social-dropbox:before {\n  content: \"\\f22f\"; }\n\n.ion-social-dropbox-outline:before {\n  content: \"\\f22e\"; }\n\n.ion-social-euro:before {\n  content: \"\\f4e1\"; }\n\n.ion-social-euro-outline:before {\n  content: \"\\f4e0\"; }\n\n.ion-social-facebook:before {\n  content: \"\\f231\"; }\n\n.ion-social-facebook-outline:before {\n  content: \"\\f230\"; }\n\n.ion-social-foursquare:before {\n  content: \"\\f34d\"; }\n\n.ion-social-foursquare-outline:before {\n  content: \"\\f34c\"; }\n\n.ion-social-freebsd-devil:before {\n  content: \"\\f2c4\"; }\n\n.ion-social-github:before {\n  content: \"\\f233\"; }\n\n.ion-social-github-outline:before {\n  content: \"\\f232\"; }\n\n.ion-social-google:before {\n  content: \"\\f34f\"; }\n\n.ion-social-google-outline:before {\n  content: \"\\f34e\"; }\n\n.ion-social-googleplus:before {\n  content: \"\\f235\"; }\n\n.ion-social-googleplus-outline:before {\n  content: \"\\f234\"; }\n\n.ion-social-hackernews:before {\n  content: \"\\f237\"; }\n\n.ion-social-hackernews-outline:before {\n  content: \"\\f236\"; }\n\n.ion-social-html5:before {\n  content: \"\\f4e3\"; }\n\n.ion-social-html5-outline:before {\n  content: \"\\f4e2\"; }\n\n.ion-social-instagram:before {\n  content: \"\\f351\"; }\n\n.ion-social-instagram-outline:before {\n  content: \"\\f350\"; }\n\n.ion-social-javascript:before {\n  content: \"\\f4e5\"; }\n\n.ion-social-javascript-outline:before {\n  content: \"\\f4e4\"; }\n\n.ion-social-linkedin:before {\n  content: \"\\f239\"; }\n\n.ion-social-linkedin-outline:before {\n  content: \"\\f238\"; }\n\n.ion-social-markdown:before {\n  content: \"\\f4e6\"; }\n\n.ion-social-nodejs:before {\n  content: \"\\f4e7\"; }\n\n.ion-social-octocat:before {\n  content: \"\\f4e8\"; }\n\n.ion-social-pinterest:before {\n  content: \"\\f2b1\"; }\n\n.ion-social-pinterest-outline:before {\n  content: \"\\f2b0\"; }\n\n.ion-social-python:before {\n  content: \"\\f4e9\"; }\n\n.ion-social-reddit:before {\n  content: \"\\f23b\"; }\n\n.ion-social-reddit-outline:before {\n  content: \"\\f23a\"; }\n\n.ion-social-rss:before {\n  content: \"\\f23d\"; }\n\n.ion-social-rss-outline:before {\n  content: \"\\f23c\"; }\n\n.ion-social-sass:before {\n  content: \"\\f4ea\"; }\n\n.ion-social-skype:before {\n  content: \"\\f23f\"; }\n\n.ion-social-skype-outline:before {\n  content: \"\\f23e\"; }\n\n.ion-social-snapchat:before {\n  content: \"\\f4ec\"; }\n\n.ion-social-snapchat-outline:before {\n  content: \"\\f4eb\"; }\n\n.ion-social-tumblr:before {\n  content: \"\\f241\"; }\n\n.ion-social-tumblr-outline:before {\n  content: \"\\f240\"; }\n\n.ion-social-tux:before {\n  content: \"\\f2c5\"; }\n\n.ion-social-twitch:before {\n  content: \"\\f4ee\"; }\n\n.ion-social-twitch-outline:before {\n  content: \"\\f4ed\"; }\n\n.ion-social-twitter:before {\n  content: \"\\f243\"; }\n\n.ion-social-twitter-outline:before {\n  content: \"\\f242\"; }\n\n.ion-social-usd:before {\n  content: \"\\f353\"; }\n\n.ion-social-usd-outline:before {\n  content: \"\\f352\"; }\n\n.ion-social-vimeo:before {\n  content: \"\\f245\"; }\n\n.ion-social-vimeo-outline:before {\n  content: \"\\f244\"; }\n\n.ion-social-whatsapp:before {\n  content: \"\\f4f0\"; }\n\n.ion-social-whatsapp-outline:before {\n  content: \"\\f4ef\"; }\n\n.ion-social-windows:before {\n  content: \"\\f247\"; }\n\n.ion-social-windows-outline:before {\n  content: \"\\f246\"; }\n\n.ion-social-wordpress:before {\n  content: \"\\f249\"; }\n\n.ion-social-wordpress-outline:before {\n  content: \"\\f248\"; }\n\n.ion-social-yahoo:before {\n  content: \"\\f24b\"; }\n\n.ion-social-yahoo-outline:before {\n  content: \"\\f24a\"; }\n\n.ion-social-yen:before {\n  content: \"\\f4f2\"; }\n\n.ion-social-yen-outline:before {\n  content: \"\\f4f1\"; }\n\n.ion-social-youtube:before {\n  content: \"\\f24d\"; }\n\n.ion-social-youtube-outline:before {\n  content: \"\\f24c\"; }\n\n.ion-soup-can:before {\n  content: \"\\f4f4\"; }\n\n.ion-soup-can-outline:before {\n  content: \"\\f4f3\"; }\n\n.ion-speakerphone:before {\n  content: \"\\f2b2\"; }\n\n.ion-speedometer:before {\n  content: \"\\f2b3\"; }\n\n.ion-spoon:before {\n  content: \"\\f2b4\"; }\n\n.ion-star:before {\n  content: \"\\f24e\"; }\n\n.ion-stats-bars:before {\n  content: \"\\f2b5\"; }\n\n.ion-steam:before {\n  content: \"\\f30b\"; }\n\n.ion-stop:before {\n  content: \"\\f24f\"; }\n\n.ion-thermometer:before {\n  content: \"\\f2b6\"; }\n\n.ion-thumbsdown:before {\n  content: \"\\f250\"; }\n\n.ion-thumbsup:before {\n  content: \"\\f251\"; }\n\n.ion-toggle:before {\n  content: \"\\f355\"; }\n\n.ion-toggle-filled:before {\n  content: \"\\f354\"; }\n\n.ion-transgender:before {\n  content: \"\\f4f5\"; }\n\n.ion-trash-a:before {\n  content: \"\\f252\"; }\n\n.ion-trash-b:before {\n  content: \"\\f253\"; }\n\n.ion-trophy:before {\n  content: \"\\f356\"; }\n\n.ion-tshirt:before {\n  content: \"\\f4f7\"; }\n\n.ion-tshirt-outline:before {\n  content: \"\\f4f6\"; }\n\n.ion-umbrella:before {\n  content: \"\\f2b7\"; }\n\n.ion-university:before {\n  content: \"\\f357\"; }\n\n.ion-unlocked:before {\n  content: \"\\f254\"; }\n\n.ion-upload:before {\n  content: \"\\f255\"; }\n\n.ion-usb:before {\n  content: \"\\f2b8\"; }\n\n.ion-videocamera:before {\n  content: \"\\f256\"; }\n\n.ion-volume-high:before {\n  content: \"\\f257\"; }\n\n.ion-volume-low:before {\n  content: \"\\f258\"; }\n\n.ion-volume-medium:before {\n  content: \"\\f259\"; }\n\n.ion-volume-mute:before {\n  content: \"\\f25a\"; }\n\n.ion-wand:before {\n  content: \"\\f358\"; }\n\n.ion-waterdrop:before {\n  content: \"\\f25b\"; }\n\n.ion-wifi:before {\n  content: \"\\f25c\"; }\n\n.ion-wineglass:before {\n  content: \"\\f2b9\"; }\n\n.ion-woman:before {\n  content: \"\\f25d\"; }\n\n.ion-wrench:before {\n  content: \"\\f2ba\"; }\n\n.ion-xbox:before {\n  content: \"\\f30c\"; }\n\n/**\n * Resets\n * --------------------------------------------------\n * Adapted from normalize.css and some reset.css. We don't care even one\n * bit about old IE, so we don't need any hacks for that in here.\n *\n * There are probably other things we could remove here, as well.\n *\n * normalize.css v2.1.2 | MIT License | git.io/normalize\n\n * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)\n * http://cssreset.com\n */\nhtml, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, i, u, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, fieldset, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  vertical-align: baseline;\n  font: inherit;\n  font-size: 100%; }\n\nol, ul {\n  list-style: none; }\n\nblockquote, q {\n  quotes: none; }\n\nblockquote:before, blockquote:after, q:before, q:after {\n  content: '';\n  content: none; }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\naudio:not([controls]) {\n  display: none;\n  height: 0; }\n\n/**\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n[hidden], template {\n  display: none; }\n\nscript {\n  display: none !important; }\n\n/* ==========================================================================\n   Base\n   ========================================================================== */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *  user zoom.\n */\nhtml {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  font-family: sans-serif;\n  /* 1 */\n  -webkit-text-size-adjust: 100%;\n  -ms-text-size-adjust: 100%;\n  /* 2 */\n  -webkit-text-size-adjust: 100%;\n  /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n  margin: 0;\n  line-height: 1; }\n\n/**\n * Remove default outlines.\n */\na, button, :focus, a:focus, button:focus, a:active, a:hover {\n  outline: 0; }\n\n/* *\n * Remove tap highlight color\n */\na {\n  -webkit-user-drag: none;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-tap-highlight-color: transparent; }\n  a[href]:hover {\n    cursor: pointer; }\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\nb, strong {\n  font-weight: bold; }\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\ndfn {\n  font-style: italic; }\n\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0; }\n\n/**\n * Correct font family set oddly in Safari 5 and Chrome.\n */\ncode, kbd, pre, samp {\n  font-size: 1em;\n  font-family: monospace, serif; }\n\n/**\n * Improve readability of pre-formatted text in all browsers.\n */\npre {\n  white-space: pre-wrap; }\n\n/**\n * Set consistent quote types.\n */\nq {\n  quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\"; }\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n  font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub, sup {\n  position: relative;\n  vertical-align: baseline;\n  font-size: 75%;\n  line-height: 0; }\n\nsup {\n  top: -0.5em; }\n\nsub {\n  bottom: -0.25em; }\n\n/**\n * Define consistent border, margin, and padding.\n */\nfieldset {\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n  border: 1px solid #c0c0c0; }\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n  padding: 0;\n  /* 2 */\n  border: 0;\n  /* 1 */ }\n\n/**\n * 1. Correct font family not being inherited in all browsers.\n * 2. Correct font size not being inherited in all browsers.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n * 4. Remove any default :focus styles\n * 5. Make sure webkit font smoothing is being inherited\n * 6. Remove default gradient in Android Firefox / FirefoxOS\n */\nbutton, input, select, textarea {\n  margin: 0;\n  /* 3 */\n  font-size: 100%;\n  /* 2 */\n  font-family: inherit;\n  /* 1 */\n  outline-offset: 0;\n  /* 4 */\n  outline-style: none;\n  /* 4 */\n  outline-width: 0;\n  /* 4 */\n  -webkit-font-smoothing: inherit;\n  /* 5 */\n  background-image: none;\n  /* 6 */ }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `importnt` in\n * the UA stylesheet.\n */\nbutton, input {\n  line-height: normal; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.\n * Correct `select` style inheritance in Firefox 4+ and Opera.\n */\nbutton, select {\n  text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *  and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *  `input` and others.\n */\nbutton, html input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"] {\n  cursor: pointer;\n  /* 3 */\n  -webkit-appearance: button;\n  /* 2 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled], html input[disabled] {\n  cursor: default; }\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n *  (include `-moz` to future-proof).\n */\ninput[type=\"search\"] {\n  -webkit-box-sizing: content-box;\n  /* 2 */\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  -webkit-appearance: textfield;\n  /* 1 */ }\n\n/**\n * Remove inner padding and search cancel button in Safari 5 and Chrome\n * on OS X.\n */\ninput[type=\"search\"]::-webkit-search-cancel-button, input[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner, input::-moz-focus-inner {\n  padding: 0;\n  border: 0; }\n\n/**\n * 1. Remove default vertical scrollbar in IE 8/9.\n * 2. Improve readability and alignment in all browsers.\n */\ntextarea {\n  overflow: auto;\n  /* 1 */\n  vertical-align: top;\n  /* 2 */ }\n\nimg {\n  -webkit-user-drag: none; }\n\n/* ==========================================================================\n   Tables\n   ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n  border-spacing: 0;\n  border-collapse: collapse; }\n\n/**\n * Scaffolding\n * --------------------------------------------------\n */\n*, *:before, *:after {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box; }\n\nhtml {\n  overflow: hidden;\n  -ms-touch-action: pan-y;\n  touch-action: pan-y; }\n\nbody, .ionic-body {\n  -webkit-touch-callout: none;\n  -webkit-font-smoothing: antialiased;\n  font-smoothing: antialiased;\n  -webkit-text-size-adjust: none;\n  -moz-text-size-adjust: none;\n  text-size-adjust: none;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  margin: 0;\n  padding: 0;\n  color: #000;\n  word-wrap: break-word;\n  font-size: 14px;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  line-height: 20px;\n  text-rendering: optimizeLegibility;\n  -webkit-backface-visibility: hidden;\n  -webkit-user-drag: none;\n  -ms-content-zooming: none; }\n\nbody.grade-b, body.grade-c {\n  text-rendering: auto; }\n\n.content {\n  position: relative; }\n\n.scroll-content {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  margin-top: -1px;\n  padding-top: 1px;\n  margin-bottom: -1px;\n  width: auto;\n  height: auto; }\n\n.menu .scroll-content.scroll-content-false {\n  z-index: 11; }\n\n.scroll-view {\n  position: relative;\n  display: block;\n  overflow: hidden;\n  margin-top: -1px; }\n\n/**\n * Scroll is the scroll view component available for complex and custom\n * scroll view functionality.\n */\n.scroll {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-text-size-adjust: none;\n  -moz-text-size-adjust: none;\n  text-size-adjust: none;\n  -webkit-transform-origin: left top;\n  transform-origin: left top; }\n\n/**\n * Set ms-viewport to prevent MS \"page squish\" and allow fluid scrolling\n * https://msdn.microsoft.com/en-us/library/ie/hh869615(v=vs.85).aspx\n */\n@-ms-viewport {\n  width: device-width; }\n\n.scroll-bar {\n  position: absolute;\n  z-index: 9999; }\n\n.ng-animate .scroll-bar {\n  visibility: hidden; }\n\n.scroll-bar-h {\n  right: 2px;\n  bottom: 3px;\n  left: 2px;\n  height: 3px; }\n  .scroll-bar-h .scroll-bar-indicator {\n    height: 100%; }\n\n.scroll-bar-v {\n  top: 2px;\n  right: 3px;\n  bottom: 2px;\n  width: 3px; }\n  .scroll-bar-v .scroll-bar-indicator {\n    width: 100%; }\n\n.scroll-bar-indicator {\n  position: absolute;\n  border-radius: 4px;\n  background: rgba(0, 0, 0, 0.3);\n  opacity: 1;\n  -webkit-transition: opacity .3s linear;\n  transition: opacity .3s linear; }\n  .scroll-bar-indicator.scroll-bar-fade-out {\n    opacity: 0; }\n\n.platform-android .scroll-bar-indicator {\n  border-radius: 0; }\n\n.grade-b .scroll-bar-indicator, .grade-c .scroll-bar-indicator {\n  background: #aaa; }\n  .grade-b .scroll-bar-indicator.scroll-bar-fade-out, .grade-c .scroll-bar-indicator.scroll-bar-fade-out {\n    -webkit-transition: none;\n    transition: none; }\n\nion-infinite-scroll {\n  height: 60px;\n  width: 100%;\n  display: block;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -moz-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center; }\n  ion-infinite-scroll .icon {\n    color: #666666;\n    font-size: 30px;\n    color: #666666; }\n  ion-infinite-scroll .icon:before, ion-infinite-scroll .spinner {\n    -webkit-transform: translate3d(0, 0, 0);\n    transform: translate3d(0, 0, 0); }\n  ion-infinite-scroll:not(.active) .spinner, ion-infinite-scroll:not(.active) .icon:before {\n    -webkit-transform: translate3d(-1000px, 0, 0);\n    transform: translate3d(-1000px, 0, 0); }\n\n.overflow-scroll {\n  overflow-x: hidden;\n  overflow-y: scroll;\n  -webkit-overflow-scrolling: touch;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  position: absolute; }\n  .overflow-scroll .scroll {\n    position: static;\n    height: 100%;\n    -webkit-transform: translate3d(0, 0, 0); }\n\n/* If you change these, change platform.scss as well */\n.has-header {\n  top: 44px; }\n\n.no-header {\n  top: 0; }\n\n.has-subheader {\n  top: 88px; }\n\n.has-tabs-top {\n  top: 93px; }\n\n.has-header.has-subheader.has-tabs-top {\n  top: 137px; }\n\n.has-footer {\n  bottom: 44px; }\n\n.has-subfooter {\n  bottom: 88px; }\n\n.has-tabs, .bar-footer.has-tabs {\n  bottom: 49px; }\n  .has-tabs.pane, .bar-footer.has-tabs.pane {\n    bottom: 49px;\n    height: auto; }\n\n.has-footer.has-tabs {\n  bottom: 93px; }\n\n.pane {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  -webkit-transition-duration: 0;\n  transition-duration: 0;\n  z-index: 1; }\n\n.view {\n  z-index: 1; }\n\n.pane, .view {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #fff;\n  overflow: hidden; }\n\n.view-container {\n  position: absolute;\n  display: block;\n  width: 100%;\n  height: 100%; }\n\n/**\n * Typography\n * --------------------------------------------------\n */\np {\n  margin: 0 0 10px; }\n\nsmall {\n  font-size: 85%; }\n\ncite {\n  font-style: normal; }\n\n.text-left {\n  text-align: left; }\n\n.text-right {\n  text-align: right; }\n\n.text-center {\n  text-align: center; }\n\nh1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {\n  color: #000;\n  font-weight: 500;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  line-height: 1.2; }\n  h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small {\n    font-weight: normal;\n    line-height: 1; }\n\nh1, .h1, h2, .h2, h3, .h3 {\n  margin-top: 20px;\n  margin-bottom: 10px; }\n  h1:first-child, .h1:first-child, h2:first-child, .h2:first-child, h3:first-child, .h3:first-child {\n    margin-top: 0; }\n  h1 + h1, h1 + .h1, h1 + h2, h1 + .h2, h1 + h3, h1 + .h3, .h1 + h1, .h1 + .h1, .h1 + h2, .h1 + .h2, .h1 + h3, .h1 + .h3, h2 + h1, h2 + .h1, h2 + h2, h2 + .h2, h2 + h3, h2 + .h3, .h2 + h1, .h2 + .h1, .h2 + h2, .h2 + .h2, .h2 + h3, .h2 + .h3, h3 + h1, h3 + .h1, h3 + h2, h3 + .h2, h3 + h3, h3 + .h3, .h3 + h1, .h3 + .h1, .h3 + h2, .h3 + .h2, .h3 + h3, .h3 + .h3 {\n    margin-top: 10px; }\n\nh4, .h4, h5, .h5, h6, .h6 {\n  margin-top: 10px;\n  margin-bottom: 10px; }\n\nh1, .h1 {\n  font-size: 36px; }\n\nh2, .h2 {\n  font-size: 30px; }\n\nh3, .h3 {\n  font-size: 24px; }\n\nh4, .h4 {\n  font-size: 18px; }\n\nh5, .h5 {\n  font-size: 14px; }\n\nh6, .h6 {\n  font-size: 12px; }\n\nh1 small, .h1 small {\n  font-size: 24px; }\n\nh2 small, .h2 small {\n  font-size: 18px; }\n\nh3 small, .h3 small, h4 small, .h4 small {\n  font-size: 14px; }\n\ndl {\n  margin-bottom: 20px; }\n\ndt, dd {\n  line-height: 1.42857; }\n\ndt {\n  font-weight: bold; }\n\nblockquote {\n  margin: 0 0 20px;\n  padding: 10px 20px;\n  border-left: 5px solid gray; }\n  blockquote p {\n    font-weight: 300;\n    font-size: 17.5px;\n    line-height: 1.25; }\n  blockquote p:last-child {\n    margin-bottom: 0; }\n  blockquote small {\n    display: block;\n    line-height: 1.42857; }\n    blockquote small:before {\n      content: '\\2014 \\00A0'; }\n\nq:before, q:after, blockquote:before, blockquote:after {\n  content: \"\"; }\n\naddress {\n  display: block;\n  margin-bottom: 20px;\n  font-style: normal;\n  line-height: 1.42857; }\n\na.subdued {\n  padding-right: 10px;\n  color: #888;\n  text-decoration: none; }\n  a.subdued:hover {\n    text-decoration: none; }\n  a.subdued:last-child {\n    padding-right: 0; }\n\n/**\n * Action Sheets\n * --------------------------------------------------\n */\n.action-sheet-backdrop {\n  -webkit-transition: background-color 150ms ease-in-out;\n  transition: background-color 150ms ease-in-out;\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 11;\n  width: 100%;\n  height: 100%;\n  background-color: transparent; }\n  .action-sheet-backdrop.active {\n    background-color: rgba(0, 0, 0, 0.4); }\n\n.action-sheet-wrapper {\n  -webkit-transform: translate3d(0, 100%, 0);\n  transform: translate3d(0, 100%, 0);\n  -webkit-transition: all cubic-bezier(.36, .66, .04, 1) 500ms;\n  transition: all cubic-bezier(.36, .66, .04, 1) 500ms;\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  width: 100%;\n  max-width: 500px;\n  margin: auto; }\n\n.action-sheet-up {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0); }\n\n.action-sheet {\n  margin-left: 8px;\n  margin-right: 8px;\n  width: auto;\n  z-index: 11;\n  overflow: hidden; }\n  .action-sheet .button {\n    display: block;\n    padding: 1px;\n    width: 100%;\n    border-radius: 0;\n    border-color: #d1d3d6;\n    background-color: transparent;\n    color: #007aff;\n    font-size: 21px; }\n    .action-sheet .button:hover {\n      color: #007aff; }\n    .action-sheet .button.destructive {\n      color: #ff3b30; }\n      .action-sheet .button.destructive:hover {\n        color: #ff3b30; }\n  .action-sheet .button.active, .action-sheet .button.activated {\n    box-shadow: none;\n    border-color: #d1d3d6;\n    color: #007aff;\n    background: #e4e5e7; }\n\n.action-sheet-has-icons .icon {\n  position: absolute;\n  left: 16px; }\n\n.action-sheet-title {\n  padding: 16px;\n  color: #8f8f8f;\n  text-align: center;\n  font-size: 13px; }\n\n.action-sheet-group {\n  margin-bottom: 8px;\n  border-radius: 4px;\n  background-color: #fff;\n  overflow: hidden; }\n  .action-sheet-group .button {\n    border-width: 1px 0px 0px 0px; }\n  .action-sheet-group .button:first-child:last-child {\n    border-width: 0; }\n\n.action-sheet-options {\n  background: #f1f2f3; }\n\n.action-sheet-cancel .button {\n  font-weight: 500; }\n\n.action-sheet-open {\n  pointer-events: none; }\n  .action-sheet-open.modal-open .modal {\n    pointer-events: none; }\n  .action-sheet-open .action-sheet-backdrop {\n    pointer-events: auto; }\n\n.platform-android .action-sheet-backdrop.active {\n  background-color: rgba(0, 0, 0, 0.2); }\n.platform-android .action-sheet {\n  margin: 0; }\n  .platform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {\n    text-align: left;\n    border-color: transparent;\n    font-size: 16px;\n    color: inherit; }\n  .platform-android .action-sheet .action-sheet-title {\n    font-size: 14px;\n    padding: 16px;\n    color: #666; }\n  .platform-android .action-sheet .button.active, .platform-android .action-sheet .button.activated {\n    background: #e8e8e8; }\n.platform-android .action-sheet-group {\n  margin: 0;\n  border-radius: 0;\n  background-color: #fafafa; }\n.platform-android .action-sheet-cancel {\n  display: none; }\n.platform-android .action-sheet-has-icons .button {\n  padding-left: 56px; }\n\n.backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 11;\n  width: 100%;\n  height: 100%;\n  background-color: rgba(0, 0, 0, 0.4);\n  visibility: hidden;\n  opacity: 0;\n  -webkit-transition: 0.1s opacity linear;\n  transition: 0.1s opacity linear; }\n  .backdrop.visible {\n    visibility: visible; }\n  .backdrop.active {\n    opacity: 1; }\n\n/**\n * Bar (Headers and Footers)\n * --------------------------------------------------\n */\n.bar {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  position: absolute;\n  right: 0;\n  left: 0;\n  z-index: 9;\n  box-sizing: border-box;\n  padding: 5px;\n  width: 100%;\n  height: 44px;\n  border-width: 0;\n  border-style: solid;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid #ddd;\n  background-color: white;\n  /* border-width: 1px will actually create 2 device pixels on retina */\n  /* this nifty trick sets an actual 1px border on hi-res displays */\n  background-size: 0; }\n  @media (min--moz-device-pixel-ratio: 1.5), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx) {\n    .bar {\n      border: none;\n      background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n      background-position: bottom;\n      background-size: 100% 1px;\n      background-repeat: no-repeat; } }\n  .bar.bar-clear {\n    border: none;\n    background: none;\n    color: #fff; }\n    .bar.bar-clear .button {\n      color: #fff; }\n    .bar.bar-clear .title {\n      color: #fff; }\n  .bar.item-input-inset .item-input-wrapper {\n    margin-top: -1px; }\n    .bar.item-input-inset .item-input-wrapper input {\n      padding-left: 8px;\n      width: 94%;\n      height: 28px;\n      background: transparent; }\n  .bar.bar-light {\n    border-color: #ddd;\n    background-color: white;\n    background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n    color: #444; }\n    .bar.bar-light .title {\n      color: #444; }\n    .bar.bar-light.bar-footer {\n      background-image: linear-gradient(180deg, #ddd, #ddd 50%, transparent 50%); }\n  .bar.bar-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n    color: #444; }\n    .bar.bar-stable .title {\n      color: #444; }\n    .bar.bar-stable.bar-footer {\n      background-image: linear-gradient(180deg, #b2b2b2, #b2b2b2 50%, transparent 50%); }\n  .bar.bar-positive {\n    border-color: #0c60ee;\n    background-color: #387ef5;\n    background-image: linear-gradient(0deg, #0c60ee, #0c60ee 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-positive .title {\n      color: #fff; }\n    .bar.bar-positive.bar-footer {\n      background-image: linear-gradient(180deg, #0c60ee, #0c60ee 50%, transparent 50%); }\n  .bar.bar-calm {\n    border-color: #0a9dc7;\n    background-color: #11c1f3;\n    background-image: linear-gradient(0deg, #0a9dc7, #0a9dc7 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-calm .title {\n      color: #fff; }\n    .bar.bar-calm.bar-footer {\n      background-image: linear-gradient(180deg, #0a9dc7, #0a9dc7 50%, transparent 50%); }\n  .bar.bar-assertive {\n    border-color: #e42112;\n    background-color: #ef473a;\n    background-image: linear-gradient(0deg, #e42112, #e42112 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-assertive .title {\n      color: #fff; }\n    .bar.bar-assertive.bar-footer {\n      background-image: linear-gradient(180deg, #e42112, #e42112 50%, transparent 50%); }\n  .bar.bar-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-balanced .title {\n      color: #fff; }\n    .bar.bar-balanced.bar-footer {\n      background-image: linear-gradient(180deg, #28a54c, #0c60ee 50%, transparent 50%); }\n  .bar.bar-energized {\n    border-color: #e6b500;\n    background-color: #ffc900;\n    background-image: linear-gradient(0deg, #e6b500, #e6b500 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-energized .title {\n      color: #fff; }\n    .bar.bar-energized.bar-footer {\n      background-image: linear-gradient(180deg, #e6b500, #e6b500 50%, transparent 50%); }\n  .bar.bar-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-royal .title {\n      color: #fff; }\n    .bar.bar-royal.bar-footer {\n      background-image: linear-gradient(180deg, #6b46e5, #6b46e5 50%, transparent 50%); }\n  .bar.bar-dark {\n    border-color: #111;\n    background-color: #444444;\n    background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-dark .title {\n      color: #fff; }\n    .bar.bar-dark.bar-footer {\n      background-image: linear-gradient(180deg, #111, #111 50%, transparent 50%); }\n  .bar .title {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 0;\n    z-index: 0;\n    overflow: hidden;\n    margin: 0 10px;\n    min-width: 30px;\n    height: 43px;\n    text-align: center;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    font-size: 17px;\n    font-weight: 500;\n    line-height: 44px; }\n    .bar .title.title-left {\n      text-align: left; }\n    .bar .title.title-right {\n      text-align: right; }\n  .bar .title a {\n    color: inherit; }\n  .bar .button {\n    z-index: 1;\n    padding: 0 8px;\n    min-width: initial;\n    min-height: 31px;\n    font-weight: 400;\n    font-size: 13px;\n    line-height: 32px; }\n    .bar .button.button-icon:before, .bar .button .icon:before, .bar .button.icon:before, .bar .button.icon-left:before, .bar .button.icon-right:before {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-size: 20px;\n      line-height: 32px; }\n    .bar .button.button-icon {\n      font-size: 17px; }\n      .bar .button.button-icon .icon:before, .bar .button.button-icon:before, .bar .button.button-icon.icon-left:before, .bar .button.button-icon.icon-right:before {\n        vertical-align: top;\n        font-size: 32px;\n        line-height: 32px; }\n    .bar .button.button-clear {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-weight: 300;\n      font-size: 17px; }\n      .bar .button.button-clear .icon:before, .bar .button.button-clear.icon:before, .bar .button.button-clear.icon-left:before, .bar .button.button-clear.icon-right:before {\n        font-size: 32px;\n        line-height: 32px; }\n    .bar .button.back-button {\n      display: block;\n      margin-right: 5px;\n      padding: 0;\n      white-space: nowrap;\n      font-weight: 400; }\n    .bar .button.back-button.active, .bar .button.back-button.activated {\n      opacity: 0.2; }\n  .bar .button-bar > .button, .bar .buttons > .button {\n    min-height: 31px;\n    line-height: 32px; }\n  .bar .button-bar + .button, .bar .button + .button-bar {\n    margin-left: 5px; }\n  .bar .buttons, .bar .buttons.primary-buttons, .bar .buttons.secondary-buttons {\n    display: inherit; }\n  .bar .buttons span {\n    display: inline-block; }\n  .bar .buttons-left span {\n    margin-right: 5px;\n    display: inherit; }\n  .bar .buttons-right span {\n    margin-left: 5px;\n    display: inherit; }\n  .bar .title + .button:last-child, .bar > .button + .button:last-child, .bar > .button.pull-right, .bar .buttons.pull-right, .bar .title + .buttons {\n    position: absolute;\n    top: 5px;\n    right: 5px;\n    bottom: 5px; }\n\n.platform-android .nav-bar-has-subheader .bar {\n  background-image: none; }\n.platform-android .bar .back-button .icon:before {\n  font-size: 24px; }\n.platform-android .bar .title {\n  font-size: 19px;\n  line-height: 44px; }\n\n.bar-light .button {\n  border-color: #ddd;\n  background-color: white;\n  color: #444; }\n  .bar-light .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .bar-light .button.active, .bar-light .button.activated {\n    border-color: #ccc;\n    background-color: #fafafa;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-light .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #444;\n    font-size: 17px; }\n  .bar-light .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-stable .button {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444; }\n  .bar-stable .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .bar-stable .button.active, .bar-stable .button.activated {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-stable .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #444;\n    font-size: 17px; }\n  .bar-stable .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-positive .button {\n  border-color: #0c60ee;\n  background-color: #387ef5;\n  color: #fff; }\n  .bar-positive .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-positive .button.active, .bar-positive .button.activated {\n    border-color: #0c60ee;\n    background-color: #0c60ee;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-positive .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-positive .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-calm .button {\n  border-color: #0a9dc7;\n  background-color: #11c1f3;\n  color: #fff; }\n  .bar-calm .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-calm .button.active, .bar-calm .button.activated {\n    border-color: #0a9dc7;\n    background-color: #0a9dc7;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-calm .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-calm .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-assertive .button {\n  border-color: #e42112;\n  background-color: #ef473a;\n  color: #fff; }\n  .bar-assertive .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-assertive .button.active, .bar-assertive .button.activated {\n    border-color: #e42112;\n    background-color: #e42112;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-assertive .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-assertive .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-balanced .button {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  color: #fff; }\n  .bar-balanced .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-balanced .button.active, .bar-balanced .button.activated {\n    border-color: #28a54c;\n    background-color: #28a54c;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-balanced .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-balanced .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-energized .button {\n  border-color: #e6b500;\n  background-color: #ffc900;\n  color: #fff; }\n  .bar-energized .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-energized .button.active, .bar-energized .button.activated {\n    border-color: #e6b500;\n    background-color: #e6b500;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-energized .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-energized .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-royal .button {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  color: #fff; }\n  .bar-royal .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-royal .button.active, .bar-royal .button.activated {\n    border-color: #6b46e5;\n    background-color: #6b46e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-royal .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-royal .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-dark .button {\n  border-color: #111;\n  background-color: #444444;\n  color: #fff; }\n  .bar-dark .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-dark .button.active, .bar-dark .button.activated {\n    border-color: #000;\n    background-color: #262626;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-dark .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-dark .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-header {\n  top: 0;\n  border-top-width: 0;\n  border-bottom-width: 1px; }\n  .bar-header.has-tabs-top {\n    border-bottom-width: 0px;\n    background-image: none; }\n\n.tabs-top .bar-header {\n  border-bottom-width: 0px;\n  background-image: none; }\n\n.bar-footer {\n  bottom: 0;\n  border-top-width: 1px;\n  border-bottom-width: 0;\n  background-position: top;\n  height: 44px; }\n  .bar-footer.item-input-inset {\n    position: absolute; }\n\n.bar-tabs {\n  padding: 0; }\n\n.bar-subheader {\n  top: 44px;\n  display: block;\n  height: 44px; }\n\n.bar-subfooter {\n  bottom: 44px;\n  display: block;\n  height: 44px; }\n\n.nav-bar-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  left: 0;\n  z-index: 9; }\n\n.bar .back-button.hide, .bar .buttons .hide {\n  display: none; }\n\n.nav-bar-tabs-top .bar {\n  background-image: none; }\n\n/**\n * Tabs\n * --------------------------------------------------\n * A navigation bar with any number of tab items supported.\n */\n.tabs {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: horizontal;\n  -moz-flex-direction: horizontal;\n  -ms-flex-direction: horizontal;\n  flex-direction: horizontal;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  color: #444;\n  position: absolute;\n  bottom: 0;\n  z-index: 5;\n  width: 100%;\n  height: 49px;\n  border-style: solid;\n  border-top-width: 1px;\n  background-size: 0;\n  line-height: 49px; }\n  .tabs .tab-item .badge {\n    background-color: #444;\n    color: #f8f8f8; }\n  @media (min--moz-device-pixel-ratio: 1.5), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx) {\n    .tabs {\n      padding-top: 2px;\n      border-top: none !important;\n      border-bottom: none;\n      background-position: top;\n      background-size: 100% 1px;\n      background-repeat: no-repeat; } }\n\n/* Allow parent element of tabs to define color, or just the tab itself */\n.tabs-light > .tabs, .tabs.tabs-light {\n  border-color: #ddd;\n  background-color: #fff;\n  background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n  color: #444; }\n  .tabs-light > .tabs .tab-item .badge, .tabs.tabs-light .tab-item .badge {\n    background-color: #444;\n    color: #fff; }\n\n.tabs-stable > .tabs, .tabs.tabs-stable {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  color: #444; }\n  .tabs-stable > .tabs .tab-item .badge, .tabs.tabs-stable .tab-item .badge {\n    background-color: #444;\n    color: #f8f8f8; }\n\n.tabs-positive > .tabs, .tabs.tabs-positive {\n  border-color: #0c60ee;\n  background-color: #387ef5;\n  background-image: linear-gradient(0deg, #0c60ee, #0c60ee 50%, transparent 50%);\n  color: #fff; }\n  .tabs-positive > .tabs .tab-item .badge, .tabs.tabs-positive .tab-item .badge {\n    background-color: #fff;\n    color: #387ef5; }\n\n.tabs-calm > .tabs, .tabs.tabs-calm {\n  border-color: #0a9dc7;\n  background-color: #11c1f3;\n  background-image: linear-gradient(0deg, #0a9dc7, #0a9dc7 50%, transparent 50%);\n  color: #fff; }\n  .tabs-calm > .tabs .tab-item .badge, .tabs.tabs-calm .tab-item .badge {\n    background-color: #fff;\n    color: #11c1f3; }\n\n.tabs-assertive > .tabs, .tabs.tabs-assertive {\n  border-color: #e42112;\n  background-color: #ef473a;\n  background-image: linear-gradient(0deg, #e42112, #e42112 50%, transparent 50%);\n  color: #fff; }\n  .tabs-assertive > .tabs .tab-item .badge, .tabs.tabs-assertive .tab-item .badge {\n    background-color: #fff;\n    color: #ef473a; }\n\n.tabs-balanced > .tabs, .tabs.tabs-balanced {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n  color: #fff; }\n  .tabs-balanced > .tabs .tab-item .badge, .tabs.tabs-balanced .tab-item .badge {\n    background-color: #fff;\n    color: #33cd5f; }\n\n.tabs-energized > .tabs, .tabs.tabs-energized {\n  border-color: #e6b500;\n  background-color: #ffc900;\n  background-image: linear-gradient(0deg, #e6b500, #e6b500 50%, transparent 50%);\n  color: #fff; }\n  .tabs-energized > .tabs .tab-item .badge, .tabs.tabs-energized .tab-item .badge {\n    background-color: #fff;\n    color: #ffc900; }\n\n.tabs-royal > .tabs, .tabs.tabs-royal {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n  color: #fff; }\n  .tabs-royal > .tabs .tab-item .badge, .tabs.tabs-royal .tab-item .badge {\n    background-color: #fff;\n    color: #886aea; }\n\n.tabs-dark > .tabs, .tabs.tabs-dark {\n  border-color: #111;\n  background-color: #444;\n  background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n  color: #fff; }\n  .tabs-dark > .tabs .tab-item .badge, .tabs.tabs-dark .tab-item .badge {\n    background-color: #fff;\n    color: #444; }\n\n.tabs-striped .tabs {\n  background-color: white;\n  background-image: none;\n  border: none;\n  border-bottom: 1px solid #ddd;\n  padding-top: 2px; }\n.tabs-striped .tab-item.tab-item-active, .tabs-striped .tab-item.active, .tabs-striped .tab-item.activated {\n  margin-top: -2px;\n  border-style: solid;\n  border-width: 2px 0 0 0;\n  border-color: #444; }\n  .tabs-striped .tab-item.tab-item-active .badge, .tabs-striped .tab-item.active .badge, .tabs-striped .tab-item.activated .badge {\n    top: 2px;\n    opacity: 1; }\n.tabs-striped.tabs-light .tabs {\n  background-color: #fff; }\n.tabs-striped.tabs-light .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-light .tab-item.tab-item-active, .tabs-striped.tabs-light .tab-item.active, .tabs-striped.tabs-light .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #444; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-stable .tabs {\n  background-color: #f8f8f8; }\n.tabs-striped.tabs-stable .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-stable .tab-item.tab-item-active, .tabs-striped.tabs-stable .tab-item.active, .tabs-striped.tabs-stable .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #444; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-positive .tabs {\n  background-color: #387ef5; }\n.tabs-striped.tabs-positive .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-positive .tab-item.tab-item-active, .tabs-striped.tabs-positive .tab-item.active, .tabs-striped.tabs-positive .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-calm .tabs {\n  background-color: #11c1f3; }\n.tabs-striped.tabs-calm .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-calm .tab-item.tab-item-active, .tabs-striped.tabs-calm .tab-item.active, .tabs-striped.tabs-calm .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-assertive .tabs {\n  background-color: #ef473a; }\n.tabs-striped.tabs-assertive .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-assertive .tab-item.tab-item-active, .tabs-striped.tabs-assertive .tab-item.active, .tabs-striped.tabs-assertive .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-balanced .tabs {\n  background-color: #33cd5f; }\n.tabs-striped.tabs-balanced .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-balanced .tab-item.tab-item-active, .tabs-striped.tabs-balanced .tab-item.active, .tabs-striped.tabs-balanced .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-energized .tabs {\n  background-color: #ffc900; }\n.tabs-striped.tabs-energized .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-energized .tab-item.tab-item-active, .tabs-striped.tabs-energized .tab-item.active, .tabs-striped.tabs-energized .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-royal .tabs {\n  background-color: #886aea; }\n.tabs-striped.tabs-royal .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-royal .tab-item.tab-item-active, .tabs-striped.tabs-royal .tab-item.active, .tabs-striped.tabs-royal .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-dark .tabs {\n  background-color: #444; }\n.tabs-striped.tabs-dark .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-dark .tab-item.tab-item-active, .tabs-striped.tabs-dark .tab-item.active, .tabs-striped.tabs-dark .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-background-light .tabs {\n  background-color: #fff;\n  background-image: none; }\n.tabs-striped.tabs-background-stable .tabs {\n  background-color: #f8f8f8;\n  background-image: none; }\n.tabs-striped.tabs-background-positive .tabs {\n  background-color: #387ef5;\n  background-image: none; }\n.tabs-striped.tabs-background-calm .tabs {\n  background-color: #11c1f3;\n  background-image: none; }\n.tabs-striped.tabs-background-assertive .tabs {\n  background-color: #ef473a;\n  background-image: none; }\n.tabs-striped.tabs-background-balanced .tabs {\n  background-color: #33cd5f;\n  background-image: none; }\n.tabs-striped.tabs-background-energized .tabs {\n  background-color: #ffc900;\n  background-image: none; }\n.tabs-striped.tabs-background-royal .tabs {\n  background-color: #886aea;\n  background-image: none; }\n.tabs-striped.tabs-background-dark .tabs {\n  background-color: #444;\n  background-image: none; }\n.tabs-striped.tabs-color-light .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-light .tab-item.tab-item-active, .tabs-striped.tabs-color-light .tab-item.active, .tabs-striped.tabs-color-light .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border: 0 solid #fff;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-light .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-light .tab-item.active .badge, .tabs-striped.tabs-color-light .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-stable .tab-item {\n  color: rgba(248, 248, 248, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-stable .tab-item.tab-item-active, .tabs-striped.tabs-color-stable .tab-item.active, .tabs-striped.tabs-color-stable .tab-item.activated {\n    margin-top: -2px;\n    color: #f8f8f8;\n    border: 0 solid #f8f8f8;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-stable .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-stable .tab-item.active .badge, .tabs-striped.tabs-color-stable .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-positive .tab-item {\n  color: rgba(56, 126, 245, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-positive .tab-item.tab-item-active, .tabs-striped.tabs-color-positive .tab-item.active, .tabs-striped.tabs-color-positive .tab-item.activated {\n    margin-top: -2px;\n    color: #387ef5;\n    border: 0 solid #387ef5;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-positive .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-positive .tab-item.active .badge, .tabs-striped.tabs-color-positive .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-calm .tab-item {\n  color: rgba(17, 193, 243, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-calm .tab-item.tab-item-active, .tabs-striped.tabs-color-calm .tab-item.active, .tabs-striped.tabs-color-calm .tab-item.activated {\n    margin-top: -2px;\n    color: #11c1f3;\n    border: 0 solid #11c1f3;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-calm .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-calm .tab-item.active .badge, .tabs-striped.tabs-color-calm .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-assertive .tab-item {\n  color: rgba(239, 71, 58, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-assertive .tab-item.tab-item-active, .tabs-striped.tabs-color-assertive .tab-item.active, .tabs-striped.tabs-color-assertive .tab-item.activated {\n    margin-top: -2px;\n    color: #ef473a;\n    border: 0 solid #ef473a;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-assertive .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-assertive .tab-item.active .badge, .tabs-striped.tabs-color-assertive .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-balanced .tab-item {\n  color: rgba(51, 205, 95, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-balanced .tab-item.tab-item-active, .tabs-striped.tabs-color-balanced .tab-item.active, .tabs-striped.tabs-color-balanced .tab-item.activated {\n    margin-top: -2px;\n    color: #33cd5f;\n    border: 0 solid #33cd5f;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-balanced .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-balanced .tab-item.active .badge, .tabs-striped.tabs-color-balanced .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-energized .tab-item {\n  color: rgba(255, 201, 0, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-energized .tab-item.tab-item-active, .tabs-striped.tabs-color-energized .tab-item.active, .tabs-striped.tabs-color-energized .tab-item.activated {\n    margin-top: -2px;\n    color: #ffc900;\n    border: 0 solid #ffc900;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-energized .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-energized .tab-item.active .badge, .tabs-striped.tabs-color-energized .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-royal .tab-item {\n  color: rgba(136, 106, 234, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-royal .tab-item.tab-item-active, .tabs-striped.tabs-color-royal .tab-item.active, .tabs-striped.tabs-color-royal .tab-item.activated {\n    margin-top: -2px;\n    color: #886aea;\n    border: 0 solid #886aea;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-royal .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-royal .tab-item.active .badge, .tabs-striped.tabs-color-royal .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-dark .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-dark .tab-item.tab-item-active, .tabs-striped.tabs-color-dark .tab-item.active, .tabs-striped.tabs-color-dark .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border: 0 solid #444;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-dark .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-dark .tab-item.active .badge, .tabs-striped.tabs-color-dark .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n\n.tabs-background-light .tabs, .tabs-background-light > .tabs {\n  background-color: #fff;\n  background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n  border-color: #ddd; }\n\n.tabs-background-stable .tabs, .tabs-background-stable > .tabs {\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  border-color: #b2b2b2; }\n\n.tabs-background-positive .tabs, .tabs-background-positive > .tabs {\n  background-color: #387ef5;\n  background-image: linear-gradient(0deg, #0c60ee, #0c60ee 50%, transparent 50%);\n  border-color: #0c60ee; }\n\n.tabs-background-calm .tabs, .tabs-background-calm > .tabs {\n  background-color: #11c1f3;\n  background-image: linear-gradient(0deg, #0a9dc7, #0a9dc7 50%, transparent 50%);\n  border-color: #0a9dc7; }\n\n.tabs-background-assertive .tabs, .tabs-background-assertive > .tabs {\n  background-color: #ef473a;\n  background-image: linear-gradient(0deg, #e42112, #e42112 50%, transparent 50%);\n  border-color: #e42112; }\n\n.tabs-background-balanced .tabs, .tabs-background-balanced > .tabs {\n  background-color: #33cd5f;\n  background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n  border-color: #28a54c; }\n\n.tabs-background-energized .tabs, .tabs-background-energized > .tabs {\n  background-color: #ffc900;\n  background-image: linear-gradient(0deg, #e6b500, #e6b500 50%, transparent 50%);\n  border-color: #e6b500; }\n\n.tabs-background-royal .tabs, .tabs-background-royal > .tabs {\n  background-color: #886aea;\n  background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n  border-color: #6b46e5; }\n\n.tabs-background-dark .tabs, .tabs-background-dark > .tabs {\n  background-color: #444;\n  background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n  border-color: #111; }\n\n.tabs-color-light .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-color-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-light .tab-item.tab-item-active, .tabs-color-light .tab-item.active, .tabs-color-light .tab-item.activated {\n    color: #fff;\n    border: 0 solid #fff; }\n    .tabs-color-light .tab-item.tab-item-active .badge, .tabs-color-light .tab-item.active .badge, .tabs-color-light .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-stable .tab-item {\n  color: rgba(248, 248, 248, 0.4);\n  opacity: 1; }\n  .tabs-color-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-stable .tab-item.tab-item-active, .tabs-color-stable .tab-item.active, .tabs-color-stable .tab-item.activated {\n    color: #f8f8f8;\n    border: 0 solid #f8f8f8; }\n    .tabs-color-stable .tab-item.tab-item-active .badge, .tabs-color-stable .tab-item.active .badge, .tabs-color-stable .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-positive .tab-item {\n  color: rgba(56, 126, 245, 0.4);\n  opacity: 1; }\n  .tabs-color-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-positive .tab-item.tab-item-active, .tabs-color-positive .tab-item.active, .tabs-color-positive .tab-item.activated {\n    color: #387ef5;\n    border: 0 solid #387ef5; }\n    .tabs-color-positive .tab-item.tab-item-active .badge, .tabs-color-positive .tab-item.active .badge, .tabs-color-positive .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-calm .tab-item {\n  color: rgba(17, 193, 243, 0.4);\n  opacity: 1; }\n  .tabs-color-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-calm .tab-item.tab-item-active, .tabs-color-calm .tab-item.active, .tabs-color-calm .tab-item.activated {\n    color: #11c1f3;\n    border: 0 solid #11c1f3; }\n    .tabs-color-calm .tab-item.tab-item-active .badge, .tabs-color-calm .tab-item.active .badge, .tabs-color-calm .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-assertive .tab-item {\n  color: rgba(239, 71, 58, 0.4);\n  opacity: 1; }\n  .tabs-color-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-assertive .tab-item.tab-item-active, .tabs-color-assertive .tab-item.active, .tabs-color-assertive .tab-item.activated {\n    color: #ef473a;\n    border: 0 solid #ef473a; }\n    .tabs-color-assertive .tab-item.tab-item-active .badge, .tabs-color-assertive .tab-item.active .badge, .tabs-color-assertive .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-balanced .tab-item {\n  color: rgba(51, 205, 95, 0.4);\n  opacity: 1; }\n  .tabs-color-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-balanced .tab-item.tab-item-active, .tabs-color-balanced .tab-item.active, .tabs-color-balanced .tab-item.activated {\n    color: #33cd5f;\n    border: 0 solid #33cd5f; }\n    .tabs-color-balanced .tab-item.tab-item-active .badge, .tabs-color-balanced .tab-item.active .badge, .tabs-color-balanced .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-energized .tab-item {\n  color: rgba(255, 201, 0, 0.4);\n  opacity: 1; }\n  .tabs-color-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-energized .tab-item.tab-item-active, .tabs-color-energized .tab-item.active, .tabs-color-energized .tab-item.activated {\n    color: #ffc900;\n    border: 0 solid #ffc900; }\n    .tabs-color-energized .tab-item.tab-item-active .badge, .tabs-color-energized .tab-item.active .badge, .tabs-color-energized .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-royal .tab-item {\n  color: rgba(136, 106, 234, 0.4);\n  opacity: 1; }\n  .tabs-color-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-royal .tab-item.tab-item-active, .tabs-color-royal .tab-item.active, .tabs-color-royal .tab-item.activated {\n    color: #886aea;\n    border: 0 solid #886aea; }\n    .tabs-color-royal .tab-item.tab-item-active .badge, .tabs-color-royal .tab-item.active .badge, .tabs-color-royal .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-dark .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-color-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-dark .tab-item.tab-item-active, .tabs-color-dark .tab-item.active, .tabs-color-dark .tab-item.activated {\n    color: #444;\n    border: 0 solid #444; }\n    .tabs-color-dark .tab-item.tab-item-active .badge, .tabs-color-dark .tab-item.active .badge, .tabs-color-dark .tab-item.activated .badge {\n      opacity: 1; }\n\nion-tabs.tabs-color-active-light .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-light .tab-item.tab-item-active, ion-tabs.tabs-color-active-light .tab-item.active, ion-tabs.tabs-color-active-light .tab-item.activated {\n    color: #fff; }\nion-tabs.tabs-color-active-stable .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-stable .tab-item.tab-item-active, ion-tabs.tabs-color-active-stable .tab-item.active, ion-tabs.tabs-color-active-stable .tab-item.activated {\n    color: #f8f8f8; }\nion-tabs.tabs-color-active-positive .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-positive .tab-item.tab-item-active, ion-tabs.tabs-color-active-positive .tab-item.active, ion-tabs.tabs-color-active-positive .tab-item.activated {\n    color: #387ef5; }\nion-tabs.tabs-color-active-calm .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-calm .tab-item.tab-item-active, ion-tabs.tabs-color-active-calm .tab-item.active, ion-tabs.tabs-color-active-calm .tab-item.activated {\n    color: #11c1f3; }\nion-tabs.tabs-color-active-assertive .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-assertive .tab-item.tab-item-active, ion-tabs.tabs-color-active-assertive .tab-item.active, ion-tabs.tabs-color-active-assertive .tab-item.activated {\n    color: #ef473a; }\nion-tabs.tabs-color-active-balanced .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-balanced .tab-item.tab-item-active, ion-tabs.tabs-color-active-balanced .tab-item.active, ion-tabs.tabs-color-active-balanced .tab-item.activated {\n    color: #33cd5f; }\nion-tabs.tabs-color-active-energized .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-energized .tab-item.tab-item-active, ion-tabs.tabs-color-active-energized .tab-item.active, ion-tabs.tabs-color-active-energized .tab-item.activated {\n    color: #ffc900; }\nion-tabs.tabs-color-active-royal .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-royal .tab-item.tab-item-active, ion-tabs.tabs-color-active-royal .tab-item.active, ion-tabs.tabs-color-active-royal .tab-item.activated {\n    color: #886aea; }\nion-tabs.tabs-color-active-dark .tab-item {\n  color: #fff; }\n  ion-tabs.tabs-color-active-dark .tab-item.tab-item-active, ion-tabs.tabs-color-active-dark .tab-item.active, ion-tabs.tabs-color-active-dark .tab-item.activated {\n    color: #444; }\n\n.tabs-top.tabs-striped {\n  padding-bottom: 0; }\n  .tabs-top.tabs-striped .tab-item {\n    background: transparent;\n    -webkit-transition: color .1s ease;\n    -moz-transition: color .1s ease;\n    -ms-transition: color .1s ease;\n    -o-transition: color .1s ease;\n    transition: color .1s ease; }\n    .tabs-top.tabs-striped .tab-item.tab-item-active, .tabs-top.tabs-striped .tab-item.active, .tabs-top.tabs-striped .tab-item.activated {\n      margin-top: 1px;\n      border-width: 0px 0px 2px 0px !important;\n      border-style: solid; }\n      .tabs-top.tabs-striped .tab-item.tab-item-active > .badge, .tabs-top.tabs-striped .tab-item.tab-item-active > i, .tabs-top.tabs-striped .tab-item.active > .badge, .tabs-top.tabs-striped .tab-item.active > i, .tabs-top.tabs-striped .tab-item.activated > .badge, .tabs-top.tabs-striped .tab-item.activated > i {\n        margin-top: -1px; }\n    .tabs-top.tabs-striped .tab-item .badge {\n      -webkit-transition: color .2s ease;\n      -moz-transition: color .2s ease;\n      -ms-transition: color .2s ease;\n      -o-transition: color .2s ease;\n      transition: color .2s ease; }\n\n/* Allow parent element to have tabs-top */\n/* If you change this, change platform.scss as well */\n.tabs-top > .tabs, .tabs.tabs-top {\n  top: 44px;\n  padding-top: 0;\n  background-position: bottom;\n  border-top-width: 0;\n  border-bottom-width: 1px; }\n  .tabs-top > .tabs .tab-item.tab-item-active .badge, .tabs-top > .tabs .tab-item.active .badge, .tabs-top > .tabs .tab-item.activated .badge, .tabs.tabs-top .tab-item.tab-item-active .badge, .tabs.tabs-top .tab-item.active .badge, .tabs.tabs-top .tab-item.activated .badge {\n    top: 4%; }\n\n.tabs-top ~ .bar-header {\n  border-bottom-width: 0; }\n\n.tab-item {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  overflow: hidden;\n  max-width: 150px;\n  height: 100%;\n  color: inherit;\n  text-align: center;\n  text-decoration: none;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-weight: 400;\n  font-size: 14px;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  opacity: 0.7; }\n  .tab-item:hover {\n    cursor: pointer; }\n  .tab-item.tab-hidden {\n    display: none; }\n\n.tabs-item-hide > .tabs, .tabs.tabs-item-hide {\n  display: none; }\n\n.tabs-icon-top > .tabs .tab-item, .tabs-icon-top.tabs .tab-item, .tabs-icon-bottom > .tabs .tab-item, .tabs-icon-bottom.tabs .tab-item {\n  font-size: 10px;\n  line-height: 14px; }\n\n.tab-item .icon {\n  display: block;\n  margin: 0 auto;\n  height: 32px;\n  font-size: 32px; }\n\n.tabs-icon-left.tabs .tab-item, .tabs-icon-left > .tabs .tab-item, .tabs-icon-right.tabs .tab-item, .tabs-icon-right > .tabs .tab-item {\n  font-size: 10px; }\n  .tabs-icon-left.tabs .tab-item .icon, .tabs-icon-left > .tabs .tab-item .icon, .tabs-icon-right.tabs .tab-item .icon, .tabs-icon-right > .tabs .tab-item .icon {\n    display: inline-block;\n    vertical-align: top;\n    margin-top: -.1em; }\n    .tabs-icon-left.tabs .tab-item .icon:before, .tabs-icon-left > .tabs .tab-item .icon:before, .tabs-icon-right.tabs .tab-item .icon:before, .tabs-icon-right > .tabs .tab-item .icon:before {\n      font-size: 24px;\n      line-height: 49px; }\n\n.tabs-icon-left > .tabs .tab-item .icon, .tabs-icon-left.tabs .tab-item .icon {\n  padding-right: 3px; }\n\n.tabs-icon-right > .tabs .tab-item .icon, .tabs-icon-right.tabs .tab-item .icon {\n  padding-left: 3px; }\n\n.tabs-icon-only > .tabs .icon, .tabs-icon-only.tabs .icon {\n  line-height: inherit; }\n\n.tab-item.has-badge {\n  position: relative; }\n\n.tab-item .badge {\n  position: absolute;\n  top: 4%;\n  right: 33%;\n  right: calc(50% - 26px);\n  padding: 1px 6px;\n  height: auto;\n  font-size: 12px;\n  line-height: 16px; }\n\n/* Navigational tab */\n/* Active state for tab */\n.tab-item.tab-item-active, .tab-item.active, .tab-item.activated {\n  opacity: 1; }\n  .tab-item.tab-item-active.tab-item-light, .tab-item.active.tab-item-light, .tab-item.activated.tab-item-light {\n    color: #fff; }\n  .tab-item.tab-item-active.tab-item-stable, .tab-item.active.tab-item-stable, .tab-item.activated.tab-item-stable {\n    color: #f8f8f8; }\n  .tab-item.tab-item-active.tab-item-positive, .tab-item.active.tab-item-positive, .tab-item.activated.tab-item-positive {\n    color: #387ef5; }\n  .tab-item.tab-item-active.tab-item-calm, .tab-item.active.tab-item-calm, .tab-item.activated.tab-item-calm {\n    color: #11c1f3; }\n  .tab-item.tab-item-active.tab-item-assertive, .tab-item.active.tab-item-assertive, .tab-item.activated.tab-item-assertive {\n    color: #ef473a; }\n  .tab-item.tab-item-active.tab-item-balanced, .tab-item.active.tab-item-balanced, .tab-item.activated.tab-item-balanced {\n    color: #33cd5f; }\n  .tab-item.tab-item-active.tab-item-energized, .tab-item.active.tab-item-energized, .tab-item.activated.tab-item-energized {\n    color: #ffc900; }\n  .tab-item.tab-item-active.tab-item-royal, .tab-item.active.tab-item-royal, .tab-item.activated.tab-item-royal {\n    color: #886aea; }\n  .tab-item.tab-item-active.tab-item-dark, .tab-item.active.tab-item-dark, .tab-item.activated.tab-item-dark {\n    color: #444; }\n\n.item.tabs {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  padding: 0; }\n  .item.tabs .icon:before {\n    position: relative; }\n\n.tab-item.disabled, .tab-item[disabled] {\n  opacity: .4;\n  cursor: default;\n  pointer-events: none; }\n\n/**\n * Menus\n * --------------------------------------------------\n * Side panel structure\n */\n.menu {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  z-index: 0;\n  overflow: hidden;\n  min-height: 100%;\n  max-height: 100%;\n  width: 275px;\n  background-color: #fff; }\n  .menu .scroll-content {\n    z-index: 10; }\n  .menu .bar-header {\n    z-index: 11; }\n\n.menu-content {\n  -webkit-transform: none;\n  transform: none;\n  box-shadow: -1px 0px 2px rgba(0, 0, 0, 0.2), 1px 0px 2px rgba(0, 0, 0, 0.2); }\n\n.menu-open .menu-content .pane, .menu-open .menu-content .scroll-content {\n  pointer-events: none; }\n\n.grade-b .menu-content, .grade-c .menu-content {\n  -webkit-box-sizing: content-box;\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  right: -1px;\n  left: -1px;\n  border-right: 1px solid #ccc;\n  border-left: 1px solid #ccc;\n  box-shadow: none; }\n\n.menu-left {\n  left: 0; }\n\n.menu-right {\n  right: 0; }\n\n.aside-open.aside-resizing .menu-right {\n  display: none; }\n\n.menu-animated {\n  -webkit-transition: -webkit-transform 200ms ease;\n  transition: transform 200ms ease; }\n\n/**\n * Modals\n * --------------------------------------------------\n * Modals are independent windows that slide in from off-screen.\n */\n.modal-backdrop, .modal-backdrop-bg {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 10;\n  width: 100%;\n  height: 100%; }\n\n.modal-backdrop-bg {\n  pointer-events: none; }\n\n.modal {\n  display: block;\n  position: absolute;\n  top: 0;\n  z-index: 10;\n  overflow: hidden;\n  min-height: 100%;\n  width: 100%;\n  background-color: #fff; }\n\n@media (min-width: 680px) {\n  .modal {\n    top: 20%;\n    right: 20%;\n    bottom: 20%;\n    left: 20%;\n    min-height: 240px;\n    width: 60%; }\n  .modal.ng-leave-active {\n    bottom: 0; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .bar-header:not(.bar-subheader) {\n    height: 44px; }\n    .platform-ios.platform-cordova .modal-wrapper .modal .bar-header:not(.bar-subheader) > * {\n      margin-top: 0; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .tabs-top > .tabs, .platform-ios.platform-cordova .modal-wrapper .modal .tabs.tabs-top {\n    top: 44px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header, .platform-ios.platform-cordova .modal-wrapper .modal .bar-subheader {\n    top: 44px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-subheader {\n    top: 88px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header.has-tabs-top {\n    top: 93px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header.has-subheader.has-tabs-top {\n    top: 137px; }\n  .modal-backdrop-bg {\n    -webkit-transition: opacity 300ms ease-in-out;\n    transition: opacity 300ms ease-in-out;\n    background-color: #000;\n    opacity: 0; }\n  .active .modal-backdrop-bg {\n    opacity: 0.5; } }\n\n.modal-open {\n  pointer-events: none; }\n  .modal-open .modal, .modal-open .modal-backdrop {\n    pointer-events: auto; }\n  .modal-open.loading-active .modal, .modal-open.loading-active .modal-backdrop {\n    pointer-events: none; }\n\n/**\n * Popovers\n * --------------------------------------------------\n * Popovers are independent views which float over content\n */\n.popover-backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 10;\n  width: 100%;\n  height: 100%;\n  background-color: transparent; }\n  .popover-backdrop.active {\n    background-color: rgba(0, 0, 0, 0.1); }\n\n.popover {\n  position: absolute;\n  top: 25%;\n  left: 50%;\n  z-index: 10;\n  display: block;\n  margin-top: 12px;\n  margin-left: -110px;\n  height: 280px;\n  width: 220px;\n  background-color: #fff;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);\n  opacity: 0; }\n  .popover .item:first-child {\n    border-top: 0; }\n  .popover .item:last-child {\n    border-bottom: 0; }\n  .popover.popover-bottom {\n    margin-top: -12px; }\n\n.popover, .popover .bar-header {\n  border-radius: 2px; }\n\n.popover .scroll-content {\n  z-index: 1;\n  margin: 2px 0; }\n\n.popover .bar-header {\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0; }\n\n.popover .has-header {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0; }\n\n.popover-arrow {\n  display: none; }\n\n.platform-ios .popover {\n  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);\n  border-radius: 10px; }\n.platform-ios .popover .bar-header {\n  -webkit-border-top-right-radius: 10px;\n  border-top-right-radius: 10px;\n  -webkit-border-top-left-radius: 10px;\n  border-top-left-radius: 10px; }\n.platform-ios .popover .scroll-content {\n  margin: 8px 0;\n  border-radius: 10px; }\n.platform-ios .popover .scroll-content.has-header {\n  margin-top: 0; }\n.platform-ios .popover-arrow {\n  position: absolute;\n  display: block;\n  top: -17px;\n  width: 30px;\n  height: 19px;\n  overflow: hidden; }\n  .platform-ios .popover-arrow:after {\n    position: absolute;\n    top: 12px;\n    left: 5px;\n    width: 20px;\n    height: 20px;\n    background-color: #fff;\n    border-radius: 3px;\n    content: '';\n    -webkit-transform: rotate(-45deg);\n    transform: rotate(-45deg); }\n.platform-ios .popover-bottom .popover-arrow {\n  top: auto;\n  bottom: -10px; }\n  .platform-ios .popover-bottom .popover-arrow:after {\n    top: -6px; }\n\n.platform-android .popover {\n  margin-top: -32px;\n  background-color: #fafafa;\n  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }\n  .platform-android .popover .item {\n    border-color: #fafafa;\n    background-color: #fafafa;\n    color: #4d4d4d; }\n  .platform-android .popover.popover-bottom {\n    margin-top: 32px; }\n.platform-android .popover-backdrop, .platform-android .popover-backdrop.active {\n  background-color: transparent; }\n\n.popover-open {\n  pointer-events: none; }\n  .popover-open .popover, .popover-open .popover-backdrop {\n    pointer-events: auto; }\n  .popover-open.loading-active .popover, .popover-open.loading-active .popover-backdrop {\n    pointer-events: none; }\n\n@media (min-width: 680px) {\n  .popover {\n    width: 360px; } }\n\n/**\n * Popups\n * --------------------------------------------------\n */\n.popup-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  background: transparent;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  z-index: 12;\n  visibility: hidden; }\n  .popup-container.popup-showing {\n    visibility: visible; }\n  .popup-container.popup-hidden .popup {\n    -webkit-animation-name: scaleOut;\n    animation-name: scaleOut;\n    -webkit-animation-duration: 0.1s;\n    animation-duration: 0.1s;\n    -webkit-animation-timing-function: ease-in-out;\n    animation-timing-function: ease-in-out;\n    -webkit-animation-fill-mode: both;\n    animation-fill-mode: both; }\n  .popup-container.active .popup {\n    -webkit-animation-name: superScaleIn;\n    animation-name: superScaleIn;\n    -webkit-animation-duration: 0.2s;\n    animation-duration: 0.2s;\n    -webkit-animation-timing-function: ease-in-out;\n    animation-timing-function: ease-in-out;\n    -webkit-animation-fill-mode: both;\n    animation-fill-mode: both; }\n  .popup-container .popup {\n    width: 250px;\n    max-width: 100%;\n    max-height: 90%;\n    border-radius: 0px;\n    background-color: rgba(255, 255, 255, 0.9);\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -moz-flex;\n    display: -ms-flexbox;\n    display: flex;\n    -webkit-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -moz-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n  .popup-container input, .popup-container textarea {\n    width: 100%; }\n\n.popup-head {\n  padding: 15px 10px;\n  border-bottom: 1px solid #eee;\n  text-align: center; }\n\n.popup-title {\n  margin: 0;\n  padding: 0;\n  font-size: 15px; }\n\n.popup-sub-title {\n  margin: 5px 0 0 0;\n  padding: 0;\n  font-weight: normal;\n  font-size: 11px; }\n\n.popup-body {\n  padding: 10px;\n  overflow: auto; }\n\n.popup-buttons {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -moz-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  padding: 10px;\n  min-height: 65px; }\n  .popup-buttons .button {\n    -webkit-box-flex: 1;\n    -webkit-flex: 1;\n    -moz-box-flex: 1;\n    -moz-flex: 1;\n    -ms-flex: 1;\n    flex: 1;\n    display: block;\n    min-height: 45px;\n    border-radius: 2px;\n    line-height: 20px;\n    margin-right: 5px; }\n    .popup-buttons .button:last-child {\n      margin-right: 0px; }\n\n.popup-open {\n  pointer-events: none; }\n  .popup-open.modal-open .modal {\n    pointer-events: none; }\n  .popup-open .popup-backdrop, .popup-open .popup {\n    pointer-events: auto; }\n\n/**\n * Loading\n * --------------------------------------------------\n */\n.loading-container {\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 13;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  -webkit-transition: 0.2s opacity linear;\n  transition: 0.2s opacity linear;\n  visibility: hidden;\n  opacity: 0; }\n  .loading-container:not(.visible) .icon {\n    display: none; }\n  .loading-container.visible {\n    visibility: visible; }\n  .loading-container.active {\n    opacity: 1; }\n  .loading-container .loading {\n    padding: 20px;\n    border-radius: 5px;\n    background-color: rgba(0, 0, 0, 0.7);\n    color: #fff;\n    text-align: center;\n    text-overflow: ellipsis;\n    font-size: 15px; }\n    .loading-container .loading h1, .loading-container .loading h2, .loading-container .loading h3, .loading-container .loading h4, .loading-container .loading h5, .loading-container .loading h6 {\n      color: #fff; }\n\n/**\n * Items\n * --------------------------------------------------\n */\n.item {\n  border-color: #ddd;\n  background-color: #fff;\n  color: #444;\n  position: relative;\n  z-index: 2;\n  display: block;\n  margin: -1px;\n  padding: 16px;\n  border-width: 1px;\n  border-style: solid;\n  font-size: 16px; }\n  .item h2 {\n    margin: 0 0 2px 0;\n    font-size: 16px;\n    font-weight: normal; }\n  .item h3 {\n    margin: 0 0 4px 0;\n    font-size: 14px; }\n  .item h4 {\n    margin: 0 0 4px 0;\n    font-size: 12px; }\n  .item h5, .item h6 {\n    margin: 0 0 3px 0;\n    font-size: 10px; }\n  .item p {\n    color: #666;\n    font-size: 14px;\n    margin-bottom: 2px; }\n  .item h1:last-child, .item h2:last-child, .item h3:last-child, .item h4:last-child, .item h5:last-child, .item h6:last-child, .item p:last-child {\n    margin-bottom: 0; }\n  .item .badge {\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -moz-flex;\n    display: -ms-flexbox;\n    display: flex;\n    position: absolute;\n    top: 16px;\n    right: 32px; }\n  .item.item-button-right .badge {\n    right: 67px; }\n  .item.item-divider .badge {\n    top: 8px; }\n  .item .badge + .badge {\n    margin-right: 5px; }\n  .item.item-light {\n    border-color: #ddd;\n    background-color: #fff;\n    color: #444; }\n  .item.item-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    color: #444; }\n  .item.item-positive {\n    border-color: #0c60ee;\n    background-color: #387ef5;\n    color: #fff; }\n  .item.item-calm {\n    border-color: #0a9dc7;\n    background-color: #11c1f3;\n    color: #fff; }\n  .item.item-assertive {\n    border-color: #e42112;\n    background-color: #ef473a;\n    color: #fff; }\n  .item.item-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    color: #fff; }\n  .item.item-energized {\n    border-color: #e6b500;\n    background-color: #ffc900;\n    color: #fff; }\n  .item.item-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    color: #fff; }\n  .item.item-dark {\n    border-color: #111;\n    background-color: #444;\n    color: #fff; }\n  .item[ng-click]:hover {\n    cursor: pointer; }\n\n.list-borderless .item, .item-borderless {\n  border-width: 0; }\n\n.item.active, .item.activated, .item-complex.active .item-content, .item-complex.activated .item-content, .item .item-content.active, .item .item-content.activated {\n  border-color: #ccc;\n  background-color: #D9D9D9; }\n  .item.active.item-light, .item.activated.item-light, .item-complex.active .item-content.item-light, .item-complex.activated .item-content.item-light, .item .item-content.active.item-light, .item .item-content.activated.item-light {\n    border-color: #ccc;\n    background-color: #fafafa; }\n  .item.active.item-stable, .item.activated.item-stable, .item-complex.active .item-content.item-stable, .item-complex.activated .item-content.item-stable, .item .item-content.active.item-stable, .item .item-content.activated.item-stable {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5; }\n  .item.active.item-positive, .item.activated.item-positive, .item-complex.active .item-content.item-positive, .item-complex.activated .item-content.item-positive, .item .item-content.active.item-positive, .item .item-content.activated.item-positive {\n    border-color: #0c60ee;\n    background-color: #0c60ee; }\n  .item.active.item-calm, .item.activated.item-calm, .item-complex.active .item-content.item-calm, .item-complex.activated .item-content.item-calm, .item .item-content.active.item-calm, .item .item-content.activated.item-calm {\n    border-color: #0a9dc7;\n    background-color: #0a9dc7; }\n  .item.active.item-assertive, .item.activated.item-assertive, .item-complex.active .item-content.item-assertive, .item-complex.activated .item-content.item-assertive, .item .item-content.active.item-assertive, .item .item-content.activated.item-assertive {\n    border-color: #e42112;\n    background-color: #e42112; }\n  .item.active.item-balanced, .item.activated.item-balanced, .item-complex.active .item-content.item-balanced, .item-complex.activated .item-content.item-balanced, .item .item-content.active.item-balanced, .item .item-content.activated.item-balanced {\n    border-color: #28a54c;\n    background-color: #28a54c; }\n  .item.active.item-energized, .item.activated.item-energized, .item-complex.active .item-content.item-energized, .item-complex.activated .item-content.item-energized, .item .item-content.active.item-energized, .item .item-content.activated.item-energized {\n    border-color: #e6b500;\n    background-color: #e6b500; }\n  .item.active.item-royal, .item.activated.item-royal, .item-complex.active .item-content.item-royal, .item-complex.activated .item-content.item-royal, .item .item-content.active.item-royal, .item .item-content.activated.item-royal {\n    border-color: #6b46e5;\n    background-color: #6b46e5; }\n  .item.active.item-dark, .item.activated.item-dark, .item-complex.active .item-content.item-dark, .item-complex.activated .item-content.item-dark, .item .item-content.active.item-dark, .item .item-content.activated.item-dark {\n    border-color: #000;\n    background-color: #262626; }\n\n.item, .item h1, .item h2, .item h3, .item h4, .item h5, .item h6, .item p, .item-content, .item-content h1, .item-content h2, .item-content h3, .item-content h4, .item-content h5, .item-content h6, .item-content p {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap; }\n\na.item {\n  color: inherit;\n  text-decoration: none; }\n  a.item:hover, a.item:focus {\n    text-decoration: none; }\n\n/**\n * Complex Items\n * --------------------------------------------------\n * Adding .item-complex allows the .item to be slidable and\n * have options underneath the button, but also requires an\n * additional .item-content element inside .item.\n * Basically .item-complex removes any default settings which\n * .item added, so that .item-content looks them as just .item.\n */\n.item-complex, a.item.item-complex, button.item.item-complex {\n  padding: 0; }\n\n.item-complex .item-content, .item-radio .item-content {\n  position: relative;\n  z-index: 2;\n  padding: 16px 49px 16px 16px;\n  border: none;\n  background-color: white; }\n\na.item-content {\n  display: block;\n  color: inherit;\n  text-decoration: none; }\n\n.item-text-wrap .item, .item-text-wrap .item-content, .item-text-wrap, .item-text-wrap h1, .item-text-wrap h2, .item-text-wrap h3, .item-text-wrap h4, .item-text-wrap h5, .item-text-wrap h6, .item-text-wrap p, .item-complex.item-text-wrap .item-content, .item-body h1, .item-body h2, .item-body h3, .item-body h4, .item-body h5, .item-body h6, .item-body p {\n  overflow: visible;\n  white-space: normal; }\n\n.item-complex.item-text-wrap, .item-complex.item-text-wrap h1, .item-complex.item-text-wrap h2, .item-complex.item-text-wrap h3, .item-complex.item-text-wrap h4, .item-complex.item-text-wrap h5, .item-complex.item-text-wrap h6, .item-complex.item-text-wrap p {\n  overflow: visible;\n  white-space: normal; }\n\n.item-complex.item-light > .item-content {\n  border-color: #ddd;\n  background-color: #fff;\n  color: #444; }\n  .item-complex.item-light > .item-content.active, .item-complex.item-light > .item-content:active {\n    border-color: #ccc;\n    background-color: #fafafa; }\n.item-complex.item-stable > .item-content {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444; }\n  .item-complex.item-stable > .item-content.active, .item-complex.item-stable > .item-content:active {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5; }\n.item-complex.item-positive > .item-content {\n  border-color: #0c60ee;\n  background-color: #387ef5;\n  color: #fff; }\n  .item-complex.item-positive > .item-content.active, .item-complex.item-positive > .item-content:active {\n    border-color: #0c60ee;\n    background-color: #0c60ee; }\n.item-complex.item-calm > .item-content {\n  border-color: #0a9dc7;\n  background-color: #11c1f3;\n  color: #fff; }\n  .item-complex.item-calm > .item-content.active, .item-complex.item-calm > .item-content:active {\n    border-color: #0a9dc7;\n    background-color: #0a9dc7; }\n.item-complex.item-assertive > .item-content {\n  border-color: #e42112;\n  background-color: #ef473a;\n  color: #fff; }\n  .item-complex.item-assertive > .item-content.active, .item-complex.item-assertive > .item-content:active {\n    border-color: #e42112;\n    background-color: #e42112; }\n.item-complex.item-balanced > .item-content {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  color: #fff; }\n  .item-complex.item-balanced > .item-content.active, .item-complex.item-balanced > .item-content:active {\n    border-color: #28a54c;\n    background-color: #28a54c; }\n.item-complex.item-energized > .item-content {\n  border-color: #e6b500;\n  background-color: #ffc900;\n  color: #fff; }\n  .item-complex.item-energized > .item-content.active, .item-complex.item-energized > .item-content:active {\n    border-color: #e6b500;\n    background-color: #e6b500; }\n.item-complex.item-royal > .item-content {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  color: #fff; }\n  .item-complex.item-royal > .item-content.active, .item-complex.item-royal > .item-content:active {\n    border-color: #6b46e5;\n    background-color: #6b46e5; }\n.item-complex.item-dark > .item-content {\n  border-color: #111;\n  background-color: #444;\n  color: #fff; }\n  .item-complex.item-dark > .item-content.active, .item-complex.item-dark > .item-content:active {\n    border-color: #000;\n    background-color: #262626; }\n\n/**\n * Item Icons\n * --------------------------------------------------\n */\n.item-icon-left .icon, .item-icon-right .icon {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 0;\n  height: 100%;\n  font-size: 32px; }\n  .item-icon-left .icon:before, .item-icon-right .icon:before {\n    display: block;\n    width: 32px;\n    text-align: center; }\n\n.item .fill-icon {\n  min-width: 30px;\n  min-height: 30px;\n  font-size: 28px; }\n\n.item-icon-left {\n  padding-left: 54px; }\n  .item-icon-left .icon {\n    left: 11px; }\n\n.item-complex.item-icon-left {\n  padding-left: 0; }\n  .item-complex.item-icon-left .item-content {\n    padding-left: 54px; }\n\n.item-icon-right {\n  padding-right: 54px; }\n  .item-icon-right .icon {\n    right: 11px; }\n\n.item-complex.item-icon-right {\n  padding-right: 0; }\n  .item-complex.item-icon-right .item-content {\n    padding-right: 54px; }\n\n.item-icon-left.item-icon-right .icon:first-child {\n  right: auto; }\n\n.item-icon-left.item-icon-right .icon:last-child, .item-icon-left .item-delete .icon {\n  left: auto; }\n\n.item-icon-left .icon-accessory, .item-icon-right .icon-accessory {\n  color: #ccc;\n  font-size: 16px; }\n\n.item-icon-left .icon-accessory {\n  left: 3px; }\n\n.item-icon-right .icon-accessory {\n  right: 3px; }\n\n/**\n * Item Button\n * --------------------------------------------------\n * An item button is a child button inside an .item (not the entire .item)\n */\n.item-button-left {\n  padding-left: 72px; }\n\n.item-button-left > .button, .item-button-left .item-content > .button {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 8px;\n  left: 11px;\n  min-width: 34px;\n  min-height: 34px;\n  font-size: 18px;\n  line-height: 32px; }\n  .item-button-left > .button .icon:before, .item-button-left .item-content > .button .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: 31px; }\n  .item-button-left > .button > .button, .item-button-left .item-content > .button > .button {\n    margin: 0px 2px;\n    min-height: 34px;\n    font-size: 18px;\n    line-height: 32px; }\n\n.item-button-right, a.item.item-button-right, button.item.item-button-right {\n  padding-right: 80px; }\n\n.item-button-right > .button, .item-button-right .item-content > .button, .item-button-right > .buttons, .item-button-right .item-content > .buttons {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 8px;\n  right: 16px;\n  min-width: 34px;\n  min-height: 34px;\n  font-size: 18px;\n  line-height: 32px; }\n  .item-button-right > .button .icon:before, .item-button-right .item-content > .button .icon:before, .item-button-right > .buttons .icon:before, .item-button-right .item-content > .buttons .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: 31px; }\n  .item-button-right > .button > .button, .item-button-right .item-content > .button > .button, .item-button-right > .buttons > .button, .item-button-right .item-content > .buttons > .button {\n    margin: 0px 2px;\n    min-width: 34px;\n    min-height: 34px;\n    font-size: 18px;\n    line-height: 32px; }\n\n.item-avatar, .item-avatar .item-content, .item-avatar-left, .item-avatar-left .item-content {\n  padding-left: 72px;\n  min-height: 72px; }\n  .item-avatar > img:first-child, .item-avatar .item-image, .item-avatar .item-content > img:first-child, .item-avatar .item-content .item-image, .item-avatar-left > img:first-child, .item-avatar-left .item-image, .item-avatar-left .item-content > img:first-child, .item-avatar-left .item-content .item-image {\n    position: absolute;\n    top: 16px;\n    left: 16px;\n    max-width: 40px;\n    max-height: 40px;\n    width: 100%;\n    height: 100%;\n    border-radius: 50%; }\n\n.item-avatar-right, .item-avatar-right .item-content {\n  padding-right: 72px;\n  min-height: 72px; }\n  .item-avatar-right > img:first-child, .item-avatar-right .item-image, .item-avatar-right .item-content > img:first-child, .item-avatar-right .item-content .item-image {\n    position: absolute;\n    top: 16px;\n    right: 16px;\n    max-width: 40px;\n    max-height: 40px;\n    width: 100%;\n    height: 100%;\n    border-radius: 50%; }\n\n.item-thumbnail-left, .item-thumbnail-left .item-content {\n  padding-top: 8px;\n  padding-left: 106px;\n  min-height: 100px; }\n  .item-thumbnail-left > img:first-child, .item-thumbnail-left .item-image, .item-thumbnail-left .item-content > img:first-child, .item-thumbnail-left .item-content .item-image {\n    position: absolute;\n    top: 10px;\n    left: 10px;\n    max-width: 80px;\n    max-height: 80px;\n    width: 100%;\n    height: 100%; }\n\n.item-avatar.item-complex, .item-avatar-left.item-complex, .item-thumbnail-left.item-complex {\n  padding-top: 0;\n  padding-left: 0; }\n\n.item-thumbnail-right, .item-thumbnail-right .item-content {\n  padding-top: 8px;\n  padding-right: 106px;\n  min-height: 100px; }\n  .item-thumbnail-right > img:first-child, .item-thumbnail-right .item-image, .item-thumbnail-right .item-content > img:first-child, .item-thumbnail-right .item-content .item-image {\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    max-width: 80px;\n    max-height: 80px;\n    width: 100%;\n    height: 100%; }\n\n.item-avatar-right.item-complex, .item-thumbnail-right.item-complex {\n  padding-top: 0;\n  padding-right: 0; }\n\n.item-image {\n  padding: 0;\n  text-align: center; }\n  .item-image img:first-child, .item-image .list-img {\n    width: 100%;\n    vertical-align: middle; }\n\n.item-body {\n  overflow: auto;\n  padding: 16px;\n  text-overflow: inherit;\n  white-space: normal; }\n  .item-body h1, .item-body h2, .item-body h3, .item-body h4, .item-body h5, .item-body h6, .item-body p {\n    margin-top: 16px;\n    margin-bottom: 16px; }\n\n.item-divider {\n  padding-top: 8px;\n  padding-bottom: 8px;\n  min-height: 30px;\n  background-color: #f5f5f5;\n  color: #222;\n  font-weight: 500; }\n\n.platform-ios .item-divider-platform, .item-divider-ios {\n  padding-top: 26px;\n  text-transform: uppercase;\n  font-weight: 300;\n  font-size: 13px;\n  background-color: #efeff4;\n  color: #555; }\n\n.platform-android .item-divider-platform, .item-divider-android {\n  font-weight: 300;\n  font-size: 13px; }\n\n.item-note {\n  float: right;\n  color: #aaa;\n  font-size: 14px; }\n\n.item-left-editable .item-content, .item-right-editable .item-content {\n  -webkit-transition-duration: 250ms;\n  transition-duration: 250ms;\n  -webkit-transition-timing-function: ease-in-out;\n  transition-timing-function: ease-in-out;\n  -webkit-transition-property: -webkit-transform;\n  -moz-transition-property: -moz-transform;\n  transition-property: transform; }\n\n.list-left-editing .item-left-editable .item-content, .item-left-editing.item-left-editable .item-content {\n  -webkit-transform: translate3d(50px, 0, 0);\n  transform: translate3d(50px, 0, 0); }\n\n.item-remove-animate.ng-leave {\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms; }\n.item-remove-animate.ng-leave .item-content, .item-remove-animate.ng-leave:last-of-type {\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms;\n  -webkit-transition-timing-function: ease-in;\n  transition-timing-function: ease-in;\n  -webkit-transition-property: all;\n  transition-property: all; }\n.item-remove-animate.ng-leave.ng-leave-active .item-content {\n  opacity: 0;\n  -webkit-transform: translate3d(-100%, 0, 0) !important;\n  transform: translate3d(-100%, 0, 0) !important; }\n.item-remove-animate.ng-leave.ng-leave-active:last-of-type {\n  opacity: 0; }\n.item-remove-animate.ng-leave.ng-leave-active ~ ion-item:not(.ng-leave) {\n  -webkit-transform: translate3d(0, -webkit-calc(-100% + 1px), 0);\n  transform: translate3d(0, calc(-100% + 1px), 0);\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms;\n  -webkit-transition-timing-function: cubic-bezier(.25, .81, .24, 1);\n  transition-timing-function: cubic-bezier(.25, .81, .24, 1);\n  -webkit-transition-property: all;\n  transition-property: all; }\n\n.item-left-edit {\n  -webkit-transition: all ease-in-out 125ms;\n  transition: all ease-in-out 125ms;\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 0;\n  width: 50px;\n  height: 100%;\n  line-height: 100%;\n  display: none;\n  opacity: 0;\n  -webkit-transform: translate3d(-21px, 0, 0);\n  transform: translate3d(-21px, 0, 0); }\n  .item-left-edit .button {\n    height: 100%; }\n    .item-left-edit .button.icon {\n      display: -webkit-box;\n      display: -webkit-flex;\n      display: -moz-box;\n      display: -moz-flex;\n      display: -ms-flexbox;\n      display: flex;\n      -webkit-box-align: center;\n      -ms-flex-align: center;\n      -webkit-align-items: center;\n      -moz-align-items: center;\n      align-items: center;\n      position: absolute;\n      top: 0;\n      height: 100%; }\n  .item-left-edit.visible {\n    display: block; }\n    .item-left-edit.visible.active {\n      opacity: 1;\n      -webkit-transform: translate3d(8px, 0, 0);\n      transform: translate3d(8px, 0, 0); }\n\n.list-left-editing .item-left-edit {\n  -webkit-transition-delay: 125ms;\n  transition-delay: 125ms; }\n\n.item-delete .button.icon {\n  color: #ef473a;\n  font-size: 24px; }\n  .item-delete .button.icon:hover {\n    opacity: .7; }\n\n.item-right-edit {\n  -webkit-transition: all ease-in-out 250ms;\n  transition: all ease-in-out 250ms;\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 3;\n  width: 75px;\n  height: 100%;\n  background: inherit;\n  padding-left: 20px;\n  display: block;\n  opacity: 0;\n  -webkit-transform: translate3d(75px, 0, 0);\n  transform: translate3d(75px, 0, 0); }\n  .item-right-edit .button {\n    min-width: 50px;\n    height: 100%; }\n    .item-right-edit .button.icon {\n      display: -webkit-box;\n      display: -webkit-flex;\n      display: -moz-box;\n      display: -moz-flex;\n      display: -ms-flexbox;\n      display: flex;\n      -webkit-box-align: center;\n      -ms-flex-align: center;\n      -webkit-align-items: center;\n      -moz-align-items: center;\n      align-items: center;\n      position: absolute;\n      top: 0;\n      height: 100%;\n      font-size: 32px; }\n  .item-right-edit.visible {\n    display: block; }\n    .item-right-edit.visible.active {\n      opacity: 1;\n      -webkit-transform: translate3d(0, 0, 0);\n      transform: translate3d(0, 0, 0); }\n\n.item-reorder .button.icon {\n  color: #444;\n  font-size: 32px; }\n\n.item-reordering {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 9;\n  width: 100%;\n  box-shadow: 0px 0px 10px 0px #aaa; }\n  .item-reordering .item-reorder {\n    z-index: 9; }\n\n.item-placeholder {\n  opacity: 0.7; }\n\n/**\n * The hidden right-side buttons that can be exposed under a list item\n * with dragging.\n */\n.item-options {\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 1;\n  height: 100%; }\n  .item-options .button {\n    height: 100%;\n    border: none;\n    border-radius: 0;\n    display: -webkit-inline-box;\n    display: -webkit-inline-flex;\n    display: -moz-inline-flex;\n    display: -ms-inline-flexbox;\n    display: inline-flex;\n    -webkit-box-align: center;\n    -ms-flex-align: center;\n    -webkit-align-items: center;\n    -moz-align-items: center;\n    align-items: center; }\n    .item-options .button:before {\n      margin: 0 auto; }\n\n/**\n * Lists\n * --------------------------------------------------\n */\n.list {\n  position: relative;\n  padding-top: 1px;\n  padding-bottom: 1px;\n  padding-left: 0;\n  margin-bottom: 20px; }\n\n.list:last-child {\n  margin-bottom: 0px; }\n  .list:last-child.card {\n    margin-bottom: 40px; }\n\n/**\n * List Header\n * --------------------------------------------------\n */\n.list-header {\n  margin-top: 20px;\n  padding: 5px 15px;\n  background-color: transparent;\n  color: #222;\n  font-weight: bold; }\n\n.card.list .list-item {\n  padding-right: 1px;\n  padding-left: 1px; }\n\n/**\n * Cards and Inset Lists\n * --------------------------------------------------\n * A card and list-inset are close to the same thing, except a card as a box shadow.\n */\n.card, .list-inset {\n  overflow: hidden;\n  margin: 20px 10px;\n  border-radius: 2px;\n  background-color: #fff; }\n\n.card {\n  padding-top: 1px;\n  padding-bottom: 1px;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }\n  .card .item {\n    border-left: 0;\n    border-right: 0; }\n  .card .item:first-child {\n    border-top: 0; }\n  .card .item:last-child {\n    border-bottom: 0; }\n\n.padding .card, .padding .list-inset {\n  margin-left: 0;\n  margin-right: 0; }\n\n.card .item:first-child, .list-inset .item:first-child, .padding > .list .item:first-child {\n  border-top-left-radius: 2px;\n  border-top-right-radius: 2px; }\n  .card .item:first-child .item-content, .list-inset .item:first-child .item-content, .padding > .list .item:first-child .item-content {\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px; }\n.card .item:last-child, .list-inset .item:last-child, .padding > .list .item:last-child {\n  border-bottom-right-radius: 2px;\n  border-bottom-left-radius: 2px; }\n  .card .item:last-child .item-content, .list-inset .item:last-child .item-content, .padding > .list .item:last-child .item-content {\n    border-bottom-right-radius: 2px;\n    border-bottom-left-radius: 2px; }\n\n.card .item:last-child, .list-inset .item:last-child {\n  margin-bottom: -1px; }\n\n.card .item, .list-inset .item, .padding > .list .item, .padding-horizontal > .list .item {\n  margin-right: 0;\n  margin-left: 0; }\n  .card .item.item-input input, .list-inset .item.item-input input, .padding > .list .item.item-input input, .padding-horizontal > .list .item.item-input input {\n    padding-right: 44px; }\n\n.padding-left > .list .item {\n  margin-left: 0; }\n\n.padding-right > .list .item {\n  margin-right: 0; }\n\n/**\n * Badges\n * --------------------------------------------------\n */\n.badge {\n  background-color: transparent;\n  color: #AAAAAA;\n  z-index: 1;\n  display: inline-block;\n  padding: 3px 8px;\n  min-width: 10px;\n  border-radius: 10px;\n  vertical-align: baseline;\n  text-align: center;\n  white-space: nowrap;\n  font-weight: bold;\n  font-size: 14px;\n  line-height: 16px; }\n  .badge:empty {\n    display: none; }\n\n.tabs .tab-item .badge.badge-light, .badge.badge-light {\n  background-color: #fff;\n  color: #444; }\n.tabs .tab-item .badge.badge-stable, .badge.badge-stable {\n  background-color: #f8f8f8;\n  color: #444; }\n.tabs .tab-item .badge.badge-positive, .badge.badge-positive {\n  background-color: #387ef5;\n  color: #fff; }\n.tabs .tab-item .badge.badge-calm, .badge.badge-calm {\n  background-color: #11c1f3;\n  color: #fff; }\n.tabs .tab-item .badge.badge-assertive, .badge.badge-assertive {\n  background-color: #ef473a;\n  color: #fff; }\n.tabs .tab-item .badge.badge-balanced, .badge.badge-balanced {\n  background-color: #33cd5f;\n  color: #fff; }\n.tabs .tab-item .badge.badge-energized, .badge.badge-energized {\n  background-color: #ffc900;\n  color: #fff; }\n.tabs .tab-item .badge.badge-royal, .badge.badge-royal {\n  background-color: #886aea;\n  color: #fff; }\n.tabs .tab-item .badge.badge-dark, .badge.badge-dark {\n  background-color: #444;\n  color: #fff; }\n\n.button .badge {\n  position: relative;\n  top: -1px; }\n\n/**\n * Slide Box\n * --------------------------------------------------\n */\n.slider {\n  position: relative;\n  visibility: hidden;\n  overflow: hidden; }\n\n.slider-slides {\n  position: relative;\n  height: 100%; }\n\n.slider-slide {\n  position: relative;\n  display: block;\n  float: left;\n  width: 100%;\n  height: 100%;\n  vertical-align: top; }\n\n.slider-slide-image > img {\n  width: 100%; }\n\n.slider-pager {\n  position: absolute;\n  bottom: 20px;\n  z-index: 1;\n  width: 100%;\n  height: 15px;\n  text-align: center; }\n  .slider-pager .slider-pager-page {\n    display: inline-block;\n    margin: 0px 3px;\n    width: 15px;\n    color: #000;\n    text-decoration: none;\n    opacity: 0.3; }\n    .slider-pager .slider-pager-page.active {\n      -webkit-transition: opacity 0.4s ease-in;\n      transition: opacity 0.4s ease-in;\n      opacity: 1; }\n\n.scroll-refresher {\n  position: absolute;\n  top: -60px;\n  right: 0;\n  left: 0;\n  overflow: hidden;\n  margin: auto;\n  height: 60px; }\n  .scroll-refresher .ionic-refresher-content {\n    position: absolute;\n    bottom: 15px;\n    left: 0;\n    width: 100%;\n    color: #666666;\n    text-align: center;\n    font-size: 30px; }\n    .scroll-refresher .ionic-refresher-content .text-refreshing, .scroll-refresher .ionic-refresher-content .text-pulling {\n      font-size: 16px;\n      line-height: 16px; }\n    .scroll-refresher .ionic-refresher-content.ionic-refresher-with-text {\n      bottom: 10px; }\n  .scroll-refresher .icon-refreshing, .scroll-refresher .icon-pulling {\n    width: 100%;\n    -webkit-backface-visibility: hidden;\n    backface-visibility: hidden;\n    -webkit-transform-style: preserve-3d;\n    transform-style: preserve-3d; }\n  .scroll-refresher .icon-pulling {\n    -webkit-animation-name: refresh-spin-back;\n    animation-name: refresh-spin-back;\n    -webkit-animation-duration: 200ms;\n    animation-duration: 200ms;\n    -webkit-animation-timing-function: linear;\n    animation-timing-function: linear;\n    -webkit-animation-fill-mode: none;\n    animation-fill-mode: none;\n    -webkit-transform: translate3d(0, 0, 0) rotate(0deg);\n    transform: translate3d(0, 0, 0) rotate(0deg); }\n  .scroll-refresher .icon-refreshing, .scroll-refresher .text-refreshing {\n    display: none; }\n  .scroll-refresher .icon-refreshing {\n    -webkit-animation-duration: 1.5s;\n    animation-duration: 1.5s; }\n  .scroll-refresher.active .icon-pulling:not(.pulling-rotation-disabled) {\n    -webkit-animation-name: refresh-spin;\n    animation-name: refresh-spin;\n    -webkit-transform: translate3d(0, 0, 0) rotate(-180deg);\n    transform: translate3d(0, 0, 0) rotate(-180deg); }\n  .scroll-refresher.active.refreshing {\n    -webkit-transition: -webkit-transform .2s;\n    transition: -webkit-transform .2s;\n    -webkit-transition: transform .2s;\n    transition: transform .2s;\n    -webkit-transform: scale(1, 1);\n    transform: scale(1, 1); }\n    .scroll-refresher.active.refreshing .icon-pulling, .scroll-refresher.active.refreshing .text-pulling {\n      display: none; }\n    .scroll-refresher.active.refreshing .icon-refreshing, .scroll-refresher.active.refreshing .text-refreshing {\n      display: block; }\n    .scroll-refresher.active.refreshing.refreshing-tail {\n      -webkit-transform: scale(0, 0);\n      transform: scale(0, 0); }\n\n.overflow-scroll > .scroll {\n  -webkit-overflow-scrolling: touch;\n  width: 100%; }\n  .overflow-scroll > .scroll.overscroll {\n    position: fixed; }\n\n@-webkit-keyframes refresh-spin {\n  0% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(0); }\n\n  100% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(180deg); } }\n\n@keyframes refresh-spin {\n  0% {\n    transform: translate3d(0, 0, 0) rotate(0); }\n\n  100% {\n    transform: translate3d(0, 0, 0) rotate(180deg); } }\n\n@-webkit-keyframes refresh-spin-back {\n  0% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(180deg); }\n\n  100% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(0); } }\n\n@keyframes refresh-spin-back {\n  0% {\n    transform: translate3d(0, 0, 0) rotate(180deg); }\n\n  100% {\n    transform: translate3d(0, 0, 0) rotate(0); } }\n\n/**\n * Spinners\n * --------------------------------------------------\n */\n.spinner {\n  stroke: #444;\n  fill: #444; }\n  .spinner svg {\n    width: 28px;\n    height: 28px; }\n  .spinner.spinner-light {\n    stroke: #fff;\n    fill: #fff; }\n  .spinner.spinner-stable {\n    stroke: #f8f8f8;\n    fill: #f8f8f8; }\n  .spinner.spinner-positive {\n    stroke: #387ef5;\n    fill: #387ef5; }\n  .spinner.spinner-calm {\n    stroke: #11c1f3;\n    fill: #11c1f3; }\n  .spinner.spinner-balanced {\n    stroke: #33cd5f;\n    fill: #33cd5f; }\n  .spinner.spinner-assertive {\n    stroke: #ef473a;\n    fill: #ef473a; }\n  .spinner.spinner-energized {\n    stroke: #ffc900;\n    fill: #ffc900; }\n  .spinner.spinner-royal {\n    stroke: #886aea;\n    fill: #886aea; }\n  .spinner.spinner-dark {\n    stroke: #444;\n    fill: #444; }\n\n.spinner-android {\n  stroke: #4b8bf4; }\n\n.spinner-ios, .spinner-ios-small {\n  stroke: #69717d; }\n\n.spinner-spiral .stop1 {\n  stop-color: #fff;\n  stop-opacity: 0; }\n.spinner-spiral.spinner-light .stop1 {\n  stop-color: #444; }\n.spinner-spiral.spinner-light .stop2 {\n  stop-color: #fff; }\n.spinner-spiral.spinner-stable .stop2 {\n  stop-color: #f8f8f8; }\n.spinner-spiral.spinner-positive .stop2 {\n  stop-color: #387ef5; }\n.spinner-spiral.spinner-calm .stop2 {\n  stop-color: #11c1f3; }\n.spinner-spiral.spinner-balanced .stop2 {\n  stop-color: #33cd5f; }\n.spinner-spiral.spinner-assertive .stop2 {\n  stop-color: #ef473a; }\n.spinner-spiral.spinner-energized .stop2 {\n  stop-color: #ffc900; }\n.spinner-spiral.spinner-royal .stop2 {\n  stop-color: #886aea; }\n.spinner-spiral.spinner-dark .stop2 {\n  stop-color: #444; }\n\n/**\n * Forms\n * --------------------------------------------------\n */\nform {\n  margin: 0 0 1.42857; }\n\nlegend {\n  display: block;\n  margin-bottom: 1.42857;\n  padding: 0;\n  width: 100%;\n  border: 1px solid #ddd;\n  color: #444;\n  font-size: 21px;\n  line-height: 2.85714; }\n  legend small {\n    color: #f8f8f8;\n    font-size: 1.07143; }\n\nlabel, input, button, select, textarea {\n  font-weight: normal;\n  font-size: 14px;\n  line-height: 1.42857; }\n\ninput, button, select, textarea {\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif; }\n\n.item-input {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: relative;\n  overflow: hidden;\n  padding: 6px 0 5px 16px; }\n  .item-input input {\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-box-flex: 1;\n    -webkit-flex: 1 220px;\n    -moz-box-flex: 1;\n    -moz-flex: 1 220px;\n    -ms-flex: 1 220px;\n    flex: 1 220px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none;\n    margin: 0;\n    padding-right: 24px;\n    background-color: transparent; }\n  .item-input .button .icon {\n    -webkit-box-flex: 0;\n    -webkit-flex: 0 0 24px;\n    -moz-box-flex: 0;\n    -moz-flex: 0 0 24px;\n    -ms-flex: 0 0 24px;\n    flex: 0 0 24px;\n    position: static;\n    display: inline-block;\n    height: auto;\n    text-align: center;\n    font-size: 16px; }\n  .item-input .button-bar {\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-box-flex: 1;\n    -webkit-flex: 1 0 220px;\n    -moz-box-flex: 1;\n    -moz-flex: 1 0 220px;\n    -ms-flex: 1 0 220px;\n    flex: 1 0 220px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none; }\n  .item-input .icon {\n    min-width: 14px; }\n\n.platform-windowsphone .item-input input {\n  flex-shrink: 1; }\n\n.item-input-inset {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: relative;\n  overflow: hidden;\n  padding: 10.66667px; }\n\n.item-input-wrapper {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 1;\n  -webkit-flex: 1 0;\n  -moz-box-flex: 1;\n  -moz-flex: 1 0;\n  -ms-flex: 1 0;\n  flex: 1 0;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  -webkit-border-radius: 4px;\n  border-radius: 4px;\n  padding-right: 8px;\n  padding-left: 8px;\n  background: #eee; }\n\n.item-input-inset .item-input-wrapper input {\n  padding-left: 4px;\n  height: 29px;\n  background: transparent;\n  line-height: 18px; }\n\n.item-input-wrapper ~ .button {\n  margin-left: 10.66667px; }\n\n.input-label {\n  display: table;\n  padding: 7px 10px 7px 0px;\n  max-width: 200px;\n  width: 35%;\n  color: #444;\n  font-size: 16px; }\n\n.placeholder-icon {\n  color: #aaa; }\n  .placeholder-icon:first-child {\n    padding-right: 6px; }\n  .placeholder-icon:last-child {\n    padding-left: 6px; }\n\n.item-stacked-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none; }\n  .item-stacked-label .input-label, .item-stacked-label .icon {\n    display: inline-block;\n    padding: 4px 0 0 0px;\n    vertical-align: middle; }\n\n.item-stacked-label input, .item-stacked-label textarea {\n  -webkit-border-radius: 2px;\n  border-radius: 2px;\n  padding: 4px 8px 3px 0;\n  border: none;\n  background-color: #fff; }\n\n.item-stacked-label input {\n  overflow: hidden;\n  height: 46px; }\n\n.item-floating-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none; }\n  .item-floating-label .input-label {\n    position: relative;\n    padding: 5px 0 0 0;\n    opacity: 0;\n    top: 10px;\n    -webkit-transition: opacity .15s ease-in, top .2s linear;\n    transition: opacity .15s ease-in, top .2s linear; }\n    .item-floating-label .input-label.has-input {\n      opacity: 1;\n      top: 0;\n      -webkit-transition: opacity .15s ease-in, top .2s linear;\n      transition: opacity .15s ease-in, top .2s linear; }\n\ntextarea, input[type=\"text\"], input[type=\"password\"], input[type=\"datetime\"], input[type=\"datetime-local\"], input[type=\"date\"], input[type=\"month\"], input[type=\"time\"], input[type=\"week\"], input[type=\"number\"], input[type=\"email\"], input[type=\"url\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"color\"] {\n  display: block;\n  padding-top: 2px;\n  padding-left: 0;\n  height: 34px;\n  color: #111;\n  vertical-align: middle;\n  font-size: 14px;\n  line-height: 16px; }\n\n.platform-ios input[type=\"datetime-local\"], .platform-ios input[type=\"date\"], .platform-ios input[type=\"month\"], .platform-ios input[type=\"time\"], .platform-ios input[type=\"week\"], .platform-android input[type=\"datetime-local\"], .platform-android input[type=\"date\"], .platform-android input[type=\"month\"], .platform-android input[type=\"time\"], .platform-android input[type=\"week\"] {\n  padding-top: 8px; }\n\n.item-input input, .item-input textarea {\n  width: 100%; }\n\ntextarea {\n  padding-left: 0; }\n  textarea::-moz-placeholder {\n    color: #aaaaaa; }\n  textarea:-ms-input-placeholder {\n    color: #aaaaaa; }\n  textarea::-webkit-input-placeholder {\n    color: #aaaaaa;\n    text-indent: -3px; }\n\ntextarea {\n  height: auto; }\n\ntextarea, input[type=\"text\"], input[type=\"password\"], input[type=\"datetime\"], input[type=\"datetime-local\"], input[type=\"date\"], input[type=\"month\"], input[type=\"time\"], input[type=\"week\"], input[type=\"number\"], input[type=\"email\"], input[type=\"url\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"color\"] {\n  border: 0; }\n\ninput[type=\"radio\"], input[type=\"checkbox\"] {\n  margin: 0;\n  line-height: normal; }\n\n.item-input input[type=\"file\"], .item-input input[type=\"image\"], .item-input input[type=\"submit\"], .item-input input[type=\"reset\"], .item-input input[type=\"button\"], .item-input input[type=\"radio\"], .item-input input[type=\"checkbox\"] {\n  width: auto; }\n\ninput[type=\"file\"] {\n  line-height: 34px; }\n\n.previous-input-focus, .cloned-text-input + input, .cloned-text-input + textarea {\n  position: absolute !important;\n  left: -9999px;\n  width: 200px; }\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n  color: #aaaaaa; }\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n  color: #aaaaaa; }\ninput::-webkit-input-placeholder, textarea::-webkit-input-placeholder {\n  color: #aaaaaa;\n  text-indent: 0; }\n\ninput[disabled], select[disabled], textarea[disabled], input[readonly]:not(.cloned-text-input), textarea[readonly]:not(.cloned-text-input), select[readonly] {\n  background-color: #f8f8f8;\n  cursor: not-allowed; }\n\ninput[type=\"radio\"][disabled], input[type=\"checkbox\"][disabled], input[type=\"radio\"][readonly], input[type=\"checkbox\"][readonly] {\n  background-color: transparent; }\n\n/**\n * Checkbox\n * --------------------------------------------------\n */\n.checkbox {\n  position: relative;\n  display: inline-block;\n  padding: 7px 7px;\n  cursor: pointer; }\n  .checkbox input:before, .checkbox .checkbox-icon:before {\n    border-color: #ddd; }\n  .checkbox input:checked:before, .checkbox input:checked + .checkbox-icon:before {\n    background: #387ef5;\n    border-color: #387ef5; }\n\n.checkbox-light input:before, .checkbox-light .checkbox-icon:before {\n  border-color: #ddd; }\n.checkbox-light input:checked:before, .checkbox-light input:checked + .checkbox-icon:before {\n  background: #ddd;\n  border-color: #ddd; }\n\n.checkbox-stable input:before, .checkbox-stable .checkbox-icon:before {\n  border-color: #b2b2b2; }\n.checkbox-stable input:checked:before, .checkbox-stable input:checked + .checkbox-icon:before {\n  background: #b2b2b2;\n  border-color: #b2b2b2; }\n\n.checkbox-positive input:before, .checkbox-positive .checkbox-icon:before {\n  border-color: #387ef5; }\n.checkbox-positive input:checked:before, .checkbox-positive input:checked + .checkbox-icon:before {\n  background: #387ef5;\n  border-color: #387ef5; }\n\n.checkbox-calm input:before, .checkbox-calm .checkbox-icon:before {\n  border-color: #11c1f3; }\n.checkbox-calm input:checked:before, .checkbox-calm input:checked + .checkbox-icon:before {\n  background: #11c1f3;\n  border-color: #11c1f3; }\n\n.checkbox-assertive input:before, .checkbox-assertive .checkbox-icon:before {\n  border-color: #ef473a; }\n.checkbox-assertive input:checked:before, .checkbox-assertive input:checked + .checkbox-icon:before {\n  background: #ef473a;\n  border-color: #ef473a; }\n\n.checkbox-balanced input:before, .checkbox-balanced .checkbox-icon:before {\n  border-color: #33cd5f; }\n.checkbox-balanced input:checked:before, .checkbox-balanced input:checked + .checkbox-icon:before {\n  background: #33cd5f;\n  border-color: #33cd5f; }\n\n.checkbox-energized input:before, .checkbox-energized .checkbox-icon:before {\n  border-color: #ffc900; }\n.checkbox-energized input:checked:before, .checkbox-energized input:checked + .checkbox-icon:before {\n  background: #ffc900;\n  border-color: #ffc900; }\n\n.checkbox-royal input:before, .checkbox-royal .checkbox-icon:before {\n  border-color: #886aea; }\n.checkbox-royal input:checked:before, .checkbox-royal input:checked + .checkbox-icon:before {\n  background: #886aea;\n  border-color: #886aea; }\n\n.checkbox-dark input:before, .checkbox-dark .checkbox-icon:before {\n  border-color: #444; }\n.checkbox-dark input:checked:before, .checkbox-dark input:checked + .checkbox-icon:before {\n  background: #444;\n  border-color: #444; }\n\n.checkbox input:disabled:before, .checkbox input:disabled + .checkbox-icon:before {\n  border-color: #ddd; }\n\n.checkbox input:disabled:checked:before, .checkbox input:disabled:checked + .checkbox-icon:before {\n  background: #ddd; }\n\n.checkbox.checkbox-input-hidden input {\n  display: none !important; }\n\n.checkbox input, .checkbox-icon {\n  position: relative;\n  width: 28px;\n  height: 28px;\n  display: block;\n  border: 0;\n  background: transparent;\n  cursor: pointer;\n  -webkit-appearance: none; }\n  .checkbox input:before, .checkbox-icon:before {\n    display: table;\n    width: 100%;\n    height: 100%;\n    border-width: 1px;\n    border-style: solid;\n    border-radius: 28px;\n    background: #fff;\n    content: ' ';\n    -webkit-transition: background-color 20ms ease-in-out;\n    transition: background-color 20ms ease-in-out; }\n\n.checkbox input:checked:before, input:checked + .checkbox-icon:before {\n  border-width: 2px; }\n\n.checkbox input:after, .checkbox-icon:after {\n  -webkit-transition: opacity .05s ease-in-out;\n  transition: opacity .05s ease-in-out;\n  -webkit-transform: rotate(-45deg);\n  transform: rotate(-45deg);\n  position: absolute;\n  top: 33%;\n  left: 25%;\n  display: table;\n  width: 14px;\n  height: 6px;\n  border: 1px solid #fff;\n  border-top: 0;\n  border-right: 0;\n  content: ' ';\n  opacity: 0; }\n\n.platform-android .checkbox-platform input:before, .platform-android .checkbox-platform .checkbox-icon:before, .checkbox-square input:before, .checkbox-square .checkbox-icon:before {\n  border-radius: 2px;\n  width: 72%;\n  height: 72%;\n  margin-top: 14%;\n  margin-left: 14%;\n  border-width: 2px; }\n\n.platform-android .checkbox-platform input:after, .platform-android .checkbox-platform .checkbox-icon:after, .checkbox-square input:after, .checkbox-square .checkbox-icon:after {\n  border-width: 2px;\n  top: 19%;\n  left: 25%;\n  width: 13px;\n  height: 7px; }\n\n.grade-c .checkbox input:after, .grade-c .checkbox-icon:after {\n  -webkit-transform: rotate(0);\n  transform: rotate(0);\n  top: 3px;\n  left: 4px;\n  border: none;\n  color: #fff;\n  content: '\\2713';\n  font-weight: bold;\n  font-size: 20px; }\n\n.checkbox input:checked:after, input:checked + .checkbox-icon:after {\n  opacity: 1; }\n\n.item-checkbox {\n  padding-left: 60px; }\n  .item-checkbox.active {\n    box-shadow: none; }\n\n.item-checkbox .checkbox {\n  position: absolute;\n  top: 50%;\n  right: 8px;\n  left: 8px;\n  z-index: 3;\n  margin-top: -21px; }\n\n.item-checkbox.item-checkbox-right {\n  padding-right: 60px;\n  padding-left: 16px; }\n\n.item-checkbox-right .checkbox input, .item-checkbox-right .checkbox-icon {\n  float: right; }\n\n/**\n * Toggle\n * --------------------------------------------------\n */\n.item-toggle {\n  pointer-events: none; }\n\n.toggle {\n  position: relative;\n  display: inline-block;\n  pointer-events: auto;\n  margin: -5px;\n  padding: 5px; }\n  .toggle input:checked + .track {\n    border-color: #4cd964;\n    background-color: #4cd964; }\n  .toggle.dragging .handle {\n    background-color: #f2f2f2 !important; }\n\n.toggle.toggle-light input:checked + .track {\n  border-color: #ddd;\n  background-color: #ddd; }\n.toggle.toggle-stable input:checked + .track {\n  border-color: #b2b2b2;\n  background-color: #b2b2b2; }\n.toggle.toggle-positive input:checked + .track {\n  border-color: #387ef5;\n  background-color: #387ef5; }\n.toggle.toggle-calm input:checked + .track {\n  border-color: #11c1f3;\n  background-color: #11c1f3; }\n.toggle.toggle-assertive input:checked + .track {\n  border-color: #ef473a;\n  background-color: #ef473a; }\n.toggle.toggle-balanced input:checked + .track {\n  border-color: #33cd5f;\n  background-color: #33cd5f; }\n.toggle.toggle-energized input:checked + .track {\n  border-color: #ffc900;\n  background-color: #ffc900; }\n.toggle.toggle-royal input:checked + .track {\n  border-color: #886aea;\n  background-color: #886aea; }\n.toggle.toggle-dark input:checked + .track {\n  border-color: #444;\n  background-color: #444; }\n\n.toggle input {\n  display: none; }\n\n/* the track appearance when the toggle is \"off\" */\n.toggle .track {\n  -webkit-transition-timing-function: ease-in-out;\n  transition-timing-function: ease-in-out;\n  -webkit-transition-duration: 0.3s;\n  transition-duration: 0.3s;\n  -webkit-transition-property: background-color, border;\n  transition-property: background-color, border;\n  display: inline-block;\n  box-sizing: border-box;\n  width: 51px;\n  height: 31px;\n  border: solid 2px #e6e6e6;\n  border-radius: 20px;\n  background-color: #fff;\n  content: ' ';\n  cursor: pointer;\n  pointer-events: none; }\n\n/* Fix to avoid background color bleeding */\n/* (occured on (at least) Android 4.2, Asus MeMO Pad HD7 ME173X) */\n.platform-android4_2 .toggle .track {\n  -webkit-background-clip: padding-box; }\n\n/* the handle (circle) thats inside the toggle's track area */\n/* also the handle's appearance when it is \"off\" */\n.toggle .handle {\n  -webkit-transition: 0.3s cubic-bezier(0, 1.1, 1, 1.1);\n  transition: 0.3s cubic-bezier(0, 1.1, 1, 1.1);\n  -webkit-transition-property: background-color, transform;\n  transition-property: background-color, transform;\n  position: absolute;\n  display: block;\n  width: 27px;\n  height: 27px;\n  border-radius: 27px;\n  background-color: #fff;\n  top: 7px;\n  left: 7px;\n  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.15); }\n  .toggle .handle:before {\n    position: absolute;\n    top: -4px;\n    left: -21.5px;\n    padding: 18.5px 34px;\n    content: \" \"; }\n\n.toggle input:checked + .track .handle {\n  -webkit-transform: translate3d(20px, 0, 0);\n  transform: translate3d(20px, 0, 0);\n  background-color: #fff; }\n\n.item-toggle.active {\n  box-shadow: none; }\n\n.item-toggle, .item-toggle.item-complex .item-content {\n  padding-right: 99px; }\n\n.item-toggle.item-complex {\n  padding-right: 0; }\n\n.item-toggle .toggle {\n  position: absolute;\n  top: 10px;\n  right: 16px;\n  z-index: 3; }\n\n.toggle input:disabled + .track {\n  opacity: .6; }\n\n.toggle-small .track {\n  border: 0;\n  width: 34px;\n  height: 15px;\n  background: #9e9e9e; }\n.toggle-small input:checked + .track {\n  background: rgba(0, 150, 137, 0.5); }\n.toggle-small .handle {\n  top: 2px;\n  left: 4px;\n  width: 21px;\n  height: 21px;\n  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); }\n.toggle-small input:checked + .track .handle {\n  -webkit-transform: translate3d(16px, 0, 0);\n  transform: translate3d(16px, 0, 0);\n  background: #009689; }\n.toggle-small.item-toggle .toggle {\n  top: 19px; }\n.toggle-small .toggle-light input:checked + .track {\n  background-color: rgba(221, 221, 221, 0.5); }\n.toggle-small .toggle-light input:checked + .track .handle {\n  background-color: #ddd; }\n.toggle-small .toggle-stable input:checked + .track {\n  background-color: rgba(178, 178, 178, 0.5); }\n.toggle-small .toggle-stable input:checked + .track .handle {\n  background-color: #b2b2b2; }\n.toggle-small .toggle-positive input:checked + .track {\n  background-color: rgba(56, 126, 245, 0.5); }\n.toggle-small .toggle-positive input:checked + .track .handle {\n  background-color: #387ef5; }\n.toggle-small .toggle-calm input:checked + .track {\n  background-color: rgba(17, 193, 243, 0.5); }\n.toggle-small .toggle-calm input:checked + .track .handle {\n  background-color: #11c1f3; }\n.toggle-small .toggle-assertive input:checked + .track {\n  background-color: rgba(239, 71, 58, 0.5); }\n.toggle-small .toggle-assertive input:checked + .track .handle {\n  background-color: #ef473a; }\n.toggle-small .toggle-balanced input:checked + .track {\n  background-color: rgba(51, 205, 95, 0.5); }\n.toggle-small .toggle-balanced input:checked + .track .handle {\n  background-color: #33cd5f; }\n.toggle-small .toggle-energized input:checked + .track {\n  background-color: rgba(255, 201, 0, 0.5); }\n.toggle-small .toggle-energized input:checked + .track .handle {\n  background-color: #ffc900; }\n.toggle-small .toggle-royal input:checked + .track {\n  background-color: rgba(136, 106, 234, 0.5); }\n.toggle-small .toggle-royal input:checked + .track .handle {\n  background-color: #886aea; }\n.toggle-small .toggle-dark input:checked + .track {\n  background-color: rgba(68, 68, 68, 0.5); }\n.toggle-small .toggle-dark input:checked + .track .handle {\n  background-color: #444; }\n\n/**\n * Radio Button Inputs\n * --------------------------------------------------\n */\n.item-radio {\n  padding: 0; }\n  .item-radio:hover {\n    cursor: pointer; }\n\n.item-radio .item-content {\n  /* give some room to the right for the checkmark icon */\n  padding-right: 64px; }\n\n.item-radio .radio-icon {\n  /* checkmark icon will be hidden by default */\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 3;\n  visibility: hidden;\n  padding: 14px;\n  height: 100%;\n  font-size: 24px; }\n\n.item-radio input {\n  /* hide any radio button inputs elements (the ugly circles) */\n  position: absolute;\n  left: -9999px; }\n  .item-radio input:checked ~ .item-content {\n    /* style the item content when its checked */\n    background: #f7f7f7; }\n  .item-radio input:checked ~ .radio-icon {\n    /* show the checkmark icon when its checked */\n    visibility: visible; }\n\n.platform-android.grade-b .item-radio, .platform-android.grade-c .item-radio {\n  -webkit-animation: androidCheckedbugfix infinite 1s; }\n\n@-webkit-keyframes androidCheckedbugfix {\n  from {\n    padding: 0; }\n\n  to {\n    padding: 0; } }\n\n/**\n * Range\n * --------------------------------------------------\n */\n.range input {\n  display: inline-block;\n  overflow: hidden;\n  margin-top: 5px;\n  margin-bottom: 5px;\n  padding-right: 2px;\n  padding-left: 1px;\n  width: auto;\n  height: 43px;\n  outline: none;\n  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ccc), color-stop(100%, #ccc));\n  background: linear-gradient(to right, #ccc 0%, #ccc 100%);\n  background-position: center;\n  background-size: 99% 2px;\n  background-repeat: no-repeat;\n  -webkit-appearance: none; }\n  .range input::-webkit-slider-thumb {\n    position: relative;\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background-color: #fff;\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n    -webkit-appearance: none;\n    border: 0; }\n  .range input::-webkit-slider-thumb:before {\n    /* what creates the colorful line on the left side of the slider */\n    position: absolute;\n    top: 13px;\n    left: -2001px;\n    width: 2000px;\n    height: 2px;\n    background: #444;\n    content: ' '; }\n  .range input::-webkit-slider-thumb:after {\n    /* create a larger (but hidden) hit area */\n    position: absolute;\n    top: -15px;\n    left: -15px;\n    padding: 30px;\n    content: ' '; }\n  .range input::-ms-track {\n    background: transparent;\n    border-color: transparent;\n    border-width: 11px 0 16px;\n    color: transparent;\n    margin-top: 20px; }\n  .range input::-ms-thumb {\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background-color: #fff;\n    border-color: #fff;\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2);\n    margin-left: 1px;\n    margin-right: 1px;\n    outline: none; }\n  .range input::-ms-fill-lower {\n    height: 2px;\n    background: #444; }\n  .range input::-ms-fill-upper {\n    height: 2px;\n    background: #ccc; }\n\n.range {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  padding: 2px 11px; }\n  .range.range-light input::-webkit-slider-thumb:before {\n    background: #ddd; }\n  .range.range-light input::-ms-fill-lower {\n    background: #ddd; }\n  .range.range-stable input::-webkit-slider-thumb:before {\n    background: #b2b2b2; }\n  .range.range-stable input::-ms-fill-lower {\n    background: #b2b2b2; }\n  .range.range-positive input::-webkit-slider-thumb:before {\n    background: #387ef5; }\n  .range.range-positive input::-ms-fill-lower {\n    background: #387ef5; }\n  .range.range-calm input::-webkit-slider-thumb:before {\n    background: #11c1f3; }\n  .range.range-calm input::-ms-fill-lower {\n    background: #11c1f3; }\n  .range.range-balanced input::-webkit-slider-thumb:before {\n    background: #33cd5f; }\n  .range.range-balanced input::-ms-fill-lower {\n    background: #33cd5f; }\n  .range.range-assertive input::-webkit-slider-thumb:before {\n    background: #ef473a; }\n  .range.range-assertive input::-ms-fill-lower {\n    background: #ef473a; }\n  .range.range-energized input::-webkit-slider-thumb:before {\n    background: #ffc900; }\n  .range.range-energized input::-ms-fill-lower {\n    background: #ffc900; }\n  .range.range-royal input::-webkit-slider-thumb:before {\n    background: #886aea; }\n  .range.range-royal input::-ms-fill-lower {\n    background: #886aea; }\n  .range.range-dark input::-webkit-slider-thumb:before {\n    background: #444; }\n  .range.range-dark input::-ms-fill-lower {\n    background: #444; }\n\n.range .icon {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0;\n  -moz-box-flex: 0;\n  -moz-flex: 0;\n  -ms-flex: 0;\n  flex: 0;\n  display: block;\n  min-width: 24px;\n  text-align: center;\n  font-size: 24px; }\n\n.range input {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  margin-right: 10px;\n  margin-left: 10px; }\n\n.range-label {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 auto;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 auto;\n  -ms-flex: 0 0 auto;\n  flex: 0 0 auto;\n  display: block;\n  white-space: nowrap; }\n\n.range-label:first-child {\n  padding-left: 5px; }\n\n.range input + .range-label {\n  padding-right: 5px;\n  padding-left: 0; }\n\n.platform-windowsphone .range input {\n  height: auto; }\n\n/**\n * Select\n * --------------------------------------------------\n */\n.item-select {\n  position: relative; }\n  .item-select select {\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none;\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    padding: 14px 48px 16px 16px;\n    max-width: 65%;\n    border: none;\n    background: #fff;\n    color: #333;\n    text-indent: .01px;\n    text-overflow: '';\n    white-space: nowrap;\n    font-size: 14px;\n    cursor: pointer;\n    direction: rtl; }\n  .item-select select::-ms-expand {\n    display: none; }\n  .item-select option {\n    direction: ltr; }\n  .item-select:after {\n    position: absolute;\n    top: 50%;\n    right: 16px;\n    margin-top: -3px;\n    width: 0;\n    height: 0;\n    border-top: 5px solid;\n    border-right: 5px solid transparent;\n    border-left: 5px solid transparent;\n    color: #999;\n    content: \"\";\n    pointer-events: none; }\n  .item-select.item-light select {\n    background: #fff;\n    color: #444; }\n  .item-select.item-stable select {\n    background: #f8f8f8;\n    color: #444; }\n  .item-select.item-stable:after, .item-select.item-stable .input-label {\n    color: #656565; }\n  .item-select.item-positive select {\n    background: #387ef5;\n    color: #fff; }\n  .item-select.item-positive:after, .item-select.item-positive .input-label {\n    color: #fff; }\n  .item-select.item-calm select {\n    background: #11c1f3;\n    color: #fff; }\n  .item-select.item-calm:after, .item-select.item-calm .input-label {\n    color: #fff; }\n  .item-select.item-assertive select {\n    background: #ef473a;\n    color: #fff; }\n  .item-select.item-assertive:after, .item-select.item-assertive .input-label {\n    color: #fff; }\n  .item-select.item-balanced select {\n    background: #33cd5f;\n    color: #fff; }\n  .item-select.item-balanced:after, .item-select.item-balanced .input-label {\n    color: #fff; }\n  .item-select.item-energized select {\n    background: #ffc900;\n    color: #fff; }\n  .item-select.item-energized:after, .item-select.item-energized .input-label {\n    color: #fff; }\n  .item-select.item-royal select {\n    background: #886aea;\n    color: #fff; }\n  .item-select.item-royal:after, .item-select.item-royal .input-label {\n    color: #fff; }\n  .item-select.item-dark select {\n    background: #444;\n    color: #fff; }\n  .item-select.item-dark:after, .item-select.item-dark .input-label {\n    color: #fff; }\n\nselect[multiple], select[size] {\n  height: auto; }\n\n/**\n * Progress\n * --------------------------------------------------\n */\nprogress {\n  display: block;\n  margin: 15px auto;\n  width: 100%; }\n\n/**\n * Buttons\n * --------------------------------------------------\n */\n.button {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444;\n  position: relative;\n  display: inline-block;\n  margin: 0;\n  padding: 0 12px;\n  min-width: 52px;\n  min-height: 47px;\n  border-width: 1px;\n  border-style: solid;\n  border-radius: 2px;\n  vertical-align: top;\n  text-align: center;\n  text-overflow: ellipsis;\n  font-size: 16px;\n  line-height: 42px;\n  cursor: pointer; }\n  .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .button.active, .button.activated {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .button:after {\n    position: absolute;\n    top: -6px;\n    right: -6px;\n    bottom: -6px;\n    left: -6px;\n    content: ' '; }\n  .button .icon {\n    vertical-align: top;\n    pointer-events: none; }\n  .button .icon:before, .button.icon:before, .button.icon-left:before, .button.icon-right:before {\n    display: inline-block;\n    padding: 0 0 1px 0;\n    vertical-align: inherit;\n    font-size: 24px;\n    line-height: 41px;\n    pointer-events: none; }\n  .button.icon-left:before {\n    float: left;\n    padding-right: .2em;\n    padding-left: 0; }\n  .button.icon-right:before {\n    float: right;\n    padding-right: 0;\n    padding-left: .2em; }\n  .button.button-block, .button.button-full {\n    margin-top: 10px;\n    margin-bottom: 10px; }\n  .button.button-light {\n    border-color: #ddd;\n    background-color: #fff;\n    color: #444; }\n    .button.button-light:hover {\n      color: #444;\n      text-decoration: none; }\n    .button.button-light.active, .button.button-light.activated {\n      border-color: #ccc;\n      background-color: #fafafa;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-light.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ddd; }\n    .button.button-light.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-light.button-outline {\n      border-color: #ddd;\n      background: transparent;\n      color: #ddd; }\n      .button.button-light.button-outline.active, .button.button-light.button-outline.activated {\n        background-color: #ddd;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    color: #444; }\n    .button.button-stable:hover {\n      color: #444;\n      text-decoration: none; }\n    .button.button-stable.active, .button.button-stable.activated {\n      border-color: #a2a2a2;\n      background-color: #e5e5e5;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-stable.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #b2b2b2; }\n    .button.button-stable.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-stable.button-outline {\n      border-color: #b2b2b2;\n      background: transparent;\n      color: #b2b2b2; }\n      .button.button-stable.button-outline.active, .button.button-stable.button-outline.activated {\n        background-color: #b2b2b2;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-positive {\n    border-color: #0c60ee;\n    background-color: #387ef5;\n    color: #fff; }\n    .button.button-positive:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-positive.active, .button.button-positive.activated {\n      border-color: #0c60ee;\n      background-color: #0c60ee;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-positive.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #387ef5; }\n    .button.button-positive.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-positive.button-outline {\n      border-color: #387ef5;\n      background: transparent;\n      color: #387ef5; }\n      .button.button-positive.button-outline.active, .button.button-positive.button-outline.activated {\n        background-color: #387ef5;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-calm {\n    border-color: #0a9dc7;\n    background-color: #11c1f3;\n    color: #fff; }\n    .button.button-calm:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-calm.active, .button.button-calm.activated {\n      border-color: #0a9dc7;\n      background-color: #0a9dc7;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-calm.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #11c1f3; }\n    .button.button-calm.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-calm.button-outline {\n      border-color: #11c1f3;\n      background: transparent;\n      color: #11c1f3; }\n      .button.button-calm.button-outline.active, .button.button-calm.button-outline.activated {\n        background-color: #11c1f3;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-assertive {\n    border-color: #e42112;\n    background-color: #ef473a;\n    color: #fff; }\n    .button.button-assertive:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-assertive.active, .button.button-assertive.activated {\n      border-color: #e42112;\n      background-color: #e42112;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-assertive.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ef473a; }\n    .button.button-assertive.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-assertive.button-outline {\n      border-color: #ef473a;\n      background: transparent;\n      color: #ef473a; }\n      .button.button-assertive.button-outline.active, .button.button-assertive.button-outline.activated {\n        background-color: #ef473a;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    color: #fff; }\n    .button.button-balanced:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-balanced.active, .button.button-balanced.activated {\n      border-color: #28a54c;\n      background-color: #28a54c;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-balanced.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #33cd5f; }\n    .button.button-balanced.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-balanced.button-outline {\n      border-color: #33cd5f;\n      background: transparent;\n      color: #33cd5f; }\n      .button.button-balanced.button-outline.active, .button.button-balanced.button-outline.activated {\n        background-color: #33cd5f;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-energized {\n    border-color: #e6b500;\n    background-color: #ffc900;\n    color: #fff; }\n    .button.button-energized:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-energized.active, .button.button-energized.activated {\n      border-color: #e6b500;\n      background-color: #e6b500;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-energized.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ffc900; }\n    .button.button-energized.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-energized.button-outline {\n      border-color: #ffc900;\n      background: transparent;\n      color: #ffc900; }\n      .button.button-energized.button-outline.active, .button.button-energized.button-outline.activated {\n        background-color: #ffc900;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    color: #fff; }\n    .button.button-royal:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-royal.active, .button.button-royal.activated {\n      border-color: #6b46e5;\n      background-color: #6b46e5;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-royal.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #886aea; }\n    .button.button-royal.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-royal.button-outline {\n      border-color: #886aea;\n      background: transparent;\n      color: #886aea; }\n      .button.button-royal.button-outline.active, .button.button-royal.button-outline.activated {\n        background-color: #886aea;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-dark {\n    border-color: #111;\n    background-color: #444;\n    color: #fff; }\n    .button.button-dark:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-dark.active, .button.button-dark.activated {\n      border-color: #000;\n      background-color: #262626;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-dark.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #444; }\n    .button.button-dark.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-dark.button-outline {\n      border-color: #444;\n      background: transparent;\n      color: #444; }\n      .button.button-dark.button-outline.active, .button.button-dark.button-outline.activated {\n        background-color: #444;\n        box-shadow: none;\n        color: #fff; }\n\n.button-small {\n  padding: 2px 4px 1px;\n  min-width: 28px;\n  min-height: 30px;\n  font-size: 12px;\n  line-height: 26px; }\n  .button-small .icon:before, .button-small.icon:before, .button-small.icon-left:before, .button-small.icon-right:before {\n    font-size: 16px;\n    line-height: 19px;\n    margin-top: 3px; }\n\n.button-large {\n  padding: 0 16px;\n  min-width: 68px;\n  min-height: 59px;\n  font-size: 20px;\n  line-height: 53px; }\n  .button-large .icon:before, .button-large.icon:before, .button-large.icon-left:before, .button-large.icon-right:before {\n    padding-bottom: 2px;\n    font-size: 32px;\n    line-height: 51px; }\n\n.button-icon {\n  -webkit-transition: opacity .1s;\n  transition: opacity .1s;\n  padding: 0 6px;\n  min-width: initial;\n  border-color: transparent;\n  background: none; }\n  .button-icon.button.active, .button-icon.button.activated {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    opacity: 0.3; }\n  .button-icon .icon:before, .button-icon.icon:before {\n    font-size: 32px; }\n\n.button-clear {\n  -webkit-transition: opacity .1s;\n  transition: opacity .1s;\n  padding: 0 6px;\n  max-height: 42px;\n  border-color: transparent;\n  background: none;\n  box-shadow: none; }\n  .button-clear.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #b2b2b2; }\n  .button-clear.button-icon {\n    border-color: transparent;\n    background: none; }\n  .button-clear.active, .button-clear.activated {\n    opacity: 0.3; }\n\n.button-outline {\n  -webkit-transition: opacity .1s;\n  transition: opacity .1s;\n  background: none;\n  box-shadow: none; }\n  .button-outline.button-outline {\n    border-color: #b2b2b2;\n    background: transparent;\n    color: #b2b2b2; }\n    .button-outline.button-outline.active, .button-outline.button-outline.activated {\n      background-color: #b2b2b2;\n      box-shadow: none;\n      color: #fff; }\n\n.padding > .button.button-block:first-child {\n  margin-top: 0; }\n\n.button-block {\n  display: block;\n  clear: both; }\n  .button-block:after {\n    clear: both; }\n\n.button-full, .button-full > .button {\n  display: block;\n  margin-right: 0;\n  margin-left: 0;\n  border-right-width: 0;\n  border-left-width: 0;\n  border-radius: 0; }\n\nbutton.button-block, button.button-full, .button-full > button.button, input.button.button-block {\n  width: 100%; }\n\na.button {\n  text-decoration: none; }\n  a.button .icon:before, a.button.icon:before, a.button.icon-left:before, a.button.icon-right:before {\n    margin-top: 2px; }\n\n.button.disabled, .button[disabled] {\n  opacity: .4;\n  cursor: default !important;\n  pointer-events: none; }\n\n/**\n * Button Bar\n * --------------------------------------------------\n */\n.button-bar {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  width: 100%; }\n  .button-bar.button-bar-inline {\n    display: block;\n    width: auto;\n    *zoom: 1; }\n    .button-bar.button-bar-inline:before, .button-bar.button-bar-inline:after {\n      display: table;\n      content: \"\";\n      line-height: 0; }\n    .button-bar.button-bar-inline:after {\n      clear: both; }\n    .button-bar.button-bar-inline > .button {\n      width: auto;\n      display: inline-block;\n      float: left; }\n\n.button-bar > .button {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  overflow: hidden;\n  padding: 0 16px;\n  width: 0;\n  border-width: 1px 0px 1px 1px;\n  border-radius: 0;\n  text-align: center;\n  text-overflow: ellipsis;\n  white-space: nowrap; }\n  .button-bar > .button:before, .button-bar > .button .icon:before {\n    line-height: 44px; }\n  .button-bar > .button:first-child {\n    border-radius: 2px 0px 0px 2px; }\n  .button-bar > .button:last-child {\n    border-right-width: 1px;\n    border-radius: 0px 2px 2px 0px; }\n\n/**\n * Grid\n * --------------------------------------------------\n * Using flexbox for the grid, inspired by Philip Walton:\n * http://philipwalton.github.io/solved-by-flexbox/demos/grids/\n * By default each .col within a .row will evenly take up\n * available width, and the height of each .col with take\n * up the height of the tallest .col in the same .row.\n */\n.row {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  padding: 5px;\n  width: 100%; }\n\n.row-wrap {\n  -webkit-flex-wrap: wrap;\n  -moz-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap; }\n\n.row-no-padding {\n  padding: 0; }\n  .row-no-padding > .col {\n    padding: 0; }\n\n.row + .row {\n  margin-top: -5px;\n  padding-top: 0; }\n\n.col {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  padding: 5px;\n  width: 100%; }\n\n/* Vertically Align Columns */\n/* .row-* vertically aligns every .col in the .row */\n.row-top {\n  -webkit-box-align: start;\n  -ms-flex-align: start;\n  -webkit-align-items: flex-start;\n  -moz-align-items: flex-start;\n  align-items: flex-start; }\n\n.row-bottom {\n  -webkit-box-align: end;\n  -ms-flex-align: end;\n  -webkit-align-items: flex-end;\n  -moz-align-items: flex-end;\n  align-items: flex-end; }\n\n.row-center {\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center; }\n\n.row-stretch {\n  -webkit-box-align: stretch;\n  -ms-flex-align: stretch;\n  -webkit-align-items: stretch;\n  -moz-align-items: stretch;\n  align-items: stretch; }\n\n.row-baseline {\n  -webkit-box-align: baseline;\n  -ms-flex-align: baseline;\n  -webkit-align-items: baseline;\n  -moz-align-items: baseline;\n  align-items: baseline; }\n\n/* .col-* vertically aligns an individual .col */\n.col-top {\n  -webkit-align-self: flex-start;\n  -moz-align-self: flex-start;\n  -ms-flex-item-align: start;\n  align-self: flex-start; }\n\n.col-bottom {\n  -webkit-align-self: flex-end;\n  -moz-align-self: flex-end;\n  -ms-flex-item-align: end;\n  align-self: flex-end; }\n\n.col-center {\n  -webkit-align-self: center;\n  -moz-align-self: center;\n  -ms-flex-item-align: center;\n  align-self: center; }\n\n/* Column Offsets */\n.col-offset-10 {\n  margin-left: 10%; }\n\n.col-offset-20 {\n  margin-left: 20%; }\n\n.col-offset-25 {\n  margin-left: 25%; }\n\n.col-offset-33, .col-offset-34 {\n  margin-left: 33.3333%; }\n\n.col-offset-50 {\n  margin-left: 50%; }\n\n.col-offset-66, .col-offset-67 {\n  margin-left: 66.6666%; }\n\n.col-offset-75 {\n  margin-left: 75%; }\n\n.col-offset-80 {\n  margin-left: 80%; }\n\n.col-offset-90 {\n  margin-left: 90%; }\n\n/* Explicit Column Percent Sizes */\n/* By default each grid column will evenly distribute */\n/* across the grid. However, you can specify individual */\n/* columns to take up a certain size of the available area */\n.col-10 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 10%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 10%;\n  -ms-flex: 0 0 10%;\n  flex: 0 0 10%;\n  max-width: 10%; }\n\n.col-20 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 20%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 20%;\n  -ms-flex: 0 0 20%;\n  flex: 0 0 20%;\n  max-width: 20%; }\n\n.col-25 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 25%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 25%;\n  -ms-flex: 0 0 25%;\n  flex: 0 0 25%;\n  max-width: 25%; }\n\n.col-33, .col-34 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 33.3333%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 33.3333%;\n  -ms-flex: 0 0 33.3333%;\n  flex: 0 0 33.3333%;\n  max-width: 33.3333%; }\n\n.col-50 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 50%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 50%;\n  -ms-flex: 0 0 50%;\n  flex: 0 0 50%;\n  max-width: 50%; }\n\n.col-66, .col-67 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 66.6666%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 66.6666%;\n  -ms-flex: 0 0 66.6666%;\n  flex: 0 0 66.6666%;\n  max-width: 66.6666%; }\n\n.col-75 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 75%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 75%;\n  -ms-flex: 0 0 75%;\n  flex: 0 0 75%;\n  max-width: 75%; }\n\n.col-80 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 80%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 80%;\n  -ms-flex: 0 0 80%;\n  flex: 0 0 80%;\n  max-width: 80%; }\n\n.col-90 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 90%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 90%;\n  -ms-flex: 0 0 90%;\n  flex: 0 0 90%;\n  max-width: 90%; }\n\n/* Responsive Grid Classes */\n/* Adding a class of responsive-X to a row */\n/* will trigger the flex-direction to */\n/* change to column and add some margin */\n/* to any columns in the row for clearity */\n@media (max-width: 567px) {\n  .responsive-sm {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-sm .col, .responsive-sm .col-10, .responsive-sm .col-20, .responsive-sm .col-25, .responsive-sm .col-33, .responsive-sm .col-34, .responsive-sm .col-50, .responsive-sm .col-66, .responsive-sm .col-67, .responsive-sm .col-75, .responsive-sm .col-80, .responsive-sm .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n@media (max-width: 767px) {\n  .responsive-md {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-md .col, .responsive-md .col-10, .responsive-md .col-20, .responsive-md .col-25, .responsive-md .col-33, .responsive-md .col-34, .responsive-md .col-50, .responsive-md .col-66, .responsive-md .col-67, .responsive-md .col-75, .responsive-md .col-80, .responsive-md .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n@media (max-width: 1023px) {\n  .responsive-lg {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-lg .col, .responsive-lg .col-10, .responsive-lg .col-20, .responsive-lg .col-25, .responsive-lg .col-33, .responsive-lg .col-34, .responsive-lg .col-50, .responsive-lg .col-66, .responsive-lg .col-67, .responsive-lg .col-75, .responsive-lg .col-80, .responsive-lg .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n/**\n * Utility Classes\n * --------------------------------------------------\n */\n.hide {\n  display: none; }\n\n.opacity-hide {\n  opacity: 0; }\n\n.grade-b .opacity-hide, .grade-c .opacity-hide {\n  opacity: 1;\n  display: none; }\n\n.show {\n  display: block; }\n\n.opacity-show {\n  opacity: 1; }\n\n.invisible {\n  visibility: hidden; }\n\n.keyboard-open .hide-on-keyboard-open {\n  display: none; }\n\n.keyboard-open .tabs.hide-on-keyboard-open + .pane .has-tabs, .keyboard-open .bar-footer.hide-on-keyboard-open + .pane .has-footer {\n  bottom: 0; }\n\n.inline {\n  display: inline-block; }\n\n.disable-pointer-events {\n  pointer-events: none; }\n\n.enable-pointer-events {\n  pointer-events: auto; }\n\n.disable-user-behavior {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-user-drag: none;\n  -ms-touch-action: none;\n  -ms-content-zooming: none; }\n\n.click-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  opacity: 0;\n  z-index: 99999;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  overflow: hidden; }\n\n.click-block-hide {\n  -webkit-transform: translate3d(-9999px, 0, 0);\n  transform: translate3d(-9999px, 0, 0); }\n\n.no-resize {\n  resize: none; }\n\n.block {\n  display: block;\n  clear: both; }\n  .block:after {\n    display: block;\n    visibility: hidden;\n    clear: both;\n    height: 0;\n    content: \".\"; }\n\n.full-image {\n  width: 100%; }\n\n.clearfix {\n  *zoom: 1; }\n  .clearfix:before, .clearfix:after {\n    display: table;\n    content: \"\";\n    line-height: 0; }\n  .clearfix:after {\n    clear: both; }\n\n/**\n * Content Padding\n * --------------------------------------------------\n */\n.padding {\n  padding: 10px; }\n\n.padding-top, .padding-vertical {\n  padding-top: 10px; }\n\n.padding-right, .padding-horizontal {\n  padding-right: 10px; }\n\n.padding-bottom, .padding-vertical {\n  padding-bottom: 10px; }\n\n.padding-left, .padding-horizontal {\n  padding-left: 10px; }\n\n/**\n * Scrollable iFrames\n * --------------------------------------------------\n */\n.iframe-wrapper {\n  position: fixed;\n  -webkit-overflow-scrolling: touch;\n  overflow: scroll; }\n  .iframe-wrapper iframe {\n    height: 100%;\n    width: 100%; }\n\n/**\n * Rounded\n * --------------------------------------------------\n */\n.rounded {\n  border-radius: 4px; }\n\n/**\n * Utility Colors\n * --------------------------------------------------\n * Utility colors are added to help set a naming convention. You'll\n * notice we purposely do not use words like \"red\" or \"blue\", but\n * instead have colors which represent an emotion or generic theme.\n */\n.light, a.light {\n  color: #fff; }\n\n.light-bg {\n  background-color: #fff; }\n\n.light-border {\n  border-color: #ddd; }\n\n.stable, a.stable {\n  color: #f8f8f8; }\n\n.stable-bg {\n  background-color: #f8f8f8; }\n\n.stable-border {\n  border-color: #b2b2b2; }\n\n.positive, a.positive {\n  color: #387ef5; }\n\n.positive-bg {\n  background-color: #387ef5; }\n\n.positive-border {\n  border-color: #0c60ee; }\n\n.calm, a.calm {\n  color: #11c1f3; }\n\n.calm-bg {\n  background-color: #11c1f3; }\n\n.calm-border {\n  border-color: #0a9dc7; }\n\n.assertive, a.assertive {\n  color: #ef473a; }\n\n.assertive-bg {\n  background-color: #ef473a; }\n\n.assertive-border {\n  border-color: #e42112; }\n\n.balanced, a.balanced {\n  color: #33cd5f; }\n\n.balanced-bg {\n  background-color: #33cd5f; }\n\n.balanced-border {\n  border-color: #28a54c; }\n\n.energized, a.energized {\n  color: #ffc900; }\n\n.energized-bg {\n  background-color: #ffc900; }\n\n.energized-border {\n  border-color: #e6b500; }\n\n.royal, a.royal {\n  color: #886aea; }\n\n.royal-bg {\n  background-color: #886aea; }\n\n.royal-border {\n  border-color: #6b46e5; }\n\n.dark, a.dark {\n  color: #444; }\n\n.dark-bg {\n  background-color: #444; }\n\n.dark-border {\n  border-color: #111; }\n\n[collection-repeat] {\n  /* Position is set by transforms */\n  left: 0 !important;\n  top: 0 !important;\n  position: absolute !important;\n  z-index: 1; }\n\n.collection-repeat-container {\n  position: relative;\n  z-index: 1; }\n\n.collection-repeat-after-container {\n  z-index: 0;\n  display: block;\n  /* when scrolling horizontally, make sure the after container doesn't take up 100% width */ }\n  .collection-repeat-after-container.horizontal {\n    display: inline-block; }\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {\n  display: none !important; }\n\n/**\n * Platform\n * --------------------------------------------------\n * Platform specific tweaks\n */\n.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) {\n  height: 64px; }\n  .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader).item-input-inset .item-input-wrapper {\n    margin-top: 19px !important; }\n  .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) > * {\n    margin-top: 20px; }\n.platform-ios.platform-cordova:not(.fullscreen) .tabs-top > .tabs, .platform-ios.platform-cordova:not(.fullscreen) .tabs.tabs-top {\n  top: 64px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header, .platform-ios.platform-cordova:not(.fullscreen) .bar-subheader {\n  top: 64px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-subheader {\n  top: 108px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-tabs-top {\n  top: 113px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-subheader.has-tabs-top {\n  top: 157px; }\n.platform-ios.platform-cordova.status-bar-hide {\n  margin-bottom: 20px; }\n\n@media (orientation: landscape) {\n  .platform-ios.platform-browser.platform-ipad {\n    position: fixed; } }\n\n.platform-c:not(.enable-transitions) * {\n  -webkit-transition: none !important;\n  transition: none !important; }\n\n.slide-in-up {\n  -webkit-transform: translate3d(0, 100%, 0);\n  transform: translate3d(0, 100%, 0); }\n\n.slide-in-up.ng-enter, .slide-in-up > .ng-enter {\n  -webkit-transition: all cubic-bezier(.1, .7, .1, 1) 400ms;\n  transition: all cubic-bezier(.1, .7, .1, 1) 400ms; }\n\n.slide-in-up.ng-enter-active, .slide-in-up > .ng-enter-active {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0); }\n\n.slide-in-up.ng-leave, .slide-in-up > .ng-leave {\n  -webkit-transition: all ease-in-out 250ms;\n  transition: all ease-in-out 250ms; }\n\n@-webkit-keyframes scaleOut {\n  from {\n    -webkit-transform: scale(1);\n    opacity: 1; }\n\n  to {\n    -webkit-transform: scale(0.8);\n    opacity: 0; } }\n\n@keyframes scaleOut {\n  from {\n    transform: scale(1);\n    opacity: 1; }\n\n  to {\n    transform: scale(0.8);\n    opacity: 0; } }\n\n@-webkit-keyframes superScaleIn {\n  from {\n    -webkit-transform: scale(1.2);\n    opacity: 0; }\n\n  to {\n    -webkit-transform: scale(1);\n    opacity: 1; } }\n\n@keyframes superScaleIn {\n  from {\n    transform: scale(1.2);\n    opacity: 0; }\n\n  to {\n    transform: scale(1);\n    opacity: 1; } }\n\n[nav-view-transition=\"ios\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"] [nav-view=\"leaving\"] {\n  -webkit-transition-duration: 500ms;\n  transition-duration: 500ms;\n  -webkit-transition-timing-function: cubic-bezier(.36, .66, .04, 1);\n  transition-timing-function: cubic-bezier(.36, .66, .04, 1);\n  -webkit-transition-property: opacity, -webkit-transform, box-shadow;\n  transition-property: opacity, transform, box-shadow; }\n[nav-view-transition=\"ios\"][nav-view-direction=\"forward\"], [nav-view-transition=\"ios\"][nav-view-direction=\"back\"] {\n  background-color: #000; }\n[nav-view-transition=\"ios\"] [nav-view=\"active\"], [nav-view-transition=\"ios\"][nav-view-direction=\"forward\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"][nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n  z-index: 3; }\n[nav-view-transition=\"ios\"][nav-view-direction=\"back\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"][nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n  z-index: 2; }\n\n[nav-bar-transition=\"ios\"] .title, [nav-bar-transition=\"ios\"] .buttons, [nav-bar-transition=\"ios\"] .back-text {\n  -webkit-transition-duration: 500ms;\n  transition-duration: 500ms;\n  -webkit-transition-timing-function: cubic-bezier(.36, .66, .04, 1);\n  transition-timing-function: cubic-bezier(.36, .66, .04, 1);\n  -webkit-transition-property: opacity, -webkit-transform;\n  transition-property: opacity, transform; }\n[nav-bar-transition=\"ios\"] [nav-bar=\"active\"], [nav-bar-transition=\"ios\"] [nav-bar=\"entering\"] {\n  z-index: 10; }\n  [nav-bar-transition=\"ios\"] [nav-bar=\"active\"] .bar, [nav-bar-transition=\"ios\"] [nav-bar=\"entering\"] .bar {\n    background: transparent; }\n[nav-bar-transition=\"ios\"] [nav-bar=\"cached\"] {\n  display: block; }\n  [nav-bar-transition=\"ios\"] [nav-bar=\"cached\"] .header-item {\n    display: none; }\n\n[nav-view-transition=\"android\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"] [nav-view=\"leaving\"] {\n  -webkit-transition-duration: 200ms;\n  transition-duration: 200ms;\n  -webkit-transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  -webkit-transition-property: -webkit-transform;\n  transition-property: transform; }\n[nav-view-transition=\"android\"] [nav-view=\"active\"], [nav-view-transition=\"android\"][nav-view-direction=\"forward\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"][nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n  z-index: 3; }\n[nav-view-transition=\"android\"][nav-view-direction=\"back\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"][nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n  z-index: 2; }\n\n[nav-bar-transition=\"android\"] .title, [nav-bar-transition=\"android\"] .buttons {\n  -webkit-transition-duration: 200ms;\n  transition-duration: 200ms;\n  -webkit-transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  -webkit-transition-property: opacity;\n  transition-property: opacity; }\n[nav-bar-transition=\"android\"] [nav-bar=\"active\"], [nav-bar-transition=\"android\"] [nav-bar=\"entering\"] {\n  z-index: 10; }\n  [nav-bar-transition=\"android\"] [nav-bar=\"active\"] .bar, [nav-bar-transition=\"android\"] [nav-bar=\"entering\"] .bar {\n    background: transparent; }\n[nav-bar-transition=\"android\"] [nav-bar=\"cached\"] {\n  display: block; }\n  [nav-bar-transition=\"android\"] [nav-bar=\"cached\"] .header-item {\n    display: none; }\n\n[nav-swipe=\"fast\"] [nav-view], [nav-swipe=\"fast\"] .title, [nav-swipe=\"fast\"] .buttons, [nav-swipe=\"fast\"] .back-text {\n  -webkit-transition-duration: 50ms;\n  transition-duration: 50ms;\n  -webkit-transition-timing-function: linear;\n  transition-timing-function: linear; }\n\n[nav-swipe=\"slow\"] [nav-view], [nav-swipe=\"slow\"] .title, [nav-swipe=\"slow\"] .buttons, [nav-swipe=\"slow\"] .back-text {\n  -webkit-transition-duration: 160ms;\n  transition-duration: 160ms;\n  -webkit-transition-timing-function: linear;\n  transition-timing-function: linear; }\n\n[nav-view=\"cached\"], [nav-bar=\"cached\"] {\n  display: none; }\n\n[nav-view=\"stage\"] {\n  opacity: 0;\n  -webkit-transition-duration: 0;\n  transition-duration: 0; }\n\n[nav-bar=\"stage\"] .title, [nav-bar=\"stage\"] .buttons, [nav-bar=\"stage\"] .back-text {\n  position: absolute;\n  opacity: 0;\n  -webkit-transition-duration: 0s;\n  transition-duration: 0s; }\n\n#copyright {\n  margin: 20px 0 10px;\n  text-align: center;\n  color: #aaa;\n  text-shadow: 0 1px 0 #fff; }\n\n.notifyBadge {\n  position: absolute;\n  top: 2px;\n  right: 2px;\n  background: #EF4E3A;\n  border-radius: 10px;\n  width: 10px;\n  height: 10px; }\n\n.badge.messagesCount {\n  border-radius: 20px;\n  width: 20px;\n  height: 20px;\n  display: inline-block;\n  padding: 0;\n  text-align: center;\n  line-height: 20px;\n  font-size: 12px; }\n\n.bold {\n  font-weight: bold; }\n\n.pane {\n  background-color: #f5f5f5; }\n\n.cnode {\n  color: #80bd01; }\n\n.cnode-bg {\n  background-color: #80bd01; }\n\n.item {\n  left: 0;\n  right: 0; }\n\n.item-divider {\n  color: #555;\n  font-weight: normal;\n  font-size: 14px; }\n\n.item-gap {\n  border: 0 none;\n  min-height: 0; }\n\n.item-loading {\n  text-align: center;\n  color: #aaa; }\n\n.saverMode .item-avatar {\n  padding-left: 14px; }\n  .saverMode .item-avatar.item-complex {\n    padding-left: 0; }\n  .saverMode .item-avatar > img:first-child {\n    -webkit-transform: translate3d(-2000px, -2000px, 0px); }\n  .saverMode .item-avatar .item-content {\n    padding-left: 14px;\n    padding-right: 16px; }\n    .saverMode .item-avatar .item-content > img:first-child {\n      -webkit-transform: translate3d(-2000px, -2000px, 0px); }\n\n.setting .avatar {\n  width: 50px;\n  border-radius: 10px;\n  vertical-align: middle; }\n.setting .login {\n  text-align: center;\n  /* background-color: #4EB554; */ }\n\n.markdown-text a {\n  color: #778087; }\n.markdown-text ul {\n  list-style-type: disc;\n  margin-bottom: 5px;\n  margin-left: 15px; }\n  .markdown-text ul ul {\n    list-style-type: circle; }\n\na {\n  color: #08c;\n  text-decoration: none; }\n\n#logo {\n  width: 128px;\n  height: 30px;\n  margin-left: 10px; }\n\n#devTag {\n  position: relative;\n  font-size: 14px; }\n\n.topics .item-content {\n  padding: 14px 16px 18px 72px; }\n  .topics .item-content > img:not(:first-child) {\n    -webkit-transform: translate3d(-2000px, -2000px, 0px);\n    position: absolute; }\n.topics .activated .tab:not(.hl) {\n  background-color: #aeaeae;\n  color: #fff; }\n.topics .ago, .topics .summary {\n  font-size: 12px; }\n.topics .tab {\n  background-color: #E5E5E5;\n  color: #999;\n  border-radius: 2px;\n  padding: 2px 4px; }\n.topics .hl {\n  background-color: #80bd01;\n  color: #fff; }\n\n.topic-content img {\n  max-width: 100%; }\n\n.topic .title {\n  margin: 0; }\n.topic .summary {\n  margin: 8px 0; }\n.topic .avatar {\n  width: 16px;\n  border-radius: 8px;\n  vertical-align: middle; }\n\n.replies .item {\n  padding-top: 10px;\n  padding-bottom: 10px;\n  white-space: normal; }\n.replies .reply-content img {\n  max-width: 100%; }\n.replies .reply-content p {\n  overflow: visible !important;\n  white-space: normal !important; }\n\n.topic-create .topic-tabs {\n  position: relative;\n  padding-top: 8px;\n  padding-bottom: 8px;\n  padding-left: 0; }\n\n.reply-new input {\n  background: transparent; }\n\n.center {\n  display: -webkit-box;\n  display: -moz-box;\n  display: -ms-flexbox;\n  display: -webkit-flex;\n  display: flex;\n  -webkit-box-direction: normal;\n  -moz-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -moz-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  -webkit-flex-wrap: nowrap;\n  -ms-flex-wrap: nowrap;\n  flex-wrap: nowrap;\n  -webkit-box-pack: center;\n  -moz-box-pack: center;\n  -webkit-justify-content: center;\n  -ms-flex-pack: center;\n  justify-content: center;\n  -webkit-align-content: stretch;\n  -ms-flex-line-pack: stretch;\n  align-content: stretch;\n  -webkit-box-align: center;\n  -moz-box-align: center;\n  -webkit-align-items: center;\n  -ms-flex-align: center;\n  align-items: center; }\n\n.user .item-content {\n  padding-right: 16px; }\n\n.tabs-striped.tabs-color-assertive .tab-item {\n  color: black; }\n\n.tabs-striped.tabs-color-assertive .tab-item.active {\n  color: red; }\n\n.nav-bar-tabs-top.hide + .view-container > .tabs-top > .tabs, .tabs.tabs-top {\n  top: 0 !important; }\n\n.nav-bar-tabs-top.hide + .view-container > .tabs-top > .tab-content .pane .has-tabs-top {\n  top: 49px !important; }\n\n.tabs-hide .tabs {\n  display: none; }\n\n.spinner svg {\n  width: 28px;\n  height: 28px;\n  stroke: #444;\n  fill: #444; }\n\n.topic-spinner {\n  margin: 100px auto 0;\n  text-align: center;\n  font-size: 50px;\n  position: absolute;\n  top: 50px;\n  left: -webkit-calc(50% - 25px);\n  z-index: 2;\n  -webkit-transition: all .4s cubic-bezier(.6, -1.6, .92, .48);\n  transition: all .4s cubic-bezier(.6, -1.6, .92, .48); }\n\n.topic-spinner.ng-hide-add {\n  -webkit-transform: scale(1, 1);\n  transform: scale(1, 1); }\n\n.topic-spinner.ng-hide-add-active {\n  -webkit-transform: scale(0, 0);\n  transform: scale(0, 0); }\n\n.hide-tabs .has-tabs {\n  bottom: 0px; }\n"
  },
  {
    "path": "www/css/style.css",
    "content": "/* Empty. Add your own CSS if you like */\na .my-tab-item{\n  color: rgb(0, 0, 0);\n\n}\n"
  },
  {
    "path": "www/index.html",
    "content": "<!DOCTYPE html>\n<html>\n\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width\">\n  <title></title>\n\n\n  <!-- compiled css output -->\n  <link href=\"css/ionic.app.css\" rel=\"stylesheet\">\n\n  <!-- ionic/angularjs js -->\n  <script src=\"lib/ionic/js/ionic.bundle.js\"></script>\n  <script src=\"lib/angular-resource/angular-resource.min.js\"></script>\n  <script src=\"lib/moment/min/moment-with-locales.js\"></script>\n  <script src=\"lib/angular-moment/angular-moment.min.js\"></script>\n\n\n\n  <!-- cordova script (this will be a 404 during development) -->\n  <script src=\"lib/ngCordova/dist/ng-cordova.min.js\"></script>\n  <script src=\"cordova.js\"></script>\n\n  <!-- your app's js -->\n  <script src=\"js/config.js\"></script>\n  <script src=\"js/app.js\"></script>\n  <script src=\"js/services.js\"></script>\n  <script src=\"js/controllers.js\"></script>\n  <script src=\"views/topic/topics.js\"></script>\n  <script src=\"views/my/my.js\"></script>\n  <script src=\"views/explore/explore.js\"></script>\n</head>\n\n<body ng-app=\"ioniclub\">\n  <!--\n      The nav bar that will be updated as we navigate between views.\n    -->\n  <ion-nav-bar class=\"bar-positive\">\n    <ion-nav-back-button>\n    </ion-nav-back-button>\n  </ion-nav-bar>\n  <!--\n  The views will be rendered in the <ion-nav-view> directive below\n  Templates are in the /templates folder (but you could also\n  have templates inline in this html file if you'd like).\n-->\n\n  <ion-nav-view  ></ion-nav-view>\n\n</body>\n\n</html>\n"
  },
  {
    "path": "www/js/app.js",
    "content": "// Ionic Starter App\n\n// angular.module is a global place for creating, registering and retrieving Angular modules\n// 'ioniclub' is the name of this angular module example (also set in a <body> attribute in index.html)\n// the 2nd parameter is an array of 'requires'\n// 'ioniclub.controllers' is found in controllers.js\nangular.module('ioniclub', ['ionic', 'ngCordova', 'ngResource',\n  'angularMoment',\n  'ioniclub.config', 'ioniclub.services', 'ioniclub.controllers'\n])\n\n.run(function($ionicPlatform, $rootScope, $state, $ionicLoading, $log,\n  $cordovaAppVersion, $cordovaGoogleAnalytics,\n  amMoment, My, User, Push) {\n\n  // push notification callback\n  var notificationCallback = function(data, isActive) {\n    $log.debug(data);\n    var notif = angular.fromJson(data);\n    if (notif.extras) {\n      // android\n      if (notif.extras['cn.jpush.android.EXTRA']['topicId']) {\n        $state.go('tab.my-messages-topic', {\n          id: notif.extras['cn.jpush.android.EXTRA']['topicId']\n        });\n      } else {\n        $state.go('tab.my-messages');\n      }\n    } else {\n      // ios\n      if (notif.topicId) {\n        if (isActive) {\n          // $rootScope.getMessageCount();\n        } else {\n          $state.go('tab.my-messages-topic', {\n            id: notif.topicId\n          });\n        }\n      } else {\n        $state.go('tab.my-messages');\n      }\n    }\n  };\n  // push notification callback\n  var notificationCallback2 = function(data, isActive) {\n    // $log.debug(data);\n    var notif = angular.fromJson(data);\n    console.log(notif);\n    // {\"aps\":{\"badge\":8,\"sound\":\"default\",\"alert\":\"HeyIonic 回复了你的主题\"},\"_j_msgid\":1590987161,\"topicId\":\"555d5175aaa7025033c2894d\"}\n    if (notif.topicId) {\n      if (isActive) {\n        // $rootScope.getMessageCount();\n      } else {\n        $state.go('tab.topic-detail', {\n          id: notif.topicId\n        });\n      }\n    } else {\n      $state.go('tab.my-messages');\n    }\n\n\n  };\n  $ionicPlatform.ready(function() {\n    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard\n    // for form inputs)\n    if (window.cordova && window.cordova.plugins.Keyboard) {\n      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);\n      cordova.plugins.Keyboard.disableScroll(true);\n    }\n    if (window.StatusBar) {\n      // org.apache.cordova.statusbar required\n      StatusBar.styleDefault();\n    }\n\n\n\n    // set moment locale\n    amMoment.changeLocale('zh-cn');\n\n    // push handler\n    Push.init(notificationCallback);\n\n    // detect current user have not set alias of jpush\n    var currentUser = User.getCurrentUser();\n    if (currentUser.id) {\n      Push.setAlias(currentUser.id);\n    }\n\n  });\n\n\n\n  // error handler\n  var errorMsg = {\n    0: '网络出错啦，请再试一下',\n    'wrong accessToken': '授权失败'\n  };\n\n  $rootScope.requestErrorHandler = function(options, callback) {\n    return function(response) {\n      var error;\n      if (response.data && response.data.error_msg) {\n        error = errorMsg[response.data.error_msg];\n      } else {\n        error = errorMsg[response.status] || 'Error: ' + response.status + ' ' + response.statusText;\n      }\n      var o = options || {};\n      angular.extend(o, {\n        template: error,\n        duration: 1000\n      });\n      $ionicLoading.show(o);\n      return callback && callback();\n    };\n  };\n\n  var currentUser = User.getCurrentUser();\n  document.addEventListener(\"deviceready\", function() {\n\n    // get the version\n    $cordovaAppVersion.getAppVersion().then(function(version) {\n      My.setSettings('version', version);\n    });\n\n    // turn on debug mode\n    // https://github.com/danwilson/google-analytics-plugin#javascript-usage\n    // $cordovaGoogleAnalytics.debugMode();\n\n    // start tracker\n    // https://developers.google.com/analytics/devguides/collection/analyticsjs/\n    $cordovaGoogleAnalytics.startTrackerWithId('UA-59800656-3');\n\n    if (currentUser) {\n      // set user id\n      // https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id\n      $cordovaGoogleAnalytics.setUserId(currentUser.id);\n    }\n\n    // track a view\n    // https://developers.google.com/analytics/devguides/collection/analyticsjs/screens\n    // Hint: Currently no support for appName, appId, appVersion, appInstallerId\n    //       If you need support for it, please create an issue on github:\n    //       https://github.com/driftyco/ng-cordova/issues\n\n    $cordovaGoogleAnalytics.trackView('Home Screen');\n\n\n  }, false);\n\n  // 只有在激活时候才会被调用\n  document.addEventListener(\"jpush.receiveNotification\", function(data, isActive) {\n    console.log('jpush.receiveNotification -- start');\n\n\n    console.log(data);\n    notificationCallback2(data, true);\n\n\n    console.log('jpush.receiveNotification -- end');\n\n  }, false);\n\n  // 打开通知栏时候调用\n  document.addEventListener(\"jpush.openNotification\", function(data) {\n    console.log('jpush.openNotification -- start');\n\n\n    console.log(data);\n    notificationCallback2(data, false);\n\n    console.log('jpush.openNotification -- end');\n\n  }, false);\n\n\n\n})\n\n.config(function($stateProvider, $urlRouterProvider) {\n  $stateProvider\n\n    .state('tab', {\n    url: \"/tab\",\n    abstract: true,\n    templateUrl: \"views/tabs.html\"\n  })\n\n  .state('tab.topics', {\n      url: '/topics',\n      views: {\n        'tab-topics': {\n          templateUrl: 'views/topic/topics.html',\n          controller: 'TopicsCtrl'\n        }\n      }\n    })\n    .state('tab.topic-detail', {\n      url: '/topics/:id',\n      views: {\n        'tab-topics': {\n          templateUrl: 'views/topic/topic.html',\n          controller: 'TopicCtrl'\n        }\n      }\n    })\n    .state('tab.explore', {\n      url: '/explore',\n      views: {\n        'tab-explore': {\n          templateUrl: 'views/explore/explore.html',\n          controller: 'ExploreCtrl'\n        }\n      }\n    })\n    .state('tab.my', {\n      url: '/my',\n      views: {\n        'tab-my': {\n          templateUrl: 'views/my/my.html',\n          controller: 'MyCtrl'\n        }\n      }\n    })\n    .state('tab.my-personal', {\n      url: '/my/personal',\n      views: {\n        'tab-my': {\n          templateUrl: 'views/my/personal.html',\n          controller: 'PersonalCtrl'\n        }\n      }\n    })\n    .state('tab.my-messages', {\n      url: '/my/messages',\n      views: {\n        'tab-my': {\n          templateUrl: 'views/my/messages.html',\n          controller: 'MessagesCtrl'\n        }\n      }\n    })\n    .state('tab.my-messages-topic', {\n      url: '/my/messages-topic/:id',\n      views: {\n        'tab-my': {\n          templateUrl: 'views/topic/topic.html',\n          controller: 'TopicCtrl'\n        }\n      }\n    });\n  // if none of the above states are matched, use this as the fallback\n  $urlRouterProvider.otherwise('/tab/topics');\n});\n"
  },
  {
    "path": "www/js/config.js",
    "content": "angular.module(\"ioniclub.config\", [])\n    .constant(\"ENV\", {\n        // \"name\": \"production\",\n        \"accessToken\": '',\n        \"debug\": false,\n        \"api\": \"http://ionichina.com/api/v1\",\n        // \"api\": \"http://localhost:3000/api/v1\",\n        \"appleId\": 'id981408438',\n        'version':'1.0.1'\n    })\n;\n"
  },
  {
    "path": "www/js/controllers.js",
    "content": "angular.module('ioniclub.controllers', [])\n\n.controller('AppCtrl', function($scope, $rootScope, $ionicLoading, $ionicModal, $timeout) {\n  console.log(\"AppCtrl\");\n  // Form data for the login modal\n  $scope.loginData = {};\n\n  // error handler\n  var errorMsg = {\n    0: '网络出错啦，请再试一下',\n    'wrong accessToken': '授权失败'\n  };\n\n  $rootScope.requestErrorHandler = function(options, callback) {\n    return function(response) {\n      var error;\n      if (response.data && response.data.error_msg) {\n        error = errorMsg[response.data.error_msg];\n      } else {\n        error = errorMsg[response.status] || 'Error: ' + response.status + ' ' + response.statusText;\n      }\n      var o = options || {};\n      angular.extend(o, {\n        template: error,\n        duration: 1000\n      });\n      $ionicLoading.show(o);\n      return callback && callback();\n    };\n  };\n\n\n});\n"
  },
  {
    "path": "www/js/services.js",
    "content": "/**\n * 各种定制化的服务\n */\n\nangular.module('ioniclub.services', [])\n  .factory('Storage', function() {\n    \"use strict\";\n    return {\n      set: function(key, data) {\n        return window.localStorage.setItem(key, window.JSON.stringify(data));\n      },\n      get: function(key) {\n\n        return window.JSON.parse(window.localStorage.getItem(key));\n      },\n      remove: function(key) {\n        return window.localStorage.removeItem(key);\n      }\n    };\n  })\n  .factory('Push', function(ENV) {\n    var push;\n    return {\n      setBadge: function(badge) {\n        if (push) {\n\n          plugins.jPushPlugin.setBadge(badge);\n        }\n      },\n      resetBadge: function() {\n        if (push) {\n          plugins.jPushPlugin.resetBadge();\n        }\n      },\n      setAlias: function(alias) {\n        if (push) {\n          plugins.jPushPlugin.setAlias(alias);\n\n        }\n      },\n      check: function() {\n\n        if (window.jpush && push) {\n\n          window.jpush = null;\n        }\n      },\n      init: function(notificationCallback) {\n\n\n        push = window.plugins && window.plugins.jPushPlugin;\n        if (push) {\n\n\n          plugins.jPushPlugin.init();\n          plugins.jPushPlugin.setDebugMode(false);\n          try {\n            if (plugins.jPushPlugin.isPlatformIOS()) {\n              plugins.jPushPlugin.setLogOFF();\n            }\n            plugins.jPushPlugin.openNotificationInAndroidCallback = notificationCallback;\n\n            plugins.jPushPlugin.receiveNotificationIniOSCallback = notificationCallback;\n          } catch (exception) {\n            console.debug('exception--------------------');\n            console.debug(\"JPushPlugin initexception ： \" + exception);\n          }\n        }\n      },\n      stopPush: function() {\n        // 停止推送\n        plugins.jPushPlugin.stopPush();\n\n\n      },\n      resumePush: function() {\n        // 唤醒推送\n\n        plugins.jPushPlugin.resumePush();\n\n      }\n    };\n  })\n  .factory('CommonService', function($http, $rootScope, LXS, Storage) {\n\n    return {\n      getIOSVersion: function() {\n\n        return $http.post(LXS.api + \"/getIOSVersion.do\")\n          .success(function(data, status, headers, config) {\n\n\n            $rootScope.$broadcast('lxs.IOSVersionUpdate', data);\n          });\n      },\n      getAndroidVersion: function() {\n\n        return $http.post(LXS.api + \"/getAndroidVersion.do\")\n          .success(function(data, status, headers, config) {\n\n            $rootScope.$broadcast('lxs.AndroidVersionUpdate', data);\n          });\n      }\n    };\n  })\n  .factory('Tabs', function() {\n    return [{\n      value: 'all',\n      label: '全部'\n    }, {\n      value: 'share',\n      label: '分享'\n    }, {\n      value: 'ask',\n      label: '问答'\n    }, {\n      value: 'job',\n      label: '招聘'\n    }, {\n      value: 'bb',\n      label: '吐槽'\n    }, {\n      value: undefined,\n      label: '其他'\n    }];\n  })\n  .filter('tabName', function(Tabs) {\n    return function(tab) {\n      for (var i in Tabs) {\n        if (Tabs[i].value === tab) {\n          return Tabs[i].label;\n        }\n      }\n    };\n  })\n  .filter('link', function($sce) {\n    return function(content) {\n      if (typeof content === 'string') {\n        var userLinkRegex = /href=\"\\/user\\/([\\S]+)\"/gi;\n        var noProtocolSrcRegex = /src=\"\\/\\/([\\S]+)\"/gi;\n        var externalLinkRegex = /href=\"((?!#\\/user\\/)[\\S]+)\"/gi;\n        return $sce.trustAsHtml(\n          content\n          .replace(userLinkRegex, 'href=\"#/user/$1\"')\n          .replace(noProtocolSrcRegex, 'src=\"https://$1\"')\n          .replace(externalLinkRegex, \"onClick=\\\"window.open('$1', '_blank', 'location=yes')\\\"\")\n        );\n      }\n      return content;\n    };\n  })\n  .filter('protocol', function() {\n    return function(src) {\n      // add https protocol\n      if (/^\\/\\//gi.test(src)) {\n        return 'https:' + src;\n      } else {\n        return src;\n      }\n    };\n  })\n  .filter('avatarFilter', function() {\n    return function(src) {\n      // add https protocol\n      if (src) {\n        src = src.replace(\"https://avatars.githubusercontent.com\", \"http://7xj5bc.com1.z0.glb.clouddn.com\");\n        src = src + \"&imageView2/2/w/120\";\n      }\n      return src;\n    };\n  })\n  // .directive('hideTabs', function($rootScope) {\n  //\n  //   return {\n  //\n  //     restrict: 'AE',\n  //\n  //     link: function($scope) {\n  //\n  //       $rootScope.hideTabs = 'tabs-item-hide';\n  //\n  //       $scope.$on('$destroy', function() {\n  //\n  //         $rootScope.hideTabs = ' ';\n  //\n  //       });\n  //\n  //     }\n  //\n  //   };\n  //\n  // })\n\n\n.directive(\n  // Collection-repeat image recycling while loading\n  // https://github.com/driftyco/ionic/issues/1742\n  'resetImg',\n  function($document) {\n    return {\n      restrict: 'A',\n      link: function($scope, $element, $attributes) {\n        var applyNewSrc = function(src) {\n          var newImg = $element.clone(true);\n\n          newImg.attr('src', src);\n          $element.replaceWith(newImg);\n          $element = newImg;\n        };\n\n        $attributes.$observe('src', applyNewSrc);\n        $attributes.$observe('ngSrc', applyNewSrc);\n      }\n    };\n  }\n);\n"
  },
  {
    "path": "www/lib/angular/.bower.json",
    "content": "{\n  \"name\": \"angular\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular.js\",\n  \"ignore\": [],\n  \"dependencies\": {},\n  \"homepage\": \"https://github.com/angular/bower-angular\",\n  \"_release\": \"1.3.13\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v1.3.13\",\n    \"commit\": \"ad68cfecb69ff7cacb27813377ce9d95e072529b\"\n  },\n  \"_source\": \"git://github.com/angular/bower-angular.git\",\n  \"_target\": \"1.3.13\",\n  \"_originalSource\": \"angular\"\n}"
  },
  {
    "path": "www/lib/angular/README.md",
    "content": "# packaged angular\n\nThis repo is for distribution on `npm` and `bower`. The source for this module is in the\n[main AngularJS repo](https://github.com/angular/angular.js).\nPlease file issues and pull requests against that repo.\n\n## Install\n\nYou can install this package either with `npm` or with `bower`.\n\n### npm\n\n```shell\nnpm install angular\n```\n\nThen add a `<script>` to your `index.html`:\n\n```html\n<script src=\"/node_modules/angular/angular.js\"></script>\n```\n\nNote that this package is not in CommonJS format, so doing `require('angular')` will return `undefined`.\nIf you're using [Browserify](https://github.com/substack/node-browserify), you can use\n[exposify](https://github.com/thlorenz/exposify) to have `require('angular')` return the `angular`\nglobal.\n\n### bower\n\n```shell\nbower install angular\n```\n\nThen add a `<script>` to your `index.html`:\n\n```html\n<script src=\"/bower_components/angular/angular.js\"></script>\n```\n\n## Documentation\n\nDocumentation is available on the\n[AngularJS docs site](http://docs.angularjs.org/).\n\n## License\n\nThe MIT License\n\nCopyright (c) 2010-2012 Google, Inc. http://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": "www/lib/angular/angular-csp.css",
    "content": "/* Include this file in your html if you are using the CSP mode. */\n\n@charset \"UTF-8\";\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],\n.ng-cloak, .x-ng-cloak,\n.ng-hide:not(.ng-hide-animate) {\n  display: none !important;\n}\n\nng\\:form {\n  display: block;\n}\n"
  },
  {
    "path": "www/lib/angular/angular.js",
    "content": "/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, document, undefined) {'use strict';\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one.  The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n *   error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n  ErrorConstructor = ErrorConstructor || Error;\n  return function() {\n    var code = arguments[0],\n      prefix = '[' + (module ? module + ':' : '') + code + '] ',\n      template = arguments[1],\n      templateArgs = arguments,\n\n      message, i;\n\n    message = prefix + template.replace(/\\{\\d+\\}/g, function(match) {\n      var index = +match.slice(1, -1), arg;\n\n      if (index + 2 < templateArgs.length) {\n        return toDebugString(templateArgs[index + 2]);\n      }\n      return match;\n    });\n\n    message = message + '\\nhttp://errors.angularjs.org/1.3.13/' +\n      (module ? module + '/' : '') + code;\n    for (i = 2; i < arguments.length; i++) {\n      message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +\n        encodeURIComponent(toDebugString(arguments[i]));\n    }\n    return new ErrorConstructor(message);\n  };\n}\n\n/* We need to tell jshint what variables are being exported */\n/* global angular: true,\n  msie: true,\n  jqLite: true,\n  jQuery: true,\n  slice: true,\n  splice: true,\n  push: true,\n  toString: true,\n  ngMinErr: true,\n  angularModule: true,\n  uid: true,\n  REGEX_STRING_REGEXP: true,\n  VALIDITY_STATE_PROPERTY: true,\n\n  lowercase: true,\n  uppercase: true,\n  manualLowercase: true,\n  manualUppercase: true,\n  nodeName_: true,\n  isArrayLike: true,\n  forEach: true,\n  sortedKeys: true,\n  forEachSorted: true,\n  reverseParams: true,\n  nextUid: true,\n  setHashKey: true,\n  extend: true,\n  int: true,\n  inherit: true,\n  noop: true,\n  identity: true,\n  valueFn: true,\n  isUndefined: true,\n  isDefined: true,\n  isObject: true,\n  isString: true,\n  isNumber: true,\n  isDate: true,\n  isArray: true,\n  isFunction: true,\n  isRegExp: true,\n  isWindow: true,\n  isScope: true,\n  isFile: true,\n  isFormData: true,\n  isBlob: true,\n  isBoolean: true,\n  isPromiseLike: true,\n  trim: true,\n  escapeForRegexp: true,\n  isElement: true,\n  makeMap: true,\n  includes: true,\n  arrayRemove: true,\n  copy: true,\n  shallowCopy: true,\n  equals: true,\n  csp: true,\n  concat: true,\n  sliceArgs: true,\n  bind: true,\n  toJsonReplacer: true,\n  toJson: true,\n  fromJson: true,\n  startingTag: true,\n  tryDecodeURIComponent: true,\n  parseKeyValue: true,\n  toKeyValue: true,\n  encodeUriSegment: true,\n  encodeUriQuery: true,\n  angularInit: true,\n  bootstrap: true,\n  getTestability: true,\n  snake_case: true,\n  bindJQuery: true,\n  assertArg: true,\n  assertArgFn: true,\n  assertNotHasOwnProperty: true,\n  getter: true,\n  getBlockNodes: true,\n  hasOwnProperty: true,\n  createMap: true,\n\n  NODE_TYPE_ELEMENT: true,\n  NODE_TYPE_TEXT: true,\n  NODE_TYPE_COMMENT: true,\n  NODE_TYPE_DOCUMENT: true,\n  NODE_TYPE_DOCUMENT_FRAGMENT: true,\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n * <div doc-module-components=\"ng\"></div>\n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\n/**\n * @ngdoc function\n * @name angular.lowercase\n * @module ng\n * @kind function\n *\n * @description Converts the specified string to lowercase.\n * @param {string} string String to be converted to lowercase.\n * @returns {string} Lowercased string.\n */\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * @ngdoc function\n * @name angular.uppercase\n * @module ng\n * @kind function\n *\n * @description Converts the specified string to uppercase.\n * @param {string} string String to be converted to uppercase.\n * @returns {string} Uppercased string.\n */\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar manualLowercase = function(s) {\n  /* jshint bitwise: false */\n  return isString(s)\n      ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n      : s;\n};\nvar manualUppercase = function(s) {\n  /* jshint bitwise: false */\n  return isString(s)\n      ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n      : s;\n};\n\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives.\nif ('i' !== 'I'.toLowerCase()) {\n  lowercase = manualLowercase;\n  uppercase = manualUppercase;\n}\n\n\nvar\n    msie,             // holds major version number for IE, or NaN if UA is not IE.\n    jqLite,           // delay binding since jQuery could be loaded after us.\n    jQuery,           // delay binding\n    slice             = [].slice,\n    splice            = [].splice,\n    push              = [].push,\n    toString          = Object.prototype.toString,\n    ngMinErr          = minErr('ng'),\n\n    /** @name angular */\n    angular           = window.angular || (window.angular = {}),\n    angularModule,\n    uid               = 0;\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n *                   String ...)\n */\nfunction isArrayLike(obj) {\n  if (obj == null || isWindow(obj)) {\n    return false;\n  }\n\n  var length = obj.length;\n\n  if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n    return true;\n  }\n\n  return isString(obj) || isArray(obj) || length === 0 ||\n         typeof length === 'number' && length > 0 && (length - 1) in obj;\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n   ```js\n     var values = {name: 'misko', gender: 'male'};\n     var log = [];\n     angular.forEach(values, function(value, key) {\n       this.push(key + ': ' + value);\n     }, log);\n     expect(log).toEqual(['name: misko', 'gender: male']);\n   ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n  var key, length;\n  if (obj) {\n    if (isFunction(obj)) {\n      for (key in obj) {\n        // Need to check if hasOwnProperty exists,\n        // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n        if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    } else if (isArray(obj) || isArrayLike(obj)) {\n      var isPrimitive = typeof obj !== 'object';\n      for (key = 0, length = obj.length; key < length; key++) {\n        if (isPrimitive || key in obj) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    } else if (obj.forEach && obj.forEach !== forEach) {\n        obj.forEach(iterator, context, obj);\n    } else {\n      for (key in obj) {\n        if (obj.hasOwnProperty(key)) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    }\n  }\n  return obj;\n}\n\nfunction sortedKeys(obj) {\n  return Object.keys(obj).sort();\n}\n\nfunction forEachSorted(obj, iterator, context) {\n  var keys = sortedKeys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    iterator.call(context, obj[keys[i]], keys[i]);\n  }\n  return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n  return function(value, key) { iteratorFn(key, value); };\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n  return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n  if (h) {\n    obj.$$hashKey = h;\n  } else {\n    delete obj.$$hashKey;\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy).\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n  var h = dst.$$hashKey;\n\n  for (var i = 1, ii = arguments.length; i < ii; i++) {\n    var obj = arguments[i];\n    if (obj) {\n      var keys = Object.keys(obj);\n      for (var j = 0, jj = keys.length; j < jj; j++) {\n        var key = keys[j];\n        dst[key] = obj[key];\n      }\n    }\n  }\n\n  setHashKey(dst, h);\n  return dst;\n}\n\nfunction int(str) {\n  return parseInt(str, 10);\n}\n\n\nfunction inherit(parent, extra) {\n  return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n   ```js\n     function foo(callback) {\n       var result = calculateResult();\n       (callback || angular.noop)(result);\n     }\n   ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n   ```js\n     function transformer(transformationFn, value) {\n       return (transformationFn || angular.identity)(value);\n     };\n   ```\n  * @param {*} value to be returned.\n  * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function() {return value;};}\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n  // http://jsperf.com/isobject4\n  return value !== null && typeof value === 'object';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n  return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n  return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n  return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n  return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n  return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n  return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n  return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n  return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n  return obj && isFunction(obj.then);\n}\n\n\nvar trim = function(value) {\n  return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n  return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n           replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a DOM element (or wrapped jQuery element).\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).\n */\nfunction isElement(node) {\n  return !!(node &&\n    (node.nodeName  // we are a direct element\n    || (node.prop && node.attr && node.find)));  // we have an on and find method part of jQuery API\n}\n\n/**\n * @param str 'key1,key2,...'\n * @returns {object} in the form of {key1:true, key2:true, ...}\n */\nfunction makeMap(str) {\n  var obj = {}, items = str.split(\",\"), i;\n  for (i = 0; i < items.length; i++)\n    obj[items[i]] = true;\n  return obj;\n}\n\n\nfunction nodeName_(element) {\n  return lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\nfunction includes(array, obj) {\n  return Array.prototype.indexOf.call(array, obj) != -1;\n}\n\nfunction arrayRemove(array, value) {\n  var index = array.indexOf(value);\n  if (index >= 0)\n    array.splice(index, 1);\n  return value;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n *   are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to 'destination' an exception will be thrown.\n *\n * @param {*} source The source that will be used to make a copy.\n *                   Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n *     provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n <example module=\"copyExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate class=\"simple-form\">\n Name: <input type=\"text\" ng-model=\"user.name\" /><br />\n E-mail: <input type=\"email\" ng-model=\"user.email\" /><br />\n Gender: <input type=\"radio\" ng-model=\"user.gender\" value=\"male\" />male\n <input type=\"radio\" ng-model=\"user.gender\" value=\"female\" />female<br />\n <button ng-click=\"reset()\">RESET</button>\n <button ng-click=\"update(user)\">SAVE</button>\n </form>\n <pre>form = {{user | json}}</pre>\n <pre>master = {{master | json}}</pre>\n </div>\n\n <script>\n  angular.module('copyExample', [])\n    .controller('ExampleController', ['$scope', function($scope) {\n      $scope.master= {};\n\n      $scope.update = function(user) {\n        // Example with 1 argument\n        $scope.master= angular.copy(user);\n      };\n\n      $scope.reset = function() {\n        // Example with 2 arguments\n        angular.copy($scope.master, $scope.user);\n      };\n\n      $scope.reset();\n    }]);\n </script>\n </file>\n </example>\n */\nfunction copy(source, destination, stackSource, stackDest) {\n  if (isWindow(source) || isScope(source)) {\n    throw ngMinErr('cpws',\n      \"Can't copy! Making copies of Window or Scope instances is not supported.\");\n  }\n\n  if (!destination) {\n    destination = source;\n    if (source) {\n      if (isArray(source)) {\n        destination = copy(source, [], stackSource, stackDest);\n      } else if (isDate(source)) {\n        destination = new Date(source.getTime());\n      } else if (isRegExp(source)) {\n        destination = new RegExp(source.source, source.toString().match(/[^\\/]*$/)[0]);\n        destination.lastIndex = source.lastIndex;\n      } else if (isObject(source)) {\n        var emptyObject = Object.create(Object.getPrototypeOf(source));\n        destination = copy(source, emptyObject, stackSource, stackDest);\n      }\n    }\n  } else {\n    if (source === destination) throw ngMinErr('cpi',\n      \"Can't copy! Source and destination are identical.\");\n\n    stackSource = stackSource || [];\n    stackDest = stackDest || [];\n\n    if (isObject(source)) {\n      var index = stackSource.indexOf(source);\n      if (index !== -1) return stackDest[index];\n\n      stackSource.push(source);\n      stackDest.push(destination);\n    }\n\n    var result;\n    if (isArray(source)) {\n      destination.length = 0;\n      for (var i = 0; i < source.length; i++) {\n        result = copy(source[i], null, stackSource, stackDest);\n        if (isObject(source[i])) {\n          stackSource.push(source[i]);\n          stackDest.push(result);\n        }\n        destination.push(result);\n      }\n    } else {\n      var h = destination.$$hashKey;\n      if (isArray(destination)) {\n        destination.length = 0;\n      } else {\n        forEach(destination, function(value, key) {\n          delete destination[key];\n        });\n      }\n      for (var key in source) {\n        if (source.hasOwnProperty(key)) {\n          result = copy(source[key], null, stackSource, stackDest);\n          if (isObject(source[key])) {\n            stackSource.push(source[key]);\n            stackDest.push(result);\n          }\n          destination[key] = result;\n        }\n      }\n      setHashKey(destination,h);\n    }\n\n  }\n  return destination;\n}\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n  if (isArray(src)) {\n    dst = dst || [];\n\n    for (var i = 0, ii = src.length; i < ii; i++) {\n      dst[i] = src[i];\n    }\n  } else if (isObject(src)) {\n    dst = dst || {};\n\n    for (var key in src) {\n      if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n        dst[key] = src[key];\n      }\n    }\n  }\n\n  return dst || src;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n *   comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n *   /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n *   representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n */\nfunction equals(o1, o2) {\n  if (o1 === o2) return true;\n  if (o1 === null || o2 === null) return false;\n  if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n  var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n  if (t1 == t2) {\n    if (t1 == 'object') {\n      if (isArray(o1)) {\n        if (!isArray(o2)) return false;\n        if ((length = o1.length) == o2.length) {\n          for (key = 0; key < length; key++) {\n            if (!equals(o1[key], o2[key])) return false;\n          }\n          return true;\n        }\n      } else if (isDate(o1)) {\n        if (!isDate(o2)) return false;\n        return equals(o1.getTime(), o2.getTime());\n      } else if (isRegExp(o1) && isRegExp(o2)) {\n        return o1.toString() == o2.toString();\n      } else {\n        if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false;\n        keySet = {};\n        for (key in o1) {\n          if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n          if (!equals(o1[key], o2[key])) return false;\n          keySet[key] = true;\n        }\n        for (key in o2) {\n          if (!keySet.hasOwnProperty(key) &&\n              key.charAt(0) !== '$' &&\n              o2[key] !== undefined &&\n              !isFunction(o2[key])) return false;\n        }\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\nvar csp = function() {\n  if (isDefined(csp.isActive_)) return csp.isActive_;\n\n  var active = !!(document.querySelector('[ng-csp]') ||\n                  document.querySelector('[data-ng-csp]'));\n\n  if (!active) {\n    try {\n      /* jshint -W031, -W054 */\n      new Function('');\n      /* jshint +W031, +W054 */\n    } catch (e) {\n      active = true;\n    }\n  }\n\n  return (csp.isActive_ = active);\n};\n\n\n\nfunction concat(array1, array2, index) {\n  return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n  return slice.call(args, startIndex || 0);\n}\n\n\n/* jshint -W101 */\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n/* jshint +W101 */\nfunction bind(self, fn) {\n  var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n  if (isFunction(fn) && !(fn instanceof RegExp)) {\n    return curryArgs.length\n      ? function() {\n          return arguments.length\n            ? fn.apply(self, concat(curryArgs, arguments, 0))\n            : fn.apply(self, curryArgs);\n        }\n      : function() {\n          return arguments.length\n            ? fn.apply(self, arguments)\n            : fn.call(self);\n        };\n  } else {\n    // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)\n    return fn;\n  }\n}\n\n\nfunction toJsonReplacer(key, value) {\n  var val = value;\n\n  if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n    val = undefined;\n  } else if (isWindow(value)) {\n    val = '$WINDOW';\n  } else if (value &&  document === value) {\n    val = '$DOCUMENT';\n  } else if (isScope(value)) {\n    val = '$SCOPE';\n  }\n\n  return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.\n * @param {boolean|number=} pretty If set to true, the JSON output will contain newlines and whitespace.\n *    If set to an integer, the JSON output will contain that many spaces per indentation (the default is 2).\n * @returns {string|undefined} JSON-ified string representing `obj`.\n */\nfunction toJson(obj, pretty) {\n  if (typeof obj === 'undefined') return undefined;\n  if (!isNumber(pretty)) {\n    pretty = pretty ? 2 : null;\n  }\n  return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n  return isString(json)\n      ? JSON.parse(json)\n      : json;\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n  element = jqLite(element).clone();\n  try {\n    // turns out IE does not let you set .html() on elements which\n    // are not allowed to have children. So we just ignore it.\n    element.empty();\n  } catch (e) {}\n  var elemHtml = jqLite('<div>').append(element).html();\n  try {\n    return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n        elemHtml.\n          match(/^(<[^>]+>)/)[1].\n          replace(/^<([\\w\\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });\n  } catch (e) {\n    return lowercase(elemHtml);\n  }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n  try {\n    return decodeURIComponent(value);\n  } catch (e) {\n    // Ignore any invalid uri component\n  }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.<string,boolean|Array>}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n  var obj = {}, key_value, key;\n  forEach((keyValue || \"\").split('&'), function(keyValue) {\n    if (keyValue) {\n      key_value = keyValue.replace(/\\+/g,'%20').split('=');\n      key = tryDecodeURIComponent(key_value[0]);\n      if (isDefined(key)) {\n        var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;\n        if (!hasOwnProperty.call(obj, key)) {\n          obj[key] = val;\n        } else if (isArray(obj[key])) {\n          obj[key].push(val);\n        } else {\n          obj[key] = [obj[key],val];\n        }\n      }\n    }\n  });\n  return obj;\n}\n\nfunction toKeyValue(obj) {\n  var parts = [];\n  forEach(obj, function(value, key) {\n    if (isArray(value)) {\n      forEach(value, function(arrayValue) {\n        parts.push(encodeUriQuery(key, true) +\n                   (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n      });\n    } else {\n    parts.push(encodeUriQuery(key, true) +\n               (value === true ? '' : '=' + encodeUriQuery(value, true)));\n    }\n  });\n  return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n *    segment       = *pchar\n *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n *    pct-encoded   = \"%\" HEXDIG HEXDIG\n *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n  return encodeUriQuery(val, true).\n             replace(/%26/gi, '&').\n             replace(/%3D/gi, '=').\n             replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n *    query       = *( pchar / \"/\" / \"?\" )\n *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n *    pct-encoded   = \"%\" HEXDIG HEXDIG\n *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n  return encodeURIComponent(val).\n             replace(/%40/gi, '@').\n             replace(/%3A/gi, ':').\n             replace(/%24/g, '$').\n             replace(/%2C/gi, ',').\n             replace(/%3B/gi, ';').\n             replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n  var attr, i, ii = ngAttrPrefixes.length;\n  element = jqLite(element);\n  for (i = 0; i < ii; ++i) {\n    attr = ngAttrPrefixes[i] + ngAttr;\n    if (isString(attr = element.attr(attr))) {\n      return attr;\n    }\n  }\n  return null;\n}\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n *   {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n *   created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n *   do not use explicit function annotation (and are thus unsuitable for minification), as described\n *   in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n *   tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `<body>` or `<html>` tags.\n *\n * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application.  This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n <example module=\"ngAppDemo\">\n   <file name=\"index.html\">\n   <div ng-controller=\"ngAppDemoController\">\n     I can add: {{a}} + {{b}} =  {{ a+b }}\n   </div>\n   </file>\n   <file name=\"script.js\">\n   angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n     $scope.a = 1;\n     $scope.b = 2;\n   });\n   </file>\n </example>\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n <example ng-app-included=\"true\">\n   <file name=\"index.html\">\n   <div ng-app=\"ngAppStrictDemo\" ng-strict-di>\n       <div ng-controller=\"GoodController1\">\n           I can add: {{a}} + {{b}} =  {{ a+b }}\n\n           <p>This renders because the controller does not fail to\n              instantiate, by using explicit annotation style (see\n              script.js for details)\n           </p>\n       </div>\n\n       <div ng-controller=\"GoodController2\">\n           Name: <input ng-model=\"name\"><br />\n           Hello, {{name}}!\n\n           <p>This renders because the controller does not fail to\n              instantiate, by using explicit annotation style\n              (see script.js for details)\n           </p>\n       </div>\n\n       <div ng-controller=\"BadController\">\n           I can add: {{a}} + {{b}} =  {{ a+b }}\n\n           <p>The controller could not be instantiated, due to relying\n              on automatic function annotations (which are disabled in\n              strict mode). As such, the content of this section is not\n              interpolated, and there should be an error in your web console.\n           </p>\n       </div>\n   </div>\n   </file>\n   <file name=\"script.js\">\n   angular.module('ngAppStrictDemo', [])\n     // BadController will fail to instantiate, due to relying on automatic function annotation,\n     // rather than an explicit annotation\n     .controller('BadController', function($scope) {\n       $scope.a = 1;\n       $scope.b = 2;\n     })\n     // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n     // due to using explicit annotations using the array style and $inject property, respectively.\n     .controller('GoodController1', ['$scope', function($scope) {\n       $scope.a = 1;\n       $scope.b = 2;\n     }])\n     .controller('GoodController2', GoodController2);\n     function GoodController2($scope) {\n       $scope.name = \"World\";\n     }\n     GoodController2.$inject = ['$scope'];\n   </file>\n   <file name=\"style.css\">\n   div[ng-controller] {\n       margin-bottom: 1em;\n       -webkit-border-radius: 4px;\n       border-radius: 4px;\n       border: 1px solid;\n       padding: .5em;\n   }\n   div[ng-controller^=Good] {\n       border-color: #d6e9c6;\n       background-color: #dff0d8;\n       color: #3c763d;\n   }\n   div[ng-controller^=Bad] {\n       border-color: #ebccd1;\n       background-color: #f2dede;\n       color: #a94442;\n       margin-bottom: 0;\n   }\n   </file>\n </example>\n */\nfunction angularInit(element, bootstrap) {\n  var appElement,\n      module,\n      config = {};\n\n  // The element `element` has priority over any other element\n  forEach(ngAttrPrefixes, function(prefix) {\n    var name = prefix + 'app';\n\n    if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n      appElement = element;\n      module = element.getAttribute(name);\n    }\n  });\n  forEach(ngAttrPrefixes, function(prefix) {\n    var name = prefix + 'app';\n    var candidate;\n\n    if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n      appElement = candidate;\n      module = candidate.getAttribute(name);\n    }\n  });\n  if (appElement) {\n    config.strictDi = getNgAttribute(appElement, \"strict-di\") !== null;\n    bootstrap(appElement, module ? [module] : [], config);\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * See: {@link guide/bootstrap Bootstrap}\n *\n * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n * ```html\n * <!doctype html>\n * <html>\n * <body>\n * <div ng-controller=\"WelcomeController\">\n *   {{greeting}}\n * </div>\n *\n * <script src=\"angular.js\"></script>\n * <script>\n *   var app = angular.module('demo', [])\n *   .controller('WelcomeController', function($scope) {\n *       $scope.greeting = 'Welcome!';\n *   });\n *   angular.bootstrap(document, ['demo']);\n * </script>\n * </body>\n * </html>\n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.\n *     Each item in the array should be the name of a predefined module or a (DI annotated)\n *     function that will be invoked by the injector as a `config` block.\n *     See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n *     following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n *   assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n  if (!isObject(config)) config = {};\n  var defaultConfig = {\n    strictDi: false\n  };\n  config = extend(defaultConfig, config);\n  var doBootstrap = function() {\n    element = jqLite(element);\n\n    if (element.injector()) {\n      var tag = (element[0] === document) ? 'document' : startingTag(element);\n      //Encode angle brackets to prevent input from being sanitized to empty string #8683\n      throw ngMinErr(\n          'btstrpd',\n          \"App Already Bootstrapped with this Element '{0}'\",\n          tag.replace(/</,'&lt;').replace(/>/,'&gt;'));\n    }\n\n    modules = modules || [];\n    modules.unshift(['$provide', function($provide) {\n      $provide.value('$rootElement', element);\n    }]);\n\n    if (config.debugInfoEnabled) {\n      // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n      modules.push(['$compileProvider', function($compileProvider) {\n        $compileProvider.debugInfoEnabled(true);\n      }]);\n    }\n\n    modules.unshift('ng');\n    var injector = createInjector(modules, config.strictDi);\n    injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n       function bootstrapApply(scope, element, compile, injector) {\n        scope.$apply(function() {\n          element.data('$injector', injector);\n          compile(element)(scope);\n        });\n      }]\n    );\n    return injector;\n  };\n\n  var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n  var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n  if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n    config.debugInfoEnabled = true;\n    window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n  }\n\n  if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n    return doBootstrap();\n  }\n\n  window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n  angular.resumeBootstrap = function(extraModules) {\n    forEach(extraModules, function(module) {\n      modules.push(module);\n    });\n    return doBootstrap();\n  };\n\n  if (isFunction(angular.resumeDeferredBootstrap)) {\n    angular.resumeDeferredBootstrap();\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n  window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n  window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n  var injector = angular.element(rootElement).injector();\n  if (!injector) {\n    throw ngMinErr('test',\n      'no injector found for element argument to getTestability');\n  }\n  return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n  separator = separator || '_';\n  return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n    return (pos ? separator : '') + letter.toLowerCase();\n  });\n}\n\nvar bindJQueryFired = false;\nvar skipDestroyOnNextJQueryCleanData;\nfunction bindJQuery() {\n  var originalCleanData;\n\n  if (bindJQueryFired) {\n    return;\n  }\n\n  // bind to jQuery if present;\n  jQuery = window.jQuery;\n  // Use jQuery if it exists with proper functionality, otherwise default to us.\n  // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n  // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n  // versions. It will not work for sure with jQuery <1.7, though.\n  if (jQuery && jQuery.fn.on) {\n    jqLite = jQuery;\n    extend(jQuery.fn, {\n      scope: JQLitePrototype.scope,\n      isolateScope: JQLitePrototype.isolateScope,\n      controller: JQLitePrototype.controller,\n      injector: JQLitePrototype.injector,\n      inheritedData: JQLitePrototype.inheritedData\n    });\n\n    // All nodes removed from the DOM via various jQuery APIs like .remove()\n    // are passed through jQuery.cleanData. Monkey-patch this method to fire\n    // the $destroy event on all removed nodes.\n    originalCleanData = jQuery.cleanData;\n    jQuery.cleanData = function(elems) {\n      var events;\n      if (!skipDestroyOnNextJQueryCleanData) {\n        for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n          events = jQuery._data(elem, \"events\");\n          if (events && events.$destroy) {\n            jQuery(elem).triggerHandler('$destroy');\n          }\n        }\n      } else {\n        skipDestroyOnNextJQueryCleanData = false;\n      }\n      originalCleanData(elems);\n    };\n  } else {\n    jqLite = JQLite;\n  }\n\n  angular.element = jqLite;\n\n  // Prevent double-proxying.\n  bindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n  if (!arg) {\n    throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n  }\n  return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n  if (acceptArrayAnnotation && isArray(arg)) {\n      arg = arg[arg.length - 1];\n  }\n\n  assertArg(isFunction(arg), name, 'not a function, got ' +\n      (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n  return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param  {String} name    the name to test\n * @param  {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n  if (name === 'hasOwnProperty') {\n    throw ngMinErr('badname', \"hasOwnProperty is not a valid {0} name\", context);\n  }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n  if (!path) return obj;\n  var keys = path.split('.');\n  var key;\n  var lastInstance = obj;\n  var len = keys.length;\n\n  for (var i = 0; i < len; i++) {\n    key = keys[i];\n    if (obj) {\n      obj = (lastInstance = obj)[key];\n    }\n  }\n  if (!bindFnToScope && isFunction(obj)) {\n    return bind(lastInstance, obj);\n  }\n  return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {jqLite} jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n  // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original\n  //             collection, otherwise update the original collection.\n  var node = nodes[0];\n  var endNode = nodes[nodes.length - 1];\n  var blockNodes = [node];\n\n  do {\n    node = node.nextSibling;\n    if (!node) break;\n    blockNodes.push(node);\n  } while (node !== endNode);\n\n  return jqLite(blockNodes);\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n  return Object.create(null);\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n  var $injectorMinErr = minErr('$injector');\n  var ngMinErr = minErr('ng');\n\n  function ensure(obj, name, factory) {\n    return obj[name] || (obj[name] = factory());\n  }\n\n  var angular = ensure(window, 'angular', Object);\n\n  // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n  angular.$$minErr = angular.$$minErr || minErr;\n\n  return ensure(angular, 'module', function() {\n    /** @type {Object.<string, angular.Module>} */\n    var modules = {};\n\n    /**\n     * @ngdoc function\n     * @name angular.module\n     * @module ng\n     * @description\n     *\n     * The `angular.module` is a global place for creating, registering and retrieving Angular\n     * modules.\n     * All modules (angular core or 3rd party) that should be available to an application must be\n     * registered using this mechanism.\n     *\n     * When passed two or more arguments, a new module is created.  If passed only one argument, an\n     * existing module (the name passed as the first argument to `module`) is retrieved.\n     *\n     *\n     * # Module\n     *\n     * A module is a collection of services, directives, controllers, filters, and configuration information.\n     * `angular.module` is used to configure the {@link auto.$injector $injector}.\n     *\n     * ```js\n     * // Create a new module\n     * var myModule = angular.module('myModule', []);\n     *\n     * // register a new service\n     * myModule.value('appName', 'MyCoolApp');\n     *\n     * // configure existing services inside initialization blocks.\n     * myModule.config(['$locationProvider', function($locationProvider) {\n     *   // Configure existing providers\n     *   $locationProvider.hashPrefix('!');\n     * }]);\n     * ```\n     *\n     * Then you can create an injector and load your modules like this:\n     *\n     * ```js\n     * var injector = angular.injector(['ng', 'myModule'])\n     * ```\n     *\n     * However it's more likely that you'll just use\n     * {@link ng.directive:ngApp ngApp} or\n     * {@link angular.bootstrap} to simplify this process for you.\n     *\n     * @param {!string} name The name of the module to create or retrieve.\n     * @param {!Array.<string>=} requires If specified then new module is being created. If\n     *        unspecified then the module is being retrieved for further configuration.\n     * @param {Function=} configFn Optional configuration function for the module. Same as\n     *        {@link angular.Module#config Module#config()}.\n     * @returns {module} new module with the {@link angular.Module} api.\n     */\n    return function module(name, requires, configFn) {\n      var assertNotHasOwnProperty = function(name, context) {\n        if (name === 'hasOwnProperty') {\n          throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n        }\n      };\n\n      assertNotHasOwnProperty(name, 'module');\n      if (requires && modules.hasOwnProperty(name)) {\n        modules[name] = null;\n      }\n      return ensure(modules, name, function() {\n        if (!requires) {\n          throw $injectorMinErr('nomod', \"Module '{0}' is not available! You either misspelled \" +\n             \"the module name or forgot to load it. If registering a module ensure that you \" +\n             \"specify the dependencies as the second argument.\", name);\n        }\n\n        /** @type {!Array.<Array.<*>>} */\n        var invokeQueue = [];\n\n        /** @type {!Array.<Function>} */\n        var configBlocks = [];\n\n        /** @type {!Array.<Function>} */\n        var runBlocks = [];\n\n        var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n        /** @type {angular.Module} */\n        var moduleInstance = {\n          // Private state\n          _invokeQueue: invokeQueue,\n          _configBlocks: configBlocks,\n          _runBlocks: runBlocks,\n\n          /**\n           * @ngdoc property\n           * @name angular.Module#requires\n           * @module ng\n           *\n           * @description\n           * Holds the list of modules which the injector will load before the current module is\n           * loaded.\n           */\n          requires: requires,\n\n          /**\n           * @ngdoc property\n           * @name angular.Module#name\n           * @module ng\n           *\n           * @description\n           * Name of the module.\n           */\n          name: name,\n\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#provider\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} providerType Construction function for creating new instance of the\n           *                                service.\n           * @description\n           * See {@link auto.$provide#provider $provide.provider()}.\n           */\n          provider: invokeLater('$provide', 'provider'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#factory\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} providerFunction Function for creating new instance of the service.\n           * @description\n           * See {@link auto.$provide#factory $provide.factory()}.\n           */\n          factory: invokeLater('$provide', 'factory'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#service\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} constructor A constructor function that will be instantiated.\n           * @description\n           * See {@link auto.$provide#service $provide.service()}.\n           */\n          service: invokeLater('$provide', 'service'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#value\n           * @module ng\n           * @param {string} name service name\n           * @param {*} object Service instance object.\n           * @description\n           * See {@link auto.$provide#value $provide.value()}.\n           */\n          value: invokeLater('$provide', 'value'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#constant\n           * @module ng\n           * @param {string} name constant name\n           * @param {*} object Constant value.\n           * @description\n           * Because the constant are fixed, they get applied before other provide methods.\n           * See {@link auto.$provide#constant $provide.constant()}.\n           */\n          constant: invokeLater('$provide', 'constant', 'unshift'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#animation\n           * @module ng\n           * @param {string} name animation name\n           * @param {Function} animationFactory Factory function for creating new instance of an\n           *                                    animation.\n           * @description\n           *\n           * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n           *\n           *\n           * Defines an animation hook that can be later used with\n           * {@link ngAnimate.$animate $animate} service and directives that use this service.\n           *\n           * ```js\n           * module.animation('.animation-name', function($inject1, $inject2) {\n           *   return {\n           *     eventName : function(element, done) {\n           *       //code to run the animation\n           *       //once complete, then run done()\n           *       return function cancellationFunction(element) {\n           *         //code to cancel the animation\n           *       }\n           *     }\n           *   }\n           * })\n           * ```\n           *\n           * See {@link ng.$animateProvider#register $animateProvider.register()} and\n           * {@link ngAnimate ngAnimate module} for more information.\n           */\n          animation: invokeLater('$animateProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#filter\n           * @module ng\n           * @param {string} name Filter name.\n           * @param {Function} filterFactory Factory function for creating new instance of filter.\n           * @description\n           * See {@link ng.$filterProvider#register $filterProvider.register()}.\n           */\n          filter: invokeLater('$filterProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#controller\n           * @module ng\n           * @param {string|Object} name Controller name, or an object map of controllers where the\n           *    keys are the names and the values are the constructors.\n           * @param {Function} constructor Controller constructor function.\n           * @description\n           * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n           */\n          controller: invokeLater('$controllerProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#directive\n           * @module ng\n           * @param {string|Object} name Directive name, or an object map of directives where the\n           *    keys are the names and the values are the factories.\n           * @param {Function} directiveFactory Factory function for creating new instance of\n           * directives.\n           * @description\n           * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n           */\n          directive: invokeLater('$compileProvider', 'directive'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#config\n           * @module ng\n           * @param {Function} configFn Execute this function on module load. Useful for service\n           *    configuration.\n           * @description\n           * Use this method to register work which needs to be performed on module loading.\n           * For more about how to configure services, see\n           * {@link providers#provider-recipe Provider Recipe}.\n           */\n          config: config,\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#run\n           * @module ng\n           * @param {Function} initializationFn Execute this function after injector creation.\n           *    Useful for application initialization.\n           * @description\n           * Use this method to register work which should be performed when the injector is done\n           * loading all modules.\n           */\n          run: function(block) {\n            runBlocks.push(block);\n            return this;\n          }\n        };\n\n        if (configFn) {\n          config(configFn);\n        }\n\n        return moduleInstance;\n\n        /**\n         * @param {string} provider\n         * @param {string} method\n         * @param {String=} insertMethod\n         * @returns {angular.Module}\n         */\n        function invokeLater(provider, method, insertMethod, queue) {\n          if (!queue) queue = invokeQueue;\n          return function() {\n            queue[insertMethod || 'push']([provider, method, arguments]);\n            return moduleInstance;\n          };\n        }\n      });\n    };\n  });\n\n}\n\n/* global: toDebugString: true */\n\nfunction serializeObject(obj) {\n  var seen = [];\n\n  return JSON.stringify(obj, function(key, val) {\n    val = toJsonReplacer(key, val);\n    if (isObject(val)) {\n\n      if (seen.indexOf(val) >= 0) return '<<already seen>>';\n\n      seen.push(val);\n    }\n    return val;\n  });\n}\n\nfunction toDebugString(obj) {\n  if (typeof obj === 'function') {\n    return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n  } else if (typeof obj === 'undefined') {\n    return 'undefined';\n  } else if (typeof obj !== 'string') {\n    return serializeObject(obj);\n  }\n  return obj;\n}\n\n/* global angularModule: true,\n  version: true,\n\n  $LocaleProvider,\n  $CompileProvider,\n\n  htmlAnchorDirective,\n  inputDirective,\n  inputDirective,\n  formDirective,\n  scriptDirective,\n  selectDirective,\n  styleDirective,\n  optionDirective,\n  ngBindDirective,\n  ngBindHtmlDirective,\n  ngBindTemplateDirective,\n  ngClassDirective,\n  ngClassEvenDirective,\n  ngClassOddDirective,\n  ngCspDirective,\n  ngCloakDirective,\n  ngControllerDirective,\n  ngFormDirective,\n  ngHideDirective,\n  ngIfDirective,\n  ngIncludeDirective,\n  ngIncludeFillContentDirective,\n  ngInitDirective,\n  ngNonBindableDirective,\n  ngPluralizeDirective,\n  ngRepeatDirective,\n  ngShowDirective,\n  ngStyleDirective,\n  ngSwitchDirective,\n  ngSwitchWhenDirective,\n  ngSwitchDefaultDirective,\n  ngOptionsDirective,\n  ngTranscludeDirective,\n  ngModelDirective,\n  ngListDirective,\n  ngChangeDirective,\n  patternDirective,\n  patternDirective,\n  requiredDirective,\n  requiredDirective,\n  minlengthDirective,\n  minlengthDirective,\n  maxlengthDirective,\n  maxlengthDirective,\n  ngValueDirective,\n  ngModelOptionsDirective,\n  ngAttributeAliasDirectives,\n  ngEventDirectives,\n\n  $AnchorScrollProvider,\n  $AnimateProvider,\n  $BrowserProvider,\n  $CacheFactoryProvider,\n  $ControllerProvider,\n  $DocumentProvider,\n  $ExceptionHandlerProvider,\n  $FilterProvider,\n  $InterpolateProvider,\n  $IntervalProvider,\n  $HttpProvider,\n  $HttpBackendProvider,\n  $LocationProvider,\n  $LogProvider,\n  $ParseProvider,\n  $RootScopeProvider,\n  $QProvider,\n  $$QProvider,\n  $$SanitizeUriProvider,\n  $SceProvider,\n  $SceDelegateProvider,\n  $SnifferProvider,\n  $TemplateCacheProvider,\n  $TemplateRequestProvider,\n  $$TestabilityProvider,\n  $TimeoutProvider,\n  $$RAFProvider,\n  $$AsyncCallbackProvider,\n  $WindowProvider,\n  $$jqLiteProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version. This object has the\n * following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n  full: '1.3.13',    // all of these placeholder strings will be replaced by grunt's\n  major: 1,    // package task\n  minor: 3,\n  dot: 13,\n  codeName: 'meticulous-riffleshuffle'\n};\n\n\nfunction publishExternalAPI(angular) {\n  extend(angular, {\n    'bootstrap': bootstrap,\n    'copy': copy,\n    'extend': extend,\n    'equals': equals,\n    'element': jqLite,\n    'forEach': forEach,\n    'injector': createInjector,\n    'noop': noop,\n    'bind': bind,\n    'toJson': toJson,\n    'fromJson': fromJson,\n    'identity': identity,\n    'isUndefined': isUndefined,\n    'isDefined': isDefined,\n    'isString': isString,\n    'isFunction': isFunction,\n    'isObject': isObject,\n    'isNumber': isNumber,\n    'isElement': isElement,\n    'isArray': isArray,\n    'version': version,\n    'isDate': isDate,\n    'lowercase': lowercase,\n    'uppercase': uppercase,\n    'callbacks': {counter: 0},\n    'getTestability': getTestability,\n    '$$minErr': minErr,\n    '$$csp': csp,\n    'reloadWithDebugInfo': reloadWithDebugInfo\n  });\n\n  angularModule = setupModuleLoader(window);\n  try {\n    angularModule('ngLocale');\n  } catch (e) {\n    angularModule('ngLocale', []).provider('$locale', $LocaleProvider);\n  }\n\n  angularModule('ng', ['ngLocale'], ['$provide',\n    function ngModule($provide) {\n      // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n      $provide.provider({\n        $$sanitizeUri: $$SanitizeUriProvider\n      });\n      $provide.provider('$compile', $CompileProvider).\n        directive({\n            a: htmlAnchorDirective,\n            input: inputDirective,\n            textarea: inputDirective,\n            form: formDirective,\n            script: scriptDirective,\n            select: selectDirective,\n            style: styleDirective,\n            option: optionDirective,\n            ngBind: ngBindDirective,\n            ngBindHtml: ngBindHtmlDirective,\n            ngBindTemplate: ngBindTemplateDirective,\n            ngClass: ngClassDirective,\n            ngClassEven: ngClassEvenDirective,\n            ngClassOdd: ngClassOddDirective,\n            ngCloak: ngCloakDirective,\n            ngController: ngControllerDirective,\n            ngForm: ngFormDirective,\n            ngHide: ngHideDirective,\n            ngIf: ngIfDirective,\n            ngInclude: ngIncludeDirective,\n            ngInit: ngInitDirective,\n            ngNonBindable: ngNonBindableDirective,\n            ngPluralize: ngPluralizeDirective,\n            ngRepeat: ngRepeatDirective,\n            ngShow: ngShowDirective,\n            ngStyle: ngStyleDirective,\n            ngSwitch: ngSwitchDirective,\n            ngSwitchWhen: ngSwitchWhenDirective,\n            ngSwitchDefault: ngSwitchDefaultDirective,\n            ngOptions: ngOptionsDirective,\n            ngTransclude: ngTranscludeDirective,\n            ngModel: ngModelDirective,\n            ngList: ngListDirective,\n            ngChange: ngChangeDirective,\n            pattern: patternDirective,\n            ngPattern: patternDirective,\n            required: requiredDirective,\n            ngRequired: requiredDirective,\n            minlength: minlengthDirective,\n            ngMinlength: minlengthDirective,\n            maxlength: maxlengthDirective,\n            ngMaxlength: maxlengthDirective,\n            ngValue: ngValueDirective,\n            ngModelOptions: ngModelOptionsDirective\n        }).\n        directive({\n          ngInclude: ngIncludeFillContentDirective\n        }).\n        directive(ngAttributeAliasDirectives).\n        directive(ngEventDirectives);\n      $provide.provider({\n        $anchorScroll: $AnchorScrollProvider,\n        $animate: $AnimateProvider,\n        $browser: $BrowserProvider,\n        $cacheFactory: $CacheFactoryProvider,\n        $controller: $ControllerProvider,\n        $document: $DocumentProvider,\n        $exceptionHandler: $ExceptionHandlerProvider,\n        $filter: $FilterProvider,\n        $interpolate: $InterpolateProvider,\n        $interval: $IntervalProvider,\n        $http: $HttpProvider,\n        $httpBackend: $HttpBackendProvider,\n        $location: $LocationProvider,\n        $log: $LogProvider,\n        $parse: $ParseProvider,\n        $rootScope: $RootScopeProvider,\n        $q: $QProvider,\n        $$q: $$QProvider,\n        $sce: $SceProvider,\n        $sceDelegate: $SceDelegateProvider,\n        $sniffer: $SnifferProvider,\n        $templateCache: $TemplateCacheProvider,\n        $templateRequest: $TemplateRequestProvider,\n        $$testability: $$TestabilityProvider,\n        $timeout: $TimeoutProvider,\n        $window: $WindowProvider,\n        $$rAF: $$RAFProvider,\n        $$asyncCallback: $$AsyncCallbackProvider,\n        $$jqLite: $$jqLiteProvider\n      });\n    }\n  ]);\n}\n\n/* global JQLitePrototype: true,\n  addEventListenerFn: true,\n  removeEventListenerFn: true,\n  BOOLEAN_ATTR: true,\n  ALIASED_ATTR: true,\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to Angular's built-in subset of jQuery, called \"jQuery lite\" or \"jqLite.\"\n *\n * <div class=\"alert alert-success\">jqLite is a tiny, API-compatible subset of jQuery that allows\n * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most\n * commonly needed functionality with the goal of having a very small footprint.</div>\n *\n * To use jQuery, simply load it before `DOMContentLoaded` event fired.\n *\n * <div class=\"alert\">**Note:** all element references in Angular are always wrapped with jQuery or\n * jqLite; they are never raw DOM references.</div>\n *\n * ## Angular's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/)\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/)\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/)\n * - [`removeClass()`](http://api.jquery.com/removeClass/)\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/)\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.\n * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * ## jQuery/jqLite Extras\n * Angular also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n *    on all DOM nodes being removed.  This can be used to clean up any 3rd party bindings to the DOM\n *    element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n *   retrieves controller associated with the `ngController` directive. If `name` is provided as\n *   camelCase directive name, then the controller for this directive will be retrieved (e.g.\n *   `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n *   element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n *   be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n *   current element. This getter should be used only on elements that contain a directive which starts a new isolate\n *   scope. Calling `scope()` on this element always returns the original non-isolate scope.\n *   Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n *   parent element is reached.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n    jqId = 1,\n    addEventListenerFn = function(element, type, fn) {\n      element.addEventListener(type, fn, false);\n    },\n    removeEventListenerFn = function(element, type, fn) {\n      element.removeEventListener(type, fn, false);\n    };\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n  //jQuery always returns an object on cache miss\n  return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\nvar MOUSE_EVENT_MAP= { mouseleave: \"mouseout\", mouseenter: \"mouseover\"};\nvar jqLiteMinErr = minErr('jqLite');\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 */\nfunction camelCase(name) {\n  return name.\n    replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n      return offset ? letter.toUpperCase() : letter;\n    }).\n    replace(MOZ_HACK_REGEXP, 'Moz$1');\n}\n\nvar SINGLE_TAG_REGEXP = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi;\n\nvar wrapMap = {\n  'option': [1, '<select multiple=\"multiple\">', '</select>'],\n\n  'thead': [1, '<table>', '</table>'],\n  'col': [2, '<table><colgroup>', '</colgroup></table>'],\n  'tr': [2, '<table><tbody>', '</tbody></table>'],\n  'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],\n  '_default': [0, \"\", \"\"]\n};\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction jqLiteIsTextNode(html) {\n  return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n  // The window object can accept data but has no nodeType\n  // Otherwise we are only interested in elements (1) and documents (9)\n  var nodeType = node.nodeType;\n  return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteBuildFragment(html, context) {\n  var tmp, tag, wrap,\n      fragment = context.createDocumentFragment(),\n      nodes = [], i;\n\n  if (jqLiteIsTextNode(html)) {\n    // Convert non-html into a text node\n    nodes.push(context.createTextNode(html));\n  } else {\n    // Convert html into DOM nodes\n    tmp = tmp || fragment.appendChild(context.createElement(\"div\"));\n    tag = (TAG_NAME_REGEXP.exec(html) || [\"\", \"\"])[1].toLowerCase();\n    wrap = wrapMap[tag] || wrapMap._default;\n    tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, \"<$1></$2>\") + wrap[2];\n\n    // Descend through wrappers to the right content\n    i = wrap[0];\n    while (i--) {\n      tmp = tmp.lastChild;\n    }\n\n    nodes = concat(nodes, tmp.childNodes);\n\n    tmp = fragment.firstChild;\n    tmp.textContent = \"\";\n  }\n\n  // Remove wrapper from fragment\n  fragment.textContent = \"\";\n  fragment.innerHTML = \"\"; // Clear inner HTML\n  forEach(nodes, function(node) {\n    fragment.appendChild(node);\n  });\n\n  return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n  context = context || document;\n  var parsed;\n\n  if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n    return [context.createElement(parsed[1])];\n  }\n\n  if ((parsed = jqLiteBuildFragment(html, context))) {\n    return parsed.childNodes;\n  }\n\n  return [];\n}\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n  if (element instanceof JQLite) {\n    return element;\n  }\n\n  var argIsString;\n\n  if (isString(element)) {\n    element = trim(element);\n    argIsString = true;\n  }\n  if (!(this instanceof JQLite)) {\n    if (argIsString && element.charAt(0) != '<') {\n      throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n    }\n    return new JQLite(element);\n  }\n\n  if (argIsString) {\n    jqLiteAddNodes(this, jqLiteParseHTML(element));\n  } else {\n    jqLiteAddNodes(this, element);\n  }\n}\n\nfunction jqLiteClone(element) {\n  return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n  if (!onlyDescendants) jqLiteRemoveData(element);\n\n  if (element.querySelectorAll) {\n    var descendants = element.querySelectorAll('*');\n    for (var i = 0, l = descendants.length; i < l; i++) {\n      jqLiteRemoveData(descendants[i]);\n    }\n  }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n  if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n  var expandoStore = jqLiteExpandoStore(element);\n  var events = expandoStore && expandoStore.events;\n  var handle = expandoStore && expandoStore.handle;\n\n  if (!handle) return; //no listeners registered\n\n  if (!type) {\n    for (type in events) {\n      if (type !== '$destroy') {\n        removeEventListenerFn(element, type, handle);\n      }\n      delete events[type];\n    }\n  } else {\n    forEach(type.split(' '), function(type) {\n      if (isDefined(fn)) {\n        var listenerFns = events[type];\n        arrayRemove(listenerFns || [], fn);\n        if (listenerFns && listenerFns.length > 0) {\n          return;\n        }\n      }\n\n      removeEventListenerFn(element, type, handle);\n      delete events[type];\n    });\n  }\n}\n\nfunction jqLiteRemoveData(element, name) {\n  var expandoId = element.ng339;\n  var expandoStore = expandoId && jqCache[expandoId];\n\n  if (expandoStore) {\n    if (name) {\n      delete expandoStore.data[name];\n      return;\n    }\n\n    if (expandoStore.handle) {\n      if (expandoStore.events.$destroy) {\n        expandoStore.handle({}, '$destroy');\n      }\n      jqLiteOff(element);\n    }\n    delete jqCache[expandoId];\n    element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n  }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n  var expandoId = element.ng339,\n      expandoStore = expandoId && jqCache[expandoId];\n\n  if (createIfNecessary && !expandoStore) {\n    element.ng339 = expandoId = jqNextId();\n    expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n  }\n\n  return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n  if (jqLiteAcceptsData(element)) {\n\n    var isSimpleSetter = isDefined(value);\n    var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n    var massGetter = !key;\n    var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n    var data = expandoStore && expandoStore.data;\n\n    if (isSimpleSetter) { // data('key', value)\n      data[key] = value;\n    } else {\n      if (massGetter) {  // data()\n        return data;\n      } else {\n        if (isSimpleGetter) { // data('key')\n          // don't force creation of expandoStore if it doesn't exist yet\n          return data && data[key];\n        } else { // mass-setter: data({key1: val1, key2: val2})\n          extend(data, key);\n        }\n      }\n    }\n  }\n}\n\nfunction jqLiteHasClass(element, selector) {\n  if (!element.getAttribute) return false;\n  return ((\" \" + (element.getAttribute('class') || '') + \" \").replace(/[\\n\\t]/g, \" \").\n      indexOf(\" \" + selector + \" \") > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n  if (cssClasses && element.setAttribute) {\n    forEach(cssClasses.split(' '), function(cssClass) {\n      element.setAttribute('class', trim(\n          (\" \" + (element.getAttribute('class') || '') + \" \")\n          .replace(/[\\n\\t]/g, \" \")\n          .replace(\" \" + trim(cssClass) + \" \", \" \"))\n      );\n    });\n  }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n  if (cssClasses && element.setAttribute) {\n    var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n                            .replace(/[\\n\\t]/g, \" \");\n\n    forEach(cssClasses.split(' '), function(cssClass) {\n      cssClass = trim(cssClass);\n      if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n        existingClasses += cssClass + ' ';\n      }\n    });\n\n    element.setAttribute('class', trim(existingClasses));\n  }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n  // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n  if (elements) {\n\n    // if a Node (the most common case)\n    if (elements.nodeType) {\n      root[root.length++] = elements;\n    } else {\n      var length = elements.length;\n\n      // if an Array or NodeList and not a Window\n      if (typeof length === 'number' && elements.window !== elements) {\n        if (length) {\n          for (var i = 0; i < length; i++) {\n            root[root.length++] = elements[i];\n          }\n        }\n      } else {\n        root[root.length++] = elements;\n      }\n    }\n  }\n}\n\n\nfunction jqLiteController(element, name) {\n  return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n  // if element is the document object work with the html element instead\n  // this makes $(document).scope() possible\n  if (element.nodeType == NODE_TYPE_DOCUMENT) {\n    element = element.documentElement;\n  }\n  var names = isArray(name) ? name : [name];\n\n  while (element) {\n    for (var i = 0, ii = names.length; i < ii; i++) {\n      if ((value = jqLite.data(element, names[i])) !== undefined) return value;\n    }\n\n    // If dealing with a document fragment node with a host element, and no parent, use the host\n    // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n    // to lookup parent controllers.\n    element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n  }\n}\n\nfunction jqLiteEmpty(element) {\n  jqLiteDealoc(element, true);\n  while (element.firstChild) {\n    element.removeChild(element.firstChild);\n  }\n}\n\nfunction jqLiteRemove(element, keepData) {\n  if (!keepData) jqLiteDealoc(element);\n  var parent = element.parentNode;\n  if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n  win = win || window;\n  if (win.document.readyState === 'complete') {\n    // Force the action to be run async for consistent behaviour\n    // from the action's point of view\n    // i.e. it will definitely not be in a $apply\n    win.setTimeout(action);\n  } else {\n    // No need to unbind this handler as load is only ever called once\n    jqLite(win).on('load', action);\n  }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n  ready: function(fn) {\n    var fired = false;\n\n    function trigger() {\n      if (fired) return;\n      fired = true;\n      fn();\n    }\n\n    // check if document is already loaded\n    if (document.readyState === 'complete') {\n      setTimeout(trigger);\n    } else {\n      this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9\n      // we can not use jqLite since we are not done loading and jQuery could be loaded later.\n      // jshint -W064\n      JQLite(window).on('load', trigger); // fallback to window.onload for others\n      // jshint +W064\n    }\n  },\n  toString: function() {\n    var value = [];\n    forEach(this, function(e) { value.push('' + e);});\n    return '[' + value.join(', ') + ']';\n  },\n\n  eq: function(index) {\n      return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n  },\n\n  length: 0,\n  push: push,\n  sort: [].sort,\n  splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n  BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n  BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n  'ngMinlength': 'minlength',\n  'ngMaxlength': 'maxlength',\n  'ngMin': 'min',\n  'ngMax': 'max',\n  'ngPattern': 'pattern'\n};\n\nfunction getBooleanAttrName(element, name) {\n  // check dom last since we will most likely fail on name\n  var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n  // booleanAttr is here twice to minimize DOM access\n  return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(element, name) {\n  var nodeName = element.nodeName;\n  return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];\n}\n\nforEach({\n  data: jqLiteData,\n  removeData: jqLiteRemoveData\n}, function(fn, name) {\n  JQLite[name] = fn;\n});\n\nforEach({\n  data: jqLiteData,\n  inheritedData: jqLiteInheritedData,\n\n  scope: function(element) {\n    // Can't use jqLiteData here directly so we stay compatible with jQuery!\n    return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n  },\n\n  isolateScope: function(element) {\n    // Can't use jqLiteData here directly so we stay compatible with jQuery!\n    return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n  },\n\n  controller: jqLiteController,\n\n  injector: function(element) {\n    return jqLiteInheritedData(element, '$injector');\n  },\n\n  removeAttr: function(element, name) {\n    element.removeAttribute(name);\n  },\n\n  hasClass: jqLiteHasClass,\n\n  css: function(element, name, value) {\n    name = camelCase(name);\n\n    if (isDefined(value)) {\n      element.style[name] = value;\n    } else {\n      return element.style[name];\n    }\n  },\n\n  attr: function(element, name, value) {\n    var lowercasedName = lowercase(name);\n    if (BOOLEAN_ATTR[lowercasedName]) {\n      if (isDefined(value)) {\n        if (!!value) {\n          element[name] = true;\n          element.setAttribute(name, lowercasedName);\n        } else {\n          element[name] = false;\n          element.removeAttribute(lowercasedName);\n        }\n      } else {\n        return (element[name] ||\n                 (element.attributes.getNamedItem(name) || noop).specified)\n               ? lowercasedName\n               : undefined;\n      }\n    } else if (isDefined(value)) {\n      element.setAttribute(name, value);\n    } else if (element.getAttribute) {\n      // the extra argument \"2\" is to get the right thing for a.href in IE, see jQuery code\n      // some elements (e.g. Document) don't have get attribute, so return undefined\n      var ret = element.getAttribute(name, 2);\n      // normalize non-existing attributes to undefined (as jQuery)\n      return ret === null ? undefined : ret;\n    }\n  },\n\n  prop: function(element, name, value) {\n    if (isDefined(value)) {\n      element[name] = value;\n    } else {\n      return element[name];\n    }\n  },\n\n  text: (function() {\n    getText.$dv = '';\n    return getText;\n\n    function getText(element, value) {\n      if (isUndefined(value)) {\n        var nodeType = element.nodeType;\n        return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n      }\n      element.textContent = value;\n    }\n  })(),\n\n  val: function(element, value) {\n    if (isUndefined(value)) {\n      if (element.multiple && nodeName_(element) === 'select') {\n        var result = [];\n        forEach(element.options, function(option) {\n          if (option.selected) {\n            result.push(option.value || option.text);\n          }\n        });\n        return result.length === 0 ? null : result;\n      }\n      return element.value;\n    }\n    element.value = value;\n  },\n\n  html: function(element, value) {\n    if (isUndefined(value)) {\n      return element.innerHTML;\n    }\n    jqLiteDealoc(element, true);\n    element.innerHTML = value;\n  },\n\n  empty: jqLiteEmpty\n}, function(fn, name) {\n  /**\n   * Properties: writes return selection, reads return first value\n   */\n  JQLite.prototype[name] = function(arg1, arg2) {\n    var i, key;\n    var nodeCount = this.length;\n\n    // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n    // in a way that survives minification.\n    // jqLiteEmpty takes no arguments but is a setter.\n    if (fn !== jqLiteEmpty &&\n        (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) {\n      if (isObject(arg1)) {\n\n        // we are a write, but the object properties are the key/values\n        for (i = 0; i < nodeCount; i++) {\n          if (fn === jqLiteData) {\n            // data() takes the whole object in jQuery\n            fn(this[i], arg1);\n          } else {\n            for (key in arg1) {\n              fn(this[i], key, arg1[key]);\n            }\n          }\n        }\n        // return self for chaining\n        return this;\n      } else {\n        // we are a read, so read the first child.\n        // TODO: do we still need this?\n        var value = fn.$dv;\n        // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n        var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount;\n        for (var j = 0; j < jj; j++) {\n          var nodeValue = fn(this[j], arg1, arg2);\n          value = value ? value + nodeValue : nodeValue;\n        }\n        return value;\n      }\n    } else {\n      // we are a write, so apply to all children\n      for (i = 0; i < nodeCount; i++) {\n        fn(this[i], arg1, arg2);\n      }\n      // return self for chaining\n      return this;\n    }\n  };\n});\n\nfunction createEventHandler(element, events) {\n  var eventHandler = function(event, type) {\n    // jQuery specific api\n    event.isDefaultPrevented = function() {\n      return event.defaultPrevented;\n    };\n\n    var eventFns = events[type || event.type];\n    var eventFnsLength = eventFns ? eventFns.length : 0;\n\n    if (!eventFnsLength) return;\n\n    if (isUndefined(event.immediatePropagationStopped)) {\n      var originalStopImmediatePropagation = event.stopImmediatePropagation;\n      event.stopImmediatePropagation = function() {\n        event.immediatePropagationStopped = true;\n\n        if (event.stopPropagation) {\n          event.stopPropagation();\n        }\n\n        if (originalStopImmediatePropagation) {\n          originalStopImmediatePropagation.call(event);\n        }\n      };\n    }\n\n    event.isImmediatePropagationStopped = function() {\n      return event.immediatePropagationStopped === true;\n    };\n\n    // Copy event handlers in case event handlers array is modified during execution.\n    if ((eventFnsLength > 1)) {\n      eventFns = shallowCopy(eventFns);\n    }\n\n    for (var i = 0; i < eventFnsLength; i++) {\n      if (!event.isImmediatePropagationStopped()) {\n        eventFns[i].call(element, event);\n      }\n    }\n  };\n\n  // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n  //       events on `element`\n  eventHandler.elem = element;\n  return eventHandler;\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n  removeData: jqLiteRemoveData,\n\n  on: function jqLiteOn(element, type, fn, unsupported) {\n    if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n    // Do not add event handlers to non-elements because they will not be cleaned up.\n    if (!jqLiteAcceptsData(element)) {\n      return;\n    }\n\n    var expandoStore = jqLiteExpandoStore(element, true);\n    var events = expandoStore.events;\n    var handle = expandoStore.handle;\n\n    if (!handle) {\n      handle = expandoStore.handle = createEventHandler(element, events);\n    }\n\n    // http://jsperf.com/string-indexof-vs-split\n    var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n    var i = types.length;\n\n    while (i--) {\n      type = types[i];\n      var eventFns = events[type];\n\n      if (!eventFns) {\n        events[type] = [];\n\n        if (type === 'mouseenter' || type === 'mouseleave') {\n          // Refer to jQuery's implementation of mouseenter & mouseleave\n          // Read about mouseenter and mouseleave:\n          // http://www.quirksmode.org/js/events_mouse.html#link8\n\n          jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) {\n            var target = this, related = event.relatedTarget;\n            // For mousenter/leave call the handler if related is outside the target.\n            // NB: No relatedTarget if the mouse left/entered the browser window\n            if (!related || (related !== target && !target.contains(related))) {\n              handle(event, type);\n            }\n          });\n\n        } else {\n          if (type !== '$destroy') {\n            addEventListenerFn(element, type, handle);\n          }\n        }\n        eventFns = events[type];\n      }\n      eventFns.push(fn);\n    }\n  },\n\n  off: jqLiteOff,\n\n  one: function(element, type, fn) {\n    element = jqLite(element);\n\n    //add the listener twice so that when it is called\n    //you can remove the original function and still be\n    //able to call element.off(ev, fn) normally\n    element.on(type, function onFn() {\n      element.off(type, fn);\n      element.off(type, onFn);\n    });\n    element.on(type, fn);\n  },\n\n  replaceWith: function(element, replaceNode) {\n    var index, parent = element.parentNode;\n    jqLiteDealoc(element);\n    forEach(new JQLite(replaceNode), function(node) {\n      if (index) {\n        parent.insertBefore(node, index.nextSibling);\n      } else {\n        parent.replaceChild(node, element);\n      }\n      index = node;\n    });\n  },\n\n  children: function(element) {\n    var children = [];\n    forEach(element.childNodes, function(element) {\n      if (element.nodeType === NODE_TYPE_ELEMENT)\n        children.push(element);\n    });\n    return children;\n  },\n\n  contents: function(element) {\n    return element.contentDocument || element.childNodes || [];\n  },\n\n  append: function(element, node) {\n    var nodeType = element.nodeType;\n    if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n    node = new JQLite(node);\n\n    for (var i = 0, ii = node.length; i < ii; i++) {\n      var child = node[i];\n      element.appendChild(child);\n    }\n  },\n\n  prepend: function(element, node) {\n    if (element.nodeType === NODE_TYPE_ELEMENT) {\n      var index = element.firstChild;\n      forEach(new JQLite(node), function(child) {\n        element.insertBefore(child, index);\n      });\n    }\n  },\n\n  wrap: function(element, wrapNode) {\n    wrapNode = jqLite(wrapNode).eq(0).clone()[0];\n    var parent = element.parentNode;\n    if (parent) {\n      parent.replaceChild(wrapNode, element);\n    }\n    wrapNode.appendChild(element);\n  },\n\n  remove: jqLiteRemove,\n\n  detach: function(element) {\n    jqLiteRemove(element, true);\n  },\n\n  after: function(element, newElement) {\n    var index = element, parent = element.parentNode;\n    newElement = new JQLite(newElement);\n\n    for (var i = 0, ii = newElement.length; i < ii; i++) {\n      var node = newElement[i];\n      parent.insertBefore(node, index.nextSibling);\n      index = node;\n    }\n  },\n\n  addClass: jqLiteAddClass,\n  removeClass: jqLiteRemoveClass,\n\n  toggleClass: function(element, selector, condition) {\n    if (selector) {\n      forEach(selector.split(' '), function(className) {\n        var classCondition = condition;\n        if (isUndefined(classCondition)) {\n          classCondition = !jqLiteHasClass(element, className);\n        }\n        (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n      });\n    }\n  },\n\n  parent: function(element) {\n    var parent = element.parentNode;\n    return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n  },\n\n  next: function(element) {\n    return element.nextElementSibling;\n  },\n\n  find: function(element, selector) {\n    if (element.getElementsByTagName) {\n      return element.getElementsByTagName(selector);\n    } else {\n      return [];\n    }\n  },\n\n  clone: jqLiteClone,\n\n  triggerHandler: function(element, event, extraParameters) {\n\n    var dummyEvent, eventFnsCopy, handlerArgs;\n    var eventName = event.type || event;\n    var expandoStore = jqLiteExpandoStore(element);\n    var events = expandoStore && expandoStore.events;\n    var eventFns = events && events[eventName];\n\n    if (eventFns) {\n      // Create a dummy event to pass to the handlers\n      dummyEvent = {\n        preventDefault: function() { this.defaultPrevented = true; },\n        isDefaultPrevented: function() { return this.defaultPrevented === true; },\n        stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n        isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n        stopPropagation: noop,\n        type: eventName,\n        target: element\n      };\n\n      // If a custom event was provided then extend our dummy event with it\n      if (event.type) {\n        dummyEvent = extend(dummyEvent, event);\n      }\n\n      // Copy event handlers in case event handlers array is modified during execution.\n      eventFnsCopy = shallowCopy(eventFns);\n      handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n      forEach(eventFnsCopy, function(fn) {\n        if (!dummyEvent.isImmediatePropagationStopped()) {\n          fn.apply(element, handlerArgs);\n        }\n      });\n    }\n  }\n}, function(fn, name) {\n  /**\n   * chaining functions\n   */\n  JQLite.prototype[name] = function(arg1, arg2, arg3) {\n    var value;\n\n    for (var i = 0, ii = this.length; i < ii; i++) {\n      if (isUndefined(value)) {\n        value = fn(this[i], arg1, arg2, arg3);\n        if (isDefined(value)) {\n          // any function which returns a value needs to be wrapped\n          value = jqLite(value);\n        }\n      } else {\n        jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n      }\n    }\n    return isDefined(value) ? value : this;\n  };\n\n  // bind legacy bind/unbind to on/off\n  JQLite.prototype.bind = JQLite.prototype.on;\n  JQLite.prototype.unbind = JQLite.prototype.off;\n});\n\n\n// Provider for private $$jqLite service\nfunction $$jqLiteProvider() {\n  this.$get = function $$jqLite() {\n    return extend(JQLite, {\n      hasClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteHasClass(node, classes);\n      },\n      addClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteAddClass(node, classes);\n      },\n      removeClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteRemoveClass(node, classes);\n      }\n    });\n  };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n *  string is string\n *  number is number as string\n *  object is either result of calling $$hashKey function on the object or uniquely generated id,\n *         that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n *         The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n  var key = obj && obj.$$hashKey;\n\n  if (key) {\n    if (typeof key === 'function') {\n      key = obj.$$hashKey();\n    }\n    return key;\n  }\n\n  var objType = typeof obj;\n  if (objType == 'function' || (objType == 'object' && obj !== null)) {\n    key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n  } else {\n    key = objType + ':' + obj;\n  }\n\n  return key;\n}\n\n/**\n * HashMap which can use objects as keys\n */\nfunction HashMap(array, isolatedUid) {\n  if (isolatedUid) {\n    var uid = 0;\n    this.nextUid = function() {\n      return ++uid;\n    };\n  }\n  forEach(array, this.put, this);\n}\nHashMap.prototype = {\n  /**\n   * Store key value pair\n   * @param key key to store can be any type\n   * @param value value to store can be any type\n   */\n  put: function(key, value) {\n    this[hashKey(key, this.nextUid)] = value;\n  },\n\n  /**\n   * @param key\n   * @returns {Object} the value for the key\n   */\n  get: function(key) {\n    return this[hashKey(key, this.nextUid)];\n  },\n\n  /**\n   * Remove the key/value pair\n   * @param key\n   */\n  remove: function(key) {\n    var value = this[key = hashKey(key, this.nextUid)];\n    delete this[key];\n    return value;\n  }\n};\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.<string|Function>} modules A list of module functions or their aliases. See\n *     {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n *     disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n *   // create an injector\n *   var $injector = angular.injector(['ng']);\n *\n *   // use the injector to kick off your application\n *   // use the type inference to auto inject arguments, or use implicit injection\n *   $injector.invoke(function($rootScope, $compile, $document) {\n *     $compile($document)($rootScope);\n *     $rootScope.$digest();\n *   });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running Angular app\n * from outside Angular. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('<div ng-controller=\"MyCtrl\">{{content.label}}</div>');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n *   var scope = angular.element($div).scope();\n *   $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar FN_ARGS = /^function\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction anonFn(fn) {\n  // For anonymous functions, showing at the very least the function signature can help in\n  // debugging.\n  var fnText = fn.toString().replace(STRIP_COMMENTS, ''),\n      args = fnText.match(FN_ARGS);\n  if (args) {\n    return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n  }\n  return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n  var $inject,\n      fnText,\n      argDecl,\n      last;\n\n  if (typeof fn === 'function') {\n    if (!($inject = fn.$inject)) {\n      $inject = [];\n      if (fn.length) {\n        if (strictDi) {\n          if (!isString(name) || !name) {\n            name = fn.name || anonFn(fn);\n          }\n          throw $injectorMinErr('strictdi',\n            '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n        }\n        fnText = fn.toString().replace(STRIP_COMMENTS, '');\n        argDecl = fnText.match(FN_ARGS);\n        forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n          arg.replace(FN_ARG, function(all, underscore, name) {\n            $inject.push(name);\n          });\n        });\n      }\n      fn.$inject = $inject;\n    }\n  } else if (isArray(fn)) {\n    last = fn.length - 1;\n    assertArgFn(fn[last], 'fn');\n    $inject = fn.slice(0, last);\n  } else {\n    assertArgFn(fn, 'fn', true);\n  }\n  return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n *   var $injector = angular.injector();\n *   expect($injector.get('$injector')).toBe($injector);\n *   expect($injector.invoke(function($injector) {\n *     return $injector;\n *   })).toBe($injector);\n * ```\n *\n * # Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n *   // inferred (only works if code not minified/obfuscated)\n *   $injector.invoke(function(serviceA){});\n *\n *   // annotated\n *   function explicit(serviceA) {};\n *   explicit.$inject = ['serviceA'];\n *   $injector.invoke(explicit);\n *\n *   // inline\n *   $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ## Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ## `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ## Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {!Function} fn The function to invoke. Function parameters are injected according to the\n *   {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n *                         object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * # Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n *   // Given\n *   function MyController($scope, $route) {\n *     // ...\n *   }\n *\n *   // Then\n *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * # The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n *   // Given\n *   var MyController = function(obfuscatedScope, obfuscatedRoute) {\n *     // ...\n *   }\n *   // Define function dependencies\n *   MyController['$inject'] = ['$scope', '$route'];\n *\n *   // Then\n *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * # The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n *   // We wish to write this (not minification / obfuscation safe)\n *   injector.invoke(function($compile, $rootScope) {\n *     // ...\n *   });\n *\n *   // We are forced to write break inlining\n *   var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n *     // ...\n *   };\n *   tmpFn.$inject = ['$compile', '$rootScope'];\n *   injector.invoke(tmpFn);\n *\n *   // To better support inline function the inline annotation is supported\n *   injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n *     // ...\n *   }]);\n *\n *   // Therefore\n *   expect(injector.annotate(\n *      ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n *    ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.<string>} The names of the services which the function requires.\n */\n\n\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An Angular **service** is a singleton object created by a **service factory**.  These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider.  The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the\n *     {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by\n *     providers and services.\n * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by\n *     services, not providers.\n * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,\n *     that will be wrapped in a **service provider** object, whose `$get` property will contain the\n *     given factory function.\n * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`\n *     that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n *      a new object using the given constructor function.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n                        'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n *   - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n *     {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n *   - `Constructor`: a new instance of the provider will be created using\n *     {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n *  // Define the eventTracker provider\n *  function EventTrackerProvider() {\n *    var trackingUrl = '/track';\n *\n *    // A provider method for configuring where the tracked events should been saved\n *    this.setTrackingUrl = function(url) {\n *      trackingUrl = url;\n *    };\n *\n *    // The service factory function\n *    this.$get = ['$http', function($http) {\n *      var trackedEvents = {};\n *      return {\n *        // Call this to track an event\n *        event: function(event) {\n *          var count = trackedEvents[event] || 0;\n *          count += 1;\n *          trackedEvents[event] = count;\n *          return count;\n *        },\n *        // Call this to save the tracked events to the trackingUrl\n *        save: function() {\n *          $http.post(trackingUrl, trackedEvents);\n *        }\n *      };\n *    }];\n *  }\n *\n *  describe('eventTracker', function() {\n *    var postSpy;\n *\n *    beforeEach(module(function($provide) {\n *      // Register the eventTracker provider\n *      $provide.provider('eventTracker', EventTrackerProvider);\n *    }));\n *\n *    beforeEach(module(function(eventTrackerProvider) {\n *      // Configure eventTracker provider\n *      eventTrackerProvider.setTrackingUrl('/custom-track');\n *    }));\n *\n *    it('tracks events', inject(function(eventTracker) {\n *      expect(eventTracker.event('login')).toEqual(1);\n *      expect(eventTracker.event('login')).toEqual(2);\n *    }));\n *\n *    it('saves to the tracking url', inject(function(eventTracker, $http) {\n *      postSpy = spyOn($http, 'post');\n *      eventTracker.event('login');\n *      eventTracker.save();\n *      expect(postSpy).toHaveBeenCalled();\n *      expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n *      expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n *      expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n *    }));\n *  });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand\n *                            for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n *   $provide.factory('ping', ['$http', function($http) {\n *     return function ping() {\n *       return $http.send('/ping');\n *     };\n *   }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n *   someModule.controller('Ctrl', ['ping', function(ping) {\n *     ping();\n *   }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is the service\n * constructor function that will be used to instantiate the service instance.\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function} constructor A class (constructor function) that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n *   var Ping = function($http) {\n *     this.$http = $http;\n *   };\n *\n *   Ping.$inject = ['$http'];\n *\n *   Ping.prototype.send = function() {\n *     return this.$http.get('/ping');\n *   };\n *   $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n *   someModule.controller('Ctrl', ['ping', function(ping) {\n *     ping.send();\n *   }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function.  This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an Angular\n * {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n *   $provide.value('ADMIN_USER', 'admin');\n *\n *   $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n *   $provide.value('halfOf', function(value) {\n *     return value / 2;\n *   });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service**, such as a string, a number, an array, an object or a function,\n * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n *   $provide.constant('SHARD_HEIGHT', 306);\n *\n *   $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n *   $provide.constant('double', function(value) {\n *     return value * 2;\n *   });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator\n * intercepts the creation of a service, allowing it to override or modify the behaviour of the\n * service. The object returned by the decorator may be the original service, or a new service\n * object which replaces or wraps and delegates to the original service.\n *\n * @param {string} name The name of the service to decorate.\n * @param {function()} decorator This function will be invoked when the service needs to be\n *    instantiated and should return the decorated service instance. The function is called using\n *    the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n *    Local injection arguments:\n *\n *    * `$delegate` - The original service instance, which can be monkey patched, configured,\n *      decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n *   $provide.decorator('$log', ['$delegate', function($delegate) {\n *     $delegate.warn = $delegate.error;\n *     return $delegate;\n *   }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n  strictDi = (strictDi === true);\n  var INSTANTIATING = {},\n      providerSuffix = 'Provider',\n      path = [],\n      loadedModules = new HashMap([], true),\n      providerCache = {\n        $provide: {\n            provider: supportObject(provider),\n            factory: supportObject(factory),\n            service: supportObject(service),\n            value: supportObject(value),\n            constant: supportObject(constant),\n            decorator: decorator\n          }\n      },\n      providerInjector = (providerCache.$injector =\n          createInternalInjector(providerCache, function(serviceName, caller) {\n            if (angular.isString(caller)) {\n              path.push(caller);\n            }\n            throw $injectorMinErr('unpr', \"Unknown provider: {0}\", path.join(' <- '));\n          })),\n      instanceCache = {},\n      instanceInjector = (instanceCache.$injector =\n          createInternalInjector(instanceCache, function(serviceName, caller) {\n            var provider = providerInjector.get(serviceName + providerSuffix, caller);\n            return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);\n          }));\n\n\n  forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });\n\n  return instanceInjector;\n\n  ////////////////////////////////////\n  // $provider\n  ////////////////////////////////////\n\n  function supportObject(delegate) {\n    return function(key, value) {\n      if (isObject(key)) {\n        forEach(key, reverseParams(delegate));\n      } else {\n        return delegate(key, value);\n      }\n    };\n  }\n\n  function provider(name, provider_) {\n    assertNotHasOwnProperty(name, 'service');\n    if (isFunction(provider_) || isArray(provider_)) {\n      provider_ = providerInjector.instantiate(provider_);\n    }\n    if (!provider_.$get) {\n      throw $injectorMinErr('pget', \"Provider '{0}' must define $get factory method.\", name);\n    }\n    return providerCache[name + providerSuffix] = provider_;\n  }\n\n  function enforceReturnValue(name, factory) {\n    return function enforcedReturnValue() {\n      var result = instanceInjector.invoke(factory, this);\n      if (isUndefined(result)) {\n        throw $injectorMinErr('undef', \"Provider '{0}' must return a value from $get factory method.\", name);\n      }\n      return result;\n    };\n  }\n\n  function factory(name, factoryFn, enforce) {\n    return provider(name, {\n      $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n    });\n  }\n\n  function service(name, constructor) {\n    return factory(name, ['$injector', function($injector) {\n      return $injector.instantiate(constructor);\n    }]);\n  }\n\n  function value(name, val) { return factory(name, valueFn(val), false); }\n\n  function constant(name, value) {\n    assertNotHasOwnProperty(name, 'constant');\n    providerCache[name] = value;\n    instanceCache[name] = value;\n  }\n\n  function decorator(serviceName, decorFn) {\n    var origProvider = providerInjector.get(serviceName + providerSuffix),\n        orig$get = origProvider.$get;\n\n    origProvider.$get = function() {\n      var origInstance = instanceInjector.invoke(orig$get, origProvider);\n      return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n    };\n  }\n\n  ////////////////////////////////////\n  // Module Loading\n  ////////////////////////////////////\n  function loadModules(modulesToLoad) {\n    var runBlocks = [], moduleFn;\n    forEach(modulesToLoad, function(module) {\n      if (loadedModules.get(module)) return;\n      loadedModules.put(module, true);\n\n      function runInvokeQueue(queue) {\n        var i, ii;\n        for (i = 0, ii = queue.length; i < ii; i++) {\n          var invokeArgs = queue[i],\n              provider = providerInjector.get(invokeArgs[0]);\n\n          provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n        }\n      }\n\n      try {\n        if (isString(module)) {\n          moduleFn = angularModule(module);\n          runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n          runInvokeQueue(moduleFn._invokeQueue);\n          runInvokeQueue(moduleFn._configBlocks);\n        } else if (isFunction(module)) {\n            runBlocks.push(providerInjector.invoke(module));\n        } else if (isArray(module)) {\n            runBlocks.push(providerInjector.invoke(module));\n        } else {\n          assertArgFn(module, 'module');\n        }\n      } catch (e) {\n        if (isArray(module)) {\n          module = module[module.length - 1];\n        }\n        if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {\n          // Safari & FF's stack traces don't contain error.message content\n          // unlike those of Chrome and IE\n          // So if stack doesn't contain message, we create a new string that contains both.\n          // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n          /* jshint -W022 */\n          e = e.message + '\\n' + e.stack;\n        }\n        throw $injectorMinErr('modulerr', \"Failed to instantiate module {0} due to:\\n{1}\",\n                  module, e.stack || e.message || e);\n      }\n    });\n    return runBlocks;\n  }\n\n  ////////////////////////////////////\n  // internal Injector\n  ////////////////////////////////////\n\n  function createInternalInjector(cache, factory) {\n\n    function getService(serviceName, caller) {\n      if (cache.hasOwnProperty(serviceName)) {\n        if (cache[serviceName] === INSTANTIATING) {\n          throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n                    serviceName + ' <- ' + path.join(' <- '));\n        }\n        return cache[serviceName];\n      } else {\n        try {\n          path.unshift(serviceName);\n          cache[serviceName] = INSTANTIATING;\n          return cache[serviceName] = factory(serviceName, caller);\n        } catch (err) {\n          if (cache[serviceName] === INSTANTIATING) {\n            delete cache[serviceName];\n          }\n          throw err;\n        } finally {\n          path.shift();\n        }\n      }\n    }\n\n    function invoke(fn, self, locals, serviceName) {\n      if (typeof locals === 'string') {\n        serviceName = locals;\n        locals = null;\n      }\n\n      var args = [],\n          $inject = createInjector.$$annotate(fn, strictDi, serviceName),\n          length, i,\n          key;\n\n      for (i = 0, length = $inject.length; i < length; i++) {\n        key = $inject[i];\n        if (typeof key !== 'string') {\n          throw $injectorMinErr('itkn',\n                  'Incorrect injection token! Expected service name as string, got {0}', key);\n        }\n        args.push(\n          locals && locals.hasOwnProperty(key)\n          ? locals[key]\n          : getService(key, serviceName)\n        );\n      }\n      if (isArray(fn)) {\n        fn = fn[length];\n      }\n\n      // http://jsperf.com/angularjs-invoke-apply-vs-switch\n      // #5388\n      return fn.apply(self, args);\n    }\n\n    function instantiate(Type, locals, serviceName) {\n      // Check if Type is annotated and use just the given function at n-1 as parameter\n      // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n      // Object creation: http://jsperf.com/create-constructor/2\n      var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null);\n      var returnedValue = invoke(Type, instance, locals, serviceName);\n\n      return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;\n    }\n\n    return {\n      invoke: invoke,\n      instantiate: instantiate,\n      get: getService,\n      annotate: createInjector.$$annotate,\n      has: function(name) {\n        return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n      }\n    };\n  }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n  var autoScrollingEnabled = true;\n\n  /**\n   * @ngdoc method\n   * @name $anchorScrollProvider#disableAutoScrolling\n   *\n   * @description\n   * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n   * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />\n   * Use this method to disable automatic scrolling.\n   *\n   * If automatic scrolling is disabled, one must explicitly call\n   * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n   * current hash.\n   */\n  this.disableAutoScrolling = function() {\n    autoScrollingEnabled = false;\n  };\n\n  /**\n   * @ngdoc service\n   * @name $anchorScroll\n   * @kind function\n   * @requires $window\n   * @requires $location\n   * @requires $rootScope\n   *\n   * @description\n   * When called, it checks the current value of {@link ng.$location#hash $location.hash()} and\n   * scrolls to the related element, according to the rules specified in the\n   * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).\n   *\n   * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n   * match any anchor whenever it changes. This can be disabled by calling\n   * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n   *\n   * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n   * vertical scroll-offset (either fixed or dynamic).\n   *\n   * @property {(number|function|jqLite)} yOffset\n   * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n   * positioned elements at the top of the page, such as navbars, headers etc.\n   *\n   * `yOffset` can be specified in various ways:\n   * - **number**: A fixed number of pixels to be used as offset.<br /><br />\n   * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n   *   a number representing the offset (in pixels).<br /><br />\n   * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n   *   the top of the page to the element's bottom will be used as offset.<br />\n   *   **Note**: The element will be taken into account only as long as its `position` is set to\n   *   `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n   *   their height and/or positioning according to the viewport's size.\n   *\n   * <br />\n   * <div class=\"alert alert-warning\">\n   * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n   * not some child element.\n   * </div>\n   *\n   * @example\n     <example module=\"anchorScrollExample\">\n       <file name=\"index.html\">\n         <div id=\"scrollArea\" ng-controller=\"ScrollController\">\n           <a ng-click=\"gotoBottom()\">Go to bottom</a>\n           <a id=\"bottom\"></a> You're at the bottom!\n         </div>\n       </file>\n       <file name=\"script.js\">\n         angular.module('anchorScrollExample', [])\n           .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n             function ($scope, $location, $anchorScroll) {\n               $scope.gotoBottom = function() {\n                 // set the location.hash to the id of\n                 // the element you wish to scroll to.\n                 $location.hash('bottom');\n\n                 // call $anchorScroll()\n                 $anchorScroll();\n               };\n             }]);\n       </file>\n       <file name=\"style.css\">\n         #scrollArea {\n           height: 280px;\n           overflow: auto;\n         }\n\n         #bottom {\n           display: block;\n           margin-top: 2000px;\n         }\n       </file>\n     </example>\n   *\n   * <hr />\n   * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n   * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n   *\n   * @example\n     <example module=\"anchorScrollOffsetExample\">\n       <file name=\"index.html\">\n         <div class=\"fixed-header\" ng-controller=\"headerCtrl\">\n           <a href=\"\" ng-click=\"gotoAnchor(x)\" ng-repeat=\"x in [1,2,3,4,5]\">\n             Go to anchor {{x}}\n           </a>\n         </div>\n         <div id=\"anchor{{x}}\" class=\"anchor\" ng-repeat=\"x in [1,2,3,4,5]\">\n           Anchor {{x}} of 5\n         </div>\n       </file>\n       <file name=\"script.js\">\n         angular.module('anchorScrollOffsetExample', [])\n           .run(['$anchorScroll', function($anchorScroll) {\n             $anchorScroll.yOffset = 50;   // always scroll by 50 extra pixels\n           }])\n           .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n             function ($anchorScroll, $location, $scope) {\n               $scope.gotoAnchor = function(x) {\n                 var newHash = 'anchor' + x;\n                 if ($location.hash() !== newHash) {\n                   // set the $location.hash to `newHash` and\n                   // $anchorScroll will automatically scroll to it\n                   $location.hash('anchor' + x);\n                 } else {\n                   // call $anchorScroll() explicitly,\n                   // since $location.hash hasn't changed\n                   $anchorScroll();\n                 }\n               };\n             }\n           ]);\n       </file>\n       <file name=\"style.css\">\n         body {\n           padding-top: 50px;\n         }\n\n         .anchor {\n           border: 2px dashed DarkOrchid;\n           padding: 10px 10px 200px 10px;\n         }\n\n         .fixed-header {\n           background-color: rgba(0, 0, 0, 0.2);\n           height: 50px;\n           position: fixed;\n           top: 0; left: 0; right: 0;\n         }\n\n         .fixed-header > a {\n           display: inline-block;\n           margin: 5px 15px;\n         }\n       </file>\n     </example>\n   */\n  this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n    var document = $window.document;\n\n    // Helper function to get first anchor from a NodeList\n    // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n    //  and working in all supported browsers.)\n    function getFirstAnchor(list) {\n      var result = null;\n      Array.prototype.some.call(list, function(element) {\n        if (nodeName_(element) === 'a') {\n          result = element;\n          return true;\n        }\n      });\n      return result;\n    }\n\n    function getYOffset() {\n\n      var offset = scroll.yOffset;\n\n      if (isFunction(offset)) {\n        offset = offset();\n      } else if (isElement(offset)) {\n        var elem = offset[0];\n        var style = $window.getComputedStyle(elem);\n        if (style.position !== 'fixed') {\n          offset = 0;\n        } else {\n          offset = elem.getBoundingClientRect().bottom;\n        }\n      } else if (!isNumber(offset)) {\n        offset = 0;\n      }\n\n      return offset;\n    }\n\n    function scrollTo(elem) {\n      if (elem) {\n        elem.scrollIntoView();\n\n        var offset = getYOffset();\n\n        if (offset) {\n          // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n          // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n          // top of the viewport.\n          //\n          // IF the number of pixels from the top of `elem` to the end of the page's content is less\n          // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n          // way down the page.\n          //\n          // This is often the case for elements near the bottom of the page.\n          //\n          // In such cases we do not need to scroll the whole `offset` up, just the difference between\n          // the top of the element and the offset, which is enough to align the top of `elem` at the\n          // desired position.\n          var elemTop = elem.getBoundingClientRect().top;\n          $window.scrollBy(0, elemTop - offset);\n        }\n      } else {\n        $window.scrollTo(0, 0);\n      }\n    }\n\n    function scroll() {\n      var hash = $location.hash(), elm;\n\n      // empty hash, scroll to the top of the page\n      if (!hash) scrollTo(null);\n\n      // element with given id\n      else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n      // first anchor with given name :-D\n      else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n      // no element and hash == 'top', scroll to the top of the page\n      else if (hash === 'top') scrollTo(null);\n    }\n\n    // does not scroll when user clicks on anchor link that is currently on\n    // (no url change, no $location.hash() change), browser native does scroll\n    if (autoScrollingEnabled) {\n      $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n        function autoScrollWatchAction(newVal, oldVal) {\n          // skip the initial scroll if $location.hash is empty\n          if (newVal === oldVal && newVal === '') return;\n\n          jqLiteDocumentLoaded(function() {\n            $rootScope.$evalAsync(scroll);\n          });\n        });\n    }\n\n    return scroll;\n  }];\n}\n\nvar $animateMinErr = minErr('$animate');\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM\n * updates and calls done() callbacks.\n *\n * In order to enable animations the ngAnimate module has to be loaded.\n *\n * To see the functional implementation check out src/ngAnimate/animate.js\n */\nvar $AnimateProvider = ['$provide', function($provide) {\n\n\n  this.$$selectors = {};\n\n\n  /**\n   * @ngdoc method\n   * @name $animateProvider#register\n   *\n   * @description\n   * Registers a new injectable animation factory function. The factory function produces the\n   * animation object which contains callback functions for each event that is expected to be\n   * animated.\n   *\n   *   * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction`\n   *   must be called once the element animation is complete. If a function is returned then the\n   *   animation service will use this function to cancel the animation whenever a cancel event is\n   *   triggered.\n   *\n   *\n   * ```js\n   *   return {\n     *     eventFn : function(element, done) {\n     *       //code to run the animation\n     *       //once complete, then run done()\n     *       return function cancellationFunction() {\n     *         //code to cancel the animation\n     *       }\n     *     }\n     *   }\n   * ```\n   *\n   * @param {string} name The name of the animation.\n   * @param {Function} factory The factory function that will be executed to return the animation\n   *                           object.\n   */\n  this.register = function(name, factory) {\n    var key = name + '-animation';\n    if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel',\n        \"Expecting class selector starting with '.' got '{0}'.\", name);\n    this.$$selectors[name.substr(1)] = key;\n    $provide.factory(key, factory);\n  };\n\n  /**\n   * @ngdoc method\n   * @name $animateProvider#classNameFilter\n   *\n   * @description\n   * Sets and/or returns the CSS class regular expression that is checked when performing\n   * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n   * therefore enable $animate to attempt to perform an animation on any element.\n   * When setting the classNameFilter value, animations will only be performed on elements\n   * that successfully match the filter expression. This in turn can boost performance\n   * for low-powered devices as well as applications containing a lot of structural operations.\n   * @param {RegExp=} expression The className expression which will be checked against all animations\n   * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n   */\n  this.classNameFilter = function(expression) {\n    if (arguments.length === 1) {\n      this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;\n    }\n    return this.$$classNameFilter;\n  };\n\n  this.$get = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) {\n\n    var currentDefer;\n\n    function runAnimationPostDigest(fn) {\n      var cancelFn, defer = $$q.defer();\n      defer.promise.$$cancelFn = function ngAnimateMaybeCancel() {\n        cancelFn && cancelFn();\n      };\n\n      $rootScope.$$postDigest(function ngAnimatePostDigest() {\n        cancelFn = fn(function ngAnimateNotifyComplete() {\n          defer.resolve();\n        });\n      });\n\n      return defer.promise;\n    }\n\n    function resolveElementClasses(element, classes) {\n      var toAdd = [], toRemove = [];\n\n      var hasClasses = createMap();\n      forEach((element.attr('class') || '').split(/\\s+/), function(className) {\n        hasClasses[className] = true;\n      });\n\n      forEach(classes, function(status, className) {\n        var hasClass = hasClasses[className];\n\n        // If the most recent class manipulation (via $animate) was to remove the class, and the\n        // element currently has the class, the class is scheduled for removal. Otherwise, if\n        // the most recent class manipulation (via $animate) was to add the class, and the\n        // element does not currently have the class, the class is scheduled to be added.\n        if (status === false && hasClass) {\n          toRemove.push(className);\n        } else if (status === true && !hasClass) {\n          toAdd.push(className);\n        }\n      });\n\n      return (toAdd.length + toRemove.length) > 0 &&\n        [toAdd.length ? toAdd : null, toRemove.length ? toRemove : null];\n    }\n\n    function cachedClassManipulation(cache, classes, op) {\n      for (var i=0, ii = classes.length; i < ii; ++i) {\n        var className = classes[i];\n        cache[className] = op;\n      }\n    }\n\n    function asyncPromise() {\n      // only serve one instance of a promise in order to save CPU cycles\n      if (!currentDefer) {\n        currentDefer = $$q.defer();\n        $$asyncCallback(function() {\n          currentDefer.resolve();\n          currentDefer = null;\n        });\n      }\n      return currentDefer.promise;\n    }\n\n    function applyStyles(element, options) {\n      if (angular.isObject(options)) {\n        var styles = extend(options.from || {}, options.to || {});\n        element.css(styles);\n      }\n    }\n\n    /**\n     *\n     * @ngdoc service\n     * @name $animate\n     * @description The $animate service provides rudimentary DOM manipulation functions to\n     * insert, remove and move elements within the DOM, as well as adding and removing classes.\n     * This service is the core service used by the ngAnimate $animator service which provides\n     * high-level animation hooks for CSS and JavaScript.\n     *\n     * $animate is available in the AngularJS core, however, the ngAnimate module must be included\n     * to enable full out animation support. Otherwise, $animate will only perform simple DOM\n     * manipulation operations.\n     *\n     * To learn more about enabling animation support, click here to visit the {@link ngAnimate\n     * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service\n     * page}.\n     */\n    return {\n      animate: function(element, from, to) {\n        applyStyles(element, { from: from, to: to });\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#enter\n       * @kind function\n       * @description Inserts the element into the DOM either after the `after` element or\n       * as the first child within the `parent` element. When the function is called a promise\n       * is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will be inserted into the DOM\n       * @param {DOMElement} parent the parent element which will append the element as\n       *   a child (if the after element is not present)\n       * @param {DOMElement} after the sibling element which will append the element\n       *   after itself\n       * @param {object=} options an optional collection of styles that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      enter: function(element, parent, after, options) {\n        applyStyles(element, options);\n        after ? after.after(element)\n              : parent.prepend(element);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#leave\n       * @kind function\n       * @description Removes the element from the DOM. When the function is called a promise\n       * is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will be removed from the DOM\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      leave: function(element, options) {\n        element.remove();\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#move\n       * @kind function\n       * @description Moves the position of the provided element within the DOM to be placed\n       * either after the `after` element or inside of the `parent` element. When the function\n       * is called a promise is returned that will be resolved at a later time.\n       *\n       * @param {DOMElement} element the element which will be moved around within the\n       *   DOM\n       * @param {DOMElement} parent the parent element where the element will be\n       *   inserted into (if the after element is not present)\n       * @param {DOMElement} after the sibling element where the element will be\n       *   positioned next to\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      move: function(element, parent, after, options) {\n        // Do not remove element before insert. Removing will cause data associated with the\n        // element to be dropped. Insert will implicitly do the remove.\n        return this.enter(element, parent, after, options);\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#addClass\n       * @kind function\n       * @description Adds the provided className CSS class value to the provided element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have the className value\n       *   added to it\n       * @param {string} className the CSS class which will be added to the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      addClass: function(element, className, options) {\n        return this.setClass(element, className, [], options);\n      },\n\n      $$addClassImmediately: function(element, className, options) {\n        element = jqLite(element);\n        className = !isString(className)\n                        ? (isArray(className) ? className.join(' ') : '')\n                        : className;\n        forEach(element, function(element) {\n          jqLiteAddClass(element, className);\n        });\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#removeClass\n       * @kind function\n       * @description Removes the provided className CSS class value from the provided element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have the className value\n       *   removed from it\n       * @param {string} className the CSS class which will be removed from the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      removeClass: function(element, className, options) {\n        return this.setClass(element, [], className, options);\n      },\n\n      $$removeClassImmediately: function(element, className, options) {\n        element = jqLite(element);\n        className = !isString(className)\n                        ? (isArray(className) ? className.join(' ') : '')\n                        : className;\n        forEach(element, function(element) {\n          jqLiteRemoveClass(element, className);\n        });\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#setClass\n       * @kind function\n       * @description Adds and/or removes the given CSS classes to and from the element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have its CSS classes changed\n       *   removed from it\n       * @param {string} add the CSS classes which will be added to the element\n       * @param {string} remove the CSS class which will be removed from the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      setClass: function(element, add, remove, options) {\n        var self = this;\n        var STORAGE_KEY = '$$animateClasses';\n        var createdCache = false;\n        element = jqLite(element);\n\n        var cache = element.data(STORAGE_KEY);\n        if (!cache) {\n          cache = {\n            classes: {},\n            options: options\n          };\n          createdCache = true;\n        } else if (options && cache.options) {\n          cache.options = angular.extend(cache.options || {}, options);\n        }\n\n        var classes = cache.classes;\n\n        add = isArray(add) ? add : add.split(' ');\n        remove = isArray(remove) ? remove : remove.split(' ');\n        cachedClassManipulation(classes, add, true);\n        cachedClassManipulation(classes, remove, false);\n\n        if (createdCache) {\n          cache.promise = runAnimationPostDigest(function(done) {\n            var cache = element.data(STORAGE_KEY);\n            element.removeData(STORAGE_KEY);\n\n            // in the event that the element is removed before postDigest\n            // is run then the cache will be undefined and there will be\n            // no need anymore to add or remove and of the element classes\n            if (cache) {\n              var classes = resolveElementClasses(element, cache.classes);\n              if (classes) {\n                self.$$setClassImmediately(element, classes[0], classes[1], cache.options);\n              }\n            }\n\n            done();\n          });\n          element.data(STORAGE_KEY, cache);\n        }\n\n        return cache.promise;\n      },\n\n      $$setClassImmediately: function(element, add, remove, options) {\n        add && this.$$addClassImmediately(element, add);\n        remove && this.$$removeClassImmediately(element, remove);\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      enabled: noop,\n      cancel: noop\n    };\n  }];\n}];\n\nfunction $$AsyncCallbackProvider() {\n  this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) {\n    return $$rAF.supported\n      ? function(fn) { return $$rAF(fn); }\n      : function(fn) {\n        return $timeout(fn, 0, false);\n      };\n  }];\n}\n\n/* global stripHash: true */\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer) {\n  var self = this,\n      rawDocument = document[0],\n      location = window.location,\n      history = window.history,\n      setTimeout = window.setTimeout,\n      clearTimeout = window.clearTimeout,\n      pendingDeferIds = {};\n\n  self.isMock = false;\n\n  var outstandingRequestCount = 0;\n  var outstandingRequestCallbacks = [];\n\n  // TODO(vojta): remove this temporary api\n  self.$$completeOutstandingRequest = completeOutstandingRequest;\n  self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };\n\n  /**\n   * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`\n   * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.\n   */\n  function completeOutstandingRequest(fn) {\n    try {\n      fn.apply(null, sliceArgs(arguments, 1));\n    } finally {\n      outstandingRequestCount--;\n      if (outstandingRequestCount === 0) {\n        while (outstandingRequestCallbacks.length) {\n          try {\n            outstandingRequestCallbacks.pop()();\n          } catch (e) {\n            $log.error(e);\n          }\n        }\n      }\n    }\n  }\n\n  function getHash(url) {\n    var index = url.indexOf('#');\n    return index === -1 ? '' : url.substr(index + 1);\n  }\n\n  /**\n   * @private\n   * Note: this method is used only by scenario runner\n   * TODO(vojta): prefix this method with $$ ?\n   * @param {function()} callback Function that will be called when no outstanding request\n   */\n  self.notifyWhenNoOutstandingRequests = function(callback) {\n    // force browser to execute all pollFns - this is needed so that cookies and other pollers fire\n    // at some deterministic time in respect to the test runner's actions. Leaving things up to the\n    // regular poller would result in flaky tests.\n    forEach(pollFns, function(pollFn) { pollFn(); });\n\n    if (outstandingRequestCount === 0) {\n      callback();\n    } else {\n      outstandingRequestCallbacks.push(callback);\n    }\n  };\n\n  //////////////////////////////////////////////////////////////\n  // Poll Watcher API\n  //////////////////////////////////////////////////////////////\n  var pollFns = [],\n      pollTimeout;\n\n  /**\n   * @name $browser#addPollFn\n   *\n   * @param {function()} fn Poll function to add\n   *\n   * @description\n   * Adds a function to the list of functions that poller periodically executes,\n   * and starts polling if not started yet.\n   *\n   * @returns {function()} the added function\n   */\n  self.addPollFn = function(fn) {\n    if (isUndefined(pollTimeout)) startPoller(100, setTimeout);\n    pollFns.push(fn);\n    return fn;\n  };\n\n  /**\n   * @param {number} interval How often should browser call poll functions (ms)\n   * @param {function()} setTimeout Reference to a real or fake `setTimeout` function.\n   *\n   * @description\n   * Configures the poller to run in the specified intervals, using the specified\n   * setTimeout fn and kicks it off.\n   */\n  function startPoller(interval, setTimeout) {\n    (function check() {\n      forEach(pollFns, function(pollFn) { pollFn(); });\n      pollTimeout = setTimeout(check, interval);\n    })();\n  }\n\n  //////////////////////////////////////////////////////////////\n  // URL API\n  //////////////////////////////////////////////////////////////\n\n  var cachedState, lastHistoryState,\n      lastBrowserUrl = location.href,\n      baseElement = document.find('base'),\n      reloadLocation = null;\n\n  cacheState();\n  lastHistoryState = cachedState;\n\n  /**\n   * @name $browser#url\n   *\n   * @description\n   * GETTER:\n   * Without any argument, this method just returns current value of location.href.\n   *\n   * SETTER:\n   * With at least one argument, this method sets url to new value.\n   * If html5 history api supported, pushState/replaceState is used, otherwise\n   * location.href/location.replace is used.\n   * Returns its own instance to allow chaining\n   *\n   * NOTE: this api is intended for use only by the $location service. Please use the\n   * {@link ng.$location $location service} to change url.\n   *\n   * @param {string} url New url (when used as setter)\n   * @param {boolean=} replace Should new url replace current history record?\n   * @param {object=} state object to use with pushState/replaceState\n   */\n  self.url = function(url, replace, state) {\n    // In modern browsers `history.state` is `null` by default; treating it separately\n    // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n    // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n    if (isUndefined(state)) {\n      state = null;\n    }\n\n    // Android Browser BFCache causes location, history reference to become stale.\n    if (location !== window.location) location = window.location;\n    if (history !== window.history) history = window.history;\n\n    // setter\n    if (url) {\n      var sameState = lastHistoryState === state;\n\n      // Don't change anything if previous and current URLs and states match. This also prevents\n      // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n      // See https://github.com/angular/angular.js/commit/ffb2701\n      if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n        return self;\n      }\n      var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n      lastBrowserUrl = url;\n      lastHistoryState = state;\n      // Don't use history API if only the hash changed\n      // due to a bug in IE10/IE11 which leads\n      // to not firing a `hashchange` nor `popstate` event\n      // in some cases (see #9143).\n      if ($sniffer.history && (!sameBase || !sameState)) {\n        history[replace ? 'replaceState' : 'pushState'](state, '', url);\n        cacheState();\n        // Do the assignment again so that those two variables are referentially identical.\n        lastHistoryState = cachedState;\n      } else {\n        if (!sameBase) {\n          reloadLocation = url;\n        }\n        if (replace) {\n          location.replace(url);\n        } else if (!sameBase) {\n          location.href = url;\n        } else {\n          location.hash = getHash(url);\n        }\n      }\n      return self;\n    // getter\n    } else {\n      // - reloadLocation is needed as browsers don't allow to read out\n      //   the new location.href if a reload happened.\n      // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n      return reloadLocation || location.href.replace(/%27/g,\"'\");\n    }\n  };\n\n  /**\n   * @name $browser#state\n   *\n   * @description\n   * This method is a getter.\n   *\n   * Return history.state or null if history.state is undefined.\n   *\n   * @returns {object} state\n   */\n  self.state = function() {\n    return cachedState;\n  };\n\n  var urlChangeListeners = [],\n      urlChangeInit = false;\n\n  function cacheStateAndFireUrlChange() {\n    cacheState();\n    fireUrlChange();\n  }\n\n  // This variable should be used *only* inside the cacheState function.\n  var lastCachedState = null;\n  function cacheState() {\n    // This should be the only place in $browser where `history.state` is read.\n    cachedState = window.history.state;\n    cachedState = isUndefined(cachedState) ? null : cachedState;\n\n    // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n    if (equals(cachedState, lastCachedState)) {\n      cachedState = lastCachedState;\n    }\n    lastCachedState = cachedState;\n  }\n\n  function fireUrlChange() {\n    if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {\n      return;\n    }\n\n    lastBrowserUrl = self.url();\n    lastHistoryState = cachedState;\n    forEach(urlChangeListeners, function(listener) {\n      listener(self.url(), cachedState);\n    });\n  }\n\n  /**\n   * @name $browser#onUrlChange\n   *\n   * @description\n   * Register callback function that will be called, when url changes.\n   *\n   * It's only called when the url is changed from outside of angular:\n   * - user types different url into address bar\n   * - user clicks on history (forward/back) button\n   * - user clicks on a link\n   *\n   * It's not called when url is changed by $browser.url() method\n   *\n   * The listener gets called with new url as parameter.\n   *\n   * NOTE: this api is intended for use only by the $location service. Please use the\n   * {@link ng.$location $location service} to monitor url changes in angular apps.\n   *\n   * @param {function(string)} listener Listener function to be called when url changes.\n   * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n   */\n  self.onUrlChange = function(callback) {\n    // TODO(vojta): refactor to use node's syntax for events\n    if (!urlChangeInit) {\n      // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)\n      // don't fire popstate when user change the address bar and don't fire hashchange when url\n      // changed by push/replaceState\n\n      // html5 history api - popstate event\n      if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n      // hashchange event\n      jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n      urlChangeInit = true;\n    }\n\n    urlChangeListeners.push(callback);\n    return callback;\n  };\n\n  /**\n   * Checks whether the url has changed outside of Angular.\n   * Needs to be exported to be able to check for changes that have been done in sync,\n   * as hashchange/popstate events fire in async.\n   */\n  self.$$checkUrlChange = fireUrlChange;\n\n  //////////////////////////////////////////////////////////////\n  // Misc API\n  //////////////////////////////////////////////////////////////\n\n  /**\n   * @name $browser#baseHref\n   *\n   * @description\n   * Returns current <base href>\n   * (always relative - without domain)\n   *\n   * @returns {string} The current base href\n   */\n  self.baseHref = function() {\n    var href = baseElement.attr('href');\n    return href ? href.replace(/^(https?\\:)?\\/\\/[^\\/]*/, '') : '';\n  };\n\n  //////////////////////////////////////////////////////////////\n  // Cookies API\n  //////////////////////////////////////////////////////////////\n  var lastCookies = {};\n  var lastCookieString = '';\n  var cookiePath = self.baseHref();\n\n  function safeDecodeURIComponent(str) {\n    try {\n      return decodeURIComponent(str);\n    } catch (e) {\n      return str;\n    }\n  }\n\n  /**\n   * @name $browser#cookies\n   *\n   * @param {string=} name Cookie name\n   * @param {string=} value Cookie value\n   *\n   * @description\n   * The cookies method provides a 'private' low level access to browser cookies.\n   * It is not meant to be used directly, use the $cookie service instead.\n   *\n   * The return values vary depending on the arguments that the method was called with as follows:\n   *\n   * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify\n   *   it\n   * - cookies(name, value) -> set name to value, if value is undefined delete the cookie\n   * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that\n   *   way)\n   *\n   * @returns {Object} Hash of all cookies (if called without any parameter)\n   */\n  self.cookies = function(name, value) {\n    var cookieLength, cookieArray, cookie, i, index;\n\n    if (name) {\n      if (value === undefined) {\n        rawDocument.cookie = encodeURIComponent(name) + \"=;path=\" + cookiePath +\n                                \";expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n      } else {\n        if (isString(value)) {\n          cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) +\n                                ';path=' + cookiePath).length + 1;\n\n          // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\n          // - 300 cookies\n          // - 20 cookies per unique domain\n          // - 4096 bytes per cookie\n          if (cookieLength > 4096) {\n            $log.warn(\"Cookie '\" + name +\n              \"' possibly not set or overflowed because it was too large (\" +\n              cookieLength + \" > 4096 bytes)!\");\n          }\n        }\n      }\n    } else {\n      if (rawDocument.cookie !== lastCookieString) {\n        lastCookieString = rawDocument.cookie;\n        cookieArray = lastCookieString.split(\"; \");\n        lastCookies = {};\n\n        for (i = 0; i < cookieArray.length; i++) {\n          cookie = cookieArray[i];\n          index = cookie.indexOf('=');\n          if (index > 0) { //ignore nameless cookies\n            name = safeDecodeURIComponent(cookie.substring(0, index));\n            // the first value that is seen for a cookie is the most\n            // specific one.  values for the same cookie name that\n            // follow are for less specific paths.\n            if (lastCookies[name] === undefined) {\n              lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n            }\n          }\n        }\n      }\n      return lastCookies;\n    }\n  };\n\n\n  /**\n   * @name $browser#defer\n   * @param {function()} fn A function, who's execution should be deferred.\n   * @param {number=} [delay=0] of milliseconds to defer the function execution.\n   * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n   *\n   * @description\n   * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n   *\n   * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n   * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n   * via `$browser.defer.flush()`.\n   *\n   */\n  self.defer = function(fn, delay) {\n    var timeoutId;\n    outstandingRequestCount++;\n    timeoutId = setTimeout(function() {\n      delete pendingDeferIds[timeoutId];\n      completeOutstandingRequest(fn);\n    }, delay || 0);\n    pendingDeferIds[timeoutId] = true;\n    return timeoutId;\n  };\n\n\n  /**\n   * @name $browser#defer.cancel\n   *\n   * @description\n   * Cancels a deferred task identified with `deferId`.\n   *\n   * @param {*} deferId Token returned by the `$browser.defer` function.\n   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n   *                    canceled.\n   */\n  self.defer.cancel = function(deferId) {\n    if (pendingDeferIds[deferId]) {\n      delete pendingDeferIds[deferId];\n      clearTimeout(deferId);\n      completeOutstandingRequest(noop);\n      return true;\n    }\n    return false;\n  };\n\n}\n\nfunction $BrowserProvider() {\n  this.$get = ['$window', '$log', '$sniffer', '$document',\n      function($window, $log, $sniffer, $document) {\n        return new Browser($window, $document, $log, $sniffer);\n      }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n *  var cache = $cacheFactory('cacheId');\n *  expect($cacheFactory.get('cacheId')).toBe(cache);\n *  expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n *  cache.put(\"key\", \"value\");\n *  cache.put(\"another key\", \"another value\");\n *\n *  // We've specified no options on creation\n *  expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n *   - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n *   it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n   <example module=\"cacheExampleApp\">\n     <file name=\"index.html\">\n       <div ng-controller=\"CacheController\">\n         <input ng-model=\"newCacheKey\" placeholder=\"Key\">\n         <input ng-model=\"newCacheValue\" placeholder=\"Value\">\n         <button ng-click=\"put(newCacheKey, newCacheValue)\">Cache</button>\n\n         <p ng-if=\"keys.length\">Cached Values</p>\n         <div ng-repeat=\"key in keys\">\n           <span ng-bind=\"key\"></span>\n           <span>: </span>\n           <b ng-bind=\"cache.get(key)\"></b>\n         </div>\n\n         <p>Cache Info</p>\n         <div ng-repeat=\"(key, value) in cache.info()\">\n           <span ng-bind=\"key\"></span>\n           <span>: </span>\n           <b ng-bind=\"value\"></b>\n         </div>\n       </div>\n     </file>\n     <file name=\"script.js\">\n       angular.module('cacheExampleApp', []).\n         controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n           $scope.keys = [];\n           $scope.cache = $cacheFactory('cacheId');\n           $scope.put = function(key, value) {\n             if ($scope.cache.get(key) === undefined) {\n               $scope.keys.push(key);\n             }\n             $scope.cache.put(key, value === undefined ? null : value);\n           };\n         }]);\n     </file>\n     <file name=\"style.css\">\n       p {\n         margin: 10px 0 3px;\n       }\n     </file>\n   </example>\n */\nfunction $CacheFactoryProvider() {\n\n  this.$get = function() {\n    var caches = {};\n\n    function cacheFactory(cacheId, options) {\n      if (cacheId in caches) {\n        throw minErr('$cacheFactory')('iid', \"CacheId '{0}' is already taken!\", cacheId);\n      }\n\n      var size = 0,\n          stats = extend({}, options, {id: cacheId}),\n          data = {},\n          capacity = (options && options.capacity) || Number.MAX_VALUE,\n          lruHash = {},\n          freshEnd = null,\n          staleEnd = null;\n\n      /**\n       * @ngdoc type\n       * @name $cacheFactory.Cache\n       *\n       * @description\n       * A cache object used to store and retrieve data, primarily used by\n       * {@link $http $http} and the {@link ng.directive:script script} directive to cache\n       * templates and other data.\n       *\n       * ```js\n       *  angular.module('superCache')\n       *    .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n       *      return $cacheFactory('super-cache');\n       *    }]);\n       * ```\n       *\n       * Example test:\n       *\n       * ```js\n       *  it('should behave like a cache', inject(function(superCache) {\n       *    superCache.put('key', 'value');\n       *    superCache.put('another key', 'another value');\n       *\n       *    expect(superCache.info()).toEqual({\n       *      id: 'super-cache',\n       *      size: 2\n       *    });\n       *\n       *    superCache.remove('another key');\n       *    expect(superCache.get('another key')).toBeUndefined();\n       *\n       *    superCache.removeAll();\n       *    expect(superCache.info()).toEqual({\n       *      id: 'super-cache',\n       *      size: 0\n       *    });\n       *  }));\n       * ```\n       */\n      return caches[cacheId] = {\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#put\n         * @kind function\n         *\n         * @description\n         * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n         * retrieved later, and incrementing the size of the cache if the key was not already\n         * present in the cache. If behaving like an LRU cache, it will also remove stale\n         * entries from the set.\n         *\n         * It will not insert undefined values into the cache.\n         *\n         * @param {string} key the key under which the cached data is stored.\n         * @param {*} value the value to store alongside the key. If it is undefined, the key\n         *    will not be stored.\n         * @returns {*} the value stored.\n         */\n        put: function(key, value) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n            refresh(lruEntry);\n          }\n\n          if (isUndefined(value)) return;\n          if (!(key in data)) size++;\n          data[key] = value;\n\n          if (size > capacity) {\n            this.remove(staleEnd.key);\n          }\n\n          return value;\n        },\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#get\n         * @kind function\n         *\n         * @description\n         * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n         *\n         * @param {string} key the key of the data to be retrieved\n         * @returns {*} the value stored.\n         */\n        get: function(key) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key];\n\n            if (!lruEntry) return;\n\n            refresh(lruEntry);\n          }\n\n          return data[key];\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#remove\n         * @kind function\n         *\n         * @description\n         * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n         *\n         * @param {string} key the key of the entry to be removed\n         */\n        remove: function(key) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key];\n\n            if (!lruEntry) return;\n\n            if (lruEntry == freshEnd) freshEnd = lruEntry.p;\n            if (lruEntry == staleEnd) staleEnd = lruEntry.n;\n            link(lruEntry.n,lruEntry.p);\n\n            delete lruHash[key];\n          }\n\n          delete data[key];\n          size--;\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#removeAll\n         * @kind function\n         *\n         * @description\n         * Clears the cache object of any entries.\n         */\n        removeAll: function() {\n          data = {};\n          size = 0;\n          lruHash = {};\n          freshEnd = staleEnd = null;\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#destroy\n         * @kind function\n         *\n         * @description\n         * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n         * removing it from the {@link $cacheFactory $cacheFactory} set.\n         */\n        destroy: function() {\n          data = null;\n          stats = null;\n          lruHash = null;\n          delete caches[cacheId];\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#info\n         * @kind function\n         *\n         * @description\n         * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n         *\n         * @returns {object} an object with the following properties:\n         *   <ul>\n         *     <li>**id**: the id of the cache instance</li>\n         *     <li>**size**: the number of entries kept in the cache instance</li>\n         *     <li>**...**: any additional properties from the options object when creating the\n         *       cache.</li>\n         *   </ul>\n         */\n        info: function() {\n          return extend({}, stats, {size: size});\n        }\n      };\n\n\n      /**\n       * makes the `entry` the freshEnd of the LRU linked list\n       */\n      function refresh(entry) {\n        if (entry != freshEnd) {\n          if (!staleEnd) {\n            staleEnd = entry;\n          } else if (staleEnd == entry) {\n            staleEnd = entry.n;\n          }\n\n          link(entry.n, entry.p);\n          link(entry, freshEnd);\n          freshEnd = entry;\n          freshEnd.n = null;\n        }\n      }\n\n\n      /**\n       * bidirectionally links two entries of the LRU linked list\n       */\n      function link(nextEntry, prevEntry) {\n        if (nextEntry != prevEntry) {\n          if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n          if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n        }\n      }\n    }\n\n\n  /**\n   * @ngdoc method\n   * @name $cacheFactory#info\n   *\n   * @description\n   * Get information about all the caches that have been created\n   *\n   * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n   */\n    cacheFactory.info = function() {\n      var info = {};\n      forEach(caches, function(cache, cacheId) {\n        info[cacheId] = cache.info();\n      });\n      return info;\n    };\n\n\n  /**\n   * @ngdoc method\n   * @name $cacheFactory#get\n   *\n   * @description\n   * Get access to a cache object by the `cacheId` used when it was created.\n   *\n   * @param {string} cacheId Name or id of a cache to access.\n   * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n   */\n    cacheFactory.get = function(cacheId) {\n      return caches[cacheId];\n    };\n\n\n    return cacheFactory;\n  };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n *\n * @description\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, or by consuming the\n * `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n *   <script type=\"text/ng-template\" id=\"templateId.html\">\n *     <p>This is the content of the template</p>\n *   </script>\n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,\n * element with ng-app attribute), otherwise the template will be ignored.\n *\n * Adding via the $templateCache service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n *   $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your HTML:\n * ```html\n * <div ng-include=\" 'templateId.html' \"></div>\n * ```\n *\n * or get it via Javascript:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n * See {@link ng.$cacheFactory $cacheFactory}.\n *\n */\nfunction $TemplateCacheProvider() {\n  this.$get = ['$cacheFactory', function($cacheFactory) {\n    return $cacheFactory('templates');\n  }];\n}\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" -  function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n * </div>\n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a \"Directive Definition Object\" (see below) that defines the directive properties,\n * or just the `postLink` function (all other properties will have the default values).\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n * </div>\n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n *   var myModule = angular.module(...);\n *\n *   myModule.directive('directiveName', function factory(injectables) {\n *     var directiveDefinitionObject = {\n *       priority: 0,\n *       template: '<div></div>', // or // function(tElement, tAttrs) { ... },\n *       // or\n *       // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },\n *       transclude: false,\n *       restrict: 'A',\n *       templateNamespace: 'html',\n *       scope: false,\n *       controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n *       controllerAs: 'stringAlias',\n *       require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n *       compile: function compile(tElement, tAttrs, transclude) {\n *         return {\n *           pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n *           post: function postLink(scope, iElement, iAttrs, controller) { ... }\n *         }\n *         // or\n *         // return function postLink( ... ) { ... }\n *       },\n *       // or\n *       // link: {\n *       //  pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n *       //  post: function postLink(scope, iElement, iAttrs, controller) { ... }\n *       // }\n *       // or\n *       // link: function postLink( ... ) { ... }\n *     };\n *     return directiveDefinitionObject;\n *   });\n * ```\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n * </div>\n *\n * Therefore the above can be simplified as:\n *\n * ```js\n *   var myModule = angular.module(...);\n *\n *   myModule.directive('directiveName', function factory(injectables) {\n *     var directiveDefinitionObject = {\n *       link: function postLink(scope, iElement, iAttrs) { ... }\n *     };\n *     return directiveDefinitionObject;\n *     // or\n *     // return function postLink(scope, iElement, iAttrs) { ... }\n *   });\n * ```\n *\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true, the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioural (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the\n * same element request a new scope, only one new scope is created. The new scope rule does not\n * apply for the root of the template since the root of the template always gets a new scope.\n *\n * **If set to `{}` (object hash),** then a new \"isolate\" scope is created. The 'isolate' scope differs from\n * normal scope in that it does not prototypically inherit from the parent scope. This is useful\n * when creating reusable components, which should not accidentally read or modify data in the\n * parent scope.\n *\n * The 'isolate' scope takes an object hash which defines a set of local scope properties\n * derived from the parent scope. These local properties are useful for aliasing values for\n * templates. Locals definition is a hash of local scope property to its source:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n *   always a string since DOM attributes are strings. If no `attr` name is specified  then the\n *   attribute name is assumed to be the same as the local name.\n *   Given `<widget my-attr=\"hello {{name}}\">` and widget definition\n *   of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect\n *   the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the\n *   `localName` property on the widget scope. The `name` is read from the parent scope (not\n *   component scope).\n *\n * * `=` or `=attr` - set up bi-directional binding between a local scope property and the\n *   parent scope property of name defined via the value of the `attr` attribute. If no `attr`\n *   name is specified then the attribute name is assumed to be the same as the local name.\n *   Given `<widget my-attr=\"parentModel\">` and widget definition of\n *   `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the\n *   value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected\n *   in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent\n *   scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You\n *   can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If\n *   you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use\n *   `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional).\n *\n * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.\n *   If no `attr` name is specified then the attribute name is assumed to be the same as the\n *   local name. Given `<widget my-attr=\"count = count + value\">` and widget definition of\n *   `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to\n *   a function wrapper for the `count = count + value` expression. Often it's desirable to\n *   pass data from the isolated scope via an expression to the parent scope, this can be\n *   done by passing a map of local variable names and values into the expression wrapper fn.\n *   For example, if the expression is `increment(amount)` then we can specify the amount value\n *   by calling the `localFn` as `localFn({amount: 22})`.\n *\n *\n * #### `bindToController`\n * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope. When the controller\n * is instantiated, the initial values of the isolate scope bindings are already available.\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and it is shared with other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n *   `function([scope], cloneLinkingFn, futureParentElement)`.\n *    * `scope`: optional argument to override the scope.\n *    * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.\n *    * `futureParentElement`:\n *        * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n *        * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n *        * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n *          and when the `cloneLinkinFn` is passed,\n *          as those elements need to created and cloned in a special way when they are defined outside their\n *          usual containers (e.g. like `<svg>`).\n *        * See also the `directive.templateNamespace` property.\n *\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the\n * injected argument will be an array in corresponding order. If no such directive can be\n * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n *   `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n *   `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Controller alias at the directive scope. An alias for the controller so it\n * can be referenced at the directive template. The directive needs to define a scope for this\n * configuration to be used. Useful in the case when directive is used as component.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): `<my-directive></my-directive>`\n * * `A` - Attribute (default): `<div my-directive=\"exp\"></div>`\n * * `C` - Class: `<div class=\"my-directive: exp;\"></div>`\n * * `M` - Comment: `<!-- directive: my-directive exp -->`\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n *   top-level elements such as `<svg>` or `<math>`.\n * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).\n * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n *   function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved.  In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url.  In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)\n * specify what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element or the entire element:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n *   element that defined at a lower priority than this directive. When used, the `template`\n *   property is ignored.\n *\n *\n * #### `compile`\n *\n * ```js\n *   function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n *   * `tElement` - template element - The element where the directive has been declared. It is\n *     safe to do template transformation on the element and child elements only.\n *\n *   * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n *     between all directive compile functions.\n *\n *   * `transclude` -  [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n * <div class=\"alert alert-warning\">\n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n * </div>\n\n * <div class=\"alert alert-warning\">\n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and a\n * stack overflow errors.\n *\n * This can be avoided by manually using $compile in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n * </div>\n *\n * <div class=\"alert alert-error\">\n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n *   e.g. does not know about the right outer scope. Please use the transclude function that is passed\n *   to the link function instead.\n * </div>\n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n *   `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n *   control when a linking function should be called during the linking phase. See info about\n *   pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n *   function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n *   * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n *     directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n *   * `iElement` - instance element - The element where the directive is to be used. It is safe to\n *     manipulate the children of the element only in `postLink` function since the children have\n *     already been linked.\n *\n *   * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n *     between all directive linking functions.\n *\n *   * `controller` - a controller instance - A controller instance if at least one directive on the\n *     element defines a controller. The controller is shared among all the directives, which allows\n *     the directives to use the controllers as a communication channel.\n *\n *   * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n *     This is the same as the `$transclude`\n *     parameter of directive controllers, see there for details.\n *     `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM element from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n * </div>\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n * <div class=\"alert alert-info\">\n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n * </div>\n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, to which the clone is bound.\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n * </div>\n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n *   element.append(clone);\n *   transcludedContent = clone;\n *   transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n * </div>\n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n * <div ng-app>\n *   <div isolate>\n *     <div transclusion>\n *     </div>\n *   </div>\n * </div>\n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n * ```\n * - $rootScope\n *   - isolate\n *     - transclusion\n * ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n * ```\n * - $rootScope\n *   - transclusion\n * - isolate\n * ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * accessing *Normalized attribute names:*\n * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'.\n * the attributes object allows for normalized access to\n *   the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n *   object which allows the directives to use the attributes object as inter directive\n *   communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n *   allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n *   that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n *   the only way to easily get the actual value because during the linking phase the interpolation\n *   hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n *   // get the attribute value\n *   console.log(attrs.ngModel);\n *\n *   // change the attribute\n *   attrs.$set('ngModel', 'new value');\n *\n *   // observe changes to interpolated attribute\n *   attrs.$observe('ngModel', function(value) {\n *     console.log('ngModel has changed value to ' + value);\n *   });\n * }\n * ```\n *\n * ## Example\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n * </div>\n *\n <example module=\"compileExample\">\n   <file name=\"index.html\">\n    <script>\n      angular.module('compileExample', [], function($compileProvider) {\n        // configure new 'compile' directive by passing a directive\n        // factory function. The factory function injects the '$compile'\n        $compileProvider.directive('compile', function($compile) {\n          // directive factory creates a link function\n          return function(scope, element, attrs) {\n            scope.$watch(\n              function(scope) {\n                 // watch the 'compile' expression for changes\n                return scope.$eval(attrs.compile);\n              },\n              function(value) {\n                // when the 'compile' expression changes\n                // assign it into the current DOM\n                element.html(value);\n\n                // compile the new DOM and link it to the current\n                // scope.\n                // NOTE: we only compile .childNodes so that\n                // we don't get into infinite loop compiling ourselves\n                $compile(element.contents())(scope);\n              }\n            );\n          };\n        });\n      })\n      .controller('GreeterController', ['$scope', function($scope) {\n        $scope.name = 'Angular';\n        $scope.html = 'Hello {{name}}';\n      }]);\n    </script>\n    <div ng-controller=\"GreeterController\">\n      <input ng-model=\"name\"> <br>\n      <textarea ng-model=\"html\"></textarea> <br>\n      <div compile=\"html\"></div>\n    </div>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n     it('should auto compile', function() {\n       var textarea = $('textarea');\n       var output = $('div[compile]');\n       // The initial state reads 'Hello Angular'.\n       expect(output.getText()).toBe('Hello Angular');\n       textarea.clear();\n       textarea.sendKeys('{{name}}!');\n       expect(output.getText()).toBe('Angular!');\n     });\n   </file>\n </example>\n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n * <div class=\"alert alert-error\">\n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n *   e.g. will not use the right outer scope. Please pass the transclude function as a\n *   `parentBoundTranscludeFn` to the link function instead.\n * </div>\n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n *                 root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n *  * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n *  `template` and call the `cloneAttachFn` function allowing the caller to attach the\n *  cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n *  called as: <br> `cloneAttachFn(clonedElement, scope)` where:\n *\n *      * `clonedElement` - is a clone of the original `element` passed into the compiler.\n *      * `scope` - is the current scope with which the linking function is working with.\n *\n *  * `options` - An optional object hash with linking options. If `options` is provided, then the following\n *  keys may be used to control linking behavior:\n *\n *      * `parentBoundTranscludeFn` - the transclude function made available to\n *        directives; if given, it will be passed through to the link functions of\n *        directives found in `element` during compilation.\n *      * `transcludeControllers` - an object hash with keys that map controller names\n *        to controller instances; if given, it will make the controllers\n *        available to directives.\n *      * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n *        the cloned elements; only needed for transcludes that are allowed to contain non html\n *        elements (e.g. SVG elements). See also the directive.controller property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to $digest which typically is done by\n * Angular automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n *   before you send them to the compiler and keep this reference around.\n *   ```js\n *     var element = $compile('<p>{{total}}</p>')(scope);\n *   ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n *   example would not point to the clone, but rather to the original template that was cloned. In\n *   this case, you can access the clone via the cloneAttachFn:\n *   ```js\n *     var templateElement = angular.element('<p>{{total}}</p>'),\n *         scope = ....;\n *\n *     var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n *       //attach the clone to DOM document at the right place\n *     });\n *\n *     //now we have reference to the cloned DOM via `clonedElement`\n *   ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.\n */\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n  var hasDirectives = {},\n      Suffix = 'Directive',\n      COMMENT_DIRECTIVE_REGEXP = /^\\s*directive\\:\\s*([\\w\\-]+)\\s+(.*)$/,\n      CLASS_DIRECTIVE_REGEXP = /(([\\w\\-]+)(?:\\:([^;]+))?;?)/,\n      ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n      REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n  // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n  // The assumption is that future DOM event attribute names will begin with\n  // 'on' and be composed of only English letters.\n  var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n\n  function parseIsolateBindings(scope, directiveName) {\n    var LOCAL_REGEXP = /^\\s*([@&]|=(\\*?))(\\??)\\s*(\\w*)\\s*$/;\n\n    var bindings = {};\n\n    forEach(scope, function(definition, scopeName) {\n      var match = definition.match(LOCAL_REGEXP);\n\n      if (!match) {\n        throw $compileMinErr('iscp',\n            \"Invalid isolate scope definition for directive '{0}'.\" +\n            \" Definition: {... {1}: '{2}' ...}\",\n            directiveName, scopeName, definition);\n      }\n\n      bindings[scopeName] = {\n        mode: match[1][0],\n        collection: match[2] === '*',\n        optional: match[3] === '?',\n        attrName: match[4] || scopeName\n      };\n    });\n\n    return bindings;\n  }\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#directive\n   * @kind function\n   *\n   * @description\n   * Register a new directive with the compiler.\n   *\n   * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which\n   *    will match as <code>ng-bind</code>), or an object map of directives where the keys are the\n   *    names and the values are the factories.\n   * @param {Function|Array} directiveFactory An injectable directive factory function. See\n   *    {@link guide/directive} for more info.\n   * @returns {ng.$compileProvider} Self for chaining.\n   */\n   this.directive = function registerDirective(name, directiveFactory) {\n    assertNotHasOwnProperty(name, 'directive');\n    if (isString(name)) {\n      assertArg(directiveFactory, 'directiveFactory');\n      if (!hasDirectives.hasOwnProperty(name)) {\n        hasDirectives[name] = [];\n        $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n          function($injector, $exceptionHandler) {\n            var directives = [];\n            forEach(hasDirectives[name], function(directiveFactory, index) {\n              try {\n                var directive = $injector.invoke(directiveFactory);\n                if (isFunction(directive)) {\n                  directive = { compile: valueFn(directive) };\n                } else if (!directive.compile && directive.link) {\n                  directive.compile = valueFn(directive.link);\n                }\n                directive.priority = directive.priority || 0;\n                directive.index = index;\n                directive.name = directive.name || name;\n                directive.require = directive.require || (directive.controller && directive.name);\n                directive.restrict = directive.restrict || 'EA';\n                if (isObject(directive.scope)) {\n                  directive.$$isolateBindings = parseIsolateBindings(directive.scope, directive.name);\n                }\n                directives.push(directive);\n              } catch (e) {\n                $exceptionHandler(e);\n              }\n            });\n            return directives;\n          }]);\n      }\n      hasDirectives[name].push(directiveFactory);\n    } else {\n      forEach(name, reverseParams(registerDirective));\n    }\n    return this;\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#aHrefSanitizationWhitelist\n   * @kind function\n   *\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during a[href] sanitization.\n   *\n   * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n   *\n   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.aHrefSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n      return this;\n    } else {\n      return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n    }\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#imgSrcSanitizationWhitelist\n   * @kind function\n   *\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during img[src] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.imgSrcSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);\n      return this;\n    } else {\n      return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name  $compileProvider#debugInfoEnabled\n   *\n   * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n   * current debugInfoEnabled state\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   *\n   * @kind function\n   *\n   * @description\n   * Call this method to enable/disable various debug runtime information in the compiler such as adding\n   * binding information and a reference to the current scope on to DOM elements.\n   * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n   * * `ng-binding` CSS class\n   * * `$binding` data property containing an array of the binding expressions\n   *\n   * You may want to disable this in production for a significant performance boost. See\n   * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n   *\n   * The default value is true.\n   */\n  var debugInfoEnabled = true;\n  this.debugInfoEnabled = function(enabled) {\n    if (isDefined(enabled)) {\n      debugInfoEnabled = enabled;\n      return this;\n    }\n    return debugInfoEnabled;\n  };\n\n  this.$get = [\n            '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n            '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',\n    function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,\n             $controller,   $rootScope,   $document,   $sce,   $animate,   $$sanitizeUri) {\n\n    var Attributes = function(element, attributesToCopy) {\n      if (attributesToCopy) {\n        var keys = Object.keys(attributesToCopy);\n        var i, l, key;\n\n        for (i = 0, l = keys.length; i < l; i++) {\n          key = keys[i];\n          this[key] = attributesToCopy[key];\n        }\n      } else {\n        this.$attr = {};\n      }\n\n      this.$$element = element;\n    };\n\n    Attributes.prototype = {\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$normalize\n       * @kind function\n       *\n       * @description\n       * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n       * `data-`) to its normalized, camelCase form.\n       *\n       * Also there is special case for Moz prefix starting with upper case letter.\n       *\n       * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n       *\n       * @param {string} name Name to normalize\n       */\n      $normalize: directiveNormalize,\n\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$addClass\n       * @kind function\n       *\n       * @description\n       * Adds the CSS class value specified by the classVal parameter to the element. If animations\n       * are enabled then an animation will be triggered for the class addition.\n       *\n       * @param {string} classVal The className value that will be added to the element\n       */\n      $addClass: function(classVal) {\n        if (classVal && classVal.length > 0) {\n          $animate.addClass(this.$$element, classVal);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$removeClass\n       * @kind function\n       *\n       * @description\n       * Removes the CSS class value specified by the classVal parameter from the element. If\n       * animations are enabled then an animation will be triggered for the class removal.\n       *\n       * @param {string} classVal The className value that will be removed from the element\n       */\n      $removeClass: function(classVal) {\n        if (classVal && classVal.length > 0) {\n          $animate.removeClass(this.$$element, classVal);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$updateClass\n       * @kind function\n       *\n       * @description\n       * Adds and removes the appropriate CSS class values to the element based on the difference\n       * between the new and old CSS class values (specified as newClasses and oldClasses).\n       *\n       * @param {string} newClasses The current CSS className value\n       * @param {string} oldClasses The former CSS className value\n       */\n      $updateClass: function(newClasses, oldClasses) {\n        var toAdd = tokenDifference(newClasses, oldClasses);\n        if (toAdd && toAdd.length) {\n          $animate.addClass(this.$$element, toAdd);\n        }\n\n        var toRemove = tokenDifference(oldClasses, newClasses);\n        if (toRemove && toRemove.length) {\n          $animate.removeClass(this.$$element, toRemove);\n        }\n      },\n\n      /**\n       * Set a normalized attribute on the element in a way such that all directives\n       * can share the attribute. This function properly handles boolean attributes.\n       * @param {string} key Normalized key. (ie ngAttribute)\n       * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n       * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n       *     Defaults to true.\n       * @param {string=} attrName Optional none normalized name. Defaults to key.\n       */\n      $set: function(key, value, writeAttr, attrName) {\n        // TODO: decide whether or not to throw an error if \"class\"\n        //is set through this function since it may cause $updateClass to\n        //become unstable.\n\n        var node = this.$$element[0],\n            booleanKey = getBooleanAttrName(node, key),\n            aliasedKey = getAliasedAttrName(node, key),\n            observer = key,\n            nodeName;\n\n        if (booleanKey) {\n          this.$$element.prop(key, value);\n          attrName = booleanKey;\n        } else if (aliasedKey) {\n          this[aliasedKey] = value;\n          observer = aliasedKey;\n        }\n\n        this[key] = value;\n\n        // translate normalized key to actual key\n        if (attrName) {\n          this.$attr[key] = attrName;\n        } else {\n          attrName = this.$attr[key];\n          if (!attrName) {\n            this.$attr[key] = attrName = snake_case(key, '-');\n          }\n        }\n\n        nodeName = nodeName_(this.$$element);\n\n        if ((nodeName === 'a' && key === 'href') ||\n            (nodeName === 'img' && key === 'src')) {\n          // sanitize a[href] and img[src] values\n          this[key] = value = $$sanitizeUri(value, key === 'src');\n        } else if (nodeName === 'img' && key === 'srcset') {\n          // sanitize img[srcset] values\n          var result = \"\";\n\n          // first check if there are spaces because it's not the same pattern\n          var trimmedSrcset = trim(value);\n          //                (   999x   ,|   999w   ,|   ,|,   )\n          var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n          var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n          // split srcset into tuple of uri and descriptor except for the last item\n          var rawUris = trimmedSrcset.split(pattern);\n\n          // for each tuples\n          var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n          for (var i = 0; i < nbrUrisWith2parts; i++) {\n            var innerIdx = i * 2;\n            // sanitize the uri\n            result += $$sanitizeUri(trim(rawUris[innerIdx]), true);\n            // add the descriptor\n            result += (\" \" + trim(rawUris[innerIdx + 1]));\n          }\n\n          // split the last item into uri and descriptor\n          var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n          // sanitize the last uri\n          result += $$sanitizeUri(trim(lastTuple[0]), true);\n\n          // and add the last descriptor if any\n          if (lastTuple.length === 2) {\n            result += (\" \" + trim(lastTuple[1]));\n          }\n          this[key] = value = result;\n        }\n\n        if (writeAttr !== false) {\n          if (value === null || value === undefined) {\n            this.$$element.removeAttr(attrName);\n          } else {\n            this.$$element.attr(attrName, value);\n          }\n        }\n\n        // fire observers\n        var $$observers = this.$$observers;\n        $$observers && forEach($$observers[observer], function(fn) {\n          try {\n            fn(value);\n          } catch (e) {\n            $exceptionHandler(e);\n          }\n        });\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$observe\n       * @kind function\n       *\n       * @description\n       * Observes an interpolated attribute.\n       *\n       * The observer function will be invoked once during the next `$digest` following\n       * compilation. The observer is then invoked whenever the interpolated value\n       * changes.\n       *\n       * @param {string} key Normalized key. (ie ngAttribute) .\n       * @param {function(interpolatedValue)} fn Function that will be called whenever\n                the interpolated value of the attribute changes.\n       *        See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info.\n       * @returns {function()} Returns a deregistration function for this observer.\n       */\n      $observe: function(key, fn) {\n        var attrs = this,\n            $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n            listeners = ($$observers[key] || ($$observers[key] = []));\n\n        listeners.push(fn);\n        $rootScope.$evalAsync(function() {\n          if (!listeners.$$inter && attrs.hasOwnProperty(key)) {\n            // no one registered attribute interpolation function, so lets call it manually\n            fn(attrs[key]);\n          }\n        });\n\n        return function() {\n          arrayRemove(listeners, fn);\n        };\n      }\n    };\n\n\n    function safeAddClass($element, className) {\n      try {\n        $element.addClass(className);\n      } catch (e) {\n        // ignore, since it means that we are trying to set class on\n        // SVG element, where class name is read-only.\n      }\n    }\n\n\n    var startSymbol = $interpolate.startSymbol(),\n        endSymbol = $interpolate.endSymbol(),\n        denormalizeTemplate = (startSymbol == '{{' || endSymbol  == '}}')\n            ? identity\n            : function denormalizeTemplate(template) {\n              return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n        },\n        NG_ATTR_BINDING = /^ngAttr[A-Z]/;\n\n    compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n      var bindings = $element.data('$binding') || [];\n\n      if (isArray(binding)) {\n        bindings = bindings.concat(binding);\n      } else {\n        bindings.push(binding);\n      }\n\n      $element.data('$binding', bindings);\n    } : noop;\n\n    compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n      safeAddClass($element, 'ng-binding');\n    } : noop;\n\n    compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n      var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n      $element.data(dataName, scope);\n    } : noop;\n\n    compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n      safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n    } : noop;\n\n    return compile;\n\n    //================================\n\n    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n                        previousCompileContext) {\n      if (!($compileNodes instanceof jqLite)) {\n        // jquery always rewraps, whereas we need to preserve the original selector so that we can\n        // modify it.\n        $compileNodes = jqLite($compileNodes);\n      }\n      // We can not compile top level text elements since text nodes can be merged and we will\n      // not be able to attach scope data to them, so we will wrap them in <span>\n      forEach($compileNodes, function(node, index) {\n        if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\\S+/) /* non-empty */ ) {\n          $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0];\n        }\n      });\n      var compositeLinkFn =\n              compileNodes($compileNodes, transcludeFn, $compileNodes,\n                           maxPriority, ignoreDirective, previousCompileContext);\n      compile.$$addScopeClass($compileNodes);\n      var namespace = null;\n      return function publicLinkFn(scope, cloneConnectFn, options) {\n        assertArg(scope, 'scope');\n\n        options = options || {};\n        var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n          transcludeControllers = options.transcludeControllers,\n          futureParentElement = options.futureParentElement;\n\n        // When `parentBoundTranscludeFn` is passed, it is a\n        // `controllersBoundTransclude` function (it was previously passed\n        // as `transclude` to directive.link) so we must unwrap it to get\n        // its `boundTranscludeFn`\n        if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n          parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n        }\n\n        if (!namespace) {\n          namespace = detectNamespaceForChildElements(futureParentElement);\n        }\n        var $linkNode;\n        if (namespace !== 'html') {\n          // When using a directive with replace:true and templateUrl the $compileNodes\n          // (or a child element inside of them)\n          // might change, so we need to recreate the namespace adapted compileNodes\n          // for call to the link function.\n          // Note: This will already clone the nodes...\n          $linkNode = jqLite(\n            wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())\n          );\n        } else if (cloneConnectFn) {\n          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n          // and sometimes changes the structure of the DOM.\n          $linkNode = JQLitePrototype.clone.call($compileNodes);\n        } else {\n          $linkNode = $compileNodes;\n        }\n\n        if (transcludeControllers) {\n          for (var controllerName in transcludeControllers) {\n            $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n          }\n        }\n\n        compile.$$addScopeInfo($linkNode, scope);\n\n        if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n        if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n        return $linkNode;\n      };\n    }\n\n    function detectNamespaceForChildElements(parentElement) {\n      // TODO: Make this detect MathML as well...\n      var node = parentElement && parentElement[0];\n      if (!node) {\n        return 'html';\n      } else {\n        return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html';\n      }\n    }\n\n    /**\n     * Compile function matches each node in nodeList against the directives. Once all directives\n     * for a particular node are collected their compile functions are executed. The compile\n     * functions return values - the linking functions - are combined into a composite linking\n     * function, which is the a linking function for the node.\n     *\n     * @param {NodeList} nodeList an array of nodes or NodeList to compile\n     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n     *        scope argument is auto-generated to the new child of the transcluded parent scope.\n     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n     *        the rootElement must be set the jqLite collection of the compile root. This is\n     *        needed so that the jqLite collection items can be replaced with widgets.\n     * @param {number=} maxPriority Max directive priority.\n     * @returns {Function} A composite linking function of all of the matched directives or null.\n     */\n    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n                            previousCompileContext) {\n      var linkFns = [],\n          attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n      for (var i = 0; i < nodeList.length; i++) {\n        attrs = new Attributes();\n\n        // we must always refer to nodeList[i] since the nodes can be replaced underneath us.\n        directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n                                        ignoreDirective);\n\n        nodeLinkFn = (directives.length)\n            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n                                      null, [], [], previousCompileContext)\n            : null;\n\n        if (nodeLinkFn && nodeLinkFn.scope) {\n          compile.$$addScopeClass(attrs.$$element);\n        }\n\n        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n                      !(childNodes = nodeList[i].childNodes) ||\n                      !childNodes.length)\n            ? null\n            : compileNodes(childNodes,\n                 nodeLinkFn ? (\n                  (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n                     && nodeLinkFn.transclude) : transcludeFn);\n\n        if (nodeLinkFn || childLinkFn) {\n          linkFns.push(i, nodeLinkFn, childLinkFn);\n          linkFnFound = true;\n          nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n        }\n\n        //use the previous context only for the first element in the virtual group\n        previousCompileContext = null;\n      }\n\n      // return a linking function if we have found anything, null otherwise\n      return linkFnFound ? compositeLinkFn : null;\n\n      function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n        var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n        var stableNodeList;\n\n\n        if (nodeLinkFnFound) {\n          // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n          // offsets don't get screwed up\n          var nodeListLength = nodeList.length;\n          stableNodeList = new Array(nodeListLength);\n\n          // create a sparse array by only copying the elements which have a linkFn\n          for (i = 0; i < linkFns.length; i+=3) {\n            idx = linkFns[i];\n            stableNodeList[idx] = nodeList[idx];\n          }\n        } else {\n          stableNodeList = nodeList;\n        }\n\n        for (i = 0, ii = linkFns.length; i < ii;) {\n          node = stableNodeList[linkFns[i++]];\n          nodeLinkFn = linkFns[i++];\n          childLinkFn = linkFns[i++];\n\n          if (nodeLinkFn) {\n            if (nodeLinkFn.scope) {\n              childScope = scope.$new();\n              compile.$$addScopeInfo(jqLite(node), childScope);\n            } else {\n              childScope = scope;\n            }\n\n            if (nodeLinkFn.transcludeOnThisElement) {\n              childBoundTranscludeFn = createBoundTranscludeFn(\n                  scope, nodeLinkFn.transclude, parentBoundTranscludeFn,\n                  nodeLinkFn.elementTranscludeOnThisElement);\n\n            } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n              childBoundTranscludeFn = parentBoundTranscludeFn;\n\n            } else if (!parentBoundTranscludeFn && transcludeFn) {\n              childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n            } else {\n              childBoundTranscludeFn = null;\n            }\n\n            nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n          } else if (childLinkFn) {\n            childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n          }\n        }\n      }\n    }\n\n    function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn, elementTransclusion) {\n\n      var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n        if (!transcludedScope) {\n          transcludedScope = scope.$new(false, containingScope);\n          transcludedScope.$$transcluded = true;\n        }\n\n        return transcludeFn(transcludedScope, cloneFn, {\n          parentBoundTranscludeFn: previousBoundTranscludeFn,\n          transcludeControllers: controllers,\n          futureParentElement: futureParentElement\n        });\n      };\n\n      return boundTranscludeFn;\n    }\n\n    /**\n     * Looks for directives on the given node and adds them to the directive collection which is\n     * sorted.\n     *\n     * @param node Node to search.\n     * @param directives An array to which the directives are added to. This array is sorted before\n     *        the function returns.\n     * @param attrs The shared attrs object which is used to populate the normalized attributes.\n     * @param {number=} maxPriority Max directive priority.\n     */\n    function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n      var nodeType = node.nodeType,\n          attrsMap = attrs.$attr,\n          match,\n          className;\n\n      switch (nodeType) {\n        case NODE_TYPE_ELEMENT: /* Element */\n          // use the node name: <directive>\n          addDirective(directives,\n              directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);\n\n          // iterate over the attributes\n          for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n                   j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n            var attrStartName = false;\n            var attrEndName = false;\n\n            attr = nAttrs[j];\n            name = attr.name;\n            value = trim(attr.value);\n\n            // support ngAttr attribute binding\n            ngAttrName = directiveNormalize(name);\n            if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {\n              name = name.replace(PREFIX_REGEXP, '')\n                .substr(8).replace(/_(.)/g, function(match, letter) {\n                  return letter.toUpperCase();\n                });\n            }\n\n            var directiveNName = ngAttrName.replace(/(Start|End)$/, '');\n            if (directiveIsMultiElement(directiveNName)) {\n              if (ngAttrName === directiveNName + 'Start') {\n                attrStartName = name;\n                attrEndName = name.substr(0, name.length - 5) + 'end';\n                name = name.substr(0, name.length - 6);\n              }\n            }\n\n            nName = directiveNormalize(name.toLowerCase());\n            attrsMap[nName] = name;\n            if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n                attrs[nName] = value;\n                if (getBooleanAttrName(node, nName)) {\n                  attrs[nName] = true; // presence means true\n                }\n            }\n            addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n            addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n                          attrEndName);\n          }\n\n          // use class as directive\n          className = node.className;\n          if (isObject(className)) {\n              // Maybe SVGAnimatedString\n              className = className.animVal;\n          }\n          if (isString(className) && className !== '') {\n            while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {\n              nName = directiveNormalize(match[2]);\n              if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n                attrs[nName] = trim(match[3]);\n              }\n              className = className.substr(match.index + match[0].length);\n            }\n          }\n          break;\n        case NODE_TYPE_TEXT: /* Text Node */\n          addTextInterpolateDirective(directives, node.nodeValue);\n          break;\n        case NODE_TYPE_COMMENT: /* Comment */\n          try {\n            match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n            if (match) {\n              nName = directiveNormalize(match[1]);\n              if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n                attrs[nName] = trim(match[2]);\n              }\n            }\n          } catch (e) {\n            // turns out that under some circumstances IE9 throws errors when one attempts to read\n            // comment's node value.\n            // Just ignore it and continue. (Can't seem to reproduce in test case.)\n          }\n          break;\n      }\n\n      directives.sort(byPriority);\n      return directives;\n    }\n\n    /**\n     * Given a node with an directive-start it collects all of the siblings until it finds\n     * directive-end.\n     * @param node\n     * @param attrStart\n     * @param attrEnd\n     * @returns {*}\n     */\n    function groupScan(node, attrStart, attrEnd) {\n      var nodes = [];\n      var depth = 0;\n      if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n        do {\n          if (!node) {\n            throw $compileMinErr('uterdir',\n                      \"Unterminated attribute, found '{0}' but no matching '{1}' found.\",\n                      attrStart, attrEnd);\n          }\n          if (node.nodeType == NODE_TYPE_ELEMENT) {\n            if (node.hasAttribute(attrStart)) depth++;\n            if (node.hasAttribute(attrEnd)) depth--;\n          }\n          nodes.push(node);\n          node = node.nextSibling;\n        } while (depth > 0);\n      } else {\n        nodes.push(node);\n      }\n\n      return jqLite(nodes);\n    }\n\n    /**\n     * Wrapper for linking function which converts normal linking function into a grouped\n     * linking function.\n     * @param linkFn\n     * @param attrStart\n     * @param attrEnd\n     * @returns {Function}\n     */\n    function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n      return function(scope, element, attrs, controllers, transcludeFn) {\n        element = groupScan(element[0], attrStart, attrEnd);\n        return linkFn(scope, element, attrs, controllers, transcludeFn);\n      };\n    }\n\n    /**\n     * Once the directives have been collected, their compile functions are executed. This method\n     * is responsible for inlining directive templates as well as terminating the application\n     * of the directives if the terminal directive has been reached.\n     *\n     * @param {Array} directives Array of collected directives to execute their compile function.\n     *        this needs to be pre-sorted by priority order.\n     * @param {Node} compileNode The raw DOM node to apply the compile functions to\n     * @param {Object} templateAttrs The shared attribute function\n     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n     *                                                  scope argument is auto-generated to the new\n     *                                                  child of the transcluded parent scope.\n     * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n     *                              argument has the root jqLite array so that we can replace nodes\n     *                              on it.\n     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n     *                                           compiling the transclusion.\n     * @param {Array.<Function>} preLinkFns\n     * @param {Array.<Function>} postLinkFns\n     * @param {Object} previousCompileContext Context used for previous compilation of the current\n     *                                        node\n     * @returns {Function} linkFn\n     */\n    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n                                   previousCompileContext) {\n      previousCompileContext = previousCompileContext || {};\n\n      var terminalPriority = -Number.MAX_VALUE,\n          newScopeDirective,\n          controllerDirectives = previousCompileContext.controllerDirectives,\n          controllers,\n          newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n          templateDirective = previousCompileContext.templateDirective,\n          nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n          hasTranscludeDirective = false,\n          hasTemplate = false,\n          hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n          $compileNode = templateAttrs.$$element = jqLite(compileNode),\n          directive,\n          directiveName,\n          $template,\n          replaceDirective = originalReplaceDirective,\n          childTranscludeFn = transcludeFn,\n          linkFn,\n          directiveValue;\n\n      // executes all directives on the current element\n      for (var i = 0, ii = directives.length; i < ii; i++) {\n        directive = directives[i];\n        var attrStart = directive.$$start;\n        var attrEnd = directive.$$end;\n\n        // collect multiblock sections\n        if (attrStart) {\n          $compileNode = groupScan(compileNode, attrStart, attrEnd);\n        }\n        $template = undefined;\n\n        if (terminalPriority > directive.priority) {\n          break; // prevent further processing of directives\n        }\n\n        if (directiveValue = directive.scope) {\n\n          // skip the check for directives with async templates, we'll check the derived sync\n          // directive when the template arrives\n          if (!directive.templateUrl) {\n            if (isObject(directiveValue)) {\n              // This directive is trying to add an isolated scope.\n              // Check that there is no scope of any kind already\n              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n                                directive, $compileNode);\n              newIsolateScopeDirective = directive;\n            } else {\n              // This directive is trying to add a child scope.\n              // Check that there is no isolated scope already\n              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n                                $compileNode);\n            }\n          }\n\n          newScopeDirective = newScopeDirective || directive;\n        }\n\n        directiveName = directive.name;\n\n        if (!directive.templateUrl && directive.controller) {\n          directiveValue = directive.controller;\n          controllerDirectives = controllerDirectives || {};\n          assertNoDuplicate(\"'\" + directiveName + \"' controller\",\n              controllerDirectives[directiveName], directive, $compileNode);\n          controllerDirectives[directiveName] = directive;\n        }\n\n        if (directiveValue = directive.transclude) {\n          hasTranscludeDirective = true;\n\n          // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n          // This option should only be used by directives that know how to safely handle element transclusion,\n          // where the transcluded nodes are added or replaced after linking.\n          if (!directive.$$tlb) {\n            assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n            nonTlbTranscludeDirective = directive;\n          }\n\n          if (directiveValue == 'element') {\n            hasElementTranscludeDirective = true;\n            terminalPriority = directive.priority;\n            $template = $compileNode;\n            $compileNode = templateAttrs.$$element =\n                jqLite(document.createComment(' ' + directiveName + ': ' +\n                                              templateAttrs[directiveName] + ' '));\n            compileNode = $compileNode[0];\n            replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n            childTranscludeFn = compile($template, transcludeFn, terminalPriority,\n                                        replaceDirective && replaceDirective.name, {\n                                          // Don't pass in:\n                                          // - controllerDirectives - otherwise we'll create duplicates controllers\n                                          // - newIsolateScopeDirective or templateDirective - combining templates with\n                                          //   element transclusion doesn't make sense.\n                                          //\n                                          // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n                                          // on the same element more than once.\n                                          nonTlbTranscludeDirective: nonTlbTranscludeDirective\n                                        });\n          } else {\n            $template = jqLite(jqLiteClone(compileNode)).contents();\n            $compileNode.empty(); // clear contents\n            childTranscludeFn = compile($template, transcludeFn);\n          }\n        }\n\n        if (directive.template) {\n          hasTemplate = true;\n          assertNoDuplicate('template', templateDirective, directive, $compileNode);\n          templateDirective = directive;\n\n          directiveValue = (isFunction(directive.template))\n              ? directive.template($compileNode, templateAttrs)\n              : directive.template;\n\n          directiveValue = denormalizeTemplate(directiveValue);\n\n          if (directive.replace) {\n            replaceDirective = directive;\n            if (jqLiteIsTextNode(directiveValue)) {\n              $template = [];\n            } else {\n              $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n            }\n            compileNode = $template[0];\n\n            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n              throw $compileMinErr('tplrt',\n                  \"Template for directive '{0}' must have exactly one root element. {1}\",\n                  directiveName, '');\n            }\n\n            replaceWith(jqCollection, $compileNode, compileNode);\n\n            var newTemplateAttrs = {$attr: {}};\n\n            // combine directives from the original node and from the template:\n            // - take the array of directives for this element\n            // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n            // - collect directives from the template and sort them by priority\n            // - combine directives as: processed + template + unprocessed\n            var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n            var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n            if (newIsolateScopeDirective) {\n              markDirectivesAsIsolate(templateDirectives);\n            }\n            directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n            mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n            ii = directives.length;\n          } else {\n            $compileNode.html(directiveValue);\n          }\n        }\n\n        if (directive.templateUrl) {\n          hasTemplate = true;\n          assertNoDuplicate('template', templateDirective, directive, $compileNode);\n          templateDirective = directive;\n\n          if (directive.replace) {\n            replaceDirective = directive;\n          }\n\n          nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n              templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n                controllerDirectives: controllerDirectives,\n                newIsolateScopeDirective: newIsolateScopeDirective,\n                templateDirective: templateDirective,\n                nonTlbTranscludeDirective: nonTlbTranscludeDirective\n              });\n          ii = directives.length;\n        } else if (directive.compile) {\n          try {\n            linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n            if (isFunction(linkFn)) {\n              addLinkFns(null, linkFn, attrStart, attrEnd);\n            } else if (linkFn) {\n              addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);\n            }\n          } catch (e) {\n            $exceptionHandler(e, startingTag($compileNode));\n          }\n        }\n\n        if (directive.terminal) {\n          nodeLinkFn.terminal = true;\n          terminalPriority = Math.max(terminalPriority, directive.priority);\n        }\n\n      }\n\n      nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n      nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n      nodeLinkFn.elementTranscludeOnThisElement = hasElementTranscludeDirective;\n      nodeLinkFn.templateOnThisElement = hasTemplate;\n      nodeLinkFn.transclude = childTranscludeFn;\n\n      previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n      // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n      return nodeLinkFn;\n\n      ////////////////////\n\n      function addLinkFns(pre, post, attrStart, attrEnd) {\n        if (pre) {\n          if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n          pre.require = directive.require;\n          pre.directiveName = directiveName;\n          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n            pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n          }\n          preLinkFns.push(pre);\n        }\n        if (post) {\n          if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n          post.require = directive.require;\n          post.directiveName = directiveName;\n          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n            post = cloneAndAnnotateFn(post, {isolateScope: true});\n          }\n          postLinkFns.push(post);\n        }\n      }\n\n\n      function getControllers(directiveName, require, $element, elementControllers) {\n        var value, retrievalMethod = 'data', optional = false;\n        var $searchElement = $element;\n        var match;\n        if (isString(require)) {\n          match = require.match(REQUIRE_PREFIX_REGEXP);\n          require = require.substring(match[0].length);\n\n          if (match[3]) {\n            if (match[1]) match[3] = null;\n            else match[1] = match[3];\n          }\n          if (match[1] === '^') {\n            retrievalMethod = 'inheritedData';\n          } else if (match[1] === '^^') {\n            retrievalMethod = 'inheritedData';\n            $searchElement = $element.parent();\n          }\n          if (match[2] === '?') {\n            optional = true;\n          }\n\n          value = null;\n\n          if (elementControllers && retrievalMethod === 'data') {\n            if (value = elementControllers[require]) {\n              value = value.instance;\n            }\n          }\n          value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');\n\n          if (!value && !optional) {\n            throw $compileMinErr('ctreq',\n                \"Controller '{0}', required by directive '{1}', can't be found!\",\n                require, directiveName);\n          }\n          return value || null;\n        } else if (isArray(require)) {\n          value = [];\n          forEach(require, function(require) {\n            value.push(getControllers(directiveName, require, $element, elementControllers));\n          });\n        }\n        return value;\n      }\n\n\n      function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n        var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element,\n            attrs;\n\n        if (compileNode === linkNode) {\n          attrs = templateAttrs;\n          $element = templateAttrs.$$element;\n        } else {\n          $element = jqLite(linkNode);\n          attrs = new Attributes($element, templateAttrs);\n        }\n\n        if (newIsolateScopeDirective) {\n          isolateScope = scope.$new(true);\n        }\n\n        if (boundTranscludeFn) {\n          // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n          // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n          transcludeFn = controllersBoundTransclude;\n          transcludeFn.$$boundTransclude = boundTranscludeFn;\n        }\n\n        if (controllerDirectives) {\n          // TODO: merge `controllers` and `elementControllers` into single object.\n          controllers = {};\n          elementControllers = {};\n          forEach(controllerDirectives, function(directive) {\n            var locals = {\n              $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n              $element: $element,\n              $attrs: attrs,\n              $transclude: transcludeFn\n            }, controllerInstance;\n\n            controller = directive.controller;\n            if (controller == '@') {\n              controller = attrs[directive.name];\n            }\n\n            controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n            // For directives with element transclusion the element is a comment,\n            // but jQuery .data doesn't support attaching data to comment nodes as it's hard to\n            // clean up (http://bugs.jquery.com/ticket/8335).\n            // Instead, we save the controllers for the element in a local hash and attach to .data\n            // later, once we have the actual element.\n            elementControllers[directive.name] = controllerInstance;\n            if (!hasElementTranscludeDirective) {\n              $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n            }\n\n            controllers[directive.name] = controllerInstance;\n          });\n        }\n\n        if (newIsolateScopeDirective) {\n          compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n              templateDirective === newIsolateScopeDirective.$$originalDirective)));\n          compile.$$addScopeClass($element, true);\n\n          var isolateScopeController = controllers && controllers[newIsolateScopeDirective.name];\n          var isolateBindingContext = isolateScope;\n          if (isolateScopeController && isolateScopeController.identifier &&\n              newIsolateScopeDirective.bindToController === true) {\n            isolateBindingContext = isolateScopeController.instance;\n          }\n\n          forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) {\n            var attrName = definition.attrName,\n                optional = definition.optional,\n                mode = definition.mode, // @, =, or &\n                lastValue,\n                parentGet, parentSet, compare;\n\n            switch (mode) {\n\n              case '@':\n                attrs.$observe(attrName, function(value) {\n                  isolateBindingContext[scopeName] = value;\n                });\n                attrs.$$observers[attrName].$$scope = scope;\n                if (attrs[attrName]) {\n                  // If the attribute has been provided then we trigger an interpolation to ensure\n                  // the value is there for use in the link fn\n                  isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);\n                }\n                break;\n\n              case '=':\n                if (optional && !attrs[attrName]) {\n                  return;\n                }\n                parentGet = $parse(attrs[attrName]);\n                if (parentGet.literal) {\n                  compare = equals;\n                } else {\n                  compare = function(a, b) { return a === b || (a !== a && b !== b); };\n                }\n                parentSet = parentGet.assign || function() {\n                  // reset the change, or we will throw this exception on every $digest\n                  lastValue = isolateBindingContext[scopeName] = parentGet(scope);\n                  throw $compileMinErr('nonassign',\n                      \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n                      attrs[attrName], newIsolateScopeDirective.name);\n                };\n                lastValue = isolateBindingContext[scopeName] = parentGet(scope);\n                var parentValueWatch = function parentValueWatch(parentValue) {\n                  if (!compare(parentValue, isolateBindingContext[scopeName])) {\n                    // we are out of sync and need to copy\n                    if (!compare(parentValue, lastValue)) {\n                      // parent changed and it has precedence\n                      isolateBindingContext[scopeName] = parentValue;\n                    } else {\n                      // if the parent can be assigned then do so\n                      parentSet(scope, parentValue = isolateBindingContext[scopeName]);\n                    }\n                  }\n                  return lastValue = parentValue;\n                };\n                parentValueWatch.$stateful = true;\n                var unwatch;\n                if (definition.collection) {\n                  unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n                } else {\n                  unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n                }\n                isolateScope.$on('$destroy', unwatch);\n                break;\n\n              case '&':\n                parentGet = $parse(attrs[attrName]);\n                isolateBindingContext[scopeName] = function(locals) {\n                  return parentGet(scope, locals);\n                };\n                break;\n            }\n          });\n        }\n        if (controllers) {\n          forEach(controllers, function(controller) {\n            controller();\n          });\n          controllers = null;\n        }\n\n        // PRELINKING\n        for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n          linkFn = preLinkFns[i];\n          invokeLinkFn(linkFn,\n              linkFn.isolateScope ? isolateScope : scope,\n              $element,\n              attrs,\n              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n              transcludeFn\n          );\n        }\n\n        // RECURSION\n        // We only pass the isolate scope, if the isolate directive has a template,\n        // otherwise the child elements do not belong to the isolate directive.\n        var scopeToChild = scope;\n        if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n          scopeToChild = isolateScope;\n        }\n        childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n\n        // POSTLINKING\n        for (i = postLinkFns.length - 1; i >= 0; i--) {\n          linkFn = postLinkFns[i];\n          invokeLinkFn(linkFn,\n              linkFn.isolateScope ? isolateScope : scope,\n              $element,\n              attrs,\n              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n              transcludeFn\n          );\n        }\n\n        // This is the function that is injected as `$transclude`.\n        // Note: all arguments are optional!\n        function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n          var transcludeControllers;\n\n          // No scope passed in:\n          if (!isScope(scope)) {\n            futureParentElement = cloneAttachFn;\n            cloneAttachFn = scope;\n            scope = undefined;\n          }\n\n          if (hasElementTranscludeDirective) {\n            transcludeControllers = elementControllers;\n          }\n          if (!futureParentElement) {\n            futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n          }\n          return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n        }\n      }\n    }\n\n    function markDirectivesAsIsolate(directives) {\n      // mark all directives as needing isolate scope.\n      for (var j = 0, jj = directives.length; j < jj; j++) {\n        directives[j] = inherit(directives[j], {$$isolateScope: true});\n      }\n    }\n\n    /**\n     * looks up the directive and decorates it with exception handling and proper parameters. We\n     * call this the boundDirective.\n     *\n     * @param {string} name name of the directive to look up.\n     * @param {string} location The directive must be found in specific format.\n     *   String containing any of theses characters:\n     *\n     *   * `E`: element name\n     *   * `A': attribute\n     *   * `C`: class\n     *   * `M`: comment\n     * @returns {boolean} true if directive was added.\n     */\n    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n                          endAttrName) {\n      if (name === ignoreDirective) return null;\n      var match = null;\n      if (hasDirectives.hasOwnProperty(name)) {\n        for (var directive, directives = $injector.get(name + Suffix),\n            i = 0, ii = directives.length; i < ii; i++) {\n          try {\n            directive = directives[i];\n            if ((maxPriority === undefined || maxPriority > directive.priority) &&\n                 directive.restrict.indexOf(location) != -1) {\n              if (startAttrName) {\n                directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n              }\n              tDirectives.push(directive);\n              match = directive;\n            }\n          } catch (e) { $exceptionHandler(e); }\n        }\n      }\n      return match;\n    }\n\n\n    /**\n     * looks up the directive and returns true if it is a multi-element directive,\n     * and therefore requires DOM nodes between -start and -end markers to be grouped\n     * together.\n     *\n     * @param {string} name name of the directive to look up.\n     * @returns true if directive was registered as multi-element.\n     */\n    function directiveIsMultiElement(name) {\n      if (hasDirectives.hasOwnProperty(name)) {\n        for (var directive, directives = $injector.get(name + Suffix),\n            i = 0, ii = directives.length; i < ii; i++) {\n          directive = directives[i];\n          if (directive.multiElement) {\n            return true;\n          }\n        }\n      }\n      return false;\n    }\n\n    /**\n     * When the element is replaced with HTML template then the new attributes\n     * on the template need to be merged with the existing attributes in the DOM.\n     * The desired effect is to have both of the attributes present.\n     *\n     * @param {object} dst destination attributes (original DOM)\n     * @param {object} src source attributes (from the directive template)\n     */\n    function mergeTemplateAttributes(dst, src) {\n      var srcAttr = src.$attr,\n          dstAttr = dst.$attr,\n          $element = dst.$$element;\n\n      // reapply the old attributes to the new element\n      forEach(dst, function(value, key) {\n        if (key.charAt(0) != '$') {\n          if (src[key] && src[key] !== value) {\n            value += (key === 'style' ? ';' : ' ') + src[key];\n          }\n          dst.$set(key, value, true, srcAttr[key]);\n        }\n      });\n\n      // copy the new attributes on the old attrs object\n      forEach(src, function(value, key) {\n        if (key == 'class') {\n          safeAddClass($element, value);\n          dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;\n        } else if (key == 'style') {\n          $element.attr('style', $element.attr('style') + ';' + value);\n          dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;\n          // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n          // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n          // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n        } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {\n          dst[key] = value;\n          dstAttr[key] = srcAttr[key];\n        }\n      });\n    }\n\n\n    function compileTemplateUrl(directives, $compileNode, tAttrs,\n        $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n      var linkQueue = [],\n          afterTemplateNodeLinkFn,\n          afterTemplateChildLinkFn,\n          beforeTemplateCompileNode = $compileNode[0],\n          origAsyncDirective = directives.shift(),\n          derivedSyncDirective = inherit(origAsyncDirective, {\n            templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n          }),\n          templateUrl = (isFunction(origAsyncDirective.templateUrl))\n              ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n              : origAsyncDirective.templateUrl,\n          templateNamespace = origAsyncDirective.templateNamespace;\n\n      $compileNode.empty();\n\n      $templateRequest($sce.getTrustedResourceUrl(templateUrl))\n        .then(function(content) {\n          var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n          content = denormalizeTemplate(content);\n\n          if (origAsyncDirective.replace) {\n            if (jqLiteIsTextNode(content)) {\n              $template = [];\n            } else {\n              $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n            }\n            compileNode = $template[0];\n\n            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n              throw $compileMinErr('tplrt',\n                  \"Template for directive '{0}' must have exactly one root element. {1}\",\n                  origAsyncDirective.name, templateUrl);\n            }\n\n            tempTemplateAttrs = {$attr: {}};\n            replaceWith($rootElement, $compileNode, compileNode);\n            var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n            if (isObject(origAsyncDirective.scope)) {\n              markDirectivesAsIsolate(templateDirectives);\n            }\n            directives = templateDirectives.concat(directives);\n            mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n          } else {\n            compileNode = beforeTemplateCompileNode;\n            $compileNode.html(content);\n          }\n\n          directives.unshift(derivedSyncDirective);\n\n          afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n              previousCompileContext);\n          forEach($rootElement, function(node, i) {\n            if (node == compileNode) {\n              $rootElement[i] = $compileNode[0];\n            }\n          });\n          afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n          while (linkQueue.length) {\n            var scope = linkQueue.shift(),\n                beforeTemplateLinkNode = linkQueue.shift(),\n                linkRootElement = linkQueue.shift(),\n                boundTranscludeFn = linkQueue.shift(),\n                linkNode = $compileNode[0];\n\n            if (scope.$$destroyed) continue;\n\n            if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n              var oldClasses = beforeTemplateLinkNode.className;\n\n              if (!(previousCompileContext.hasElementTranscludeDirective &&\n                  origAsyncDirective.replace)) {\n                // it was cloned therefore we have to clone as well.\n                linkNode = jqLiteClone(compileNode);\n              }\n              replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n              // Copy in CSS classes from original node\n              safeAddClass(jqLite(linkNode), oldClasses);\n            }\n            if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n              childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n            } else {\n              childBoundTranscludeFn = boundTranscludeFn;\n            }\n            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n              childBoundTranscludeFn);\n          }\n          linkQueue = null;\n        });\n\n      return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n        var childBoundTranscludeFn = boundTranscludeFn;\n        if (scope.$$destroyed) return;\n        if (linkQueue) {\n          linkQueue.push(scope,\n                         node,\n                         rootElement,\n                         childBoundTranscludeFn);\n        } else {\n          if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n            childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n          }\n          afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n        }\n      };\n    }\n\n\n    /**\n     * Sorting function for bound directives.\n     */\n    function byPriority(a, b) {\n      var diff = b.priority - a.priority;\n      if (diff !== 0) return diff;\n      if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n      return a.index - b.index;\n    }\n\n\n    function assertNoDuplicate(what, previousDirective, directive, element) {\n      if (previousDirective) {\n        throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}',\n            previousDirective.name, directive.name, what, startingTag(element));\n      }\n    }\n\n\n    function addTextInterpolateDirective(directives, text) {\n      var interpolateFn = $interpolate(text, true);\n      if (interpolateFn) {\n        directives.push({\n          priority: 0,\n          compile: function textInterpolateCompileFn(templateNode) {\n            var templateNodeParent = templateNode.parent(),\n                hasCompileParent = !!templateNodeParent.length;\n\n            // When transcluding a template that has bindings in the root\n            // we don't have a parent and thus need to add the class during linking fn.\n            if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n            return function textInterpolateLinkFn(scope, node) {\n              var parent = node.parent();\n              if (!hasCompileParent) compile.$$addBindingClass(parent);\n              compile.$$addBindingInfo(parent, interpolateFn.expressions);\n              scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n                node[0].nodeValue = value;\n              });\n            };\n          }\n        });\n      }\n    }\n\n\n    function wrapTemplate(type, template) {\n      type = lowercase(type || 'html');\n      switch (type) {\n      case 'svg':\n      case 'math':\n        var wrapper = document.createElement('div');\n        wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';\n        return wrapper.childNodes[0].childNodes;\n      default:\n        return template;\n      }\n    }\n\n\n    function getTrustedContext(node, attrNormalizedName) {\n      if (attrNormalizedName == \"srcdoc\") {\n        return $sce.HTML;\n      }\n      var tag = nodeName_(node);\n      // maction[xlink:href] can source SVG.  It's not limited to <maction>.\n      if (attrNormalizedName == \"xlinkHref\" ||\n          (tag == \"form\" && attrNormalizedName == \"action\") ||\n          (tag != \"img\" && (attrNormalizedName == \"src\" ||\n                            attrNormalizedName == \"ngSrc\"))) {\n        return $sce.RESOURCE_URL;\n      }\n    }\n\n\n    function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {\n      var trustedContext = getTrustedContext(node, name);\n      allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;\n\n      var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);\n\n      // no interpolation found -> ignore\n      if (!interpolateFn) return;\n\n\n      if (name === \"multiple\" && nodeName_(node) === \"select\") {\n        throw $compileMinErr(\"selmulti\",\n            \"Binding to the 'multiple' attribute is not supported. Element: {0}\",\n            startingTag(node));\n      }\n\n      directives.push({\n        priority: 100,\n        compile: function() {\n            return {\n              pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n                var $$observers = (attr.$$observers || (attr.$$observers = {}));\n\n                if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n                  throw $compileMinErr('nodomevents',\n                      \"Interpolations for HTML DOM event attributes are disallowed.  Please use the \" +\n                          \"ng- versions (such as ng-click instead of onclick) instead.\");\n                }\n\n                // If the attribute has changed since last $interpolate()ed\n                var newValue = attr[name];\n                if (newValue !== value) {\n                  // we need to interpolate again since the attribute value has been updated\n                  // (e.g. by another directive's compile function)\n                  // ensure unset/empty values make interpolateFn falsy\n                  interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n                  value = newValue;\n                }\n\n                // if attribute was updated so that there is no interpolation going on we don't want to\n                // register any observers\n                if (!interpolateFn) return;\n\n                // initialize attr object so that it's ready in case we need the value for isolate\n                // scope initialization, otherwise the value would not be available from isolate\n                // directive's linking fn during linking phase\n                attr[name] = interpolateFn(scope);\n\n                ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n                (attr.$$observers && attr.$$observers[name].$$scope || scope).\n                  $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n                    //special case for class attribute addition + removal\n                    //so that class changes can tap into the animation\n                    //hooks provided by the $animate service. Be sure to\n                    //skip animations when the first digest occurs (when\n                    //both the new and the old values are the same) since\n                    //the CSS classes are the non-interpolated values\n                    if (name === 'class' && newValue != oldValue) {\n                      attr.$updateClass(newValue, oldValue);\n                    } else {\n                      attr.$set(name, newValue);\n                    }\n                  });\n              }\n            };\n          }\n      });\n    }\n\n\n    /**\n     * This is a special jqLite.replaceWith, which can replace items which\n     * have no parents, provided that the containing jqLite collection is provided.\n     *\n     * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n     *                               in the root of the tree.\n     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n     *                                  the shell, but replace its DOM node reference.\n     * @param {Node} newNode The new DOM node.\n     */\n    function replaceWith($rootElement, elementsToRemove, newNode) {\n      var firstElementToRemove = elementsToRemove[0],\n          removeCount = elementsToRemove.length,\n          parent = firstElementToRemove.parentNode,\n          i, ii;\n\n      if ($rootElement) {\n        for (i = 0, ii = $rootElement.length; i < ii; i++) {\n          if ($rootElement[i] == firstElementToRemove) {\n            $rootElement[i++] = newNode;\n            for (var j = i, j2 = j + removeCount - 1,\n                     jj = $rootElement.length;\n                 j < jj; j++, j2++) {\n              if (j2 < jj) {\n                $rootElement[j] = $rootElement[j2];\n              } else {\n                delete $rootElement[j];\n              }\n            }\n            $rootElement.length -= removeCount - 1;\n\n            // If the replaced element is also the jQuery .context then replace it\n            // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n            // http://api.jquery.com/context/\n            if ($rootElement.context === firstElementToRemove) {\n              $rootElement.context = newNode;\n            }\n            break;\n          }\n        }\n      }\n\n      if (parent) {\n        parent.replaceChild(newNode, firstElementToRemove);\n      }\n\n      // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it?\n      var fragment = document.createDocumentFragment();\n      fragment.appendChild(firstElementToRemove);\n\n      // Copy over user data (that includes Angular's $scope etc.). Don't copy private\n      // data here because there's no public interface in jQuery to do that and copying over\n      // event listeners (which is the main use of private data) wouldn't work anyway.\n      jqLite(newNode).data(jqLite(firstElementToRemove).data());\n\n      // Remove data of the replaced element. We cannot just call .remove()\n      // on the element it since that would deallocate scope that is needed\n      // for the new node. Instead, remove the data \"manually\".\n      if (!jQuery) {\n        delete jqLite.cache[firstElementToRemove[jqLite.expando]];\n      } else {\n        // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after\n        // the replaced element. The cleanData version monkey-patched by Angular would cause\n        // the scope to be trashed and we do need the very same scope to work with the new\n        // element. However, we cannot just cache the non-patched version and use it here as\n        // that would break if another library patches the method after Angular does (one\n        // example is jQuery UI). Instead, set a flag indicating scope destroying should be\n        // skipped this one time.\n        skipDestroyOnNextJQueryCleanData = true;\n        jQuery.cleanData([firstElementToRemove]);\n      }\n\n      for (var k = 1, kk = elementsToRemove.length; k < kk; k++) {\n        var element = elementsToRemove[k];\n        jqLite(element).remove(); // must do this way to clean up expando\n        fragment.appendChild(element);\n        delete elementsToRemove[k];\n      }\n\n      elementsToRemove[0] = newNode;\n      elementsToRemove.length = 1;\n    }\n\n\n    function cloneAndAnnotateFn(fn, annotation) {\n      return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n    }\n\n\n    function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n      try {\n        linkFn(scope, $element, attrs, controllers, transcludeFn);\n      } catch (e) {\n        $exceptionHandler(e, startingTag($element));\n      }\n    }\n  }];\n}\n\nvar PREFIX_REGEXP = /^((?:x|data)[\\:\\-_])/i;\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n  return camelCase(name.replace(PREFIX_REGEXP, ''));\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in Angular:\n *\n * ```\n *    <span ng:bind=\"a\" ng-bind=\"a\" data-ng-bind=\"a\" x-ng-bind=\"a\">\n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n *          reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n *          property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n  /* angular.Scope */ scope,\n  /* NodeList */ nodeList,\n  /* Element */ rootElement,\n  /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n  /* nodesetLinkingFn */ nodesetLinkingFn,\n  /* angular.Scope */ scope,\n  /* Node */ node,\n  /* Element */ rootElement,\n  /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n  var values = '',\n      tokens1 = str1.split(/\\s+/),\n      tokens2 = str2.split(/\\s+/);\n\n  outer:\n  for (var i = 0; i < tokens1.length; i++) {\n    var token = tokens1[i];\n    for (var j = 0; j < tokens2.length; j++) {\n      if (token == tokens2[j]) continue outer;\n    }\n    values += (values.length > 0 ? ' ' : '') + token;\n  }\n  return values;\n}\n\nfunction removeComments(jqNodes) {\n  jqNodes = jqLite(jqNodes);\n  var i = jqNodes.length;\n\n  if (i <= 1) {\n    return jqNodes;\n  }\n\n  while (i--) {\n    var node = jqNodes[i];\n    if (node.nodeType === NODE_TYPE_COMMENT) {\n      splice.call(jqNodes, i, 1);\n    }\n  }\n  return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @description\n * The {@link ng.$controller $controller service} is used by Angular to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n  var controllers = {},\n      globals = false,\n      CNTRL_REG = /^(\\S+)(\\s+as\\s+(\\w+))?$/;\n\n\n  /**\n   * @ngdoc method\n   * @name $controllerProvider#register\n   * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n   *    the names and the values are the constructors.\n   * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n   *    annotations in the array notation).\n   */\n  this.register = function(name, constructor) {\n    assertNotHasOwnProperty(name, 'controller');\n    if (isObject(name)) {\n      extend(controllers, name);\n    } else {\n      controllers[name] = constructor;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $controllerProvider#allowGlobals\n   * @description If called, allows `$controller` to find controller constructors on `window`\n   */\n  this.allowGlobals = function() {\n    globals = true;\n  };\n\n\n  this.$get = ['$injector', '$window', function($injector, $window) {\n\n    /**\n     * @ngdoc service\n     * @name $controller\n     * @requires $injector\n     *\n     * @param {Function|string} constructor If called with a function then it's considered to be the\n     *    controller constructor function. Otherwise it's considered to be a string which is used\n     *    to retrieve the controller constructor using the following steps:\n     *\n     *    * check if a controller with given name is registered via `$controllerProvider`\n     *    * check if evaluating the string on the current scope returns a constructor\n     *    * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n     *      `window` object (not recommended)\n     *\n     *    The string can use the `controller as property` syntax, where the controller instance is published\n     *    as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n     *    to work correctly.\n     *\n     * @param {Object} locals Injection locals for Controller.\n     * @return {Object} Instance of given controller.\n     *\n     * @description\n     * `$controller` service is responsible for instantiating controllers.\n     *\n     * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n     * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n     */\n    return function(expression, locals, later, ident) {\n      // PRIVATE API:\n      //   param `later` --- indicates that the controller's constructor is invoked at a later time.\n      //                     If true, $controller will allocate the object with the correct\n      //                     prototype chain, but will not invoke the controller until a returned\n      //                     callback is invoked.\n      //   param `ident` --- An optional label which overrides the label parsed from the controller\n      //                     expression, if any.\n      var instance, match, constructor, identifier;\n      later = later === true;\n      if (ident && isString(ident)) {\n        identifier = ident;\n      }\n\n      if (isString(expression)) {\n        match = expression.match(CNTRL_REG);\n        if (!match) {\n          throw $controllerMinErr('ctrlfmt',\n            \"Badly formed controller string '{0}'. \" +\n            \"Must match `__name__ as __id__` or `__name__`.\", expression);\n        }\n        constructor = match[1],\n        identifier = identifier || match[3];\n        expression = controllers.hasOwnProperty(constructor)\n            ? controllers[constructor]\n            : getter(locals.$scope, constructor, true) ||\n                (globals ? getter($window, constructor, true) : undefined);\n\n        assertArgFn(expression, constructor, true);\n      }\n\n      if (later) {\n        // Instantiate controller later:\n        // This machinery is used to create an instance of the object before calling the\n        // controller's constructor itself.\n        //\n        // This allows properties to be added to the controller before the constructor is\n        // invoked. Primarily, this is used for isolate scope bindings in $compile.\n        //\n        // This feature is not intended for use by applications, and is thus not documented\n        // publicly.\n        // Object creation: http://jsperf.com/create-constructor/2\n        var controllerPrototype = (isArray(expression) ?\n          expression[expression.length - 1] : expression).prototype;\n        instance = Object.create(controllerPrototype || null);\n\n        if (identifier) {\n          addIdentifier(locals, identifier, instance, constructor || expression.name);\n        }\n\n        return extend(function() {\n          $injector.invoke(expression, instance, locals, constructor);\n          return instance;\n        }, {\n          instance: instance,\n          identifier: identifier\n        });\n      }\n\n      instance = $injector.instantiate(expression, locals, constructor);\n\n      if (identifier) {\n        addIdentifier(locals, identifier, instance, constructor || expression.name);\n      }\n\n      return instance;\n    };\n\n    function addIdentifier(locals, identifier, instance, name) {\n      if (!(locals && isObject(locals.$scope))) {\n        throw minErr('$controller')('noscp',\n          \"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.\",\n          name, identifier);\n      }\n\n      locals.$scope[identifier] = instance;\n    }\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n   <example module=\"documentExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n         <p>$document title: <b ng-bind=\"title\"></b></p>\n         <p>window.document title: <b ng-bind=\"windowTitle\"></b></p>\n       </div>\n     </file>\n     <file name=\"script.js\">\n       angular.module('documentExample', [])\n         .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n           $scope.title = $document[0].title;\n           $scope.windowTitle = angular.element(window.document)[0].title;\n         }]);\n     </file>\n   </example>\n */\nfunction $DocumentProvider() {\n  this.$get = ['$window', function(window) {\n    return jqLite(window.document);\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n *\n * @description\n * Any uncaught exception in angular expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * ```js\n *   angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {\n *     return function(exception, cause) {\n *       exception.message += ' (caused by \"' + cause + '\")';\n *       throw exception;\n *     };\n *   });\n * ```\n *\n * This example will override the normal action of `$exceptionHandler`, to make angular\n * exceptions fail hard when they happen, instead of just logging to the console.\n *\n * <hr />\n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause optional information about the context in which\n *       the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n  this.$get = ['$log', function($log) {\n    return function(exception, cause) {\n      $log.error.apply($log, arguments);\n    };\n  }];\n}\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n  '[': /]$/,\n  '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\n\nfunction defaultHttpResponseTransform(data, headers) {\n  if (isString(data)) {\n    // Strip json vulnerability protection prefix and trim whitespace\n    var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n    if (tempData) {\n      var contentType = headers('Content-Type');\n      if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {\n        data = fromJson(tempData);\n      }\n    }\n  }\n\n  return data;\n}\n\nfunction isJsonLike(str) {\n    var jsonStart = str.match(JSON_START);\n    return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n  var parsed = createMap(), key, val, i;\n\n  if (!headers) return parsed;\n\n  forEach(headers.split('\\n'), function(line) {\n    i = line.indexOf(':');\n    key = lowercase(trim(line.substr(0, i)));\n    val = trim(line.substr(i + 1));\n\n    if (key) {\n      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n    }\n  });\n\n  return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n *   - if called with single an argument returns a single header value or null\n *   - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n  var headersObj = isObject(headers) ? headers : undefined;\n\n  return function(name) {\n    if (!headersObj) headersObj =  parseHeaders(headers);\n\n    if (name) {\n      var value = headersObj[lowercase(name)];\n      if (value === void 0) {\n        value = null;\n      }\n      return value;\n    }\n\n    return headersObj;\n  };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.<Function>)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n  if (isFunction(fns))\n    return fns(data, headers, status);\n\n  forEach(fns, function(fn) {\n    data = fn(data, headers, status);\n  });\n\n  return data;\n}\n\n\nfunction isSuccess(status) {\n  return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n * */\nfunction $HttpProvider() {\n  /**\n   * @ngdoc property\n   * @name $httpProvider#defaults\n   * @description\n   *\n   * Object containing default values for all {@link ng.$http $http} requests.\n   *\n   * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`}\n   * that will provide the cache for all requests who set their `cache` property to `true`.\n   * If you set the `default.cache = false` then only requests that specify their own custom\n   * cache object will be cached. See {@link $http#caching $http Caching} for more information.\n   *\n   * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n   * Defaults value is `'XSRF-TOKEN'`.\n   *\n   * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n   * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n   *\n   * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n   * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n   * setting default headers.\n   *     - **`defaults.headers.common`**\n   *     - **`defaults.headers.post`**\n   *     - **`defaults.headers.put`**\n   *     - **`defaults.headers.patch`**\n   *\n   **/\n  var defaults = this.defaults = {\n    // transform incoming response data\n    transformResponse: [defaultHttpResponseTransform],\n\n    // transform outgoing request data\n    transformRequest: [function(d) {\n      return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n    }],\n\n    // default headers\n    headers: {\n      common: {\n        'Accept': 'application/json, text/plain, */*'\n      },\n      post:   shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n      put:    shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n      patch:  shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n    },\n\n    xsrfCookieName: 'XSRF-TOKEN',\n    xsrfHeaderName: 'X-XSRF-TOKEN'\n  };\n\n  var useApplyAsync = false;\n  /**\n   * @ngdoc method\n   * @name $httpProvider#useApplyAsync\n   * @description\n   *\n   * Configure $http service to combine processing of multiple http responses received at around\n   * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n   * significant performance improvement for bigger applications that make many HTTP requests\n   * concurrently (common during application bootstrap).\n   *\n   * Defaults to false. If no value is specifed, returns the current configured value.\n   *\n   * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n   *    \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n   *    to load and share the same digest cycle.\n   *\n   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n   *    otherwise, returns the current configured value.\n   **/\n  this.useApplyAsync = function(value) {\n    if (isDefined(value)) {\n      useApplyAsync = !!value;\n      return this;\n    }\n    return useApplyAsync;\n  };\n\n  /**\n   * @ngdoc property\n   * @name $httpProvider#interceptors\n   * @description\n   *\n   * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n   * pre-processing of request or postprocessing of responses.\n   *\n   * These service factories are ordered by request, i.e. they are applied in the same order as the\n   * array, on request, but reverse order, on response.\n   *\n   * {@link ng.$http#interceptors Interceptors detailed info}\n   **/\n  var interceptorFactories = this.interceptors = [];\n\n  this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',\n      function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {\n\n    var defaultCache = $cacheFactory('$http');\n\n    /**\n     * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n     * The reversal is needed so that we can build up the interception chain around the\n     * server request.\n     */\n    var reversedInterceptors = [];\n\n    forEach(interceptorFactories, function(interceptorFactory) {\n      reversedInterceptors.unshift(isString(interceptorFactory)\n          ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n    });\n\n    /**\n     * @ngdoc service\n     * @kind function\n     * @name $http\n     * @requires ng.$httpBackend\n     * @requires $cacheFactory\n     * @requires $rootScope\n     * @requires $q\n     * @requires $injector\n     *\n     * @description\n     * The `$http` service is a core Angular service that facilitates communication with the remote\n     * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n     * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n     *\n     * For unit testing applications that use `$http` service, see\n     * {@link ngMock.$httpBackend $httpBackend mock}.\n     *\n     * For a higher level of abstraction, please check out the {@link ngResource.$resource\n     * $resource} service.\n     *\n     * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n     * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n     * it is important to familiarize yourself with these APIs and the guarantees they provide.\n     *\n     *\n     * ## General usage\n     * The `$http` service is a function which takes a single argument — a configuration object —\n     * that is used to generate an HTTP request and returns  a {@link ng.$q promise}\n     * with two $http specific methods: `success` and `error`.\n     *\n     * ```js\n     *   // Simple GET request example :\n     *   $http.get('/someUrl').\n     *     success(function(data, status, headers, config) {\n     *       // this callback will be called asynchronously\n     *       // when the response is available\n     *     }).\n     *     error(function(data, status, headers, config) {\n     *       // called asynchronously if an error occurs\n     *       // or server returns response with an error status.\n     *     });\n     * ```\n     *\n     * ```js\n     *   // Simple POST request example (passing data) :\n     *   $http.post('/someUrl', {msg:'hello word!'}).\n     *     success(function(data, status, headers, config) {\n     *       // this callback will be called asynchronously\n     *       // when the response is available\n     *     }).\n     *     error(function(data, status, headers, config) {\n     *       // called asynchronously if an error occurs\n     *       // or server returns response with an error status.\n     *     });\n     * ```\n     *\n     *\n     * Since the returned value of calling the $http function is a `promise`, you can also use\n     * the `then` method to register callbacks, and these callbacks will receive a single argument –\n     * an object representing the response. See the API signature and type info below for more\n     * details.\n     *\n     * A response status code between 200 and 299 is considered a success status and\n     * will result in the success callback being called. Note that if the response is a redirect,\n     * XMLHttpRequest will transparently follow it, meaning that the error callback will not be\n     * called for such responses.\n     *\n     * ## Writing Unit Tests that use $http\n     * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n     * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n     * request using trained responses.\n     *\n     * ```\n     * $httpBackend.expectGET(...);\n     * $http.get(...);\n     * $httpBackend.flush();\n     * ```\n     *\n     * ## Shortcut methods\n     *\n     * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n     * request data must be passed in for POST/PUT requests.\n     *\n     * ```js\n     *   $http.get('/someUrl').success(successCallback);\n     *   $http.post('/someUrl', data).success(successCallback);\n     * ```\n     *\n     * Complete list of shortcut methods:\n     *\n     * - {@link ng.$http#get $http.get}\n     * - {@link ng.$http#head $http.head}\n     * - {@link ng.$http#post $http.post}\n     * - {@link ng.$http#put $http.put}\n     * - {@link ng.$http#delete $http.delete}\n     * - {@link ng.$http#jsonp $http.jsonp}\n     * - {@link ng.$http#patch $http.patch}\n     *\n     *\n     * ## Setting HTTP Headers\n     *\n     * The $http service will automatically add certain HTTP headers to all requests. These defaults\n     * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n     * object, which currently contains this default configuration:\n     *\n     * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n     *   - `Accept: application/json, text/plain, * / *`\n     * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n     *   - `Content-Type: application/json`\n     * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n     *   - `Content-Type: application/json`\n     *\n     * To add or overwrite these defaults, simply add or remove a property from these configuration\n     * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n     * with the lowercased HTTP method name as the key, e.g.\n     * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.\n     *\n     * The defaults can also be set at runtime via the `$http.defaults` object in the same\n     * fashion. For example:\n     *\n     * ```\n     * module.run(function($http) {\n     *   $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'\n     * });\n     * ```\n     *\n     * In addition, you can supply a `headers` property in the config object passed when\n     * calling `$http(config)`, which overrides the defaults without changing them globally.\n     *\n     * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n     * Use the `headers` property, setting the desired header to `undefined`. For example:\n     *\n     * ```js\n     * var req = {\n     *  method: 'POST',\n     *  url: 'http://example.com',\n     *  headers: {\n     *    'Content-Type': undefined\n     *  },\n     *  data: { test: 'test' },\n     * }\n     *\n     * $http(req).success(function(){...}).error(function(){...});\n     * ```\n     *\n     * ## Transforming Requests and Responses\n     *\n     * Both requests and responses can be transformed using transformation functions: `transformRequest`\n     * and `transformResponse`. These properties can be a single function that returns\n     * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n     * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n     *\n     * ### Default Transformations\n     *\n     * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n     * `defaults.transformResponse` properties. If a request does not provide its own transformations\n     * then these will be applied.\n     *\n     * You can augment or replace the default transformations by modifying these properties by adding to or\n     * replacing the array.\n     *\n     * Angular provides the following default transformations:\n     *\n     * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):\n     *\n     * - If the `data` property of the request configuration object contains an object, serialize it\n     *   into JSON format.\n     *\n     * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):\n     *\n     *  - If XSRF prefix is detected, strip it (see Security Considerations section below).\n     *  - If JSON response is detected, deserialize it using a JSON parser.\n     *\n     *\n     * ### Overriding the Default Transformations Per Request\n     *\n     * If you wish override the request/response transformations only for a single request then provide\n     * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n     * into `$http`.\n     *\n     * Note that if you provide these properties on the config object the default transformations will be\n     * overwritten. If you wish to augment the default transformations then you must include them in your\n     * local transformation array.\n     *\n     * The following code demonstrates adding a new response transformation to be run after the default response\n     * transformations have been run.\n     *\n     * ```js\n     * function appendTransform(defaults, transform) {\n     *\n     *   // We can't guarantee that the default transformation is an array\n     *   defaults = angular.isArray(defaults) ? defaults : [defaults];\n     *\n     *   // Append the new transformation to the defaults\n     *   return defaults.concat(transform);\n     * }\n     *\n     * $http({\n     *   url: '...',\n     *   method: 'GET',\n     *   transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n     *     return doTransform(value);\n     *   })\n     * });\n     * ```\n     *\n     *\n     * ## Caching\n     *\n     * To enable caching, set the request configuration `cache` property to `true` (to use default\n     * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).\n     * When the cache is enabled, `$http` stores the response from the server in the specified\n     * cache. The next time the same request is made, the response is served from the cache without\n     * sending a request to the server.\n     *\n     * Note that even if the response is served from cache, delivery of the data is asynchronous in\n     * the same way that real requests are.\n     *\n     * If there are multiple GET requests for the same URL that should be cached using the same\n     * cache, but the cache is not populated yet, only one request to the server will be made and\n     * the remaining requests will be fulfilled using the response from the first request.\n     *\n     * You can change the default cache to a new object (built with\n     * {@link ng.$cacheFactory `$cacheFactory`}) by updating the\n     * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set\n     * their `cache` property to `true` will now use this cache object.\n     *\n     * If you set the default cache to `false` then only requests that specify their own custom\n     * cache object will be cached.\n     *\n     * ## Interceptors\n     *\n     * Before you start creating interceptors, be sure to understand the\n     * {@link ng.$q $q and deferred/promise APIs}.\n     *\n     * For purposes of global error handling, authentication, or any kind of synchronous or\n     * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n     * able to intercept requests before they are handed to the server and\n     * responses before they are handed over to the application code that\n     * initiated these requests. The interceptors leverage the {@link ng.$q\n     * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n     *\n     * The interceptors are service factories that are registered with the `$httpProvider` by\n     * adding them to the `$httpProvider.interceptors` array. The factory is called and\n     * injected with dependencies (if specified) and returns the interceptor.\n     *\n     * There are two kinds of interceptors (and two kinds of rejection interceptors):\n     *\n     *   * `request`: interceptors get called with a http `config` object. The function is free to\n     *     modify the `config` object or create a new one. The function needs to return the `config`\n     *     object directly, or a promise containing the `config` or a new `config` object.\n     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or\n     *     resolved with a rejection.\n     *   * `response`: interceptors get called with http `response` object. The function is free to\n     *     modify the `response` object or create a new one. The function needs to return the `response`\n     *     object directly, or as a promise containing the `response` or a new `response` object.\n     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or\n     *     resolved with a rejection.\n     *\n     *\n     * ```js\n     *   // register the interceptor as a service\n     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n     *     return {\n     *       // optional method\n     *       'request': function(config) {\n     *         // do something on success\n     *         return config;\n     *       },\n     *\n     *       // optional method\n     *      'requestError': function(rejection) {\n     *         // do something on error\n     *         if (canRecover(rejection)) {\n     *           return responseOrNewPromise\n     *         }\n     *         return $q.reject(rejection);\n     *       },\n     *\n     *\n     *\n     *       // optional method\n     *       'response': function(response) {\n     *         // do something on success\n     *         return response;\n     *       },\n     *\n     *       // optional method\n     *      'responseError': function(rejection) {\n     *         // do something on error\n     *         if (canRecover(rejection)) {\n     *           return responseOrNewPromise\n     *         }\n     *         return $q.reject(rejection);\n     *       }\n     *     };\n     *   });\n     *\n     *   $httpProvider.interceptors.push('myHttpInterceptor');\n     *\n     *\n     *   // alternatively, register the interceptor via an anonymous factory\n     *   $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n     *     return {\n     *      'request': function(config) {\n     *          // same as above\n     *       },\n     *\n     *       'response': function(response) {\n     *          // same as above\n     *       }\n     *     };\n     *   });\n     * ```\n     *\n     * ## Security Considerations\n     *\n     * When designing web applications, consider security threats from:\n     *\n     * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n     * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n     *\n     * Both server and the client must cooperate in order to eliminate these threats. Angular comes\n     * pre-configured with strategies that address these issues, but for this to work backend server\n     * cooperation is required.\n     *\n     * ### JSON Vulnerability Protection\n     *\n     * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n     * allows third party website to turn your JSON resource URL into\n     * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n     * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n     * Angular will automatically strip the prefix before processing it as JSON.\n     *\n     * For example if your server needs to return:\n     * ```js\n     * ['one','two']\n     * ```\n     *\n     * which is vulnerable to attack, your server can return:\n     * ```js\n     * )]}',\n     * ['one','two']\n     * ```\n     *\n     * Angular will strip the prefix, before processing the JSON.\n     *\n     *\n     * ### Cross Site Request Forgery (XSRF) Protection\n     *\n     * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which\n     * an unauthorized site can gain your user's private data. Angular provides a mechanism\n     * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie\n     * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only\n     * JavaScript that runs on your domain could read the cookie, your server can be assured that\n     * the XHR came from JavaScript running on your domain. The header will not be set for\n     * cross-domain requests.\n     *\n     * To take advantage of this, your server needs to set a token in a JavaScript readable session\n     * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n     * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure\n     * that only JavaScript running on your domain could have sent the request. The token must be\n     * unique for each user and must be verifiable by the server (to prevent the JavaScript from\n     * making up its own tokens). We recommend that the token is a digest of your site's\n     * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography&#41;)\n     * for added security.\n     *\n     * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName\n     * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,\n     * or the per-request config object.\n     *\n     *\n     * @param {object} config Object describing the request to be made and how it should be\n     *    processed. The object has following properties:\n     *\n     *    - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n     *    - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.\n     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned\n     *      to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be\n     *      JSONified.\n     *    - **data** – `{string|Object}` – Data to be sent as the request message data.\n     *    - **headers** – `{Object}` – Map of strings or functions which return strings representing\n     *      HTTP headers to send to the server. If the return value of a function is null, the\n     *      header will not be sent.\n     *    - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n     *    - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n     *    - **transformRequest** –\n     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n     *      transform function or an array of such functions. The transform function takes the http\n     *      request body and headers and returns its transformed (typically serialized) version.\n     *      See {@link ng.$http#overriding-the-default-transformations-per-request\n     *      Overriding the Default Transformations}\n     *    - **transformResponse** –\n     *      `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –\n     *      transform function or an array of such functions. The transform function takes the http\n     *      response body, headers and status and returns its transformed (typically deserialized) version.\n     *      See {@link ng.$http#overriding-the-default-transformations-per-request\n     *      Overriding the Default Transformations}\n     *    - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the\n     *      GET request, otherwise if a cache instance built with\n     *      {@link ng.$cacheFactory $cacheFactory}, this cache will be used for\n     *      caching.\n     *    - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n     *      that should abort the request when resolved.\n     *    - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n     *      XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n     *      for more information.\n     *    - **responseType** - `{string}` - see\n     *      [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).\n     *\n     * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the\n     *   standard `then` method and two http specific methods: `success` and `error`. The `then`\n     *   method takes two arguments a success and an error callback which will be called with a\n     *   response object. The `success` and `error` methods take a single argument - a function that\n     *   will be called when the request succeeds or fails respectively. The arguments passed into\n     *   these functions are destructured representation of the response object passed into the\n     *   `then` method. The response object has these properties:\n     *\n     *   - **data** – `{string|Object}` – The response body transformed with the transform\n     *     functions.\n     *   - **status** – `{number}` – HTTP status code of the response.\n     *   - **headers** – `{function([headerName])}` – Header getter function.\n     *   - **config** – `{Object}` – The configuration object that was used to generate the request.\n     *   - **statusText** – `{string}` – HTTP status text of the response.\n     *\n     * @property {Array.<Object>} pendingRequests Array of config objects for currently pending\n     *   requests. This is primarily meant to be used for debugging purposes.\n     *\n     *\n     * @example\n<example module=\"httpExample\">\n<file name=\"index.html\">\n  <div ng-controller=\"FetchController\">\n    <select ng-model=\"method\">\n      <option>GET</option>\n      <option>JSONP</option>\n    </select>\n    <input type=\"text\" ng-model=\"url\" size=\"80\"/>\n    <button id=\"fetchbtn\" ng-click=\"fetch()\">fetch</button><br>\n    <button id=\"samplegetbtn\" ng-click=\"updateModel('GET', 'http-hello.html')\">Sample GET</button>\n    <button id=\"samplejsonpbtn\"\n      ng-click=\"updateModel('JSONP',\n                    'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')\">\n      Sample JSONP\n    </button>\n    <button id=\"invalidjsonpbtn\"\n      ng-click=\"updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')\">\n        Invalid JSONP\n      </button>\n    <pre>http status code: {{status}}</pre>\n    <pre>http response data: {{data}}</pre>\n  </div>\n</file>\n<file name=\"script.js\">\n  angular.module('httpExample', [])\n    .controller('FetchController', ['$scope', '$http', '$templateCache',\n      function($scope, $http, $templateCache) {\n        $scope.method = 'GET';\n        $scope.url = 'http-hello.html';\n\n        $scope.fetch = function() {\n          $scope.code = null;\n          $scope.response = null;\n\n          $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n            success(function(data, status) {\n              $scope.status = status;\n              $scope.data = data;\n            }).\n            error(function(data, status) {\n              $scope.data = data || \"Request failed\";\n              $scope.status = status;\n          });\n        };\n\n        $scope.updateModel = function(method, url) {\n          $scope.method = method;\n          $scope.url = url;\n        };\n      }]);\n</file>\n<file name=\"http-hello.html\">\n  Hello, $http!\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n  var status = element(by.binding('status'));\n  var data = element(by.binding('data'));\n  var fetchBtn = element(by.id('fetchbtn'));\n  var sampleGetBtn = element(by.id('samplegetbtn'));\n  var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n  var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n  it('should make an xhr GET request', function() {\n    sampleGetBtn.click();\n    fetchBtn.click();\n    expect(status.getText()).toMatch('200');\n    expect(data.getText()).toMatch(/Hello, \\$http!/);\n  });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n//   sampleJsonpBtn.click();\n//   fetchBtn.click();\n//   expect(status.getText()).toMatch('200');\n//   expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n  it('should make JSONP request to invalid URL and invoke the error handler',\n      function() {\n    invalidJsonpBtn.click();\n    fetchBtn.click();\n    expect(status.getText()).toMatch('0');\n    expect(data.getText()).toMatch('Request failed');\n  });\n</file>\n</example>\n     */\n    function $http(requestConfig) {\n\n      if (!angular.isObject(requestConfig)) {\n        throw minErr('$http')('badreq', 'Http request configuration must be an object.  Received: {0}', requestConfig);\n      }\n\n      var config = extend({\n        method: 'get',\n        transformRequest: defaults.transformRequest,\n        transformResponse: defaults.transformResponse\n      }, requestConfig);\n\n      config.headers = mergeHeaders(requestConfig);\n      config.method = uppercase(config.method);\n\n      var serverRequest = function(config) {\n        var headers = config.headers;\n        var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n        // strip content-type if data is undefined\n        if (isUndefined(reqData)) {\n          forEach(headers, function(value, header) {\n            if (lowercase(header) === 'content-type') {\n                delete headers[header];\n            }\n          });\n        }\n\n        if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n          config.withCredentials = defaults.withCredentials;\n        }\n\n        // send request\n        return sendReq(config, reqData).then(transformResponse, transformResponse);\n      };\n\n      var chain = [serverRequest, undefined];\n      var promise = $q.when(config);\n\n      // apply interceptors\n      forEach(reversedInterceptors, function(interceptor) {\n        if (interceptor.request || interceptor.requestError) {\n          chain.unshift(interceptor.request, interceptor.requestError);\n        }\n        if (interceptor.response || interceptor.responseError) {\n          chain.push(interceptor.response, interceptor.responseError);\n        }\n      });\n\n      while (chain.length) {\n        var thenFn = chain.shift();\n        var rejectFn = chain.shift();\n\n        promise = promise.then(thenFn, rejectFn);\n      }\n\n      promise.success = function(fn) {\n        promise.then(function(response) {\n          fn(response.data, response.status, response.headers, config);\n        });\n        return promise;\n      };\n\n      promise.error = function(fn) {\n        promise.then(null, function(response) {\n          fn(response.data, response.status, response.headers, config);\n        });\n        return promise;\n      };\n\n      return promise;\n\n      function transformResponse(response) {\n        // make a copy since the response must be cacheable\n        var resp = extend({}, response);\n        if (!response.data) {\n          resp.data = response.data;\n        } else {\n          resp.data = transformData(response.data, response.headers, response.status, config.transformResponse);\n        }\n        return (isSuccess(response.status))\n          ? resp\n          : $q.reject(resp);\n      }\n\n      function executeHeaderFns(headers) {\n        var headerContent, processedHeaders = {};\n\n        forEach(headers, function(headerFn, header) {\n          if (isFunction(headerFn)) {\n            headerContent = headerFn();\n            if (headerContent != null) {\n              processedHeaders[header] = headerContent;\n            }\n          } else {\n            processedHeaders[header] = headerFn;\n          }\n        });\n\n        return processedHeaders;\n      }\n\n      function mergeHeaders(config) {\n        var defHeaders = defaults.headers,\n            reqHeaders = extend({}, config.headers),\n            defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n        defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n        // using for-in instead of forEach to avoid unecessary iteration after header has been found\n        defaultHeadersIteration:\n        for (defHeaderName in defHeaders) {\n          lowercaseDefHeaderName = lowercase(defHeaderName);\n\n          for (reqHeaderName in reqHeaders) {\n            if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n              continue defaultHeadersIteration;\n            }\n          }\n\n          reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n        }\n\n        // execute if header value is a function for merged headers\n        return executeHeaderFns(reqHeaders);\n      }\n    }\n\n    $http.pendingRequests = [];\n\n    /**\n     * @ngdoc method\n     * @name $http#get\n     *\n     * @description\n     * Shortcut method to perform `GET` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#delete\n     *\n     * @description\n     * Shortcut method to perform `DELETE` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#head\n     *\n     * @description\n     * Shortcut method to perform `HEAD` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#jsonp\n     *\n     * @description\n     * Shortcut method to perform `JSONP` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request.\n     *                     The name of the callback should be the string `JSON_CALLBACK`.\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n    createShortMethods('get', 'delete', 'head', 'jsonp');\n\n    /**\n     * @ngdoc method\n     * @name $http#post\n     *\n     * @description\n     * Shortcut method to perform `POST` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {*} data Request content\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#put\n     *\n     * @description\n     * Shortcut method to perform `PUT` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {*} data Request content\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n     /**\n      * @ngdoc method\n      * @name $http#patch\n      *\n      * @description\n      * Shortcut method to perform `PATCH` request.\n      *\n      * @param {string} url Relative or absolute URL specifying the destination of the request\n      * @param {*} data Request content\n      * @param {Object=} config Optional configuration object\n      * @returns {HttpPromise} Future object\n      */\n    createShortMethodsWithData('post', 'put', 'patch');\n\n        /**\n         * @ngdoc property\n         * @name $http#defaults\n         *\n         * @description\n         * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n         * default headers, withCredentials as well as request and response transformations.\n         *\n         * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n         */\n    $http.defaults = defaults;\n\n\n    return $http;\n\n\n    function createShortMethods(names) {\n      forEach(arguments, function(name) {\n        $http[name] = function(url, config) {\n          return $http(extend(config || {}, {\n            method: name,\n            url: url\n          }));\n        };\n      });\n    }\n\n\n    function createShortMethodsWithData(name) {\n      forEach(arguments, function(name) {\n        $http[name] = function(url, data, config) {\n          return $http(extend(config || {}, {\n            method: name,\n            url: url,\n            data: data\n          }));\n        };\n      });\n    }\n\n\n    /**\n     * Makes the request.\n     *\n     * !!! ACCESSES CLOSURE VARS:\n     * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n     */\n    function sendReq(config, reqData) {\n      var deferred = $q.defer(),\n          promise = deferred.promise,\n          cache,\n          cachedResp,\n          reqHeaders = config.headers,\n          url = buildUrl(config.url, config.params);\n\n      $http.pendingRequests.push(config);\n      promise.then(removePendingReq, removePendingReq);\n\n\n      if ((config.cache || defaults.cache) && config.cache !== false &&\n          (config.method === 'GET' || config.method === 'JSONP')) {\n        cache = isObject(config.cache) ? config.cache\n              : isObject(defaults.cache) ? defaults.cache\n              : defaultCache;\n      }\n\n      if (cache) {\n        cachedResp = cache.get(url);\n        if (isDefined(cachedResp)) {\n          if (isPromiseLike(cachedResp)) {\n            // cached request has already been sent, but there is no response yet\n            cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n          } else {\n            // serving from cache\n            if (isArray(cachedResp)) {\n              resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n            } else {\n              resolvePromise(cachedResp, 200, {}, 'OK');\n            }\n          }\n        } else {\n          // put the promise for the non-transformed response into cache as a placeholder\n          cache.put(url, promise);\n        }\n      }\n\n\n      // if we won't have the response in cache, set the xsrf headers and\n      // send the request to the backend\n      if (isUndefined(cachedResp)) {\n        var xsrfValue = urlIsSameOrigin(config.url)\n            ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n            : undefined;\n        if (xsrfValue) {\n          reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n        }\n\n        $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n            config.withCredentials, config.responseType);\n      }\n\n      return promise;\n\n\n      /**\n       * Callback registered to $httpBackend():\n       *  - caches the response if desired\n       *  - resolves the raw $http promise\n       *  - calls $apply\n       */\n      function done(status, response, headersString, statusText) {\n        if (cache) {\n          if (isSuccess(status)) {\n            cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n          } else {\n            // remove promise from the cache\n            cache.remove(url);\n          }\n        }\n\n        function resolveHttpPromise() {\n          resolvePromise(response, status, headersString, statusText);\n        }\n\n        if (useApplyAsync) {\n          $rootScope.$applyAsync(resolveHttpPromise);\n        } else {\n          resolveHttpPromise();\n          if (!$rootScope.$$phase) $rootScope.$apply();\n        }\n      }\n\n\n      /**\n       * Resolves the raw $http promise.\n       */\n      function resolvePromise(response, status, headers, statusText) {\n        // normalize internal statuses to 0\n        status = Math.max(status, 0);\n\n        (isSuccess(status) ? deferred.resolve : deferred.reject)({\n          data: response,\n          status: status,\n          headers: headersGetter(headers),\n          config: config,\n          statusText: statusText\n        });\n      }\n\n      function resolvePromiseWithResult(result) {\n        resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n      }\n\n      function removePendingReq() {\n        var idx = $http.pendingRequests.indexOf(config);\n        if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n      }\n    }\n\n\n    function buildUrl(url, params) {\n      if (!params) return url;\n      var parts = [];\n      forEachSorted(params, function(value, key) {\n        if (value === null || isUndefined(value)) return;\n        if (!isArray(value)) value = [value];\n\n        forEach(value, function(v) {\n          if (isObject(v)) {\n            if (isDate(v)) {\n              v = v.toISOString();\n            } else {\n              v = toJson(v);\n            }\n          }\n          parts.push(encodeUriQuery(key) + '=' +\n                     encodeUriQuery(v));\n        });\n      });\n      if (parts.length > 0) {\n        url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');\n      }\n      return url;\n    }\n  }];\n}\n\nfunction createXhr() {\n    return new window.XMLHttpRequest();\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $window\n * @requires $document\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n  this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {\n    return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]);\n  }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n  // TODO(vojta): fix the signature\n  return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {\n    $browser.$$incOutstandingRequestCount();\n    url = url || $browser.url();\n\n    if (lowercase(method) == 'jsonp') {\n      var callbackId = '_' + (callbacks.counter++).toString(36);\n      callbacks[callbackId] = function(data) {\n        callbacks[callbackId].data = data;\n        callbacks[callbackId].called = true;\n      };\n\n      var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),\n          callbackId, function(status, text) {\n        completeRequest(callback, status, callbacks[callbackId].data, \"\", text);\n        callbacks[callbackId] = noop;\n      });\n    } else {\n\n      var xhr = createXhr();\n\n      xhr.open(method, url, true);\n      forEach(headers, function(value, key) {\n        if (isDefined(value)) {\n            xhr.setRequestHeader(key, value);\n        }\n      });\n\n      xhr.onload = function requestLoaded() {\n        var statusText = xhr.statusText || '';\n\n        // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n        // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n        var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n        // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n        var status = xhr.status === 1223 ? 204 : xhr.status;\n\n        // fix status code when it is 0 (0 status is undocumented).\n        // Occurs when accessing file resources or on Android 4.1 stock browser\n        // while retrieving files from application cache.\n        if (status === 0) {\n          status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;\n        }\n\n        completeRequest(callback,\n            status,\n            response,\n            xhr.getAllResponseHeaders(),\n            statusText);\n      };\n\n      var requestError = function() {\n        // The response is always empty\n        // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n        completeRequest(callback, -1, null, null, '');\n      };\n\n      xhr.onerror = requestError;\n      xhr.onabort = requestError;\n\n      if (withCredentials) {\n        xhr.withCredentials = true;\n      }\n\n      if (responseType) {\n        try {\n          xhr.responseType = responseType;\n        } catch (e) {\n          // WebKit added support for the json responseType value on 09/03/2013\n          // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n          // known to throw when setting the value \"json\" as the response type. Other older\n          // browsers implementing the responseType\n          //\n          // The json response type can be ignored if not supported, because JSON payloads are\n          // parsed on the client-side regardless.\n          if (responseType !== 'json') {\n            throw e;\n          }\n        }\n      }\n\n      xhr.send(post || null);\n    }\n\n    if (timeout > 0) {\n      var timeoutId = $browserDefer(timeoutRequest, timeout);\n    } else if (isPromiseLike(timeout)) {\n      timeout.then(timeoutRequest);\n    }\n\n\n    function timeoutRequest() {\n      jsonpDone && jsonpDone();\n      xhr && xhr.abort();\n    }\n\n    function completeRequest(callback, status, response, headersString, statusText) {\n      // cancel timeout and subsequent timeout promise resolution\n      if (timeoutId !== undefined) {\n        $browserDefer.cancel(timeoutId);\n      }\n      jsonpDone = xhr = null;\n\n      callback(status, response, headersString, statusText);\n      $browser.$$completeOutstandingRequest(noop);\n    }\n  };\n\n  function jsonpReq(url, callbackId, done) {\n    // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:\n    // - fetches local scripts via XHR and evals them\n    // - adds and immediately removes script elements from the document\n    var script = rawDocument.createElement('script'), callback = null;\n    script.type = \"text/javascript\";\n    script.src = url;\n    script.async = true;\n\n    callback = function(event) {\n      removeEventListenerFn(script, \"load\", callback);\n      removeEventListenerFn(script, \"error\", callback);\n      rawDocument.body.removeChild(script);\n      script = null;\n      var status = -1;\n      var text = \"unknown\";\n\n      if (event) {\n        if (event.type === \"load\" && !callbacks[callbackId].called) {\n          event = { type: \"error\" };\n        }\n        text = event.type;\n        status = event.type === \"error\" ? 404 : 200;\n      }\n\n      if (done) {\n        done(status, text);\n      }\n    };\n\n    addEventListenerFn(script, \"load\", callback);\n    addEventListenerFn(script, \"error\", callback);\n    rawDocument.body.appendChild(script);\n    return callback;\n  }\n}\n\nvar $interpolateMinErr = minErr('$interpolate');\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n * @example\n<example module=\"customInterpolationApp\">\n<file name=\"index.html\">\n<script>\n  var customInterpolationApp = angular.module('customInterpolationApp', []);\n\n  customInterpolationApp.config(function($interpolateProvider) {\n    $interpolateProvider.startSymbol('//');\n    $interpolateProvider.endSymbol('//');\n  });\n\n\n  customInterpolationApp.controller('DemoController', function() {\n      this.label = \"This binding is brought you by // interpolation symbols.\";\n  });\n</script>\n<div ng-app=\"App\" ng-controller=\"DemoController as demo\">\n    //demo.label//\n</div>\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n  it('should interpolate binding with custom symbols', function() {\n    expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n  });\n</file>\n</example>\n */\nfunction $InterpolateProvider() {\n  var startSymbol = '{{';\n  var endSymbol = '}}';\n\n  /**\n   * @ngdoc method\n   * @name $interpolateProvider#startSymbol\n   * @description\n   * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n   *\n   * @param {string=} value new value to set the starting symbol to.\n   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n   */\n  this.startSymbol = function(value) {\n    if (value) {\n      startSymbol = value;\n      return this;\n    } else {\n      return startSymbol;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $interpolateProvider#endSymbol\n   * @description\n   * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n   *\n   * @param {string=} value new value to set the ending symbol to.\n   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n   */\n  this.endSymbol = function(value) {\n    if (value) {\n      endSymbol = value;\n      return this;\n    } else {\n      return endSymbol;\n    }\n  };\n\n\n  this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n    var startSymbolLength = startSymbol.length,\n        endSymbolLength = endSymbol.length,\n        escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n        escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n    function escape(ch) {\n      return '\\\\\\\\\\\\' + ch;\n    }\n\n    /**\n     * @ngdoc service\n     * @name $interpolate\n     * @kind function\n     *\n     * @requires $parse\n     * @requires $sce\n     *\n     * @description\n     *\n     * Compiles a string with markup into an interpolation function. This service is used by the\n     * HTML {@link ng.$compile $compile} service for data binding. See\n     * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n     * interpolation markup.\n     *\n     *\n     * ```js\n     *   var $interpolate = ...; // injected\n     *   var exp = $interpolate('Hello {{name | uppercase}}!');\n     *   expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!');\n     * ```\n     *\n     * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n     * `true`, the interpolation function will return `undefined` unless all embedded expressions\n     * evaluate to a value other than `undefined`.\n     *\n     * ```js\n     *   var $interpolate = ...; // injected\n     *   var context = {greeting: 'Hello', name: undefined };\n     *\n     *   // default \"forgiving\" mode\n     *   var exp = $interpolate('{{greeting}} {{name}}!');\n     *   expect(exp(context)).toEqual('Hello !');\n     *\n     *   // \"allOrNothing\" mode\n     *   exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n     *   expect(exp(context)).toBeUndefined();\n     *   context.name = 'Angular';\n     *   expect(exp(context)).toEqual('Hello Angular!');\n     * ```\n     *\n     * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n     *\n     * ####Escaped Interpolation\n     * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n     * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n     * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n     * or binding.\n     *\n     * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n     * degree, while also enabling code examples to work without relying on the\n     * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n     *\n     * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n     * replacing angle brackets (&lt;, &gt;) with &amp;lt; and &amp;gt; respectively, and replacing all\n     * interpolation start/end markers with their escaped counterparts.**\n     *\n     * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n     * output when the $interpolate service processes the text. So, for HTML elements interpolated\n     * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n     * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n     * this is typically useful only when user-data is used in rendering a template from the server, or\n     * when otherwise untrusted data is used by a directive.\n     *\n     * <example>\n     *  <file name=\"index.html\">\n     *    <div ng-init=\"username='A user'\">\n     *      <p ng-init=\"apptitle='Escaping demo'\">{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n     *        </p>\n     *      <p><strong>{{username}}</strong> attempts to inject code which will deface the\n     *        application, but fails to accomplish their task, because the server has correctly\n     *        escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n     *        characters.</p>\n     *      <p>Instead, the result of the attempted script injection is visible, and can be removed\n     *        from the database by an administrator.</p>\n     *    </div>\n     *  </file>\n     * </example>\n     *\n     * @param {string} text The text with markup to interpolate.\n     * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n     *    embedded expression in order to return an interpolation function. Strings with no\n     *    embedded expression will return null for the interpolation function.\n     * @param {string=} trustedContext when provided, the returned function passes the interpolated\n     *    result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n     *    trustedContext)} before returning it.  Refer to the {@link ng.$sce $sce} service that\n     *    provides Strict Contextual Escaping for details.\n     * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n     *    unless all embedded expressions evaluate to a value other than `undefined`.\n     * @returns {function(context)} an interpolation function which is used to compute the\n     *    interpolated string. The function has these parameters:\n     *\n     * - `context`: evaluation context for all expressions embedded in the interpolated text\n     */\n    function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n      allOrNothing = !!allOrNothing;\n      var startIndex,\n          endIndex,\n          index = 0,\n          expressions = [],\n          parseFns = [],\n          textLength = text.length,\n          exp,\n          concat = [],\n          expressionPositions = [];\n\n      while (index < textLength) {\n        if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&\n             ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {\n          if (index !== startIndex) {\n            concat.push(unescapeText(text.substring(index, startIndex)));\n          }\n          exp = text.substring(startIndex + startSymbolLength, endIndex);\n          expressions.push(exp);\n          parseFns.push($parse(exp, parseStringifyInterceptor));\n          index = endIndex + endSymbolLength;\n          expressionPositions.push(concat.length);\n          concat.push('');\n        } else {\n          // we did not find an interpolation, so we have to add the remainder to the separators array\n          if (index !== textLength) {\n            concat.push(unescapeText(text.substring(index)));\n          }\n          break;\n        }\n      }\n\n      // Concatenating expressions makes it hard to reason about whether some combination of\n      // concatenated values are unsafe to use and could easily lead to XSS.  By requiring that a\n      // single expression be used for iframe[src], object[src], etc., we ensure that the value\n      // that's used is assigned or constructed by some JS code somewhere that is more testable or\n      // make it obvious that you bound the value to some user controlled value.  This helps reduce\n      // the load when auditing for XSS issues.\n      if (trustedContext && concat.length > 1) {\n          throw $interpolateMinErr('noconcat',\n              \"Error while interpolating: {0}\\nStrict Contextual Escaping disallows \" +\n              \"interpolations that concatenate multiple expressions when a trusted value is \" +\n              \"required.  See http://docs.angularjs.org/api/ng.$sce\", text);\n      }\n\n      if (!mustHaveExpression || expressions.length) {\n        var compute = function(values) {\n          for (var i = 0, ii = expressions.length; i < ii; i++) {\n            if (allOrNothing && isUndefined(values[i])) return;\n            concat[expressionPositions[i]] = values[i];\n          }\n          return concat.join('');\n        };\n\n        var getValue = function(value) {\n          return trustedContext ?\n            $sce.getTrusted(trustedContext, value) :\n            $sce.valueOf(value);\n        };\n\n        var stringify = function(value) {\n          if (value == null) { // null || undefined\n            return '';\n          }\n          switch (typeof value) {\n            case 'string':\n              break;\n            case 'number':\n              value = '' + value;\n              break;\n            default:\n              value = toJson(value);\n          }\n\n          return value;\n        };\n\n        return extend(function interpolationFn(context) {\n            var i = 0;\n            var ii = expressions.length;\n            var values = new Array(ii);\n\n            try {\n              for (; i < ii; i++) {\n                values[i] = parseFns[i](context);\n              }\n\n              return compute(values);\n            } catch (err) {\n              var newErr = $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text,\n                  err.toString());\n              $exceptionHandler(newErr);\n            }\n\n          }, {\n          // all of these properties are undocumented for now\n          exp: text, //just for compatibility with regular watchers created via $watch\n          expressions: expressions,\n          $$watchDelegate: function(scope, listener, objectEquality) {\n            var lastValue;\n            return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {\n              var currValue = compute(values);\n              if (isFunction(listener)) {\n                listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n              }\n              lastValue = currValue;\n            }, objectEquality);\n          }\n        });\n      }\n\n      function unescapeText(text) {\n        return text.replace(escapedStartRegexp, startSymbol).\n          replace(escapedEndRegexp, endSymbol);\n      }\n\n      function parseStringifyInterceptor(value) {\n        try {\n          value = getValue(value);\n          return allOrNothing && !isDefined(value) ? value : stringify(value);\n        } catch (err) {\n          var newErr = $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text,\n            err.toString());\n          $exceptionHandler(newErr);\n        }\n      }\n    }\n\n\n    /**\n     * @ngdoc method\n     * @name $interpolate#startSymbol\n     * @description\n     * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n     *\n     * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n     * the symbol.\n     *\n     * @returns {string} start symbol.\n     */\n    $interpolate.startSymbol = function() {\n      return startSymbol;\n    };\n\n\n    /**\n     * @ngdoc method\n     * @name $interpolate#endSymbol\n     * @description\n     * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n     *\n     * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n     * the symbol.\n     *\n     * @returns {string} end symbol.\n     */\n    $interpolate.endSymbol = function() {\n      return endSymbol;\n    };\n\n    return $interpolate;\n  }];\n}\n\nfunction $IntervalProvider() {\n  this.$get = ['$rootScope', '$window', '$q', '$$q',\n       function($rootScope,   $window,   $q,   $$q) {\n    var intervals = {};\n\n\n     /**\n      * @ngdoc service\n      * @name $interval\n      *\n      * @description\n      * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n      * milliseconds.\n      *\n      * The return value of registering an interval function is a promise. This promise will be\n      * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n      * run indefinitely if `count` is not defined. The value of the notification will be the\n      * number of iterations that have run.\n      * To cancel an interval, call `$interval.cancel(promise)`.\n      *\n      * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n      * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n      * time.\n      *\n      * <div class=\"alert alert-warning\">\n      * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n      * with them.  In particular they are not automatically destroyed when a controller's scope or a\n      * directive's element are destroyed.\n      * You should take this into consideration and make sure to always cancel the interval at the\n      * appropriate moment.  See the example below for more details on how and when to do this.\n      * </div>\n      *\n      * @param {function()} fn A function that should be called repeatedly.\n      * @param {number} delay Number of milliseconds between each function call.\n      * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n      *   indefinitely.\n      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n      * @returns {promise} A promise which will be notified on each iteration.\n      *\n      * @example\n      * <example module=\"intervalExample\">\n      * <file name=\"index.html\">\n      *   <script>\n      *     angular.module('intervalExample', [])\n      *       .controller('ExampleController', ['$scope', '$interval',\n      *         function($scope, $interval) {\n      *           $scope.format = 'M/d/yy h:mm:ss a';\n      *           $scope.blood_1 = 100;\n      *           $scope.blood_2 = 120;\n      *\n      *           var stop;\n      *           $scope.fight = function() {\n      *             // Don't start a new fight if we are already fighting\n      *             if ( angular.isDefined(stop) ) return;\n      *\n      *             stop = $interval(function() {\n      *               if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {\n      *                 $scope.blood_1 = $scope.blood_1 - 3;\n      *                 $scope.blood_2 = $scope.blood_2 - 4;\n      *               } else {\n      *                 $scope.stopFight();\n      *               }\n      *             }, 100);\n      *           };\n      *\n      *           $scope.stopFight = function() {\n      *             if (angular.isDefined(stop)) {\n      *               $interval.cancel(stop);\n      *               stop = undefined;\n      *             }\n      *           };\n      *\n      *           $scope.resetFight = function() {\n      *             $scope.blood_1 = 100;\n      *             $scope.blood_2 = 120;\n      *           };\n      *\n      *           $scope.$on('$destroy', function() {\n      *             // Make sure that the interval is destroyed too\n      *             $scope.stopFight();\n      *           });\n      *         }])\n      *       // Register the 'myCurrentTime' directive factory method.\n      *       // We inject $interval and dateFilter service since the factory method is DI.\n      *       .directive('myCurrentTime', ['$interval', 'dateFilter',\n      *         function($interval, dateFilter) {\n      *           // return the directive link function. (compile function not needed)\n      *           return function(scope, element, attrs) {\n      *             var format,  // date format\n      *                 stopTime; // so that we can cancel the time updates\n      *\n      *             // used to update the UI\n      *             function updateTime() {\n      *               element.text(dateFilter(new Date(), format));\n      *             }\n      *\n      *             // watch the expression, and update the UI on change.\n      *             scope.$watch(attrs.myCurrentTime, function(value) {\n      *               format = value;\n      *               updateTime();\n      *             });\n      *\n      *             stopTime = $interval(updateTime, 1000);\n      *\n      *             // listen on DOM destroy (removal) event, and cancel the next UI update\n      *             // to prevent updating time after the DOM element was removed.\n      *             element.on('$destroy', function() {\n      *               $interval.cancel(stopTime);\n      *             });\n      *           }\n      *         }]);\n      *   </script>\n      *\n      *   <div>\n      *     <div ng-controller=\"ExampleController\">\n      *       Date format: <input ng-model=\"format\"> <hr/>\n      *       Current time is: <span my-current-time=\"format\"></span>\n      *       <hr/>\n      *       Blood 1 : <font color='red'>{{blood_1}}</font>\n      *       Blood 2 : <font color='red'>{{blood_2}}</font>\n      *       <button type=\"button\" data-ng-click=\"fight()\">Fight</button>\n      *       <button type=\"button\" data-ng-click=\"stopFight()\">StopFight</button>\n      *       <button type=\"button\" data-ng-click=\"resetFight()\">resetFight</button>\n      *     </div>\n      *   </div>\n      *\n      * </file>\n      * </example>\n      */\n    function interval(fn, delay, count, invokeApply) {\n      var setInterval = $window.setInterval,\n          clearInterval = $window.clearInterval,\n          iteration = 0,\n          skipApply = (isDefined(invokeApply) && !invokeApply),\n          deferred = (skipApply ? $$q : $q).defer(),\n          promise = deferred.promise;\n\n      count = isDefined(count) ? count : 0;\n\n      promise.then(null, null, fn);\n\n      promise.$$intervalId = setInterval(function tick() {\n        deferred.notify(iteration++);\n\n        if (count > 0 && iteration >= count) {\n          deferred.resolve(iteration);\n          clearInterval(promise.$$intervalId);\n          delete intervals[promise.$$intervalId];\n        }\n\n        if (!skipApply) $rootScope.$apply();\n\n      }, delay);\n\n      intervals[promise.$$intervalId] = deferred;\n\n      return promise;\n    }\n\n\n     /**\n      * @ngdoc method\n      * @name $interval#cancel\n      *\n      * @description\n      * Cancels a task associated with the `promise`.\n      *\n      * @param {promise} promise returned by the `$interval` function.\n      * @returns {boolean} Returns `true` if the task was successfully canceled.\n      */\n    interval.cancel = function(promise) {\n      if (promise && promise.$$intervalId in intervals) {\n        intervals[promise.$$intervalId].reject('canceled');\n        $window.clearInterval(promise.$$intervalId);\n        delete intervals[promise.$$intervalId];\n        return true;\n      }\n      return false;\n    };\n\n    return interval;\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various Angular components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\nfunction $LocaleProvider() {\n  this.$get = function() {\n    return {\n      id: 'en-us',\n\n      NUMBER_FORMATS: {\n        DECIMAL_SEP: '.',\n        GROUP_SEP: ',',\n        PATTERNS: [\n          { // Decimal Pattern\n            minInt: 1,\n            minFrac: 0,\n            maxFrac: 3,\n            posPre: '',\n            posSuf: '',\n            negPre: '-',\n            negSuf: '',\n            gSize: 3,\n            lgSize: 3\n          },{ //Currency Pattern\n            minInt: 1,\n            minFrac: 2,\n            maxFrac: 2,\n            posPre: '\\u00A4',\n            posSuf: '',\n            negPre: '(\\u00A4',\n            negSuf: ')',\n            gSize: 3,\n            lgSize: 3\n          }\n        ],\n        CURRENCY_SYM: '$'\n      },\n\n      DATETIME_FORMATS: {\n        MONTH:\n            'January,February,March,April,May,June,July,August,September,October,November,December'\n            .split(','),\n        SHORTMONTH:  'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n        DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n        SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),\n        AMPMS: ['AM','PM'],\n        medium: 'MMM d, y h:mm:ss a',\n        'short': 'M/d/yy h:mm a',\n        fullDate: 'EEEE, MMMM d, y',\n        longDate: 'MMMM d, y',\n        mediumDate: 'MMM d, y',\n        shortDate: 'M/d/yy',\n        mediumTime: 'h:mm:ss a',\n        shortTime: 'h:mm a'\n      },\n\n      pluralCat: function(num) {\n        if (num === 1) {\n          return 'one';\n        }\n        return 'other';\n      }\n    };\n  };\n}\n\nvar PATH_MATCH = /^([^\\?#]*)(\\?([^#]*))?(#(.*))?$/,\n    DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n  var segments = path.split('/'),\n      i = segments.length;\n\n  while (i--) {\n    segments[i] = encodeUriSegment(segments[i]);\n  }\n\n  return segments.join('/');\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n  var parsedUrl = urlResolve(absoluteUrl);\n\n  locationObj.$$protocol = parsedUrl.protocol;\n  locationObj.$$host = parsedUrl.hostname;\n  locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\n\nfunction parseAppUrl(relativeUrl, locationObj) {\n  var prefixed = (relativeUrl.charAt(0) !== '/');\n  if (prefixed) {\n    relativeUrl = '/' + relativeUrl;\n  }\n  var match = urlResolve(relativeUrl);\n  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?\n      match.pathname.substring(1) : match.pathname);\n  locationObj.$$search = parseKeyValue(match.search);\n  locationObj.$$hash = decodeURIComponent(match.hash);\n\n  // make sure path starts with '/';\n  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {\n    locationObj.$$path = '/' + locationObj.$$path;\n  }\n}\n\n\n/**\n *\n * @param {string} begin\n * @param {string} whole\n * @returns {string} returns text from whole after begin or undefined if it does not begin with\n *                   expected string.\n */\nfunction beginsWith(begin, whole) {\n  if (whole.indexOf(begin) === 0) {\n    return whole.substr(begin.length);\n  }\n}\n\n\nfunction stripHash(url) {\n  var index = url.indexOf('#');\n  return index == -1 ? url : url.substr(0, index);\n}\n\nfunction trimEmptyHash(url) {\n  return url.replace(/(#.+)|#$/, '$1');\n}\n\n\nfunction stripFile(url) {\n  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n  return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents an url\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} basePrefix url path prefix\n */\nfunction LocationHtml5Url(appBase, basePrefix) {\n  this.$$html5 = true;\n  basePrefix = basePrefix || '';\n  var appBaseNoFile = stripFile(appBase);\n  parseAbsoluteUrl(appBase, this);\n\n\n  /**\n   * Parse given html5 (regular) url string into properties\n   * @param {string} url HTML5 url\n   * @private\n   */\n  this.$$parse = function(url) {\n    var pathUrl = beginsWith(appBaseNoFile, url);\n    if (!isString(pathUrl)) {\n      throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n          appBaseNoFile);\n    }\n\n    parseAppUrl(pathUrl, this);\n\n    if (!this.$$path) {\n      this.$$path = '/';\n    }\n\n    this.$$compose();\n  };\n\n  /**\n   * Compose url and update `absUrl` property\n   * @private\n   */\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'\n  };\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (relHref && relHref[0] === '#') {\n      // special case for links to hash fragments:\n      // keep the old url and only replace the hash fragment\n      this.hash(relHref.slice(1));\n      return true;\n    }\n    var appUrl, prevAppUrl;\n    var rewrittenUrl;\n\n    if ((appUrl = beginsWith(appBase, url)) !== undefined) {\n      prevAppUrl = appUrl;\n      if ((appUrl = beginsWith(basePrefix, appUrl)) !== undefined) {\n        rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl);\n      } else {\n        rewrittenUrl = appBase + prevAppUrl;\n      }\n    } else if ((appUrl = beginsWith(appBaseNoFile, url)) !== undefined) {\n      rewrittenUrl = appBaseNoFile + appUrl;\n    } else if (appBaseNoFile == url + '/') {\n      rewrittenUrl = appBaseNoFile;\n    }\n    if (rewrittenUrl) {\n      this.$$parse(rewrittenUrl);\n    }\n    return !!rewrittenUrl;\n  };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, hashPrefix) {\n  var appBaseNoFile = stripFile(appBase);\n\n  parseAbsoluteUrl(appBase, this);\n\n\n  /**\n   * Parse given hashbang url into properties\n   * @param {string} url Hashbang url\n   * @private\n   */\n  this.$$parse = function(url) {\n    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);\n    var withoutHashUrl;\n\n    if (withoutBaseUrl.charAt(0) === '#') {\n\n      // The rest of the url starts with a hash so we have\n      // got either a hashbang path or a plain hash fragment\n      withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);\n      if (isUndefined(withoutHashUrl)) {\n        // There was no hashbang prefix so we just have a hash fragment\n        withoutHashUrl = withoutBaseUrl;\n      }\n\n    } else {\n      // There was no hashbang path nor hash fragment:\n      // If we are in HTML5 mode we use what is left as the path;\n      // Otherwise we ignore what is left\n      withoutHashUrl = this.$$html5 ? withoutBaseUrl : '';\n    }\n\n    parseAppUrl(withoutHashUrl, this);\n\n    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n    this.$$compose();\n\n    /*\n     * In Windows, on an anchor node on documents loaded from\n     * the filesystem, the browser will return a pathname\n     * prefixed with the drive name ('/C:/path') when a\n     * pathname without a drive is set:\n     *  * a.setAttribute('href', '/foo')\n     *   * a.pathname === '/C:/foo' //true\n     *\n     * Inside of Angular, we're always using pathnames that\n     * do not include drive names for routing.\n     */\n    function removeWindowsDriveName(path, url, base) {\n      /*\n      Matches paths for file protocol on windows,\n      such as /C:/foo/bar, and captures only /foo/bar.\n      */\n      var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n      var firstPathSegmentMatch;\n\n      //Get the relative path from the input URL.\n      if (url.indexOf(base) === 0) {\n        url = url.replace(base, '');\n      }\n\n      // The input URL intentionally contains a first path segment that ends with a colon.\n      if (windowsFilePathExp.exec(url)) {\n        return path;\n      }\n\n      firstPathSegmentMatch = windowsFilePathExp.exec(path);\n      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n    }\n  };\n\n  /**\n   * Compose hashbang url and update `absUrl` property\n   * @private\n   */\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');\n  };\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (stripHash(appBase) == stripHash(url)) {\n      this.$$parse(url);\n      return true;\n    }\n    return false;\n  };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, hashPrefix) {\n  this.$$html5 = true;\n  LocationHashbangUrl.apply(this, arguments);\n\n  var appBaseNoFile = stripFile(appBase);\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (relHref && relHref[0] === '#') {\n      // special case for links to hash fragments:\n      // keep the old url and only replace the hash fragment\n      this.hash(relHref.slice(1));\n      return true;\n    }\n\n    var rewrittenUrl;\n    var appUrl;\n\n    if (appBase == stripHash(url)) {\n      rewrittenUrl = url;\n    } else if ((appUrl = beginsWith(appBaseNoFile, url))) {\n      rewrittenUrl = appBase + hashPrefix + appUrl;\n    } else if (appBaseNoFile === url + '/') {\n      rewrittenUrl = appBaseNoFile;\n    }\n    if (rewrittenUrl) {\n      this.$$parse(rewrittenUrl);\n    }\n    return !!rewrittenUrl;\n  };\n\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    // include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#'\n    this.$$absUrl = appBase + hashPrefix + this.$$url;\n  };\n\n}\n\n\nvar locationPrototype = {\n\n  /**\n   * Are we in html5 mode?\n   * @private\n   */\n  $$html5: false,\n\n  /**\n   * Has any change been replacing?\n   * @private\n   */\n  $$replace: false,\n\n  /**\n   * @ngdoc method\n   * @name $location#absUrl\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return full url representation with all segments encoded according to rules specified in\n   * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var absUrl = $location.absUrl();\n   * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n   * ```\n   *\n   * @return {string} full url\n   */\n  absUrl: locationGetter('$$absUrl'),\n\n  /**\n   * @ngdoc method\n   * @name $location#url\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return url (e.g. `/path?a=b#hash`) when called without any parameter.\n   *\n   * Change path, search and hash, when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var url = $location.url();\n   * // => \"/some/path?foo=bar&baz=xoxo\"\n   * ```\n   *\n   * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)\n   * @return {string} url\n   */\n  url: function(url) {\n    if (isUndefined(url))\n      return this.$$url;\n\n    var match = PATH_MATCH.exec(url);\n    if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n    if (match[2] || match[1] || url === '') this.search(match[3] || '');\n    this.hash(match[5] || '');\n\n    return this;\n  },\n\n  /**\n   * @ngdoc method\n   * @name $location#protocol\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return protocol of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var protocol = $location.protocol();\n   * // => \"http\"\n   * ```\n   *\n   * @return {string} protocol of current url\n   */\n  protocol: locationGetter('$$protocol'),\n\n  /**\n   * @ngdoc method\n   * @name $location#host\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return host of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var host = $location.host();\n   * // => \"example.com\"\n   * ```\n   *\n   * @return {string} host of current url.\n   */\n  host: locationGetter('$$host'),\n\n  /**\n   * @ngdoc method\n   * @name $location#port\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return port of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var port = $location.port();\n   * // => 80\n   * ```\n   *\n   * @return {Number} port\n   */\n  port: locationGetter('$$port'),\n\n  /**\n   * @ngdoc method\n   * @name $location#path\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return path of current url when called without any parameter.\n   *\n   * Change path when called with parameter and return `$location`.\n   *\n   * Note: Path should always begin with forward slash (/), this method will add the forward slash\n   * if it is missing.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var path = $location.path();\n   * // => \"/some/path\"\n   * ```\n   *\n   * @param {(string|number)=} path New path\n   * @return {string} path\n   */\n  path: locationGetterSetter('$$path', function(path) {\n    path = path !== null ? path.toString() : '';\n    return path.charAt(0) == '/' ? path : '/' + path;\n  }),\n\n  /**\n   * @ngdoc method\n   * @name $location#search\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return search part (as object) of current url when called without any parameter.\n   *\n   * Change search part when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var searchObject = $location.search();\n   * // => {foo: 'bar', baz: 'xoxo'}\n   *\n   * // set foo to 'yipee'\n   * $location.search('foo', 'yipee');\n   * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n   * ```\n   *\n   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or\n   * hash object.\n   *\n   * When called with a single argument the method acts as a setter, setting the `search` component\n   * of `$location` to the specified value.\n   *\n   * If the argument is a hash object containing an array of values, these values will be encoded\n   * as duplicate search parameters in the url.\n   *\n   * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n   * will override only a single search property.\n   *\n   * If `paramValue` is an array, it will override the property of the `search` component of\n   * `$location` specified via the first argument.\n   *\n   * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n   *\n   * If `paramValue` is `true`, the property specified via the first argument will be added with no\n   * value nor trailing equal sign.\n   *\n   * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n   * one or more arguments returns `$location` object itself.\n   */\n  search: function(search, paramValue) {\n    switch (arguments.length) {\n      case 0:\n        return this.$$search;\n      case 1:\n        if (isString(search) || isNumber(search)) {\n          search = search.toString();\n          this.$$search = parseKeyValue(search);\n        } else if (isObject(search)) {\n          search = copy(search, {});\n          // remove object undefined or null properties\n          forEach(search, function(value, key) {\n            if (value == null) delete search[key];\n          });\n\n          this.$$search = search;\n        } else {\n          throw $locationMinErr('isrcharg',\n              'The first argument of the `$location#search()` call must be a string or an object.');\n        }\n        break;\n      default:\n        if (isUndefined(paramValue) || paramValue === null) {\n          delete this.$$search[search];\n        } else {\n          this.$$search[search] = paramValue;\n        }\n    }\n\n    this.$$compose();\n    return this;\n  },\n\n  /**\n   * @ngdoc method\n   * @name $location#hash\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return hash fragment when called without any parameter.\n   *\n   * Change hash fragment when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n   * var hash = $location.hash();\n   * // => \"hashValue\"\n   * ```\n   *\n   * @param {(string|number)=} hash New hash fragment\n   * @return {string} hash\n   */\n  hash: locationGetterSetter('$$hash', function(hash) {\n    return hash !== null ? hash.toString() : '';\n  }),\n\n  /**\n   * @ngdoc method\n   * @name $location#replace\n   *\n   * @description\n   * If called, all changes to $location during current `$digest` will be replacing current history\n   * record, instead of adding new one.\n   */\n  replace: function() {\n    this.$$replace = true;\n    return this;\n  }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n  Location.prototype = Object.create(locationPrototype);\n\n  /**\n   * @ngdoc method\n   * @name $location#state\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return the history state object when called without any parameter.\n   *\n   * Change the history state object when called with one parameter and return `$location`.\n   * The state object is later passed to `pushState` or `replaceState`.\n   *\n   * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n   * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n   * older browsers (like IE9 or Android < 4.0), don't use this method.\n   *\n   * @param {object=} state State object for pushState or replaceState\n   * @return {object} state\n   */\n  Location.prototype.state = function(state) {\n    if (!arguments.length)\n      return this.$$state;\n\n    if (Location !== LocationHtml5Url || !this.$$html5) {\n      throw $locationMinErr('nostate', 'History API state support is available only ' +\n        'in HTML5 mode and only in browsers supporting HTML5 History API');\n    }\n    // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n    // but we're changing the $$state reference to $browser.state() during the $digest\n    // so the modification window is narrow.\n    this.$$state = isUndefined(state) ? null : state;\n\n    return this;\n  };\n});\n\n\nfunction locationGetter(property) {\n  return function() {\n    return this[property];\n  };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n  return function(value) {\n    if (isUndefined(value))\n      return this[property];\n\n    this[property] = preprocess(value);\n    this.$$compose();\n\n    return this;\n  };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n *   - Watch and observe the URL.\n *   - Change the URL.\n * - Synchronizes the URL with the browser when the user\n *   - Changes the address bar.\n *   - Clicks the back or forward button (or clicks a History link).\n *   - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n  var hashPrefix = '',\n      html5Mode = {\n        enabled: false,\n        requireBase: true,\n        rewriteLinks: true\n      };\n\n  /**\n   * @ngdoc method\n   * @name $locationProvider#hashPrefix\n   * @description\n   * @param {string=} prefix Prefix for hash part (containing path and search)\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   */\n  this.hashPrefix = function(prefix) {\n    if (isDefined(prefix)) {\n      hashPrefix = prefix;\n      return this;\n    } else {\n      return hashPrefix;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $locationProvider#html5Mode\n   * @description\n   * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n   *   If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n   *   properties:\n   *   - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n   *     change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n   *     support `pushState`.\n   *   - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n   *     whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are\n   *     true, and a base tag is not present, an error will be thrown when `$location` is injected.\n   *     See the {@link guide/$location $location guide for more information}\n   *   - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,\n   *     enables/disables url rewriting for relative links.\n   *\n   * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n   */\n  this.html5Mode = function(mode) {\n    if (isBoolean(mode)) {\n      html5Mode.enabled = mode;\n      return this;\n    } else if (isObject(mode)) {\n\n      if (isBoolean(mode.enabled)) {\n        html5Mode.enabled = mode.enabled;\n      }\n\n      if (isBoolean(mode.requireBase)) {\n        html5Mode.requireBase = mode.requireBase;\n      }\n\n      if (isBoolean(mode.rewriteLinks)) {\n        html5Mode.rewriteLinks = mode.rewriteLinks;\n      }\n\n      return this;\n    } else {\n      return html5Mode;\n    }\n  };\n\n  /**\n   * @ngdoc event\n   * @name $location#$locationChangeStart\n   * @eventType broadcast on root scope\n   * @description\n   * Broadcasted before a URL will change.\n   *\n   * This change can be prevented by calling\n   * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n   * details about event object. Upon successful change\n   * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n   *\n   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n   * the browser supports the HTML5 History API.\n   *\n   * @param {Object} angularEvent Synthetic event object.\n   * @param {string} newUrl New URL\n   * @param {string=} oldUrl URL that was before it was changed.\n   * @param {string=} newState New history state object\n   * @param {string=} oldState History state object that was before it was changed.\n   */\n\n  /**\n   * @ngdoc event\n   * @name $location#$locationChangeSuccess\n   * @eventType broadcast on root scope\n   * @description\n   * Broadcasted after a URL was changed.\n   *\n   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n   * the browser supports the HTML5 History API.\n   *\n   * @param {Object} angularEvent Synthetic event object.\n   * @param {string} newUrl New URL\n   * @param {string=} oldUrl URL that was before it was changed.\n   * @param {string=} newState New history state object\n   * @param {string=} oldState History state object that was before it was changed.\n   */\n\n  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n      function($rootScope, $browser, $sniffer, $rootElement, $window) {\n    var $location,\n        LocationMode,\n        baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n        initialUrl = $browser.url(),\n        appBase;\n\n    if (html5Mode.enabled) {\n      if (!baseHref && html5Mode.requireBase) {\n        throw $locationMinErr('nobase',\n          \"$location in HTML5 mode requires a <base> tag to be present!\");\n      }\n      appBase = serverBase(initialUrl) + (baseHref || '/');\n      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n    } else {\n      appBase = stripHash(initialUrl);\n      LocationMode = LocationHashbangUrl;\n    }\n    $location = new LocationMode(appBase, '#' + hashPrefix);\n    $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n    $location.$$state = $browser.state();\n\n    var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n    function setBrowserUrlWithFallback(url, replace, state) {\n      var oldUrl = $location.url();\n      var oldState = $location.$$state;\n      try {\n        $browser.url(url, replace, state);\n\n        // Make sure $location.state() returns referentially identical (not just deeply equal)\n        // state object; this makes possible quick checking if the state changed in the digest\n        // loop. Checking deep equality would be too expensive.\n        $location.$$state = $browser.state();\n      } catch (e) {\n        // Restore old values if pushState fails\n        $location.url(oldUrl);\n        $location.$$state = oldState;\n\n        throw e;\n      }\n    }\n\n    $rootElement.on('click', function(event) {\n      // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n      // currently we open nice url link and redirect then\n\n      if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;\n\n      var elm = jqLite(event.target);\n\n      // traverse the DOM up to find first A tag\n      while (nodeName_(elm[0]) !== 'a') {\n        // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n      }\n\n      var absHref = elm.prop('href');\n      // get the actual href attribute - see\n      // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n      var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n      if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n        // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n        // an animation.\n        absHref = urlResolve(absHref.animVal).href;\n      }\n\n      // Ignore when url is started with javascript: or mailto:\n      if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n      if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n        if ($location.$$parseLinkUrl(absHref, relHref)) {\n          // We do a preventDefault for all urls that are part of the angular application,\n          // in html5mode and also without, so that we are able to abort navigation without\n          // getting double entries in the location history.\n          event.preventDefault();\n          // update location manually\n          if ($location.absUrl() != $browser.url()) {\n            $rootScope.$apply();\n            // hack to work around FF6 bug 684208 when scenario runner clicks on links\n            $window.angular['ff-684208-preventDefault'] = true;\n          }\n        }\n      }\n    });\n\n\n    // rewrite hashbang url <> html5 url\n    if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {\n      $browser.url($location.absUrl(), true);\n    }\n\n    var initializing = true;\n\n    // update $location when $browser url changes\n    $browser.onUrlChange(function(newUrl, newState) {\n      $rootScope.$evalAsync(function() {\n        var oldUrl = $location.absUrl();\n        var oldState = $location.$$state;\n        var defaultPrevented;\n\n        $location.$$parse(newUrl);\n        $location.$$state = newState;\n\n        defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n            newState, oldState).defaultPrevented;\n\n        // if the location was changed by a `$locationChangeStart` handler then stop\n        // processing this location change\n        if ($location.absUrl() !== newUrl) return;\n\n        if (defaultPrevented) {\n          $location.$$parse(oldUrl);\n          $location.$$state = oldState;\n          setBrowserUrlWithFallback(oldUrl, false, oldState);\n        } else {\n          initializing = false;\n          afterLocationChange(oldUrl, oldState);\n        }\n      });\n      if (!$rootScope.$$phase) $rootScope.$digest();\n    });\n\n    // update browser\n    $rootScope.$watch(function $locationWatch() {\n      var oldUrl = trimEmptyHash($browser.url());\n      var newUrl = trimEmptyHash($location.absUrl());\n      var oldState = $browser.state();\n      var currentReplace = $location.$$replace;\n      var urlOrStateChanged = oldUrl !== newUrl ||\n        ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n      if (initializing || urlOrStateChanged) {\n        initializing = false;\n\n        $rootScope.$evalAsync(function() {\n          var newUrl = $location.absUrl();\n          var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n              $location.$$state, oldState).defaultPrevented;\n\n          // if the location was changed by a `$locationChangeStart` handler then stop\n          // processing this location change\n          if ($location.absUrl() !== newUrl) return;\n\n          if (defaultPrevented) {\n            $location.$$parse(oldUrl);\n            $location.$$state = oldState;\n          } else {\n            if (urlOrStateChanged) {\n              setBrowserUrlWithFallback(newUrl, currentReplace,\n                                        oldState === $location.$$state ? null : $location.$$state);\n            }\n            afterLocationChange(oldUrl, oldState);\n          }\n        });\n      }\n\n      $location.$$replace = false;\n\n      // we don't need to return anything because $evalAsync will make the digest loop dirty when\n      // there is a change\n    });\n\n    return $location;\n\n    function afterLocationChange(oldUrl, oldState) {\n      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n        $location.$$state, oldState);\n    }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n   <example module=\"logExample\">\n     <file name=\"script.js\">\n       angular.module('logExample', [])\n         .controller('LogController', ['$scope', '$log', function($scope, $log) {\n           $scope.$log = $log;\n           $scope.message = 'Hello World!';\n         }]);\n     </file>\n     <file name=\"index.html\">\n       <div ng-controller=\"LogController\">\n         <p>Reload this page with open console, enter text and hit the log button...</p>\n         Message:\n         <input type=\"text\" ng-model=\"message\"/>\n         <button ng-click=\"$log.log(message)\">log</button>\n         <button ng-click=\"$log.warn(message)\">warn</button>\n         <button ng-click=\"$log.info(message)\">info</button>\n         <button ng-click=\"$log.error(message)\">error</button>\n       </div>\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n  var debug = true,\n      self = this;\n\n  /**\n   * @ngdoc method\n   * @name $logProvider#debugEnabled\n   * @description\n   * @param {boolean=} flag enable or disable debug level messages\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   */\n  this.debugEnabled = function(flag) {\n    if (isDefined(flag)) {\n      debug = flag;\n    return this;\n    } else {\n      return debug;\n    }\n  };\n\n  this.$get = ['$window', function($window) {\n    return {\n      /**\n       * @ngdoc method\n       * @name $log#log\n       *\n       * @description\n       * Write a log message\n       */\n      log: consoleLog('log'),\n\n      /**\n       * @ngdoc method\n       * @name $log#info\n       *\n       * @description\n       * Write an information message\n       */\n      info: consoleLog('info'),\n\n      /**\n       * @ngdoc method\n       * @name $log#warn\n       *\n       * @description\n       * Write a warning message\n       */\n      warn: consoleLog('warn'),\n\n      /**\n       * @ngdoc method\n       * @name $log#error\n       *\n       * @description\n       * Write an error message\n       */\n      error: consoleLog('error'),\n\n      /**\n       * @ngdoc method\n       * @name $log#debug\n       *\n       * @description\n       * Write a debug message\n       */\n      debug: (function() {\n        var fn = consoleLog('debug');\n\n        return function() {\n          if (debug) {\n            fn.apply(self, arguments);\n          }\n        };\n      }())\n    };\n\n    function formatError(arg) {\n      if (arg instanceof Error) {\n        if (arg.stack) {\n          arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n              ? 'Error: ' + arg.message + '\\n' + arg.stack\n              : arg.stack;\n        } else if (arg.sourceURL) {\n          arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n        }\n      }\n      return arg;\n    }\n\n    function consoleLog(type) {\n      var console = $window.console || {},\n          logFn = console[type] || console.log || noop,\n          hasApply = false;\n\n      // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.\n      // The reason behind this is that console.log has type \"object\" in IE8...\n      try {\n        hasApply = !!logFn.apply;\n      } catch (e) {}\n\n      if (hasApply) {\n        return function() {\n          var args = [];\n          forEach(arguments, function(arg) {\n            args.push(formatError(arg));\n          });\n          return logFn.apply(console, args);\n        };\n      }\n\n      // we are IE which either doesn't have window.console => this is noop and we do nothing,\n      // or we are IE where console.log doesn't have apply so we log at least first 2 args\n      return function(arg1, arg2) {\n        logFn(arg1, arg2 == null ? '' : arg2);\n      };\n    }\n  }];\n}\n\nvar $parseMinErr = minErr('$parse');\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are generally considered safe because these expressions only have direct\n// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by\n// obtaining a reference to native JS functions such as the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n//   {}.toString.constructor('alert(\"evil JS code\")')\n//\n// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits\n// against the expression language, but not to prevent exploits that were enabled by exposing\n// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good\n// practice and therefore we are not even trying to protect against interaction with an object\n// explicitly exposed in this way.\n//\n// In general, it is not possible to access a Window object from an angular expression unless a\n// window or some DOM object that has a reference to window is published onto a Scope.\n// Similarly we prevent invocations of function known to be dangerous, as well as assignments to\n// native objects.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction ensureSafeMemberName(name, fullExpression) {\n  if (name === \"__defineGetter__\" || name === \"__defineSetter__\"\n      || name === \"__lookupGetter__\" || name === \"__lookupSetter__\"\n      || name === \"__proto__\") {\n    throw $parseMinErr('isecfld',\n        'Attempting to access a disallowed field in Angular expressions! '\n        + 'Expression: {0}', fullExpression);\n  }\n  return name;\n}\n\nfunction ensureSafeObject(obj, fullExpression) {\n  // nifty check if obj is Function that is fast and works across iframes and other contexts\n  if (obj) {\n    if (obj.constructor === obj) {\n      throw $parseMinErr('isecfn',\n          'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// isWindow(obj)\n        obj.window === obj) {\n      throw $parseMinErr('isecwindow',\n          'Referencing the Window in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// isElement(obj)\n        obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {\n      throw $parseMinErr('isecdom',\n          'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// block Object so that we can't get hold of dangerous Object.* methods\n        obj === Object) {\n      throw $parseMinErr('isecobj',\n          'Referencing Object in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    }\n  }\n  return obj;\n}\n\nvar CALL = Function.prototype.call;\nvar APPLY = Function.prototype.apply;\nvar BIND = Function.prototype.bind;\n\nfunction ensureSafeFunction(obj, fullExpression) {\n  if (obj) {\n    if (obj.constructor === obj) {\n      throw $parseMinErr('isecfn',\n        'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n        fullExpression);\n    } else if (obj === CALL || obj === APPLY || obj === BIND) {\n      throw $parseMinErr('isecff',\n        'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',\n        fullExpression);\n    }\n  }\n}\n\n//Keyword constants\nvar CONSTANTS = createMap();\nforEach({\n  'null': function() { return null; },\n  'true': function() { return true; },\n  'false': function() { return false; },\n  'undefined': function() {}\n}, function(constantGetter, name) {\n  constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;\n  CONSTANTS[name] = constantGetter;\n});\n\n//Not quite a constant, but can be lex/parsed the same\nCONSTANTS['this'] = function(self) { return self; };\nCONSTANTS['this'].sharedGetter = true;\n\n\n//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter\nvar OPERATORS = extend(createMap(), {\n    '+':function(self, locals, a, b) {\n      a=a(self, locals); b=b(self, locals);\n      if (isDefined(a)) {\n        if (isDefined(b)) {\n          return a + b;\n        }\n        return a;\n      }\n      return isDefined(b) ? b : undefined;},\n    '-':function(self, locals, a, b) {\n          a=a(self, locals); b=b(self, locals);\n          return (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0);\n        },\n    '*':function(self, locals, a, b) {return a(self, locals) * b(self, locals);},\n    '/':function(self, locals, a, b) {return a(self, locals) / b(self, locals);},\n    '%':function(self, locals, a, b) {return a(self, locals) % b(self, locals);},\n    '===':function(self, locals, a, b) {return a(self, locals) === b(self, locals);},\n    '!==':function(self, locals, a, b) {return a(self, locals) !== b(self, locals);},\n    '==':function(self, locals, a, b) {return a(self, locals) == b(self, locals);},\n    '!=':function(self, locals, a, b) {return a(self, locals) != b(self, locals);},\n    '<':function(self, locals, a, b) {return a(self, locals) < b(self, locals);},\n    '>':function(self, locals, a, b) {return a(self, locals) > b(self, locals);},\n    '<=':function(self, locals, a, b) {return a(self, locals) <= b(self, locals);},\n    '>=':function(self, locals, a, b) {return a(self, locals) >= b(self, locals);},\n    '&&':function(self, locals, a, b) {return a(self, locals) && b(self, locals);},\n    '||':function(self, locals, a, b) {return a(self, locals) || b(self, locals);},\n    '!':function(self, locals, a) {return !a(self, locals);},\n\n    //Tokenized as operators but parsed as assignment/filters\n    '=':true,\n    '|':true\n});\nvar ESCAPE = {\"n\":\"\\n\", \"f\":\"\\f\", \"r\":\"\\r\", \"t\":\"\\t\", \"v\":\"\\v\", \"'\":\"'\", '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function(options) {\n  this.options = options;\n};\n\nLexer.prototype = {\n  constructor: Lexer,\n\n  lex: function(text) {\n    this.text = text;\n    this.index = 0;\n    this.tokens = [];\n\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      if (ch === '\"' || ch === \"'\") {\n        this.readString(ch);\n      } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n        this.readNumber();\n      } else if (this.isIdent(ch)) {\n        this.readIdent();\n      } else if (this.is(ch, '(){}[].,;:?')) {\n        this.tokens.push({index: this.index, text: ch});\n        this.index++;\n      } else if (this.isWhitespace(ch)) {\n        this.index++;\n      } else {\n        var ch2 = ch + this.peek();\n        var ch3 = ch2 + this.peek(2);\n        var op1 = OPERATORS[ch];\n        var op2 = OPERATORS[ch2];\n        var op3 = OPERATORS[ch3];\n        if (op1 || op2 || op3) {\n          var token = op3 ? ch3 : (op2 ? ch2 : ch);\n          this.tokens.push({index: this.index, text: token, operator: true});\n          this.index += token.length;\n        } else {\n          this.throwError('Unexpected next character ', this.index, this.index + 1);\n        }\n      }\n    }\n    return this.tokens;\n  },\n\n  is: function(ch, chars) {\n    return chars.indexOf(ch) !== -1;\n  },\n\n  peek: function(i) {\n    var num = i || 1;\n    return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n  },\n\n  isNumber: function(ch) {\n    return ('0' <= ch && ch <= '9') && typeof ch === \"string\";\n  },\n\n  isWhitespace: function(ch) {\n    // IE treats non-breaking space as \\u00A0\n    return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n            ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n  },\n\n  isIdent: function(ch) {\n    return ('a' <= ch && ch <= 'z' ||\n            'A' <= ch && ch <= 'Z' ||\n            '_' === ch || ch === '$');\n  },\n\n  isExpOperator: function(ch) {\n    return (ch === '-' || ch === '+' || this.isNumber(ch));\n  },\n\n  throwError: function(error, start, end) {\n    end = end || this.index;\n    var colStr = (isDefined(start)\n            ? 's ' + start +  '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n            : ' ' + end);\n    throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n        error, colStr, this.text);\n  },\n\n  readNumber: function() {\n    var number = '';\n    var start = this.index;\n    while (this.index < this.text.length) {\n      var ch = lowercase(this.text.charAt(this.index));\n      if (ch == '.' || this.isNumber(ch)) {\n        number += ch;\n      } else {\n        var peekCh = this.peek();\n        if (ch == 'e' && this.isExpOperator(peekCh)) {\n          number += ch;\n        } else if (this.isExpOperator(ch) &&\n            peekCh && this.isNumber(peekCh) &&\n            number.charAt(number.length - 1) == 'e') {\n          number += ch;\n        } else if (this.isExpOperator(ch) &&\n            (!peekCh || !this.isNumber(peekCh)) &&\n            number.charAt(number.length - 1) == 'e') {\n          this.throwError('Invalid exponent');\n        } else {\n          break;\n        }\n      }\n      this.index++;\n    }\n    this.tokens.push({\n      index: start,\n      text: number,\n      constant: true,\n      value: Number(number)\n    });\n  },\n\n  readIdent: function() {\n    var start = this.index;\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      if (!(this.isIdent(ch) || this.isNumber(ch))) {\n        break;\n      }\n      this.index++;\n    }\n    this.tokens.push({\n      index: start,\n      text: this.text.slice(start, this.index),\n      identifier: true\n    });\n  },\n\n  readString: function(quote) {\n    var start = this.index;\n    this.index++;\n    var string = '';\n    var rawString = quote;\n    var escape = false;\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      rawString += ch;\n      if (escape) {\n        if (ch === 'u') {\n          var hex = this.text.substring(this.index + 1, this.index + 5);\n          if (!hex.match(/[\\da-f]{4}/i))\n            this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n          this.index += 4;\n          string += String.fromCharCode(parseInt(hex, 16));\n        } else {\n          var rep = ESCAPE[ch];\n          string = string + (rep || ch);\n        }\n        escape = false;\n      } else if (ch === '\\\\') {\n        escape = true;\n      } else if (ch === quote) {\n        this.index++;\n        this.tokens.push({\n          index: start,\n          text: rawString,\n          constant: true,\n          value: string\n        });\n        return;\n      } else {\n        string += ch;\n      }\n      this.index++;\n    }\n    this.throwError('Unterminated quote', start);\n  }\n};\n\n\nfunction isConstant(exp) {\n  return exp.constant;\n}\n\n/**\n * @constructor\n */\nvar Parser = function(lexer, $filter, options) {\n  this.lexer = lexer;\n  this.$filter = $filter;\n  this.options = options;\n};\n\nParser.ZERO = extend(function() {\n  return 0;\n}, {\n  sharedGetter: true,\n  constant: true\n});\n\nParser.prototype = {\n  constructor: Parser,\n\n  parse: function(text) {\n    this.text = text;\n    this.tokens = this.lexer.lex(text);\n\n    var value = this.statements();\n\n    if (this.tokens.length !== 0) {\n      this.throwError('is an unexpected token', this.tokens[0]);\n    }\n\n    value.literal = !!value.literal;\n    value.constant = !!value.constant;\n\n    return value;\n  },\n\n  primary: function() {\n    var primary;\n    if (this.expect('(')) {\n      primary = this.filterChain();\n      this.consume(')');\n    } else if (this.expect('[')) {\n      primary = this.arrayDeclaration();\n    } else if (this.expect('{')) {\n      primary = this.object();\n    } else if (this.peek().identifier && this.peek().text in CONSTANTS) {\n      primary = CONSTANTS[this.consume().text];\n    } else if (this.peek().identifier) {\n      primary = this.identifier();\n    } else if (this.peek().constant) {\n      primary = this.constant();\n    } else {\n      this.throwError('not a primary expression', this.peek());\n    }\n\n    var next, context;\n    while ((next = this.expect('(', '[', '.'))) {\n      if (next.text === '(') {\n        primary = this.functionCall(primary, context);\n        context = null;\n      } else if (next.text === '[') {\n        context = primary;\n        primary = this.objectIndex(primary);\n      } else if (next.text === '.') {\n        context = primary;\n        primary = this.fieldAccess(primary);\n      } else {\n        this.throwError('IMPOSSIBLE');\n      }\n    }\n    return primary;\n  },\n\n  throwError: function(msg, token) {\n    throw $parseMinErr('syntax',\n        'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n          token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n  },\n\n  peekToken: function() {\n    if (this.tokens.length === 0)\n      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n    return this.tokens[0];\n  },\n\n  peek: function(e1, e2, e3, e4) {\n    return this.peekAhead(0, e1, e2, e3, e4);\n  },\n  peekAhead: function(i, e1, e2, e3, e4) {\n    if (this.tokens.length > i) {\n      var token = this.tokens[i];\n      var t = token.text;\n      if (t === e1 || t === e2 || t === e3 || t === e4 ||\n          (!e1 && !e2 && !e3 && !e4)) {\n        return token;\n      }\n    }\n    return false;\n  },\n\n  expect: function(e1, e2, e3, e4) {\n    var token = this.peek(e1, e2, e3, e4);\n    if (token) {\n      this.tokens.shift();\n      return token;\n    }\n    return false;\n  },\n\n  consume: function(e1) {\n    if (this.tokens.length === 0) {\n      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n    }\n\n    var token = this.expect(e1);\n    if (!token) {\n      this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n    }\n    return token;\n  },\n\n  unaryFn: function(op, right) {\n    var fn = OPERATORS[op];\n    return extend(function $parseUnaryFn(self, locals) {\n      return fn(self, locals, right);\n    }, {\n      constant:right.constant,\n      inputs: [right]\n    });\n  },\n\n  binaryFn: function(left, op, right, isBranching) {\n    var fn = OPERATORS[op];\n    return extend(function $parseBinaryFn(self, locals) {\n      return fn(self, locals, left, right);\n    }, {\n      constant: left.constant && right.constant,\n      inputs: !isBranching && [left, right]\n    });\n  },\n\n  identifier: function() {\n    var id = this.consume().text;\n\n    //Continue reading each `.identifier` unless it is a method invocation\n    while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) {\n      id += this.consume().text + this.consume().text;\n    }\n\n    return getterFn(id, this.options, this.text);\n  },\n\n  constant: function() {\n    var value = this.consume().value;\n\n    return extend(function $parseConstant() {\n      return value;\n    }, {\n      constant: true,\n      literal: true\n    });\n  },\n\n  statements: function() {\n    var statements = [];\n    while (true) {\n      if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n        statements.push(this.filterChain());\n      if (!this.expect(';')) {\n        // optimize for the common case where there is only one statement.\n        // TODO(size): maybe we should not support multiple statements?\n        return (statements.length === 1)\n            ? statements[0]\n            : function $parseStatements(self, locals) {\n                var value;\n                for (var i = 0, ii = statements.length; i < ii; i++) {\n                  value = statements[i](self, locals);\n                }\n                return value;\n              };\n      }\n    }\n  },\n\n  filterChain: function() {\n    var left = this.expression();\n    var token;\n    while ((token = this.expect('|'))) {\n      left = this.filter(left);\n    }\n    return left;\n  },\n\n  filter: function(inputFn) {\n    var fn = this.$filter(this.consume().text);\n    var argsFn;\n    var args;\n\n    if (this.peek(':')) {\n      argsFn = [];\n      args = []; // we can safely reuse the array\n      while (this.expect(':')) {\n        argsFn.push(this.expression());\n      }\n    }\n\n    var inputs = [inputFn].concat(argsFn || []);\n\n    return extend(function $parseFilter(self, locals) {\n      var input = inputFn(self, locals);\n      if (args) {\n        args[0] = input;\n\n        var i = argsFn.length;\n        while (i--) {\n          args[i + 1] = argsFn[i](self, locals);\n        }\n\n        return fn.apply(undefined, args);\n      }\n\n      return fn(input);\n    }, {\n      constant: !fn.$stateful && inputs.every(isConstant),\n      inputs: !fn.$stateful && inputs\n    });\n  },\n\n  expression: function() {\n    return this.assignment();\n  },\n\n  assignment: function() {\n    var left = this.ternary();\n    var right;\n    var token;\n    if ((token = this.expect('='))) {\n      if (!left.assign) {\n        this.throwError('implies assignment but [' +\n            this.text.substring(0, token.index) + '] can not be assigned to', token);\n      }\n      right = this.ternary();\n      return extend(function $parseAssignment(scope, locals) {\n        return left.assign(scope, right(scope, locals), locals);\n      }, {\n        inputs: [left, right]\n      });\n    }\n    return left;\n  },\n\n  ternary: function() {\n    var left = this.logicalOR();\n    var middle;\n    var token;\n    if ((token = this.expect('?'))) {\n      middle = this.assignment();\n      if (this.consume(':')) {\n        var right = this.assignment();\n\n        return extend(function $parseTernary(self, locals) {\n          return left(self, locals) ? middle(self, locals) : right(self, locals);\n        }, {\n          constant: left.constant && middle.constant && right.constant\n        });\n      }\n    }\n\n    return left;\n  },\n\n  logicalOR: function() {\n    var left = this.logicalAND();\n    var token;\n    while ((token = this.expect('||'))) {\n      left = this.binaryFn(left, token.text, this.logicalAND(), true);\n    }\n    return left;\n  },\n\n  logicalAND: function() {\n    var left = this.equality();\n    var token;\n    while ((token = this.expect('&&'))) {\n      left = this.binaryFn(left, token.text, this.equality(), true);\n    }\n    return left;\n  },\n\n  equality: function() {\n    var left = this.relational();\n    var token;\n    while ((token = this.expect('==','!=','===','!=='))) {\n      left = this.binaryFn(left, token.text, this.relational());\n    }\n    return left;\n  },\n\n  relational: function() {\n    var left = this.additive();\n    var token;\n    while ((token = this.expect('<', '>', '<=', '>='))) {\n      left = this.binaryFn(left, token.text, this.additive());\n    }\n    return left;\n  },\n\n  additive: function() {\n    var left = this.multiplicative();\n    var token;\n    while ((token = this.expect('+','-'))) {\n      left = this.binaryFn(left, token.text, this.multiplicative());\n    }\n    return left;\n  },\n\n  multiplicative: function() {\n    var left = this.unary();\n    var token;\n    while ((token = this.expect('*','/','%'))) {\n      left = this.binaryFn(left, token.text, this.unary());\n    }\n    return left;\n  },\n\n  unary: function() {\n    var token;\n    if (this.expect('+')) {\n      return this.primary();\n    } else if ((token = this.expect('-'))) {\n      return this.binaryFn(Parser.ZERO, token.text, this.unary());\n    } else if ((token = this.expect('!'))) {\n      return this.unaryFn(token.text, this.unary());\n    } else {\n      return this.primary();\n    }\n  },\n\n  fieldAccess: function(object) {\n    var getter = this.identifier();\n\n    return extend(function $parseFieldAccess(scope, locals, self) {\n      var o = self || object(scope, locals);\n      return (o == null) ? undefined : getter(o);\n    }, {\n      assign: function(scope, value, locals) {\n        var o = object(scope, locals);\n        if (!o) object.assign(scope, o = {}, locals);\n        return getter.assign(o, value);\n      }\n    });\n  },\n\n  objectIndex: function(obj) {\n    var expression = this.text;\n\n    var indexFn = this.expression();\n    this.consume(']');\n\n    return extend(function $parseObjectIndex(self, locals) {\n      var o = obj(self, locals),\n          i = indexFn(self, locals),\n          v;\n\n      ensureSafeMemberName(i, expression);\n      if (!o) return undefined;\n      v = ensureSafeObject(o[i], expression);\n      return v;\n    }, {\n      assign: function(self, value, locals) {\n        var key = ensureSafeMemberName(indexFn(self, locals), expression);\n        // prevent overwriting of Function.constructor which would break ensureSafeObject check\n        var o = ensureSafeObject(obj(self, locals), expression);\n        if (!o) obj.assign(self, o = {}, locals);\n        return o[key] = value;\n      }\n    });\n  },\n\n  functionCall: function(fnGetter, contextGetter) {\n    var argsFn = [];\n    if (this.peekToken().text !== ')') {\n      do {\n        argsFn.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume(')');\n\n    var expressionText = this.text;\n    // we can safely reuse the array across invocations\n    var args = argsFn.length ? [] : null;\n\n    return function $parseFunctionCall(scope, locals) {\n      var context = contextGetter ? contextGetter(scope, locals) : isDefined(contextGetter) ? undefined : scope;\n      var fn = fnGetter(scope, locals, context) || noop;\n\n      if (args) {\n        var i = argsFn.length;\n        while (i--) {\n          args[i] = ensureSafeObject(argsFn[i](scope, locals), expressionText);\n        }\n      }\n\n      ensureSafeObject(context, expressionText);\n      ensureSafeFunction(fn, expressionText);\n\n      // IE doesn't have apply for some native functions\n      var v = fn.apply\n            ? fn.apply(context, args)\n            : fn(args[0], args[1], args[2], args[3], args[4]);\n\n      if (args) {\n        // Free-up the memory (arguments of the last function call).\n        args.length = 0;\n      }\n\n      return ensureSafeObject(v, expressionText);\n      };\n  },\n\n  // This is used with json array declaration\n  arrayDeclaration: function() {\n    var elementFns = [];\n    if (this.peekToken().text !== ']') {\n      do {\n        if (this.peek(']')) {\n          // Support trailing commas per ES5.1.\n          break;\n        }\n        elementFns.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume(']');\n\n    return extend(function $parseArrayLiteral(self, locals) {\n      var array = [];\n      for (var i = 0, ii = elementFns.length; i < ii; i++) {\n        array.push(elementFns[i](self, locals));\n      }\n      return array;\n    }, {\n      literal: true,\n      constant: elementFns.every(isConstant),\n      inputs: elementFns\n    });\n  },\n\n  object: function() {\n    var keys = [], valueFns = [];\n    if (this.peekToken().text !== '}') {\n      do {\n        if (this.peek('}')) {\n          // Support trailing commas per ES5.1.\n          break;\n        }\n        var token = this.consume();\n        if (token.constant) {\n          keys.push(token.value);\n        } else if (token.identifier) {\n          keys.push(token.text);\n        } else {\n          this.throwError(\"invalid key\", token);\n        }\n        this.consume(':');\n        valueFns.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume('}');\n\n    return extend(function $parseObjectLiteral(self, locals) {\n      var object = {};\n      for (var i = 0, ii = valueFns.length; i < ii; i++) {\n        object[keys[i]] = valueFns[i](self, locals);\n      }\n      return object;\n    }, {\n      literal: true,\n      constant: valueFns.every(isConstant),\n      inputs: valueFns\n    });\n  }\n};\n\n\n//////////////////////////////////////////////////\n// Parser helper functions\n//////////////////////////////////////////////////\n\nfunction setter(obj, locals, path, setValue, fullExp) {\n  ensureSafeObject(obj, fullExp);\n  ensureSafeObject(locals, fullExp);\n\n  var element = path.split('.'), key;\n  for (var i = 0; element.length > 1; i++) {\n    key = ensureSafeMemberName(element.shift(), fullExp);\n    var propertyObj = (i === 0 && locals && locals[key]) || obj[key];\n    if (!propertyObj) {\n      propertyObj = {};\n      obj[key] = propertyObj;\n    }\n    obj = ensureSafeObject(propertyObj, fullExp);\n  }\n  key = ensureSafeMemberName(element.shift(), fullExp);\n  ensureSafeObject(obj[key], fullExp);\n  obj[key] = setValue;\n  return setValue;\n}\n\nvar getterFnCacheDefault = createMap();\nvar getterFnCacheExpensive = createMap();\n\nfunction isPossiblyDangerousMemberName(name) {\n  return name == 'constructor';\n}\n\n/**\n * Implementation of the \"Black Hole\" variant from:\n * - http://jsperf.com/angularjs-parse-getter/4\n * - http://jsperf.com/path-evaluation-simplified/7\n */\nfunction cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) {\n  ensureSafeMemberName(key0, fullExp);\n  ensureSafeMemberName(key1, fullExp);\n  ensureSafeMemberName(key2, fullExp);\n  ensureSafeMemberName(key3, fullExp);\n  ensureSafeMemberName(key4, fullExp);\n  var eso = function(o) {\n    return ensureSafeObject(o, fullExp);\n  };\n  var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n  var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n  var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n  var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n  var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n  return function cspSafeGetter(scope, locals) {\n    var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n    if (pathVal == null) return pathVal;\n    pathVal = eso0(pathVal[key0]);\n\n    if (!key1) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso1(pathVal[key1]);\n\n    if (!key2) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso2(pathVal[key2]);\n\n    if (!key3) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso3(pathVal[key3]);\n\n    if (!key4) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso4(pathVal[key4]);\n\n    return pathVal;\n  };\n}\n\nfunction getterFnWithEnsureSafeObject(fn, fullExpression) {\n  return function(s, l) {\n    return fn(s, l, ensureSafeObject, fullExpression);\n  };\n}\n\nfunction getterFn(path, options, fullExp) {\n  var expensiveChecks = options.expensiveChecks;\n  var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault);\n  var fn = getterFnCache[path];\n  if (fn) return fn;\n\n\n  var pathKeys = path.split('.'),\n      pathKeysLength = pathKeys.length;\n\n  // http://jsperf.com/angularjs-parse-getter/6\n  if (options.csp) {\n    if (pathKeysLength < 6) {\n      fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, expensiveChecks);\n    } else {\n      fn = function cspSafeGetter(scope, locals) {\n        var i = 0, val;\n        do {\n          val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++],\n                                pathKeys[i++], fullExp, expensiveChecks)(scope, locals);\n\n          locals = undefined; // clear after first iteration\n          scope = val;\n        } while (i < pathKeysLength);\n        return val;\n      };\n    }\n  } else {\n    var code = '';\n    if (expensiveChecks) {\n      code += 's = eso(s, fe);\\nl = eso(l, fe);\\n';\n    }\n    var needsEnsureSafeObject = expensiveChecks;\n    forEach(pathKeys, function(key, index) {\n      ensureSafeMemberName(key, fullExp);\n      var lookupJs = (index\n                      // we simply dereference 's' on any .dot notation\n                      ? 's'\n                      // but if we are first then we check locals first, and if so read it first\n                      : '((l&&l.hasOwnProperty(\"' + key + '\"))?l:s)') + '.' + key;\n      if (expensiveChecks || isPossiblyDangerousMemberName(key)) {\n        lookupJs = 'eso(' + lookupJs + ', fe)';\n        needsEnsureSafeObject = true;\n      }\n      code += 'if(s == null) return undefined;\\n' +\n              's=' + lookupJs + ';\\n';\n    });\n    code += 'return s;';\n\n    /* jshint -W054 */\n    var evaledFnGetter = new Function('s', 'l', 'eso', 'fe', code); // s=scope, l=locals, eso=ensureSafeObject\n    /* jshint +W054 */\n    evaledFnGetter.toString = valueFn(code);\n    if (needsEnsureSafeObject) {\n      evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter, fullExp);\n    }\n    fn = evaledFnGetter;\n  }\n\n  fn.sharedGetter = true;\n  fn.assign = function(self, value, locals) {\n    return setter(self, locals, path, value, path);\n  };\n  getterFnCache[path] = fn;\n  return fn;\n}\n\nvar objectValueOf = Object.prototype.valueOf;\n\nfunction getValueOf(value) {\n  return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n *   var getter = $parse('user.name');\n *   var setter = getter.assign;\n *   var context = {user:{name:'angular'}};\n *   var locals = {user:{name:'local'}};\n *\n *   expect(getter(context)).toEqual('angular');\n *   setter(context, 'newValue');\n *   expect(context.user.name).toEqual('newValue');\n *   expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n *      are evaluated against (typically a scope object).\n *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n *      `context`.\n *\n *    The returned function also has the following properties:\n *      * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n *        literal.\n *      * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n *        constant literals.\n *      * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n *        set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n *  service.\n */\nfunction $ParseProvider() {\n  var cacheDefault = createMap();\n  var cacheExpensive = createMap();\n\n\n\n  this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {\n    var $parseOptions = {\n          csp: $sniffer.csp,\n          expensiveChecks: false\n        },\n        $parseOptionsExpensive = {\n          csp: $sniffer.csp,\n          expensiveChecks: true\n        };\n\n    function wrapSharedExpression(exp) {\n      var wrapped = exp;\n\n      if (exp.sharedGetter) {\n        wrapped = function $parseWrapper(self, locals) {\n          return exp(self, locals);\n        };\n        wrapped.literal = exp.literal;\n        wrapped.constant = exp.constant;\n        wrapped.assign = exp.assign;\n      }\n\n      return wrapped;\n    }\n\n    return function $parse(exp, interceptorFn, expensiveChecks) {\n      var parsedExpression, oneTime, cacheKey;\n\n      switch (typeof exp) {\n        case 'string':\n          cacheKey = exp = exp.trim();\n\n          var cache = (expensiveChecks ? cacheExpensive : cacheDefault);\n          parsedExpression = cache[cacheKey];\n\n          if (!parsedExpression) {\n            if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n              oneTime = true;\n              exp = exp.substring(2);\n            }\n\n            var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;\n            var lexer = new Lexer(parseOptions);\n            var parser = new Parser(lexer, $filter, parseOptions);\n            parsedExpression = parser.parse(exp);\n\n            if (parsedExpression.constant) {\n              parsedExpression.$$watchDelegate = constantWatchDelegate;\n            } else if (oneTime) {\n              //oneTime is not part of the exp passed to the Parser so we may have to\n              //wrap the parsedExpression before adding a $$watchDelegate\n              parsedExpression = wrapSharedExpression(parsedExpression);\n              parsedExpression.$$watchDelegate = parsedExpression.literal ?\n                oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;\n            } else if (parsedExpression.inputs) {\n              parsedExpression.$$watchDelegate = inputsWatchDelegate;\n            }\n\n            cache[cacheKey] = parsedExpression;\n          }\n          return addInterceptor(parsedExpression, interceptorFn);\n\n        case 'function':\n          return addInterceptor(exp, interceptorFn);\n\n        default:\n          return addInterceptor(noop, interceptorFn);\n      }\n    };\n\n    function collectExpressionInputs(inputs, list) {\n      for (var i = 0, ii = inputs.length; i < ii; i++) {\n        var input = inputs[i];\n        if (!input.constant) {\n          if (input.inputs) {\n            collectExpressionInputs(input.inputs, list);\n          } else if (list.indexOf(input) === -1) { // TODO(perf) can we do better?\n            list.push(input);\n          }\n        }\n      }\n\n      return list;\n    }\n\n    function expressionInputDirtyCheck(newValue, oldValueOfValue) {\n\n      if (newValue == null || oldValueOfValue == null) { // null/undefined\n        return newValue === oldValueOfValue;\n      }\n\n      if (typeof newValue === 'object') {\n\n        // attempt to convert the value to a primitive type\n        // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n        //             be cheaply dirty-checked\n        newValue = getValueOf(newValue);\n\n        if (typeof newValue === 'object') {\n          // objects/arrays are not supported - deep-watching them would be too expensive\n          return false;\n        }\n\n        // fall-through to the primitive equality check\n      }\n\n      //Primitive or NaN\n      return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n    }\n\n    function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var inputExpressions = parsedExpression.$$inputs ||\n                    (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, []));\n\n      var lastResult;\n\n      if (inputExpressions.length === 1) {\n        var oldInputValue = expressionInputDirtyCheck; // init to something unique so that equals check fails\n        inputExpressions = inputExpressions[0];\n        return scope.$watch(function expressionInputWatch(scope) {\n          var newInputValue = inputExpressions(scope);\n          if (!expressionInputDirtyCheck(newInputValue, oldInputValue)) {\n            lastResult = parsedExpression(scope);\n            oldInputValue = newInputValue && getValueOf(newInputValue);\n          }\n          return lastResult;\n        }, listener, objectEquality);\n      }\n\n      var oldInputValueOfValues = [];\n      for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n        oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n      }\n\n      return scope.$watch(function expressionInputsWatch(scope) {\n        var changed = false;\n\n        for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n          var newInputValue = inputExpressions[i](scope);\n          if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {\n            oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n          }\n        }\n\n        if (changed) {\n          lastResult = parsedExpression(scope);\n        }\n\n        return lastResult;\n      }, listener, objectEquality);\n    }\n\n    function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch, lastValue;\n      return unwatch = scope.$watch(function oneTimeWatch(scope) {\n        return parsedExpression(scope);\n      }, function oneTimeListener(value, old, scope) {\n        lastValue = value;\n        if (isFunction(listener)) {\n          listener.apply(this, arguments);\n        }\n        if (isDefined(value)) {\n          scope.$$postDigest(function() {\n            if (isDefined(lastValue)) {\n              unwatch();\n            }\n          });\n        }\n      }, objectEquality);\n    }\n\n    function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch, lastValue;\n      return unwatch = scope.$watch(function oneTimeWatch(scope) {\n        return parsedExpression(scope);\n      }, function oneTimeListener(value, old, scope) {\n        lastValue = value;\n        if (isFunction(listener)) {\n          listener.call(this, value, old, scope);\n        }\n        if (isAllDefined(value)) {\n          scope.$$postDigest(function() {\n            if (isAllDefined(lastValue)) unwatch();\n          });\n        }\n      }, objectEquality);\n\n      function isAllDefined(value) {\n        var allDefined = true;\n        forEach(value, function(val) {\n          if (!isDefined(val)) allDefined = false;\n        });\n        return allDefined;\n      }\n    }\n\n    function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch;\n      return unwatch = scope.$watch(function constantWatch(scope) {\n        return parsedExpression(scope);\n      }, function constantListener(value, old, scope) {\n        if (isFunction(listener)) {\n          listener.apply(this, arguments);\n        }\n        unwatch();\n      }, objectEquality);\n    }\n\n    function addInterceptor(parsedExpression, interceptorFn) {\n      if (!interceptorFn) return parsedExpression;\n      var watchDelegate = parsedExpression.$$watchDelegate;\n\n      var regularWatch =\n          watchDelegate !== oneTimeLiteralWatchDelegate &&\n          watchDelegate !== oneTimeWatchDelegate;\n\n      var fn = regularWatch ? function regularInterceptedExpression(scope, locals) {\n        var value = parsedExpression(scope, locals);\n        return interceptorFn(value, scope, locals);\n      } : function oneTimeInterceptedExpression(scope, locals) {\n        var value = parsedExpression(scope, locals);\n        var result = interceptorFn(value, scope, locals);\n        // we only return the interceptor's result if the\n        // initial value is defined (for bind-once)\n        return isDefined(value) ? result : value;\n      };\n\n      // Propagate $$watchDelegates other then inputsWatchDelegate\n      if (parsedExpression.$$watchDelegate &&\n          parsedExpression.$$watchDelegate !== inputsWatchDelegate) {\n        fn.$$watchDelegate = parsedExpression.$$watchDelegate;\n      } else if (!interceptorFn.$stateful) {\n        // If there is an interceptor, but no watchDelegate then treat the interceptor like\n        // we treat filters - it is assumed to be a pure function unless flagged with $stateful\n        fn.$$watchDelegate = inputsWatchDelegate;\n        fn.inputs = [parsedExpression];\n      }\n\n      return fn;\n    }\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is an implementation of promises/deferred objects inspired by\n * [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 promises to some degree.\n *\n * # $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n *   // are available in the current lexical scope (they could have been injected or passed in).\n *\n *   function asyncGreet(name) {\n *     // perform some asynchronous operation, resolve or reject the promise when appropriate.\n *     return $q(function(resolve, reject) {\n *       setTimeout(function() {\n *         if (okToGreet(name)) {\n *           resolve('Hello, ' + name + '!');\n *         } else {\n *           reject('Greeting ' + name + ' is not allowed.');\n *         }\n *       }, 1000);\n *     });\n *   }\n *\n *   var promise = asyncGreet('Robin Hood');\n *   promise.then(function(greeting) {\n *     alert('Success: ' + greeting);\n *   }, function(reason) {\n *     alert('Failed: ' + reason);\n *   });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n *   // are available in the current lexical scope (they could have been injected or passed in).\n *\n *   function asyncGreet(name) {\n *     var deferred = $q.defer();\n *\n *     setTimeout(function() {\n *       deferred.notify('About to greet ' + name + '.');\n *\n *       if (okToGreet(name)) {\n *         deferred.resolve('Hello, ' + name + '!');\n *       } else {\n *         deferred.reject('Greeting ' + name + ' is not allowed.');\n *       }\n *     }, 1000);\n *\n *     return deferred.promise;\n *   }\n *\n *   var promise = asyncGreet('Robin Hood');\n *   promise.then(function(greeting) {\n *     alert('Success: ' + greeting);\n *   }, function(reason) {\n *     alert('Failed: ' + reason);\n *   }, function(update) {\n *     alert('Got notification: ' + update);\n *   });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * # The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n *   constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n *   resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n *   multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * # The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or\n *   will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n *   as soon as the result is available. The callbacks are called with a single argument: the result\n *   or rejection reason. Additionally, the notify callback may be called zero or more times to\n *   provide a progress indication, before the promise is resolved or rejected.\n *\n *   This method *returns a new promise* which is resolved or rejected via the return value of the\n *   `successCallback`, `errorCallback`. It also notifies via the return value of the\n *   `notifyCallback` method. The promise cannot be resolved or rejected from the notifyCallback\n *   method.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n *   but to do so without modifying the final value. This is useful to release resources or do some\n *   clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n *   specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n *   more information.\n *\n * # Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n *   promiseB = promiseA.then(function(result) {\n *     return result + 1;\n *   });\n *\n *   // promiseB will be resolved immediately after promiseA is resolved and its value\n *   // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * # Differences between Kris Kowal's Q and $q\n *\n *  There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n *   mechanism in angular, which means faster propagation of resolution or rejection into your\n *   models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n *   all the important functionality needed for common async tasks.\n *\n *  # Testing\n *\n *  ```js\n *    it('should simulate promise', inject(function($q, $rootScope) {\n *      var deferred = $q.defer();\n *      var promise = deferred.promise;\n *      var resolvedValue;\n *\n *      promise.then(function(value) { resolvedValue = value; });\n *      expect(resolvedValue).toBeUndefined();\n *\n *      // Simulate resolving of promise\n *      deferred.resolve(123);\n *      // Note that the 'then' function does not get called synchronously.\n *      // This is because we want the promise API to always be async, whether or not\n *      // it got called synchronously or asynchronously.\n *      expect(resolvedValue).toBeUndefined();\n *\n *      // Propagate promise resolution to 'then' functions using $apply().\n *      $rootScope.$apply();\n *      expect(resolvedValue).toEqual(123);\n *    }));\n *  ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n *   rejecting the newly created promise. The first parameter is a function which resolves the\n *   promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\nfunction $QProvider() {\n\n  this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n    return qFactory(function(callback) {\n      $rootScope.$evalAsync(callback);\n    }, $exceptionHandler);\n  }];\n}\n\nfunction $$QProvider() {\n  this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n    return qFactory(function(callback) {\n      $browser.defer(callback);\n    }, $exceptionHandler);\n  }];\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n *     debugging purposes.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler) {\n  var $qMinErr = minErr('$q', TypeError);\n  function callOnce(self, resolveFn, rejectFn) {\n    var called = false;\n    function wrap(fn) {\n      return function(value) {\n        if (called) return;\n        called = true;\n        fn.call(self, value);\n      };\n    }\n\n    return [wrap(resolveFn), wrap(rejectFn)];\n  }\n\n  /**\n   * @ngdoc method\n   * @name ng.$q#defer\n   * @kind function\n   *\n   * @description\n   * Creates a `Deferred` object which represents a task which will finish in the future.\n   *\n   * @returns {Deferred} Returns a new instance of deferred.\n   */\n  var defer = function() {\n    return new Deferred();\n  };\n\n  function Promise() {\n    this.$$state = { status: 0 };\n  }\n\n  Promise.prototype = {\n    then: function(onFulfilled, onRejected, progressBack) {\n      var result = new Deferred();\n\n      this.$$state.pending = this.$$state.pending || [];\n      this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n      if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n      return result.promise;\n    },\n\n    \"catch\": function(callback) {\n      return this.then(null, callback);\n    },\n\n    \"finally\": function(callback, progressBack) {\n      return this.then(function(value) {\n        return handleCallback(value, true, callback);\n      }, function(error) {\n        return handleCallback(error, false, callback);\n      }, progressBack);\n    }\n  };\n\n  //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native\n  function simpleBind(context, fn) {\n    return function(value) {\n      fn.call(context, value);\n    };\n  }\n\n  function processQueue(state) {\n    var fn, promise, pending;\n\n    pending = state.pending;\n    state.processScheduled = false;\n    state.pending = undefined;\n    for (var i = 0, ii = pending.length; i < ii; ++i) {\n      promise = pending[i][0];\n      fn = pending[i][state.status];\n      try {\n        if (isFunction(fn)) {\n          promise.resolve(fn(state.value));\n        } else if (state.status === 1) {\n          promise.resolve(state.value);\n        } else {\n          promise.reject(state.value);\n        }\n      } catch (e) {\n        promise.reject(e);\n        exceptionHandler(e);\n      }\n    }\n  }\n\n  function scheduleProcessQueue(state) {\n    if (state.processScheduled || !state.pending) return;\n    state.processScheduled = true;\n    nextTick(function() { processQueue(state); });\n  }\n\n  function Deferred() {\n    this.promise = new Promise();\n    //Necessary to support unbound execution :/\n    this.resolve = simpleBind(this, this.resolve);\n    this.reject = simpleBind(this, this.reject);\n    this.notify = simpleBind(this, this.notify);\n  }\n\n  Deferred.prototype = {\n    resolve: function(val) {\n      if (this.promise.$$state.status) return;\n      if (val === this.promise) {\n        this.$$reject($qMinErr(\n          'qcycle',\n          \"Expected promise to be resolved with value other than itself '{0}'\",\n          val));\n      } else {\n        this.$$resolve(val);\n      }\n\n    },\n\n    $$resolve: function(val) {\n      var then, fns;\n\n      fns = callOnce(this, this.$$resolve, this.$$reject);\n      try {\n        if ((isObject(val) || isFunction(val))) then = val && val.then;\n        if (isFunction(then)) {\n          this.promise.$$state.status = -1;\n          then.call(val, fns[0], fns[1], this.notify);\n        } else {\n          this.promise.$$state.value = val;\n          this.promise.$$state.status = 1;\n          scheduleProcessQueue(this.promise.$$state);\n        }\n      } catch (e) {\n        fns[1](e);\n        exceptionHandler(e);\n      }\n    },\n\n    reject: function(reason) {\n      if (this.promise.$$state.status) return;\n      this.$$reject(reason);\n    },\n\n    $$reject: function(reason) {\n      this.promise.$$state.value = reason;\n      this.promise.$$state.status = 2;\n      scheduleProcessQueue(this.promise.$$state);\n    },\n\n    notify: function(progress) {\n      var callbacks = this.promise.$$state.pending;\n\n      if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {\n        nextTick(function() {\n          var callback, result;\n          for (var i = 0, ii = callbacks.length; i < ii; i++) {\n            result = callbacks[i][0];\n            callback = callbacks[i][3];\n            try {\n              result.notify(isFunction(callback) ? callback(progress) : progress);\n            } catch (e) {\n              exceptionHandler(e);\n            }\n          }\n        });\n      }\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#reject\n   * @kind function\n   *\n   * @description\n   * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n   * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n   * a promise chain, you don't need to worry about it.\n   *\n   * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n   * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n   * a promise error callback and you want to forward the error to the promise derived from the\n   * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n   * `reject`.\n   *\n   * ```js\n   *   promiseB = promiseA.then(function(result) {\n   *     // success: do something and resolve promiseB\n   *     //          with the old or a new result\n   *     return result;\n   *   }, function(reason) {\n   *     // error: handle the error if possible and\n   *     //        resolve promiseB with newPromiseOrValue,\n   *     //        otherwise forward the rejection to promiseB\n   *     if (canHandle(reason)) {\n   *      // handle the error and recover\n   *      return newPromiseOrValue;\n   *     }\n   *     return $q.reject(reason);\n   *   });\n   * ```\n   *\n   * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n   * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n   */\n  var reject = function(reason) {\n    var result = new Deferred();\n    result.reject(reason);\n    return result.promise;\n  };\n\n  var makePromise = function makePromise(value, resolved) {\n    var result = new Deferred();\n    if (resolved) {\n      result.resolve(value);\n    } else {\n      result.reject(value);\n    }\n    return result.promise;\n  };\n\n  var handleCallback = function handleCallback(value, isResolved, callback) {\n    var callbackOutput = null;\n    try {\n      if (isFunction(callback)) callbackOutput = callback();\n    } catch (e) {\n      return makePromise(e, false);\n    }\n    if (isPromiseLike(callbackOutput)) {\n      return callbackOutput.then(function() {\n        return makePromise(value, isResolved);\n      }, function(error) {\n        return makePromise(error, false);\n      });\n    } else {\n      return makePromise(value, isResolved);\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#when\n   * @kind function\n   *\n   * @description\n   * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n   * This is useful when you are dealing with an object that might or might not be a promise, or if\n   * the promise comes from a source that can't be trusted.\n   *\n   * @param {*} value Value or a promise\n   * @returns {Promise} Returns a promise of the passed value or promise\n   */\n\n\n  var when = function(value, callback, errback, progressBack) {\n    var result = new Deferred();\n    result.resolve(value);\n    return result.promise.then(callback, errback, progressBack);\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#all\n   * @kind function\n   *\n   * @description\n   * Combines multiple promises into a single promise that is resolved when all of the input\n   * promises are resolved.\n   *\n   * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.\n   * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n   *   each value corresponding to the promise at the same index/key in the `promises` array/hash.\n   *   If any of the promises is resolved with a rejection, this resulting promise will be rejected\n   *   with the same rejection value.\n   */\n\n  function all(promises) {\n    var deferred = new Deferred(),\n        counter = 0,\n        results = isArray(promises) ? [] : {};\n\n    forEach(promises, function(promise, key) {\n      counter++;\n      when(promise).then(function(value) {\n        if (results.hasOwnProperty(key)) return;\n        results[key] = value;\n        if (!(--counter)) deferred.resolve(results);\n      }, function(reason) {\n        if (results.hasOwnProperty(key)) return;\n        deferred.reject(reason);\n      });\n    });\n\n    if (counter === 0) {\n      deferred.resolve(results);\n    }\n\n    return deferred.promise;\n  }\n\n  var $Q = function Q(resolver) {\n    if (!isFunction(resolver)) {\n      throw $qMinErr('norslvr', \"Expected resolverFn, got '{0}'\", resolver);\n    }\n\n    if (!(this instanceof Q)) {\n      // More useful when $Q is the Promise itself.\n      return new Q(resolver);\n    }\n\n    var deferred = new Deferred();\n\n    function resolveFn(value) {\n      deferred.resolve(value);\n    }\n\n    function rejectFn(reason) {\n      deferred.reject(reason);\n    }\n\n    resolver(resolveFn, rejectFn);\n\n    return deferred.promise;\n  };\n\n  $Q.defer = defer;\n  $Q.reject = reject;\n  $Q.when = when;\n  $Q.all = all;\n\n  return $Q;\n}\n\nfunction $$RAFProvider() { //rAF\n  this.$get = ['$window', '$timeout', function($window, $timeout) {\n    var requestAnimationFrame = $window.requestAnimationFrame ||\n                                $window.webkitRequestAnimationFrame;\n\n    var cancelAnimationFrame = $window.cancelAnimationFrame ||\n                               $window.webkitCancelAnimationFrame ||\n                               $window.webkitCancelRequestAnimationFrame;\n\n    var rafSupported = !!requestAnimationFrame;\n    var raf = rafSupported\n      ? function(fn) {\n          var id = requestAnimationFrame(fn);\n          return function() {\n            cancelAnimationFrame(id);\n          };\n        }\n      : function(fn) {\n          var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n          return function() {\n            $timeout.cancel(timer);\n          };\n        };\n\n    raf.supported = rafSupported;\n\n    return raf;\n  }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n *   - No closures, instead use prototypical inheritance for API\n *   - Internal state needs to be stored on scope directly, which means that private state is\n *     exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n *   - this means that in order to keep the same order of execution as addition we have to add\n *     items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n *   - Using an array would be slow since inserts in middle are expensive so we use linked list\n *\n * There are few watches then a lot of observers. This is why you don't want the observer to be\n * implemented in the same way as watch. Watch requires return of initialization function which\n * are expensive to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide an event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n  var TTL = 10;\n  var $rootScopeMinErr = minErr('$rootScope');\n  var lastDirtyWatch = null;\n  var applyAsyncId = null;\n\n  this.digestTtl = function(value) {\n    if (arguments.length) {\n      TTL = value;\n    }\n    return TTL;\n  };\n\n  this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',\n      function($injector, $exceptionHandler, $parse, $browser) {\n\n    /**\n     * @ngdoc type\n     * @name $rootScope.Scope\n     *\n     * @description\n     * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n     * {@link auto.$injector $injector}. Child scopes are created using the\n     * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n     * compiled HTML template is executed.)\n     *\n     * Here is a simple scope snippet to show how you can interact with the scope.\n     * ```html\n     * <file src=\"./test/ng/rootScopeSpec.js\" tag=\"docs1\" />\n     * ```\n     *\n     * # Inheritance\n     * A scope can inherit from a parent scope, as in this example:\n     * ```js\n         var parent = $rootScope;\n         var child = parent.$new();\n\n         parent.salutation = \"Hello\";\n         expect(child.salutation).toEqual('Hello');\n\n         child.salutation = \"Welcome\";\n         expect(child.salutation).toEqual('Welcome');\n         expect(parent.salutation).toEqual('Hello');\n     * ```\n     *\n     * When interacting with `Scope` in tests, additional helper methods are available on the\n     * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n     * details.\n     *\n     *\n     * @param {Object.<string, function()>=} providers Map of service factory which need to be\n     *                                       provided for the current scope. Defaults to {@link ng}.\n     * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should\n     *                              append/override services provided by `providers`. This is handy\n     *                              when unit-testing and having the need to override a default\n     *                              service.\n     * @returns {Object} Newly created scope.\n     *\n     */\n    function Scope() {\n      this.$id = nextUid();\n      this.$$phase = this.$parent = this.$$watchers =\n                     this.$$nextSibling = this.$$prevSibling =\n                     this.$$childHead = this.$$childTail = null;\n      this.$root = this;\n      this.$$destroyed = false;\n      this.$$listeners = {};\n      this.$$listenerCount = {};\n      this.$$isolateBindings = null;\n    }\n\n    /**\n     * @ngdoc property\n     * @name $rootScope.Scope#$id\n     *\n     * @description\n     * Unique scope ID (monotonically increasing) useful for debugging.\n     */\n\n     /**\n      * @ngdoc property\n      * @name $rootScope.Scope#$parent\n      *\n      * @description\n      * Reference to the parent scope.\n      */\n\n      /**\n       * @ngdoc property\n       * @name $rootScope.Scope#$root\n       *\n       * @description\n       * Reference to the root scope.\n       */\n\n    Scope.prototype = {\n      constructor: Scope,\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$new\n       * @kind function\n       *\n       * @description\n       * Creates a new child {@link ng.$rootScope.Scope scope}.\n       *\n       * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n       * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n       *\n       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n       * desired for the scope and its child scopes to be permanently detached from the parent and\n       * thus stop participating in model change detection and listener notification by invoking.\n       *\n       * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n       *         parent scope. The scope is isolated, as it can not see parent scope properties.\n       *         When creating widgets, it is useful for the widget to not accidentally read parent\n       *         state.\n       *\n       * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n       *                              of the newly created scope. Defaults to `this` scope if not provided.\n       *                              This is used when creating a transclude scope to correctly place it\n       *                              in the scope hierarchy while maintaining the correct prototypical\n       *                              inheritance.\n       *\n       * @returns {Object} The newly created child scope.\n       *\n       */\n      $new: function(isolate, parent) {\n        var child;\n\n        parent = parent || this;\n\n        if (isolate) {\n          child = new Scope();\n          child.$root = this.$root;\n        } else {\n          // Only create a child scope class if somebody asks for one,\n          // but cache it to allow the VM to optimize lookups.\n          if (!this.$$ChildScope) {\n            this.$$ChildScope = function ChildScope() {\n              this.$$watchers = this.$$nextSibling =\n                  this.$$childHead = this.$$childTail = null;\n              this.$$listeners = {};\n              this.$$listenerCount = {};\n              this.$id = nextUid();\n              this.$$ChildScope = null;\n            };\n            this.$$ChildScope.prototype = this;\n          }\n          child = new this.$$ChildScope();\n        }\n        child.$parent = parent;\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        // When the new scope is not isolated or we inherit from `this`, and\n        // the parent scope is destroyed, the property `$$destroyed` is inherited\n        // prototypically. In all other cases, this property needs to be set\n        // when the parent scope is destroyed.\n        // The listener needs to be added after the parent is set\n        if (isolate || parent != this) child.$on('$destroy', destroyChild);\n\n        return child;\n\n        function destroyChild() {\n          child.$$destroyed = true;\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watch\n       * @kind function\n       *\n       * @description\n       * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n       *\n       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n       *   $digest()} and should return the value that will be watched. (Since\n       *   {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the\n       *   `watchExpression` can execute multiple times per\n       *   {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)\n       * - The `listener` is called only when the value from the current `watchExpression` and the\n       *   previous call to `watchExpression` are not equal (with the exception of the initial run,\n       *   see below). Inequality is determined according to reference inequality,\n       *   [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n       *    via the `!==` Javascript operator, unless `objectEquality == true`\n       *   (see next point)\n       * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n       *   according to the {@link angular.equals} function. To save the value of the object for\n       *   later comparison, the {@link angular.copy} function is used. This therefore means that\n       *   watching complex objects will have adverse memory and performance implications.\n       * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n       *   This is achieved by rerunning the watchers until no changes are detected. The rerun\n       *   iteration limit is 10 to prevent an infinite loop deadlock.\n       *\n       *\n       * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n       * you can register a `watchExpression` function with no `listener`. (Since `watchExpression`\n       * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a\n       * change is detected, be prepared for multiple calls to your listener.)\n       *\n       * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n       * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n       * watcher. In rare cases, this is undesirable because the listener is called when the result\n       * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n       * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n       * listener was called due to initialization.\n       *\n       *\n       *\n       * # Example\n       * ```js\n           // let's assume that scope was dependency injected as the $rootScope\n           var scope = $rootScope;\n           scope.name = 'misko';\n           scope.counter = 0;\n\n           expect(scope.counter).toEqual(0);\n           scope.$watch('name', function(newValue, oldValue) {\n             scope.counter = scope.counter + 1;\n           });\n           expect(scope.counter).toEqual(0);\n\n           scope.$digest();\n           // the listener is always called during the first $digest loop after it was registered\n           expect(scope.counter).toEqual(1);\n\n           scope.$digest();\n           // but now it will not be called unless the value changes\n           expect(scope.counter).toEqual(1);\n\n           scope.name = 'adam';\n           scope.$digest();\n           expect(scope.counter).toEqual(2);\n\n\n\n           // Using a function as a watchExpression\n           var food;\n           scope.foodCounter = 0;\n           expect(scope.foodCounter).toEqual(0);\n           scope.$watch(\n             // This function returns the value being watched. It is called for each turn of the $digest loop\n             function() { return food; },\n             // This is the change listener, called when the value returned from the above function changes\n             function(newValue, oldValue) {\n               if ( newValue !== oldValue ) {\n                 // Only increment the counter if the value changed\n                 scope.foodCounter = scope.foodCounter + 1;\n               }\n             }\n           );\n           // No digest has been run so the counter will be zero\n           expect(scope.foodCounter).toEqual(0);\n\n           // Run the digest but since food has not changed count will still be zero\n           scope.$digest();\n           expect(scope.foodCounter).toEqual(0);\n\n           // Update food and run digest.  Now the counter will increment\n           food = 'cheeseburger';\n           scope.$digest();\n           expect(scope.foodCounter).toEqual(1);\n\n       * ```\n       *\n       *\n       *\n       * @param {(function()|string)} watchExpression Expression that is evaluated on each\n       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n       *    a call to the `listener`.\n       *\n       *    - `string`: Evaluated as {@link guide/expression expression}\n       *    - `function(scope)`: called with current `scope` as a parameter.\n       * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n       *    of `watchExpression` changes.\n       *\n       *    - `newVal` contains the current value of the `watchExpression`\n       *    - `oldVal` contains the previous value of the `watchExpression`\n       *    - `scope` refers to the current scope\n       * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of\n       *     comparing for reference equality.\n       * @returns {function()} Returns a deregistration function for this listener.\n       */\n      $watch: function(watchExp, listener, objectEquality) {\n        var get = $parse(watchExp);\n\n        if (get.$$watchDelegate) {\n          return get.$$watchDelegate(this, listener, objectEquality, get);\n        }\n        var scope = this,\n            array = scope.$$watchers,\n            watcher = {\n              fn: listener,\n              last: initWatchVal,\n              get: get,\n              exp: watchExp,\n              eq: !!objectEquality\n            };\n\n        lastDirtyWatch = null;\n\n        if (!isFunction(listener)) {\n          watcher.fn = noop;\n        }\n\n        if (!array) {\n          array = scope.$$watchers = [];\n        }\n        // we use unshift since we use a while loop in $digest for speed.\n        // the while loop reads in reverse order.\n        array.unshift(watcher);\n\n        return function deregisterWatch() {\n          arrayRemove(array, watcher);\n          lastDirtyWatch = null;\n        };\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watchGroup\n       * @kind function\n       *\n       * @description\n       * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n       * If any one expression in the collection changes the `listener` is executed.\n       *\n       * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every\n       *   call to $digest() to see if any items changes.\n       * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n       *\n       * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually\n       * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n       *\n       * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n       *    expression in `watchExpressions` changes\n       *    The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n       *    those of `watchExpression`\n       *    and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n       *    those of `watchExpression`\n       *    The `scope` refers to the current scope.\n       * @returns {function()} Returns a de-registration function for all listeners.\n       */\n      $watchGroup: function(watchExpressions, listener) {\n        var oldValues = new Array(watchExpressions.length);\n        var newValues = new Array(watchExpressions.length);\n        var deregisterFns = [];\n        var self = this;\n        var changeReactionScheduled = false;\n        var firstRun = true;\n\n        if (!watchExpressions.length) {\n          // No expressions means we call the listener ASAP\n          var shouldCall = true;\n          self.$evalAsync(function() {\n            if (shouldCall) listener(newValues, newValues, self);\n          });\n          return function deregisterWatchGroup() {\n            shouldCall = false;\n          };\n        }\n\n        if (watchExpressions.length === 1) {\n          // Special case size of one\n          return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n            newValues[0] = value;\n            oldValues[0] = oldValue;\n            listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n          });\n        }\n\n        forEach(watchExpressions, function(expr, i) {\n          var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {\n            newValues[i] = value;\n            oldValues[i] = oldValue;\n            if (!changeReactionScheduled) {\n              changeReactionScheduled = true;\n              self.$evalAsync(watchGroupAction);\n            }\n          });\n          deregisterFns.push(unwatchFn);\n        });\n\n        function watchGroupAction() {\n          changeReactionScheduled = false;\n\n          if (firstRun) {\n            firstRun = false;\n            listener(newValues, newValues, self);\n          } else {\n            listener(newValues, oldValues, self);\n          }\n        }\n\n        return function deregisterWatchGroup() {\n          while (deregisterFns.length) {\n            deregisterFns.shift()();\n          }\n        };\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watchCollection\n       * @kind function\n       *\n       * @description\n       * Shallow watches the properties of an object and fires whenever any of the properties change\n       * (for arrays, this implies watching the array items; for object maps, this implies watching\n       * the properties). If a change is detected, the `listener` callback is fired.\n       *\n       * - The `obj` collection is observed via standard $watch operation and is examined on every\n       *   call to $digest() to see if any items have been added, removed, or moved.\n       * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n       *   adding, removing, and moving items belonging to an object or array.\n       *\n       *\n       * # Example\n       * ```js\n          $scope.names = ['igor', 'matias', 'misko', 'james'];\n          $scope.dataCount = 4;\n\n          $scope.$watchCollection('names', function(newNames, oldNames) {\n            $scope.dataCount = newNames.length;\n          });\n\n          expect($scope.dataCount).toEqual(4);\n          $scope.$digest();\n\n          //still at 4 ... no changes\n          expect($scope.dataCount).toEqual(4);\n\n          $scope.names.pop();\n          $scope.$digest();\n\n          //now there's been a change\n          expect($scope.dataCount).toEqual(3);\n       * ```\n       *\n       *\n       * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n       *    expression value should evaluate to an object or an array which is observed on each\n       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n       *    collection will trigger a call to the `listener`.\n       *\n       * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n       *    when a change is detected.\n       *    - The `newCollection` object is the newly modified data obtained from the `obj` expression\n       *    - The `oldCollection` object is a copy of the former collection data.\n       *      Due to performance considerations, the`oldCollection` value is computed only if the\n       *      `listener` function declares two or more arguments.\n       *    - The `scope` argument refers to the current scope.\n       *\n       * @returns {function()} Returns a de-registration function for this listener. When the\n       *    de-registration function is executed, the internal watch operation is terminated.\n       */\n      $watchCollection: function(obj, listener) {\n        $watchCollectionInterceptor.$stateful = true;\n\n        var self = this;\n        // the current value, updated on each dirty-check run\n        var newValue;\n        // a shallow copy of the newValue from the last dirty-check run,\n        // updated to match newValue during dirty-check run\n        var oldValue;\n        // a shallow copy of the newValue from when the last change happened\n        var veryOldValue;\n        // only track veryOldValue if the listener is asking for it\n        var trackVeryOldValue = (listener.length > 1);\n        var changeDetected = 0;\n        var changeDetector = $parse(obj, $watchCollectionInterceptor);\n        var internalArray = [];\n        var internalObject = {};\n        var initRun = true;\n        var oldLength = 0;\n\n        function $watchCollectionInterceptor(_value) {\n          newValue = _value;\n          var newLength, key, bothNaN, newItem, oldItem;\n\n          // If the new value is undefined, then return undefined as the watch may be a one-time watch\n          if (isUndefined(newValue)) return;\n\n          if (!isObject(newValue)) { // if primitive\n            if (oldValue !== newValue) {\n              oldValue = newValue;\n              changeDetected++;\n            }\n          } else if (isArrayLike(newValue)) {\n            if (oldValue !== internalArray) {\n              // we are transitioning from something which was not an array into array.\n              oldValue = internalArray;\n              oldLength = oldValue.length = 0;\n              changeDetected++;\n            }\n\n            newLength = newValue.length;\n\n            if (oldLength !== newLength) {\n              // if lengths do not match we need to trigger change notification\n              changeDetected++;\n              oldValue.length = oldLength = newLength;\n            }\n            // copy the items to oldValue and look for changes.\n            for (var i = 0; i < newLength; i++) {\n              oldItem = oldValue[i];\n              newItem = newValue[i];\n\n              bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n              if (!bothNaN && (oldItem !== newItem)) {\n                changeDetected++;\n                oldValue[i] = newItem;\n              }\n            }\n          } else {\n            if (oldValue !== internalObject) {\n              // we are transitioning from something which was not an object into object.\n              oldValue = internalObject = {};\n              oldLength = 0;\n              changeDetected++;\n            }\n            // copy the items to oldValue and look for changes.\n            newLength = 0;\n            for (key in newValue) {\n              if (newValue.hasOwnProperty(key)) {\n                newLength++;\n                newItem = newValue[key];\n                oldItem = oldValue[key];\n\n                if (key in oldValue) {\n                  bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n                  if (!bothNaN && (oldItem !== newItem)) {\n                    changeDetected++;\n                    oldValue[key] = newItem;\n                  }\n                } else {\n                  oldLength++;\n                  oldValue[key] = newItem;\n                  changeDetected++;\n                }\n              }\n            }\n            if (oldLength > newLength) {\n              // we used to have more keys, need to find them and destroy them.\n              changeDetected++;\n              for (key in oldValue) {\n                if (!newValue.hasOwnProperty(key)) {\n                  oldLength--;\n                  delete oldValue[key];\n                }\n              }\n            }\n          }\n          return changeDetected;\n        }\n\n        function $watchCollectionAction() {\n          if (initRun) {\n            initRun = false;\n            listener(newValue, newValue, self);\n          } else {\n            listener(newValue, veryOldValue, self);\n          }\n\n          // make a copy for the next time a collection is changed\n          if (trackVeryOldValue) {\n            if (!isObject(newValue)) {\n              //primitive\n              veryOldValue = newValue;\n            } else if (isArrayLike(newValue)) {\n              veryOldValue = new Array(newValue.length);\n              for (var i = 0; i < newValue.length; i++) {\n                veryOldValue[i] = newValue[i];\n              }\n            } else { // if object\n              veryOldValue = {};\n              for (var key in newValue) {\n                if (hasOwnProperty.call(newValue, key)) {\n                  veryOldValue[key] = newValue[key];\n                }\n              }\n            }\n          }\n        }\n\n        return this.$watch(changeDetector, $watchCollectionAction);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$digest\n       * @kind function\n       *\n       * @description\n       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n       * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n       * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n       * until no more listeners are firing. This means that it is possible to get into an infinite\n       * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n       * iterations exceeds 10.\n       *\n       * Usually, you don't call `$digest()` directly in\n       * {@link ng.directive:ngController controllers} or in\n       * {@link ng.$compileProvider#directive directives}.\n       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n       * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n       *\n       * If you want to be notified whenever `$digest()` is called,\n       * you can register a `watchExpression` function with\n       * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n       *\n       * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n       *\n       * # Example\n       * ```js\n           var scope = ...;\n           scope.name = 'misko';\n           scope.counter = 0;\n\n           expect(scope.counter).toEqual(0);\n           scope.$watch('name', function(newValue, oldValue) {\n             scope.counter = scope.counter + 1;\n           });\n           expect(scope.counter).toEqual(0);\n\n           scope.$digest();\n           // the listener is always called during the first $digest loop after it was registered\n           expect(scope.counter).toEqual(1);\n\n           scope.$digest();\n           // but now it will not be called unless the value changes\n           expect(scope.counter).toEqual(1);\n\n           scope.name = 'adam';\n           scope.$digest();\n           expect(scope.counter).toEqual(2);\n       * ```\n       *\n       */\n      $digest: function() {\n        var watch, value, last,\n            watchers,\n            length,\n            dirty, ttl = TTL,\n            next, current, target = this,\n            watchLog = [],\n            logIdx, logMsg, asyncTask;\n\n        beginPhase('$digest');\n        // Check for changes to browser url that happened in sync before the call to $digest\n        $browser.$$checkUrlChange();\n\n        if (this === $rootScope && applyAsyncId !== null) {\n          // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n          // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n          $browser.defer.cancel(applyAsyncId);\n          flushApplyAsync();\n        }\n\n        lastDirtyWatch = null;\n\n        do { // \"while dirty\" loop\n          dirty = false;\n          current = target;\n\n          while (asyncQueue.length) {\n            try {\n              asyncTask = asyncQueue.shift();\n              asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n            lastDirtyWatch = null;\n          }\n\n          traverseScopesLoop:\n          do { // \"traverse the scopes\" loop\n            if ((watchers = current.$$watchers)) {\n              // process our watches\n              length = watchers.length;\n              while (length--) {\n                try {\n                  watch = watchers[length];\n                  // Most common watches are on primitives, in which case we can short\n                  // circuit it with === operator, only when === fails do we use .equals\n                  if (watch) {\n                    if ((value = watch.get(current)) !== (last = watch.last) &&\n                        !(watch.eq\n                            ? equals(value, last)\n                            : (typeof value === 'number' && typeof last === 'number'\n                               && isNaN(value) && isNaN(last)))) {\n                      dirty = true;\n                      lastDirtyWatch = watch;\n                      watch.last = watch.eq ? copy(value, null) : value;\n                      watch.fn(value, ((last === initWatchVal) ? value : last), current);\n                      if (ttl < 5) {\n                        logIdx = 4 - ttl;\n                        if (!watchLog[logIdx]) watchLog[logIdx] = [];\n                        watchLog[logIdx].push({\n                          msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n                          newVal: value,\n                          oldVal: last\n                        });\n                      }\n                    } else if (watch === lastDirtyWatch) {\n                      // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n                      // have already been tested.\n                      dirty = false;\n                      break traverseScopesLoop;\n                    }\n                  }\n                } catch (e) {\n                  $exceptionHandler(e);\n                }\n              }\n            }\n\n            // Insanity Warning: scope depth-first traversal\n            // yes, this code is a bit crazy, but it works and we have tests to prove it!\n            // this piece should be kept in sync with the traversal in $broadcast\n            if (!(next = (current.$$childHead ||\n                (current !== target && current.$$nextSibling)))) {\n              while (current !== target && !(next = current.$$nextSibling)) {\n                current = current.$parent;\n              }\n            }\n          } while ((current = next));\n\n          // `break traverseScopesLoop;` takes us to here\n\n          if ((dirty || asyncQueue.length) && !(ttl--)) {\n            clearPhase();\n            throw $rootScopeMinErr('infdig',\n                '{0} $digest() iterations reached. Aborting!\\n' +\n                'Watchers fired in the last 5 iterations: {1}',\n                TTL, watchLog);\n          }\n\n        } while (dirty || asyncQueue.length);\n\n        clearPhase();\n\n        while (postDigestQueue.length) {\n          try {\n            postDigestQueue.shift()();\n          } catch (e) {\n            $exceptionHandler(e);\n          }\n        }\n      },\n\n\n      /**\n       * @ngdoc event\n       * @name $rootScope.Scope#$destroy\n       * @eventType broadcast on scope being destroyed\n       *\n       * @description\n       * Broadcasted when a scope and its children are being destroyed.\n       *\n       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n       * clean up DOM bindings before an element is removed from the DOM.\n       */\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$destroy\n       * @kind function\n       *\n       * @description\n       * Removes the current scope (and all of its children) from the parent scope. Removal implies\n       * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n       * propagate to the current scope and its children. Removal also implies that the current\n       * scope is eligible for garbage collection.\n       *\n       * The `$destroy()` is usually used by directives such as\n       * {@link ng.directive:ngRepeat ngRepeat} for managing the\n       * unrolling of the loop.\n       *\n       * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n       * Application code can register a `$destroy` event handler that will give it a chance to\n       * perform any necessary cleanup.\n       *\n       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n       * clean up DOM bindings before an element is removed from the DOM.\n       */\n      $destroy: function() {\n        // we can't destroy the root scope or a scope that has been already destroyed\n        if (this.$$destroyed) return;\n        var parent = this.$parent;\n\n        this.$broadcast('$destroy');\n        this.$$destroyed = true;\n        if (this === $rootScope) return;\n\n        for (var eventName in this.$$listenerCount) {\n          decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n        }\n\n        // sever all the references to parent scopes (after this cleanup, the current scope should\n        // not be retained by any of our references and should be eligible for garbage collection)\n        if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;\n        if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;\n        if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n        if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n        // Disable listeners, watchers and apply/digest methods\n        this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n        this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n        this.$$listeners = {};\n\n        // All of the code below is bogus code that works around V8's memory leak via optimized code\n        // and inline caches.\n        //\n        // see:\n        // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n        // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n        // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n        this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =\n            this.$$childTail = this.$root = this.$$watchers = null;\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$eval\n       * @kind function\n       *\n       * @description\n       * Executes the `expression` on the current scope and returns the result. Any exceptions in\n       * the expression are propagated (uncaught). This is useful when evaluating Angular\n       * expressions.\n       *\n       * # Example\n       * ```js\n           var scope = ng.$rootScope.Scope();\n           scope.a = 1;\n           scope.b = 2;\n\n           expect(scope.$eval('a+b')).toEqual(3);\n           expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n       * ```\n       *\n       * @param {(string|function())=} expression An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in  {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with the current `scope` parameter.\n       *\n       * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n       * @returns {*} The result of evaluating the expression.\n       */\n      $eval: function(expr, locals) {\n        return $parse(expr)(this, locals);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$evalAsync\n       * @kind function\n       *\n       * @description\n       * Executes the expression on the current scope at a later point in time.\n       *\n       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n       * that:\n       *\n       *   - it will execute after the function that scheduled the evaluation (preferably before DOM\n       *     rendering).\n       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n       *     `expression` execution.\n       *\n       * Any exceptions from the execution of the expression are forwarded to the\n       * {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n       * will be scheduled. However, it is encouraged to always call code that changes the model\n       * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n       *\n       * @param {(string|function())=} expression An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with the current `scope` parameter.\n       *\n       * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n       */\n      $evalAsync: function(expr, locals) {\n        // if we are outside of an $digest loop and this is the first time we are scheduling async\n        // task also schedule async auto-flush\n        if (!$rootScope.$$phase && !asyncQueue.length) {\n          $browser.defer(function() {\n            if (asyncQueue.length) {\n              $rootScope.$digest();\n            }\n          });\n        }\n\n        asyncQueue.push({scope: this, expression: expr, locals: locals});\n      },\n\n      $$postDigest: function(fn) {\n        postDigestQueue.push(fn);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$apply\n       * @kind function\n       *\n       * @description\n       * `$apply()` is used to execute an expression in angular from outside of the angular\n       * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n       * Because we are calling into the angular framework we need to perform proper scope life\n       * cycle of {@link ng.$exceptionHandler exception handling},\n       * {@link ng.$rootScope.Scope#$digest executing watches}.\n       *\n       * ## Life cycle\n       *\n       * # Pseudo-Code of `$apply()`\n       * ```js\n           function $apply(expr) {\n             try {\n               return $eval(expr);\n             } catch (e) {\n               $exceptionHandler(e);\n             } finally {\n               $root.$digest();\n             }\n           }\n       * ```\n       *\n       *\n       * Scope's `$apply()` method transitions through the following stages:\n       *\n       * 1. The {@link guide/expression expression} is executed using the\n       *    {@link ng.$rootScope.Scope#$eval $eval()} method.\n       * 2. Any exceptions from the execution of the expression are forwarded to the\n       *    {@link ng.$exceptionHandler $exceptionHandler} service.\n       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n       *    expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n       *\n       *\n       * @param {(string|function())=} exp An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with current `scope` parameter.\n       *\n       * @returns {*} The result of evaluating the expression.\n       */\n      $apply: function(expr) {\n        try {\n          beginPhase('$apply');\n          return this.$eval(expr);\n        } catch (e) {\n          $exceptionHandler(e);\n        } finally {\n          clearPhase();\n          try {\n            $rootScope.$digest();\n          } catch (e) {\n            $exceptionHandler(e);\n            throw e;\n          }\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$applyAsync\n       * @kind function\n       *\n       * @description\n       * Schedule the invocation of $apply to occur at a later time. The actual time difference\n       * varies across browsers, but is typically around ~10 milliseconds.\n       *\n       * This can be used to queue up multiple expressions which need to be evaluated in the same\n       * digest.\n       *\n       * @param {(string|function())=} exp An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with current `scope` parameter.\n       */\n      $applyAsync: function(expr) {\n        var scope = this;\n        expr && applyAsyncQueue.push($applyAsyncExpression);\n        scheduleApplyAsync();\n\n        function $applyAsyncExpression() {\n          scope.$eval(expr);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$on\n       * @kind function\n       *\n       * @description\n       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n       * discussion of event life cycle.\n       *\n       * The event listener function format is: `function(event, args...)`. The `event` object\n       * passed into the listener has the following attributes:\n       *\n       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n       *     `$broadcast`-ed.\n       *   - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n       *     event propagates through the scope hierarchy, this property is set to null.\n       *   - `name` - `{string}`: name of the event.\n       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n       *     further event propagation (available only for events that were `$emit`-ed).\n       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n       *     to true.\n       *   - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n       *\n       * @param {string} name Event name to listen on.\n       * @param {function(event, ...args)} listener Function to call when the event is emitted.\n       * @returns {function()} Returns a deregistration function for this listener.\n       */\n      $on: function(name, listener) {\n        var namedListeners = this.$$listeners[name];\n        if (!namedListeners) {\n          this.$$listeners[name] = namedListeners = [];\n        }\n        namedListeners.push(listener);\n\n        var current = this;\n        do {\n          if (!current.$$listenerCount[name]) {\n            current.$$listenerCount[name] = 0;\n          }\n          current.$$listenerCount[name]++;\n        } while ((current = current.$parent));\n\n        var self = this;\n        return function() {\n          var indexOfListener = namedListeners.indexOf(listener);\n          if (indexOfListener !== -1) {\n            namedListeners[indexOfListener] = null;\n            decrementListenerCount(self, 1, name);\n          }\n        };\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$emit\n       * @kind function\n       *\n       * @description\n       * Dispatches an event `name` upwards through the scope hierarchy notifying the\n       * registered {@link ng.$rootScope.Scope#$on} listeners.\n       *\n       * The event life cycle starts at the scope on which `$emit` was called. All\n       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n       * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n       * registered listeners along the way. The event will stop propagating if one of the listeners\n       * cancels it.\n       *\n       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * @param {string} name Event name to emit.\n       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n       * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n       */\n      $emit: function(name, args) {\n        var empty = [],\n            namedListeners,\n            scope = this,\n            stopPropagation = false,\n            event = {\n              name: name,\n              targetScope: scope,\n              stopPropagation: function() {stopPropagation = true;},\n              preventDefault: function() {\n                event.defaultPrevented = true;\n              },\n              defaultPrevented: false\n            },\n            listenerArgs = concat([event], arguments, 1),\n            i, length;\n\n        do {\n          namedListeners = scope.$$listeners[name] || empty;\n          event.currentScope = scope;\n          for (i = 0, length = namedListeners.length; i < length; i++) {\n\n            // if listeners were deregistered, defragment the array\n            if (!namedListeners[i]) {\n              namedListeners.splice(i, 1);\n              i--;\n              length--;\n              continue;\n            }\n            try {\n              //allow all listeners attached to the current scope to run\n              namedListeners[i].apply(null, listenerArgs);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n          }\n          //if any listener on the current scope stops propagation, prevent bubbling\n          if (stopPropagation) {\n            event.currentScope = null;\n            return event;\n          }\n          //traverse upwards\n          scope = scope.$parent;\n        } while (scope);\n\n        event.currentScope = null;\n\n        return event;\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$broadcast\n       * @kind function\n       *\n       * @description\n       * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n       * registered {@link ng.$rootScope.Scope#$on} listeners.\n       *\n       * The event life cycle starts at the scope on which `$broadcast` was called. All\n       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n       * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n       * scope and calls all registered listeners along the way. The event cannot be canceled.\n       *\n       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * @param {string} name Event name to broadcast.\n       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n       * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n       */\n      $broadcast: function(name, args) {\n        var target = this,\n            current = target,\n            next = target,\n            event = {\n              name: name,\n              targetScope: target,\n              preventDefault: function() {\n                event.defaultPrevented = true;\n              },\n              defaultPrevented: false\n            };\n\n        if (!target.$$listenerCount[name]) return event;\n\n        var listenerArgs = concat([event], arguments, 1),\n            listeners, i, length;\n\n        //down while you can, then up and next sibling or up and next sibling until back at root\n        while ((current = next)) {\n          event.currentScope = current;\n          listeners = current.$$listeners[name] || [];\n          for (i = 0, length = listeners.length; i < length; i++) {\n            // if listeners were deregistered, defragment the array\n            if (!listeners[i]) {\n              listeners.splice(i, 1);\n              i--;\n              length--;\n              continue;\n            }\n\n            try {\n              listeners[i].apply(null, listenerArgs);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n          }\n\n          // Insanity Warning: scope depth-first traversal\n          // yes, this code is a bit crazy, but it works and we have tests to prove it!\n          // this piece should be kept in sync with the traversal in $digest\n          // (though it differs due to having the extra check for $$listenerCount)\n          if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n              (current !== target && current.$$nextSibling)))) {\n            while (current !== target && !(next = current.$$nextSibling)) {\n              current = current.$parent;\n            }\n          }\n        }\n\n        event.currentScope = null;\n        return event;\n      }\n    };\n\n    var $rootScope = new Scope();\n\n    //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n    var asyncQueue = $rootScope.$$asyncQueue = [];\n    var postDigestQueue = $rootScope.$$postDigestQueue = [];\n    var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n    return $rootScope;\n\n\n    function beginPhase(phase) {\n      if ($rootScope.$$phase) {\n        throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n      }\n\n      $rootScope.$$phase = phase;\n    }\n\n    function clearPhase() {\n      $rootScope.$$phase = null;\n    }\n\n\n    function decrementListenerCount(current, count, name) {\n      do {\n        current.$$listenerCount[name] -= count;\n\n        if (current.$$listenerCount[name] === 0) {\n          delete current.$$listenerCount[name];\n        }\n      } while ((current = current.$parent));\n    }\n\n    /**\n     * function used as an initial value for watchers.\n     * because it's unique we can easily tell it apart from other values\n     */\n    function initWatchVal() {}\n\n    function flushApplyAsync() {\n      while (applyAsyncQueue.length) {\n        try {\n          applyAsyncQueue.shift()();\n        } catch (e) {\n          $exceptionHandler(e);\n        }\n      }\n      applyAsyncId = null;\n    }\n\n    function scheduleApplyAsync() {\n      if (applyAsyncId === null) {\n        applyAsyncId = $browser.defer(function() {\n          $rootScope.$apply(flushApplyAsync);\n        });\n      }\n    }\n  }];\n}\n\n/**\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n  var aHrefSanitizationWhitelist = /^\\s*(https?|ftp|mailto|tel|file):/,\n    imgSrcSanitizationWhitelist = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n  /**\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during a[href] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.aHrefSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      aHrefSanitizationWhitelist = regexp;\n      return this;\n    }\n    return aHrefSanitizationWhitelist;\n  };\n\n\n  /**\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during img[src] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.imgSrcSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      imgSrcSanitizationWhitelist = regexp;\n      return this;\n    }\n    return imgSrcSanitizationWhitelist;\n  };\n\n  this.$get = function() {\n    return function sanitizeUri(uri, isImage) {\n      var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;\n      var normalizedVal;\n      normalizedVal = urlResolve(uri).href;\n      if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n        return 'unsafe:' + normalizedVal;\n      }\n      return uri;\n    };\n  };\n}\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n  HTML: 'html',\n  CSS: 'css',\n  URL: 'url',\n  // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a\n  // url.  (e.g. ng-include, script src, templateUrl)\n  RESOURCE_URL: 'resourceUrl',\n  JS: 'js'\n};\n\n// Helper functions follow.\n\nfunction adjustMatcher(matcher) {\n  if (matcher === 'self') {\n    return matcher;\n  } else if (isString(matcher)) {\n    // Strings match exactly except for 2 wildcards - '*' and '**'.\n    // '*' matches any character except those from the set ':/.?&'.\n    // '**' matches any character (like .* in a RegExp).\n    // More than 2 *'s raises an error as it's ill defined.\n    if (matcher.indexOf('***') > -1) {\n      throw $sceMinErr('iwcard',\n          'Illegal sequence *** in string matcher.  String: {0}', matcher);\n    }\n    matcher = escapeForRegexp(matcher).\n                  replace('\\\\*\\\\*', '.*').\n                  replace('\\\\*', '[^:/.?&;]*');\n    return new RegExp('^' + matcher + '$');\n  } else if (isRegExp(matcher)) {\n    // The only other type of matcher allowed is a Regexp.\n    // Match entire URL / disallow partial matches.\n    // Flags are reset (i.e. no global, ignoreCase or multiline)\n    return new RegExp('^' + matcher.source + '$');\n  } else {\n    throw $sceMinErr('imatcher',\n        'Matchers may only be \"self\", string patterns or RegExp objects');\n  }\n}\n\n\nfunction adjustMatchers(matchers) {\n  var adjustedMatchers = [];\n  if (isDefined(matchers)) {\n    forEach(matchers, function(matcher) {\n      adjustedMatchers.push(adjustMatcher(matcher));\n    });\n  }\n  return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS.  This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain.  While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as\n * templates.  Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate} service.  This allows one to get/set the whitelists and blacklists used to ensure\n * that the URLs used for sourcing Angular templates are safe.  Refer {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and\n * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n *\n * For the general details about this service in Angular, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**:  Consider the following case. <a name=\"example\"></a>\n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n *   `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n *  angular.module('myApp', []).config(function($sceDelegateProvider) {\n *    $sceDelegateProvider.resourceUrlWhitelist([\n *      // Allow same origin resource loads.\n *      'self',\n *      // Allow loading from our assets domain.  Notice the difference between * and **.\n *      'http://srv*.assets.example.com/**'\n *    ]);\n *\n *    // The blacklist overrides the whitelist so the open redirect here is blocked.\n *    $sceDelegateProvider.resourceUrlBlacklist([\n *      'http://myapp.example.com/clickThru**'\n *    ]);\n *  });\n * ```\n */\n\nfunction $SceDelegateProvider() {\n  this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n  // Resource URLs can also be trusted by policy.\n  var resourceUrlWhitelist = ['self'],\n      resourceUrlBlacklist = [];\n\n  /**\n   * @ngdoc method\n   * @name $sceDelegateProvider#resourceUrlWhitelist\n   * @kind function\n   *\n   * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value\n   *     provided.  This must be an array or null.  A snapshot of this array is used so further\n   *     changes to the array are ignored.\n   *\n   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n   *     allowed in this array.\n   *\n   *     Note: **an empty whitelist array will block all URLs**!\n   *\n   * @return {Array} the currently set whitelist array.\n   *\n   * The **default value** when no whitelist has been explicitly set is `['self']` allowing only\n   * same origin resource requests.\n   *\n   * @description\n   * Sets/Gets the whitelist of trusted resource URLs.\n   */\n  this.resourceUrlWhitelist = function(value) {\n    if (arguments.length) {\n      resourceUrlWhitelist = adjustMatchers(value);\n    }\n    return resourceUrlWhitelist;\n  };\n\n  /**\n   * @ngdoc method\n   * @name $sceDelegateProvider#resourceUrlBlacklist\n   * @kind function\n   *\n   * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value\n   *     provided.  This must be an array or null.  A snapshot of this array is used so further\n   *     changes to the array are ignored.\n   *\n   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n   *     allowed in this array.\n   *\n   *     The typical usage for the blacklist is to **block\n   *     [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n   *     these would otherwise be trusted but actually return content from the redirected domain.\n   *\n   *     Finally, **the blacklist overrides the whitelist** and has the final say.\n   *\n   * @return {Array} the currently set blacklist array.\n   *\n   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there\n   * is no blacklist.)\n   *\n   * @description\n   * Sets/Gets the blacklist of trusted resource URLs.\n   */\n\n  this.resourceUrlBlacklist = function(value) {\n    if (arguments.length) {\n      resourceUrlBlacklist = adjustMatchers(value);\n    }\n    return resourceUrlBlacklist;\n  };\n\n  this.$get = ['$injector', function($injector) {\n\n    var htmlSanitizer = function htmlSanitizer(html) {\n      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n    };\n\n    if ($injector.has('$sanitize')) {\n      htmlSanitizer = $injector.get('$sanitize');\n    }\n\n\n    function matchUrl(matcher, parsedUrl) {\n      if (matcher === 'self') {\n        return urlIsSameOrigin(parsedUrl);\n      } else {\n        // definitely a regex.  See adjustMatchers()\n        return !!matcher.exec(parsedUrl.href);\n      }\n    }\n\n    function isResourceUrlAllowedByPolicy(url) {\n      var parsedUrl = urlResolve(url.toString());\n      var i, n, allowed = false;\n      // Ensure that at least one item from the whitelist allows this url.\n      for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {\n        if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {\n          allowed = true;\n          break;\n        }\n      }\n      if (allowed) {\n        // Ensure that no item from the blacklist blocked this url.\n        for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {\n          if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {\n            allowed = false;\n            break;\n          }\n        }\n      }\n      return allowed;\n    }\n\n    function generateHolderType(Base) {\n      var holderType = function TrustedValueHolderType(trustedValue) {\n        this.$$unwrapTrustedValue = function() {\n          return trustedValue;\n        };\n      };\n      if (Base) {\n        holderType.prototype = new Base();\n      }\n      holderType.prototype.valueOf = function sceValueOf() {\n        return this.$$unwrapTrustedValue();\n      };\n      holderType.prototype.toString = function sceToString() {\n        return this.$$unwrapTrustedValue().toString();\n      };\n      return holderType;\n    }\n\n    var trustedValueHolderBase = generateHolderType(),\n        byType = {};\n\n    byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#trustAs\n     *\n     * @description\n     * Returns an object that is trusted by angular for use in specified strict\n     * contextual escaping contexts (such as ng-bind-html, ng-include, any src\n     * attribute interpolation, any dom event binding attribute interpolation\n     * such as for onclick,  etc.) that uses the provided value.\n     * See {@link ng.$sce $sce} for enabling strict contextual escaping.\n     *\n     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,\n     *   resourceUrl, html, js and css.\n     * @param {*} value The value that that should be considered trusted/safe.\n     * @returns {*} A value that can be used to stand in for the provided `value` in places\n     * where Angular expects a $sce.trustAs() return value.\n     */\n    function trustAs(type, trustedValue) {\n      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n      if (!Constructor) {\n        throw $sceMinErr('icontext',\n            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n            type, trustedValue);\n      }\n      if (trustedValue === null || trustedValue === undefined || trustedValue === '') {\n        return trustedValue;\n      }\n      // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting\n      // mutable objects, we ensure here that the value passed in is actually a string.\n      if (typeof trustedValue !== 'string') {\n        throw $sceMinErr('itype',\n            'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n            type);\n      }\n      return new Constructor(trustedValue);\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#valueOf\n     *\n     * @description\n     * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n     * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n     *\n     * If the passed parameter is not a value that had been returned by {@link\n     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.\n     *\n     * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n     *      call or anything else.\n     * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns\n     *     `value` unchanged.\n     */\n    function valueOf(maybeTrusted) {\n      if (maybeTrusted instanceof trustedValueHolderBase) {\n        return maybeTrusted.$$unwrapTrustedValue();\n      } else {\n        return maybeTrusted;\n      }\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#getTrusted\n     *\n     * @description\n     * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and\n     * returns the originally supplied value if the queried context type is a supertype of the\n     * created type.  If this condition isn't satisfied, throws an exception.\n     *\n     * @param {string} type The kind of context in which this value is to be used.\n     * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} call.\n     * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} if valid in this context.  Otherwise, throws an exception.\n     */\n    function getTrusted(type, maybeTrusted) {\n      if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') {\n        return maybeTrusted;\n      }\n      var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n      if (constructor && maybeTrusted instanceof constructor) {\n        return maybeTrusted.$$unwrapTrustedValue();\n      }\n      // If we get here, then we may only take one of two actions.\n      // 1. sanitize the value for the requested type, or\n      // 2. throw an exception.\n      if (type === SCE_CONTEXTS.RESOURCE_URL) {\n        if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n          return maybeTrusted;\n        } else {\n          throw $sceMinErr('insecurl',\n              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}',\n              maybeTrusted.toString());\n        }\n      } else if (type === SCE_CONTEXTS.HTML) {\n        return htmlSanitizer(maybeTrusted);\n      }\n      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n    }\n\n    return { trustAs: trustAs,\n             getTrusted: getTrusted,\n             valueOf: valueOf };\n  }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * -   enable/disable Strict Contextual Escaping (SCE) in a module\n * -   override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/* jshint maxlen: false*/\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * # Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain\n * contexts to result in a value that is marked as safe to use for that context.  One example of\n * such a context is binding arbitrary html controlled by the user via `ng-bind-html`.  We refer\n * to these contexts as privileged or SCE contexts.\n *\n * As of version 1.2, Angular ships with SCE enabled by default.\n *\n * Note:  When enabled (the default), IE<11 in quirks mode is not supported.  In this mode, IE<11 allow\n * one to execute arbitrary javascript by the use of the expression() syntax.  Refer\n * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.\n * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`\n * to the top of your HTML document.\n *\n * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for\n * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * <input ng-model=\"userHtml\">\n * <div ng-bind-html=\"userHtml\"></div>\n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user.  With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV.\n * In a more realistic example, one may be rendering user comments, blog articles, etc. via\n * bindings.  (HTML is just one example of a context where rendering user controlled input creates\n * security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?)  How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, you want to ensure that any such bindings are disallowed unless you can\n * determine that something explicitly says it's safe to use a value for binding in that\n * context.  You can then audit your code (a simple grep would do) to ensure that this is only done\n * for those values that you can easily tell are safe - because they were received from your server,\n * sanitized by your library, etc.  You can organize your codebase to help with this - perhaps\n * allowing only the files in a specific directory to do this.  Ensuring that the internal API\n * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * obtain values that will be accepted by SCE / privileged contexts.\n *\n *\n * ## How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly.  Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the\n * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}.  Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n *   return function(scope, element, attr) {\n *     scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n *       element.html(value || '');\n *     });\n *   };\n * }];\n * ```\n *\n * ## Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, Angular only loads templates from the same domain and protocol as the application\n * document.  This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL.  To load templates from other domains and/or\n * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded.  This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers.  Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ## This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.\n * `<div ng-bind-html=\"'<b>implicitly trusted</b>'\"></div>`) just works.\n *\n * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them\n * through {@link ng.$sce#getTrusted $sce.getTrusted}.  SCE doesn't play a role here.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document.  You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.\n *\n * This significantly reduces the overhead.  It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * <a name=\"contexts\"></a>\n * ## What trusted context types are supported?\n *\n * | Context             | Notes          |\n * |---------------------|----------------|\n * | `$sce.HTML`         | For HTML that's safe to source into the application.  The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS`          | For CSS that's safe to source into the application.  Currently unused.  Feel free to use it in your own directives. |\n * | `$sce.URL`          | For URLs that are safe to follow as links.  Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application.  Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)  <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |\n * | `$sce.JS`           | For JavaScript that is safe to execute in your application's context.  Currently unused.  Feel free to use it in your own directives. |\n *\n * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name=\"resourceUrlPatternItem\"></a>\n *\n *  Each element in these arrays must be one of the following:\n *\n *  - **'self'**\n *    - The special **string**, `'self'`, can be used to match against all URLs of the **same\n *      domain** as the application document using the **same protocol**.\n *  - **String** (except the special value `'self'`)\n *    - The string is matched against the full *normalized / absolute URL* of the resource\n *      being tested (substring matches are not good enough.)\n *    - There are exactly **two wildcard sequences** - `*` and `**`.  All other characters\n *      match themselves.\n *    - `*`: matches zero or more occurrences of any character other than one of the following 6\n *      characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'.  It's a useful wildcard for use\n *      in a whitelist.\n *    - `**`: matches zero or more occurrences of *any* character.  As such, it's not\n *      not appropriate to use in for a scheme, domain, etc. as it would match too much.  (e.g.\n *      http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n *      not have been the intention.)  Its usage at the very end of the path is ok.  (e.g.\n *      http://foo.example.com/templates/**).\n *  - **RegExp** (*see caveat below*)\n *    - *Caveat*:  While regular expressions are powerful and offer great flexibility,  their syntax\n *      (and all the inevitable escaping) makes them *harder to maintain*.  It's easy to\n *      accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n *      have good test coverage.).  For instance, the use of `.` in the regex is correct only in a\n *      small number of cases.  A `.` character in the regex used when matching the scheme or a\n *      subdomain could be matched against a `:` or literal `.` that was likely not intended.   It\n *      is highly recommended to use the string patterns and only fall back to regular expressions\n *      if they as a last resort.\n *    - The regular expression must be an instance of RegExp (i.e. not a string.)  It is\n *      matched against the **entire** *normalized / absolute URL* of the resource being tested\n *      (even when the RegExp did not have the `^` and `$` codes.)  In addition, any flags\n *      present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n *    - If you are generating your JavaScript from some other templating engine (not\n *      recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n *      remember to escape your regular expression (and be aware that you might need more than\n *      one level of escaping depending on your templating engine and the way you interpolated\n *      the value.)  Do make use of your platform's escaping mechanism as it might be good\n *      enough before coding your own.  e.g. Ruby has\n *      [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n *      and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n *      Javascript lacks a similar built in function for escaping.  Take a look at Google\n *      Closure library's [goog.string.regExpEscape(s)](\n *      http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ## Show me an example using SCE.\n *\n * <example module=\"mySceApp\" deps=\"angular-sanitize.js\">\n * <file name=\"index.html\">\n *   <div ng-controller=\"AppController as myCtrl\">\n *     <i ng-bind-html=\"myCtrl.explicitlyTrustedHtml\" id=\"explicitlyTrustedHtml\"></i><br><br>\n *     <b>User comments</b><br>\n *     By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n *     $sanitize is available.  If $sanitize isn't available, this results in an error instead of an\n *     exploit.\n *     <div class=\"well\">\n *       <div ng-repeat=\"userComment in myCtrl.userComments\">\n *         <b>{{userComment.name}}</b>:\n *         <span ng-bind-html=\"userComment.htmlComment\" class=\"htmlComment\"></span>\n *         <br>\n *       </div>\n *     </div>\n *   </div>\n * </file>\n *\n * <file name=\"script.js\">\n *   angular.module('mySceApp', ['ngSanitize'])\n *     .controller('AppController', ['$http', '$templateCache', '$sce',\n *       function($http, $templateCache, $sce) {\n *         var self = this;\n *         $http.get(\"test_data.json\", {cache: $templateCache}).success(function(userComments) {\n *           self.userComments = userComments;\n *         });\n *         self.explicitlyTrustedHtml = $sce.trustAsHtml(\n *             '<span onmouseover=\"this.textContent=&quot;Explicitly trusted HTML bypasses ' +\n *             'sanitization.&quot;\">Hover over this text.</span>');\n *       }]);\n * </file>\n *\n * <file name=\"test_data.json\">\n * [\n *   { \"name\": \"Alice\",\n *     \"htmlComment\":\n *         \"<span onmouseover='this.textContent=\\\"PWN3D!\\\"'>Is <i>anyone</i> reading this?</span>\"\n *   },\n *   { \"name\": \"Bob\",\n *     \"htmlComment\": \"<i>Yes!</i>  Am I the only other one?\"\n *   }\n * ]\n * </file>\n *\n * <file name=\"protractor.js\" type=\"protractor\">\n *   describe('SCE doc demo', function() {\n *     it('should sanitize untrusted values', function() {\n *       expect(element.all(by.css('.htmlComment')).first().getInnerHtml())\n *           .toBe('<span>Is <i>anyone</i> reading this?</span>');\n *     });\n *\n *     it('should NOT sanitize explicitly trusted values', function() {\n *       expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(\n *           '<span onmouseover=\"this.textContent=&quot;Explicitly trusted HTML bypasses ' +\n *           'sanitization.&quot;\">Hover over this text.</span>');\n *     });\n *   });\n * </file>\n * </example>\n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can.  However, this is strongly discouraged.  SCE gives you a lot of security benefits\n * for little coding overhead.  It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage.  It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n *   // Completely disable SCE.  For demonstration purposes only!\n *   // Do not use in new projects.\n *   $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n/* jshint maxlen: 100 */\n\nfunction $SceProvider() {\n  var enabled = true;\n\n  /**\n   * @ngdoc method\n   * @name $sceProvider#enabled\n   * @kind function\n   *\n   * @param {boolean=} value If provided, then enables/disables SCE.\n   * @return {boolean} true if SCE is enabled, false otherwise.\n   *\n   * @description\n   * Enables/disables SCE and returns the current value.\n   */\n  this.enabled = function(value) {\n    if (arguments.length) {\n      enabled = !!value;\n    }\n    return enabled;\n  };\n\n\n  /* Design notes on the default implementation for SCE.\n   *\n   * The API contract for the SCE delegate\n   * -------------------------------------\n   * The SCE delegate object must provide the following 3 methods:\n   *\n   * - trustAs(contextEnum, value)\n   *     This method is used to tell the SCE service that the provided value is OK to use in the\n   *     contexts specified by contextEnum.  It must return an object that will be accepted by\n   *     getTrusted() for a compatible contextEnum and return this value.\n   *\n   * - valueOf(value)\n   *     For values that were not produced by trustAs(), return them as is.  For values that were\n   *     produced by trustAs(), return the corresponding input value to trustAs.  Basically, if\n   *     trustAs is wrapping the given values into some type, this operation unwraps it when given\n   *     such a value.\n   *\n   * - getTrusted(contextEnum, value)\n   *     This function should return the a value that is safe to use in the context specified by\n   *     contextEnum or throw and exception otherwise.\n   *\n   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n   * opaque or wrapped in some holder object.  That happens to be an implementation detail.  For\n   * instance, an implementation could maintain a registry of all trusted objects by context.  In\n   * such a case, trustAs() would return the same object that was passed in.  getTrusted() would\n   * return the same object passed in if it was found in the registry under a compatible context or\n   * throw an exception otherwise.  An implementation might only wrap values some of the time based\n   * on some criteria.  getTrusted() might return a value and not throw an exception for special\n   * constants or objects even if not wrapped.  All such implementations fulfill this contract.\n   *\n   *\n   * A note on the inheritance model for SCE contexts\n   * ------------------------------------------------\n   * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types.  This\n   * is purely an implementation details.\n   *\n   * The contract is simply this:\n   *\n   *     getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n   *     will also succeed.\n   *\n   * Inheritance happens to capture this in a natural way.  In some future, we\n   * may not use inheritance anymore.  That is OK because no code outside of\n   * sce.js and sceSpecs.js would need to be aware of this detail.\n   */\n\n  this.$get = ['$parse', '$sceDelegate', function(\n                $parse,   $sceDelegate) {\n    // Prereq: Ensure that we're not running in IE<11 quirks mode.  In that mode, IE < 11 allow\n    // the \"expression(javascript expression)\" syntax which is insecure.\n    if (enabled && msie < 8) {\n      throw $sceMinErr('iequirks',\n        'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n        'mode.  You can fix this by adding the text <!doctype html> to the top of your HTML ' +\n        'document.  See http://docs.angularjs.org/api/ng.$sce for more information.');\n    }\n\n    var sce = shallowCopy(SCE_CONTEXTS);\n\n    /**\n     * @ngdoc method\n     * @name $sce#isEnabled\n     * @kind function\n     *\n     * @return {Boolean} true if SCE is enabled, false otherwise.  If you want to set the value, you\n     * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n     *\n     * @description\n     * Returns a boolean indicating if SCE is enabled.\n     */\n    sce.isEnabled = function() {\n      return enabled;\n    };\n    sce.trustAs = $sceDelegate.trustAs;\n    sce.getTrusted = $sceDelegate.getTrusted;\n    sce.valueOf = $sceDelegate.valueOf;\n\n    if (!enabled) {\n      sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n      sce.valueOf = identity;\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAs\n     *\n     * @description\n     * Converts Angular {@link guide/expression expression} into a function.  This is like {@link\n     * ng.$parse $parse} and is identical when the expression is a literal constant.  Otherwise, it\n     * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n     * *result*)}\n     *\n     * @param {string} type The kind of SCE context in which this result will be used.\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n    sce.parseAs = function sceParseAs(type, expr) {\n      var parsed = $parse(expr);\n      if (parsed.literal && parsed.constant) {\n        return parsed;\n      } else {\n        return $parse(expr, function(value) {\n          return sce.getTrusted(type, value);\n        });\n      }\n    };\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAs\n     *\n     * @description\n     * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.  As such,\n     * returns an object that is trusted by angular for use in specified strict contextual\n     * escaping contexts (such as ng-bind-html, ng-include, any src attribute\n     * interpolation, any dom event binding attribute interpolation such as for onclick,  etc.)\n     * that uses the provided value.  See * {@link ng.$sce $sce} for enabling strict contextual\n     * escaping.\n     *\n     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,\n     *   resource_url, html, js and css.\n     * @param {*} value The value that that should be considered trusted/safe.\n     * @returns {*} A value that can be used to stand in for the provided `value` in places\n     * where Angular expects a $sce.trustAs() return value.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsHtml(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml\n     *     $sce.getTrustedHtml(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsUrl(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl\n     *     $sce.getTrustedUrl(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsResourceUrl(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl\n     *     $sce.getTrustedResourceUrl(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the return\n     *     value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsJs\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsJs(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs\n     *     $sce.getTrustedJs(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrusted\n     *\n     * @description\n     * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}.  As such,\n     * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the\n     * originally supplied value if the queried context type is a supertype of the created type.\n     * If this condition isn't satisfied, throws an exception.\n     *\n     * @param {string} type The kind of context in which this value is to be used.\n     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}\n     *                         call.\n     * @returns {*} The value the was originally provided to\n     *              {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.\n     *              Otherwise, throws an exception.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedHtml(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedCss\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedCss(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedUrl(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n     *\n     * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedJs\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedJs(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsHtml(expression string)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsCss\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsCss(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsUrl(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsResourceUrl(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsJs\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsJs(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    // Shorthand delegations.\n    var parse = sce.parseAs,\n        getTrusted = sce.getTrusted,\n        trustAs = sce.trustAs;\n\n    forEach(SCE_CONTEXTS, function(enumValue, name) {\n      var lName = lowercase(name);\n      sce[camelCase(\"parse_as_\" + lName)] = function(expr) {\n        return parse(enumValue, expr);\n      };\n      sce[camelCase(\"get_trusted_\" + lName)] = function(value) {\n        return getTrusted(enumValue, value);\n      };\n      sce[camelCase(\"trust_as_\" + lName)] = function(value) {\n        return trustAs(enumValue, value);\n      };\n    });\n\n    return sce;\n  }];\n}\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n  this.$get = ['$window', '$document', function($window, $document) {\n    var eventSupport = {},\n        android =\n          int((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n        boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n        document = $document[0] || {},\n        vendorPrefix,\n        vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,\n        bodyStyle = document.body && document.body.style,\n        transitions = false,\n        animations = false,\n        match;\n\n    if (bodyStyle) {\n      for (var prop in bodyStyle) {\n        if (match = vendorRegex.exec(prop)) {\n          vendorPrefix = match[0];\n          vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);\n          break;\n        }\n      }\n\n      if (!vendorPrefix) {\n        vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';\n      }\n\n      transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));\n      animations  = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));\n\n      if (android && (!transitions ||  !animations)) {\n        transitions = isString(document.body.style.webkitTransition);\n        animations = isString(document.body.style.webkitAnimation);\n      }\n    }\n\n\n    return {\n      // Android has history.pushState, but it does not update location correctly\n      // so let's not use the history API at all.\n      // http://code.google.com/p/android/issues/detail?id=17471\n      // https://github.com/angular/angular.js/issues/904\n\n      // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n      // so let's not use the history API also\n      // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n      // jshint -W018\n      history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),\n      // jshint +W018\n      hasEvent: function(event) {\n        // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n        // it. In particular the event is not fired when backspace or delete key are pressed or\n        // when cut operation is performed.\n        // IE10+ implements 'input' event but it erroneously fires under various situations,\n        // e.g. when placeholder changes, or a form is focused.\n        if (event === 'input' && msie <= 11) return false;\n\n        if (isUndefined(eventSupport[event])) {\n          var divElm = document.createElement('div');\n          eventSupport[event] = 'on' + event in divElm;\n        }\n\n        return eventSupport[event];\n      },\n      csp: csp(),\n      vendorPrefix: vendorPrefix,\n      transitions: transitions,\n      animations: animations,\n      android: android\n    };\n  }];\n}\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service downloads the provided template using `$http` and, upon success,\n * stores the contents inside of `$templateCache`. If the HTTP request fails or the response data\n * of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted\n * by setting the 2nd parameter of the function to true).\n *\n * @param {string} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} the HTTP Promise for the given.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\nfunction $TemplateRequestProvider() {\n  this.$get = ['$templateCache', '$http', '$q', function($templateCache, $http, $q) {\n    function handleRequestFn(tpl, ignoreRequestError) {\n      handleRequestFn.totalPendingRequests++;\n\n      var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n      if (isArray(transformResponse)) {\n        transformResponse = transformResponse.filter(function(transformer) {\n          return transformer !== defaultHttpResponseTransform;\n        });\n      } else if (transformResponse === defaultHttpResponseTransform) {\n        transformResponse = null;\n      }\n\n      var httpOptions = {\n        cache: $templateCache,\n        transformResponse: transformResponse\n      };\n\n      return $http.get(tpl, httpOptions)\n        .finally(function() {\n          handleRequestFn.totalPendingRequests--;\n        })\n        .then(function(response) {\n          return response.data;\n        }, handleError);\n\n      function handleError(resp) {\n        if (!ignoreRequestError) {\n          throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl);\n        }\n        return $q.reject(resp);\n      }\n    }\n\n    handleRequestFn.totalPendingRequests = 0;\n\n    return handleRequestFn;\n  }];\n}\n\nfunction $$TestabilityProvider() {\n  this.$get = ['$rootScope', '$browser', '$location',\n       function($rootScope,   $browser,   $location) {\n\n    /**\n     * @name $testability\n     *\n     * @description\n     * The private $$testability service provides a collection of methods for use when debugging\n     * or by automated test and debugging tools.\n     */\n    var testability = {};\n\n    /**\n     * @name $$testability#findBindings\n     *\n     * @description\n     * Returns an array of elements that are bound (via ng-bind or {{}})\n     * to expressions matching the input.\n     *\n     * @param {Element} element The element root to search from.\n     * @param {string} expression The binding expression to match.\n     * @param {boolean} opt_exactMatch If true, only returns exact matches\n     *     for the expression. Filters and whitespace are ignored.\n     */\n    testability.findBindings = function(element, expression, opt_exactMatch) {\n      var bindings = element.getElementsByClassName('ng-binding');\n      var matches = [];\n      forEach(bindings, function(binding) {\n        var dataBinding = angular.element(binding).data('$binding');\n        if (dataBinding) {\n          forEach(dataBinding, function(bindingName) {\n            if (opt_exactMatch) {\n              var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n              if (matcher.test(bindingName)) {\n                matches.push(binding);\n              }\n            } else {\n              if (bindingName.indexOf(expression) != -1) {\n                matches.push(binding);\n              }\n            }\n          });\n        }\n      });\n      return matches;\n    };\n\n    /**\n     * @name $$testability#findModels\n     *\n     * @description\n     * Returns an array of elements that are two-way found via ng-model to\n     * expressions matching the input.\n     *\n     * @param {Element} element The element root to search from.\n     * @param {string} expression The model expression to match.\n     * @param {boolean} opt_exactMatch If true, only returns exact matches\n     *     for the expression.\n     */\n    testability.findModels = function(element, expression, opt_exactMatch) {\n      var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n      for (var p = 0; p < prefixes.length; ++p) {\n        var attributeEquals = opt_exactMatch ? '=' : '*=';\n        var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n        var elements = element.querySelectorAll(selector);\n        if (elements.length) {\n          return elements;\n        }\n      }\n    };\n\n    /**\n     * @name $$testability#getLocation\n     *\n     * @description\n     * Shortcut for getting the location in a browser agnostic way. Returns\n     *     the path, search, and hash. (e.g. /path?a=b#hash)\n     */\n    testability.getLocation = function() {\n      return $location.url();\n    };\n\n    /**\n     * @name $$testability#setLocation\n     *\n     * @description\n     * Shortcut for navigating to a location without doing a full page reload.\n     *\n     * @param {string} url The location url (path, search and hash,\n     *     e.g. /path?a=b#hash) to go to.\n     */\n    testability.setLocation = function(url) {\n      if (url !== $location.url()) {\n        $location.url(url);\n        $rootScope.$digest();\n      }\n    };\n\n    /**\n     * @name $$testability#whenStable\n     *\n     * @description\n     * Calls the callback when $timeout and $http requests are completed.\n     *\n     * @param {function} callback\n     */\n    testability.whenStable = function(callback) {\n      $browser.notifyWhenNoOutstandingRequests(callback);\n    };\n\n    return testability;\n  }];\n}\n\nfunction $TimeoutProvider() {\n  this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n       function($rootScope,   $browser,   $q,   $$q,   $exceptionHandler) {\n    var deferreds = {};\n\n\n     /**\n      * @ngdoc service\n      * @name $timeout\n      *\n      * @description\n      * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n      * block and delegates any exceptions to\n      * {@link ng.$exceptionHandler $exceptionHandler} service.\n      *\n      * The return value of registering a timeout function is a promise, which will be resolved when\n      * the timeout is reached and the timeout function is executed.\n      *\n      * To cancel a timeout request, call `$timeout.cancel(promise)`.\n      *\n      * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n      * synchronously flush the queue of deferred functions.\n      *\n      * @param {function()} fn A function, whose execution should be delayed.\n      * @param {number=} [delay=0] Delay in milliseconds.\n      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n      * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this\n      *   promise will be resolved with is the return value of the `fn` function.\n      *\n      */\n    function timeout(fn, delay, invokeApply) {\n      var skipApply = (isDefined(invokeApply) && !invokeApply),\n          deferred = (skipApply ? $$q : $q).defer(),\n          promise = deferred.promise,\n          timeoutId;\n\n      timeoutId = $browser.defer(function() {\n        try {\n          deferred.resolve(fn());\n        } catch (e) {\n          deferred.reject(e);\n          $exceptionHandler(e);\n        }\n        finally {\n          delete deferreds[promise.$$timeoutId];\n        }\n\n        if (!skipApply) $rootScope.$apply();\n      }, delay);\n\n      promise.$$timeoutId = timeoutId;\n      deferreds[timeoutId] = deferred;\n\n      return promise;\n    }\n\n\n     /**\n      * @ngdoc method\n      * @name $timeout#cancel\n      *\n      * @description\n      * Cancels a task associated with the `promise`. As a result of this, the promise will be\n      * resolved with a rejection.\n      *\n      * @param {Promise=} promise Promise returned by the `$timeout` function.\n      * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n      *   canceled.\n      */\n    timeout.cancel = function(promise) {\n      if (promise && promise.$$timeoutId in deferreds) {\n        deferreds[promise.$$timeoutId].reject('canceled');\n        delete deferreds[promise.$$timeoutId];\n        return $browser.defer.cancel(promise.$$timeoutId);\n      }\n      return false;\n    };\n\n    return timeout;\n  }];\n}\n\n// NOTE:  The usage of window and document instead of $window and $document here is\n// deliberate.  This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests.  In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here.  There is little value is mocking these out for this\n// service.\nvar urlParsingNode = document.createElement(\"a\");\nvar originUrl = urlResolve(window.location.href);\n\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL.  Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL.  This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc.  See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers.  However, the parsed components will not be set if the URL assigned did not specify\n * them.  (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.)  We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again.  This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node.  (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729)  However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n *   http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n *   http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *   http://url.spec.whatwg.org/#urlutils\n *   https://github.com/angular/angular.js/pull/2902\n *   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n *   | member name   | Description    |\n *   |---------------|----------------|\n *   | href          | A normalized version of the provided URL if it was not an absolute URL |\n *   | protocol      | The protocol including the trailing colon                              |\n *   | host          | The host and port (if the port is non-default) of the normalizedUrl    |\n *   | search        | The search params, minus the question mark                             |\n *   | hash          | The hash string, minus the hash symbol\n *   | hostname      | The hostname\n *   | port          | The port, without \":\"\n *   | pathname      | The pathname, beginning with \"/\"\n *\n */\nfunction urlResolve(url) {\n  var href = url;\n\n  if (msie) {\n    // Normalize before parse.  Refer Implementation Notes on why this is\n    // done in two steps on IE.\n    urlParsingNode.setAttribute(\"href\", href);\n    href = urlParsingNode.href;\n  }\n\n  urlParsingNode.setAttribute('href', href);\n\n  // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n  return {\n    href: urlParsingNode.href,\n    protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n    host: urlParsingNode.host,\n    search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n    hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n    hostname: urlParsingNode.hostname,\n    port: urlParsingNode.port,\n    pathname: (urlParsingNode.pathname.charAt(0) === '/')\n      ? urlParsingNode.pathname\n      : '/' + urlParsingNode.pathname\n  };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n  var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n  return (parsed.protocol === originUrl.protocol &&\n          parsed.host === originUrl.host);\n}\n\n/**\n * @ngdoc service\n * @name $window\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In angular we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope.  Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n   <example module=\"windowExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('windowExample', [])\n           .controller('ExampleController', ['$scope', '$window', function($scope, $window) {\n             $scope.greeting = 'Hello, World!';\n             $scope.doGreeting = function(greeting) {\n               $window.alert(greeting);\n             };\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input type=\"text\" ng-model=\"greeting\" />\n         <button ng-click=\"doGreeting(greeting)\">ALERT</button>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n      it('should display the greeting in the input box', function() {\n       element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n       // If we click the button it will block the test runner\n       // element(':button').click();\n      });\n     </file>\n   </example>\n */\nfunction $WindowProvider() {\n  this.$get = valueFn(window);\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n * ```js\n *   // Filter registration\n *   function MyModule($provide, $filterProvider) {\n *     // create a service to demonstrate injection (not always needed)\n *     $provide.value('greet', function(name){\n *       return 'Hello ' + name + '!';\n *     });\n *\n *     // register a filter factory which uses the\n *     // greet service to demonstrate DI.\n *     $filterProvider.register('greet', function(greet){\n *       // return the filter function which uses the greet service\n *       // to generate salutation\n *       return function(text) {\n *         // filters need to be forgiving so check input validity\n *         return text && greet(text) || text;\n *       };\n *     });\n *   }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n *   it('should be the same instance', inject(\n *     function($filterProvider) {\n *       $filterProvider.register('reverse', function(){\n *         return ...;\n *       });\n *     },\n *     function($filter, reverseFilter) {\n *       expect($filter('reverse')).toBe(reverseFilter);\n *     });\n * ```\n *\n *\n * For more information about how angular filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the Angular Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * The general syntax in templates is as follows:\n *\n *         {{ expression [| filter_name[:parameter_value] ... ] }}\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n   <example name=\"$filter\" module=\"filterExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"MainCtrl\">\n        <h3>{{ originalText }}</h3>\n        <h3>{{ filteredText }}</h3>\n       </div>\n     </file>\n\n     <file name=\"script.js\">\n      angular.module('filterExample', [])\n      .controller('MainCtrl', function($scope, $filter) {\n        $scope.originalText = 'hello';\n        $scope.filteredText = $filter('uppercase')($scope.originalText);\n      });\n     </file>\n   </example>\n  */\n$FilterProvider.$inject = ['$provide'];\nfunction $FilterProvider($provide) {\n  var suffix = 'Filter';\n\n  /**\n   * @ngdoc method\n   * @name $filterProvider#register\n   * @param {string|Object} name Name of the filter function, or an object map of filters where\n   *    the keys are the filter names and the values are the filter factories.\n   * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n   *    of the registered filter instances.\n   */\n  function register(name, factory) {\n    if (isObject(name)) {\n      var filters = {};\n      forEach(name, function(filter, key) {\n        filters[key] = register(key, filter);\n      });\n      return filters;\n    } else {\n      return $provide.factory(name + suffix, factory);\n    }\n  }\n  this.register = register;\n\n  this.$get = ['$injector', function($injector) {\n    return function(name) {\n      return $injector.get(name + suffix);\n    };\n  }];\n\n  ////////////////////////////////////////\n\n  /* global\n    currencyFilter: false,\n    dateFilter: false,\n    filterFilter: false,\n    jsonFilter: false,\n    limitToFilter: false,\n    lowercaseFilter: false,\n    numberFilter: false,\n    orderByFilter: false,\n    uppercaseFilter: false,\n  */\n\n  register('currency', currencyFilter);\n  register('date', dateFilter);\n  register('filter', filterFilter);\n  register('json', jsonFilter);\n  register('limitTo', limitToFilter);\n  register('lowercase', lowercaseFilter);\n  register('number', numberFilter);\n  register('orderBy', orderByFilter);\n  register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n *   `array`.\n *\n *   Can be one of:\n *\n *   - `string`: The string is used for matching against the contents of the `array`. All strings or\n *     objects with string properties in `array` that match this string will be returned. This also\n *     applies to nested object properties.\n *     The predicate can be negated by prefixing the string with `!`.\n *\n *   - `Object`: A pattern object can be used to filter specific properties on objects contained\n *     by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n *     which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n *     property name `$` can be used (as in `{$:\"text\"}`) to accept a match against any\n *     property of the object or its nested object properties. That's equivalent to the simple\n *     substring match with a `string` as described above. The predicate can be negated by prefixing\n *     the string with `!`.\n *     For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n *     not containing \"M\".\n *\n *     Note that a named property will match properties on the same level only, while the special\n *     `$` property will match properties on the same level or deeper. E.g. an array item like\n *     `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n *     **will** be matched by `{$: 'John'}`.\n *\n *   - `function(value, index)`: A predicate function can be used to write arbitrary filters. The\n *     function is called for each element of `array`. The final result is an array of those\n *     elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in\n *     determining if the expected value (from the filter expression) and actual value (from\n *     the object in the array) should be considered a match.\n *\n *   Can be one of:\n *\n *   - `function(actual, expected)`:\n *     The function will be given the object value and the predicate value to compare and\n *     should return true if both values should be considered equal.\n *\n *   - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n *     This is essentially strict comparison of expected and actual.\n *\n *   - `false|undefined`: A short hand for a function which will look for a substring match in case\n *     insensitive way.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <div ng-init=\"friends = [{name:'John', phone:'555-1276'},\n                                {name:'Mary', phone:'800-BIG-MARY'},\n                                {name:'Mike', phone:'555-4321'},\n                                {name:'Adam', phone:'555-5678'},\n                                {name:'Julie', phone:'555-8765'},\n                                {name:'Juliette', phone:'555-5678'}]\"></div>\n\n       Search: <input ng-model=\"searchText\">\n       <table id=\"searchTextResults\">\n         <tr><th>Name</th><th>Phone</th></tr>\n         <tr ng-repeat=\"friend in friends | filter:searchText\">\n           <td>{{friend.name}}</td>\n           <td>{{friend.phone}}</td>\n         </tr>\n       </table>\n       <hr>\n       Any: <input ng-model=\"search.$\"> <br>\n       Name only <input ng-model=\"search.name\"><br>\n       Phone only <input ng-model=\"search.phone\"><br>\n       Equality <input type=\"checkbox\" ng-model=\"strict\"><br>\n       <table id=\"searchObjResults\">\n         <tr><th>Name</th><th>Phone</th></tr>\n         <tr ng-repeat=\"friendObj in friends | filter:search:strict\">\n           <td>{{friendObj.name}}</td>\n           <td>{{friendObj.phone}}</td>\n         </tr>\n       </table>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var expectFriendNames = function(expectedNames, key) {\n         element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n           arr.forEach(function(wd, i) {\n             expect(wd.getText()).toMatch(expectedNames[i]);\n           });\n         });\n       };\n\n       it('should search across all fields when filtering with a string', function() {\n         var searchText = element(by.model('searchText'));\n         searchText.clear();\n         searchText.sendKeys('m');\n         expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n         searchText.clear();\n         searchText.sendKeys('76');\n         expectFriendNames(['John', 'Julie'], 'friend');\n       });\n\n       it('should search in specific fields when filtering with a predicate object', function() {\n         var searchAny = element(by.model('search.$'));\n         searchAny.clear();\n         searchAny.sendKeys('i');\n         expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n       });\n       it('should use a equal comparison when comparator is true', function() {\n         var searchName = element(by.model('search.name'));\n         var strict = element(by.model('strict'));\n         searchName.clear();\n         searchName.sendKeys('Julie');\n         strict.click();\n         expectFriendNames(['Julie'], 'friendObj');\n       });\n     </file>\n   </example>\n */\nfunction filterFilter() {\n  return function(array, expression, comparator) {\n    if (!isArray(array)) return array;\n\n    var predicateFn;\n    var matchAgainstAnyProp;\n\n    switch (typeof expression) {\n      case 'function':\n        predicateFn = expression;\n        break;\n      case 'boolean':\n      case 'number':\n      case 'string':\n        matchAgainstAnyProp = true;\n        //jshint -W086\n      case 'object':\n        //jshint +W086\n        predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);\n        break;\n      default:\n        return array;\n    }\n\n    return array.filter(predicateFn);\n  };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, matchAgainstAnyProp) {\n  var shouldMatchPrimitives = isObject(expression) && ('$' in expression);\n  var predicateFn;\n\n  if (comparator === true) {\n    comparator = equals;\n  } else if (!isFunction(comparator)) {\n    comparator = function(actual, expected) {\n      if (isObject(actual) || isObject(expected)) {\n        // Prevent an object to be considered equal to a string like `'[object'`\n        return false;\n      }\n\n      actual = lowercase('' + actual);\n      expected = lowercase('' + expected);\n      return actual.indexOf(expected) !== -1;\n    };\n  }\n\n  predicateFn = function(item) {\n    if (shouldMatchPrimitives && !isObject(item)) {\n      return deepCompare(item, expression.$, comparator, false);\n    }\n    return deepCompare(item, expression, comparator, matchAgainstAnyProp);\n  };\n\n  return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {\n  var actualType = typeof actual;\n  var expectedType = typeof expected;\n\n  if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n    return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);\n  } else if (isArray(actual)) {\n    // In case `actual` is an array, consider it a match\n    // if ANY of it's items matches `expected`\n    return actual.some(function(item) {\n      return deepCompare(item, expected, comparator, matchAgainstAnyProp);\n    });\n  }\n\n  switch (actualType) {\n    case 'object':\n      var key;\n      if (matchAgainstAnyProp) {\n        for (key in actual) {\n          if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {\n            return true;\n          }\n        }\n        return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);\n      } else if (expectedType === 'object') {\n        for (key in expected) {\n          var expectedVal = expected[key];\n          if (isFunction(expectedVal)) {\n            continue;\n          }\n\n          var matchAnyProperty = key === '$';\n          var actualVal = matchAnyProperty ? actual : actual[key];\n          if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {\n            return false;\n          }\n        }\n        return true;\n      } else {\n        return comparator(actual, expected);\n      }\n      break;\n    case 'function':\n      return false;\n    default:\n      return comparator(actual, expected);\n  }\n}\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n   <example module=\"currencyExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('currencyExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.amount = 1234.56;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input type=\"number\" ng-model=\"amount\"> <br>\n         default currency symbol ($): <span id=\"currency-default\">{{amount | currency}}</span><br>\n         custom currency identifier (USD$): <span id=\"currency-custom\">{{amount | currency:\"USD$\"}}</span>\n         no fractions (0): <span id=\"currency-no-fractions\">{{amount | currency:\"USD$\":0}}</span>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should init with 1234.56', function() {\n         expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n         expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n         expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n       });\n       it('should update', function() {\n         if (browser.params.browser == 'safari') {\n           // Safari does not understand the minus key. See\n           // https://github.com/angular/protractor/issues/481\n           return;\n         }\n         element(by.model('amount')).clear();\n         element(by.model('amount')).sendKeys('-1234');\n         expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)');\n         expect(element(by.id('currency-custom')).getText()).toBe('(USD$1,234.00)');\n         expect(element(by.id('currency-no-fractions')).getText()).toBe('(USD$1,234)');\n       });\n     </file>\n   </example>\n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n  var formats = $locale.NUMBER_FORMATS;\n  return function(amount, currencySymbol, fractionSize) {\n    if (isUndefined(currencySymbol)) {\n      currencySymbol = formats.CURRENCY_SYM;\n    }\n\n    if (isUndefined(fractionSize)) {\n      fractionSize = formats.PATTERNS[1].maxFrac;\n    }\n\n    // if null or undefined pass it through\n    return (amount == null)\n        ? amount\n        : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n            replace(/\\u00A4/g, currencySymbol);\n  };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is not a number an empty string is returned.\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.\n *\n * @example\n   <example module=\"numberFilterExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('numberFilterExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.val = 1234.56789;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Enter number: <input ng-model='val'><br>\n         Default formatting: <span id='number-default'>{{val | number}}</span><br>\n         No fractions: <span>{{val | number:0}}</span><br>\n         Negative number: <span>{{-val | number:4}}</span>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should format numbers', function() {\n         expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n         expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n         expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n       });\n\n       it('should update', function() {\n         element(by.model('val')).clear();\n         element(by.model('val')).sendKeys('3374.333');\n         expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n         expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n         expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n      });\n     </file>\n   </example>\n */\n\n\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n  var formats = $locale.NUMBER_FORMATS;\n  return function(number, fractionSize) {\n\n    // if null or undefined pass it through\n    return (number == null)\n        ? number\n        : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n                       fractionSize);\n  };\n}\n\nvar DECIMAL_SEP = '.';\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n  if (!isFinite(number) || isObject(number)) return '';\n\n  var isNegative = number < 0;\n  number = Math.abs(number);\n  var numStr = number + '',\n      formatedText = '',\n      parts = [];\n\n  var hasExponent = false;\n  if (numStr.indexOf('e') !== -1) {\n    var match = numStr.match(/([\\d\\.]+)e(-?)(\\d+)/);\n    if (match && match[2] == '-' && match[3] > fractionSize + 1) {\n      number = 0;\n    } else {\n      formatedText = numStr;\n      hasExponent = true;\n    }\n  }\n\n  if (!hasExponent) {\n    var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;\n\n    // determine fractionSize if it is not specified\n    if (isUndefined(fractionSize)) {\n      fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);\n    }\n\n    // safely round numbers in JS without hitting imprecisions of floating-point arithmetics\n    // inspired by:\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n    number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);\n\n    var fraction = ('' + number).split(DECIMAL_SEP);\n    var whole = fraction[0];\n    fraction = fraction[1] || '';\n\n    var i, pos = 0,\n        lgroup = pattern.lgSize,\n        group = pattern.gSize;\n\n    if (whole.length >= (lgroup + group)) {\n      pos = whole.length - lgroup;\n      for (i = 0; i < pos; i++) {\n        if ((pos - i) % group === 0 && i !== 0) {\n          formatedText += groupSep;\n        }\n        formatedText += whole.charAt(i);\n      }\n    }\n\n    for (i = pos; i < whole.length; i++) {\n      if ((whole.length - i) % lgroup === 0 && i !== 0) {\n        formatedText += groupSep;\n      }\n      formatedText += whole.charAt(i);\n    }\n\n    // format fraction part.\n    while (fraction.length < fractionSize) {\n      fraction += '0';\n    }\n\n    if (fractionSize && fractionSize !== \"0\") formatedText += decimalSep + fraction.substr(0, fractionSize);\n  } else {\n    if (fractionSize > 0 && number < 1) {\n      formatedText = number.toFixed(fractionSize);\n      number = parseFloat(formatedText);\n    }\n  }\n\n  if (number === 0) {\n    isNegative = false;\n  }\n\n  parts.push(isNegative ? pattern.negPre : pattern.posPre,\n             formatedText,\n             isNegative ? pattern.negSuf : pattern.posSuf);\n  return parts.join('');\n}\n\nfunction padNumber(num, digits, trim) {\n  var neg = '';\n  if (num < 0) {\n    neg =  '-';\n    num = -num;\n  }\n  num = '' + num;\n  while (num.length < digits) num = '0' + num;\n  if (trim)\n    num = num.substr(num.length - digits);\n  return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim) {\n  offset = offset || 0;\n  return function(date) {\n    var value = date['get' + name]();\n    if (offset > 0 || value > -offset)\n      value += offset;\n    if (value === 0 && offset == -12) value = 12;\n    return padNumber(value, size, trim);\n  };\n}\n\nfunction dateStrGetter(name, shortForm) {\n  return function(date, formats) {\n    var value = date['get' + name]();\n    var get = uppercase(shortForm ? ('SHORT' + name) : name);\n\n    return formats[get][value];\n  };\n}\n\nfunction timeZoneGetter(date) {\n  var zone = -1 * date.getTimezoneOffset();\n  var paddedZone = (zone >= 0) ? \"+\" : \"\";\n\n  paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n                padNumber(Math.abs(zone % 60), 2);\n\n  return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n    // 0 = index of January\n    var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n    // 4 = index of Thursday (+1 to account for 1st = 5)\n    // 11 = index of *next* Thursday (+1 account for 1st = 12)\n    return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n    return new Date(datetime.getFullYear(), datetime.getMonth(),\n      // 4 = index of Thursday\n      datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n   return function(date) {\n      var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n         thisThurs = getThursdayThisWeek(date);\n\n      var diff = +thisThurs - +firstThurs,\n         result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n      return padNumber(result, size);\n   };\n}\n\nfunction ampmGetter(date, formats) {\n  return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nvar DATE_FORMATS = {\n  yyyy: dateGetter('FullYear', 4),\n    yy: dateGetter('FullYear', 2, 0, true),\n     y: dateGetter('FullYear', 1),\n  MMMM: dateStrGetter('Month'),\n   MMM: dateStrGetter('Month', true),\n    MM: dateGetter('Month', 2, 1),\n     M: dateGetter('Month', 1, 1),\n    dd: dateGetter('Date', 2),\n     d: dateGetter('Date', 1),\n    HH: dateGetter('Hours', 2),\n     H: dateGetter('Hours', 1),\n    hh: dateGetter('Hours', 2, -12),\n     h: dateGetter('Hours', 1, -12),\n    mm: dateGetter('Minutes', 2),\n     m: dateGetter('Minutes', 1),\n    ss: dateGetter('Seconds', 2),\n     s: dateGetter('Seconds', 1),\n     // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n     // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n   sss: dateGetter('Milliseconds', 3),\n  EEEE: dateStrGetter('Day'),\n   EEE: dateStrGetter('Day', true),\n     a: ampmGetter,\n     Z: timeZoneGetter,\n    ww: weekGetter(2),\n     w: weekGetter(1)\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/,\n    NUMBER_STRING = /^\\-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n *   Formats `date` to a string based on the requested `format`.\n *\n *   `format` string can be composed of the following elements:\n *\n *   * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n *   * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n *   * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n *   * `'MMMM'`: Month in year (January-December)\n *   * `'MMM'`: Month in year (Jan-Dec)\n *   * `'MM'`: Month in year, padded (01-12)\n *   * `'M'`: Month in year (1-12)\n *   * `'dd'`: Day in month, padded (01-31)\n *   * `'d'`: Day in month (1-31)\n *   * `'EEEE'`: Day in Week,(Sunday-Saturday)\n *   * `'EEE'`: Day in Week, (Sun-Sat)\n *   * `'HH'`: Hour in day, padded (00-23)\n *   * `'H'`: Hour in day (0-23)\n *   * `'hh'`: Hour in AM/PM, padded (01-12)\n *   * `'h'`: Hour in AM/PM, (1-12)\n *   * `'mm'`: Minute in hour, padded (00-59)\n *   * `'m'`: Minute in hour (0-59)\n *   * `'ss'`: Second in minute, padded (00-59)\n *   * `'s'`: Second in minute (0-59)\n *   * `'sss'`: Millisecond in second, padded (000-999)\n *   * `'a'`: AM/PM marker\n *   * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n *   * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n *   * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n *\n *   `format` string can also be one of the following predefined\n *   {@link guide/i18n localizable formats}:\n *\n *   * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n *     (e.g. Sep 3, 2010 12:05:08 PM)\n *   * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US  locale (e.g. 9/3/10 12:05 PM)\n *   * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US  locale\n *     (e.g. Friday, September 3, 2010)\n *   * `'longDate'`: equivalent to `'MMMM d, y'` for en_US  locale (e.g. September 3, 2010)\n *   * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US  locale (e.g. Sep 3, 2010)\n *   * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n *   * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n *   * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n *   `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n *   `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n *   (e.g. `\"h 'o''clock'\"`).\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n *    number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n *    shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n *    specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n *    `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. Right now, only `'UTC'` is supported.\n *    If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:\n           <span>{{1288323623006 | date:'medium'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n          <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n          <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}</span>:\n          <span>{{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}</span><br>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should format date', function() {\n         expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n            toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n         expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n            toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} (\\-|\\+)?\\d{4}/);\n         expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n            toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n         expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n            toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n       });\n     </file>\n   </example>\n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n  var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n                     // 1        2       3         4          5          6          7          8  9     10      11\n  function jsonStringToDate(string) {\n    var match;\n    if (match = string.match(R_ISO8601_STR)) {\n      var date = new Date(0),\n          tzHour = 0,\n          tzMin  = 0,\n          dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n          timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n      if (match[9]) {\n        tzHour = int(match[9] + match[10]);\n        tzMin = int(match[9] + match[11]);\n      }\n      dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));\n      var h = int(match[4] || 0) - tzHour;\n      var m = int(match[5] || 0) - tzMin;\n      var s = int(match[6] || 0);\n      var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n      timeSetter.call(date, h, m, s, ms);\n      return date;\n    }\n    return string;\n  }\n\n\n  return function(date, format, timezone) {\n    var text = '',\n        parts = [],\n        fn, match;\n\n    format = format || 'mediumDate';\n    format = $locale.DATETIME_FORMATS[format] || format;\n    if (isString(date)) {\n      date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);\n    }\n\n    if (isNumber(date)) {\n      date = new Date(date);\n    }\n\n    if (!isDate(date)) {\n      return date;\n    }\n\n    while (format) {\n      match = DATE_FORMATS_SPLIT.exec(format);\n      if (match) {\n        parts = concat(parts, match, 1);\n        format = parts.pop();\n      } else {\n        parts.push(format);\n        format = null;\n      }\n    }\n\n    if (timezone && timezone === 'UTC') {\n      date = new Date(date.getTime());\n      date.setMinutes(date.getMinutes() + date.getTimezoneOffset());\n    }\n    forEach(parts, function(value) {\n      fn = DATE_FORMATS[value];\n      text += fn ? fn(date, $locale.DATETIME_FORMATS)\n                 : value.replace(/(^'|'$)/g, '').replace(/''/g, \"'\");\n    });\n\n    return text;\n  };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n *   Allows you to convert a JavaScript object into JSON string.\n *\n *   This filter is mostly useful for debugging. When using the double curly {{value}} notation\n *   the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <pre id=\"default-spacing\">{{ {'name':'value'} | json }}</pre>\n       <pre id=\"custom-spacing\">{{ {'name':'value'} | json:4 }}</pre>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should jsonify filtered objects', function() {\n         expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n  \"name\": ?\"value\"\\n}/);\n         expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n    \"name\": ?\"value\"\\n}/);\n       });\n     </file>\n   </example>\n *\n */\nfunction jsonFilter() {\n  return function(object, spacing) {\n    if (isUndefined(spacing)) {\n        spacing = 2;\n    }\n    return toJson(object, spacing);\n  };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @see angular.uppercase\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements\n * are taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. If a number is used as input, it is\n * converted to a string.\n *\n * @param {Array|string|number} input Source array, string or number to be limited.\n * @param {string|number} limit The length of the returned array or string. If the `limit` number\n *     is positive, `limit` number of items from the beginning of the source array/string are copied.\n *     If the number is negative, `limit` number  of items from the end of the source array/string\n *     are copied. The `limit` will be trimmed if it exceeds `array.length`\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array\n *     had less than `limit` elements.\n *\n * @example\n   <example module=\"limitToExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('limitToExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.numbers = [1,2,3,4,5,6,7,8,9];\n             $scope.letters = \"abcdefghi\";\n             $scope.longNumber = 2345432342;\n             $scope.numLimit = 3;\n             $scope.letterLimit = 3;\n             $scope.longNumberLimit = 3;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Limit {{numbers}} to: <input type=\"number\" step=\"1\" ng-model=\"numLimit\">\n         <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>\n         Limit {{letters}} to: <input type=\"number\" step=\"1\" ng-model=\"letterLimit\">\n         <p>Output letters: {{ letters | limitTo:letterLimit }}</p>\n         Limit {{longNumber}} to: <input type=\"number\" step=\"1\" ng-model=\"longNumberLimit\">\n         <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var numLimitInput = element(by.model('numLimit'));\n       var letterLimitInput = element(by.model('letterLimit'));\n       var longNumberLimitInput = element(by.model('longNumberLimit'));\n       var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n       var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n       var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n       it('should limit the number array to first three items', function() {\n         expect(numLimitInput.getAttribute('value')).toBe('3');\n         expect(letterLimitInput.getAttribute('value')).toBe('3');\n         expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n         expect(limitedLetters.getText()).toEqual('Output letters: abc');\n         expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n       });\n\n       // There is a bug in safari and protractor that doesn't like the minus key\n       // it('should update the output when -3 is entered', function() {\n       //   numLimitInput.clear();\n       //   numLimitInput.sendKeys('-3');\n       //   letterLimitInput.clear();\n       //   letterLimitInput.sendKeys('-3');\n       //   longNumberLimitInput.clear();\n       //   longNumberLimitInput.sendKeys('-3');\n       //   expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n       //   expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n       //   expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n       // });\n\n       it('should not exceed the maximum size of input array', function() {\n         numLimitInput.clear();\n         numLimitInput.sendKeys('100');\n         letterLimitInput.clear();\n         letterLimitInput.sendKeys('100');\n         longNumberLimitInput.clear();\n         longNumberLimitInput.sendKeys('100');\n         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n         expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n         expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n       });\n     </file>\n   </example>\n*/\nfunction limitToFilter() {\n  return function(input, limit) {\n    if (isNumber(input)) input = input.toString();\n    if (!isArray(input) && !isString(input)) return input;\n\n    if (Math.abs(Number(limit)) === Infinity) {\n      limit = Number(limit);\n    } else {\n      limit = int(limit);\n    }\n\n    //NaN check on limit\n    if (limit) {\n      return limit > 0 ? input.slice(0, limit) : input.slice(limit);\n    } else {\n      return isString(input) ? \"\" : [];\n    }\n  };\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically\n * for strings and numerically for numbers. Note: if you notice numbers are not being sorted\n * correctly, make sure they are actually being saved as numbers and not strings.\n *\n * @param {Array} array The array to sort.\n * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be\n *    used by the comparator to determine the order of elements.\n *\n *    Can be one of:\n *\n *    - `function`: Getter function. The result of this function will be sorted using the\n *      `<`, `=`, `>` operator.\n *    - `string`: An Angular expression. The result of this expression is used to compare elements\n *      (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by\n *      3 first characters of a property called `name`). The result of a constant expression\n *      is interpreted as a property name to be used in comparisons (for example `\"special name\"`\n *      to sort object by the value of their `special name` property). An expression can be\n *      optionally prefixed with `+` or `-` to control ascending or descending sort order\n *      (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array\n *      element itself is used to compare where sorting.\n *    - `Array`: An array of function or string predicates. The first predicate in the array\n *      is used for sorting, but when two items are equivalent, the next predicate is used.\n *\n *    If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse Reverse the order of the array.\n * @returns {Array} Sorted copy of the source array.\n *\n * @example\n   <example module=\"orderByExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('orderByExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.friends =\n                 [{name:'John', phone:'555-1212', age:10},\n                  {name:'Mary', phone:'555-9876', age:19},\n                  {name:'Mike', phone:'555-4321', age:21},\n                  {name:'Adam', phone:'555-5678', age:35},\n                  {name:'Julie', phone:'555-8765', age:29}];\n             $scope.predicate = '-age';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>\n         <hr/>\n         [ <a href=\"\" ng-click=\"predicate=''\">unsorted</a> ]\n         <table class=\"friend\">\n           <tr>\n             <th><a href=\"\" ng-click=\"predicate = 'name'; reverse=false\">Name</a>\n                 (<a href=\"\" ng-click=\"predicate = '-name'; reverse=false\">^</a>)</th>\n             <th><a href=\"\" ng-click=\"predicate = 'phone'; reverse=!reverse\">Phone Number</a></th>\n             <th><a href=\"\" ng-click=\"predicate = 'age'; reverse=!reverse\">Age</a></th>\n           </tr>\n           <tr ng-repeat=\"friend in friends | orderBy:predicate:reverse\">\n             <td>{{friend.name}}</td>\n             <td>{{friend.phone}}</td>\n             <td>{{friend.age}}</td>\n           </tr>\n         </table>\n       </div>\n     </file>\n   </example>\n *\n * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the\n * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the\n * desired parameters.\n *\n * Example:\n *\n * @example\n  <example module=\"orderByExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <table class=\"friend\">\n          <tr>\n            <th><a href=\"\" ng-click=\"reverse=false;order('name', false)\">Name</a>\n              (<a href=\"\" ng-click=\"order('-name',false)\">^</a>)</th>\n            <th><a href=\"\" ng-click=\"reverse=!reverse;order('phone', reverse)\">Phone Number</a></th>\n            <th><a href=\"\" ng-click=\"reverse=!reverse;order('age',reverse)\">Age</a></th>\n          </tr>\n          <tr ng-repeat=\"friend in friends\">\n            <td>{{friend.name}}</td>\n            <td>{{friend.phone}}</td>\n            <td>{{friend.age}}</td>\n          </tr>\n        </table>\n      </div>\n    </file>\n\n    <file name=\"script.js\">\n      angular.module('orderByExample', [])\n        .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {\n          var orderBy = $filter('orderBy');\n          $scope.friends = [\n            { name: 'John',    phone: '555-1212',    age: 10 },\n            { name: 'Mary',    phone: '555-9876',    age: 19 },\n            { name: 'Mike',    phone: '555-4321',    age: 21 },\n            { name: 'Adam',    phone: '555-5678',    age: 35 },\n            { name: 'Julie',   phone: '555-8765',    age: 29 }\n          ];\n          $scope.order = function(predicate, reverse) {\n            $scope.friends = orderBy($scope.friends, predicate, reverse);\n          };\n          $scope.order('-age',false);\n        }]);\n    </file>\n</example>\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n  return function(array, sortPredicate, reverseOrder) {\n    if (!(isArrayLike(array))) return array;\n    sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate];\n    if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n    sortPredicate = sortPredicate.map(function(predicate) {\n      var descending = false, get = predicate || identity;\n      if (isString(predicate)) {\n        if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {\n          descending = predicate.charAt(0) == '-';\n          predicate = predicate.substring(1);\n        }\n        if (predicate === '') {\n          // Effectively no predicate was passed so we compare identity\n          return reverseComparator(compare, descending);\n        }\n        get = $parse(predicate);\n        if (get.constant) {\n          var key = get();\n          return reverseComparator(function(a, b) {\n            return compare(a[key], b[key]);\n          }, descending);\n        }\n      }\n      return reverseComparator(function(a, b) {\n        return compare(get(a),get(b));\n      }, descending);\n    });\n    return slice.call(array).sort(reverseComparator(comparator, reverseOrder));\n\n    function comparator(o1, o2) {\n      for (var i = 0; i < sortPredicate.length; i++) {\n        var comp = sortPredicate[i](o1, o2);\n        if (comp !== 0) return comp;\n      }\n      return 0;\n    }\n    function reverseComparator(comp, descending) {\n      return descending\n          ? function(a, b) {return comp(b,a);}\n          : comp;\n    }\n\n    function isPrimitive(value) {\n      switch (typeof value) {\n        case 'number': /* falls through */\n        case 'boolean': /* falls through */\n        case 'string':\n          return true;\n        default:\n          return false;\n      }\n    }\n\n    function objectToString(value) {\n      if (value === null) return 'null';\n      if (typeof value.valueOf === 'function') {\n        value = value.valueOf();\n        if (isPrimitive(value)) return value;\n      }\n      if (typeof value.toString === 'function') {\n        value = value.toString();\n        if (isPrimitive(value)) return value;\n      }\n      return '';\n    }\n\n    function compare(v1, v2) {\n      var t1 = typeof v1;\n      var t2 = typeof v2;\n      if (t1 === t2 && t1 === \"object\") {\n        v1 = objectToString(v1);\n        v2 = objectToString(v2);\n      }\n      if (t1 === t2) {\n        if (t1 === \"string\") {\n           v1 = v1.toLowerCase();\n           v2 = v2.toLowerCase();\n        }\n        if (v1 === v2) return 0;\n        return v1 < v2 ? -1 : 1;\n      } else {\n        return t1 < t2 ? -1 : 1;\n      }\n    }\n  };\n}\n\nfunction ngDirective(directive) {\n  if (isFunction(directive)) {\n    directive = {\n      link: directive\n    };\n  }\n  directive.restrict = directive.restrict || 'AC';\n  return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html A tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * This change permits the easy creation of action links with the `ngClick` directive\n * without changing the location or causing page reloads, e.g.:\n * `<a href=\"\" ng-click=\"list.addItem()\">Add Item</a>`\n */\nvar htmlAnchorDirective = valueFn({\n  restrict: 'E',\n  compile: function(element, attr) {\n    if (!attr.href && !attr.xlinkHref && !attr.name) {\n      return function(scope, element) {\n        // If the linked element is not an anchor tag anymore, do nothing\n        if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n        // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n        var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n                   'xlink:href' : 'href';\n        element.on('click', function(event) {\n          // if we have no href url, then don't navigate anywhere.\n          if (!element.attr(href)) {\n            event.preventDefault();\n          }\n        });\n      };\n    }\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * Angular has a chance to replace the `{{hash}}` markup with its\n * value. Until Angular replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * <a href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <a ng-href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n    <example>\n      <file name=\"index.html\">\n        <input ng-model=\"value\" /><br />\n        <a id=\"link-1\" href ng-click=\"value = 1\">link 1</a> (link, don't reload)<br />\n        <a id=\"link-2\" href=\"\" ng-click=\"value = 2\">link 2</a> (link, don't reload)<br />\n        <a id=\"link-3\" ng-href=\"/{{'123'}}\">link 3</a> (link, reload!)<br />\n        <a id=\"link-4\" href=\"\" name=\"xx\" ng-click=\"value = 4\">anchor</a> (link, don't reload)<br />\n        <a id=\"link-5\" name=\"xxx\" ng-click=\"value = 5\">anchor</a> (no link)<br />\n        <a id=\"link-6\" ng-href=\"{{value}}\">link</a> (link, change location)\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should execute ng-click but not reload when href without value', function() {\n          element(by.id('link-1')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n          expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click but not reload when href empty string', function() {\n          element(by.id('link-2')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n          expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click and change url when ng-href specified', function() {\n          expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n          element(by.id('link-3')).click();\n\n          // At this point, we navigate away from an Angular page, so we need\n          // to use browser.driver to get the base webdriver.\n\n          browser.wait(function() {\n            return browser.driver.getCurrentUrl().then(function(url) {\n              return url.match(/\\/123$/);\n            });\n          }, 5000, 'page should navigate to /123');\n        });\n\n        xit('should execute ng-click but not reload when href empty string and name specified', function() {\n          element(by.id('link-4')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n          expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click but not reload when no href but name specified', function() {\n          element(by.id('link-5')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n          expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n        });\n\n        it('should only change url when only ng-href', function() {\n          element(by.model('value')).clear();\n          element(by.model('value')).sendKeys('6');\n          expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n          element(by.id('link-6')).click();\n\n          // At this point, we navigate away from an Angular page, so we need\n          // to use browser.driver to get the base webdriver.\n          browser.wait(function() {\n            return browser.driver.getCurrentUrl().then(function(url) {\n              return url.match(/\\/6$/);\n            });\n          }, 5000, 'page should navigate to /6');\n        });\n      </file>\n    </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:\n * ```html\n * <div ng-init=\"scope = { isDisabled: false }\">\n *  <button disabled=\"{{scope.isDisabled}}\">Disabled</button>\n * </div>\n * ```\n *\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as disabled. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngDisabled` directive solves this problem for the `disabled` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        Click me to toggle: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n        <button ng-model=\"button\" ng-disabled=\"checked\">Button</button>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should toggle button', function() {\n          expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n          element(by.model('checked')).click();\n          expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n *     then special attribute \"disabled\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as checked. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngChecked` directive solves this problem for the `checked` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to check both: <input type=\"checkbox\" ng-model=\"master\"><br/>\n        <input id=\"checkSlave\" type=\"checkbox\" ng-checked=\"master\">\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should check both checkBoxes', function() {\n          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();\n          element(by.model('master')).click();\n          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n *     then special attribute \"checked\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as readonly. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngReadonly` directive solves this problem for the `readonly` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to make text readonly: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n        <input type=\"text\" ng-readonly=\"checked\" value=\"I'm Angular\"/>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should toggle readonly attr', function() {\n          expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n          element(by.model('checked')).click();\n          expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n *     then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as selected. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngSelected` directive solves this problem for the `selected` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to select: <input type=\"checkbox\" ng-model=\"selected\"><br/>\n        <select>\n          <option>Hello!</option>\n          <option id=\"greet\" ng-selected=\"selected\">Greetings!</option>\n        </select>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should select Greetings!', function() {\n          expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n          element(by.model('selected')).click();\n          expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n *     then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as open. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngOpen` directive solves this problem for the `open` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n     <example>\n       <file name=\"index.html\">\n         Check me check multiple: <input type=\"checkbox\" ng-model=\"open\"><br/>\n         <details id=\"details\" ng-open=\"open\">\n            <summary>Show/Hide me</summary>\n         </details>\n       </file>\n       <file name=\"protractor.js\" type=\"protractor\">\n         it('should toggle open', function() {\n           expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n           element(by.model('open')).click();\n           expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n         });\n       </file>\n     </example>\n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n *     then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n  // binding to multiple is not supported\n  if (propName == \"multiple\") return;\n\n  var normalized = directiveNormalize('ng-' + attrName);\n  ngAttributeAliasDirectives[normalized] = function() {\n    return {\n      restrict: 'A',\n      priority: 100,\n      link: function(scope, element, attr) {\n        scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n          attr.$set(attrName, !!value);\n        });\n      }\n    };\n  };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n  ngAttributeAliasDirectives[ngAttr] = function() {\n    return {\n      priority: 100,\n      link: function(scope, element, attr) {\n        //special case ngPattern when a literal regular expression value\n        //is used as the expression (this way we don't have to watch anything).\n        if (ngAttr === \"ngPattern\" && attr.ngPattern.charAt(0) == \"/\") {\n          var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n          if (match) {\n            attr.$set(\"ngPattern\", new RegExp(match[1], match[2]));\n            return;\n          }\n        }\n\n        scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n          attr.$set(ngAttr, value);\n        });\n      }\n    };\n  };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n  var normalized = directiveNormalize('ng-' + attrName);\n  ngAttributeAliasDirectives[normalized] = function() {\n    return {\n      priority: 99, // it needs to run after the attributes are interpolated\n      link: function(scope, element, attr) {\n        var propName = attrName,\n            name = attrName;\n\n        if (attrName === 'href' &&\n            toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n          name = 'xlinkHref';\n          attr.$attr[name] = 'xlink:href';\n          propName = null;\n        }\n\n        attr.$observe(normalized, function(value) {\n          if (!value) {\n            if (attrName === 'href') {\n              attr.$set(name, null);\n            }\n            return;\n          }\n\n          attr.$set(name, value);\n\n          // on IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n          // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n          // to set the property as well to achieve the desired effect.\n          // we use attr[attrName] value since $set can sanitize the url.\n          if (msie && propName) element.prop(propName, attr[name]);\n        });\n      }\n    };\n  };\n});\n\n/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true\n */\nvar nullFormCtrl = {\n  $addControl: noop,\n  $$renameControl: nullFormRenameControl,\n  $removeControl: noop,\n  $setValidity: noop,\n  $setDirty: noop,\n  $setPristine: noop,\n  $setSubmitted: noop\n},\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n  control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $error Is an object hash, containing references to controls or\n *  forms with failing validators, where:\n *\n *  - keys are validation tokens (error names),\n *  - values are arrays of controls or forms that have a failing validator for given error name.\n *\n *  Built-in validation tokens:\n *\n *  - `email`\n *  - `max`\n *  - `maxlength`\n *  - `min`\n *  - `minlength`\n *  - `number`\n *  - `pattern`\n *  - `required`\n *  - `url`\n *  - `date`\n *  - `datetimelocal`\n *  - `time`\n *  - `week`\n *  - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController(element, attrs, $scope, $animate, $interpolate) {\n  var form = this,\n      controls = [];\n\n  var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl;\n\n  // init state\n  form.$error = {};\n  form.$$success = {};\n  form.$pending = undefined;\n  form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);\n  form.$dirty = false;\n  form.$pristine = true;\n  form.$valid = true;\n  form.$invalid = false;\n  form.$submitted = false;\n\n  parentForm.$addControl(form);\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$rollbackViewValue\n   *\n   * @description\n   * Rollback all form controls pending updates to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. This method is typically needed by the reset button of\n   * a form that uses `ng-model-options` to pend updates.\n   */\n  form.$rollbackViewValue = function() {\n    forEach(controls, function(control) {\n      control.$rollbackViewValue();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$commitViewValue\n   *\n   * @description\n   * Commit all form controls pending updates to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n   * usually handles calling this in response to input events.\n   */\n  form.$commitViewValue = function() {\n    forEach(controls, function(control) {\n      control.$commitViewValue();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$addControl\n   *\n   * @description\n   * Register a control with the form.\n   *\n   * Input elements using ngModelController do this automatically when they are linked.\n   */\n  form.$addControl = function(control) {\n    // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n    // and not added to the scope.  Now we throw an error.\n    assertNotHasOwnProperty(control.$name, 'input');\n    controls.push(control);\n\n    if (control.$name) {\n      form[control.$name] = control;\n    }\n  };\n\n  // Private API: rename a form control\n  form.$$renameControl = function(control, newName) {\n    var oldName = control.$name;\n\n    if (form[oldName] === control) {\n      delete form[oldName];\n    }\n    form[newName] = control;\n    control.$name = newName;\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$removeControl\n   *\n   * @description\n   * Deregister a control from the form.\n   *\n   * Input elements using ngModelController do this automatically when they are destroyed.\n   */\n  form.$removeControl = function(control) {\n    if (control.$name && form[control.$name] === control) {\n      delete form[control.$name];\n    }\n    forEach(form.$pending, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n    forEach(form.$error, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n    forEach(form.$$success, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n\n    arrayRemove(controls, control);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setValidity\n   *\n   * @description\n   * Sets the validity of a form control.\n   *\n   * This method will also propagate to parent forms.\n   */\n  addSetValidityMethod({\n    ctrl: this,\n    $element: element,\n    set: function(object, property, controller) {\n      var list = object[property];\n      if (!list) {\n        object[property] = [controller];\n      } else {\n        var index = list.indexOf(controller);\n        if (index === -1) {\n          list.push(controller);\n        }\n      }\n    },\n    unset: function(object, property, controller) {\n      var list = object[property];\n      if (!list) {\n        return;\n      }\n      arrayRemove(list, controller);\n      if (list.length === 0) {\n        delete object[property];\n      }\n    },\n    parentForm: parentForm,\n    $animate: $animate\n  });\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setDirty\n   *\n   * @description\n   * Sets the form to a dirty state.\n   *\n   * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n   * state (ng-dirty class). This method will also propagate to parent forms.\n   */\n  form.$setDirty = function() {\n    $animate.removeClass(element, PRISTINE_CLASS);\n    $animate.addClass(element, DIRTY_CLASS);\n    form.$dirty = true;\n    form.$pristine = false;\n    parentForm.$setDirty();\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setPristine\n   *\n   * @description\n   * Sets the form to its pristine state.\n   *\n   * This method can be called to remove the 'ng-dirty' class and set the form to its pristine\n   * state (ng-pristine class). This method will also propagate to all the controls contained\n   * in this form.\n   *\n   * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n   * saving or resetting it.\n   */\n  form.$setPristine = function() {\n    $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n    form.$dirty = false;\n    form.$pristine = true;\n    form.$submitted = false;\n    forEach(controls, function(control) {\n      control.$setPristine();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setUntouched\n   *\n   * @description\n   * Sets the form to its untouched state.\n   *\n   * This method can be called to remove the 'ng-touched' class and set the form controls to their\n   * untouched state (ng-untouched class).\n   *\n   * Setting a form controls back to their untouched state is often useful when setting the form\n   * back to its pristine state.\n   */\n  form.$setUntouched = function() {\n    forEach(controls, function(control) {\n      control.$setUntouched();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setSubmitted\n   *\n   * @description\n   * Sets the form to its submitted state.\n   */\n  form.$setSubmitted = function() {\n    $animate.addClass(element, SUBMITTED_CLASS);\n    form.$submitted = true;\n    parentForm.$setSubmitted();\n  };\n}\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Nestable alias of {@link ng.directive:form `form`} directive. HTML\n * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a\n * sub-group of controls needs to be determined.\n *\n * Note: the purpose of `ngForm` is to group controls,\n * but not to be a replacement for the `<form>` tag with all of its capabilities\n * (e.g. posting to the server, ...).\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into\n *                       related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * # Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In Angular forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so\n * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to\n * `<form>` but can be nested.  This allows you to have nested forms, which is very useful when\n * using Angular validation directives in forms that are dynamically generated using the\n * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name`\n * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an\n * `ngForm` directive and nest these in an outer `form` element.\n *\n *\n * # CSS classes\n *  - `ng-valid` is set if the form is valid.\n *  - `ng-invalid` is set if the form is invalid.\n *  - `ng-pristine` is set if the form is pristine.\n *  - `ng-dirty` is set if the form is dirty.\n *  - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * # Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side Angular applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, Angular prevents the default action (form submission to the server) unless the\n * `<form>` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n  *  button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ## Animation Hooks\n *\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-form.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * </pre>\n *\n * @example\n    <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"formExample\">\n      <file name=\"index.html\">\n       <script>\n         angular.module('formExample', [])\n           .controller('FormController', ['$scope', function($scope) {\n             $scope.userType = 'guest';\n           }]);\n       </script>\n       <style>\n        .my-form {\n          -webkit-transition:all linear 0.5s;\n          transition:all linear 0.5s;\n          background: transparent;\n        }\n        .my-form.ng-invalid {\n          background: red;\n        }\n       </style>\n       <form name=\"myForm\" ng-controller=\"FormController\" class=\"my-form\">\n         userType: <input name=\"input\" ng-model=\"userType\" required>\n         <span class=\"error\" ng-show=\"myForm.input.$error.required\">Required!</span><br>\n         <tt>userType = {{userType}}</tt><br>\n         <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>\n         <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>\n         <tt>myForm.$valid = {{myForm.$valid}}</tt><br>\n         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>\n        </form>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should initialize to model', function() {\n          var userType = element(by.binding('userType'));\n          var valid = element(by.binding('myForm.input.$valid'));\n\n          expect(userType.getText()).toContain('guest');\n          expect(valid.getText()).toContain('true');\n        });\n\n        it('should be invalid if empty', function() {\n          var userType = element(by.binding('userType'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var userInput = element(by.model('userType'));\n\n          userInput.clear();\n          userInput.sendKeys('');\n\n          expect(userType.getText()).toEqual('userType =');\n          expect(valid.getText()).toContain('false');\n        });\n      </file>\n    </example>\n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n *                       related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n  return ['$timeout', function($timeout) {\n    var formDirective = {\n      name: 'form',\n      restrict: isNgForm ? 'EAC' : 'E',\n      controller: FormController,\n      compile: function ngFormCompile(formElement) {\n        // Setup initial state of the control\n        formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n        return {\n          pre: function ngFormPreLink(scope, formElement, attr, controller) {\n            // if `action` attr is not present on the form, prevent the default action (submission)\n            if (!('action' in attr)) {\n              // we can't use jq events because if a form is destroyed during submission the default\n              // action is not prevented. see #1238\n              //\n              // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n              // page reload if the form was destroyed by submission of the form via a click handler\n              // on a button in the form. Looks like an IE9 specific bug.\n              var handleFormSubmission = function(event) {\n                scope.$apply(function() {\n                  controller.$commitViewValue();\n                  controller.$setSubmitted();\n                });\n\n                event.preventDefault();\n              };\n\n              addEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n\n              // unregister the preventDefault listener so that we don't not leak memory but in a\n              // way that will achieve the prevention of the default action.\n              formElement.on('$destroy', function() {\n                $timeout(function() {\n                  removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n                }, 0, false);\n              });\n            }\n\n            var parentFormCtrl = controller.$$parentForm,\n                alias = controller.$name;\n\n            if (alias) {\n              setter(scope, null, alias, controller, alias);\n              attr.$observe(attr.name ? 'name' : 'ngForm', function(newValue) {\n                if (alias === newValue) return;\n                setter(scope, null, alias, undefined, alias);\n                alias = newValue;\n                setter(scope, null, alias, controller, alias);\n                parentFormCtrl.$$renameControl(controller, alias);\n              });\n            }\n            formElement.on('$destroy', function() {\n              parentFormCtrl.$removeControl(controller);\n              if (alias) {\n                setter(scope, null, alias, undefined, alias);\n              }\n              extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n            });\n          }\n        };\n      }\n    };\n\n    return formDirective;\n  }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n/* global VALID_CLASS: false,\n  INVALID_CLASS: false,\n  PRISTINE_CLASS: false,\n  DIRTY_CLASS: false,\n  UNTOUCHED_CLASS: false,\n  TOUCHED_CLASS: false,\n  $ngModelMinErr: false,\n*/\n\n// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar ISO_DATE_REGEXP = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/;\nvar URL_REGEXP = /^(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?$/;\nvar EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;\nvar NUMBER_REGEXP = /^\\s*(\\-|\\+)?(\\d+|(\\d*(\\.\\d*)))\\s*$/;\nvar DATE_REGEXP = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar inputType = {\n\n  /**\n   * @ngdoc input\n   * @name input[text]\n   *\n   * @description\n   * Standard HTML text input with angular data binding, inherited by most of the `input` elements.\n   *\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Adds `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n   *    This parameter is ignored for input[type=password] controls, which will never trim the\n   *    input.\n   *\n   * @example\n      <example name=\"text-input-directive\" module=\"textInputExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('textInputExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.example = {\n                 text: 'guest',\n                 word: /^\\s*\\w*\\s*$/\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Single word: <input type=\"text\" name=\"input\" ng-model=\"example.text\"\n                               ng-pattern=\"example.word\" required ng-trim=\"false\">\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.pattern\">\n             Single word only!</span>\n\n           <tt>text = {{example.text}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('example.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('example.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('guest');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if multi word', function() {\n            input.clear();\n            input.sendKeys('hello world');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'text': textInputType,\n\n    /**\n     * @ngdoc input\n     * @name input[date]\n     *\n     * @description\n     * Input with date validation and transformation. In browsers that do not yet support\n     * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n     * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n     * modern browsers do not yet support this input type, it is important to provide cues to users on the\n     * expected input format via a placeholder or label.\n     *\n     * The model must always be a Date object, otherwise Angular will throw an error.\n     * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n     *\n     * The timezone to be used to read/write the `Date` instance in the model can be defined using\n     * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n     *\n     * @param {string} ngModel Assignable angular expression to data-bind to.\n     * @param {string=} name Property name of the form under which the control is published.\n     * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n     * valid ISO date string (yyyy-MM-dd).\n     * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n     * a valid ISO date string (yyyy-MM-dd).\n     * @param {string=} required Sets `required` validation error key if the value is not entered.\n     * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n     *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n     *    `required` when you want to data-bind to the `required` attribute.\n     * @param {string=} ngChange Angular expression to be executed when input changes due to user\n     *    interaction with the input element.\n     *\n     * @example\n     <example name=\"date-input-directive\" module=\"dateInputExample\">\n     <file name=\"index.html\">\n       <script>\n          angular.module('dateInputExample', [])\n            .controller('DateController', ['$scope', function($scope) {\n              $scope.example = {\n                value: new Date(2013, 9, 22)\n              };\n            }]);\n       </script>\n       <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n          Pick a date in 2013:\n          <input type=\"date\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n              placeholder=\"yyyy-MM-dd\" min=\"2013-01-01\" max=\"2013-12-31\" required />\n          <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n              Required!</span>\n          <span class=\"error\" ng-show=\"myForm.input.$error.date\">\n              Not a valid date!</span>\n           <tt>value = {{example.value | date: \"yyyy-MM-dd\"}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n       </form>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n        var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n        var valid = element(by.binding('myForm.input.$valid'));\n        var input = element(by.model('example.value'));\n\n        // currently protractor/webdriver does not support\n        // sending keys to all known HTML5 input controls\n        // for various browsers (see https://github.com/angular/protractor/issues/562).\n        function setInput(val) {\n          // set the value of the element and force validation.\n          var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n          \"ipt.value = '\" + val + \"';\" +\n          \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n          browser.executeScript(scr);\n        }\n\n        it('should initialize to model', function() {\n          expect(value.getText()).toContain('2013-10-22');\n          expect(valid.getText()).toContain('myForm.input.$valid = true');\n        });\n\n        it('should be invalid if empty', function() {\n          setInput('');\n          expect(value.getText()).toEqual('value =');\n          expect(valid.getText()).toContain('myForm.input.$valid = false');\n        });\n\n        it('should be invalid if over max', function() {\n          setInput('2015-01-01');\n          expect(value.getText()).toContain('');\n          expect(valid.getText()).toContain('myForm.input.$valid = false');\n        });\n     </file>\n     </example>\n     */\n  'date': createDateInputType('date', DATE_REGEXP,\n         createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n         'yyyy-MM-dd'),\n\n   /**\n    * @ngdoc input\n    * @name input[datetime-local]\n    *\n    * @description\n    * Input with datetime validation and transformation. In browsers that do not yet support\n    * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n    * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n    *\n    * The model must always be a Date object, otherwise Angular will throw an error.\n    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n    *\n    * The timezone to be used to read/write the `Date` instance in the model can be defined using\n    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n    *\n    * @param {string} ngModel Assignable angular expression to data-bind to.\n    * @param {string=} name Property name of the form under which the control is published.\n    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n    * valid ISO datetime format (yyyy-MM-ddTHH:mm:ss).\n    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n    * a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss).\n    * @param {string=} required Sets `required` validation error key if the value is not entered.\n    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n    *    `required` when you want to data-bind to the `required` attribute.\n    * @param {string=} ngChange Angular expression to be executed when input changes due to user\n    *    interaction with the input element.\n    *\n    * @example\n    <example name=\"datetimelocal-input-directive\" module=\"dateExample\">\n    <file name=\"index.html\">\n      <script>\n        angular.module('dateExample', [])\n          .controller('DateController', ['$scope', function($scope) {\n            $scope.example = {\n              value: new Date(2010, 11, 28, 14, 57)\n            };\n          }]);\n      </script>\n      <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a date between in 2013:\n        <input type=\"datetime-local\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"yyyy-MM-ddTHH:mm:ss\" min=\"2001-01-01T00:00:00\" max=\"2013-12-31T00:00:00\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.datetimelocal\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2010-12-28T14:57:00');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-01-01T23:59:00');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n    </file>\n    </example>\n    */\n  'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n      createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n      'yyyy-MM-ddTHH:mm:ss.sss'),\n\n  /**\n   * @ngdoc input\n   * @name input[time]\n   *\n   * @description\n   * Input with time validation and transformation. In browsers that do not yet support\n   * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n   * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n   * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n   *\n   * The model must always be a Date object, otherwise Angular will throw an error.\n   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n   *\n   * The timezone to be used to read/write the `Date` instance in the model can be defined using\n   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n   * valid ISO time format (HH:mm:ss).\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be a\n   * valid ISO time format (HH:mm:ss).\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n   <example name=\"time-input-directive\" module=\"timeExample\">\n   <file name=\"index.html\">\n     <script>\n      angular.module('timeExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(1970, 0, 1, 14, 57, 0)\n          };\n        }]);\n     </script>\n     <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a between 8am and 5pm:\n        <input type=\"time\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"HH:mm:ss\" min=\"08:00:00\" max=\"17:00:00\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.time\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"HH:mm:ss\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n     </form>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('14:57:00');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('23:59:00');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n   </file>\n   </example>\n   */\n  'time': createDateInputType('time', TIME_REGEXP,\n      createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n     'HH:mm:ss.sss'),\n\n   /**\n    * @ngdoc input\n    * @name input[week]\n    *\n    * @description\n    * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n    * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n    * week format (yyyy-W##), for example: `2013-W02`.\n    *\n    * The model must always be a Date object, otherwise Angular will throw an error.\n    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n    *\n    * The timezone to be used to read/write the `Date` instance in the model can be defined using\n    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n    *\n    * @param {string} ngModel Assignable angular expression to data-bind to.\n    * @param {string=} name Property name of the form under which the control is published.\n    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n    * valid ISO week format (yyyy-W##).\n    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n    * a valid ISO week format (yyyy-W##).\n    * @param {string=} required Sets `required` validation error key if the value is not entered.\n    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n    *    `required` when you want to data-bind to the `required` attribute.\n    * @param {string=} ngChange Angular expression to be executed when input changes due to user\n    *    interaction with the input element.\n    *\n    * @example\n    <example name=\"week-input-directive\" module=\"weekExample\">\n    <file name=\"index.html\">\n      <script>\n      angular.module('weekExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(2013, 0, 3)\n          };\n        }]);\n      </script>\n      <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a date between in 2013:\n        <input id=\"exampleInput\" type=\"week\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"YYYY-W##\" min=\"2012-W32\" max=\"2013-W52\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.week\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"yyyy-Www\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2013-W01');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-W01');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n    </file>\n    </example>\n    */\n  'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n  /**\n   * @ngdoc input\n   * @name input[month]\n   *\n   * @description\n   * Input with month validation and transformation. In browsers that do not yet support\n   * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n   * month format (yyyy-MM), for example: `2009-01`.\n   *\n   * The model must always be a Date object, otherwise Angular will throw an error.\n   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n   * If the model is not set to the first of the month, the next view to model update will set it\n   * to the first of the month.\n   *\n   * The timezone to be used to read/write the `Date` instance in the model can be defined using\n   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be\n   * a valid ISO month format (yyyy-MM).\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must\n   * be a valid ISO month format (yyyy-MM).\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n   <example name=\"month-input-directive\" module=\"monthExample\">\n   <file name=\"index.html\">\n     <script>\n      angular.module('monthExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(2013, 9, 1)\n          };\n        }]);\n     </script>\n     <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n       Pick a month in 2013:\n       <input id=\"exampleInput\" type=\"month\" name=\"input\" ng-model=\"example.value\"\n          placeholder=\"yyyy-MM\" min=\"2013-01\" max=\"2013-12\" required />\n       <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n          Required!</span>\n       <span class=\"error\" ng-show=\"myForm.input.$error.month\">\n          Not a valid month!</span>\n       <tt>value = {{example.value | date: \"yyyy-MM\"}}</tt><br/>\n       <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n       <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n       <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n       <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n     </form>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2013-10');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-01');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n   </file>\n   </example>\n   */\n  'month': createDateInputType('month', MONTH_REGEXP,\n     createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n     'yyyy-MM'),\n\n  /**\n   * @ngdoc input\n   * @name input[number]\n   *\n   * @description\n   * Text input with number validation and transformation. Sets the `number` validation\n   * error if not a valid number.\n   *\n   * The model must always be a number, otherwise Angular will throw an error.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"number-input-directive\" module=\"numberExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('numberExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.example = {\n                 value: 12\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Number: <input type=\"number\" name=\"input\" ng-model=\"example.value\"\n                          min=\"0\" max=\"99\" required>\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.number\">\n             Not valid number!</span>\n           <tt>value = {{example.value}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var value = element(by.binding('example.value'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('example.value'));\n\n          it('should initialize to model', function() {\n            expect(value.getText()).toContain('12');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n            expect(value.getText()).toEqual('value =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if over max', function() {\n            input.clear();\n            input.sendKeys('123');\n            expect(value.getText()).toEqual('value =');\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'number': numberInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[url]\n   *\n   * @description\n   * Text input with URL validation. Sets the `url` validation error key if the content is not a\n   * valid URL.\n   *\n   * <div class=\"alert alert-warning\">\n   * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n   * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n   * the built-in validators (see the {@link guide/forms Forms guide})\n   * </div>\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"url-input-directive\" module=\"urlExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('urlExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.url = {\n                 text: 'http://google.com'\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           URL: <input type=\"url\" name=\"input\" ng-model=\"url.text\" required>\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.url\">\n             Not valid url!</span>\n           <tt>text = {{url.text}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n           <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('url.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('url.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('http://google.com');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if not url', function() {\n            input.clear();\n            input.sendKeys('box');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'url': urlInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[email]\n   *\n   * @description\n   * Text input with email validation. Sets the `email` validation error key if not a valid email\n   * address.\n   *\n   * <div class=\"alert alert-warning\">\n   * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n   * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can\n   * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})\n   * </div>\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"email-input-directive\" module=\"emailExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('emailExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.email = {\n                 text: 'me@example.com'\n               };\n             }]);\n         </script>\n           <form name=\"myForm\" ng-controller=\"ExampleController\">\n             Email: <input type=\"email\" name=\"input\" ng-model=\"email.text\" required>\n             <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n               Required!</span>\n             <span class=\"error\" ng-show=\"myForm.input.$error.email\">\n               Not valid email!</span>\n             <tt>text = {{email.text}}</tt><br/>\n             <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n             <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n             <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n             <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n             <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>\n           </form>\n         </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('email.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('email.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('me@example.com');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if not email', function() {\n            input.clear();\n            input.sendKeys('xxx');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'email': emailInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[radio]\n   *\n   * @description\n   * HTML radio button.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string} value The value to which the expression should be set when selected.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   * @param {string} ngValue Angular expression which sets the value to which the expression should\n   *    be set when selected.\n   *\n   * @example\n      <example name=\"radio-input-directive\" module=\"radioExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('radioExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.color = {\n                 name: 'blue'\n               };\n               $scope.specialValue = {\n                 \"id\": \"12345\",\n                 \"value\": \"green\"\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           <input type=\"radio\" ng-model=\"color.name\" value=\"red\">  Red <br/>\n           <input type=\"radio\" ng-model=\"color.name\" ng-value=\"specialValue\"> Green <br/>\n           <input type=\"radio\" ng-model=\"color.name\" value=\"blue\"> Blue <br/>\n           <tt>color = {{color.name | json}}</tt><br/>\n          </form>\n          Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          it('should change state', function() {\n            var color = element(by.binding('color.name'));\n\n            expect(color.getText()).toContain('blue');\n\n            element.all(by.model('color.name')).get(0).click();\n\n            expect(color.getText()).toContain('red');\n          });\n        </file>\n      </example>\n   */\n  'radio': radioInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[checkbox]\n   *\n   * @description\n   * HTML checkbox.\n   *\n   * @param {string} ngModel 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=} ngTrueValue The value to which the expression should be set when selected.\n   * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"checkbox-input-directive\" module=\"checkboxExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('checkboxExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.checkboxModel = {\n                value1 : true,\n                value2 : 'YES'\n              };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Value1: <input type=\"checkbox\" ng-model=\"checkboxModel.value1\"> <br/>\n           Value2: <input type=\"checkbox\" ng-model=\"checkboxModel.value2\"\n                          ng-true-value=\"'YES'\" ng-false-value=\"'NO'\"> <br/>\n           <tt>value1 = {{checkboxModel.value1}}</tt><br/>\n           <tt>value2 = {{checkboxModel.value2}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          it('should change state', function() {\n            var value1 = element(by.binding('checkboxModel.value1'));\n            var value2 = element(by.binding('checkboxModel.value2'));\n\n            expect(value1.getText()).toContain('true');\n            expect(value2.getText()).toContain('YES');\n\n            element(by.model('checkboxModel.value1')).click();\n            element(by.model('checkboxModel.value2')).click();\n\n            expect(value1.getText()).toContain('false');\n            expect(value2.getText()).toContain('NO');\n          });\n        </file>\n      </example>\n   */\n  'checkbox': checkboxInputType,\n\n  'hidden': noop,\n  'button': noop,\n  'submit': noop,\n  'reset': noop,\n  'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n  ctrl.$formatters.push(function(value) {\n    return ctrl.$isEmpty(value) ? value : value.toString();\n  });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  var type = lowercase(element[0].type);\n\n  // In composition mode, users are still inputing intermediate text buffer,\n  // hold the listener until composition is done.\n  // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n  if (!$sniffer.android) {\n    var composing = false;\n\n    element.on('compositionstart', function(data) {\n      composing = true;\n    });\n\n    element.on('compositionend', function() {\n      composing = false;\n      listener();\n    });\n  }\n\n  var listener = function(ev) {\n    if (timeout) {\n      $browser.defer.cancel(timeout);\n      timeout = null;\n    }\n    if (composing) return;\n    var value = element.val(),\n        event = ev && ev.type;\n\n    // By default we will trim the value\n    // If the attribute ng-trim exists we will avoid trimming\n    // If input type is 'password', the value is never trimmed\n    if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n      value = trim(value);\n    }\n\n    // If a control is suffering from bad input (due to native validators), browsers discard its\n    // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n    // control's value is the same empty value twice in a row.\n    if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n      ctrl.$setViewValue(value, event);\n    }\n  };\n\n  // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n  // input event on backspace, delete or cut\n  if ($sniffer.hasEvent('input')) {\n    element.on('input', listener);\n  } else {\n    var timeout;\n\n    var deferListener = function(ev, input, origValue) {\n      if (!timeout) {\n        timeout = $browser.defer(function() {\n          timeout = null;\n          if (!input || input.value !== origValue) {\n            listener(ev);\n          }\n        });\n      }\n    };\n\n    element.on('keydown', function(event) {\n      var key = event.keyCode;\n\n      // ignore\n      //    command            modifiers                   arrows\n      if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n      deferListener(event, this, this.value);\n    });\n\n    // if user modifies input value using context menu in IE, we need \"paste\" and \"cut\" events to catch it\n    if ($sniffer.hasEvent('paste')) {\n      element.on('paste cut', deferListener);\n    }\n  }\n\n  // if user paste into input using mouse on older browser\n  // or form autocomplete on newer browser, we need \"change\" event to catch it\n  element.on('change', listener);\n\n  ctrl.$render = function() {\n    element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);\n  };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n  if (isDate(isoWeek)) {\n    return isoWeek;\n  }\n\n  if (isString(isoWeek)) {\n    WEEK_REGEXP.lastIndex = 0;\n    var parts = WEEK_REGEXP.exec(isoWeek);\n    if (parts) {\n      var year = +parts[1],\n          week = +parts[2],\n          hours = 0,\n          minutes = 0,\n          seconds = 0,\n          milliseconds = 0,\n          firstThurs = getFirstThursdayOfYear(year),\n          addDays = (week - 1) * 7;\n\n      if (existingDate) {\n        hours = existingDate.getHours();\n        minutes = existingDate.getMinutes();\n        seconds = existingDate.getSeconds();\n        milliseconds = existingDate.getMilliseconds();\n      }\n\n      return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n    }\n  }\n\n  return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n  return function(iso, date) {\n    var parts, map;\n\n    if (isDate(iso)) {\n      return iso;\n    }\n\n    if (isString(iso)) {\n      // When a date is JSON'ified to wraps itself inside of an extra\n      // set of double quotes. This makes the date parsing code unable\n      // to match the date string and parse it as a date.\n      if (iso.charAt(0) == '\"' && iso.charAt(iso.length - 1) == '\"') {\n        iso = iso.substring(1, iso.length - 1);\n      }\n      if (ISO_DATE_REGEXP.test(iso)) {\n        return new Date(iso);\n      }\n      regexp.lastIndex = 0;\n      parts = regexp.exec(iso);\n\n      if (parts) {\n        parts.shift();\n        if (date) {\n          map = {\n            yyyy: date.getFullYear(),\n            MM: date.getMonth() + 1,\n            dd: date.getDate(),\n            HH: date.getHours(),\n            mm: date.getMinutes(),\n            ss: date.getSeconds(),\n            sss: date.getMilliseconds() / 1000\n          };\n        } else {\n          map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n        }\n\n        forEach(parts, function(part, index) {\n          if (index < mapping.length) {\n            map[mapping[index]] = +part;\n          }\n        });\n        return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n      }\n    }\n\n    return NaN;\n  };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n  return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {\n    badInputChecker(scope, element, attr, ctrl);\n    baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n    var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;\n    var previousDate;\n\n    ctrl.$$parserName = type;\n    ctrl.$parsers.push(function(value) {\n      if (ctrl.$isEmpty(value)) return null;\n      if (regexp.test(value)) {\n        // Note: We cannot read ctrl.$modelValue, as there might be a different\n        // parser/formatter in the processing chain so that the model\n        // contains some different data format!\n        var parsedDate = parseDate(value, previousDate);\n        if (timezone === 'UTC') {\n          parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());\n        }\n        return parsedDate;\n      }\n      return undefined;\n    });\n\n    ctrl.$formatters.push(function(value) {\n      if (value && !isDate(value)) {\n        throw $ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n      }\n      if (isValidDate(value)) {\n        previousDate = value;\n        if (previousDate && timezone === 'UTC') {\n          var timezoneOffset = 60000 * previousDate.getTimezoneOffset();\n          previousDate = new Date(previousDate.getTime() + timezoneOffset);\n        }\n        return $filter('date')(value, format, timezone);\n      } else {\n        previousDate = null;\n        return '';\n      }\n    });\n\n    if (isDefined(attr.min) || attr.ngMin) {\n      var minVal;\n      ctrl.$validators.min = function(value) {\n        return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;\n      };\n      attr.$observe('min', function(val) {\n        minVal = parseObservedDateValue(val);\n        ctrl.$validate();\n      });\n    }\n\n    if (isDefined(attr.max) || attr.ngMax) {\n      var maxVal;\n      ctrl.$validators.max = function(value) {\n        return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;\n      };\n      attr.$observe('max', function(val) {\n        maxVal = parseObservedDateValue(val);\n        ctrl.$validate();\n      });\n    }\n\n    function isValidDate(value) {\n      // Invalid Date: getTime() returns NaN\n      return value && !(value.getTime && value.getTime() !== value.getTime());\n    }\n\n    function parseObservedDateValue(val) {\n      return isDefined(val) ? (isDate(val) ? val : parseDate(val)) : undefined;\n    }\n  };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl) {\n  var node = element[0];\n  var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n  if (nativeValidation) {\n    ctrl.$parsers.push(function(value) {\n      var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n      // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430):\n      // - also sets validity.badInput (should only be validity.typeMismatch).\n      // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)\n      // - can ignore this case as we can still read out the erroneous email...\n      return validity.badInput && !validity.typeMismatch ? undefined : value;\n    });\n  }\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  badInputChecker(scope, element, attr, ctrl);\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n  ctrl.$$parserName = 'number';\n  ctrl.$parsers.push(function(value) {\n    if (ctrl.$isEmpty(value))      return null;\n    if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n    return undefined;\n  });\n\n  ctrl.$formatters.push(function(value) {\n    if (!ctrl.$isEmpty(value)) {\n      if (!isNumber(value)) {\n        throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n      }\n      value = value.toString();\n    }\n    return value;\n  });\n\n  if (attr.min || attr.ngMin) {\n    var minVal;\n    ctrl.$validators.min = function(value) {\n      return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;\n    };\n\n    attr.$observe('min', function(val) {\n      if (isDefined(val) && !isNumber(val)) {\n        val = parseFloat(val, 10);\n      }\n      minVal = isNumber(val) && !isNaN(val) ? val : undefined;\n      // TODO(matsko): implement validateLater to reduce number of validations\n      ctrl.$validate();\n    });\n  }\n\n  if (attr.max || attr.ngMax) {\n    var maxVal;\n    ctrl.$validators.max = function(value) {\n      return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;\n    };\n\n    attr.$observe('max', function(val) {\n      if (isDefined(val) && !isNumber(val)) {\n        val = parseFloat(val, 10);\n      }\n      maxVal = isNumber(val) && !isNaN(val) ? val : undefined;\n      // TODO(matsko): implement validateLater to reduce number of validations\n      ctrl.$validate();\n    });\n  }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  // Note: no badInputChecker here by purpose as `url` is only a validation\n  // in browsers, i.e. we can always read out input.value even if it is not valid!\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n\n  ctrl.$$parserName = 'url';\n  ctrl.$validators.url = function(modelValue, viewValue) {\n    var value = modelValue || viewValue;\n    return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n  };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  // Note: no badInputChecker here by purpose as `url` is only a validation\n  // in browsers, i.e. we can always read out input.value even if it is not valid!\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n\n  ctrl.$$parserName = 'email';\n  ctrl.$validators.email = function(modelValue, viewValue) {\n    var value = modelValue || viewValue;\n    return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n  };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n  // make the name unique, if not defined\n  if (isUndefined(attr.name)) {\n    element.attr('name', nextUid());\n  }\n\n  var listener = function(ev) {\n    if (element[0].checked) {\n      ctrl.$setViewValue(attr.value, ev && ev.type);\n    }\n  };\n\n  element.on('click', listener);\n\n  ctrl.$render = function() {\n    var value = attr.value;\n    element[0].checked = (value == ctrl.$viewValue);\n  };\n\n  attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n  var parseFn;\n  if (isDefined(expression)) {\n    parseFn = $parse(expression);\n    if (!parseFn.constant) {\n      throw minErr('ngModel')('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n                                   '`{1}`.', name, expression);\n    }\n    return parseFn(context);\n  }\n  return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n  var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n  var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n  var listener = function(ev) {\n    ctrl.$setViewValue(element[0].checked, ev && ev.type);\n  };\n\n  element.on('click', listener);\n\n  ctrl.$render = function() {\n    element[0].checked = ctrl.$viewValue;\n  };\n\n  // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n  // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n  // it to a boolean.\n  ctrl.$isEmpty = function(value) {\n    return value === false;\n  };\n\n  ctrl.$formatters.push(function(value) {\n    return equals(value, trueValue);\n  });\n\n  ctrl.$parsers.push(function(value) {\n    return value ? trueValue : falseValue;\n  });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with angular data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n *    `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n *    minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n *    length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the\n *    RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for\n *    patterns defined as scope expressions.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n *    interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n */\n\n\n/**\n * @ngdoc directive\n * @name input\n * @restrict E\n *\n * @description\n * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,\n * input state control, and validation.\n * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Not every feature offered is available for all input types.\n * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {boolean=} ngRequired Sets `required` attribute if set to true\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n *    minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n *    length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the\n *    RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for\n *    patterns defined as scope expressions.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n *    interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n *    This parameter is ignored for input[type=password] controls, which will never trim the\n *    input.\n *\n * @example\n    <example name=\"input-directive\" module=\"inputExample\">\n      <file name=\"index.html\">\n       <script>\n          angular.module('inputExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.user = {name: 'guest', last: 'visitor'};\n            }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <form name=\"myForm\">\n           User name: <input type=\"text\" name=\"userName\" ng-model=\"user.name\" required>\n           <span class=\"error\" ng-show=\"myForm.userName.$error.required\">\n             Required!</span><br>\n           Last name: <input type=\"text\" name=\"lastName\" ng-model=\"user.last\"\n             ng-minlength=\"3\" ng-maxlength=\"10\">\n           <span class=\"error\" ng-show=\"myForm.lastName.$error.minlength\">\n             Too short!</span>\n           <span class=\"error\" ng-show=\"myForm.lastName.$error.maxlength\">\n             Too long!</span><br>\n         </form>\n         <hr>\n         <tt>user = {{user}}</tt><br/>\n         <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>\n         <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>\n         <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>\n         <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br>\n         <tt>myForm.$valid = {{myForm.$valid}}</tt><br>\n         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>\n         <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br>\n         <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br>\n       </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        var user = element(by.exactBinding('user'));\n        var userNameValid = element(by.binding('myForm.userName.$valid'));\n        var lastNameValid = element(by.binding('myForm.lastName.$valid'));\n        var lastNameError = element(by.binding('myForm.lastName.$error'));\n        var formValid = element(by.binding('myForm.$valid'));\n        var userNameInput = element(by.model('user.name'));\n        var userLastInput = element(by.model('user.last'));\n\n        it('should initialize to model', function() {\n          expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"visitor\"}');\n          expect(userNameValid.getText()).toContain('true');\n          expect(formValid.getText()).toContain('true');\n        });\n\n        it('should be invalid if empty when required', function() {\n          userNameInput.clear();\n          userNameInput.sendKeys('');\n\n          expect(user.getText()).toContain('{\"last\":\"visitor\"}');\n          expect(userNameValid.getText()).toContain('false');\n          expect(formValid.getText()).toContain('false');\n        });\n\n        it('should be valid if empty when min length is set', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"\"}');\n          expect(lastNameValid.getText()).toContain('true');\n          expect(formValid.getText()).toContain('true');\n        });\n\n        it('should be invalid if less than required min length', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('xx');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\"}');\n          expect(lastNameValid.getText()).toContain('false');\n          expect(lastNameError.getText()).toContain('minlength');\n          expect(formValid.getText()).toContain('false');\n        });\n\n        it('should be invalid if longer than max length', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('some ridiculously long name');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\"}');\n          expect(lastNameValid.getText()).toContain('false');\n          expect(lastNameError.getText()).toContain('maxlength');\n          expect(formValid.getText()).toContain('false');\n        });\n      </file>\n    </example>\n */\nvar inputDirective = ['$browser', '$sniffer', '$filter', '$parse',\n    function($browser, $sniffer, $filter, $parse) {\n  return {\n    restrict: 'E',\n    require: ['?ngModel'],\n    link: {\n      pre: function(scope, element, attr, ctrls) {\n        if (ctrls[0]) {\n          (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,\n                                                              $browser, $filter, $parse);\n        }\n      }\n    }\n  };\n}];\n\n\n\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ngValue\n *\n * @description\n * Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},\n * so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to\n * the bound value.\n *\n * `ngValue` is useful when dynamically generating lists of radio buttons using\n * {@link ngRepeat `ngRepeat`}, as shown below.\n *\n * Likewise, `ngValue` can be used to generate `<option>` elements for\n * the {@link select `select`} element. In that case however, only strings are supported\n * for the `value `attribute, so the resulting `ngModel` will always be a string.\n * Support for `select` models with non-string values is available via `ngOptions`.\n *\n * @element input\n * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute\n *   of the `input` element\n *\n * @example\n    <example name=\"ngValue-directive\" module=\"valueExample\">\n      <file name=\"index.html\">\n       <script>\n          angular.module('valueExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.names = ['pizza', 'unicorns', 'robots'];\n              $scope.my = { favorite: 'unicorns' };\n            }]);\n       </script>\n        <form ng-controller=\"ExampleController\">\n          <h2>Which is your favorite?</h2>\n            <label ng-repeat=\"name in names\" for=\"{{name}}\">\n              {{name}}\n              <input type=\"radio\"\n                     ng-model=\"my.favorite\"\n                     ng-value=\"name\"\n                     id=\"{{name}}\"\n                     name=\"favorite\">\n            </label>\n          <div>You chose {{my.favorite}}</div>\n        </form>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        var favorite = element(by.binding('my.favorite'));\n\n        it('should initialize to model', function() {\n          expect(favorite.getText()).toContain('unicorns');\n        });\n        it('should bind the values to the inputs', function() {\n          element.all(by.model('my.favorite')).get(0).click();\n          expect(favorite.getText()).toContain('pizza');\n        });\n      </file>\n    </example>\n */\nvar ngValueDirective = function() {\n  return {\n    restrict: 'A',\n    priority: 100,\n    compile: function(tpl, tplAttr) {\n      if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {\n        return function ngValueConstantLink(scope, elm, attr) {\n          attr.$set('value', scope.$eval(attr.ngValue));\n        };\n      } else {\n        return function ngValueLink(scope, elm, attr) {\n          scope.$watch(attr.ngValue, function valueWatchAction(value) {\n            attr.$set('value', value);\n          });\n        };\n      }\n    }\n  };\n};\n\n/**\n * @ngdoc directive\n * @name ngBind\n * @restrict AC\n *\n * @description\n * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element\n * with the value of a given expression, and to update the text content when the value of that\n * expression changes.\n *\n * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like\n * `{{ expression }}` which is similar but less verbose.\n *\n * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily\n * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an\n * element attribute, it makes the bindings invisible to the user while the page is loading.\n *\n * An alternative solution to this problem would be using the\n * {@link ng.directive:ngCloak ngCloak} directive.\n *\n *\n * @element ANY\n * @param {expression} ngBind {@link guide/expression Expression} to evaluate.\n *\n * @example\n * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.\n   <example module=\"bindExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('bindExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.name = 'Whirled';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Enter name: <input type=\"text\" ng-model=\"name\"><br>\n         Hello <span ng-bind=\"name\"></span>!\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind', function() {\n         var nameInput = element(by.model('name'));\n\n         expect(element(by.binding('name')).getText()).toBe('Whirled');\n         nameInput.clear();\n         nameInput.sendKeys('world');\n         expect(element(by.binding('name')).getText()).toBe('world');\n       });\n     </file>\n   </example>\n */\nvar ngBindDirective = ['$compile', function($compile) {\n  return {\n    restrict: 'AC',\n    compile: function ngBindCompile(templateElement) {\n      $compile.$$addBindingClass(templateElement);\n      return function ngBindLink(scope, element, attr) {\n        $compile.$$addBindingInfo(element, attr.ngBind);\n        element = element[0];\n        scope.$watch(attr.ngBind, function ngBindWatchAction(value) {\n          element.textContent = value === undefined ? '' : value;\n        });\n      };\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindTemplate\n *\n * @description\n * The `ngBindTemplate` directive specifies that the element\n * text content should be replaced with the interpolation of the template\n * in the `ngBindTemplate` attribute.\n * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`\n * expressions. This directive is needed since some HTML elements\n * (such as TITLE and OPTION) cannot contain SPAN elements.\n *\n * @element ANY\n * @param {string} ngBindTemplate template of form\n *   <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.\n *\n * @example\n * Try it here: enter text in text box and watch the greeting change.\n   <example module=\"bindExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('bindExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.salutation = 'Hello';\n             $scope.name = 'World';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n        Salutation: <input type=\"text\" ng-model=\"salutation\"><br>\n        Name: <input type=\"text\" ng-model=\"name\"><br>\n        <pre ng-bind-template=\"{{salutation}} {{name}}!\"></pre>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind', function() {\n         var salutationElem = element(by.binding('salutation'));\n         var salutationInput = element(by.model('salutation'));\n         var nameInput = element(by.model('name'));\n\n         expect(salutationElem.getText()).toBe('Hello World!');\n\n         salutationInput.clear();\n         salutationInput.sendKeys('Greetings');\n         nameInput.clear();\n         nameInput.sendKeys('user');\n\n         expect(salutationElem.getText()).toBe('Greetings user!');\n       });\n     </file>\n   </example>\n */\nvar ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {\n  return {\n    compile: function ngBindTemplateCompile(templateElement) {\n      $compile.$$addBindingClass(templateElement);\n      return function ngBindTemplateLink(scope, element, attr) {\n        var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));\n        $compile.$$addBindingInfo(element, interpolateFn.expressions);\n        element = element[0];\n        attr.$observe('ngBindTemplate', function(value) {\n          element.textContent = value === undefined ? '' : value;\n        });\n      };\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindHtml\n *\n * @description\n * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,\n * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.\n * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link\n * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}\n * in your module's dependencies, you need to include \"angular-sanitize.js\" in your application.\n *\n * You may also bypass sanitization for values you know are safe. To do so, bind to\n * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}.  See the example\n * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.\n *\n * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you\n * will have an exception (instead of an exploit.)\n *\n * @element ANY\n * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.\n *\n * @example\n\n   <example module=\"bindHtmlExample\" deps=\"angular-sanitize.js\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n        <p ng-bind-html=\"myHTML\"></p>\n       </div>\n     </file>\n\n     <file name=\"script.js\">\n       angular.module('bindHtmlExample', ['ngSanitize'])\n         .controller('ExampleController', ['$scope', function($scope) {\n           $scope.myHTML =\n              'I am an <code>HTML</code>string with ' +\n              '<a href=\"#\">links!</a> and other <em>stuff</em>';\n         }]);\n     </file>\n\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind-html', function() {\n         expect(element(by.binding('myHTML')).getText()).toBe(\n             'I am an HTMLstring with links! and other stuff');\n       });\n     </file>\n   </example>\n */\nvar ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {\n  return {\n    restrict: 'A',\n    compile: function ngBindHtmlCompile(tElement, tAttrs) {\n      var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);\n      var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function getStringValue(value) {\n        return (value || '').toString();\n      });\n      $compile.$$addBindingClass(tElement);\n\n      return function ngBindHtmlLink(scope, element, attr) {\n        $compile.$$addBindingInfo(element, attr.ngBindHtml);\n\n        scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {\n          // we re-evaluate the expr because we want a TrustedValueHolderType\n          // for $sce, not a string\n          element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');\n        });\n      };\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngChange\n *\n * @description\n * Evaluate the given expression when the user changes the input.\n * The expression is evaluated immediately, unlike the JavaScript onchange event\n * which only triggers at the end of a change (usually, when the user leaves the\n * form element or presses the return key).\n *\n * The `ngChange` expression is only evaluated when a change in the input value causes\n * a new value to be committed to the model.\n *\n * It will not be evaluated:\n * * if the value returned from the `$parsers` transformation pipeline has not changed\n * * if the input has continued to be invalid since the model will stay `null`\n * * if the model is changed programmatically and not by a change to the input value\n *\n *\n * Note, this directive requires `ngModel` to be present.\n *\n * @element input\n * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change\n * in input value.\n *\n * @example\n * <example name=\"ngChange-directive\" module=\"changeExample\">\n *   <file name=\"index.html\">\n *     <script>\n *       angular.module('changeExample', [])\n *         .controller('ExampleController', ['$scope', function($scope) {\n *           $scope.counter = 0;\n *           $scope.change = function() {\n *             $scope.counter++;\n *           };\n *         }]);\n *     </script>\n *     <div ng-controller=\"ExampleController\">\n *       <input type=\"checkbox\" ng-model=\"confirmed\" ng-change=\"change()\" id=\"ng-change-example1\" />\n *       <input type=\"checkbox\" ng-model=\"confirmed\" id=\"ng-change-example2\" />\n *       <label for=\"ng-change-example2\">Confirmed</label><br />\n *       <tt>debug = {{confirmed}}</tt><br/>\n *       <tt>counter = {{counter}}</tt><br/>\n *     </div>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     var counter = element(by.binding('counter'));\n *     var debug = element(by.binding('confirmed'));\n *\n *     it('should evaluate the expression if changing from view', function() {\n *       expect(counter.getText()).toContain('0');\n *\n *       element(by.id('ng-change-example1')).click();\n *\n *       expect(counter.getText()).toContain('1');\n *       expect(debug.getText()).toContain('true');\n *     });\n *\n *     it('should not evaluate the expression if changing from model', function() {\n *       element(by.id('ng-change-example2')).click();\n\n *       expect(counter.getText()).toContain('0');\n *       expect(debug.getText()).toContain('true');\n *     });\n *   </file>\n * </example>\n */\nvar ngChangeDirective = valueFn({\n  restrict: 'A',\n  require: 'ngModel',\n  link: function(scope, element, attr, ctrl) {\n    ctrl.$viewChangeListeners.push(function() {\n      scope.$eval(attr.ngChange);\n    });\n  }\n});\n\nfunction classDirective(name, selector) {\n  name = 'ngClass' + name;\n  return ['$animate', function($animate) {\n    return {\n      restrict: 'AC',\n      link: function(scope, element, attr) {\n        var oldVal;\n\n        scope.$watch(attr[name], ngClassWatchAction, true);\n\n        attr.$observe('class', function(value) {\n          ngClassWatchAction(scope.$eval(attr[name]));\n        });\n\n\n        if (name !== 'ngClass') {\n          scope.$watch('$index', function($index, old$index) {\n            // jshint bitwise: false\n            var mod = $index & 1;\n            if (mod !== (old$index & 1)) {\n              var classes = arrayClasses(scope.$eval(attr[name]));\n              mod === selector ?\n                addClasses(classes) :\n                removeClasses(classes);\n            }\n          });\n        }\n\n        function addClasses(classes) {\n          var newClasses = digestClassCounts(classes, 1);\n          attr.$addClass(newClasses);\n        }\n\n        function removeClasses(classes) {\n          var newClasses = digestClassCounts(classes, -1);\n          attr.$removeClass(newClasses);\n        }\n\n        function digestClassCounts(classes, count) {\n          var classCounts = element.data('$classCounts') || {};\n          var classesToUpdate = [];\n          forEach(classes, function(className) {\n            if (count > 0 || classCounts[className]) {\n              classCounts[className] = (classCounts[className] || 0) + count;\n              if (classCounts[className] === +(count > 0)) {\n                classesToUpdate.push(className);\n              }\n            }\n          });\n          element.data('$classCounts', classCounts);\n          return classesToUpdate.join(' ');\n        }\n\n        function updateClasses(oldClasses, newClasses) {\n          var toAdd = arrayDifference(newClasses, oldClasses);\n          var toRemove = arrayDifference(oldClasses, newClasses);\n          toAdd = digestClassCounts(toAdd, 1);\n          toRemove = digestClassCounts(toRemove, -1);\n          if (toAdd && toAdd.length) {\n            $animate.addClass(element, toAdd);\n          }\n          if (toRemove && toRemove.length) {\n            $animate.removeClass(element, toRemove);\n          }\n        }\n\n        function ngClassWatchAction(newVal) {\n          if (selector === true || scope.$index % 2 === selector) {\n            var newClasses = arrayClasses(newVal || []);\n            if (!oldVal) {\n              addClasses(newClasses);\n            } else if (!equals(newVal,oldVal)) {\n              var oldClasses = arrayClasses(oldVal);\n              updateClasses(oldClasses, newClasses);\n            }\n          }\n          oldVal = shallowCopy(newVal);\n        }\n      }\n    };\n\n    function arrayDifference(tokens1, tokens2) {\n      var values = [];\n\n      outer:\n      for (var i = 0; i < tokens1.length; i++) {\n        var token = tokens1[i];\n        for (var j = 0; j < tokens2.length; j++) {\n          if (token == tokens2[j]) continue outer;\n        }\n        values.push(token);\n      }\n      return values;\n    }\n\n    function arrayClasses(classVal) {\n      if (isArray(classVal)) {\n        return classVal;\n      } else if (isString(classVal)) {\n        return classVal.split(' ');\n      } else if (isObject(classVal)) {\n        var classes = [];\n        forEach(classVal, function(v, k) {\n          if (v) {\n            classes = classes.concat(k.split(' '));\n          }\n        });\n        return classes;\n      }\n      return classVal;\n    }\n  }];\n}\n\n/**\n * @ngdoc directive\n * @name ngClass\n * @restrict AC\n *\n * @description\n * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding\n * an expression that represents all classes to be added.\n *\n * The directive operates in three different ways, depending on which of three types the expression\n * evaluates to:\n *\n * 1. If the expression evaluates to a string, the string should be one or more space-delimited class\n * names.\n *\n * 2. If the expression evaluates to an array, each element of the array should be a string that is\n * one or more space-delimited class names.\n *\n * 3. If the expression evaluates to an object, then for each key-value pair of the\n * object with a truthy value the corresponding key is used as a class name.\n *\n * The directive won't add duplicate classes if a particular class was already set.\n *\n * When the expression changes, the previously added classes are removed and only then the\n * new classes are added.\n *\n * @animations\n * **add** - happens just before the class is applied to the elements\n *\n * **remove** - happens just before the class is removed from the element\n *\n * @element ANY\n * @param {expression} ngClass {@link guide/expression Expression} to eval. The result\n *   of the evaluation can be a string representing space delimited class\n *   names, an array, or a map of class names to boolean values. In the case of a map, the\n *   names of the properties whose values are truthy will be added as css classes to the\n *   element.\n *\n * @example Example that demonstrates basic bindings via ngClass directive.\n   <example>\n     <file name=\"index.html\">\n       <p ng-class=\"{strike: deleted, bold: important, red: error}\">Map Syntax Example</p>\n       <input type=\"checkbox\" ng-model=\"deleted\"> deleted (apply \"strike\" class)<br>\n       <input type=\"checkbox\" ng-model=\"important\"> important (apply \"bold\" class)<br>\n       <input type=\"checkbox\" ng-model=\"error\"> error (apply \"red\" class)\n       <hr>\n       <p ng-class=\"style\">Using String Syntax</p>\n       <input type=\"text\" ng-model=\"style\" placeholder=\"Type: bold strike red\">\n       <hr>\n       <p ng-class=\"[style1, style2, style3]\">Using Array Syntax</p>\n       <input ng-model=\"style1\" placeholder=\"Type: bold, strike or red\"><br>\n       <input ng-model=\"style2\" placeholder=\"Type: bold, strike or red\"><br>\n       <input ng-model=\"style3\" placeholder=\"Type: bold, strike or red\"><br>\n     </file>\n     <file name=\"style.css\">\n       .strike {\n         text-decoration: line-through;\n       }\n       .bold {\n           font-weight: bold;\n       }\n       .red {\n           color: red;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var ps = element.all(by.css('p'));\n\n       it('should let you toggle the class', function() {\n\n         expect(ps.first().getAttribute('class')).not.toMatch(/bold/);\n         expect(ps.first().getAttribute('class')).not.toMatch(/red/);\n\n         element(by.model('important')).click();\n         expect(ps.first().getAttribute('class')).toMatch(/bold/);\n\n         element(by.model('error')).click();\n         expect(ps.first().getAttribute('class')).toMatch(/red/);\n       });\n\n       it('should let you toggle string example', function() {\n         expect(ps.get(1).getAttribute('class')).toBe('');\n         element(by.model('style')).clear();\n         element(by.model('style')).sendKeys('red');\n         expect(ps.get(1).getAttribute('class')).toBe('red');\n       });\n\n       it('array example should have 3 classes', function() {\n         expect(ps.last().getAttribute('class')).toBe('');\n         element(by.model('style1')).sendKeys('bold');\n         element(by.model('style2')).sendKeys('strike');\n         element(by.model('style3')).sendKeys('red');\n         expect(ps.last().getAttribute('class')).toBe('bold strike red');\n       });\n     </file>\n   </example>\n\n   ## Animations\n\n   The example below demonstrates how to perform animations using ngClass.\n\n   <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n     <file name=\"index.html\">\n      <input id=\"setbtn\" type=\"button\" value=\"set\" ng-click=\"myVar='my-class'\">\n      <input id=\"clearbtn\" type=\"button\" value=\"clear\" ng-click=\"myVar=''\">\n      <br>\n      <span class=\"base-class\" ng-class=\"myVar\">Sample Text</span>\n     </file>\n     <file name=\"style.css\">\n       .base-class {\n         -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n         transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n       }\n\n       .base-class.my-class {\n         color: red;\n         font-size:3em;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class', function() {\n         expect(element(by.css('.base-class')).getAttribute('class')).not.\n           toMatch(/my-class/);\n\n         element(by.id('setbtn')).click();\n\n         expect(element(by.css('.base-class')).getAttribute('class')).\n           toMatch(/my-class/);\n\n         element(by.id('clearbtn')).click();\n\n         expect(element(by.css('.base-class')).getAttribute('class')).not.\n           toMatch(/my-class/);\n       });\n     </file>\n   </example>\n\n\n   ## ngClass and pre-existing CSS3 Transitions/Animations\n   The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.\n   Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder\n   any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure\n   to view the step by step details of {@link ng.$animate#addClass $animate.addClass} and\n   {@link ng.$animate#removeClass $animate.removeClass}.\n */\nvar ngClassDirective = classDirective('', true);\n\n/**\n * @ngdoc directive\n * @name ngClassOdd\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result\n *   of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n          <li ng-repeat=\"name in names\">\n           <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n             {{name}}\n           </span>\n          </li>\n        </ol>\n     </file>\n     <file name=\"style.css\">\n       .odd {\n         color: red;\n       }\n       .even {\n         color: blue;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class-odd and ng-class-even', function() {\n         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n           toMatch(/odd/);\n         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n           toMatch(/even/);\n       });\n     </file>\n   </example>\n */\nvar ngClassOddDirective = classDirective('Odd', 0);\n\n/**\n * @ngdoc directive\n * @name ngClassEven\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The\n *   result of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n          <li ng-repeat=\"name in names\">\n           <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n             {{name}} &nbsp; &nbsp; &nbsp;\n           </span>\n          </li>\n        </ol>\n     </file>\n     <file name=\"style.css\">\n       .odd {\n         color: red;\n       }\n       .even {\n         color: blue;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class-odd and ng-class-even', function() {\n         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n           toMatch(/odd/);\n         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n           toMatch(/even/);\n       });\n     </file>\n   </example>\n */\nvar ngClassEvenDirective = classDirective('Even', 1);\n\n/**\n * @ngdoc directive\n * @name ngCloak\n * @restrict AC\n *\n * @description\n * The `ngCloak` directive is used to prevent the Angular html template from being briefly\n * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this\n * directive to avoid the undesirable flicker effect caused by the html template display.\n *\n * The directive can be applied to the `<body>` element, but the preferred usage is to apply\n * multiple `ngCloak` directives to small portions of the page to permit progressive rendering\n * of the browser view.\n *\n * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and\n * `angular.min.js`.\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```css\n * [ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n *   display: none !important;\n * }\n * ```\n *\n * When this css rule is loaded by the browser, all html elements (including their children) that\n * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive\n * during the compilation of the template it deletes the `ngCloak` element attribute, making\n * the compiled element visible.\n *\n * For the best result, the `angular.js` script must be loaded in the head section of the html\n * document; alternatively, the css rule above must be included in the external stylesheet of the\n * application.\n *\n * Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they\n * cannot match the `[ng\\:cloak]` selector. To work around this limitation, you must add the css\n * class `ng-cloak` in addition to the `ngCloak` directive as shown in the example below.\n *\n * @element ANY\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <div id=\"template1\" ng-cloak>{{ 'hello' }}</div>\n        <div id=\"template2\" ng-cloak class=\"ng-cloak\">{{ 'hello IE7' }}</div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should remove the template directive and css class', function() {\n         expect($('#template1').getAttribute('ng-cloak')).\n           toBeNull();\n         expect($('#template2').getAttribute('ng-cloak')).\n           toBeNull();\n       });\n     </file>\n   </example>\n *\n */\nvar ngCloakDirective = ngDirective({\n  compile: function(element, attr) {\n    attr.$set('ngCloak', undefined);\n    element.removeClass('ng-cloak');\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngController\n *\n * @description\n * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular\n * supports the principles behind the Model-View-Controller design pattern.\n *\n * MVC components in angular:\n *\n * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties\n *   are accessed through bindings.\n * * View — The template (HTML with data bindings) that is rendered into the View.\n * * Controller — The `ngController` directive specifies a Controller class; the class contains business\n *   logic behind the application to decorate the scope with functions and values\n *\n * Note that you can also attach controllers to the DOM by declaring it in a route definition\n * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller\n * again using `ng-controller` in the template itself.  This will cause the controller to be attached\n * and executed twice.\n *\n * @element ANY\n * @scope\n * @priority 500\n * @param {expression} ngController Name of a constructor function registered with the current\n * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}\n * that on the current scope evaluates to a constructor function.\n *\n * The controller instance can be published into a scope property by specifying\n * `ng-controller=\"as propertyName\"`.\n *\n * If the current `$controllerProvider` is configured to use globals (via\n * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may\n * also be the name of a globally accessible constructor function (not recommended).\n *\n * @example\n * Here is a simple form for editing user contact information. Adding, removing, clearing, and\n * greeting are methods declared on the controller (see source tab). These methods can\n * easily be called from the angular markup. Any changes to the data are automatically reflected\n * in the View without the need for a manual update.\n *\n * Two different declaration styles are included below:\n *\n * * one binds methods and properties directly onto the controller using `this`:\n * `ng-controller=\"SettingsController1 as settings\"`\n * * one injects `$scope` into the controller:\n * `ng-controller=\"SettingsController2\"`\n *\n * The second option is more common in the Angular community, and is generally used in boilerplates\n * and in this guide. However, there are advantages to binding properties directly to the controller\n * and avoiding scope.\n *\n * * Using `controller as` makes it obvious which controller you are accessing in the template when\n * multiple controllers apply to an element.\n * * If you are writing your controllers as classes you have easier access to the properties and\n * methods, which will appear on the scope, from inside the controller code.\n * * Since there is always a `.` in the bindings, you don't have to worry about prototypal\n * inheritance masking primitives.\n *\n * This example demonstrates the `controller as` syntax.\n *\n * <example name=\"ngControllerAs\" module=\"controllerAsExample\">\n *   <file name=\"index.html\">\n *    <div id=\"ctrl-as-exmpl\" ng-controller=\"SettingsController1 as settings\">\n *      Name: <input type=\"text\" ng-model=\"settings.name\"/>\n *      [ <a href=\"\" ng-click=\"settings.greet()\">greet</a> ]<br/>\n *      Contact:\n *      <ul>\n *        <li ng-repeat=\"contact in settings.contacts\">\n *          <select ng-model=\"contact.type\">\n *             <option>phone</option>\n *             <option>email</option>\n *          </select>\n *          <input type=\"text\" ng-model=\"contact.value\"/>\n *          [ <a href=\"\" ng-click=\"settings.clearContact(contact)\">clear</a>\n *          | <a href=\"\" ng-click=\"settings.removeContact(contact)\">X</a> ]\n *        </li>\n *        <li>[ <a href=\"\" ng-click=\"settings.addContact()\">add</a> ]</li>\n *     </ul>\n *    </div>\n *   </file>\n *   <file name=\"app.js\">\n *    angular.module('controllerAsExample', [])\n *      .controller('SettingsController1', SettingsController1);\n *\n *    function SettingsController1() {\n *      this.name = \"John Smith\";\n *      this.contacts = [\n *        {type: 'phone', value: '408 555 1212'},\n *        {type: 'email', value: 'john.smith@example.org'} ];\n *    }\n *\n *    SettingsController1.prototype.greet = function() {\n *      alert(this.name);\n *    };\n *\n *    SettingsController1.prototype.addContact = function() {\n *      this.contacts.push({type: 'email', value: 'yourname@example.org'});\n *    };\n *\n *    SettingsController1.prototype.removeContact = function(contactToRemove) {\n *     var index = this.contacts.indexOf(contactToRemove);\n *      this.contacts.splice(index, 1);\n *    };\n *\n *    SettingsController1.prototype.clearContact = function(contact) {\n *      contact.type = 'phone';\n *      contact.value = '';\n *    };\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     it('should check controller as', function() {\n *       var container = element(by.id('ctrl-as-exmpl'));\n *         expect(container.element(by.model('settings.name'))\n *           .getAttribute('value')).toBe('John Smith');\n *\n *       var firstRepeat =\n *           container.element(by.repeater('contact in settings.contacts').row(0));\n *       var secondRepeat =\n *           container.element(by.repeater('contact in settings.contacts').row(1));\n *\n *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('408 555 1212');\n *\n *       expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('john.smith@example.org');\n *\n *       firstRepeat.element(by.linkText('clear')).click();\n *\n *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('');\n *\n *       container.element(by.linkText('add')).click();\n *\n *       expect(container.element(by.repeater('contact in settings.contacts').row(2))\n *           .element(by.model('contact.value'))\n *           .getAttribute('value'))\n *           .toBe('yourname@example.org');\n *     });\n *   </file>\n * </example>\n *\n * This example demonstrates the \"attach to `$scope`\" style of controller.\n *\n * <example name=\"ngController\" module=\"controllerExample\">\n *  <file name=\"index.html\">\n *   <div id=\"ctrl-exmpl\" ng-controller=\"SettingsController2\">\n *     Name: <input type=\"text\" ng-model=\"name\"/>\n *     [ <a href=\"\" ng-click=\"greet()\">greet</a> ]<br/>\n *     Contact:\n *     <ul>\n *       <li ng-repeat=\"contact in contacts\">\n *         <select ng-model=\"contact.type\">\n *            <option>phone</option>\n *            <option>email</option>\n *         </select>\n *         <input type=\"text\" ng-model=\"contact.value\"/>\n *         [ <a href=\"\" ng-click=\"clearContact(contact)\">clear</a>\n *         | <a href=\"\" ng-click=\"removeContact(contact)\">X</a> ]\n *       </li>\n *       <li>[ <a href=\"\" ng-click=\"addContact()\">add</a> ]</li>\n *    </ul>\n *   </div>\n *  </file>\n *  <file name=\"app.js\">\n *   angular.module('controllerExample', [])\n *     .controller('SettingsController2', ['$scope', SettingsController2]);\n *\n *   function SettingsController2($scope) {\n *     $scope.name = \"John Smith\";\n *     $scope.contacts = [\n *       {type:'phone', value:'408 555 1212'},\n *       {type:'email', value:'john.smith@example.org'} ];\n *\n *     $scope.greet = function() {\n *       alert($scope.name);\n *     };\n *\n *     $scope.addContact = function() {\n *       $scope.contacts.push({type:'email', value:'yourname@example.org'});\n *     };\n *\n *     $scope.removeContact = function(contactToRemove) {\n *       var index = $scope.contacts.indexOf(contactToRemove);\n *       $scope.contacts.splice(index, 1);\n *     };\n *\n *     $scope.clearContact = function(contact) {\n *       contact.type = 'phone';\n *       contact.value = '';\n *     };\n *   }\n *  </file>\n *  <file name=\"protractor.js\" type=\"protractor\">\n *    it('should check controller', function() {\n *      var container = element(by.id('ctrl-exmpl'));\n *\n *      expect(container.element(by.model('name'))\n *          .getAttribute('value')).toBe('John Smith');\n *\n *      var firstRepeat =\n *          container.element(by.repeater('contact in contacts').row(0));\n *      var secondRepeat =\n *          container.element(by.repeater('contact in contacts').row(1));\n *\n *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('408 555 1212');\n *      expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('john.smith@example.org');\n *\n *      firstRepeat.element(by.linkText('clear')).click();\n *\n *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('');\n *\n *      container.element(by.linkText('add')).click();\n *\n *      expect(container.element(by.repeater('contact in contacts').row(2))\n *          .element(by.model('contact.value'))\n *          .getAttribute('value'))\n *          .toBe('yourname@example.org');\n *    });\n *  </file>\n *</example>\n\n */\nvar ngControllerDirective = [function() {\n  return {\n    restrict: 'A',\n    scope: true,\n    controller: '@',\n    priority: 500\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngCsp\n *\n * @element html\n * @description\n * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support.\n *\n * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.\n *\n * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things).\n * For Angular to be CSP compatible there are only two things that we need to do differently:\n *\n * - don't use `Function` constructor to generate optimized value getters\n * - don't inject custom stylesheet into the document\n *\n * AngularJS uses `Function(string)` generated functions as a speed optimization. Applying the `ngCsp`\n * directive will cause Angular to use CSP compatibility mode. When this mode is on AngularJS will\n * evaluate all expressions up to 30% slower than in non-CSP mode, but no security violations will\n * be raised.\n *\n * CSP forbids JavaScript to inline stylesheet rules. In non CSP mode Angular automatically\n * includes some CSS rules (e.g. {@link ng.directive:ngCloak ngCloak}).\n * To make those directives work in CSP mode, include the `angular-csp.css` manually.\n *\n * Angular tries to autodetect if CSP is active and automatically turn on the CSP-safe mode. This\n * autodetection however triggers a CSP error to be logged in the console:\n *\n * ```\n * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of\n * script in the following Content Security Policy directive: \"default-src 'self'\". Note that\n * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.\n * ```\n *\n * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`\n * directive on the root element of the application or on the `angular.js` script tag, whichever\n * appears first in the html document.\n *\n * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*\n *\n * @example\n * This example shows how to apply the `ngCsp` directive to the `html` tag.\n   ```html\n     <!doctype html>\n     <html ng-app ng-csp>\n     ...\n     ...\n     </html>\n   ```\n  * @example\n      // Note: the suffix `.csp` in the example name triggers\n      // csp mode in our http server!\n      <example name=\"example.csp\" module=\"cspExample\" ng-csp=\"true\">\n        <file name=\"index.html\">\n          <div ng-controller=\"MainController as ctrl\">\n            <div>\n              <button ng-click=\"ctrl.inc()\" id=\"inc\">Increment</button>\n              <span id=\"counter\">\n                {{ctrl.counter}}\n              </span>\n            </div>\n\n            <div>\n              <button ng-click=\"ctrl.evil()\" id=\"evil\">Evil</button>\n              <span id=\"evilError\">\n                {{ctrl.evilError}}\n              </span>\n            </div>\n          </div>\n        </file>\n        <file name=\"script.js\">\n           angular.module('cspExample', [])\n             .controller('MainController', function() {\n                this.counter = 0;\n                this.inc = function() {\n                  this.counter++;\n                };\n                this.evil = function() {\n                  // jshint evil:true\n                  try {\n                    eval('1+2');\n                  } catch (e) {\n                    this.evilError = e.message;\n                  }\n                };\n              });\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var util, webdriver;\n\n          var incBtn = element(by.id('inc'));\n          var counter = element(by.id('counter'));\n          var evilBtn = element(by.id('evil'));\n          var evilError = element(by.id('evilError'));\n\n          function getAndClearSevereErrors() {\n            return browser.manage().logs().get('browser').then(function(browserLog) {\n              return browserLog.filter(function(logEntry) {\n                return logEntry.level.value > webdriver.logging.Level.WARNING.value;\n              });\n            });\n          }\n\n          function clearErrors() {\n            getAndClearSevereErrors();\n          }\n\n          function expectNoErrors() {\n            getAndClearSevereErrors().then(function(filteredLog) {\n              expect(filteredLog.length).toEqual(0);\n              if (filteredLog.length) {\n                console.log('browser console errors: ' + util.inspect(filteredLog));\n              }\n            });\n          }\n\n          function expectError(regex) {\n            getAndClearSevereErrors().then(function(filteredLog) {\n              var found = false;\n              filteredLog.forEach(function(log) {\n                if (log.message.match(regex)) {\n                  found = true;\n                }\n              });\n              if (!found) {\n                throw new Error('expected an error that matches ' + regex);\n              }\n            });\n          }\n\n          beforeEach(function() {\n            util = require('util');\n            webdriver = require('protractor/node_modules/selenium-webdriver');\n          });\n\n          // For now, we only test on Chrome,\n          // as Safari does not load the page with Protractor's injected scripts,\n          // and Firefox webdriver always disables content security policy (#6358)\n          if (browser.params.browser !== 'chrome') {\n            return;\n          }\n\n          it('should not report errors when the page is loaded', function() {\n            // clear errors so we are not dependent on previous tests\n            clearErrors();\n            // Need to reload the page as the page is already loaded when\n            // we come here\n            browser.driver.getCurrentUrl().then(function(url) {\n              browser.get(url);\n            });\n            expectNoErrors();\n          });\n\n          it('should evaluate expressions', function() {\n            expect(counter.getText()).toEqual('0');\n            incBtn.click();\n            expect(counter.getText()).toEqual('1');\n            expectNoErrors();\n          });\n\n          it('should throw and report an error when using \"eval\"', function() {\n            evilBtn.click();\n            expect(evilError.getText()).toMatch(/Content Security Policy/);\n            expectError(/Content Security Policy/);\n          });\n        </file>\n      </example>\n  */\n\n// ngCsp is not implemented as a proper directive any more, because we need it be processed while we\n// bootstrap the system (before $parse is instantiated), for this reason we just have\n// the csp.isActive() fn that looks for ng-csp attribute anywhere in the current doc\n\n/**\n * @ngdoc directive\n * @name ngClick\n *\n * @description\n * The ngClick directive allows you to specify custom behavior when\n * an element is clicked.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon\n * click. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n        Increment\n      </button>\n      <span>\n        count: {{count}}\n      </span>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-click', function() {\n         expect(element(by.binding('count')).getText()).toMatch('0');\n         element(by.css('button')).click();\n         expect(element(by.binding('count')).getText()).toMatch('1');\n       });\n     </file>\n   </example>\n */\n/*\n * A collection of directives that allows creation of custom event handlers that are defined as\n * angular expressions and are compiled and executed within the current scope.\n */\nvar ngEventDirectives = {};\n\n// For events that might fire synchronously during DOM manipulation\n// we need to execute their event handlers asynchronously using $evalAsync,\n// so that they are not executed in an inconsistent state.\nvar forceAsyncEvents = {\n  'blur': true,\n  'focus': true\n};\nforEach(\n  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),\n  function(eventName) {\n    var directiveName = directiveNormalize('ng-' + eventName);\n    ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {\n      return {\n        restrict: 'A',\n        compile: function($element, attr) {\n          // We expose the powerful $event object on the scope that provides access to the Window,\n          // etc. that isn't protected by the fast paths in $parse.  We explicitly request better\n          // checks at the cost of speed since event handler expressions are not executed as\n          // frequently as regular change detection.\n          var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);\n          return function ngEventHandler(scope, element) {\n            element.on(eventName, function(event) {\n              var callback = function() {\n                fn(scope, {$event:event});\n              };\n              if (forceAsyncEvents[eventName] && $rootScope.$$phase) {\n                scope.$evalAsync(callback);\n              } else {\n                scope.$apply(callback);\n              }\n            });\n          };\n        }\n      };\n    }];\n  }\n);\n\n/**\n * @ngdoc directive\n * @name ngDblclick\n *\n * @description\n * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon\n * a dblclick. (The Event object is available as `$event`)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-dblclick=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on double click)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousedown\n *\n * @description\n * The ngMousedown directive allows you to specify custom behavior on mousedown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon\n * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mousedown=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on mouse down)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseup\n *\n * @description\n * Specify custom behavior on mouseup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon\n * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseup=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on mouse up)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngMouseover\n *\n * @description\n * Specify custom behavior on mouseover event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon\n * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseover=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse is over)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseenter\n *\n * @description\n * Specify custom behavior on mouseenter event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon\n * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseenter=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse enters)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseleave\n *\n * @description\n * Specify custom behavior on mouseleave event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon\n * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseleave=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse leaves)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousemove\n *\n * @description\n * Specify custom behavior on mousemove event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon\n * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mousemove=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse moves)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeydown\n *\n * @description\n * Specify custom behavior on keydown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon\n * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-keydown=\"count = count + 1\" ng-init=\"count=0\">\n      key down count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeyup\n *\n * @description\n * Specify custom behavior on keyup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon\n * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <p>Typing in the input box below updates the key count</p>\n       <input ng-keyup=\"count = count + 1\" ng-init=\"count=0\"> key up count: {{count}}\n\n       <p>Typing in the input box below updates the keycode</p>\n       <input ng-keyup=\"event=$event\">\n       <p>event keyCode: {{ event.keyCode }}</p>\n       <p>event altKey: {{ event.altKey }}</p>\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeypress\n *\n * @description\n * Specify custom behavior on keypress event.\n *\n * @element ANY\n * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon\n * keypress. ({@link guide/expression#-event- Event object is available as `$event`}\n * and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-keypress=\"count = count + 1\" ng-init=\"count=0\">\n      key press count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSubmit\n *\n * @description\n * Enables binding angular expressions to onsubmit events.\n *\n * Additionally it prevents the default action (which for form means sending the request to the\n * server and reloading the current page), but only if the form does not contain `action`,\n * `data-action`, or `x-action` attributes.\n *\n * <div class=\"alert alert-warning\">\n * **Warning:** Be careful not to cause \"double-submission\" by using both the `ngClick` and\n * `ngSubmit` handlers together. See the\n * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}\n * for a detailed discussion of when `ngSubmit` may be triggered.\n * </div>\n *\n * @element form\n * @priority 0\n * @param {expression} ngSubmit {@link guide/expression Expression} to eval.\n * ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example module=\"submitExample\">\n     <file name=\"index.html\">\n      <script>\n        angular.module('submitExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.list = [];\n            $scope.text = 'hello';\n            $scope.submit = function() {\n              if ($scope.text) {\n                $scope.list.push(this.text);\n                $scope.text = '';\n              }\n            };\n          }]);\n      </script>\n      <form ng-submit=\"submit()\" ng-controller=\"ExampleController\">\n        Enter text and hit enter:\n        <input type=\"text\" ng-model=\"text\" name=\"text\" />\n        <input type=\"submit\" id=\"submit\" value=\"Submit\" />\n        <pre>list={{list}}</pre>\n      </form>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-submit', function() {\n         expect(element(by.binding('list')).getText()).toBe('list=[]');\n         element(by.css('#submit')).click();\n         expect(element(by.binding('list')).getText()).toContain('hello');\n         expect(element(by.model('text')).getAttribute('value')).toBe('');\n       });\n       it('should ignore empty strings', function() {\n         expect(element(by.binding('list')).getText()).toBe('list=[]');\n         element(by.css('#submit')).click();\n         element(by.css('#submit')).click();\n         expect(element(by.binding('list')).getText()).toContain('hello');\n        });\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngFocus\n *\n * @description\n * Specify custom behavior on focus event.\n *\n * Note: As the `focus` event is executed synchronously when calling `input.focus()`\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon\n * focus. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngBlur\n *\n * @description\n * Specify custom behavior on blur event.\n *\n * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when\n * an element has lost focus.\n *\n * Note: As the `blur` event is executed synchronously also during DOM manipulations\n * (e.g. removing a focussed input),\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon\n * blur. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngCopy\n *\n * @description\n * Specify custom behavior on copy event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon\n * copy. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-copy=\"copied=true\" ng-init=\"copied=false; value='copy me'\" ng-model=\"value\">\n      copied: {{copied}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngCut\n *\n * @description\n * Specify custom behavior on cut event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon\n * cut. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-cut=\"cut=true\" ng-init=\"cut=false; value='cut me'\" ng-model=\"value\">\n      cut: {{cut}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngPaste\n *\n * @description\n * Specify custom behavior on paste event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon\n * paste. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-paste=\"paste=true\" ng-init=\"paste=false\" placeholder='paste here'>\n      pasted: {{paste}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngIf\n * @restrict A\n *\n * @description\n * The `ngIf` directive removes or recreates a portion of the DOM tree based on an\n * {expression}. If the expression assigned to `ngIf` evaluates to a false\n * value then the element is removed from the DOM, otherwise a clone of the\n * element is reinserted into the DOM.\n *\n * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the\n * element in the DOM rather than changing its visibility via the `display` css property.  A common\n * case when this difference is significant is when using css selectors that rely on an element's\n * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.\n *\n * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope\n * is created when the element is restored.  The scope created within `ngIf` inherits from\n * its parent scope using\n * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).\n * An important implication of this is if `ngModel` is used within `ngIf` to bind to\n * a javascript primitive defined in the parent scope. In this case any modifications made to the\n * variable within the child scope will override (hide) the value in the parent scope.\n *\n * Also, `ngIf` recreates elements using their compiled state. An example of this behavior\n * is if an element's class attribute is directly modified after it's compiled, using something like\n * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element\n * the added class will be lost because the original compiled state is used to regenerate the element.\n *\n * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`\n * and `leave` effects.\n *\n * @animations\n * enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container\n * leave - happens just before the `ngIf` contents are removed from the DOM\n *\n * @element ANY\n * @scope\n * @priority 600\n * @param {expression} ngIf If the {@link guide/expression expression} is falsy then\n *     the element is removed from the DOM tree. If it is truthy a copy of the compiled\n *     element is added to the DOM tree.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\" ng-init=\"checked=true\" /><br/>\n      Show when checked:\n      <span ng-if=\"checked\" class=\"animate-if\">\n        This is removed when the checkbox is unchecked.\n      </span>\n    </file>\n    <file name=\"animations.css\">\n      .animate-if {\n        background:white;\n        border:1px solid black;\n        padding:10px;\n      }\n\n      .animate-if.ng-enter, .animate-if.ng-leave {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n      }\n\n      .animate-if.ng-enter,\n      .animate-if.ng-leave.ng-leave-active {\n        opacity:0;\n      }\n\n      .animate-if.ng-leave,\n      .animate-if.ng-enter.ng-enter-active {\n        opacity:1;\n      }\n    </file>\n  </example>\n */\nvar ngIfDirective = ['$animate', function($animate) {\n  return {\n    multiElement: true,\n    transclude: 'element',\n    priority: 600,\n    terminal: true,\n    restrict: 'A',\n    $$tlb: true,\n    link: function($scope, $element, $attr, ctrl, $transclude) {\n        var block, childScope, previousElements;\n        $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {\n\n          if (value) {\n            if (!childScope) {\n              $transclude(function(clone, newScope) {\n                childScope = newScope;\n                clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');\n                // Note: We only need the first/last node of the cloned nodes.\n                // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n                // by a directive with templateUrl when its template arrives.\n                block = {\n                  clone: clone\n                };\n                $animate.enter(clone, $element.parent(), $element);\n              });\n            }\n          } else {\n            if (previousElements) {\n              previousElements.remove();\n              previousElements = null;\n            }\n            if (childScope) {\n              childScope.$destroy();\n              childScope = null;\n            }\n            if (block) {\n              previousElements = getBlockNodes(block.clone);\n              $animate.leave(previousElements).then(function() {\n                previousElements = null;\n              });\n              block = null;\n            }\n          }\n        });\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngInclude\n * @restrict ECA\n *\n * @description\n * Fetches, compiles and includes an external HTML fragment.\n *\n * By default, the template URL is restricted to the same domain and protocol as the\n * application document. This is done by calling {@link $sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols\n * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or\n * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link\n * ng.$sce Strict Contextual Escaping}.\n *\n * In addition, the browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy may further restrict whether the template is successfully loaded.\n * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`\n * access on some browsers.\n *\n * @animations\n * enter - animation is used to bring new content into the browser.\n * leave - animation is used to animate existing content away.\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n *\n * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,\n *                 make sure you wrap it in **single** quotes, e.g. `src=\"'myPartialTemplate.html'\"`.\n * @param {string=} onload Expression to evaluate when a new partial is loaded.\n *\n * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll\n *                  $anchorScroll} to scroll the viewport after the content is loaded.\n *\n *                  - If the attribute is not set, disable scrolling.\n *                  - If the attribute is set without value, enable scrolling.\n *                  - Otherwise enable scrolling only if the expression evaluates to truthy value.\n *\n * @example\n  <example module=\"includeExample\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n     <div ng-controller=\"ExampleController\">\n       <select ng-model=\"template\" ng-options=\"t.name for t in templates\">\n        <option value=\"\">(blank)</option>\n       </select>\n       url of the template: <code>{{template.url}}</code>\n       <hr/>\n       <div class=\"slide-animate-container\">\n         <div class=\"slide-animate\" ng-include=\"template.url\"></div>\n       </div>\n     </div>\n    </file>\n    <file name=\"script.js\">\n      angular.module('includeExample', ['ngAnimate'])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.templates =\n            [ { name: 'template1.html', url: 'template1.html'},\n              { name: 'template2.html', url: 'template2.html'} ];\n          $scope.template = $scope.templates[0];\n        }]);\n     </file>\n    <file name=\"template1.html\">\n      Content of template1.html\n    </file>\n    <file name=\"template2.html\">\n      Content of template2.html\n    </file>\n    <file name=\"animations.css\">\n      .slide-animate-container {\n        position:relative;\n        background:white;\n        border:1px solid black;\n        height:40px;\n        overflow:hidden;\n      }\n\n      .slide-animate {\n        padding:10px;\n      }\n\n      .slide-animate.ng-enter, .slide-animate.ng-leave {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n        position:absolute;\n        top:0;\n        left:0;\n        right:0;\n        bottom:0;\n        display:block;\n        padding:10px;\n      }\n\n      .slide-animate.ng-enter {\n        top:-50px;\n      }\n      .slide-animate.ng-enter.ng-enter-active {\n        top:0;\n      }\n\n      .slide-animate.ng-leave {\n        top:0;\n      }\n      .slide-animate.ng-leave.ng-leave-active {\n        top:50px;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var templateSelect = element(by.model('template'));\n      var includeElem = element(by.css('[ng-include]'));\n\n      it('should load template1.html', function() {\n        expect(includeElem.getText()).toMatch(/Content of template1.html/);\n      });\n\n      it('should load template2.html', function() {\n        if (browser.params.browser == 'firefox') {\n          // Firefox can't handle using selects\n          // See https://github.com/angular/protractor/issues/480\n          return;\n        }\n        templateSelect.click();\n        templateSelect.all(by.css('option')).get(2).click();\n        expect(includeElem.getText()).toMatch(/Content of template2.html/);\n      });\n\n      it('should change to blank', function() {\n        if (browser.params.browser == 'firefox') {\n          // Firefox can't handle using selects\n          return;\n        }\n        templateSelect.click();\n        templateSelect.all(by.css('option')).get(0).click();\n        expect(includeElem.isPresent()).toBe(false);\n      });\n    </file>\n  </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentRequested\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted every time the ngInclude content is requested.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentLoaded\n * @eventType emit on the current ngInclude scope\n * @description\n * Emitted every time the ngInclude content is reloaded.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentError\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\nvar ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce',\n                  function($templateRequest,   $anchorScroll,   $animate,   $sce) {\n  return {\n    restrict: 'ECA',\n    priority: 400,\n    terminal: true,\n    transclude: 'element',\n    controller: angular.noop,\n    compile: function(element, attr) {\n      var srcExp = attr.ngInclude || attr.src,\n          onloadExp = attr.onload || '',\n          autoScrollExp = attr.autoscroll;\n\n      return function(scope, $element, $attr, ctrl, $transclude) {\n        var changeCounter = 0,\n            currentScope,\n            previousElement,\n            currentElement;\n\n        var cleanupLastIncludeContent = function() {\n          if (previousElement) {\n            previousElement.remove();\n            previousElement = null;\n          }\n          if (currentScope) {\n            currentScope.$destroy();\n            currentScope = null;\n          }\n          if (currentElement) {\n            $animate.leave(currentElement).then(function() {\n              previousElement = null;\n            });\n            previousElement = currentElement;\n            currentElement = null;\n          }\n        };\n\n        scope.$watch($sce.parseAsResourceUrl(srcExp), function ngIncludeWatchAction(src) {\n          var afterAnimation = function() {\n            if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {\n              $anchorScroll();\n            }\n          };\n          var thisChangeId = ++changeCounter;\n\n          if (src) {\n            //set the 2nd param to true to ignore the template request error so that the inner\n            //contents and scope can be cleaned up.\n            $templateRequest(src, true).then(function(response) {\n              if (thisChangeId !== changeCounter) return;\n              var newScope = scope.$new();\n              ctrl.template = response;\n\n              // Note: This will also link all children of ng-include that were contained in the original\n              // html. If that content contains controllers, ... they could pollute/change the scope.\n              // However, using ng-include on an element with additional content does not make sense...\n              // Note: We can't remove them in the cloneAttchFn of $transclude as that\n              // function is called before linking the content, which would apply child\n              // directives to non existing elements.\n              var clone = $transclude(newScope, function(clone) {\n                cleanupLastIncludeContent();\n                $animate.enter(clone, null, $element).then(afterAnimation);\n              });\n\n              currentScope = newScope;\n              currentElement = clone;\n\n              currentScope.$emit('$includeContentLoaded', src);\n              scope.$eval(onloadExp);\n            }, function() {\n              if (thisChangeId === changeCounter) {\n                cleanupLastIncludeContent();\n                scope.$emit('$includeContentError', src);\n              }\n            });\n            scope.$emit('$includeContentRequested', src);\n          } else {\n            cleanupLastIncludeContent();\n            ctrl.template = null;\n          }\n        });\n      };\n    }\n  };\n}];\n\n// This directive is called during the $transclude call of the first `ngInclude` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngInclude\n// is called.\nvar ngIncludeFillContentDirective = ['$compile',\n  function($compile) {\n    return {\n      restrict: 'ECA',\n      priority: -400,\n      require: 'ngInclude',\n      link: function(scope, $element, $attr, ctrl) {\n        if (/SVG/.test($element[0].toString())) {\n          // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not\n          // support innerHTML, so detect this here and try to generate the contents\n          // specially.\n          $element.empty();\n          $compile(jqLiteBuildFragment(ctrl.template, document).childNodes)(scope,\n              function namespaceAdaptedClone(clone) {\n            $element.append(clone);\n          }, {futureParentElement: $element});\n          return;\n        }\n\n        $element.html(ctrl.template);\n        $compile($element.contents())(scope);\n      }\n    };\n  }];\n\n/**\n * @ngdoc directive\n * @name ngInit\n * @restrict AC\n *\n * @description\n * The `ngInit` directive allows you to evaluate an expression in the\n * current scope.\n *\n * <div class=\"alert alert-error\">\n * The only appropriate use of `ngInit` is for aliasing special properties of\n * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below. Besides this case, you\n * should use {@link guide/controller controllers} rather than `ngInit`\n * to initialize values on a scope.\n * </div>\n * <div class=\"alert alert-warning\">\n * **Note**: If you have assignment in `ngInit` along with {@link ng.$filter `$filter`}, make\n * sure you have parenthesis for correct precedence:\n * <pre class=\"prettyprint\">\n * `<div ng-init=\"test1 = (data | orderBy:'name')\"></div>`\n * </pre>\n * </div>\n *\n * @priority 450\n *\n * @element ANY\n * @param {expression} ngInit {@link guide/expression Expression} to eval.\n *\n * @example\n   <example module=\"initExample\">\n     <file name=\"index.html\">\n   <script>\n     angular.module('initExample', [])\n       .controller('ExampleController', ['$scope', function($scope) {\n         $scope.list = [['a', 'b'], ['c', 'd']];\n       }]);\n   </script>\n   <div ng-controller=\"ExampleController\">\n     <div ng-repeat=\"innerList in list\" ng-init=\"outerIndex = $index\">\n       <div ng-repeat=\"value in innerList\" ng-init=\"innerIndex = $index\">\n          <span class=\"example-init\">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>\n       </div>\n     </div>\n   </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should alias index positions', function() {\n         var elements = element.all(by.css('.example-init'));\n         expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');\n         expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');\n         expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');\n         expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');\n       });\n     </file>\n   </example>\n */\nvar ngInitDirective = ngDirective({\n  priority: 450,\n  compile: function() {\n    return {\n      pre: function(scope, element, attrs) {\n        scope.$eval(attrs.ngInit);\n      }\n    };\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngList\n *\n * @description\n * Text input that converts between a delimited string and an array of strings. The default\n * delimiter is a comma followed by a space - equivalent to `ng-list=\", \"`. You can specify a custom\n * delimiter as the value of the `ngList` attribute - for example, `ng-list=\" | \"`.\n *\n * The behaviour of the directive is affected by the use of the `ngTrim` attribute.\n * * If `ngTrim` is set to `\"false\"` then whitespace around both the separator and each\n *   list item is respected. This implies that the user of the directive is responsible for\n *   dealing with whitespace but also allows you to use whitespace as a delimiter, such as a\n *   tab or newline character.\n * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected\n *   when joining the list items back together) and whitespace around each list item is stripped\n *   before it is added to the model.\n *\n * ### Example with Validation\n *\n * <example name=\"ngList-directive\" module=\"listExample\">\n *   <file name=\"app.js\">\n *      angular.module('listExample', [])\n *        .controller('ExampleController', ['$scope', function($scope) {\n *          $scope.names = ['morpheus', 'neo', 'trinity'];\n *        }]);\n *   </file>\n *   <file name=\"index.html\">\n *    <form name=\"myForm\" ng-controller=\"ExampleController\">\n *      List: <input name=\"namesInput\" ng-model=\"names\" ng-list required>\n *      <span class=\"error\" ng-show=\"myForm.namesInput.$error.required\">\n *        Required!</span>\n *      <br>\n *      <tt>names = {{names}}</tt><br/>\n *      <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>\n *      <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>\n *      <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n *      <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n *     </form>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     var listInput = element(by.model('names'));\n *     var names = element(by.exactBinding('names'));\n *     var valid = element(by.binding('myForm.namesInput.$valid'));\n *     var error = element(by.css('span.error'));\n *\n *     it('should initialize to model', function() {\n *       expect(names.getText()).toContain('[\"morpheus\",\"neo\",\"trinity\"]');\n *       expect(valid.getText()).toContain('true');\n *       expect(error.getCssValue('display')).toBe('none');\n *     });\n *\n *     it('should be invalid if empty', function() {\n *       listInput.clear();\n *       listInput.sendKeys('');\n *\n *       expect(names.getText()).toContain('');\n *       expect(valid.getText()).toContain('false');\n *       expect(error.getCssValue('display')).not.toBe('none');\n *     });\n *   </file>\n * </example>\n *\n * ### Example - splitting on whitespace\n * <example name=\"ngList-directive-newlines\">\n *   <file name=\"index.html\">\n *    <textarea ng-model=\"list\" ng-list=\"&#10;\" ng-trim=\"false\"></textarea>\n *    <pre>{{ list | json }}</pre>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     it(\"should split the text by newlines\", function() {\n *       var listInput = element(by.model('list'));\n *       var output = element(by.binding('list | json'));\n *       listInput.sendKeys('abc\\ndef\\nghi');\n *       expect(output.getText()).toContain('[\\n  \"abc\",\\n  \"def\",\\n  \"ghi\"\\n]');\n *     });\n *   </file>\n * </example>\n *\n * @element input\n * @param {string=} ngList optional delimiter that should be used to split the value.\n */\nvar ngListDirective = function() {\n  return {\n    restrict: 'A',\n    priority: 100,\n    require: 'ngModel',\n    link: function(scope, element, attr, ctrl) {\n      // We want to control whitespace trimming so we use this convoluted approach\n      // to access the ngList attribute, which doesn't pre-trim the attribute\n      var ngList = element.attr(attr.$attr.ngList) || ', ';\n      var trimValues = attr.ngTrim !== 'false';\n      var separator = trimValues ? trim(ngList) : ngList;\n\n      var parse = function(viewValue) {\n        // If the viewValue is invalid (say required but empty) it will be `undefined`\n        if (isUndefined(viewValue)) return;\n\n        var list = [];\n\n        if (viewValue) {\n          forEach(viewValue.split(separator), function(value) {\n            if (value) list.push(trimValues ? trim(value) : value);\n          });\n        }\n\n        return list;\n      };\n\n      ctrl.$parsers.push(parse);\n      ctrl.$formatters.push(function(value) {\n        if (isArray(value)) {\n          return value.join(ngList);\n        }\n\n        return undefined;\n      });\n\n      // Override the standard $isEmpty because an empty array means the input is empty.\n      ctrl.$isEmpty = function(value) {\n        return !value || !value.length;\n      };\n    }\n  };\n};\n\n/* global VALID_CLASS: true,\n  INVALID_CLASS: true,\n  PRISTINE_CLASS: true,\n  DIRTY_CLASS: true,\n  UNTOUCHED_CLASS: true,\n  TOUCHED_CLASS: true,\n*/\n\nvar VALID_CLASS = 'ng-valid',\n    INVALID_CLASS = 'ng-invalid',\n    PRISTINE_CLASS = 'ng-pristine',\n    DIRTY_CLASS = 'ng-dirty',\n    UNTOUCHED_CLASS = 'ng-untouched',\n    TOUCHED_CLASS = 'ng-touched',\n    PENDING_CLASS = 'ng-pending';\n\n\nvar $ngModelMinErr = new minErr('ngModel');\n\n/**\n * @ngdoc type\n * @name ngModel.NgModelController\n *\n * @property {string} $viewValue Actual string value in the view.\n * @property {*} $modelValue The value in the model that the control is bound to.\n * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever\n       the control reads value from the DOM. The functions are called in array order, each passing\n       its return value through to the next. The last return value is forwarded to the\n       {@link ngModel.NgModelController#$validators `$validators`} collection.\n\nParsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n`$viewValue`}.\n\nReturning `undefined` from a parser means a parse error occurred. In that case,\nno {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\nwill be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\nis set to `true`. The parse error is stored in `ngModel.$error.parse`.\n\n *\n * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever\n       the model value changes. The functions are called in reverse array order, each passing the value through to the\n       next. The last return value is used as the actual DOM value.\n       Used to format / convert values for display in the control.\n * ```js\n * function formatter(value) {\n *   if (value) {\n *     return value.toUpperCase();\n *   }\n * }\n * ngModel.$formatters.push(formatter);\n * ```\n *\n * @property {Object.<string, function>} $validators A collection of validators that are applied\n *      whenever the model value changes. The key value within the object refers to the name of the\n *      validator while the function refers to the validation operation. The validation operation is\n *      provided with the model value as an argument and must return a true or false value depending\n *      on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n *   var value = modelValue || viewValue;\n *   return /[0-9]+/.test(value) &&\n *          /[a-z]+/.test(value) &&\n *          /[A-Z]+/.test(value) &&\n *          /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to\n *      perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n *      is expected to return a promise when it is run during the model validation process. Once the promise\n *      is delivered then the validation status will be set to true when fulfilled and false when rejected.\n *      When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n *      value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n *      is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n *      will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n *   var value = modelValue || viewValue;\n *\n *   // Lookup user by username\n *   return $http.get('/api/users/' + value).\n *      then(function resolved() {\n *        //username exists, this means validation fails\n *        return $q.reject('exists');\n *      }, function rejected() {\n *        //username does not exist, therefore this validation passes\n *        return true;\n *      });\n * };\n * ```\n *\n * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the\n *     view value has changed. It is called with no arguments, and its return value is ignored.\n *     This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * Angular provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * Note that `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.  This will not work on older browsers.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. `<span onclick=\"...\">`).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * <example name=\"NgModelController\" module=\"customControl\" deps=\"angular-sanitize.js\">\n    <file name=\"style.css\">\n      [contenteditable] {\n        border: 1px solid black;\n        background-color: white;\n        min-height: 20px;\n      }\n\n      .ng-invalid {\n        border: 1px solid red;\n      }\n\n    </file>\n    <file name=\"script.js\">\n      angular.module('customControl', ['ngSanitize']).\n        directive('contenteditable', ['$sce', function($sce) {\n          return {\n            restrict: 'A', // only activate on element attribute\n            require: '?ngModel', // get a hold of NgModelController\n            link: function(scope, element, attrs, ngModel) {\n              if (!ngModel) return; // do nothing if no ng-model\n\n              // Specify how UI should be updated\n              ngModel.$render = function() {\n                element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n              };\n\n              // Listen for change events to enable binding\n              element.on('blur keyup change', function() {\n                scope.$evalAsync(read);\n              });\n              read(); // initialize\n\n              // Write data to the model\n              function read() {\n                var html = element.html();\n                // When we clear the content editable the browser leaves a <br> behind\n                // If strip-br attribute is provided then we strip this out\n                if ( attrs.stripBr && html == '<br>' ) {\n                  html = '';\n                }\n                ngModel.$setViewValue(html);\n              }\n            }\n          };\n        }]);\n    </file>\n    <file name=\"index.html\">\n      <form name=\"myForm\">\n       <div contenteditable\n            name=\"myWidget\" ng-model=\"userContent\"\n            strip-br=\"true\"\n            required>Change me!</div>\n        <span ng-show=\"myForm.myWidget.$error.required\">Required!</span>\n       <hr>\n       <textarea ng-model=\"userContent\"></textarea>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n    it('should data-bind and become invalid', function() {\n      if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {\n        // SafariDriver can't handle contenteditable\n        // and Firefox driver can't clear contenteditables very well\n        return;\n      }\n      var contentEditable = element(by.css('[contenteditable]'));\n      var content = 'Change me!';\n\n      expect(contentEditable.getText()).toEqual(content);\n\n      contentEditable.clear();\n      contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n      expect(contentEditable.getText()).toEqual('');\n      expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n    });\n    </file>\n * </example>\n *\n *\n */\nvar NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',\n    function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {\n  this.$viewValue = Number.NaN;\n  this.$modelValue = Number.NaN;\n  this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n  this.$validators = {};\n  this.$asyncValidators = {};\n  this.$parsers = [];\n  this.$formatters = [];\n  this.$viewChangeListeners = [];\n  this.$untouched = true;\n  this.$touched = false;\n  this.$pristine = true;\n  this.$dirty = false;\n  this.$valid = true;\n  this.$invalid = false;\n  this.$error = {}; // keep invalid keys here\n  this.$$success = {}; // keep valid keys here\n  this.$pending = undefined; // keep pending keys here\n  this.$name = $interpolate($attr.name || '', false)($scope);\n\n\n  var parsedNgModel = $parse($attr.ngModel),\n      parsedNgModelAssign = parsedNgModel.assign,\n      ngModelGet = parsedNgModel,\n      ngModelSet = parsedNgModelAssign,\n      pendingDebounce = null,\n      ctrl = this;\n\n  this.$$setOptions = function(options) {\n    ctrl.$options = options;\n    if (options && options.getterSetter) {\n      var invokeModelGetter = $parse($attr.ngModel + '()'),\n          invokeModelSetter = $parse($attr.ngModel + '($$$p)');\n\n      ngModelGet = function($scope) {\n        var modelValue = parsedNgModel($scope);\n        if (isFunction(modelValue)) {\n          modelValue = invokeModelGetter($scope);\n        }\n        return modelValue;\n      };\n      ngModelSet = function($scope, newValue) {\n        if (isFunction(parsedNgModel($scope))) {\n          invokeModelSetter($scope, {$$$p: ctrl.$modelValue});\n        } else {\n          parsedNgModelAssign($scope, ctrl.$modelValue);\n        }\n      };\n    } else if (!parsedNgModel.assign) {\n      throw $ngModelMinErr('nonassign', \"Expression '{0}' is non-assignable. Element: {1}\",\n          $attr.ngModel, startingTag($element));\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$render\n   *\n   * @description\n   * Called when the view needs to be updated. It is expected that the user of the ng-model\n   * directive will implement this method.\n   *\n   * The `$render()` method is invoked in the following situations:\n   *\n   * * `$rollbackViewValue()` is called.  If we are rolling back the view value to the last\n   *   committed value then `$render()` is called to update the input control.\n   * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n   *   the `$viewValue` are different to last time.\n   *\n   * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n   * `$modelValue` and `$viewValue` are actually different to their previous value. If `$modelValue`\n   * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n   * invoked if you only change a property on the objects.\n   */\n  this.$render = noop;\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$isEmpty\n   *\n   * @description\n   * This is called when we need to determine if the value of an input is empty.\n   *\n   * For instance, the required directive does this to work out if the input has data or not.\n   *\n   * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n   *\n   * You can override this for input directives whose concept of being empty is different to the\n   * default. The `checkboxInputType` directive does this because in its case a value of `false`\n   * implies empty.\n   *\n   * @param {*} value The value of the input to check for emptiness.\n   * @returns {boolean} True if `value` is \"empty\".\n   */\n  this.$isEmpty = function(value) {\n    return isUndefined(value) || value === '' || value === null || value !== value;\n  };\n\n  var parentForm = $element.inheritedData('$formController') || nullFormCtrl,\n      currentValidationRunId = 0;\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setValidity\n   *\n   * @description\n   * Change the validity state, and notify the form.\n   *\n   * This method can be called within $parsers/$formatters or a custom validation implementation.\n   * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n   * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n   *\n   * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n   *        to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n   *        (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n   *        The `validationErrorKey` should be in camelCase and will get converted into dash-case\n   *        for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n   *        class and can be bound to as  `{{someForm.someControl.$error.myError}}` .\n   * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n   *                          or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n   *                          Skipped is used by Angular when validators do not run because of parse errors and\n   *                          when `$asyncValidators` do not run because any of the `$validators` failed.\n   */\n  addSetValidityMethod({\n    ctrl: this,\n    $element: $element,\n    set: function(object, property) {\n      object[property] = true;\n    },\n    unset: function(object, property) {\n      delete object[property];\n    },\n    parentForm: parentForm,\n    $animate: $animate\n  });\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setPristine\n   *\n   * @description\n   * Sets the control to its pristine state.\n   *\n   * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n   * state (`ng-pristine` class). A model is considered to be pristine when the control\n   * has not been changed from when first compiled.\n   */\n  this.$setPristine = function() {\n    ctrl.$dirty = false;\n    ctrl.$pristine = true;\n    $animate.removeClass($element, DIRTY_CLASS);\n    $animate.addClass($element, PRISTINE_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setDirty\n   *\n   * @description\n   * Sets the control to its dirty state.\n   *\n   * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n   * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n   * from when first compiled.\n   */\n  this.$setDirty = function() {\n    ctrl.$dirty = true;\n    ctrl.$pristine = false;\n    $animate.removeClass($element, PRISTINE_CLASS);\n    $animate.addClass($element, DIRTY_CLASS);\n    parentForm.$setDirty();\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setUntouched\n   *\n   * @description\n   * Sets the control to its untouched state.\n   *\n   * This method can be called to remove the `ng-touched` class and set the control to its\n   * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n   * by default, however this function can be used to restore that state if the model has\n   * already been touched by the user.\n   */\n  this.$setUntouched = function() {\n    ctrl.$touched = false;\n    ctrl.$untouched = true;\n    $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setTouched\n   *\n   * @description\n   * Sets the control to its touched state.\n   *\n   * This method can be called to remove the `ng-untouched` class and set the control to its\n   * touched state (`ng-touched` class). A model is considered to be touched when the user has\n   * first focused the control element and then shifted focus away from the control (blur event).\n   */\n  this.$setTouched = function() {\n    ctrl.$touched = true;\n    ctrl.$untouched = false;\n    $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$rollbackViewValue\n   *\n   * @description\n   * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n   * which may be caused by a pending debounced event or because the input is waiting for a some\n   * future event.\n   *\n   * If you have an input that uses `ng-model-options` to set up debounced events or events such\n   * as blur you can have a situation where there is a period when the `$viewValue`\n   * is out of synch with the ngModel's `$modelValue`.\n   *\n   * In this case, you can run into difficulties if you try to update the ngModel's `$modelValue`\n   * programmatically before these debounced/future events have resolved/occurred, because Angular's\n   * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n   *\n   * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n   * input which may have such events pending. This is important in order to make sure that the\n   * input field will be updated with the new model value and any pending operations are cancelled.\n   *\n   * <example name=\"ng-model-cancel-update\" module=\"cancel-update-example\">\n   *   <file name=\"app.js\">\n   *     angular.module('cancel-update-example', [])\n   *\n   *     .controller('CancelUpdateController', ['$scope', function($scope) {\n   *       $scope.resetWithCancel = function(e) {\n   *         if (e.keyCode == 27) {\n   *           $scope.myForm.myInput1.$rollbackViewValue();\n   *           $scope.myValue = '';\n   *         }\n   *       };\n   *       $scope.resetWithoutCancel = function(e) {\n   *         if (e.keyCode == 27) {\n   *           $scope.myValue = '';\n   *         }\n   *       };\n   *     }]);\n   *   </file>\n   *   <file name=\"index.html\">\n   *     <div ng-controller=\"CancelUpdateController\">\n   *       <p>Try typing something in each input.  See that the model only updates when you\n   *          blur off the input.\n   *        </p>\n   *        <p>Now see what happens if you start typing then press the Escape key</p>\n   *\n   *       <form name=\"myForm\" ng-model-options=\"{ updateOn: 'blur' }\">\n   *         <p>With $rollbackViewValue()</p>\n   *         <input name=\"myInput1\" ng-model=\"myValue\" ng-keydown=\"resetWithCancel($event)\"><br/>\n   *         myValue: \"{{ myValue }}\"\n   *\n   *         <p>Without $rollbackViewValue()</p>\n   *         <input name=\"myInput2\" ng-model=\"myValue\" ng-keydown=\"resetWithoutCancel($event)\"><br/>\n   *         myValue: \"{{ myValue }}\"\n   *       </form>\n   *     </div>\n   *   </file>\n   * </example>\n   */\n  this.$rollbackViewValue = function() {\n    $timeout.cancel(pendingDebounce);\n    ctrl.$viewValue = ctrl.$$lastCommittedViewValue;\n    ctrl.$render();\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$validate\n   *\n   * @description\n   * Runs each of the registered validators (first synchronous validators and then\n   * asynchronous validators).\n   * If the validity changes to invalid, the model will be set to `undefined`,\n   * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n   * If the validity changes to valid, it will set the model to the last available valid\n   * modelValue, i.e. either the last parsed value or the last value set from the scope.\n   */\n  this.$validate = function() {\n    // ignore $validate before model is initialized\n    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n      return;\n    }\n\n    var viewValue = ctrl.$$lastCommittedViewValue;\n    // Note: we use the $$rawModelValue as $modelValue might have been\n    // set to undefined during a view -> model update that found validation\n    // errors. We can't parse the view here, since that could change\n    // the model although neither viewValue nor the model on the scope changed\n    var modelValue = ctrl.$$rawModelValue;\n\n    // Check if the there's a parse error, so we don't unset it accidentially\n    var parserName = ctrl.$$parserName || 'parse';\n    var parserValid = ctrl.$error[parserName] ? false : undefined;\n\n    var prevValid = ctrl.$valid;\n    var prevModelValue = ctrl.$modelValue;\n\n    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n\n    ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) {\n      // If there was no change in validity, don't update the model\n      // This prevents changing an invalid modelValue to undefined\n      if (!allowInvalid && prevValid !== allValid) {\n        // Note: Don't check ctrl.$valid here, as we could have\n        // external validators (e.g. calculated on the server),\n        // that just call $setValidity and need the model value\n        // to calculate their validity.\n        ctrl.$modelValue = allValid ? modelValue : undefined;\n\n        if (ctrl.$modelValue !== prevModelValue) {\n          ctrl.$$writeModelToScope();\n        }\n      }\n    });\n\n  };\n\n  this.$$runValidators = function(parseValid, modelValue, viewValue, doneCallback) {\n    currentValidationRunId++;\n    var localValidationRunId = currentValidationRunId;\n\n    // check parser error\n    if (!processParseErrors(parseValid)) {\n      validationDone(false);\n      return;\n    }\n    if (!processSyncValidators()) {\n      validationDone(false);\n      return;\n    }\n    processAsyncValidators();\n\n    function processParseErrors(parseValid) {\n      var errorKey = ctrl.$$parserName || 'parse';\n      if (parseValid === undefined) {\n        setValidity(errorKey, null);\n      } else {\n        setValidity(errorKey, parseValid);\n        if (!parseValid) {\n          forEach(ctrl.$validators, function(v, name) {\n            setValidity(name, null);\n          });\n          forEach(ctrl.$asyncValidators, function(v, name) {\n            setValidity(name, null);\n          });\n          return false;\n        }\n      }\n      return true;\n    }\n\n    function processSyncValidators() {\n      var syncValidatorsValid = true;\n      forEach(ctrl.$validators, function(validator, name) {\n        var result = validator(modelValue, viewValue);\n        syncValidatorsValid = syncValidatorsValid && result;\n        setValidity(name, result);\n      });\n      if (!syncValidatorsValid) {\n        forEach(ctrl.$asyncValidators, function(v, name) {\n          setValidity(name, null);\n        });\n        return false;\n      }\n      return true;\n    }\n\n    function processAsyncValidators() {\n      var validatorPromises = [];\n      var allValid = true;\n      forEach(ctrl.$asyncValidators, function(validator, name) {\n        var promise = validator(modelValue, viewValue);\n        if (!isPromiseLike(promise)) {\n          throw $ngModelMinErr(\"$asyncValidators\",\n            \"Expected asynchronous validator to return a promise but got '{0}' instead.\", promise);\n        }\n        setValidity(name, undefined);\n        validatorPromises.push(promise.then(function() {\n          setValidity(name, true);\n        }, function(error) {\n          allValid = false;\n          setValidity(name, false);\n        }));\n      });\n      if (!validatorPromises.length) {\n        validationDone(true);\n      } else {\n        $q.all(validatorPromises).then(function() {\n          validationDone(allValid);\n        }, noop);\n      }\n    }\n\n    function setValidity(name, isValid) {\n      if (localValidationRunId === currentValidationRunId) {\n        ctrl.$setValidity(name, isValid);\n      }\n    }\n\n    function validationDone(allValid) {\n      if (localValidationRunId === currentValidationRunId) {\n\n        doneCallback(allValid);\n      }\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$commitViewValue\n   *\n   * @description\n   * Commit a pending update to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n   * usually handles calling this in response to input events.\n   */\n  this.$commitViewValue = function() {\n    var viewValue = ctrl.$viewValue;\n\n    $timeout.cancel(pendingDebounce);\n\n    // If the view value has not changed then we should just exit, except in the case where there is\n    // a native validator on the element. In this case the validation state may have changed even though\n    // the viewValue has stayed empty.\n    if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {\n      return;\n    }\n    ctrl.$$lastCommittedViewValue = viewValue;\n\n    // change to dirty\n    if (ctrl.$pristine) {\n      this.$setDirty();\n    }\n    this.$$parseAndValidate();\n  };\n\n  this.$$parseAndValidate = function() {\n    var viewValue = ctrl.$$lastCommittedViewValue;\n    var modelValue = viewValue;\n    var parserValid = isUndefined(modelValue) ? undefined : true;\n\n    if (parserValid) {\n      for (var i = 0; i < ctrl.$parsers.length; i++) {\n        modelValue = ctrl.$parsers[i](modelValue);\n        if (isUndefined(modelValue)) {\n          parserValid = false;\n          break;\n        }\n      }\n    }\n    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n      // ctrl.$modelValue has not been touched yet...\n      ctrl.$modelValue = ngModelGet($scope);\n    }\n    var prevModelValue = ctrl.$modelValue;\n    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n    ctrl.$$rawModelValue = modelValue;\n\n    if (allowInvalid) {\n      ctrl.$modelValue = modelValue;\n      writeToModelIfNeeded();\n    }\n\n    // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n    // This can happen if e.g. $setViewValue is called from inside a parser\n    ctrl.$$runValidators(parserValid, modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {\n      if (!allowInvalid) {\n        // Note: Don't check ctrl.$valid here, as we could have\n        // external validators (e.g. calculated on the server),\n        // that just call $setValidity and need the model value\n        // to calculate their validity.\n        ctrl.$modelValue = allValid ? modelValue : undefined;\n        writeToModelIfNeeded();\n      }\n    });\n\n    function writeToModelIfNeeded() {\n      if (ctrl.$modelValue !== prevModelValue) {\n        ctrl.$$writeModelToScope();\n      }\n    }\n  };\n\n  this.$$writeModelToScope = function() {\n    ngModelSet($scope, ctrl.$modelValue);\n    forEach(ctrl.$viewChangeListeners, function(listener) {\n      try {\n        listener();\n      } catch (e) {\n        $exceptionHandler(e);\n      }\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setViewValue\n   *\n   * @description\n   * Update the view value.\n   *\n   * This method should be called when an input directive want to change the view value; typically,\n   * this is done from within a DOM event handler.\n   *\n   * For example {@link ng.directive:input input} calls it when the value of the input changes and\n   * {@link ng.directive:select select} calls it when an option is selected.\n   *\n   * If the new `value` is an object (rather than a string or a number), we should make a copy of the\n   * object before passing it to `$setViewValue`.  This is because `ngModel` does not perform a deep\n   * watch of objects, it only looks for a change of identity. If you only change the property of\n   * the object then ngModel will not realise that the object has changed and will not invoke the\n   * `$parsers` and `$validators` pipelines.\n   *\n   * For this reason, you should not change properties of the copy once it has been passed to\n   * `$setViewValue`. Otherwise you may cause the model value on the scope to change incorrectly.\n   *\n   * When this method is called, the new `value` will be staged for committing through the `$parsers`\n   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n   * value sent directly for processing, finally to be applied to `$modelValue` and then the\n   * **expression** specified in the `ng-model` attribute.\n   *\n   * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.\n   *\n   * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n   * and the `default` trigger is not listed, all those actions will remain pending until one of the\n   * `updateOn` events is triggered on the DOM element.\n   * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n   * directive is used with a custom debounce for this particular event.\n   *\n   * Note that calling this function does not trigger a `$digest`.\n   *\n   * @param {string} value Value from the view.\n   * @param {string} trigger Event that triggered the update.\n   */\n  this.$setViewValue = function(value, trigger) {\n    ctrl.$viewValue = value;\n    if (!ctrl.$options || ctrl.$options.updateOnDefault) {\n      ctrl.$$debounceViewValueCommit(trigger);\n    }\n  };\n\n  this.$$debounceViewValueCommit = function(trigger) {\n    var debounceDelay = 0,\n        options = ctrl.$options,\n        debounce;\n\n    if (options && isDefined(options.debounce)) {\n      debounce = options.debounce;\n      if (isNumber(debounce)) {\n        debounceDelay = debounce;\n      } else if (isNumber(debounce[trigger])) {\n        debounceDelay = debounce[trigger];\n      } else if (isNumber(debounce['default'])) {\n        debounceDelay = debounce['default'];\n      }\n    }\n\n    $timeout.cancel(pendingDebounce);\n    if (debounceDelay) {\n      pendingDebounce = $timeout(function() {\n        ctrl.$commitViewValue();\n      }, debounceDelay);\n    } else if ($rootScope.$$phase) {\n      ctrl.$commitViewValue();\n    } else {\n      $scope.$apply(function() {\n        ctrl.$commitViewValue();\n      });\n    }\n  };\n\n  // model -> value\n  // Note: we cannot use a normal scope.$watch as we want to detect the following:\n  // 1. scope value is 'a'\n  // 2. user enters 'b'\n  // 3. ng-change kicks in and reverts scope value to 'a'\n  //    -> scope value did not change since the last digest as\n  //       ng-change executes in apply phase\n  // 4. view should be changed back to 'a'\n  $scope.$watch(function ngModelWatch() {\n    var modelValue = ngModelGet($scope);\n\n    // if scope model value and ngModel value are out of sync\n    // TODO(perf): why not move this to the action fn?\n    if (modelValue !== ctrl.$modelValue) {\n      ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;\n\n      var formatters = ctrl.$formatters,\n          idx = formatters.length;\n\n      var viewValue = modelValue;\n      while (idx--) {\n        viewValue = formatters[idx](viewValue);\n      }\n      if (ctrl.$viewValue !== viewValue) {\n        ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;\n        ctrl.$render();\n\n        ctrl.$$runValidators(undefined, modelValue, viewValue, noop);\n      }\n    }\n\n    return modelValue;\n  });\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngModel\n *\n * @element input\n * @priority 1\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n *   require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, `ng-untouched`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n *  - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n *  - {@link ng.directive:input input}\n *    - {@link input[text] text}\n *    - {@link input[checkbox] checkbox}\n *    - {@link input[radio] radio}\n *    - {@link input[number] number}\n *    - {@link input[email] email}\n *    - {@link input[url] url}\n *    - {@link input[date] date}\n *    - {@link input[datetime-local] datetime-local}\n *    - {@link input[time] time}\n *    - {@link input[month] month}\n *    - {@link input[week] week}\n *  - {@link ng.directive:select select}\n *  - {@link ng.directive:textarea textarea}\n *\n * # CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n *  - `ng-valid`: the model is valid\n *  - `ng-invalid`: the model is invalid\n *  - `ng-valid-[key]`: for each valid key added by `$setValidity`\n *  - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n *  - `ng-pristine`: the control hasn't been interacted with yet\n *  - `ng-dirty`: the control has been interacted with\n *  - `ng-touched`: the control has been blurred\n *  - `ng-untouched`: the control hasn't been blurred\n *  - `ng-pending`: any `$asyncValidators` are unfulfilled\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * ## Animation Hooks\n *\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-input {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-input.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * </pre>\n *\n * @example\n * <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"inputExample\">\n     <file name=\"index.html\">\n       <script>\n        angular.module('inputExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.val = '1';\n          }]);\n       </script>\n       <style>\n         .my-input {\n           -webkit-transition:all linear 0.5s;\n           transition:all linear 0.5s;\n           background: transparent;\n         }\n         .my-input.ng-invalid {\n           color:white;\n           background: red;\n         }\n       </style>\n       Update input to see transitions when valid/invalid.\n       Integer is a valid value.\n       <form name=\"testForm\" ng-controller=\"ExampleController\">\n         <input ng-model=\"val\" ng-pattern=\"/^\\d+$/\" name=\"anim\" class=\"my-input\" />\n       </form>\n     </file>\n * </example>\n *\n * ## Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function.  A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different than what the model exposes\n * to the view.\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more\n * frequently than other parts of your code.\n * </div>\n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `<form>`, which will enable this behavior for all `<input>`s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * <example name=\"ngModel-getter-setter\" module=\"getterSetterExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n         <form name=\"userForm\">\n           Name:\n           <input type=\"text\" name=\"userName\"\n                  ng-model=\"user.name\"\n                  ng-model-options=\"{ getterSetter: true }\" />\n         </form>\n         <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n       </div>\n     </file>\n     <file name=\"app.js\">\n       angular.module('getterSetterExample', [])\n         .controller('ExampleController', ['$scope', function($scope) {\n           var _name = 'Brian';\n           $scope.user = {\n             name: function(newName) {\n               if (angular.isDefined(newName)) {\n                 _name = newName;\n               }\n               return _name;\n             }\n           };\n         }]);\n     </file>\n * </example>\n */\nvar ngModelDirective = ['$rootScope', function($rootScope) {\n  return {\n    restrict: 'A',\n    require: ['ngModel', '^?form', '^?ngModelOptions'],\n    controller: NgModelController,\n    // Prelink needs to run before any input directive\n    // so that we can set the NgModelOptions in NgModelController\n    // before anyone else uses it.\n    priority: 1,\n    compile: function ngModelCompile(element) {\n      // Setup initial state of the control\n      element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n\n      return {\n        pre: function ngModelPreLink(scope, element, attr, ctrls) {\n          var modelCtrl = ctrls[0],\n              formCtrl = ctrls[1] || nullFormCtrl;\n\n          modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);\n\n          // notify others, especially parent forms\n          formCtrl.$addControl(modelCtrl);\n\n          attr.$observe('name', function(newValue) {\n            if (modelCtrl.$name !== newValue) {\n              formCtrl.$$renameControl(modelCtrl, newValue);\n            }\n          });\n\n          scope.$on('$destroy', function() {\n            formCtrl.$removeControl(modelCtrl);\n          });\n        },\n        post: function ngModelPostLink(scope, element, attr, ctrls) {\n          var modelCtrl = ctrls[0];\n          if (modelCtrl.$options && modelCtrl.$options.updateOn) {\n            element.on(modelCtrl.$options.updateOn, function(ev) {\n              modelCtrl.$$debounceViewValueCommit(ev && ev.type);\n            });\n          }\n\n          element.on('blur', function(ev) {\n            if (modelCtrl.$touched) return;\n\n            if ($rootScope.$$phase) {\n              scope.$evalAsync(modelCtrl.$setTouched);\n            } else {\n              scope.$apply(modelCtrl.$setTouched);\n            }\n          });\n        }\n      };\n    }\n  };\n}];\n\nvar DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n/**\n * @ngdoc directive\n * @name ngModelOptions\n *\n * @description\n * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of\n * events that will trigger a model update and/or a debouncing delay so that the actual update only\n * takes place when a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different than the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController `$rollbackViewValue`} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController `$rollbackViewValue`}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * `ngModelOptions` has an effect on the element it's declared on and its descendants.\n *\n * @param {Object} ngModelOptions options to apply to the current model. Valid keys are:\n *   - `updateOn`: string specifying which event should the input be bound to. You can set several\n *     events using an space delimited list. There is a special event called `default` that\n *     matches the default events belonging of the control.\n *   - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n *     value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n *     custom value for each event. For example:\n *     `ng-model-options=\"{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }\"`\n *   - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n *     not validate correctly instead of the default behavior of setting the model to undefined.\n *   - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n       `ngModel` as getters/setters.\n *   - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n *     `<input type=\"date\">`, `<input type=\"time\">`, ... . Right now, the only supported value is `'UTC'`,\n *     otherwise the default timezone of the browser will be used.\n *\n * @example\n\n  The following example shows how to override immediate updates. Changes on the inputs within the\n  form will update the model only when the control loses focus (blur event). If `escape` key is\n  pressed while the input field is focused, the value is reset to the value in the current model.\n\n  <example name=\"ngModelOptions-directive-blur\" module=\"optionsExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ updateOn: 'blur' }\"\n                 ng-keyup=\"cancel($event)\" /><br />\n\n          Other data:\n          <input type=\"text\" ng-model=\"user.data\" /><br />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('optionsExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.user = { name: 'say', data: '' };\n\n          $scope.cancel = function(e) {\n            if (e.keyCode == 27) {\n              $scope.userForm.userName.$rollbackViewValue();\n            }\n          };\n        }]);\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var model = element(by.binding('user.name'));\n      var input = element(by.model('user.name'));\n      var other = element(by.model('user.data'));\n\n      it('should allow custom events', function() {\n        input.sendKeys(' hello');\n        input.click();\n        expect(model.getText()).toEqual('say');\n        other.click();\n        expect(model.getText()).toEqual('say hello');\n      });\n\n      it('should $rollbackViewValue when model changes', function() {\n        input.sendKeys(' hello');\n        expect(input.getAttribute('value')).toEqual('say hello');\n        input.sendKeys(protractor.Key.ESCAPE);\n        expect(input.getAttribute('value')).toEqual('say');\n        other.click();\n        expect(model.getText()).toEqual('say');\n      });\n    </file>\n  </example>\n\n  This one shows how to debounce model changes. Model will be updated only 1 sec after last change.\n  If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n\n  <example name=\"ngModelOptions-directive-debounce\" module=\"optionsExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ debounce: 1000 }\" />\n          <button ng-click=\"userForm.userName.$rollbackViewValue(); user.name=''\">Clear</button><br />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('optionsExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.user = { name: 'say' };\n        }]);\n    </file>\n  </example>\n\n  This one shows how to bind to getter/setters:\n\n  <example name=\"ngModelOptions-directive-getter-setter\" module=\"getterSetterExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ getterSetter: true }\" />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('getterSetterExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          var _name = 'Brian';\n          $scope.user = {\n            name: function(newName) {\n              return angular.isDefined(newName) ? (_name = newName) : _name;\n            }\n          };\n        }]);\n    </file>\n  </example>\n */\nvar ngModelOptionsDirective = function() {\n  return {\n    restrict: 'A',\n    controller: ['$scope', '$attrs', function($scope, $attrs) {\n      var that = this;\n      this.$options = $scope.$eval($attrs.ngModelOptions);\n      // Allow adding/overriding bound events\n      if (this.$options.updateOn !== undefined) {\n        this.$options.updateOnDefault = false;\n        // extract \"default\" pseudo-event from list of events that can trigger a model update\n        this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {\n          that.$options.updateOnDefault = true;\n          return ' ';\n        }));\n      } else {\n        this.$options.updateOnDefault = true;\n      }\n    }]\n  };\n};\n\n\n\n// helper methods\nfunction addSetValidityMethod(context) {\n  var ctrl = context.ctrl,\n      $element = context.$element,\n      classCache = {},\n      set = context.set,\n      unset = context.unset,\n      parentForm = context.parentForm,\n      $animate = context.$animate;\n\n  classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));\n\n  ctrl.$setValidity = setValidity;\n\n  function setValidity(validationErrorKey, state, controller) {\n    if (state === undefined) {\n      createAndSet('$pending', validationErrorKey, controller);\n    } else {\n      unsetAndCleanup('$pending', validationErrorKey, controller);\n    }\n    if (!isBoolean(state)) {\n      unset(ctrl.$error, validationErrorKey, controller);\n      unset(ctrl.$$success, validationErrorKey, controller);\n    } else {\n      if (state) {\n        unset(ctrl.$error, validationErrorKey, controller);\n        set(ctrl.$$success, validationErrorKey, controller);\n      } else {\n        set(ctrl.$error, validationErrorKey, controller);\n        unset(ctrl.$$success, validationErrorKey, controller);\n      }\n    }\n    if (ctrl.$pending) {\n      cachedToggleClass(PENDING_CLASS, true);\n      ctrl.$valid = ctrl.$invalid = undefined;\n      toggleValidationCss('', null);\n    } else {\n      cachedToggleClass(PENDING_CLASS, false);\n      ctrl.$valid = isObjectEmpty(ctrl.$error);\n      ctrl.$invalid = !ctrl.$valid;\n      toggleValidationCss('', ctrl.$valid);\n    }\n\n    // re-read the state as the set/unset methods could have\n    // combined state in ctrl.$error[validationError] (used for forms),\n    // where setting/unsetting only increments/decrements the value,\n    // and does not replace it.\n    var combinedState;\n    if (ctrl.$pending && ctrl.$pending[validationErrorKey]) {\n      combinedState = undefined;\n    } else if (ctrl.$error[validationErrorKey]) {\n      combinedState = false;\n    } else if (ctrl.$$success[validationErrorKey]) {\n      combinedState = true;\n    } else {\n      combinedState = null;\n    }\n\n    toggleValidationCss(validationErrorKey, combinedState);\n    parentForm.$setValidity(validationErrorKey, combinedState, ctrl);\n  }\n\n  function createAndSet(name, value, controller) {\n    if (!ctrl[name]) {\n      ctrl[name] = {};\n    }\n    set(ctrl[name], value, controller);\n  }\n\n  function unsetAndCleanup(name, value, controller) {\n    if (ctrl[name]) {\n      unset(ctrl[name], value, controller);\n    }\n    if (isObjectEmpty(ctrl[name])) {\n      ctrl[name] = undefined;\n    }\n  }\n\n  function cachedToggleClass(className, switchValue) {\n    if (switchValue && !classCache[className]) {\n      $animate.addClass($element, className);\n      classCache[className] = true;\n    } else if (!switchValue && classCache[className]) {\n      $animate.removeClass($element, className);\n      classCache[className] = false;\n    }\n  }\n\n  function toggleValidationCss(validationErrorKey, isValid) {\n    validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n\n    cachedToggleClass(VALID_CLASS + validationErrorKey, isValid === true);\n    cachedToggleClass(INVALID_CLASS + validationErrorKey, isValid === false);\n  }\n}\n\nfunction isObjectEmpty(obj) {\n  if (obj) {\n    for (var prop in obj) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n *\n * @description\n * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current\n * DOM element. This is useful if the element contains what appears to be Angular directives and\n * bindings but which should be ignored by Angular. This could be the case if you have a site that\n * displays snippets of code, for instance.\n *\n * @element ANY\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        <div>Normal: {{1 + 2}}</div>\n        <div ng-non-bindable>Ignored: {{1 + 2}}</div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-non-bindable', function() {\n         expect(element(by.binding('1 + 2')).getText()).toContain('3');\n         expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n       });\n      </file>\n    </example>\n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/**\n * @ngdoc directive\n * @name ngPluralize\n * @restrict EA\n *\n * @description\n * `ngPluralize` is a directive that displays messages according to en-US localization rules.\n * These rules are bundled with angular.js, but can be overridden\n * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive\n * by specifying the mappings between\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * and the strings to be displayed.\n *\n * # Plural categories and explicit number rules\n * There are two\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * in Angular's default en-US locale: \"one\" and \"other\".\n *\n * While a plural category may match many numbers (for example, in en-US locale, \"other\" can match\n * any number that is not 1), an explicit number rule can only match one number. For example, the\n * explicit number rule for \"3\" matches the number 3. There are examples of plural categories\n * and explicit number rules throughout the rest of this documentation.\n *\n * # Configuring ngPluralize\n * You configure ngPluralize by providing 2 attributes: `count` and `when`.\n * You can also provide an optional attribute, `offset`.\n *\n * The value of the `count` attribute can be either a string or an {@link guide/expression\n * Angular expression}; these are evaluated on the current scope for its bound value.\n *\n * The `when` attribute specifies the mappings between plural categories and the actual\n * string to be displayed. The value of the attribute should be a JSON object.\n *\n * The following example shows how to configure ngPluralize:\n *\n * ```html\n * <ng-pluralize count=\"personCount\"\n                 when=\"{'0': 'Nobody is viewing.',\n *                      'one': '1 person is viewing.',\n *                      'other': '{} people are viewing.'}\">\n * </ng-pluralize>\n *```\n *\n * In the example, `\"0: Nobody is viewing.\"` is an explicit number rule. If you did not\n * specify this rule, 0 would be matched to the \"other\" category and \"0 people are viewing\"\n * would be shown instead of \"Nobody is viewing\". You can specify an explicit number rule for\n * other numbers, for example 12, so that instead of showing \"12 people are viewing\", you can\n * show \"a dozen people are viewing\".\n *\n * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted\n * into pluralized strings. In the previous example, Angular will replace `{}` with\n * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder\n * for <span ng-non-bindable>{{numberExpression}}</span>.\n *\n * # Configuring ngPluralize with offset\n * The `offset` attribute allows further customization of pluralized text, which can result in\n * a better user experience. For example, instead of the message \"4 people are viewing this document\",\n * you might display \"John, Kate and 2 others are viewing this document\".\n * The offset attribute allows you to offset a number by any desired value.\n * Let's take a look at an example:\n *\n * ```html\n * <ng-pluralize count=\"personCount\" offset=2\n *               when=\"{'0': 'Nobody is viewing.',\n *                      '1': '{{person1}} is viewing.',\n *                      '2': '{{person1}} and {{person2}} are viewing.',\n *                      'one': '{{person1}}, {{person2}} and one other person are viewing.',\n *                      'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n * </ng-pluralize>\n * ```\n *\n * Notice that we are still using two plural categories(one, other), but we added\n * three explicit number rules 0, 1 and 2.\n * When one person, perhaps John, views the document, \"John is viewing\" will be shown.\n * When three people view the document, no explicit number rule is found, so\n * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.\n * In this case, plural category 'one' is matched and \"John, Mary and one other person are viewing\"\n * is shown.\n *\n * Note that when you specify offsets, you must provide explicit number rules for\n * numbers from 0 up to and including the offset. If you use an offset of 3, for example,\n * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for\n * plural categories \"one\" and \"other\".\n *\n * @param {string|expression} count The variable to be bound to.\n * @param {string} when The mapping between plural category to its corresponding strings.\n * @param {number=} offset Offset to deduct from the total number.\n *\n * @example\n    <example module=\"pluralizeExample\">\n      <file name=\"index.html\">\n        <script>\n          angular.module('pluralizeExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.person1 = 'Igor';\n              $scope.person2 = 'Misko';\n              $scope.personCount = 1;\n            }]);\n        </script>\n        <div ng-controller=\"ExampleController\">\n          Person 1:<input type=\"text\" ng-model=\"person1\" value=\"Igor\" /><br/>\n          Person 2:<input type=\"text\" ng-model=\"person2\" value=\"Misko\" /><br/>\n          Number of People:<input type=\"text\" ng-model=\"personCount\" value=\"1\" /><br/>\n\n          <!--- Example with simple pluralization rules for en locale --->\n          Without Offset:\n          <ng-pluralize count=\"personCount\"\n                        when=\"{'0': 'Nobody is viewing.',\n                               'one': '1 person is viewing.',\n                               'other': '{} people are viewing.'}\">\n          </ng-pluralize><br>\n\n          <!--- Example with offset --->\n          With Offset(2):\n          <ng-pluralize count=\"personCount\" offset=2\n                        when=\"{'0': 'Nobody is viewing.',\n                               '1': '{{person1}} is viewing.',\n                               '2': '{{person1}} and {{person2}} are viewing.',\n                               'one': '{{person1}}, {{person2}} and one other person are viewing.',\n                               'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n          </ng-pluralize>\n        </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should show correct pluralized string', function() {\n          var withoutOffset = element.all(by.css('ng-pluralize')).get(0);\n          var withOffset = element.all(by.css('ng-pluralize')).get(1);\n          var countInput = element(by.model('personCount'));\n\n          expect(withoutOffset.getText()).toEqual('1 person is viewing.');\n          expect(withOffset.getText()).toEqual('Igor is viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('0');\n\n          expect(withoutOffset.getText()).toEqual('Nobody is viewing.');\n          expect(withOffset.getText()).toEqual('Nobody is viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('2');\n\n          expect(withoutOffset.getText()).toEqual('2 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('3');\n\n          expect(withoutOffset.getText()).toEqual('3 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('4');\n\n          expect(withoutOffset.getText()).toEqual('4 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');\n        });\n        it('should show data-bound names', function() {\n          var withOffset = element.all(by.css('ng-pluralize')).get(1);\n          var personCount = element(by.model('personCount'));\n          var person1 = element(by.model('person1'));\n          var person2 = element(by.model('person2'));\n          personCount.clear();\n          personCount.sendKeys('4');\n          person1.clear();\n          person1.sendKeys('Di');\n          person2.clear();\n          person2.sendKeys('Vojta');\n          expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');\n        });\n      </file>\n    </example>\n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {\n  var BRACE = /{}/g,\n      IS_WHEN = /^when(Minus)?(.+)$/;\n\n  return {\n    restrict: 'EA',\n    link: function(scope, element, attr) {\n      var numberExp = attr.count,\n          whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs\n          offset = attr.offset || 0,\n          whens = scope.$eval(whenExp) || {},\n          whensExpFns = {},\n          startSymbol = $interpolate.startSymbol(),\n          endSymbol = $interpolate.endSymbol(),\n          braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,\n          watchRemover = angular.noop,\n          lastCount;\n\n      forEach(attr, function(expression, attributeName) {\n        var tmpMatch = IS_WHEN.exec(attributeName);\n        if (tmpMatch) {\n          var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);\n          whens[whenKey] = element.attr(attr.$attr[attributeName]);\n        }\n      });\n      forEach(whens, function(expression, key) {\n        whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));\n\n      });\n\n      scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {\n        var count = parseFloat(newVal);\n        var countIsNaN = isNaN(count);\n\n        if (!countIsNaN && !(count in whens)) {\n          // If an explicit number rule such as 1, 2, 3... is defined, just use it.\n          // Otherwise, check it against pluralization rules in $locale service.\n          count = $locale.pluralCat(count - offset);\n        }\n\n        // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.\n        // In JS `NaN !== NaN`, so we have to exlicitly check.\n        if ((count !== lastCount) && !(countIsNaN && isNaN(lastCount))) {\n          watchRemover();\n          watchRemover = scope.$watch(whensExpFns[count], updateElementText);\n          lastCount = count;\n        }\n      });\n\n      function updateElementText(newText) {\n        element.text(newText || '');\n      }\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngRepeat\n *\n * @description\n * The `ngRepeat` directive instantiates a template once per item from a collection. Each template\n * instance gets its own scope, where the given loop variable is set to the current collection item,\n * and `$index` is set to the item index or key.\n *\n * Special properties are exposed on the local scope of each template instance, including:\n *\n * | Variable  | Type            | Details                                                                     |\n * |-----------|-----------------|-----------------------------------------------------------------------------|\n * | `$index`  | {@type number}  | iterator offset of the repeated element (0..length-1)                       |\n * | `$first`  | {@type boolean} | true if the repeated element is first in the iterator.                      |\n * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |\n * | `$last`   | {@type boolean} | true if the repeated element is last in the iterator.                       |\n * | `$even`   | {@type boolean} | true if the iterator position `$index` is even (otherwise false).           |\n * | `$odd`    | {@type boolean} | true if the iterator position `$index` is odd (otherwise false).            |\n *\n * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.\n * This may be useful when, for instance, nesting ngRepeats.\n *\n * # Iterating over object properties\n *\n * It is possible to get `ngRepeat` to iterate over the properties of an object using the following\n * syntax:\n *\n * ```js\n * <div ng-repeat=\"(key, value) in myObj\"> ... </div>\n * ```\n *\n * You need to be aware that the JavaScript specification does not define what order\n * it will return the keys for an object. In order to have a guaranteed deterministic order\n * for the keys, Angular versions up to and including 1.3 **sort the keys alphabetically**.\n *\n * If this is not desired, the recommended workaround is to convert your object into an array\n * that is sorted into the order that you prefer before providing it to `ngRepeat`.  You could\n * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)\n * or implement a `$watch` on the object yourself.\n *\n * In version 1.4 we will remove the sorting, since it seems that browsers generally follow the\n * strategy of providing keys in the order in which they were defined, although there are exceptions\n * when keys are deleted and reinstated.\n *\n *\n * # Special repeat start and end points\n * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending\n * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.\n * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)\n * up to and including the ending HTML tag where **ng-repeat-end** is placed.\n *\n * The example below makes use of this feature:\n * ```html\n *   <header ng-repeat-start=\"item in items\">\n *     Header {{ item }}\n *   </header>\n *   <div class=\"body\">\n *     Body {{ item }}\n *   </div>\n *   <footer ng-repeat-end>\n *     Footer {{ item }}\n *   </footer>\n * ```\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * ```html\n *   <header>\n *     Header A\n *   </header>\n *   <div class=\"body\">\n *     Body A\n *   </div>\n *   <footer>\n *     Footer A\n *   </footer>\n *   <header>\n *     Header B\n *   </header>\n *   <div class=\"body\">\n *     Body B\n *   </div>\n *   <footer>\n *     Footer B\n *   </footer>\n * ```\n *\n * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such\n * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).\n *\n * @animations\n * **.enter** - when a new item is added to the list or when an item is revealed after a filter\n *\n * **.leave** - when an item is removed from the list or when an item is filtered out\n *\n * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered\n *\n * @element ANY\n * @scope\n * @priority 1000\n * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These\n *   formats are currently supported:\n *\n *   * `variable in expression` – where variable is the user defined loop variable and `expression`\n *     is a scope expression giving the collection to enumerate.\n *\n *     For example: `album in artist.albums`.\n *\n *   * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,\n *     and `expression` is the scope expression giving the collection to enumerate.\n *\n *     For example: `(name, age) in {'adam':10, 'amalie':12}`.\n *\n *   * `variable in expression track by tracking_expression` – You can also provide an optional tracking function\n *     which can be used to associate the objects in the collection with the DOM elements. If no tracking function\n *     is specified the ng-repeat associates elements by identity in the collection. It is an error to have\n *     more than one tracking function to resolve to the same key. (This would mean that two distinct objects are\n *     mapped to the same DOM element, which is not possible.)  Filters should be applied to the expression,\n *     before specifying a tracking expression.\n *\n *     For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements\n *     will be associated by item identity in the array.\n *\n *     For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique\n *     `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements\n *     with the corresponding item in the array by identity. Moving the same object in array would move the DOM\n *     element in the same way in the DOM.\n *\n *     For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this\n *     case the object identity does not matter. Two objects are considered equivalent as long as their `id`\n *     property is same.\n *\n *     For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter\n *     to items in conjunction with a tracking expression.\n *\n *   * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the\n *     intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message\n *     when a filter is active on the repeater, but the filtered result set is empty.\n *\n *     For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after\n *     the items have been processed through the filter.\n *\n * @example\n * This example initializes the scope to a list of names and\n * then uses `ngRepeat` to display every person:\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      <div ng-init=\"friends = [\n        {name:'John', age:25, gender:'boy'},\n        {name:'Jessie', age:30, gender:'girl'},\n        {name:'Johanna', age:28, gender:'girl'},\n        {name:'Joy', age:15, gender:'girl'},\n        {name:'Mary', age:28, gender:'girl'},\n        {name:'Peter', age:95, gender:'boy'},\n        {name:'Sebastian', age:50, gender:'boy'},\n        {name:'Erika', age:27, gender:'girl'},\n        {name:'Patrick', age:40, gender:'boy'},\n        {name:'Samantha', age:60, gender:'girl'}\n      ]\">\n        I have {{friends.length}} friends. They are:\n        <input type=\"search\" ng-model=\"q\" placeholder=\"filter friends...\" />\n        <ul class=\"example-animate-container\">\n          <li class=\"animate-repeat\" ng-repeat=\"friend in friends | filter:q as results\">\n            [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n          </li>\n          <li class=\"animate-repeat\" ng-if=\"results.length == 0\">\n            <strong>No results found...</strong>\n          </li>\n        </ul>\n      </div>\n    </file>\n    <file name=\"animations.css\">\n      .example-animate-container {\n        background:white;\n        border:1px solid black;\n        list-style:none;\n        margin:0;\n        padding:0 10px;\n      }\n\n      .animate-repeat {\n        line-height:40px;\n        list-style:none;\n        box-sizing:border-box;\n      }\n\n      .animate-repeat.ng-move,\n      .animate-repeat.ng-enter,\n      .animate-repeat.ng-leave {\n        -webkit-transition:all linear 0.5s;\n        transition:all linear 0.5s;\n      }\n\n      .animate-repeat.ng-leave.ng-leave-active,\n      .animate-repeat.ng-move,\n      .animate-repeat.ng-enter {\n        opacity:0;\n        max-height:0;\n      }\n\n      .animate-repeat.ng-leave,\n      .animate-repeat.ng-move.ng-move-active,\n      .animate-repeat.ng-enter.ng-enter-active {\n        opacity:1;\n        max-height:40px;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var friends = element.all(by.repeater('friend in friends'));\n\n      it('should render initial data set', function() {\n        expect(friends.count()).toBe(10);\n        expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');\n        expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');\n        expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');\n        expect(element(by.binding('friends.length')).getText())\n            .toMatch(\"I have 10 friends. They are:\");\n      });\n\n       it('should update repeater when filter predicate changes', function() {\n         expect(friends.count()).toBe(10);\n\n         element(by.model('q')).sendKeys('ma');\n\n         expect(friends.count()).toBe(2);\n         expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');\n         expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');\n       });\n      </file>\n    </example>\n */\nvar ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {\n  var NG_REMOVED = '$$NG_REMOVED';\n  var ngRepeatMinErr = minErr('ngRepeat');\n\n  var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {\n    // TODO(perf): generate setters to shave off ~40ms or 1-1.5%\n    scope[valueIdentifier] = value;\n    if (keyIdentifier) scope[keyIdentifier] = key;\n    scope.$index = index;\n    scope.$first = (index === 0);\n    scope.$last = (index === (arrayLength - 1));\n    scope.$middle = !(scope.$first || scope.$last);\n    // jshint bitwise: false\n    scope.$odd = !(scope.$even = (index&1) === 0);\n    // jshint bitwise: true\n  };\n\n  var getBlockStart = function(block) {\n    return block.clone[0];\n  };\n\n  var getBlockEnd = function(block) {\n    return block.clone[block.clone.length - 1];\n  };\n\n\n  return {\n    restrict: 'A',\n    multiElement: true,\n    transclude: 'element',\n    priority: 1000,\n    terminal: true,\n    $$tlb: true,\n    compile: function ngRepeatCompile($element, $attr) {\n      var expression = $attr.ngRepeat;\n      var ngRepeatEndComment = document.createComment(' end ngRepeat: ' + expression + ' ');\n\n      var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\n      if (!match) {\n        throw ngRepeatMinErr('iexp', \"Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.\",\n            expression);\n      }\n\n      var lhs = match[1];\n      var rhs = match[2];\n      var aliasAs = match[3];\n      var trackByExp = match[4];\n\n      match = lhs.match(/^(?:(\\s*[\\$\\w]+)|\\(\\s*([\\$\\w]+)\\s*,\\s*([\\$\\w]+)\\s*\\))$/);\n\n      if (!match) {\n        throw ngRepeatMinErr('iidexp', \"'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.\",\n            lhs);\n      }\n      var valueIdentifier = match[3] || match[1];\n      var keyIdentifier = match[2];\n\n      if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||\n          /^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))) {\n        throw ngRepeatMinErr('badident', \"alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.\",\n          aliasAs);\n      }\n\n      var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;\n      var hashFnLocals = {$id: hashKey};\n\n      if (trackByExp) {\n        trackByExpGetter = $parse(trackByExp);\n      } else {\n        trackByIdArrayFn = function(key, value) {\n          return hashKey(value);\n        };\n        trackByIdObjFn = function(key) {\n          return key;\n        };\n      }\n\n      return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {\n\n        if (trackByExpGetter) {\n          trackByIdExpFn = function(key, value, index) {\n            // assign key, value, and $index to the locals so that they can be used in hash functions\n            if (keyIdentifier) hashFnLocals[keyIdentifier] = key;\n            hashFnLocals[valueIdentifier] = value;\n            hashFnLocals.$index = index;\n            return trackByExpGetter($scope, hashFnLocals);\n          };\n        }\n\n        // Store a list of elements from previous run. This is a hash where key is the item from the\n        // iterator, and the value is objects with following properties.\n        //   - scope: bound scope\n        //   - element: previous element.\n        //   - index: position\n        //\n        // We are using no-proto object so that we don't need to guard against inherited props via\n        // hasOwnProperty.\n        var lastBlockMap = createMap();\n\n        //watch props\n        $scope.$watchCollection(rhs, function ngRepeatAction(collection) {\n          var index, length,\n              previousNode = $element[0],     // node that cloned nodes should be inserted after\n                                              // initialized to the comment node anchor\n              nextNode,\n              // Same as lastBlockMap but it has the current state. It will become the\n              // lastBlockMap on the next iteration.\n              nextBlockMap = createMap(),\n              collectionLength,\n              key, value, // key/value of iteration\n              trackById,\n              trackByIdFn,\n              collectionKeys,\n              block,       // last object information {scope, element, id}\n              nextBlockOrder,\n              elementsToRemove;\n\n          if (aliasAs) {\n            $scope[aliasAs] = collection;\n          }\n\n          if (isArrayLike(collection)) {\n            collectionKeys = collection;\n            trackByIdFn = trackByIdExpFn || trackByIdArrayFn;\n          } else {\n            trackByIdFn = trackByIdExpFn || trackByIdObjFn;\n            // if object, extract keys, sort them and use to determine order of iteration over obj props\n            collectionKeys = [];\n            for (var itemKey in collection) {\n              if (collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$') {\n                collectionKeys.push(itemKey);\n              }\n            }\n            collectionKeys.sort();\n          }\n\n          collectionLength = collectionKeys.length;\n          nextBlockOrder = new Array(collectionLength);\n\n          // locate existing items\n          for (index = 0; index < collectionLength; index++) {\n            key = (collection === collectionKeys) ? index : collectionKeys[index];\n            value = collection[key];\n            trackById = trackByIdFn(key, value, index);\n            if (lastBlockMap[trackById]) {\n              // found previously seen block\n              block = lastBlockMap[trackById];\n              delete lastBlockMap[trackById];\n              nextBlockMap[trackById] = block;\n              nextBlockOrder[index] = block;\n            } else if (nextBlockMap[trackById]) {\n              // if collision detected. restore lastBlockMap and throw an error\n              forEach(nextBlockOrder, function(block) {\n                if (block && block.scope) lastBlockMap[block.id] = block;\n              });\n              throw ngRepeatMinErr('dupes',\n                  \"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}\",\n                  expression, trackById, value);\n            } else {\n              // new never before seen block\n              nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};\n              nextBlockMap[trackById] = true;\n            }\n          }\n\n          // remove leftover items\n          for (var blockKey in lastBlockMap) {\n            block = lastBlockMap[blockKey];\n            elementsToRemove = getBlockNodes(block.clone);\n            $animate.leave(elementsToRemove);\n            if (elementsToRemove[0].parentNode) {\n              // if the element was not removed yet because of pending animation, mark it as deleted\n              // so that we can ignore it later\n              for (index = 0, length = elementsToRemove.length; index < length; index++) {\n                elementsToRemove[index][NG_REMOVED] = true;\n              }\n            }\n            block.scope.$destroy();\n          }\n\n          // we are not using forEach for perf reasons (trying to avoid #call)\n          for (index = 0; index < collectionLength; index++) {\n            key = (collection === collectionKeys) ? index : collectionKeys[index];\n            value = collection[key];\n            block = nextBlockOrder[index];\n\n            if (block.scope) {\n              // if we have already seen this object, then we need to reuse the\n              // associated scope/element\n\n              nextNode = previousNode;\n\n              // skip nodes that are already pending removal via leave animation\n              do {\n                nextNode = nextNode.nextSibling;\n              } while (nextNode && nextNode[NG_REMOVED]);\n\n              if (getBlockStart(block) != nextNode) {\n                // existing item which got moved\n                $animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));\n              }\n              previousNode = getBlockEnd(block);\n              updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n            } else {\n              // new item which we don't know about\n              $transclude(function ngRepeatTransclude(clone, scope) {\n                block.scope = scope;\n                // http://jsperf.com/clone-vs-createcomment\n                var endNode = ngRepeatEndComment.cloneNode(false);\n                clone[clone.length++] = endNode;\n\n                // TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?\n                $animate.enter(clone, null, jqLite(previousNode));\n                previousNode = endNode;\n                // Note: We only need the first/last node of the cloned nodes.\n                // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n                // by a directive with templateUrl when its template arrives.\n                block.clone = clone;\n                nextBlockMap[block.id] = block;\n                updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n              });\n            }\n          }\n          lastBlockMap = nextBlockMap;\n        });\n      };\n    }\n  };\n}];\n\nvar NG_HIDE_CLASS = 'ng-hide';\nvar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';\n/**\n * @ngdoc directive\n * @name ngShow\n *\n * @description\n * The `ngShow` directive shows or hides the given HTML element based on the expression\n * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding\n * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is visible) -->\n * <div ng-show=\"myValue\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is hidden) -->\n * <div ng-show=\"myValue\" class=\"ng-hide\"></div>\n * ```\n *\n * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope\n * with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n *   /&#42; this is just another form of hiding an element &#42;/\n *   display: block!important;\n *   position: absolute;\n *   top: -9999px;\n *   left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngShow`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass except that\n * you must also include the !important flag to override the display property\n * so that you can perform an animation when the element is hidden during the time of the animation.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n *   /&#42; this is required as of 1.3x to properly\n *      apply all styling in a show/hide animation &#42;/\n *   transition: 0s linear all;\n * }\n *\n * .my-element.ng-hide-add-active,\n * .my-element.ng-hide-remove-active {\n *   /&#42; the transition is defined in the active class &#42;/\n *   transition: 1s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible\n * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden\n *\n * @element ANY\n * @param {expression} ngShow If the {@link guide/expression expression} is truthy\n *     then the element is shown or hidden respectively.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n      <div>\n        Show:\n        <div class=\"check-element animate-show\" ng-show=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n        </div>\n      </div>\n      <div>\n        Hide:\n        <div class=\"check-element animate-show\" ng-hide=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n        </div>\n      </div>\n    </file>\n    <file name=\"glyphicons.css\">\n      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n    </file>\n    <file name=\"animations.css\">\n      .animate-show {\n        line-height: 20px;\n        opacity: 1;\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n\n      .animate-show.ng-hide-add.ng-hide-add-active,\n      .animate-show.ng-hide-remove.ng-hide-remove-active {\n        -webkit-transition: all linear 0.5s;\n        transition: all linear 0.5s;\n      }\n\n      .animate-show.ng-hide {\n        line-height: 0;\n        opacity: 0;\n        padding: 0 10px;\n      }\n\n      .check-element {\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n      it('should check ng-show / ng-hide', function() {\n        expect(thumbsUp.isDisplayed()).toBeFalsy();\n        expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n        element(by.model('checked')).click();\n\n        expect(thumbsUp.isDisplayed()).toBeTruthy();\n        expect(thumbsDown.isDisplayed()).toBeFalsy();\n      });\n    </file>\n  </example>\n */\nvar ngShowDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'A',\n    multiElement: true,\n    link: function(scope, element, attr) {\n      scope.$watch(attr.ngShow, function ngShowWatchAction(value) {\n        // we're adding a temporary, animation-specific class for ng-hide since this way\n        // we can control when the element is actually displayed on screen without having\n        // to have a global/greedy CSS selector that breaks when other animations are run.\n        // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845\n        $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {\n          tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n        });\n      });\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngHide\n *\n * @description\n * The `ngHide` directive shows or hides the given HTML element based on the expression\n * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding\n * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is hidden) -->\n * <div ng-hide=\"myValue\" class=\"ng-hide\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is visible) -->\n * <div ng-hide=\"myValue\"></div>\n * ```\n *\n * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class in CSS:\n *\n * ```css\n * .ng-hide {\n *   /&#42; this is just another form of hiding an element &#42;/\n *   display: block!important;\n *   position: absolute;\n *   top: -9999px;\n *   left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngHide`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`\n * CSS class is added and removed for you instead of your own CSS class.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n *   transition: 0.5s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden\n * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible\n *\n * @element ANY\n * @param {expression} ngHide If the {@link guide/expression expression} is truthy then\n *     the element is shown or hidden respectively.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n      <div>\n        Show:\n        <div class=\"check-element animate-hide\" ng-show=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n        </div>\n      </div>\n      <div>\n        Hide:\n        <div class=\"check-element animate-hide\" ng-hide=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n        </div>\n      </div>\n    </file>\n    <file name=\"glyphicons.css\">\n      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n    </file>\n    <file name=\"animations.css\">\n      .animate-hide {\n        -webkit-transition: all linear 0.5s;\n        transition: all linear 0.5s;\n        line-height: 20px;\n        opacity: 1;\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n\n      .animate-hide.ng-hide {\n        line-height: 0;\n        opacity: 0;\n        padding: 0 10px;\n      }\n\n      .check-element {\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n      it('should check ng-show / ng-hide', function() {\n        expect(thumbsUp.isDisplayed()).toBeFalsy();\n        expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n        element(by.model('checked')).click();\n\n        expect(thumbsUp.isDisplayed()).toBeTruthy();\n        expect(thumbsDown.isDisplayed()).toBeFalsy();\n      });\n    </file>\n  </example>\n */\nvar ngHideDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'A',\n    multiElement: true,\n    link: function(scope, element, attr) {\n      scope.$watch(attr.ngHide, function ngHideWatchAction(value) {\n        // The comment inside of the ngShowDirective explains why we add and\n        // remove a temporary class for the show/hide animation\n        $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {\n          tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n        });\n      });\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngStyle\n * @restrict AC\n *\n * @description\n * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.\n *\n * @element ANY\n * @param {expression} ngStyle\n *\n * {@link guide/expression Expression} which evals to an\n * object whose keys are CSS style names and values are corresponding values for those CSS\n * keys.\n *\n * Since some CSS style names are not valid keys for an object, they must be quoted.\n * See the 'background-color' style in the example below.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <input type=\"button\" value=\"set color\" ng-click=\"myStyle={color:'red'}\">\n        <input type=\"button\" value=\"set background\" ng-click=\"myStyle={'background-color':'blue'}\">\n        <input type=\"button\" value=\"clear\" ng-click=\"myStyle={}\">\n        <br/>\n        <span ng-style=\"myStyle\">Sample Text</span>\n        <pre>myStyle={{myStyle}}</pre>\n     </file>\n     <file name=\"style.css\">\n       span {\n         color: black;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var colorSpan = element(by.css('span'));\n\n       it('should check ng-style', function() {\n         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n         element(by.css('input[value=\\'set color\\']')).click();\n         expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');\n         element(by.css('input[value=clear]')).click();\n         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n       });\n     </file>\n   </example>\n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n  scope.$watchCollection(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {\n    if (oldStyles && (newStyles !== oldStyles)) {\n      forEach(oldStyles, function(val, style) { element.css(style, '');});\n    }\n    if (newStyles) element.css(newStyles);\n  });\n});\n\n/**\n * @ngdoc directive\n * @name ngSwitch\n * @restrict EA\n *\n * @description\n * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.\n * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location\n * as specified in the template.\n *\n * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it\n * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element\n * matches the value obtained from the evaluated expression. In other words, you define a container element\n * (where you place the directive), place an expression on the **`on=\"...\"` attribute**\n * (or the **`ng-switch=\"...\"` attribute**), define any inner elements inside of the directive and place\n * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on\n * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default\n * attribute is displayed.\n *\n * <div class=\"alert alert-info\">\n * Be aware that the attribute values to match against cannot be expressions. They are interpreted\n * as literal string values to match against.\n * For example, **`ng-switch-when=\"someVal\"`** will match against the string `\"someVal\"` not against the\n * value of the expression `$scope.someVal`.\n * </div>\n\n * @animations\n * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container\n * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM\n *\n * @usage\n *\n * ```\n * <ANY ng-switch=\"expression\">\n *   <ANY ng-switch-when=\"matchValue1\">...</ANY>\n *   <ANY ng-switch-when=\"matchValue2\">...</ANY>\n *   <ANY ng-switch-default>...</ANY>\n * </ANY>\n * ```\n *\n *\n * @scope\n * @priority 1200\n * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.\n * On child elements add:\n *\n * * `ngSwitchWhen`: the case statement to match against. If match then this\n *   case will be displayed. If the same match appears multiple times, all the\n *   elements will be displayed.\n * * `ngSwitchDefault`: the default case when no other case match. If there\n *   are multiple default cases, all of them will be displayed when no other\n *   case match.\n *\n *\n * @example\n  <example module=\"switchExample\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <select ng-model=\"selection\" ng-options=\"item for item in items\">\n        </select>\n        <tt>selection={{selection}}</tt>\n        <hr/>\n        <div class=\"animate-switch-container\"\n          ng-switch on=\"selection\">\n            <div class=\"animate-switch\" ng-switch-when=\"settings\">Settings Div</div>\n            <div class=\"animate-switch\" ng-switch-when=\"home\">Home Span</div>\n            <div class=\"animate-switch\" ng-switch-default>default</div>\n        </div>\n      </div>\n    </file>\n    <file name=\"script.js\">\n      angular.module('switchExample', ['ngAnimate'])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.items = ['settings', 'home', 'other'];\n          $scope.selection = $scope.items[0];\n        }]);\n    </file>\n    <file name=\"animations.css\">\n      .animate-switch-container {\n        position:relative;\n        background:white;\n        border:1px solid black;\n        height:40px;\n        overflow:hidden;\n      }\n\n      .animate-switch {\n        padding:10px;\n      }\n\n      .animate-switch.ng-animate {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n        position:absolute;\n        top:0;\n        left:0;\n        right:0;\n        bottom:0;\n      }\n\n      .animate-switch.ng-leave.ng-leave-active,\n      .animate-switch.ng-enter {\n        top:-50px;\n      }\n      .animate-switch.ng-leave,\n      .animate-switch.ng-enter.ng-enter-active {\n        top:0;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var switchElem = element(by.css('[ng-switch]'));\n      var select = element(by.model('selection'));\n\n      it('should start in settings', function() {\n        expect(switchElem.getText()).toMatch(/Settings Div/);\n      });\n      it('should change to home', function() {\n        select.all(by.css('option')).get(1).click();\n        expect(switchElem.getText()).toMatch(/Home Span/);\n      });\n      it('should select default', function() {\n        select.all(by.css('option')).get(2).click();\n        expect(switchElem.getText()).toMatch(/default/);\n      });\n    </file>\n  </example>\n */\nvar ngSwitchDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'EA',\n    require: 'ngSwitch',\n\n    // asks for $scope to fool the BC controller module\n    controller: ['$scope', function ngSwitchController() {\n     this.cases = {};\n    }],\n    link: function(scope, element, attr, ngSwitchController) {\n      var watchExpr = attr.ngSwitch || attr.on,\n          selectedTranscludes = [],\n          selectedElements = [],\n          previousLeaveAnimations = [],\n          selectedScopes = [];\n\n      var spliceFactory = function(array, index) {\n          return function() { array.splice(index, 1); };\n      };\n\n      scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n        var i, ii;\n        for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {\n          $animate.cancel(previousLeaveAnimations[i]);\n        }\n        previousLeaveAnimations.length = 0;\n\n        for (i = 0, ii = selectedScopes.length; i < ii; ++i) {\n          var selected = getBlockNodes(selectedElements[i].clone);\n          selectedScopes[i].$destroy();\n          var promise = previousLeaveAnimations[i] = $animate.leave(selected);\n          promise.then(spliceFactory(previousLeaveAnimations, i));\n        }\n\n        selectedElements.length = 0;\n        selectedScopes.length = 0;\n\n        if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n          forEach(selectedTranscludes, function(selectedTransclude) {\n            selectedTransclude.transclude(function(caseElement, selectedScope) {\n              selectedScopes.push(selectedScope);\n              var anchor = selectedTransclude.element;\n              caseElement[caseElement.length++] = document.createComment(' end ngSwitchWhen: ');\n              var block = { clone: caseElement };\n\n              selectedElements.push(block);\n              $animate.enter(caseElement, anchor.parent(), anchor);\n            });\n          });\n        }\n      });\n    }\n  };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n  transclude: 'element',\n  priority: 1200,\n  require: '^ngSwitch',\n  multiElement: true,\n  link: function(scope, element, attrs, ctrl, $transclude) {\n    ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);\n    ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });\n  }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n  transclude: 'element',\n  priority: 1200,\n  require: '^ngSwitch',\n  multiElement: true,\n  link: function(scope, element, attr, ctrl, $transclude) {\n    ctrl.cases['?'] = (ctrl.cases['?'] || []);\n    ctrl.cases['?'].push({ transclude: $transclude, element: element });\n   }\n});\n\n/**\n * @ngdoc directive\n * @name ngTransclude\n * @restrict EAC\n *\n * @description\n * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.\n *\n * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.\n *\n * @element ANY\n *\n * @example\n   <example module=\"transcludeExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('transcludeExample', [])\n          .directive('pane', function(){\n             return {\n               restrict: 'E',\n               transclude: true,\n               scope: { title:'@' },\n               template: '<div style=\"border: 1px solid black;\">' +\n                           '<div style=\"background-color: gray\">{{title}}</div>' +\n                           '<ng-transclude></ng-transclude>' +\n                         '</div>'\n             };\n         })\n         .controller('ExampleController', ['$scope', function($scope) {\n           $scope.title = 'Lorem Ipsum';\n           $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n         }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input ng-model=\"title\"> <br/>\n         <textarea ng-model=\"text\"></textarea> <br/>\n         <pane title=\"{{title}}\">{{text}}</pane>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n        it('should have transcluded', function() {\n          var titleElement = element(by.model('title'));\n          titleElement.clear();\n          titleElement.sendKeys('TITLE');\n          var textElement = element(by.model('text'));\n          textElement.clear();\n          textElement.sendKeys('TEXT');\n          expect(element(by.binding('title')).getText()).toEqual('TITLE');\n          expect(element(by.binding('text')).getText()).toEqual('TEXT');\n        });\n     </file>\n   </example>\n *\n */\nvar ngTranscludeDirective = ngDirective({\n  restrict: 'EAC',\n  link: function($scope, $element, $attrs, controller, $transclude) {\n    if (!$transclude) {\n      throw minErr('ngTransclude')('orphan',\n       'Illegal use of ngTransclude directive in the template! ' +\n       'No parent directive that requires a transclusion found. ' +\n       'Element: {0}',\n       startingTag($element));\n    }\n\n    $transclude(function(clone) {\n      $element.empty();\n      $element.append(clone);\n    });\n  }\n});\n\n/**\n * @ngdoc directive\n * @name script\n * @restrict E\n *\n * @description\n * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the\n * template can be used by {@link ng.directive:ngInclude `ngInclude`},\n * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the\n * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be\n * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.\n *\n * @param {string} type Must be set to `'text/ng-template'`.\n * @param {string} id Cache name of the template.\n *\n * @example\n  <example>\n    <file name=\"index.html\">\n      <script type=\"text/ng-template\" id=\"/tpl.html\">\n        Content of the template.\n      </script>\n\n      <a ng-click=\"currentTpl='/tpl.html'\" id=\"tpl-link\">Load inlined template</a>\n      <div id=\"tpl-content\" ng-include src=\"currentTpl\"></div>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      it('should load template defined inside script tag', function() {\n        element(by.css('#tpl-link')).click();\n        expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);\n      });\n    </file>\n  </example>\n */\nvar scriptDirective = ['$templateCache', function($templateCache) {\n  return {\n    restrict: 'E',\n    terminal: true,\n    compile: function(element, attr) {\n      if (attr.type == 'text/ng-template') {\n        var templateUrl = attr.id,\n            text = element[0].text;\n\n        $templateCache.put(templateUrl, text);\n      }\n    }\n  };\n}];\n\nvar ngOptionsMinErr = minErr('ngOptions');\n/**\n * @ngdoc directive\n * @name select\n * @restrict E\n *\n * @description\n * HTML `SELECT` element with angular data-binding.\n *\n * # `ngOptions`\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`\n * elements for the `<select>` element using the array or object obtained by evaluating the\n * `ngOptions` comprehension expression.\n *\n * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a\n * similar result. However, `ngOptions` provides some benefits such as reducing memory and\n * increasing speed by not creating a new scope for each repeated instance, as well as providing\n * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound\n *  to a non-string value. This is because an option element can only be bound to string values at\n * present.\n *\n * When an item in the `<select>` menu is selected, the array element or object property\n * represented by the selected option will be bound to the model identified by the `ngModel`\n * directive.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `ngModel` compares by reference, not value. This is important when binding to an\n * array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).\n * </div>\n *\n * ## `select` **`as`**\n *\n * Using `select` **`as`** will bind the result of the `select` expression to the model, but\n * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)\n * or property name (for object data sources) of the value within the collection. If a **`track by`** expression\n * is used, the result of that expression will be set as the value of the `option` and `select` elements.\n *\n *\n * ### `select` **`as`** and **`track by`**\n *\n * <div class=\"alert alert-warning\">\n * Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.\n * </div>\n *\n * Consider the following example:\n *\n * ```html\n * <select ng-options=\"item.subItem as item.label for item in values track by item.id\" ng-model=\"selected\">\n * ```\n *\n * ```js\n * $scope.values = [{\n *   id: 1,\n *   label: 'aLabel',\n *   subItem: { name: 'aSubItem' }\n * }, {\n *   id: 2,\n *   label: 'bLabel',\n *   subItem: { name: 'bSubItem' }\n * }];\n *\n * $scope.selected = { name: 'aSubItem' };\n * ```\n *\n * With the purpose of preserving the selection, the **`track by`** expression is always applied to the element\n * of the data source (to `item` in this example). To calculate whether an element is selected, we do the\n * following:\n *\n * 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`\n * 2. Apply **`track by`** to the already selected value in `ngModel`.\n *    In the example: this is not possible as **`track by`** refers to `item.id`, but the selected\n *    value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to\n *    a wrong object, the selected element can't be found, `<select>` is always reset to the \"not\n *    selected\" option.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required The control is considered valid only if value is entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n *    `required` when you want to data-bind to the `required` attribute.\n * @param {comprehension_expression=} ngOptions in one of the following forms:\n *\n *   * for array data sources:\n *     * `label` **`for`** `value` **`in`** `array`\n *     * `select` **`as`** `label` **`for`** `value` **`in`** `array`\n *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array`\n *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n *     * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`\n *        (for including a filter with `track by`)\n *   * for object data sources:\n *     * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n *     * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n *     * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`\n *     * `select` **`as`** `label` **`group by`** `group`\n *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n *\n * Where:\n *\n *   * `array` / `object`: an expression which evaluates to an array / object to iterate over.\n *   * `value`: local variable which will refer to each item in the `array` or each property value\n *      of `object` during iteration.\n *   * `key`: local variable which will refer to a property name in `object` during iteration.\n *   * `label`: The result of this expression will be the label for `<option>` element. The\n *     `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).\n *   * `select`: The result of this expression will be bound to the model of the parent `<select>`\n *      element. If not specified, `select` expression will default to `value`.\n *   * `group`: The result of this expression will be used to group options using the `<optgroup>`\n *      DOM element.\n *   * `trackexpr`: Used when working with an array of objects. The result of this expression will be\n *      used to identify the objects in the array. The `trackexpr` will most likely refer to the\n *     `value` variable (e.g. `value.propertyName`). With this the selection is preserved\n *      even when the options are recreated (e.g. reloaded from the server).\n *\n * @example\n    <example module=\"selectExample\">\n      <file name=\"index.html\">\n        <script>\n        angular.module('selectExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.colors = [\n              {name:'black', shade:'dark'},\n              {name:'white', shade:'light'},\n              {name:'red', shade:'dark'},\n              {name:'blue', shade:'dark'},\n              {name:'yellow', shade:'light'}\n            ];\n            $scope.myColor = $scope.colors[2]; // red\n          }]);\n        </script>\n        <div ng-controller=\"ExampleController\">\n          <ul>\n            <li ng-repeat=\"color in colors\">\n              Name: <input ng-model=\"color.name\">\n              [<a href ng-click=\"colors.splice($index, 1)\">X</a>]\n            </li>\n            <li>\n              [<a href ng-click=\"colors.push({})\">add</a>]\n            </li>\n          </ul>\n          <hr/>\n          Color (null not allowed):\n          <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\"></select><br>\n\n          Color (null allowed):\n          <span  class=\"nullable\">\n            <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\">\n              <option value=\"\">-- choose color --</option>\n            </select>\n          </span><br/>\n\n          Color grouped by shade:\n          <select ng-model=\"myColor\" ng-options=\"color.name group by color.shade for color in colors\">\n          </select><br/>\n\n\n          Select <a href ng-click=\"myColor = { name:'not in list', shade: 'other' }\">bogus</a>.<br>\n          <hr/>\n          Currently selected: {{ {selected_color:myColor} }}\n          <div style=\"border:solid 1px black; height:20px\"\n               ng-style=\"{'background-color':myColor.name}\">\n          </div>\n        </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n         it('should check ng-options', function() {\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');\n           element.all(by.model('myColor')).first().click();\n           element.all(by.css('select[ng-model=\"myColor\"] option')).first().click();\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');\n           element(by.css('.nullable select[ng-model=\"myColor\"]')).click();\n           element.all(by.css('.nullable select[ng-model=\"myColor\"] option')).first().click();\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');\n         });\n      </file>\n    </example>\n */\n\nvar ngOptionsDirective = valueFn({\n  restrict: 'A',\n  terminal: true\n});\n\n// jshint maxlen: false\nvar selectDirective = ['$compile', '$parse', function($compile,   $parse) {\n                         //000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888\n  var NG_OPTIONS_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+group\\s+by\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?$/,\n      nullModelCtrl = {$setViewValue: noop};\n// jshint maxlen: 100\n\n  return {\n    restrict: 'E',\n    require: ['select', '?ngModel'],\n    controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {\n      var self = this,\n          optionsMap = {},\n          ngModelCtrl = nullModelCtrl,\n          nullOption,\n          unknownOption;\n\n\n      self.databound = $attrs.ngModel;\n\n\n      self.init = function(ngModelCtrl_, nullOption_, unknownOption_) {\n        ngModelCtrl = ngModelCtrl_;\n        nullOption = nullOption_;\n        unknownOption = unknownOption_;\n      };\n\n\n      self.addOption = function(value, element) {\n        assertNotHasOwnProperty(value, '\"option value\"');\n        optionsMap[value] = true;\n\n        if (ngModelCtrl.$viewValue == value) {\n          $element.val(value);\n          if (unknownOption.parent()) unknownOption.remove();\n        }\n        // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459\n        // Adding an <option selected=\"selected\"> element to a <select required=\"required\"> should\n        // automatically select the new element\n        if (element && element[0].hasAttribute('selected')) {\n          element[0].selected = true;\n        }\n      };\n\n\n      self.removeOption = function(value) {\n        if (this.hasOption(value)) {\n          delete optionsMap[value];\n          if (ngModelCtrl.$viewValue === value) {\n            this.renderUnknownOption(value);\n          }\n        }\n      };\n\n\n      self.renderUnknownOption = function(val) {\n        var unknownVal = '? ' + hashKey(val) + ' ?';\n        unknownOption.val(unknownVal);\n        $element.prepend(unknownOption);\n        $element.val(unknownVal);\n        unknownOption.prop('selected', true); // needed for IE\n      };\n\n\n      self.hasOption = function(value) {\n        return optionsMap.hasOwnProperty(value);\n      };\n\n      $scope.$on('$destroy', function() {\n        // disable unknown option so that we don't do work when the whole select is being destroyed\n        self.renderUnknownOption = noop;\n      });\n    }],\n\n    link: function(scope, element, attr, ctrls) {\n      // if ngModel is not defined, we don't need to do anything\n      if (!ctrls[1]) return;\n\n      var selectCtrl = ctrls[0],\n          ngModelCtrl = ctrls[1],\n          multiple = attr.multiple,\n          optionsExp = attr.ngOptions,\n          nullOption = false, // if false, user will not be able to select it (used by ngOptions)\n          emptyOption,\n          renderScheduled = false,\n          // we can't just jqLite('<option>') since jqLite is not smart enough\n          // to create it in <select> and IE barfs otherwise.\n          optionTemplate = jqLite(document.createElement('option')),\n          optGroupTemplate =jqLite(document.createElement('optgroup')),\n          unknownOption = optionTemplate.clone();\n\n      // find \"null\" option\n      for (var i = 0, children = element.children(), ii = children.length; i < ii; i++) {\n        if (children[i].value === '') {\n          emptyOption = nullOption = children.eq(i);\n          break;\n        }\n      }\n\n      selectCtrl.init(ngModelCtrl, nullOption, unknownOption);\n\n      // required validator\n      if (multiple) {\n        ngModelCtrl.$isEmpty = function(value) {\n          return !value || value.length === 0;\n        };\n      }\n\n      if (optionsExp) setupAsOptions(scope, element, ngModelCtrl);\n      else if (multiple) setupAsMultiple(scope, element, ngModelCtrl);\n      else setupAsSingle(scope, element, ngModelCtrl, selectCtrl);\n\n\n      ////////////////////////////\n\n\n\n      function setupAsSingle(scope, selectElement, ngModelCtrl, selectCtrl) {\n        ngModelCtrl.$render = function() {\n          var viewValue = ngModelCtrl.$viewValue;\n\n          if (selectCtrl.hasOption(viewValue)) {\n            if (unknownOption.parent()) unknownOption.remove();\n            selectElement.val(viewValue);\n            if (viewValue === '') emptyOption.prop('selected', true); // to make IE9 happy\n          } else {\n            if (isUndefined(viewValue) && emptyOption) {\n              selectElement.val('');\n            } else {\n              selectCtrl.renderUnknownOption(viewValue);\n            }\n          }\n        };\n\n        selectElement.on('change', function() {\n          scope.$apply(function() {\n            if (unknownOption.parent()) unknownOption.remove();\n            ngModelCtrl.$setViewValue(selectElement.val());\n          });\n        });\n      }\n\n      function setupAsMultiple(scope, selectElement, ctrl) {\n        var lastView;\n        ctrl.$render = function() {\n          var items = new HashMap(ctrl.$viewValue);\n          forEach(selectElement.find('option'), function(option) {\n            option.selected = isDefined(items.get(option.value));\n          });\n        };\n\n        // we have to do it on each watch since ngModel watches reference, but\n        // we need to work of an array, so we need to see if anything was inserted/removed\n        scope.$watch(function selectMultipleWatch() {\n          if (!equals(lastView, ctrl.$viewValue)) {\n            lastView = shallowCopy(ctrl.$viewValue);\n            ctrl.$render();\n          }\n        });\n\n        selectElement.on('change', function() {\n          scope.$apply(function() {\n            var array = [];\n            forEach(selectElement.find('option'), function(option) {\n              if (option.selected) {\n                array.push(option.value);\n              }\n            });\n            ctrl.$setViewValue(array);\n          });\n        });\n      }\n\n      function setupAsOptions(scope, selectElement, ctrl) {\n        var match;\n\n        if (!(match = optionsExp.match(NG_OPTIONS_REGEXP))) {\n          throw ngOptionsMinErr('iexp',\n            \"Expected expression in form of \" +\n            \"'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'\" +\n            \" but got '{0}'. Element: {1}\",\n            optionsExp, startingTag(selectElement));\n        }\n\n        var displayFn = $parse(match[2] || match[1]),\n            valueName = match[4] || match[6],\n            selectAs = / as /.test(match[0]) && match[1],\n            selectAsFn = selectAs ? $parse(selectAs) : null,\n            keyName = match[5],\n            groupByFn = $parse(match[3] || ''),\n            valueFn = $parse(match[2] ? match[1] : valueName),\n            valuesFn = $parse(match[7]),\n            track = match[8],\n            trackFn = track ? $parse(match[8]) : null,\n            trackKeysCache = {},\n            // This is an array of array of existing option groups in DOM.\n            // We try to reuse these if possible\n            // - optionGroupsCache[0] is the options with no option group\n            // - optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element\n            optionGroupsCache = [[{element: selectElement, label:''}]],\n            //re-usable object to represent option's locals\n            locals = {};\n\n        if (nullOption) {\n          // compile the element since there might be bindings in it\n          $compile(nullOption)(scope);\n\n          // remove the class, which is added automatically because we recompile the element and it\n          // becomes the compilation root\n          nullOption.removeClass('ng-scope');\n\n          // we need to remove it before calling selectElement.empty() because otherwise IE will\n          // remove the label from the element. wtf?\n          nullOption.remove();\n        }\n\n        // clear contents, we'll add what's needed based on the model\n        selectElement.empty();\n\n        selectElement.on('change', selectionChanged);\n\n        ctrl.$render = render;\n\n        scope.$watchCollection(valuesFn, scheduleRendering);\n        scope.$watchCollection(getLabels, scheduleRendering);\n\n        if (multiple) {\n          scope.$watchCollection(function() { return ctrl.$modelValue; }, scheduleRendering);\n        }\n\n        // ------------------------------------------------------------------ //\n\n        function callExpression(exprFn, key, value) {\n          locals[valueName] = value;\n          if (keyName) locals[keyName] = key;\n          return exprFn(scope, locals);\n        }\n\n        function selectionChanged() {\n          scope.$apply(function() {\n            var collection = valuesFn(scope) || [];\n            var viewValue;\n            if (multiple) {\n              viewValue = [];\n              forEach(selectElement.val(), function(selectedKey) {\n                  selectedKey = trackFn ? trackKeysCache[selectedKey] : selectedKey;\n                viewValue.push(getViewValue(selectedKey, collection[selectedKey]));\n              });\n            } else {\n              var selectedKey = trackFn ? trackKeysCache[selectElement.val()] : selectElement.val();\n              viewValue = getViewValue(selectedKey, collection[selectedKey]);\n            }\n            ctrl.$setViewValue(viewValue);\n            render();\n          });\n        }\n\n        function getViewValue(key, value) {\n          if (key === '?') {\n            return undefined;\n          } else if (key === '') {\n            return null;\n          } else {\n            var viewValueFn = selectAsFn ? selectAsFn : valueFn;\n            return callExpression(viewValueFn, key, value);\n          }\n        }\n\n        function getLabels() {\n          var values = valuesFn(scope);\n          var toDisplay;\n          if (values && isArray(values)) {\n            toDisplay = new Array(values.length);\n            for (var i = 0, ii = values.length; i < ii; i++) {\n              toDisplay[i] = callExpression(displayFn, i, values[i]);\n            }\n            return toDisplay;\n          } else if (values) {\n            // TODO: Add a test for this case\n            toDisplay = {};\n            for (var prop in values) {\n              if (values.hasOwnProperty(prop)) {\n                toDisplay[prop] = callExpression(displayFn, prop, values[prop]);\n              }\n            }\n          }\n          return toDisplay;\n        }\n\n        function createIsSelectedFn(viewValue) {\n          var selectedSet;\n          if (multiple) {\n            if (trackFn && isArray(viewValue)) {\n\n              selectedSet = new HashMap([]);\n              for (var trackIndex = 0; trackIndex < viewValue.length; trackIndex++) {\n                // tracking by key\n                selectedSet.put(callExpression(trackFn, null, viewValue[trackIndex]), true);\n              }\n            } else {\n              selectedSet = new HashMap(viewValue);\n            }\n          } else if (trackFn) {\n            viewValue = callExpression(trackFn, null, viewValue);\n          }\n\n          return function isSelected(key, value) {\n            var compareValueFn;\n            if (trackFn) {\n              compareValueFn = trackFn;\n            } else if (selectAsFn) {\n              compareValueFn = selectAsFn;\n            } else {\n              compareValueFn = valueFn;\n            }\n\n            if (multiple) {\n              return isDefined(selectedSet.remove(callExpression(compareValueFn, key, value)));\n            } else {\n              return viewValue === callExpression(compareValueFn, key, value);\n            }\n          };\n        }\n\n        function scheduleRendering() {\n          if (!renderScheduled) {\n            scope.$$postDigest(render);\n            renderScheduled = true;\n          }\n        }\n\n        /**\n         * A new labelMap is created with each render.\n         * This function is called for each existing option with added=false,\n         * and each new option with added=true.\n         * - Labels that are passed to this method twice,\n         * (once with added=true and once with added=false) will end up with a value of 0, and\n         * will cause no change to happen to the corresponding option.\n         * - Labels that are passed to this method only once with added=false will end up with a\n         * value of -1 and will eventually be passed to selectCtrl.removeOption()\n         * - Labels that are passed to this method only once with added=true will end up with a\n         * value of 1 and will eventually be passed to selectCtrl.addOption()\n        */\n        function updateLabelMap(labelMap, label, added) {\n          labelMap[label] = labelMap[label] || 0;\n          labelMap[label] += (added ? 1 : -1);\n        }\n\n        function render() {\n          renderScheduled = false;\n\n          // Temporary location for the option groups before we render them\n          var optionGroups = {'':[]},\n              optionGroupNames = [''],\n              optionGroupName,\n              optionGroup,\n              option,\n              existingParent, existingOptions, existingOption,\n              viewValue = ctrl.$viewValue,\n              values = valuesFn(scope) || [],\n              keys = keyName ? sortedKeys(values) : values,\n              key,\n              value,\n              groupLength, length,\n              groupIndex, index,\n              labelMap = {},\n              selected,\n              isSelected = createIsSelectedFn(viewValue),\n              anySelected = false,\n              lastElement,\n              element,\n              label,\n              optionId;\n\n          trackKeysCache = {};\n\n          // We now build up the list of options we need (we merge later)\n          for (index = 0; length = keys.length, index < length; index++) {\n            key = index;\n            if (keyName) {\n              key = keys[index];\n              if (key.charAt(0) === '$') continue;\n            }\n            value = values[key];\n\n            optionGroupName = callExpression(groupByFn, key, value) || '';\n            if (!(optionGroup = optionGroups[optionGroupName])) {\n              optionGroup = optionGroups[optionGroupName] = [];\n              optionGroupNames.push(optionGroupName);\n            }\n\n            selected = isSelected(key, value);\n            anySelected = anySelected || selected;\n\n            label = callExpression(displayFn, key, value); // what will be seen by the user\n\n            // doing displayFn(scope, locals) || '' overwrites zero values\n            label = isDefined(label) ? label : '';\n            optionId = trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index);\n            if (trackFn) {\n              trackKeysCache[optionId] = key;\n            }\n\n            optionGroup.push({\n              // either the index into array or key from object\n              id: optionId,\n              label: label,\n              selected: selected                   // determine if we should be selected\n            });\n          }\n          if (!multiple) {\n            if (nullOption || viewValue === null) {\n              // insert null option if we have a placeholder, or the model is null\n              optionGroups[''].unshift({id:'', label:'', selected:!anySelected});\n            } else if (!anySelected) {\n              // option could not be found, we have to insert the undefined item\n              optionGroups[''].unshift({id:'?', label:'', selected:true});\n            }\n          }\n\n          // Now we need to update the list of DOM nodes to match the optionGroups we computed above\n          for (groupIndex = 0, groupLength = optionGroupNames.length;\n               groupIndex < groupLength;\n               groupIndex++) {\n            // current option group name or '' if no group\n            optionGroupName = optionGroupNames[groupIndex];\n\n            // list of options for that group. (first item has the parent)\n            optionGroup = optionGroups[optionGroupName];\n\n            if (optionGroupsCache.length <= groupIndex) {\n              // we need to grow the optionGroups\n              existingParent = {\n                element: optGroupTemplate.clone().attr('label', optionGroupName),\n                label: optionGroup.label\n              };\n              existingOptions = [existingParent];\n              optionGroupsCache.push(existingOptions);\n              selectElement.append(existingParent.element);\n            } else {\n              existingOptions = optionGroupsCache[groupIndex];\n              existingParent = existingOptions[0];  // either SELECT (no group) or OPTGROUP element\n\n              // update the OPTGROUP label if not the same.\n              if (existingParent.label != optionGroupName) {\n                existingParent.element.attr('label', existingParent.label = optionGroupName);\n              }\n            }\n\n            lastElement = null;  // start at the beginning\n            for (index = 0, length = optionGroup.length; index < length; index++) {\n              option = optionGroup[index];\n              if ((existingOption = existingOptions[index + 1])) {\n                // reuse elements\n                lastElement = existingOption.element;\n                if (existingOption.label !== option.label) {\n                  updateLabelMap(labelMap, existingOption.label, false);\n                  updateLabelMap(labelMap, option.label, true);\n                  lastElement.text(existingOption.label = option.label);\n                  lastElement.prop('label', existingOption.label);\n                }\n                if (existingOption.id !== option.id) {\n                  lastElement.val(existingOption.id = option.id);\n                }\n                // lastElement.prop('selected') provided by jQuery has side-effects\n                if (lastElement[0].selected !== option.selected) {\n                  lastElement.prop('selected', (existingOption.selected = option.selected));\n                  if (msie) {\n                    // See #7692\n                    // The selected item wouldn't visually update on IE without this.\n                    // Tested on Win7: IE9, IE10 and IE11. Future IEs should be tested as well\n                    lastElement.prop('selected', existingOption.selected);\n                  }\n                }\n              } else {\n                // grow elements\n\n                // if it's a null option\n                if (option.id === '' && nullOption) {\n                  // put back the pre-compiled element\n                  element = nullOption;\n                } else {\n                  // jQuery(v1.4.2) Bug: We should be able to chain the method calls, but\n                  // in this version of jQuery on some browser the .text() returns a string\n                  // rather then the element.\n                  (element = optionTemplate.clone())\n                      .val(option.id)\n                      .prop('selected', option.selected)\n                      .attr('selected', option.selected)\n                      .prop('label', option.label)\n                      .text(option.label);\n                }\n\n                existingOptions.push(existingOption = {\n                    element: element,\n                    label: option.label,\n                    id: option.id,\n                    selected: option.selected\n                });\n                updateLabelMap(labelMap, option.label, true);\n                if (lastElement) {\n                  lastElement.after(element);\n                } else {\n                  existingParent.element.append(element);\n                }\n                lastElement = element;\n              }\n            }\n            // remove any excessive OPTIONs in a group\n            index++; // increment since the existingOptions[0] is parent element not OPTION\n            while (existingOptions.length > index) {\n              option = existingOptions.pop();\n              updateLabelMap(labelMap, option.label, false);\n              option.element.remove();\n            }\n          }\n          // remove any excessive OPTGROUPs from select\n          while (optionGroupsCache.length > groupIndex) {\n            // remove all the labels in the option group\n            optionGroup = optionGroupsCache.pop();\n            for (index = 1; index < optionGroup.length; ++index) {\n              updateLabelMap(labelMap, optionGroup[index].label, false);\n            }\n            optionGroup[0].element.remove();\n          }\n          forEach(labelMap, function(count, label) {\n            if (count > 0) {\n              selectCtrl.addOption(label);\n            } else if (count < 0) {\n              selectCtrl.removeOption(label);\n            }\n          });\n        }\n      }\n    }\n  };\n}];\n\nvar optionDirective = ['$interpolate', function($interpolate) {\n  var nullSelectCtrl = {\n    addOption: noop,\n    removeOption: noop\n  };\n\n  return {\n    restrict: 'E',\n    priority: 100,\n    compile: function(element, attr) {\n      if (isUndefined(attr.value)) {\n        var interpolateFn = $interpolate(element.text(), true);\n        if (!interpolateFn) {\n          attr.$set('value', element.text());\n        }\n      }\n\n      return function(scope, element, attr) {\n        var selectCtrlName = '$selectController',\n            parent = element.parent(),\n            selectCtrl = parent.data(selectCtrlName) ||\n              parent.parent().data(selectCtrlName); // in case we are in optgroup\n\n        if (!selectCtrl || !selectCtrl.databound) {\n          selectCtrl = nullSelectCtrl;\n        }\n\n        if (interpolateFn) {\n          scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {\n            attr.$set('value', newVal);\n            if (oldVal !== newVal) {\n              selectCtrl.removeOption(oldVal);\n            }\n            selectCtrl.addOption(newVal, element);\n          });\n        } else {\n          selectCtrl.addOption(attr.value, element);\n        }\n\n        element.on('$destroy', function() {\n          selectCtrl.removeOption(attr.value);\n        });\n      };\n    }\n  };\n}];\n\nvar styleDirective = valueFn({\n  restrict: 'E',\n  terminal: false\n});\n\nvar requiredDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n      attr.required = true; // force truthy in case we are on non input element\n\n      ctrl.$validators.required = function(modelValue, viewValue) {\n        return !attr.required || !ctrl.$isEmpty(viewValue);\n      };\n\n      attr.$observe('required', function() {\n        ctrl.$validate();\n      });\n    }\n  };\n};\n\n\nvar patternDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var regexp, patternExp = attr.ngPattern || attr.pattern;\n      attr.$observe('pattern', function(regex) {\n        if (isString(regex) && regex.length > 0) {\n          regex = new RegExp('^' + regex + '$');\n        }\n\n        if (regex && !regex.test) {\n          throw minErr('ngPattern')('noregexp',\n            'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,\n            regex, startingTag(elm));\n        }\n\n        regexp = regex || undefined;\n        ctrl.$validate();\n      });\n\n      ctrl.$validators.pattern = function(value) {\n        return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);\n      };\n    }\n  };\n};\n\n\nvar maxlengthDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var maxlength = -1;\n      attr.$observe('maxlength', function(value) {\n        var intVal = int(value);\n        maxlength = isNaN(intVal) ? -1 : intVal;\n        ctrl.$validate();\n      });\n      ctrl.$validators.maxlength = function(modelValue, viewValue) {\n        return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);\n      };\n    }\n  };\n};\n\nvar minlengthDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var minlength = 0;\n      attr.$observe('minlength', function(value) {\n        minlength = int(value) || 0;\n        ctrl.$validate();\n      });\n      ctrl.$validators.minlength = function(modelValue, viewValue) {\n        return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;\n      };\n    }\n  };\n};\n\n  if (window.angular.bootstrap) {\n    //AngularJS is already loaded, so we can return here...\n    console.log('WARNING: Tried to load angular more than once.');\n    return;\n  }\n\n  //try to bind to jquery now so that one can write jqLite(document).ready()\n  //but we will rebind on bootstrap again.\n  bindJQuery();\n\n  publishExternalAPI(angular);\n\n  jqLite(document).ready(function() {\n    angularInit(document, bootstrap);\n  });\n\n})(window, document);\n\n!window.angular.$$csp() && window.angular.element(document).find('head').prepend('<style type=\"text/css\">@charset \"UTF-8\";[ng\\\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\\\:form{display:block;}</style>');"
  },
  {
    "path": "www/lib/angular/bower.json",
    "content": "{\n  \"name\": \"angular\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n  }\n}\n"
  },
  {
    "path": "www/lib/angular/package.json",
    "content": "{\n  \"name\": \"angular\",\n  \"version\": \"1.3.13\",\n  \"description\": \"HTML enhanced for web apps\",\n  \"main\": \"angular.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/angular/angular.js.git\"\n  },\n  \"keywords\": [\n    \"angular\",\n    \"framework\",\n    \"browser\",\n    \"client-side\"\n  ],\n  \"author\": \"Angular Core Team <angular-core+npm@google.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/angular/angular.js/issues\"\n  },\n  \"homepage\": \"http://angularjs.org\"\n}\n"
  },
  {
    "path": "www/lib/angular-animate/.bower.json",
    "content": "{\n  \"name\": \"angular-animate\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular-animate.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.13\"\n  },\n  \"homepage\": \"https://github.com/angular/bower-angular-animate\",\n  \"_release\": \"1.3.13\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v1.3.13\",\n    \"commit\": \"f18cb98590471ad9c1e5ae0e57178e9ecb8d384c\"\n  },\n  \"_source\": \"git://github.com/angular/bower-angular-animate.git\",\n  \"_target\": \"1.3.13\",\n  \"_originalSource\": \"angular-animate\"\n}"
  },
  {
    "path": "www/lib/angular-animate/README.md",
    "content": "# packaged angular-animate\n\nThis repo is for distribution on `npm` and `bower`. The source for this module is in the\n[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).\nPlease file issues and pull requests against that repo.\n\n## Install\n\nYou can install this package either with `npm` or with `bower`.\n\n### npm\n\n```shell\nnpm install angular-animate\n```\n\nAdd a `<script>` to your `index.html`:\n\n```html\n<script src=\"/node_modules/angular-animate/angular-animate.js\"></script>\n```\n\nThen add `ngAnimate` as a dependency for your app:\n\n```javascript\nangular.module('myApp', ['ngAnimate']);\n```\n\nNote that this package is not in CommonJS format, so doing `require('angular-animate')` will\nreturn `undefined`.\n\n### bower\n\n```shell\nbower install angular-animate\n```\n\nThen add a `<script>` to your `index.html`:\n\n```html\n<script src=\"/bower_components/angular-animate/angular-animate.js\"></script>\n```\n\nThen add `ngAnimate` as a dependency for your app:\n\n```javascript\nangular.module('myApp', ['ngAnimate']);\n```\n\n## Documentation\n\nDocumentation is available on the\n[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).\n\n## License\n\nThe MIT License\n\nCopyright (c) 2010-2012 Google, Inc. http://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": "www/lib/angular-animate/angular-animate.js",
    "content": "/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* jshint maxlen: false */\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for JavaScript, CSS3 transition and CSS3 keyframe animation hooks within existing core and custom directives.\n *\n * <div doc-module-components=\"ngAnimate\"></div>\n *\n * # Usage\n *\n * To see animations in action, all that is required is to define the appropriate CSS classes\n * or to register a JavaScript animation via the `myModule.animation()` function. The directives that support animation automatically are:\n * `ngRepeat`, `ngInclude`, `ngIf`, `ngSwitch`, `ngShow`, `ngHide`, `ngView` and `ngClass`. Custom directives can take advantage of animation\n * by using the `$animate` service.\n *\n * Below is a more detailed breakdown of the supported animation events provided by pre-existing ng directives:\n *\n * | Directive                                                                                                | Supported Animations                                                     |\n * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n * | {@link ng.directive:ngRepeat#animations ngRepeat}                                                        | enter, leave and move                                                    |\n * | {@link ngRoute.directive:ngView#animations ngView}                                                       | enter and leave                                                          |\n * | {@link ng.directive:ngInclude#animations ngInclude}                                                      | enter and leave                                                          |\n * | {@link ng.directive:ngSwitch#animations ngSwitch}                                                        | enter and leave                                                          |\n * | {@link ng.directive:ngIf#animations ngIf}                                                                | enter and leave                                                          |\n * | {@link ng.directive:ngClass#animations ngClass}                                                          | add and remove (the CSS class(es) present)                               |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide}            | add and remove (the ng-hide class value)                                 |\n * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel}    | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages}                                                          | add and remove (ng-active & ng-inactive)                                 |\n * | {@link module:ngMessages#animations ngMessage}                                                           | enter and leave                                                          |\n *\n * You can find out more information about animations upon visiting each directive page.\n *\n * Below is an example of how to apply animations to a directive that supports animation hooks:\n *\n * ```html\n * <style type=\"text/css\">\n * .slide.ng-enter, .slide.ng-leave {\n *   -webkit-transition:0.5s linear all;\n *   transition:0.5s linear all;\n * }\n *\n * .slide.ng-enter { }        /&#42; starting animations for enter &#42;/\n * .slide.ng-enter.ng-enter-active { } /&#42; terminal animations for enter &#42;/\n * .slide.ng-leave { }        /&#42; starting animations for leave &#42;/\n * .slide.ng-leave.ng-leave-active { } /&#42; terminal animations for leave &#42;/\n * </style>\n *\n * <!--\n * the animate service will automatically add .ng-enter and .ng-leave to the element\n * to trigger the CSS transition/animations\n * -->\n * <ANY class=\"slide\" ng-include=\"...\"></ANY>\n * ```\n *\n * Keep in mind that, by default, if an animation is running, any child elements cannot be animated\n * until the parent element's animation has completed. This blocking feature can be overridden by\n * placing the `ng-animate-children` attribute on a parent container tag.\n *\n * ```html\n * <div class=\"slide-animation\" ng-if=\"on\" ng-animate-children>\n *   <div class=\"fade-animation\" ng-if=\"on\">\n *     <div class=\"explode-animation\" ng-if=\"on\">\n *        ...\n *     </div>\n *   </div>\n * </div>\n * ```\n *\n * When the `on` expression value changes and an animation is triggered then each of the elements within\n * will all animate without the block being applied to child elements.\n *\n * ## Are animations run when the application starts?\n * No they are not. When an application is bootstrapped Angular will disable animations from running to avoid\n * a frenzy of animations from being triggered as soon as the browser has rendered the screen. For this to work,\n * Angular will wait for two digest cycles until enabling animations. From there on, any animation-triggering\n * layout changes in the application will trigger animations as normal.\n *\n * In addition, upon bootstrap, if the routing system or any directives or load remote data (via $http) then Angular\n * will automatically extend the wait time to enable animations once **all** of the outbound HTTP requests\n * are complete.\n *\n * ## CSS-defined Animations\n * The animate service will automatically apply two CSS classes to the animated element and these two CSS classes\n * are designed to contain the start and end CSS styling. Both CSS transitions and keyframe animations are supported\n * and can be used to play along with this naming structure.\n *\n * The following code below demonstrates how to perform animations using **CSS transitions** with Angular:\n *\n * ```html\n * <style type=\"text/css\">\n * /&#42;\n *  The animate class is apart of the element and the ng-enter class\n *  is attached to the element once the enter animation event is triggered\n * &#42;/\n * .reveal-animation.ng-enter {\n *  -webkit-transition: 1s linear all; /&#42; Safari/Chrome &#42;/\n *  transition: 1s linear all; /&#42; All other modern browsers and IE10+ &#42;/\n *\n *  /&#42; The animation preparation code &#42;/\n *  opacity: 0;\n * }\n *\n * /&#42;\n *  Keep in mind that you want to combine both CSS\n *  classes together to avoid any CSS-specificity\n *  conflicts\n * &#42;/\n * .reveal-animation.ng-enter.ng-enter-active {\n *  /&#42; The animation code itself &#42;/\n *  opacity: 1;\n * }\n * </style>\n *\n * <div class=\"view-container\">\n *   <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * ```\n *\n * The following code below demonstrates how to perform animations using **CSS animations** with Angular:\n *\n * ```html\n * <style type=\"text/css\">\n * .reveal-animation.ng-enter {\n *   -webkit-animation: enter_sequence 1s linear; /&#42; Safari/Chrome &#42;/\n *   animation: enter_sequence 1s linear; /&#42; IE10+ and Future Browsers &#42;/\n * }\n * @-webkit-keyframes enter_sequence {\n *   from { opacity:0; }\n *   to { opacity:1; }\n * }\n * @keyframes enter_sequence {\n *   from { opacity:0; }\n *   to { opacity:1; }\n * }\n * </style>\n *\n * <div class=\"view-container\">\n *   <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * ```\n *\n * Both CSS3 animations and transitions can be used together and the animate service will figure out the correct duration and delay timing.\n *\n * Upon DOM mutation, the event class is added first (something like `ng-enter`), then the browser prepares itself to add\n * the active class (in this case `ng-enter-active`) which then triggers the animation. The animation module will automatically\n * detect the CSS code to determine when the animation ends. Once the animation is over then both CSS classes will be\n * removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end\n * immediately resulting in a DOM element that is at its final state. This final state is when the DOM element\n * has no CSS transition/animation classes applied to it.\n *\n * ### Structural transition animations\n *\n * Structural transitions (such as enter, leave and move) will always apply a `0s none` transition\n * value to force the browser into rendering the styles defined in the setup (`.ng-enter`, `.ng-leave`\n * or `.ng-move`) class. This means that any active transition animations operating on the element\n * will be cut off to make way for the enter, leave or move animation.\n *\n * ### Class-based transition animations\n *\n * Class-based transitions refer to transition animations that are triggered when a CSS class is\n * added to or removed from the element (via `$animate.addClass`, `$animate.removeClass`,\n * `$animate.setClass`, or by directives such as `ngClass`, `ngModel` and `form`).\n * They are different when compared to structural animations since they **do not cancel existing\n * animations** nor do they **block successive transitions** from rendering on the same element.\n * This distinction allows for **multiple class-based transitions** to be performed on the same element.\n *\n * In addition to ngAnimate supporting the default (natural) functionality of class-based transition\n * animations, ngAnimate also decorates the element with starting and ending CSS classes to aid the\n * developer in further styling the element throughout the transition animation. Earlier versions\n * of ngAnimate may have caused natural CSS transitions to break and not render properly due to\n * $animate temporarily blocking transitions using `0s none` in order to allow the setup CSS class\n * (the `-add` or `-remove` class) to be applied without triggering an animation. However, as of\n * **version 1.3**, this workaround has been removed with ngAnimate and all non-ngAnimate CSS\n * class transitions are compatible with ngAnimate.\n *\n * There is, however, one special case when dealing with class-based transitions in ngAnimate.\n * When rendering class-based transitions that make use of the setup and active CSS classes\n * (e.g. `.fade-add` and `.fade-add-active` for when `.fade` is added) be sure to define\n * the transition value **on the active CSS class** and not the setup class.\n *\n * ```css\n * .fade-add {\n *   /&#42; remember to place a 0s transition here\n *      to ensure that the styles are applied instantly\n *      even if the element already has a transition style &#42;/\n *   transition:0s linear all;\n *\n *   /&#42; starting CSS styles &#42;/\n *   opacity:1;\n * }\n * .fade-add.fade-add-active {\n *   /&#42; this will be the length of the animation &#42;/\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * The setup CSS class (in this case `.fade-add`) also has a transition style property, however, it\n * has a duration of zero. This may not be required, however, incase the browser is unable to render\n * the styling present in this CSS class instantly then it could be that the browser is attempting\n * to perform an unnecessary transition.\n *\n * This workaround, however, does not apply to  standard class-based transitions that are rendered\n * when a CSS class containing a transition is applied to an element:\n *\n * ```css\n * /&#42; this works as expected &#42;/\n * .fade {\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * Please keep this in mind when coding the CSS markup that will be used within class-based transitions.\n * Also, try not to mix the two class-based animation flavors together since the CSS code may become\n * overly complex.\n *\n *\n * ### Preventing Collisions With Third Party Libraries\n *\n * Some third-party frameworks place animation duration defaults across many element or className\n * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which\n * is expecting actual animations on these elements and has to wait for their completion.\n *\n * You can prevent this unwanted behavior by using a prefix on all your animation classes:\n *\n * ```css\n * /&#42; prefixed with animate- &#42;/\n * .animate-fade-add.animate-fade-add-active {\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * You then configure `$animate` to enforce this prefix:\n *\n * ```js\n * $animateProvider.classNameFilter(/animate-/);\n * ```\n * </div>\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n *   /&#42; standard transition code &#42;/\n *   -webkit-transition: 1s linear all;\n *   transition: 1s linear all;\n *   opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n *   /&#42; this will have a 100ms delay between each successive leave animation &#42;/\n *   -webkit-transition-delay: 0.1s;\n *   transition-delay: 0.1s;\n *\n *   /&#42; in case the stagger doesn't work then these two values\n *    must be set to 0 to avoid an accidental CSS inheritance &#42;/\n *   -webkit-transition-duration: 0s;\n *   transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n *   /&#42; standard transition styles &#42;/\n *   opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if more than 10ms has passed after the last animation has been fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * $timeout(function() {\n *   //stagger has reset itself\n *   $animate.leave(kids[5]); //stagger index=0\n *   $animate.leave(kids[6]); //stagger index=1\n * }, 100, false);\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ## JavaScript-defined Animations\n * In the event that you do not want to use CSS3 transitions or CSS3 animations or if you wish to offer animations on browsers that do not\n * yet support CSS transitions/animations, then you can make use of JavaScript animations defined inside of your AngularJS module.\n *\n * ```js\n * //!annotate=\"YourApp\" Your AngularJS Module|Replace this or ngModule with the module that you used to define your application.\n * var ngModule = angular.module('YourApp', ['ngAnimate']);\n * ngModule.animation('.my-crazy-animation', function() {\n *   return {\n *     enter: function(element, done) {\n *       //run the animation here and call done when the animation is complete\n *       return function(cancelled) {\n *         //this (optional) function will be called when the animation\n *         //completes or when the animation is cancelled (the cancelled\n *         //flag will be set to true if cancelled).\n *       };\n *     },\n *     leave: function(element, done) { },\n *     move: function(element, done) { },\n *\n *     //animation that can be triggered before the class is added\n *     beforeAddClass: function(element, className, done) { },\n *\n *     //animation that can be triggered after the class is added\n *     addClass: function(element, className, done) { },\n *\n *     //animation that can be triggered before the class is removed\n *     beforeRemoveClass: function(element, className, done) { },\n *\n *     //animation that can be triggered after the class is removed\n *     removeClass: function(element, className, done) { }\n *   };\n * });\n * ```\n *\n * JavaScript-defined animations are created with a CSS-like class selector and a collection of events which are set to run\n * a javascript callback function. When an animation is triggered, $animate will look for a matching animation which fits\n * the element's CSS class attribute value and then run the matching animation event function (if found).\n * In other words, if the CSS classes present on the animated element match any of the JavaScript animations then the callback function will\n * be executed. It should be also noted that only simple, single class selectors are allowed (compound class selectors are not supported).\n *\n * Within a JavaScript animation, an object containing various event callback animation functions is expected to be returned.\n * As explained above, these callbacks are triggered based on the animation event. Therefore if an enter animation is run,\n * and the JavaScript animation is found, then the enter callback will handle that animation (in addition to the CSS keyframe animation\n * or transition code that is defined via a stylesheet).\n *\n *\n * ### Applying Directive-specific Styles to an Animation\n * In some cases a directive or service may want to provide `$animate` with extra details that the animation will\n * include into its animation. Let's say for example we wanted to render an animation that animates an element\n * towards the mouse coordinates as to where the user clicked last. By collecting the X/Y coordinates of the click\n * (via the event parameter) we can set the `top` and `left` styles into an object and pass that into our function\n * call to `$animate.addClass`.\n *\n * ```js\n * canvas.on('click', function(e) {\n *   $animate.addClass(element, 'on', {\n *     to: {\n *       left : e.client.x + 'px',\n *       top : e.client.y + 'px'\n *     }\n *   }):\n * });\n * ```\n *\n * Now when the animation runs, and a transition or keyframe animation is picked up, then the animation itself will\n * also include and transition the styling of the `left` and `top` properties into its running animation. If we want\n * to provide some starting animation values then we can do so by placing the starting animations styles into an object\n * called `from` in the same object as the `to` animations.\n *\n * ```js\n * canvas.on('click', function(e) {\n *   $animate.addClass(element, 'on', {\n *     from: {\n *        position: 'absolute',\n *        left: '0px',\n *        top: '0px'\n *     },\n *     to: {\n *       left : e.client.x + 'px',\n *       top : e.client.y + 'px'\n *     }\n *   }):\n * });\n * ```\n *\n * Once the animation is complete or cancelled then the union of both the before and after styles are applied to the\n * element. If `ngAnimate` is not present then the styles will be applied immediately.\n *\n */\n\nangular.module('ngAnimate', ['ng'])\n\n  /**\n   * @ngdoc provider\n   * @name $animateProvider\n   * @description\n   *\n   * The `$animateProvider` allows developers to register JavaScript animation event handlers directly inside of a module.\n   * When an animation is triggered, the $animate service will query the $animate service to find any animations that match\n   * the provided name value.\n   *\n   * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n   *\n   * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n   *\n   */\n  .directive('ngAnimateChildren', function() {\n    var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren';\n    return function(scope, element, attrs) {\n      var val = attrs.ngAnimateChildren;\n      if (angular.isString(val) && val.length === 0) { //empty attribute\n        element.data(NG_ANIMATE_CHILDREN, true);\n      } else {\n        scope.$watch(val, function(value) {\n          element.data(NG_ANIMATE_CHILDREN, !!value);\n        });\n      }\n    };\n  })\n\n  //this private service is only used within CSS-enabled animations\n  //IE8 + IE9 do not support rAF natively, but that is fine since they\n  //also don't support transitions and keyframes which means that the code\n  //below will never be used by the two browsers.\n  .factory('$$animateReflow', ['$$rAF', '$document', function($$rAF, $document) {\n    var bod = $document[0].body;\n    return function(fn) {\n      //the returned function acts as the cancellation function\n      return $$rAF(function() {\n        //the line below will force the browser to perform a repaint\n        //so that all the animated elements within the animation frame\n        //will be properly updated and drawn on screen. This is\n        //required to perform multi-class CSS based animations with\n        //Firefox. DO NOT REMOVE THIS LINE.\n        var a = bod.offsetWidth + 1;\n        fn();\n      });\n    };\n  }])\n\n  .config(['$provide', '$animateProvider', function($provide, $animateProvider) {\n    var noop = angular.noop;\n    var forEach = angular.forEach;\n    var selectors = $animateProvider.$$selectors;\n    var isArray = angular.isArray;\n    var isString = angular.isString;\n    var isObject = angular.isObject;\n\n    var ELEMENT_NODE = 1;\n    var NG_ANIMATE_STATE = '$$ngAnimateState';\n    var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren';\n    var NG_ANIMATE_CLASS_NAME = 'ng-animate';\n    var rootAnimateState = {running: true};\n\n    function extractElementNode(element) {\n      for (var i = 0; i < element.length; i++) {\n        var elm = element[i];\n        if (elm.nodeType == ELEMENT_NODE) {\n          return elm;\n        }\n      }\n    }\n\n    function prepareElement(element) {\n      return element && angular.element(element);\n    }\n\n    function stripCommentsFromElement(element) {\n      return angular.element(extractElementNode(element));\n    }\n\n    function isMatchingElement(elm1, elm2) {\n      return extractElementNode(elm1) == extractElementNode(elm2);\n    }\n    var $$jqLite;\n    $provide.decorator('$animate',\n        ['$delegate', '$$q', '$injector', '$sniffer', '$rootElement', '$$asyncCallback', '$rootScope', '$document', '$templateRequest', '$$jqLite',\n function($delegate,   $$q,   $injector,   $sniffer,   $rootElement,   $$asyncCallback,   $rootScope,   $document,   $templateRequest,   $$$jqLite) {\n\n      $$jqLite = $$$jqLite;\n      $rootElement.data(NG_ANIMATE_STATE, rootAnimateState);\n\n      // Wait until all directive and route-related templates are downloaded and\n      // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n      // all of the remote templates being currently downloaded. If there are no\n      // templates currently downloading then the watcher will still fire anyway.\n      var deregisterWatch = $rootScope.$watch(\n        function() { return $templateRequest.totalPendingRequests; },\n        function(val, oldVal) {\n          if (val !== 0) return;\n          deregisterWatch();\n\n          // Now that all templates have been downloaded, $animate will wait until\n          // the post digest queue is empty before enabling animations. By having two\n          // calls to $postDigest calls we can ensure that the flag is enabled at the\n          // very end of the post digest queue. Since all of the animations in $animate\n          // use $postDigest, it's important that the code below executes at the end.\n          // This basically means that the page is fully downloaded and compiled before\n          // any animations are triggered.\n          $rootScope.$$postDigest(function() {\n            $rootScope.$$postDigest(function() {\n              rootAnimateState.running = false;\n            });\n          });\n        }\n      );\n\n      var globalAnimationCounter = 0;\n      var classNameFilter = $animateProvider.classNameFilter();\n      var isAnimatableClassName = !classNameFilter\n              ? function() { return true; }\n              : function(className) {\n                return classNameFilter.test(className);\n              };\n\n      function classBasedAnimationsBlocked(element, setter) {\n        var data = element.data(NG_ANIMATE_STATE) || {};\n        if (setter) {\n          data.running = true;\n          data.structural = true;\n          element.data(NG_ANIMATE_STATE, data);\n        }\n        return data.disabled || (data.running && data.structural);\n      }\n\n      function runAnimationPostDigest(fn) {\n        var cancelFn, defer = $$q.defer();\n        defer.promise.$$cancelFn = function() {\n          cancelFn && cancelFn();\n        };\n        $rootScope.$$postDigest(function() {\n          cancelFn = fn(function() {\n            defer.resolve();\n          });\n        });\n        return defer.promise;\n      }\n\n      function parseAnimateOptions(options) {\n        // some plugin code may still be passing in the callback\n        // function as the last param for the $animate methods so\n        // it's best to only allow string or array values for now\n        if (isObject(options)) {\n          if (options.tempClasses && isString(options.tempClasses)) {\n            options.tempClasses = options.tempClasses.split(/\\s+/);\n          }\n          return options;\n        }\n      }\n\n      function resolveElementClasses(element, cache, runningAnimations) {\n        runningAnimations = runningAnimations || {};\n\n        var lookup = {};\n        forEach(runningAnimations, function(data, selector) {\n          forEach(selector.split(' '), function(s) {\n            lookup[s]=data;\n          });\n        });\n\n        var hasClasses = Object.create(null);\n        forEach((element.attr('class') || '').split(/\\s+/), function(className) {\n          hasClasses[className] = true;\n        });\n\n        var toAdd = [], toRemove = [];\n        forEach((cache && cache.classes) || [], function(status, className) {\n          var hasClass = hasClasses[className];\n          var matchingAnimation = lookup[className] || {};\n\n          // When addClass and removeClass is called then $animate will check to\n          // see if addClass and removeClass cancel each other out. When there are\n          // more calls to removeClass than addClass then the count falls below 0\n          // and then the removeClass animation will be allowed. Otherwise if the\n          // count is above 0 then that means an addClass animation will commence.\n          // Once an animation is allowed then the code will also check to see if\n          // there exists any on-going animation that is already adding or remvoing\n          // the matching CSS class.\n          if (status === false) {\n            //does it have the class or will it have the class\n            if (hasClass || matchingAnimation.event == 'addClass') {\n              toRemove.push(className);\n            }\n          } else if (status === true) {\n            //is the class missing or will it be removed?\n            if (!hasClass || matchingAnimation.event == 'removeClass') {\n              toAdd.push(className);\n            }\n          }\n        });\n\n        return (toAdd.length + toRemove.length) > 0 && [toAdd.join(' '), toRemove.join(' ')];\n      }\n\n      function lookup(name) {\n        if (name) {\n          var matches = [],\n              flagMap = {},\n              classes = name.substr(1).split('.');\n\n          //the empty string value is the default animation\n          //operation which performs CSS transition and keyframe\n          //animations sniffing. This is always included for each\n          //element animation procedure if the browser supports\n          //transitions and/or keyframe animations. The default\n          //animation is added to the top of the list to prevent\n          //any previous animations from affecting the element styling\n          //prior to the element being animated.\n          if ($sniffer.transitions || $sniffer.animations) {\n            matches.push($injector.get(selectors['']));\n          }\n\n          for (var i=0; i < classes.length; i++) {\n            var klass = classes[i],\n                selectorFactoryName = selectors[klass];\n            if (selectorFactoryName && !flagMap[klass]) {\n              matches.push($injector.get(selectorFactoryName));\n              flagMap[klass] = true;\n            }\n          }\n          return matches;\n        }\n      }\n\n      function animationRunner(element, animationEvent, className, options) {\n        //transcluded directives may sometimes fire an animation using only comment nodes\n        //best to catch this early on to prevent any animation operations from occurring\n        var node = element[0];\n        if (!node) {\n          return;\n        }\n\n        if (options) {\n          options.to = options.to || {};\n          options.from = options.from || {};\n        }\n\n        var classNameAdd;\n        var classNameRemove;\n        if (isArray(className)) {\n          classNameAdd = className[0];\n          classNameRemove = className[1];\n          if (!classNameAdd) {\n            className = classNameRemove;\n            animationEvent = 'removeClass';\n          } else if (!classNameRemove) {\n            className = classNameAdd;\n            animationEvent = 'addClass';\n          } else {\n            className = classNameAdd + ' ' + classNameRemove;\n          }\n        }\n\n        var isSetClassOperation = animationEvent == 'setClass';\n        var isClassBased = isSetClassOperation\n                           || animationEvent == 'addClass'\n                           || animationEvent == 'removeClass'\n                           || animationEvent == 'animate';\n\n        var currentClassName = element.attr('class');\n        var classes = currentClassName + ' ' + className;\n        if (!isAnimatableClassName(classes)) {\n          return;\n        }\n\n        var beforeComplete = noop,\n            beforeCancel = [],\n            before = [],\n            afterComplete = noop,\n            afterCancel = [],\n            after = [];\n\n        var animationLookup = (' ' + classes).replace(/\\s+/g,'.');\n        forEach(lookup(animationLookup), function(animationFactory) {\n          var created = registerAnimation(animationFactory, animationEvent);\n          if (!created && isSetClassOperation) {\n            registerAnimation(animationFactory, 'addClass');\n            registerAnimation(animationFactory, 'removeClass');\n          }\n        });\n\n        function registerAnimation(animationFactory, event) {\n          var afterFn = animationFactory[event];\n          var beforeFn = animationFactory['before' + event.charAt(0).toUpperCase() + event.substr(1)];\n          if (afterFn || beforeFn) {\n            if (event == 'leave') {\n              beforeFn = afterFn;\n              //when set as null then animation knows to skip this phase\n              afterFn = null;\n            }\n            after.push({\n              event: event, fn: afterFn\n            });\n            before.push({\n              event: event, fn: beforeFn\n            });\n            return true;\n          }\n        }\n\n        function run(fns, cancellations, allCompleteFn) {\n          var animations = [];\n          forEach(fns, function(animation) {\n            animation.fn && animations.push(animation);\n          });\n\n          var count = 0;\n          function afterAnimationComplete(index) {\n            if (cancellations) {\n              (cancellations[index] || noop)();\n              if (++count < animations.length) return;\n              cancellations = null;\n            }\n            allCompleteFn();\n          }\n\n          //The code below adds directly to the array in order to work with\n          //both sync and async animations. Sync animations are when the done()\n          //operation is called right away. DO NOT REFACTOR!\n          forEach(animations, function(animation, index) {\n            var progress = function() {\n              afterAnimationComplete(index);\n            };\n            switch (animation.event) {\n              case 'setClass':\n                cancellations.push(animation.fn(element, classNameAdd, classNameRemove, progress, options));\n                break;\n              case 'animate':\n                cancellations.push(animation.fn(element, className, options.from, options.to, progress));\n                break;\n              case 'addClass':\n                cancellations.push(animation.fn(element, classNameAdd || className,     progress, options));\n                break;\n              case 'removeClass':\n                cancellations.push(animation.fn(element, classNameRemove || className,  progress, options));\n                break;\n              default:\n                cancellations.push(animation.fn(element, progress, options));\n                break;\n            }\n          });\n\n          if (cancellations && cancellations.length === 0) {\n            allCompleteFn();\n          }\n        }\n\n        return {\n          node: node,\n          event: animationEvent,\n          className: className,\n          isClassBased: isClassBased,\n          isSetClassOperation: isSetClassOperation,\n          applyStyles: function() {\n            if (options) {\n              element.css(angular.extend(options.from || {}, options.to || {}));\n            }\n          },\n          before: function(allCompleteFn) {\n            beforeComplete = allCompleteFn;\n            run(before, beforeCancel, function() {\n              beforeComplete = noop;\n              allCompleteFn();\n            });\n          },\n          after: function(allCompleteFn) {\n            afterComplete = allCompleteFn;\n            run(after, afterCancel, function() {\n              afterComplete = noop;\n              allCompleteFn();\n            });\n          },\n          cancel: function() {\n            if (beforeCancel) {\n              forEach(beforeCancel, function(cancelFn) {\n                (cancelFn || noop)(true);\n              });\n              beforeComplete(true);\n            }\n            if (afterCancel) {\n              forEach(afterCancel, function(cancelFn) {\n                (cancelFn || noop)(true);\n              });\n              afterComplete(true);\n            }\n          }\n        };\n      }\n\n      /**\n       * @ngdoc service\n       * @name $animate\n       * @kind object\n       *\n       * @description\n       * The `$animate` service provides animation detection support while performing DOM operations (enter, leave and move) as well as during addClass and removeClass operations.\n       * When any of these operations are run, the $animate service\n       * will examine any JavaScript-defined animations (which are defined by using the $animateProvider provider object)\n       * as well as any CSS-defined animations against the CSS classes present on the element once the DOM operation is run.\n       *\n       * The `$animate` service is used behind the scenes with pre-existing directives and animation with these directives\n       * will work out of the box without any extra configuration.\n       *\n       * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n       *\n       * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n       * ## Callback Promises\n       * With AngularJS 1.3, each of the animation methods, on the `$animate` service, return a promise when called. The\n       * promise itself is then resolved once the animation has completed itself, has been cancelled or has been\n       * skipped due to animations being disabled. (Note that even if the animation is cancelled it will still\n       * call the resolve function of the animation.)\n       *\n       * ```js\n       * $animate.enter(element, container).then(function() {\n       *   //...this is called once the animation is complete...\n       * });\n       * ```\n       *\n       * Also note that, due to the nature of the callback promise, if any Angular-specific code (like changing the scope,\n       * location of the page, etc...) is executed within the callback promise then be sure to wrap the code using\n       * `$scope.$apply(...)`;\n       *\n       * ```js\n       * $animate.leave(element).then(function() {\n       *   $scope.$apply(function() {\n       *     $location.path('/new-page');\n       *   });\n       * });\n       * ```\n       *\n       * An animation can also be cancelled by calling the `$animate.cancel(promise)` method with the provided\n       * promise that was returned when the animation was started.\n       *\n       * ```js\n       * var promise = $animate.addClass(element, 'super-long-animation');\n       * promise.then(function() {\n       *   //this will still be called even if cancelled\n       * });\n       *\n       * element.on('click', function() {\n       *   //tooo lazy to wait for the animation to end\n       *   $animate.cancel(promise);\n       * });\n       * ```\n       *\n       * (Keep in mind that the promise cancellation is unique to `$animate` since promises in\n       * general cannot be cancelled.)\n       *\n       */\n      return {\n        /**\n         * @ngdoc method\n         * @name $animate#animate\n         * @kind function\n         *\n         * @description\n         * Performs an inline animation on the element which applies the provided `to` and `from` CSS styles to the element.\n         * If any detected CSS transition, keyframe or JavaScript matches the provided `className` value then the animation\n         * will take on the provided styles. For example, if a transition animation is set for the given className then the\n         * provided `from` and `to` styles will be applied alongside the given transition. If a JavaScript animation is\n         * detected then the provided styles will be given in as function paramters.\n         *\n         * ```js\n         * ngModule.animation('.my-inline-animation', function() {\n         *   return {\n         *     animate : function(element, className, from, to, done) {\n         *       //styles\n         *     }\n         *   }\n         * });\n         * ```\n         *\n         * Below is a breakdown of each step that occurs during the `animate` animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                  |\n         * |-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n         * | 1. `$animate.animate(...)` is called                                                                                  | `class=\"my-animation\"`                                       |\n         * | 2. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                            |\n         * | 3. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                            |\n         * | 4. the `className` class value is added to the element                                                                | `class=\"my-animation ng-animate className\"`                  |\n         * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate className\"`                  |\n         * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.className` class styling is applied right away| `class=\"my-animation ng-animate className\"`                  |\n         * | 7. `$animate` applies the provided collection of `from` CSS styles to the element                                     | `class=\"my-animation ng-animate className\"`                  |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate className\"`                  |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate className\"`                  |\n         * | 10. the `className-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate className className-active\"` |\n         * | 11. `$animate` applies the collection of `to` CSS styles to the element which are then handled by the transition      | `class=\"my-animation ng-animate className className-active\"` |\n         * | 12. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate className className-active\"` |\n         * | 13. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                       |\n         * | 14. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                       |\n         *\n         * @param {DOMElement} element the element that will be the focus of the enter animation\n         * @param {object} from a collection of CSS styles that will be applied to the element at the start of the animation\n         * @param {object} to a collection of CSS styles that the element will animate towards\n         * @param {string=} className an optional CSS class that will be added to the element for the duration of the animation (the default class is `ng-inline-animate`)\n         * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        animate: function(element, from, to, className, options) {\n          className = className || 'ng-inline-animate';\n          options = parseAnimateOptions(options) || {};\n          options.from = to ? from : null;\n          options.to   = to ? to : from;\n\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('animate', className, stripCommentsFromElement(element), null, null, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#enter\n         * @kind function\n         *\n         * @description\n         * Appends the element to the parentElement element that resides in the document and then runs the enter animation. Once\n         * the animation is started, the following CSS classes will be present on the element for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during enter animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                |\n         * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n         * | 1. `$animate.enter(...)` is called                                                                                    | `class=\"my-animation\"`                                     |\n         * | 2. element is inserted into the `parentElement` element or beside the `afterElement` element                          | `class=\"my-animation\"`                                     |\n         * | 3. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                          |\n         * | 4. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                          |\n         * | 5. the `.ng-enter` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-enter` class styling is applied right away | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 10. the `.ng-enter-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate ng-enter ng-enter-active\"` |\n         * | 11. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate ng-enter ng-enter-active\"` |\n         * | 12. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                     |\n         * | 13. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                     |\n         *\n         * @param {DOMElement} element the element that will be the focus of the enter animation\n         * @param {DOMElement} parentElement the parent element of the element that will be the focus of the enter animation\n         * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation\n         * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        enter: function(element, parentElement, afterElement, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n          parentElement = prepareElement(parentElement);\n          afterElement = prepareElement(afterElement);\n\n          classBasedAnimationsBlocked(element, true);\n          $delegate.enter(element, parentElement, afterElement);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('enter', 'ng-enter', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#leave\n         * @kind function\n         *\n         * @description\n         * Runs the leave animation operation and, upon completion, removes the element from the DOM. Once\n         * the animation is started, the following CSS classes will be added for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during leave animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                |\n         * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n         * | 1. `$animate.leave(...)` is called                                                                                    | `class=\"my-animation\"`                                     |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                          |\n         * | 3. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                          |\n         * | 4. the `.ng-leave` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.ng-leave` class styling is applied right away | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 7. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 8. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 9. the `.ng-leave-active` class is added (this triggers the CSS transition/animation)                                 | `class=\"my-animation ng-animate ng-leave ng-leave-active\"` |\n         * | 10. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate ng-leave ng-leave-active\"` |\n         * | 11. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                     |\n         * | 12. The element is removed from the DOM                                                                               | ...                                                        |\n         * | 13. The returned promise is resolved.                                                                                 | ...                                                        |\n         *\n         * @param {DOMElement} element the element that will be the focus of the leave animation\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        leave: function(element, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n\n          cancelChildAnimations(element);\n          classBasedAnimationsBlocked(element, true);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('leave', 'ng-leave', stripCommentsFromElement(element), null, null, function() {\n              $delegate.leave(element);\n            }, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#move\n         * @kind function\n         *\n         * @description\n         * Fires the move DOM operation. Just before the animation starts, the animate service will either append it into the parentElement container or\n         * add the element directly after the afterElement element if present. Then the move animation will be run. Once\n         * the animation is started, the following CSS classes will be added for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during move animation:\n         *\n         * | Animation Step                                                                                                       | What the element class attribute looks like              |\n         * |----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n         * | 1. `$animate.move(...)` is called                                                                                    | `class=\"my-animation\"`                                   |\n         * | 2. element is moved into the parentElement element or beside the afterElement element                                | `class=\"my-animation\"`                                   |\n         * | 3. `$animate` waits for the next digest to start the animation                                                       | `class=\"my-animation ng-animate\"`                        |\n         * | 4. `$animate` runs the JavaScript-defined animations detected on the element                                         | `class=\"my-animation ng-animate\"`                        |\n         * | 5. the `.ng-move` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                        | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-move` class styling is applied right away | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                            | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                 | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 10. the `.ng-move-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate ng-move ng-move-active\"` |\n         * | 11. `$animate` waits for the animation to complete (via events and timeout)                                          | `class=\"my-animation ng-animate ng-move ng-move-active\"` |\n         * | 12. The animation ends and all generated CSS classes are removed from the element                                    | `class=\"my-animation\"`                                   |\n         * | 13. The returned promise is resolved.                                                                                | `class=\"my-animation\"`                                   |\n         *\n         * @param {DOMElement} element the element that will be the focus of the move animation\n         * @param {DOMElement} parentElement the parentElement element of the element that will be the focus of the move animation\n         * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        move: function(element, parentElement, afterElement, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n          parentElement = prepareElement(parentElement);\n          afterElement = prepareElement(afterElement);\n\n          cancelChildAnimations(element);\n          classBasedAnimationsBlocked(element, true);\n          $delegate.move(element, parentElement, afterElement);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('move', 'ng-move', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#addClass\n         *\n         * @description\n         * Triggers a custom animation event based off the className variable and then attaches the className value to the element as a CSS class.\n         * Unlike the other animation methods, the animate service will suffix the className value with {@type -add} in order to provide\n         * the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if no CSS transitions\n         * or keyframes are defined on the -add-active or base CSS class).\n         *\n         * Below is a breakdown of each step that occurs during addClass animation:\n         *\n         * | Animation Step                                                                                         | What the element class attribute looks like                        |\n         * |--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n         * | 1. `$animate.addClass(element, 'super')` is called                                                     | `class=\"my-animation\"`                                             |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                           | `class=\"my-animation ng-animate\"`                                  |\n         * | 3. the `.super-add` class is added to the element                                                      | `class=\"my-animation ng-animate super-add\"`                        |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                              | `class=\"my-animation ng-animate super-add\"`                        |\n         * | 5. the `.super` and `.super-add-active` classes are added (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay          | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                             | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                       | `class=\"my-animation super\"`                                       |\n         * | 9. The super class is kept on the element                                                              | `class=\"my-animation super\"`                                       |\n         * | 10. The returned promise is resolved.                                                                  | `class=\"my-animation super\"`                                       |\n         *\n         * @param {DOMElement} element the element that will be animated\n         * @param {string} className the CSS class that will be added to the element and then animated\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        addClass: function(element, className, options) {\n          return this.setClass(element, className, [], options);\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#removeClass\n         *\n         * @description\n         * Triggers a custom animation event based off the className variable and then removes the CSS class provided by the className value\n         * from the element. Unlike the other animation methods, the animate service will suffix the className value with {@type -remove} in\n         * order to provide the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if\n         * no CSS transitions or keyframes are defined on the -remove or base CSS classes).\n         *\n         * Below is a breakdown of each step that occurs during removeClass animation:\n         *\n         * | Animation Step                                                                                                       | What the element class attribute looks like                        |\n         * |----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n         * | 1. `$animate.removeClass(element, 'super')` is called                                                                | `class=\"my-animation super\"`                                       |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                         | `class=\"my-animation super ng-animate\"`                            |\n         * | 3. the `.super-remove` class is added to the element                                                                 | `class=\"my-animation super ng-animate super-remove\"`               |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                                            | `class=\"my-animation super ng-animate super-remove\"`               |\n         * | 5. the `.super-remove-active` classes are added and `.super` is removed (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                        | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                             |\n         * | 9. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                             |\n         *\n         *\n         * @param {DOMElement} element the element that will be animated\n         * @param {string} className the CSS class that will be animated and then removed from the element\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        removeClass: function(element, className, options) {\n          return this.setClass(element, [], className, options);\n        },\n\n        /**\n         *\n         * @ngdoc method\n         * @name $animate#setClass\n         *\n         * @description Adds and/or removes the given CSS classes to and from the element.\n         * Once complete, the `done()` callback will be fired (if provided).\n         *\n         * | Animation Step                                                                                                                               | What the element class attribute looks like                                            |\n         * |----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n         * | 1. `$animate.setClass(element, 'on', 'off')` is called                                                                                       | `class=\"my-animation off\"`                                                             |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                                                 | `class=\"my-animation ng-animate off\"`                                                  |\n         * | 3. the `.on-add` and `.off-remove` classes are added to the element                                                                          | `class=\"my-animation ng-animate on-add off-remove off\"`                                |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                                                                    | `class=\"my-animation ng-animate on-add off-remove off\"`                                |\n         * | 5. the `.on`, `.on-add-active` and `.off-remove-active` classes are added and `.off` is removed (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                                                | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                                                                   | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                                                             | `class=\"my-animation on\"`                                                              |\n         * | 9. The returned promise is resolved.                                                                                                         | `class=\"my-animation on\"`                                                              |\n         *\n         * @param {DOMElement} element the element which will have its CSS classes changed\n         *   removed from it\n         * @param {string} add the CSS classes which will be added to the element\n         * @param {string} remove the CSS class which will be removed from the element\n         *   CSS classes have been set on the element\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n         */\n        setClass: function(element, add, remove, options) {\n          options = parseAnimateOptions(options);\n\n          var STORAGE_KEY = '$$animateClasses';\n          element = angular.element(element);\n          element = stripCommentsFromElement(element);\n\n          if (classBasedAnimationsBlocked(element)) {\n            return $delegate.$$setClassImmediately(element, add, remove, options);\n          }\n\n          // we're using a combined array for both the add and remove\n          // operations since the ORDER OF addClass and removeClass matters\n          var classes, cache = element.data(STORAGE_KEY);\n          var hasCache = !!cache;\n          if (!cache) {\n            cache = {};\n            cache.classes = {};\n          }\n          classes = cache.classes;\n\n          add = isArray(add) ? add : add.split(' ');\n          forEach(add, function(c) {\n            if (c && c.length) {\n              classes[c] = true;\n            }\n          });\n\n          remove = isArray(remove) ? remove : remove.split(' ');\n          forEach(remove, function(c) {\n            if (c && c.length) {\n              classes[c] = false;\n            }\n          });\n\n          if (hasCache) {\n            if (options && cache.options) {\n              cache.options = angular.extend(cache.options || {}, options);\n            }\n\n            //the digest cycle will combine all the animations into one function\n            return cache.promise;\n          } else {\n            element.data(STORAGE_KEY, cache = {\n              classes: classes,\n              options: options\n            });\n          }\n\n          return cache.promise = runAnimationPostDigest(function(done) {\n            var parentElement = element.parent();\n            var elementNode = extractElementNode(element);\n            var parentNode = elementNode.parentNode;\n            // TODO(matsko): move this code into the animationsDisabled() function once #8092 is fixed\n            if (!parentNode || parentNode['$$NG_REMOVED'] || elementNode['$$NG_REMOVED']) {\n              done();\n              return;\n            }\n\n            var cache = element.data(STORAGE_KEY);\n            element.removeData(STORAGE_KEY);\n\n            var state = element.data(NG_ANIMATE_STATE) || {};\n            var classes = resolveElementClasses(element, cache, state.active);\n            return !classes\n              ? done()\n              : performAnimation('setClass', classes, element, parentElement, null, function() {\n                  if (classes[0]) $delegate.$$addClassImmediately(element, classes[0]);\n                  if (classes[1]) $delegate.$$removeClassImmediately(element, classes[1]);\n                }, cache.options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#cancel\n         * @kind function\n         *\n         * @param {Promise} animationPromise The animation promise that is returned when an animation is started.\n         *\n         * @description\n         * Cancels the provided animation.\n        */\n        cancel: function(promise) {\n          promise.$$cancelFn();\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#enabled\n         * @kind function\n         *\n         * @param {boolean=} value If provided then set the animation on or off.\n         * @param {DOMElement=} element If provided then the element will be used to represent the enable/disable operation\n         * @return {boolean} Current animation state.\n         *\n         * @description\n         * Globally enables/disables animations.\n         *\n        */\n        enabled: function(value, element) {\n          switch (arguments.length) {\n            case 2:\n              if (value) {\n                cleanup(element);\n              } else {\n                var data = element.data(NG_ANIMATE_STATE) || {};\n                data.disabled = true;\n                element.data(NG_ANIMATE_STATE, data);\n              }\n            break;\n\n            case 1:\n              rootAnimateState.disabled = !value;\n            break;\n\n            default:\n              value = !rootAnimateState.disabled;\n            break;\n          }\n          return !!value;\n         }\n      };\n\n      /*\n        all animations call this shared animation triggering function internally.\n        The animationEvent variable refers to the JavaScript animation event that will be triggered\n        and the className value is the name of the animation that will be applied within the\n        CSS code. Element, `parentElement` and `afterElement` are provided DOM elements for the animation\n        and the onComplete callback will be fired once the animation is fully complete.\n      */\n      function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {\n        var noopCancel = noop;\n        var runner = animationRunner(element, animationEvent, className, options);\n        if (!runner) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          closeAnimation();\n          return noopCancel;\n        }\n\n        animationEvent = runner.event;\n        className = runner.className;\n        var elementEvents = angular.element._data(runner.node);\n        elementEvents = elementEvents && elementEvents.events;\n\n        if (!parentElement) {\n          parentElement = afterElement ? afterElement.parent() : element.parent();\n        }\n\n        //skip the animation if animations are disabled, a parent is already being animated,\n        //the element is not currently attached to the document body or then completely close\n        //the animation if any matching animations are not found at all.\n        //NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case an animation was found.\n        if (animationsDisabled(element, parentElement)) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          closeAnimation();\n          return noopCancel;\n        }\n\n        var ngAnimateState  = element.data(NG_ANIMATE_STATE) || {};\n        var runningAnimations     = ngAnimateState.active || {};\n        var totalActiveAnimations = ngAnimateState.totalActive || 0;\n        var lastAnimation         = ngAnimateState.last;\n        var skipAnimation = false;\n\n        if (totalActiveAnimations > 0) {\n          var animationsToCancel = [];\n          if (!runner.isClassBased) {\n            if (animationEvent == 'leave' && runningAnimations['ng-leave']) {\n              skipAnimation = true;\n            } else {\n              //cancel all animations when a structural animation takes place\n              for (var klass in runningAnimations) {\n                animationsToCancel.push(runningAnimations[klass]);\n              }\n              ngAnimateState = {};\n              cleanup(element, true);\n            }\n          } else if (lastAnimation.event == 'setClass') {\n            animationsToCancel.push(lastAnimation);\n            cleanup(element, className);\n          } else if (runningAnimations[className]) {\n            var current = runningAnimations[className];\n            if (current.event == animationEvent) {\n              skipAnimation = true;\n            } else {\n              animationsToCancel.push(current);\n              cleanup(element, className);\n            }\n          }\n\n          if (animationsToCancel.length > 0) {\n            forEach(animationsToCancel, function(operation) {\n              operation.cancel();\n            });\n          }\n        }\n\n        if (runner.isClassBased\n            && !runner.isSetClassOperation\n            && animationEvent != 'animate'\n            && !skipAnimation) {\n          skipAnimation = (animationEvent == 'addClass') == element.hasClass(className); //opposite of XOR\n        }\n\n        if (skipAnimation) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          fireDoneCallbackAsync();\n          return noopCancel;\n        }\n\n        runningAnimations     = ngAnimateState.active || {};\n        totalActiveAnimations = ngAnimateState.totalActive || 0;\n\n        if (animationEvent == 'leave') {\n          //there's no need to ever remove the listener since the element\n          //will be removed (destroyed) after the leave animation ends or\n          //is cancelled midway\n          element.one('$destroy', function(e) {\n            var element = angular.element(this);\n            var state = element.data(NG_ANIMATE_STATE);\n            if (state) {\n              var activeLeaveAnimation = state.active['ng-leave'];\n              if (activeLeaveAnimation) {\n                activeLeaveAnimation.cancel();\n                cleanup(element, 'ng-leave');\n              }\n            }\n          });\n        }\n\n        //the ng-animate class does nothing, but it's here to allow for\n        //parent animations to find and cancel child animations when needed\n        $$jqLite.addClass(element, NG_ANIMATE_CLASS_NAME);\n        if (options && options.tempClasses) {\n          forEach(options.tempClasses, function(className) {\n            $$jqLite.addClass(element, className);\n          });\n        }\n\n        var localAnimationCount = globalAnimationCounter++;\n        totalActiveAnimations++;\n        runningAnimations[className] = runner;\n\n        element.data(NG_ANIMATE_STATE, {\n          last: runner,\n          active: runningAnimations,\n          index: localAnimationCount,\n          totalActive: totalActiveAnimations\n        });\n\n        //first we run the before animations and when all of those are complete\n        //then we perform the DOM operation and run the next set of animations\n        fireBeforeCallbackAsync();\n        runner.before(function(cancelled) {\n          var data = element.data(NG_ANIMATE_STATE);\n          cancelled = cancelled ||\n                        !data || !data.active[className] ||\n                        (runner.isClassBased && data.active[className].event != animationEvent);\n\n          fireDOMOperation();\n          if (cancelled === true) {\n            closeAnimation();\n          } else {\n            fireAfterCallbackAsync();\n            runner.after(closeAnimation);\n          }\n        });\n\n        return runner.cancel;\n\n        function fireDOMCallback(animationPhase) {\n          var eventName = '$animate:' + animationPhase;\n          if (elementEvents && elementEvents[eventName] && elementEvents[eventName].length > 0) {\n            $$asyncCallback(function() {\n              element.triggerHandler(eventName, {\n                event: animationEvent,\n                className: className\n              });\n            });\n          }\n        }\n\n        function fireBeforeCallbackAsync() {\n          fireDOMCallback('before');\n        }\n\n        function fireAfterCallbackAsync() {\n          fireDOMCallback('after');\n        }\n\n        function fireDoneCallbackAsync() {\n          fireDOMCallback('close');\n          doneCallback();\n        }\n\n        //it is less complicated to use a flag than managing and canceling\n        //timeouts containing multiple callbacks.\n        function fireDOMOperation() {\n          if (!fireDOMOperation.hasBeenRun) {\n            fireDOMOperation.hasBeenRun = true;\n            domOperation();\n          }\n        }\n\n        function closeAnimation() {\n          if (!closeAnimation.hasBeenRun) {\n            if (runner) { //the runner doesn't exist if it fails to instantiate\n              runner.applyStyles();\n            }\n\n            closeAnimation.hasBeenRun = true;\n            if (options && options.tempClasses) {\n              forEach(options.tempClasses, function(className) {\n                $$jqLite.removeClass(element, className);\n              });\n            }\n\n            var data = element.data(NG_ANIMATE_STATE);\n            if (data) {\n\n              /* only structural animations wait for reflow before removing an\n                 animation, but class-based animations don't. An example of this\n                 failing would be when a parent HTML tag has a ng-class attribute\n                 causing ALL directives below to skip animations during the digest */\n              if (runner && runner.isClassBased) {\n                cleanup(element, className);\n              } else {\n                $$asyncCallback(function() {\n                  var data = element.data(NG_ANIMATE_STATE) || {};\n                  if (localAnimationCount == data.index) {\n                    cleanup(element, className, animationEvent);\n                  }\n                });\n                element.data(NG_ANIMATE_STATE, data);\n              }\n            }\n            fireDoneCallbackAsync();\n          }\n        }\n      }\n\n      function cancelChildAnimations(element) {\n        var node = extractElementNode(element);\n        if (node) {\n          var nodes = angular.isFunction(node.getElementsByClassName) ?\n            node.getElementsByClassName(NG_ANIMATE_CLASS_NAME) :\n            node.querySelectorAll('.' + NG_ANIMATE_CLASS_NAME);\n          forEach(nodes, function(element) {\n            element = angular.element(element);\n            var data = element.data(NG_ANIMATE_STATE);\n            if (data && data.active) {\n              forEach(data.active, function(runner) {\n                runner.cancel();\n              });\n            }\n          });\n        }\n      }\n\n      function cleanup(element, className) {\n        if (isMatchingElement(element, $rootElement)) {\n          if (!rootAnimateState.disabled) {\n            rootAnimateState.running = false;\n            rootAnimateState.structural = false;\n          }\n        } else if (className) {\n          var data = element.data(NG_ANIMATE_STATE) || {};\n\n          var removeAnimations = className === true;\n          if (!removeAnimations && data.active && data.active[className]) {\n            data.totalActive--;\n            delete data.active[className];\n          }\n\n          if (removeAnimations || !data.totalActive) {\n            $$jqLite.removeClass(element, NG_ANIMATE_CLASS_NAME);\n            element.removeData(NG_ANIMATE_STATE);\n          }\n        }\n      }\n\n      function animationsDisabled(element, parentElement) {\n        if (rootAnimateState.disabled) {\n          return true;\n        }\n\n        if (isMatchingElement(element, $rootElement)) {\n          return rootAnimateState.running;\n        }\n\n        var allowChildAnimations, parentRunningAnimation, hasParent;\n        do {\n          //the element did not reach the root element which means that it\n          //is not apart of the DOM. Therefore there is no reason to do\n          //any animations on it\n          if (parentElement.length === 0) break;\n\n          var isRoot = isMatchingElement(parentElement, $rootElement);\n          var state = isRoot ? rootAnimateState : (parentElement.data(NG_ANIMATE_STATE) || {});\n          if (state.disabled) {\n            return true;\n          }\n\n          //no matter what, for an animation to work it must reach the root element\n          //this implies that the element is attached to the DOM when the animation is run\n          if (isRoot) {\n            hasParent = true;\n          }\n\n          //once a flag is found that is strictly false then everything before\n          //it will be discarded and all child animations will be restricted\n          if (allowChildAnimations !== false) {\n            var animateChildrenFlag = parentElement.data(NG_ANIMATE_CHILDREN);\n            if (angular.isDefined(animateChildrenFlag)) {\n              allowChildAnimations = animateChildrenFlag;\n            }\n          }\n\n          parentRunningAnimation = parentRunningAnimation ||\n                                   state.running ||\n                                   (state.last && !state.last.isClassBased);\n        }\n        while (parentElement = parentElement.parent());\n\n        return !hasParent || (!allowChildAnimations && parentRunningAnimation);\n      }\n    }]);\n\n    $animateProvider.register('', ['$window', '$sniffer', '$timeout', '$$animateReflow',\n                           function($window,   $sniffer,   $timeout,   $$animateReflow) {\n      // Detect proper transitionend/animationend event names.\n      var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n      // If unprefixed events are not supported but webkit-prefixed are, use the latter.\n      // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n      // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n      // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n      // Register both events in case `window.onanimationend` is not supported because of that,\n      // do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n      // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n      // therefore there is no reason to test anymore for other vendor prefixes: http://caniuse.com/#search=transition\n      if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {\n        CSS_PREFIX = '-webkit-';\n        TRANSITION_PROP = 'WebkitTransition';\n        TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n      } else {\n        TRANSITION_PROP = 'transition';\n        TRANSITIONEND_EVENT = 'transitionend';\n      }\n\n      if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {\n        CSS_PREFIX = '-webkit-';\n        ANIMATION_PROP = 'WebkitAnimation';\n        ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n      } else {\n        ANIMATION_PROP = 'animation';\n        ANIMATIONEND_EVENT = 'animationend';\n      }\n\n      var DURATION_KEY = 'Duration';\n      var PROPERTY_KEY = 'Property';\n      var DELAY_KEY = 'Delay';\n      var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\n      var ANIMATION_PLAYSTATE_KEY = 'PlayState';\n      var NG_ANIMATE_PARENT_KEY = '$$ngAnimateKey';\n      var NG_ANIMATE_CSS_DATA_KEY = '$$ngAnimateCSS3Data';\n      var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\n      var CLOSING_TIME_BUFFER = 1.5;\n      var ONE_SECOND = 1000;\n\n      var lookupCache = {};\n      var parentCounter = 0;\n      var animationReflowQueue = [];\n      var cancelAnimationReflow;\n      function clearCacheAfterReflow() {\n        if (!cancelAnimationReflow) {\n          cancelAnimationReflow = $$animateReflow(function() {\n            animationReflowQueue = [];\n            cancelAnimationReflow = null;\n            lookupCache = {};\n          });\n        }\n      }\n\n      function afterReflow(element, callback) {\n        if (cancelAnimationReflow) {\n          cancelAnimationReflow();\n        }\n        animationReflowQueue.push(callback);\n        cancelAnimationReflow = $$animateReflow(function() {\n          forEach(animationReflowQueue, function(fn) {\n            fn();\n          });\n\n          animationReflowQueue = [];\n          cancelAnimationReflow = null;\n          lookupCache = {};\n        });\n      }\n\n      var closingTimer = null;\n      var closingTimestamp = 0;\n      var animationElementQueue = [];\n      function animationCloseHandler(element, totalTime) {\n        var node = extractElementNode(element);\n        element = angular.element(node);\n\n        //this item will be garbage collected by the closing\n        //animation timeout\n        animationElementQueue.push(element);\n\n        //but it may not need to cancel out the existing timeout\n        //if the timestamp is less than the previous one\n        var futureTimestamp = Date.now() + totalTime;\n        if (futureTimestamp <= closingTimestamp) {\n          return;\n        }\n\n        $timeout.cancel(closingTimer);\n\n        closingTimestamp = futureTimestamp;\n        closingTimer = $timeout(function() {\n          closeAllAnimations(animationElementQueue);\n          animationElementQueue = [];\n        }, totalTime, false);\n      }\n\n      function closeAllAnimations(elements) {\n        forEach(elements, function(element) {\n          var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);\n          if (elementData) {\n            forEach(elementData.closeAnimationFns, function(fn) {\n              fn();\n            });\n          }\n        });\n      }\n\n      function getElementAnimationDetails(element, cacheKey) {\n        var data = cacheKey ? lookupCache[cacheKey] : null;\n        if (!data) {\n          var transitionDuration = 0;\n          var transitionDelay = 0;\n          var animationDuration = 0;\n          var animationDelay = 0;\n\n          //we want all the styles defined before and after\n          forEach(element, function(element) {\n            if (element.nodeType == ELEMENT_NODE) {\n              var elementStyles = $window.getComputedStyle(element) || {};\n\n              var transitionDurationStyle = elementStyles[TRANSITION_PROP + DURATION_KEY];\n              transitionDuration = Math.max(parseMaxTime(transitionDurationStyle), transitionDuration);\n\n              var transitionDelayStyle = elementStyles[TRANSITION_PROP + DELAY_KEY];\n              transitionDelay  = Math.max(parseMaxTime(transitionDelayStyle), transitionDelay);\n\n              var animationDelayStyle = elementStyles[ANIMATION_PROP + DELAY_KEY];\n              animationDelay   = Math.max(parseMaxTime(elementStyles[ANIMATION_PROP + DELAY_KEY]), animationDelay);\n\n              var aDuration  = parseMaxTime(elementStyles[ANIMATION_PROP + DURATION_KEY]);\n\n              if (aDuration > 0) {\n                aDuration *= parseInt(elementStyles[ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY], 10) || 1;\n              }\n              animationDuration = Math.max(aDuration, animationDuration);\n            }\n          });\n          data = {\n            total: 0,\n            transitionDelay: transitionDelay,\n            transitionDuration: transitionDuration,\n            animationDelay: animationDelay,\n            animationDuration: animationDuration\n          };\n          if (cacheKey) {\n            lookupCache[cacheKey] = data;\n          }\n        }\n        return data;\n      }\n\n      function parseMaxTime(str) {\n        var maxValue = 0;\n        var values = isString(str) ?\n          str.split(/\\s*,\\s*/) :\n          [];\n        forEach(values, function(value) {\n          maxValue = Math.max(parseFloat(value) || 0, maxValue);\n        });\n        return maxValue;\n      }\n\n      function getCacheKey(element) {\n        var parentElement = element.parent();\n        var parentID = parentElement.data(NG_ANIMATE_PARENT_KEY);\n        if (!parentID) {\n          parentElement.data(NG_ANIMATE_PARENT_KEY, ++parentCounter);\n          parentID = parentCounter;\n        }\n        return parentID + '-' + extractElementNode(element).getAttribute('class');\n      }\n\n      function animateSetup(animationEvent, element, className, styles) {\n        var structural = ['ng-enter','ng-leave','ng-move'].indexOf(className) >= 0;\n\n        var cacheKey = getCacheKey(element);\n        var eventCacheKey = cacheKey + ' ' + className;\n        var itemIndex = lookupCache[eventCacheKey] ? ++lookupCache[eventCacheKey].total : 0;\n\n        var stagger = {};\n        if (itemIndex > 0) {\n          var staggerClassName = className + '-stagger';\n          var staggerCacheKey = cacheKey + ' ' + staggerClassName;\n          var applyClasses = !lookupCache[staggerCacheKey];\n\n          applyClasses && $$jqLite.addClass(element, staggerClassName);\n\n          stagger = getElementAnimationDetails(element, staggerCacheKey);\n\n          applyClasses && $$jqLite.removeClass(element, staggerClassName);\n        }\n\n        $$jqLite.addClass(element, className);\n\n        var formerData = element.data(NG_ANIMATE_CSS_DATA_KEY) || {};\n        var timings = getElementAnimationDetails(element, eventCacheKey);\n        var transitionDuration = timings.transitionDuration;\n        var animationDuration = timings.animationDuration;\n\n        if (structural && transitionDuration === 0 && animationDuration === 0) {\n          $$jqLite.removeClass(element, className);\n          return false;\n        }\n\n        var blockTransition = styles || (structural && transitionDuration > 0);\n        var blockAnimation = animationDuration > 0 &&\n                             stagger.animationDelay > 0 &&\n                             stagger.animationDuration === 0;\n\n        var closeAnimationFns = formerData.closeAnimationFns || [];\n        element.data(NG_ANIMATE_CSS_DATA_KEY, {\n          stagger: stagger,\n          cacheKey: eventCacheKey,\n          running: formerData.running || 0,\n          itemIndex: itemIndex,\n          blockTransition: blockTransition,\n          closeAnimationFns: closeAnimationFns\n        });\n\n        var node = extractElementNode(element);\n\n        if (blockTransition) {\n          blockTransitions(node, true);\n          if (styles) {\n            element.css(styles);\n          }\n        }\n\n        if (blockAnimation) {\n          blockAnimations(node, true);\n        }\n\n        return true;\n      }\n\n      function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {\n        var node = extractElementNode(element);\n        var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);\n        if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {\n          activeAnimationComplete();\n          return;\n        }\n\n        var activeClassName = '';\n        var pendingClassName = '';\n        forEach(className.split(' '), function(klass, i) {\n          var prefix = (i > 0 ? ' ' : '') + klass;\n          activeClassName += prefix + '-active';\n          pendingClassName += prefix + '-pending';\n        });\n\n        var style = '';\n        var appliedStyles = [];\n        var itemIndex = elementData.itemIndex;\n        var stagger = elementData.stagger;\n        var staggerTime = 0;\n        if (itemIndex > 0) {\n          var transitionStaggerDelay = 0;\n          if (stagger.transitionDelay > 0 && stagger.transitionDuration === 0) {\n            transitionStaggerDelay = stagger.transitionDelay * itemIndex;\n          }\n\n          var animationStaggerDelay = 0;\n          if (stagger.animationDelay > 0 && stagger.animationDuration === 0) {\n            animationStaggerDelay = stagger.animationDelay * itemIndex;\n            appliedStyles.push(CSS_PREFIX + 'animation-play-state');\n          }\n\n          staggerTime = Math.round(Math.max(transitionStaggerDelay, animationStaggerDelay) * 100) / 100;\n        }\n\n        if (!staggerTime) {\n          $$jqLite.addClass(element, activeClassName);\n          if (elementData.blockTransition) {\n            blockTransitions(node, false);\n          }\n        }\n\n        var eventCacheKey = elementData.cacheKey + ' ' + activeClassName;\n        var timings = getElementAnimationDetails(element, eventCacheKey);\n        var maxDuration = Math.max(timings.transitionDuration, timings.animationDuration);\n        if (maxDuration === 0) {\n          $$jqLite.removeClass(element, activeClassName);\n          animateClose(element, className);\n          activeAnimationComplete();\n          return;\n        }\n\n        if (!staggerTime && styles && Object.keys(styles).length > 0) {\n          if (!timings.transitionDuration) {\n            element.css('transition', timings.animationDuration + 's linear all');\n            appliedStyles.push('transition');\n          }\n          element.css(styles);\n        }\n\n        var maxDelay = Math.max(timings.transitionDelay, timings.animationDelay);\n        var maxDelayTime = maxDelay * ONE_SECOND;\n\n        if (appliedStyles.length > 0) {\n          //the element being animated may sometimes contain comment nodes in\n          //the jqLite object, so we're safe to use a single variable to house\n          //the styles since there is always only one element being animated\n          var oldStyle = node.getAttribute('style') || '';\n          if (oldStyle.charAt(oldStyle.length - 1) !== ';') {\n            oldStyle += ';';\n          }\n          node.setAttribute('style', oldStyle + ' ' + style);\n        }\n\n        var startTime = Date.now();\n        var css3AnimationEvents = ANIMATIONEND_EVENT + ' ' + TRANSITIONEND_EVENT;\n        var animationTime     = (maxDelay + maxDuration) * CLOSING_TIME_BUFFER;\n        var totalTime         = (staggerTime + animationTime) * ONE_SECOND;\n\n        var staggerTimeout;\n        if (staggerTime > 0) {\n          $$jqLite.addClass(element, pendingClassName);\n          staggerTimeout = $timeout(function() {\n            staggerTimeout = null;\n\n            if (timings.transitionDuration > 0) {\n              blockTransitions(node, false);\n            }\n            if (timings.animationDuration > 0) {\n              blockAnimations(node, false);\n            }\n\n            $$jqLite.addClass(element, activeClassName);\n            $$jqLite.removeClass(element, pendingClassName);\n\n            if (styles) {\n              if (timings.transitionDuration === 0) {\n                element.css('transition', timings.animationDuration + 's linear all');\n              }\n              element.css(styles);\n              appliedStyles.push('transition');\n            }\n          }, staggerTime * ONE_SECOND, false);\n        }\n\n        element.on(css3AnimationEvents, onAnimationProgress);\n        elementData.closeAnimationFns.push(function() {\n          onEnd();\n          activeAnimationComplete();\n        });\n\n        elementData.running++;\n        animationCloseHandler(element, totalTime);\n        return onEnd;\n\n        // This will automatically be called by $animate so\n        // there is no need to attach this internally to the\n        // timeout done method.\n        function onEnd() {\n          element.off(css3AnimationEvents, onAnimationProgress);\n          $$jqLite.removeClass(element, activeClassName);\n          $$jqLite.removeClass(element, pendingClassName);\n          if (staggerTimeout) {\n            $timeout.cancel(staggerTimeout);\n          }\n          animateClose(element, className);\n          var node = extractElementNode(element);\n          for (var i in appliedStyles) {\n            node.style.removeProperty(appliedStyles[i]);\n          }\n        }\n\n        function onAnimationProgress(event) {\n          event.stopPropagation();\n          var ev = event.originalEvent || event;\n          var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();\n\n          /* Firefox (or possibly just Gecko) likes to not round values up\n           * when a ms measurement is used for the animation */\n          var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n          /* $manualTimeStamp is a mocked timeStamp value which is set\n           * within browserTrigger(). This is only here so that tests can\n           * mock animations properly. Real events fallback to event.timeStamp,\n           * or, if they don't, then a timeStamp is automatically created for them.\n           * We're checking to see if the timeStamp surpasses the expected delay,\n           * but we're using elapsedTime instead of the timeStamp on the 2nd\n           * pre-condition since animations sometimes close off early */\n          if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n            activeAnimationComplete();\n          }\n        }\n      }\n\n      function blockTransitions(node, bool) {\n        node.style[TRANSITION_PROP + PROPERTY_KEY] = bool ? 'none' : '';\n      }\n\n      function blockAnimations(node, bool) {\n        node.style[ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY] = bool ? 'paused' : '';\n      }\n\n      function animateBefore(animationEvent, element, className, styles) {\n        if (animateSetup(animationEvent, element, className, styles)) {\n          return function(cancelled) {\n            cancelled && animateClose(element, className);\n          };\n        }\n      }\n\n      function animateAfter(animationEvent, element, className, afterAnimationComplete, styles) {\n        if (element.data(NG_ANIMATE_CSS_DATA_KEY)) {\n          return animateRun(animationEvent, element, className, afterAnimationComplete, styles);\n        } else {\n          animateClose(element, className);\n          afterAnimationComplete();\n        }\n      }\n\n      function animate(animationEvent, element, className, animationComplete, options) {\n        //If the animateSetup function doesn't bother returning a\n        //cancellation function then it means that there is no animation\n        //to perform at all\n        var preReflowCancellation = animateBefore(animationEvent, element, className, options.from);\n        if (!preReflowCancellation) {\n          clearCacheAfterReflow();\n          animationComplete();\n          return;\n        }\n\n        //There are two cancellation functions: one is before the first\n        //reflow animation and the second is during the active state\n        //animation. The first function will take care of removing the\n        //data from the element which will not make the 2nd animation\n        //happen in the first place\n        var cancel = preReflowCancellation;\n        afterReflow(element, function() {\n          //once the reflow is complete then we point cancel to\n          //the new cancellation function which will remove all of the\n          //animation properties from the active animation\n          cancel = animateAfter(animationEvent, element, className, animationComplete, options.to);\n        });\n\n        return function(cancelled) {\n          (cancel || noop)(cancelled);\n        };\n      }\n\n      function animateClose(element, className) {\n        $$jqLite.removeClass(element, className);\n        var data = element.data(NG_ANIMATE_CSS_DATA_KEY);\n        if (data) {\n          if (data.running) {\n            data.running--;\n          }\n          if (!data.running || data.running === 0) {\n            element.removeData(NG_ANIMATE_CSS_DATA_KEY);\n          }\n        }\n      }\n\n      return {\n        animate: function(element, className, from, to, animationCompleted, options) {\n          options = options || {};\n          options.from = from;\n          options.to = to;\n          return animate('animate', element, className, animationCompleted, options);\n        },\n\n        enter: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('enter', element, 'ng-enter', animationCompleted, options);\n        },\n\n        leave: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('leave', element, 'ng-leave', animationCompleted, options);\n        },\n\n        move: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('move', element, 'ng-move', animationCompleted, options);\n        },\n\n        beforeSetClass: function(element, add, remove, animationCompleted, options) {\n          options = options || {};\n          var className = suffixClasses(remove, '-remove') + ' ' +\n                          suffixClasses(add, '-add');\n          var cancellationMethod = animateBefore('setClass', element, className, options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        beforeAddClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          var cancellationMethod = animateBefore('addClass', element, suffixClasses(className, '-add'), options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        beforeRemoveClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          var cancellationMethod = animateBefore('removeClass', element, suffixClasses(className, '-remove'), options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        setClass: function(element, add, remove, animationCompleted, options) {\n          options = options || {};\n          remove = suffixClasses(remove, '-remove');\n          add = suffixClasses(add, '-add');\n          var className = remove + ' ' + add;\n          return animateAfter('setClass', element, className, animationCompleted, options.to);\n        },\n\n        addClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          return animateAfter('addClass', element, suffixClasses(className, '-add'), animationCompleted, options.to);\n        },\n\n        removeClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          return animateAfter('removeClass', element, suffixClasses(className, '-remove'), animationCompleted, options.to);\n        }\n      };\n\n      function suffixClasses(classes, suffix) {\n        var className = '';\n        classes = isArray(classes) ? classes : classes.split(/\\s+/);\n        forEach(classes, function(klass, i) {\n          if (klass && klass.length > 0) {\n            className += (i > 0 ? ' ' : '') + klass + suffix;\n          }\n        });\n        return className;\n      }\n    }]);\n  }]);\n\n\n})(window, window.angular);\n"
  },
  {
    "path": "www/lib/angular-animate/bower.json",
    "content": "{\n  \"name\": \"angular-animate\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular-animate.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.13\"\n  }\n}\n"
  },
  {
    "path": "www/lib/angular-animate/package.json",
    "content": "{\n  \"name\": \"angular-animate\",\n  \"version\": \"1.3.13\",\n  \"description\": \"AngularJS module for animations\",\n  \"main\": \"angular-animate.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/angular/angular.js.git\"\n  },\n  \"keywords\": [\n    \"angular\",\n    \"framework\",\n    \"browser\",\n    \"animation\",\n    \"client-side\"\n  ],\n  \"author\": \"Angular Core Team <angular-core+npm@google.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/angular/angular.js/issues\"\n  },\n  \"homepage\": \"http://angularjs.org\"\n}\n"
  },
  {
    "path": "www/lib/angular-moment/.bower.json",
    "content": "{\n  \"name\": \"angular-moment\",\n  \"version\": \"0.10.0\",\n  \"description\": \"Moment.JS directives & filters for AngularJS (timeago alternative)\",\n  \"author\": \"Uri Shaked\",\n  \"license\": \"MIT\",\n  \"homepage\": \"http://github.com/urish/angular-moment\",\n  \"main\": \"./angular-moment.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \">=1.2.0 <1.5.0\",\n    \"moment\": \">=2.8.0 <2.11.0\"\n  },\n  \"devDependencies\": {\n    \"angular-mocks\": \"1.3.x\",\n    \"moment-timezone\": \"0.3.1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/urish/angular-moment.git\"\n  },\n  \"_release\": \"0.10.0\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"0.10.0\",\n    \"commit\": \"96d89aab944112e51177e06d4cd82a8b9306e656\"\n  },\n  \"_source\": \"git://github.com/urish/angular-moment.git\",\n  \"_target\": \"~0.10.0\",\n  \"_originalSource\": \"angular-moment\",\n  \"_direct\": true\n}"
  },
  {
    "path": "www/lib/angular-moment/.editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent\n# coding styles between different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n[*]\n\n# Change these settings to your own preference\nindent_style = tab\nindent_size = 4\n\n# We recommend you to keep these unchanged\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[{package.json,bower.json}]\nindent_style=space\nindent_size=2\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": "www/lib/angular-moment/.gitignore",
    "content": "/.idea\n/bower_components\n/node_modules\n/coverage"
  },
  {
    "path": "www/lib/angular-moment/.jshintrc",
    "content": "{\n\t\"node\": true,\n\t\"browser\": true,\n\t\"esnext\": true,\n\t\"bitwise\": true,\n\t\"camelcase\": true,\n\t\"curly\": true,\n\t\"eqeqeq\": true,\n\t\"immed\": true,\n\t\"indent\": 2,\n\t\"latedef\": true,\n\t\"newcap\": true,\n\t\"noarg\": true,\n\t\"quotmark\": \"single\",\n\t\"regexp\": true,\n\t\"undef\": true,\n\t\"unused\": true,\n\t\"strict\": true,\n\t\"trailing\": true,\n\t\"smarttabs\": true,\n\t\"maxdepth\": 2,\n\t\"maxcomplexity\": 10,\n\t\"globals\": {\n\t\t\"angular\": false\n\t}\n}\n"
  },
  {
    "path": "www/lib/angular-moment/.npmignore",
    "content": ".idea\nbower_components\nnode_modules\ncoverage\n"
  },
  {
    "path": "www/lib/angular-moment/.travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"0.10\"\nbefore_script:\n  - npm run bower\nafter_success:\n  - cat ./coverage/*/lcov.info | ./node_modules/coveralls/bin/coveralls.js\n"
  },
  {
    "path": "www/lib/angular-moment/CHANGELOG.md",
    "content": "# Changelog\n\n## 0.10.0 - 2015-04-10\n- Breaking change: removed one-time binding for `am-time-ago` in favor of AngularJS 1.3's one time binding ([#122](https://github.com/urish/angular-moment/issues/122))\n- Remove support for AngularJS 1.0.x and 1.1.x.\n- Support moment.js v2.10.x\n- Support for displaying full dates in `am-time-ago` (see [#75](https://github.com/urish/angular-moment/issues/75)) \n- Support Angular Core's style CommonJS standard ([#123](https://github.com/urish/angular-moment/pull/123), contributed by [seanhealy](https://github.com/seanhealy))\n- Added an optional timezone parameter to amDateFormat ([#90](https://github.com/urish/angular-moment/pull/90), contributed by [robertbrooker](https://github.com/robertbrooker))\n\n## 0.9.2 - 2015-03-17\n- Critical fix: npm install angular-moment fails ([#121](https://github.com/urish/angular-moment/issues/121))\n\n## 0.9.1 - 2015-03-17\n- Add support for locale strings customization ([#102](https://github.com/urish/angular-moment/pull/102), contributed by [vosi](https://github.com/vosi))\n- Add `amDifference` filter ([#120](https://github.com/urish/angular-moment/pull/120), contributed by [ajhodges](https://github.com/ajhodges))\n- Support for changing the timezone via `amMoment.changeTimezone()` ([#92](https://github.com/urish/angular-moment/issues/92))\n- Support for AngularJS 1.4.x\n- Remove explicit module name for RequireJS ([#112](https://github.com/urish/angular-moment/pull/112), contributed by [WilliamCarter](https://github.com/WilliamCarter))\n\n## 0.9.0 - 2015-01-11\n- Support moment.js v2.9.0. See [here](https://gist.github.com/ichernev/0c9a9b49951111a27ce7) for changelog.\n- Removed support for older moment.js versions. Only 2.8.0 and newer versions are now supported.\n- Removed deprecated method: `amMoment.changeLanguage()`. Use `amMoment.changeLocale()` instead.\n- Removed deprecated event: `amMoment:languageChange`. Listen for `amMoment:localeChange` instead.\n- Filters are now stateful by default (fixes [#97](https://github.com/urish/angular-moment/issues/97)).\n- The project is now available on [NuGet](https://www.nuget.org/packages/angular-moment/) ([#99](https://github.com/urish/angular-moment/pull/99), contributed by [markvp](https://github.com/markvp)).\n\n## 0.8.3 - 2014-12-08\n- `amTimeAgo` filter ([#96](https://github.com/urish/angular-moment/pull/96), contributed by [maxklenk](https://github.com/maxklenk))\n- Show formatted time as element title ([#78](https://github.com/urish/angular-moment/pull/78), contributed by [ctesene](https://github.com/ctesene))\n- Support commonjs and browserify ([#95](https://github.com/urish/angular-moment/pull/95), contributed by [Pencroff](https://github.com/Pencroff))\n- SystemJS Loader support ([#85](https://github.com/urish/angular-moment/pull/85), contributed by [capaj](https://github.com/capaj))\n\n## 0.8.2 - 2014-09-07\n- `amMoment.changeLanguage()` was deprecated in favor of `amMoment.changeLocale()` (following [a change](http://momentjs.com/docs/#/i18n/changing-locale/) introduced in moment v2.8.1)\n- Bugfix: changing the locale emitted a deprecation warning (see [#76](https://github.com/urish/angular-moment/issues/76) for details).\n\n## 0.8.1 - 2014-09-01\n- Support moment.js v2.8.0. See [here](https://gist.github.com/ichernev/ac3899324a5fa6c8c9b4) for changelog.\n- Support moment-timezone v0.2.1. See [here](https://github.com/moment/moment-timezone/blob/develop/changelog.md#021-2014-08-02) for changelog.\n- Bugfix: `updateTime()` is called too often for future dates ([#73](https://github.com/urish/angular-moment/issues/73)) \n\n## 0.8.0 - 2014-07-26\n- Generate source map for the minified version ([#50](https://github.com/urish/angular-moment/issues/50))\n- Add support HTML `<time>` element - set the `datetime` attribute ([#41](https://github.com/urish/angular-moment/pull/41), contributed by [gsklee](https://github.com/gsklee))\n- Add default format (angularMomentConfig.format config property) ([#52](https://github.com/urish/angular-moment/pull/52), contributed by [otang](https://github.com/otang))\n- Add `serverTime` configuration option ([#53](https://github.com/urish/angular-moment/pull/53), contributed by [Facundo Pedrazzini](https://github.com/Facuu7))\n- Implement one-time binding for `am-time-ago` ([#54](https://github.com/urish/angular-moment/pull/54), contributed by [Ephi Gabay](https://github.com/ephigabay))\n- Support moment.js v2.7.0. See [here](https://gist.github.com/ichernev/b0a3d456d5a84c9901d7) for changelog.\n- Support moment-timezone v0.1.0. See [here](https://github.com/moment/moment-timezone/blob/develop/changelog.md#010-2014-06-23) for changelog.\n\n## 0.7.1 - 2014-05-16\n- bugfix: Preprocess set in configuration not used by filters ([#49](https://github.com/urish/angular-moment/issues/49))\n\n## 0.7.0 - 2014-04-19\n- Use `moment` as an injectable constant instead of relying on `$window.moment` ([#35](https://github.com/urish/angular-moment/pull/35), contributed by [just-boris](https://github.com/just-boris))\n- Require.js support ([#36](https://github.com/urish/angular-moment/issues/36))\n- Add am-preprocess attribute to support unix and utc timestamps ([#38](https://github.com/urish/angular-moment/pull/38), contributed by [jspaper](https://github.com/jspaper))\n- NGDoc documentation ([#40](https://github.com/urish/angular-moment/issues/40))\n- Enable support for AngularJS 1.3.x in bower.json\n- Support moment.js v2.6.0. See [here](https://gist.github.com/ichernev/10544682) for changelog.\n\n## 0.6.2 - 2014-02-05\n- Add `amMoment` service with a `changeLanguage()` method ([#32](https://github.com/urish/angular-moment/pull/32), contributed by [Ornthalas](https://github.com/Ornthalas))\n- bower.json: Move `moment-timezone` to devDependencies (fixes [#34](https://github.com/urish/angular-moment/issues/34))\n\n## 0.6.1 - 2014-01-31\n- Add optional timezone support to `amCalendar` and `amDateFormat` filters ([#27](https://github.com/urish/angular-moment/pull/27), contributed by [kayhadrin](https://github.com/kayhadrin))\n- Happy Year of the Horse!\n\n## 0.6.0 - 2013-12-24\n\n- Add optional `am-without-suffix` attribute to `am-time-ago` ([#22](https://github.com/urish/angular-moment/issues/22), contributed by [hramaker](https://github.com/hramaker))\n- Support moment.js v2.5.0. See [here](https://gist.github.com/ichernev/8104451) for changelog.\n- Merry Christmas!\n\n## 0.5.2 - 2013-11-17\n\n- Add `amCalendar` filter ([#24](https://github.com/urish/angular-moment/issues/24), contributed by [OndraM](https://github.com/OndraM))\n\n## 0.5.1 - 2013-11-09\n\n- Add `amDuration` filter ([#20](https://github.com/urish/angular-moment/issues/20), contributed by [gabrielstuff](https://github.com/gabrielstuff))\n\n## 0.5.0 - 2013-11-02\n\n- Use $window.setTimeout instead of $timeout, fixes protractor synchronization issue ([#19](https://github.com/urish/angular-moment/issues/19))\n\n## 0.4.2 - 2013-10-30\n\n- Add settings constant for configuring moment.js withoutSuffix-option ([#18](https://github.com/urish/angular-moment/pull/18))\n\n## 0.4.1 - 2013-10-27\n\n- Support moment.js v2.4.0. See [here](https://github.com/moment/moment/#240) for changelog.\n\n## 0.4.0 - 2013-10-08\n\n- Support moment.js v2.3.0. See [here](https://gist.github.com/ichernev/6864354) for possibly breaking changes.\n\n## 0.3.0 - 2013-10-07\n\n- Bugfix: `am-time-ago` support for empty string ([#15](https://github.com/urish/angular-moment/issues/15))\n- Behavior change: `am-time-ago` will only change the text once there is date\n\n## 0.2.2 - 2013-09-29\n\n- Add support for passing unix timestamp as a string to `amDateFormat` filter ([#14](https://github.com/urish/angular-moment/issues/14))\n\n## 0.2.1 - 2013-09-13\n\n- Fix an issue with tests failing on a different timezone\n- Support moment 2.2.x, AngularJS 1.2\n\n## 0.2.0 - 2013-08-22\n\n- Add optional `am-format` attribute to `am-time-ago` ([#11](https://github.com/urish/angular-moment/issues/11))\n- Add new `amDateFormat` filter ([#12](https://github.com/urish/angular-moment/issues/12))\n- Add changelog file\n\n## 0.1.1 - 2013-06-08\n\n- Fix to support iOS ([#2](https://github.com/urish/angular-moment/pull/2), contributed by [giuseppeaiello](https://github.com/giuseppeaiello))\n\n## 0.1.0 - 2013-05-27\n\n- Initial release\n"
  },
  {
    "path": "www/lib/angular-moment/CONTRIBUTING.md",
    "content": "# Contributing Guide\n\nContributing to `angular-moment` is fairly easy. This document shows you how to\nget the project, run all provided tests and generate a production ready build.\n\nIt also covers provided grunt tasks, that help you developing on `angular-moment`.\n\n## Dependencies\n\nTo make sure, that the following instructions work, please install the following dependencies\non you machine:\n\n- Node.js\n- npm\n- Git\n\n## Installation\n\nTo get the source of `angular-moment` clone the git repository via:\n\n`git clone https://github.com/urish/angular-moment`\n\nThis will clone the complete source to your local machine. Navigate to the project folder\nand install all needed dependencies via **npm**:\n\n`npm install`\n\nTo complete the installation, install the frontend (bower) dependencies by running the \nfollowing command:\n\n`npm run bower`\n\nWell done! angular-moment is now installed and ready to be built.\n\n## Building\n\n`angular-moment` comes with a few **grunt tasks** which help you to automate\nthe development process. The following grunt tasks are provided:\n\n#### grunt test\n\n`npm test` executes (as you might thought) the unit tests, which are located\nin `tests.js`. The task uses the **karma** test runner to executes the tests with\nthe **jasmine testing framework**. This task also checks the coding using **jshint**.\n\n#### grunt build\n\n`npm run build` updates the minified version of the code (angular-moment.min.js). It also\nchecks the code using **jshint**.\n\n## Contributing/Submitting changes\n\n- Checkout a new branch based on `master` and name it to what you intend to do:\n  - Example:\n    ````\n    $ git checkout -b BRANCH_NAME\n    ````\n  - Use one branch per fix/feature\n- Make your changes\n  - Make sure to provide a spec for unit tests (in `tests.js`)\n  - Run your tests with `npm test`\n  - When all tests pass, everything's fine\n- Commit your changes\n  - Please provide a git message which explains what you've done\n  - Commit to the forked repository\n- Make a pull request\n\nIf you follow these instructions, your PR will land pretty safety in the main repo!\n"
  },
  {
    "path": "www/lib/angular-moment/Gruntfile.js",
    "content": "/* License: MIT.\n * Copyright (C) 2013, 2014, 2015, Uri Shaked.\n */\n\n'use strict';\n\nmodule.exports = function (grunt) {\n\t// Load grunt tasks automatically\n\trequire('load-grunt-tasks')(grunt);\n\n\tgrunt.initConfig({\n\t\tkarma: {\n\t\t\tunit: {\n\t\t\t\tconfigFile: 'karma.conf.js',\n\t\t\t\tsingleRun: true\n\t\t\t}\n\t\t},\n\t\tjshint: {\n\t\t\toptions: {\n\t\t\t\tjshintrc: '.jshintrc'\n\t\t\t},\n\t\t\tall: [\n\t\t\t\t'Gruntfile.js',\n\t\t\t\t'angular-moment.js',\n\t\t\t\t'tests.js'\n\t\t\t]\n\t\t},\n\t\tuglify: {\n\t\t\tdist: {\n\t\t\t\toptions: {\n\t\t\t\t\tsourceMap: true\n\t\t\t\t},\n\t\t\t\tfiles: {\n\t\t\t\t\t'angular-moment.min.js': 'angular-moment.js'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tngdocs: {\n\t\t\toptions: {\n\t\t\t\tstartPage: '/',\n\t\t\t\ttitle: false,\n\t\t\t\thtml5Mode: false\n\t\t\t},\n\t\t\tapi: {\n\t\t\t\tsrc: 'angular-moment.js',\n\t\t\t\ttitle: 'angular-moment API Documentation'\n\t\t\t}\n\t\t}\n\t});\n\n\tgrunt.registerTask('test', [\n\t\t'jshint',\n\t\t'karma'\n\t]);\n\n\tgrunt.registerTask('build', [\n\t\t'jshint',\n\t\t'uglify'\n\t]);\n\n\tgrunt.registerTask('default', ['build']);\n};\n"
  },
  {
    "path": "www/lib/angular-moment/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013-2015 Uri Shaked and contributors\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": "www/lib/angular-moment/README.md",
    "content": "angular-moment\n==============\n\nAngularJS directive and filters for [Moment.JS](http://www.momentjs.com).\n\nCopyright (C) 2013, 2014, 2015, Uri Shaked <uri@urish.org>\n\n[![Build Status](https://travis-ci.org/urish/angular-moment.png?branch=master)](https://travis-ci.org/urish/angular-moment)\n[![Coverage Status](https://coveralls.io/repos/urish/angular-moment/badge.png)](https://coveralls.io/r/urish/angular-moment)\n\nInstallation\n------------\n\nYou can choose your preferred method of installation:\n* Through bower: `bower install angular-moment --save`\n* Through npm: `npm install angular-moment --save`\n* Through NuGet: `Install-Package angular-moment`\n* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/angular.moment/0.10.0/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.10.0/angular-moment.min.js)\n* Download from github: [angular-moment.min.js](https://raw.github.com/urish/angular-moment/master/angular-moment.min.js)\n\nUsage\n-----\nInclude both moment.js and angular-moment.js in your application.\n\n```html\n<script src=\"components/moment/moment.js\"></script>\n<script src=\"components/angular-moment/angular-moment.js\"></script>\n```\n\nAdd the module `angularMoment` as a dependency to your app module:\n\n```js\nvar myapp = angular.module('myapp', ['angularMoment']);\n```\n\nIf you need internationalization support, load specified moment.js locale file first:\n\n```html\n<script src=\"components/moment/locale/de.js\"></script>\n```\n\nThen call the `amMoment.changeLocale()` method (e.g. inside your app's run() callback):\n\n```js\nmyapp.run(function(amMoment) {\n\tamMoment.changeLocale('de');\n});\n```\n\n### Configuration\n\nParameter `preprocess`(e.g: `unix`, `utc`) would pre-execute before.\n\n```js\nangular.module('myapp').constant('angularMomentConfig', {\n\tpreprocess: 'unix', // optional\n\ttimezone: 'Europe/London' // optional\n});\n```\n\n### Timeago directive\nUse am-time-ago directive to format your relative timestamps. For example:\n\n```html\n<span am-time-ago=\"message.time\"></span>\n<span am-time-ago=\"message.time\" am-preprocess=\"unix\"></span>\n```\n\nangular-moment will dynamically update the span to indicate how much time\npassed since the message was created. So, if your controller contains the following\ncode:\n```js\n$scope.message = {\n   text: 'hello world!',\n   time: new Date()\n};\n```\n\nThe user will initially see \"a few seconds ago\", and about a minute\nafter the span will automatically update with the text \"a minute ago\",\netc.\n\n### amDateFormat filter\nFormat dates using moment.js format() method. Example:\n\n```html\n<span>{{message.time | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a'}}</span>\n```\n\nThis snippet will format the given time as \"Monday, October 7th 2013, 12:36:29 am\".\n\nFor more information about Moment.JS formatting options, see the\n[docs for the format() function](http://momentjs.com/docs/#/displaying/format/).\n\n### amCalendar filter\n\nFormat dates using moment.js calendar() method. Example:\n\n```html\n<span>{{message.time | amCalendar}}</span>\n```\n\nThis snippet will format the given time as e.g. \"Today 2:30 AM\" or \"Last Monday 2:30 AM\" etc..\n\nFor more information about Moment.JS calendar time format, see the\n[docs for the calendar() function](http://momentjs.com/docs/#/displaying/calendar-time/).\n\n### amDifference filter\n\nGet the difference between two dates in milliseconds.\nParameters are date, units and usePrecision. Date defaults to current date. Example:\n\n```html\n<span>Scheduled {{message.createdAt | amDifference : null : 'days' }} days from now</span>\n```\n\nThis snippet will return the number of days between the current date and the date filtered.\n\nFor more information about Moment.JS difference function, see the\n[docs for the diff() function](http://momentjs.com/docs/#/displaying/difference/).\n\n### Time zone support\n\nThe `amDateFormat` and `amCalendar` filters can be configured to display dates aligned\nto a specific timezone. You can configure the timezone using the following syntax:\n\n```js\nangular.module('myapp').constant('angularMomentConfig', {\n    timezone: 'Name of Timezone' // e.g. 'Europe/London'\n});\n```\n\nRemember to include `moment-timezone.js` in your project, otherwise the custom timezone\nfunctionality will not be available. You will also need to include a timezone data file that\nyou can create using the [Timezone Data Builder](http://momentjs.com/timezone/data/)\nor simply download from [here](https://rawgithub.com/qw4n7y/7282780/raw/6ae3b334b295f93047e8f3ad300db6bc4387e235/moment-timezone-data.js).\n\nLicense\n----\n\nReleased under the terms of the [MIT License](LICENSE).\n"
  },
  {
    "path": "www/lib/angular-moment/angular-moment.js",
    "content": "/* angular-moment.js / v0.10.0 / (c) 2013, 2014, 2015 Uri Shaked / MIT Licence */\n\n'format global';\n/* global define */\n'deps angular';\n'deps moment';\n\n(function () {\n\t'use strict';\n\n\tfunction angularMoment(angular, moment) {\n\n\t\t/**\n\t\t * @ngdoc overview\n\t\t * @name angularMoment\n\t\t *\n\t\t * @description\n\t\t * angularMoment module provides moment.js functionality for angular.js apps.\n\t\t */\n\t\treturn angular.module('angularMoment', [])\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.config:angularMomentConfig\n\t\t *\n\t\t * @description\n\t\t * Common configuration of the angularMoment module\n\t\t */\n\t\t\t.constant('angularMomentConfig', {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#preprocess\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The default preprocessor to apply\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defines a default preprocessor to apply (e.g. 'unix', 'etc', ...). The default value is null,\n\t\t\t\t * i.e. no preprocessor will be applied.\n\t\t\t\t */\n\t\t\t\tpreprocess: null, // e.g. 'unix', 'utc', ...\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#timezone\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The default timezone\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The default timezone (e.g. 'Europe/London'). Empty string by default (does not apply\n\t\t\t\t * any timezone shift).\n\t\t\t\t */\n\t\t\t\ttimezone: '',\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#format\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The pre-conversion format of the date\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specify the format of the input date. Essentially it's a\n\t\t\t\t * default and saves you from specifying a format in every\n\t\t\t\t * element. Overridden by element attr. Null by default.\n\t\t\t\t */\n\t\t\t\tformat: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#statefulFilters\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {boolean} Whether angular-moment filters should be stateless (or not)\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specifies whether the filters included with angular-moment are stateful.\n\t\t\t\t * Stateful filters will automatically re-evaluate whenever you change the timezone\n\t\t\t\t * or language settings, but may negatively impact performance. true by default.\n\t\t\t\t */\n\t\t\t\tstatefulFilters: true\n\t\t\t})\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.object:moment\n\t\t *\n\t\t * @description\n\t\t * moment global (as provided by the moment.js library)\n\t\t */\n\t\t\t.constant('moment', moment)\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.config:amTimeAgoConfig\n\t\t * @module angularMoment\n\t\t *\n\t\t * @description\n\t\t * configuration specific to the amTimeAgo directive\n\t\t */\n\t\t\t.constant('amTimeAgoConfig', {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#withoutSuffix\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {boolean} Whether to include a suffix in am-time-ago directive\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defaults to false.\n\t\t\t\t */\n\t\t\t\twithoutSuffix: false,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#serverTime\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {number} Server time in milliseconds since the epoch\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * If set, time ago will be calculated relative to the given value.\n\t\t\t\t * If null, local time will be used. Defaults to null.\n\t\t\t\t */\n\t\t\t\tserverTime: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#titleFormat\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {string} The format of the date to be displayed in the title of the element. If null,\n\t\t\t\t *        the directive set the title of the element.\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The format of the date used for the title of the element. null by default.\n\t\t\t\t */\n\t\t\t\ttitleFormat: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#fullDateThreshold\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {number} The minimum number of days for showing a full date instead of relative time\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The threshold for displaying a full date. The default is null, which means the date will always\n\t\t\t\t * be relative, and full date will never be displayed.\n\t\t\t\t */\n\t\t\t\tfullDateThreshold: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#fullDateFormat\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {string} The format to use when displaying a full date.\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specify the format of the date when displayed as full date. null by default.\n\t\t\t\t */\n\t\t\t\tfullDateFormat: null\n\t\t\t})\n\n\t\t/**\n\t\t * @ngdoc directive\n\t\t * @name angularMoment.directive:amTimeAgo\n\t\t * @module angularMoment\n\t\t *\n\t\t * @restrict A\n\t\t */\n\t\t\t.directive('amTimeAgo', ['$window', 'moment', 'amMoment', 'amTimeAgoConfig', 'angularMomentConfig', function ($window, moment, amMoment, amTimeAgoConfig, angularMomentConfig) {\n\n\t\t\t\treturn function (scope, element, attr) {\n\t\t\t\t\tvar activeTimeout = null;\n\t\t\t\t\tvar currentValue;\n\t\t\t\t\tvar currentFormat = angularMomentConfig.format;\n\t\t\t\t\tvar withoutSuffix = amTimeAgoConfig.withoutSuffix;\n\t\t\t\t\tvar titleFormat = amTimeAgoConfig.titleFormat;\n\t\t\t\t\tvar fullDateThreshold = amTimeAgoConfig.fullDateThreshold;\n\t\t\t\t\tvar fullDateFormat = amTimeAgoConfig.fullDateFormat;\n\t\t\t\t\tvar localDate = new Date().getTime();\n\t\t\t\t\tvar preprocess = angularMomentConfig.preprocess;\n\t\t\t\t\tvar modelName = attr.amTimeAgo;\n\t\t\t\t\tvar isTimeElement = ('TIME' === element[0].nodeName.toUpperCase());\n\n\t\t\t\t\tfunction getNow() {\n\t\t\t\t\t\tvar now;\n\t\t\t\t\t\tif (amTimeAgoConfig.serverTime) {\n\t\t\t\t\t\t\tvar localNow = new Date().getTime();\n\t\t\t\t\t\t\tvar nowMillis = localNow - localDate + amTimeAgoConfig.serverTime;\n\t\t\t\t\t\t\tnow = moment(nowMillis);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnow = moment();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn now;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction cancelTimer() {\n\t\t\t\t\t\tif (activeTimeout) {\n\t\t\t\t\t\t\t$window.clearTimeout(activeTimeout);\n\t\t\t\t\t\t\tactiveTimeout = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateTime(momentInstance) {\n\t\t\t\t\t\tvar daysAgo = getNow().diff(momentInstance, 'day');\n\t\t\t\t\t\tvar showFullDate = fullDateThreshold && daysAgo >= fullDateThreshold;\n\n\t\t\t\t\t\tif (showFullDate) {\n\t\t\t\t\t\t\telement.text(momentInstance.format(fullDateFormat));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telement.text(momentInstance.from(getNow(), withoutSuffix));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (titleFormat && !element.attr('title')) {\n\t\t\t\t\t\t\telement.attr('title', momentInstance.local().format(titleFormat));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!showFullDate) {\n\t\t\t\t\t\t\tvar howOld = Math.abs(getNow().diff(momentInstance, 'minute'));\n\t\t\t\t\t\t\tvar secondsUntilUpdate = 3600;\n\t\t\t\t\t\t\tif (howOld < 1) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 1;\n\t\t\t\t\t\t\t} else if (howOld < 60) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 30;\n\t\t\t\t\t\t\t} else if (howOld < 180) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 300;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tactiveTimeout = $window.setTimeout(function () {\n\t\t\t\t\t\t\t\tupdateTime(momentInstance);\n\t\t\t\t\t\t\t}, secondsUntilUpdate * 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateDateTimeAttr(value) {\n\t\t\t\t\t\tif (isTimeElement) {\n\t\t\t\t\t\t\telement.attr('datetime', value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateMoment() {\n\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\tvar momentValue = amMoment.preprocessDate(currentValue, preprocess, currentFormat);\n\t\t\t\t\t\t\tupdateTime(momentValue);\n\t\t\t\t\t\t\tupdateDateTimeAttr(momentValue.toISOString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.$watch(modelName, function (value) {\n\t\t\t\t\t\tif ((typeof value === 'undefined') || (value === null) || (value === '')) {\n\t\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\t\telement.text('');\n\t\t\t\t\t\t\t\tupdateDateTimeAttr('');\n\t\t\t\t\t\t\t\tcurrentValue = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentValue = value;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tif (angular.isDefined(attr.amWithoutSuffix)) {\n\t\t\t\t\t\tscope.$watch(attr.amWithoutSuffix, function (value) {\n\t\t\t\t\t\t\tif (typeof value === 'boolean') {\n\t\t\t\t\t\t\t\twithoutSuffix = value;\n\t\t\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twithoutSuffix = amTimeAgoConfig.withoutSuffix;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tattr.$observe('amFormat', function (format) {\n\t\t\t\t\t\tif (typeof format !== 'undefined') {\n\t\t\t\t\t\t\tcurrentFormat = format;\n\t\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amPreprocess', function (newValue) {\n\t\t\t\t\t\tpreprocess = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amFullDateThreshold', function (newValue) {\n\t\t\t\t\t\tfullDateThreshold = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amFullDateFormat', function (newValue) {\n\t\t\t\t\t\tfullDateFormat = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tscope.$on('$destroy', function () {\n\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t});\n\n\t\t\t\t\tscope.$on('amMoment:localeChanged', function () {\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc service\n\t\t * @name angularMoment.service.amMoment\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.service('amMoment', ['moment', '$rootScope', '$log', 'angularMomentConfig', function (moment, $rootScope, $log, angularMomentConfig) {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment:amMoment#preprocessors\n\t\t\t\t * @module angularMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defines the preprocessors for the preprocessDate method. By default, the following preprocessors\n\t\t\t\t * are defined: utc, unix.\n\t\t\t\t */\n\t\t\t\tthis.preprocessors = {\n\t\t\t\t\tutc: moment.utc,\n\t\t\t\t\tunix: moment.unix\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#changeLocale\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Changes the locale for moment.js and updates all the am-time-ago directive instances\n\t\t\t\t * with the new locale. Also broadcasts an `amMoment:localeChanged` event on $rootScope.\n\t\t\t\t *\n\t\t\t\t * @param {string} locale Locale code (e.g. en, es, ru, pt-br, etc.)\n\t\t\t\t * @param {object} customization object of locale strings to override\n\t\t\t\t */\n\t\t\t\tthis.changeLocale = function (locale, customization) {\n\t\t\t\t\tvar result = moment.locale(locale, customization);\n\t\t\t\t\tif (angular.isDefined(locale)) {\n\t\t\t\t\t\t$rootScope.$broadcast('amMoment:localeChanged');\n\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#changeTimezone\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Changes the default timezone for amCalendar, amDateFormat and amTimeAgo. Also broadcasts an\n\t\t\t\t * `amMoment:timezoneChanged` event on $rootScope.\n\t\t\t\t *\n\t\t\t\t * @param {string} timezone Timezone name (e.g. UTC)\n\t\t\t\t */\n\t\t\t\tthis.changeTimezone = function (timezone) {\n\t\t\t\t\tangularMomentConfig.timezone = timezone;\n\t\t\t\t\t$rootScope.$broadcast('amMoment:timezoneChanged');\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#preprocessDate\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Preprocess a given value and convert it into a Moment instance appropriate for use in the\n\t\t\t\t * am-time-ago directive and the filters.\n\t\t\t\t *\n\t\t\t\t * @param {*} value The value to be preprocessed\n\t\t\t\t * @param {string} preprocess The name of the preprocessor the apply (e.g. utc, unix)\n\t\t\t\t * @param {string=} format Specifies how to parse the value (see {@link http://momentjs.com/docs/#/parsing/string-format/})\n\t\t\t\t * @return {Moment} A value that can be parsed by the moment library\n\t\t\t\t */\n\t\t\t\tthis.preprocessDate = function (value, preprocess, format) {\n\t\t\t\t\tif (angular.isUndefined(preprocess)) {\n\t\t\t\t\t\tpreprocess = angularMomentConfig.preprocess;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.preprocessors[preprocess]) {\n\t\t\t\t\t\treturn this.preprocessors[preprocess](value, format);\n\t\t\t\t\t}\n\t\t\t\t\tif (preprocess) {\n\t\t\t\t\t\t$log.warn('angular-moment: Ignoring unsupported value for preprocess: ' + preprocess);\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(parseFloat(value)) && isFinite(value)) {\n\t\t\t\t\t\t// Milliseconds since the epoch\n\t\t\t\t\t\treturn moment(parseInt(value, 10));\n\t\t\t\t\t}\n\t\t\t\t\t// else just returns the value as-is.\n\t\t\t\t\treturn moment(value, format);\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#applyTimezone\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Apply a timezone onto a given moment object - if moment-timezone.js is included\n\t\t\t\t * Otherwise, it'll not apply any timezone shift.\n\t\t\t\t *\n\t\t\t\t * @param {Moment} aMoment a moment() instance to apply the timezone shift to\n\t\t\t\t * @param {string=} timezone The timezone to apply. If none given, will apply the timezone\n\t\t\t\t * \t\tconfigured in angularMomentConfig.timezone.\n\t\t\t\t *\n\t\t\t\t * @returns {Moment} The given moment with the timezone shift applied\n\t\t\t\t */\n\t\t\t\tthis.applyTimezone = function (aMoment, timezone) {\n\t\t\t\t\ttimezone = timezone || angularMomentConfig.timezone;\n\t\t\t\t\tif (aMoment && timezone) {\n\t\t\t\t\t\tif (aMoment.tz) {\n\t\t\t\t\t\t\taMoment = aMoment.tz(timezone);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$log.warn('angular-moment: timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn aMoment;\n\t\t\t\t};\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amCalendar\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.filter('amCalendar', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amCalendarFilter(value, preprocess) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date).calendar();\n\t\t\t\t}\n\n\t\t\t\t// Since AngularJS 1.3, filters have to explicitly define being stateful\n\t\t\t\t// (this is no longer the default).\n\t\t\t\tamCalendarFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amCalendarFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDifference\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.filter('amDifference', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amDifferenceFilter(value, otherValue, unit, usePrecision, preprocessValue, preprocessOtherValue) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocessValue);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar date2;\n\t\t\t\t\tif (typeof otherValue === 'undefined' || otherValue === null) {\n\t\t\t\t\t\tdate2 = moment();\n\t\t\t\t\t} else {\n\t\t\t\t\t\totherValue = amMoment.preprocessDate(otherValue, preprocessOtherValue);\n\t\t\t\t\t\tdate2 = moment(otherValue);\n\t\t\t\t\t\tif (!date2.isValid()) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date).diff(amMoment.applyTimezone(date2), unit, usePrecision);\n\t\t\t\t}\n\n\t\t\t\tamDifferenceFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDifferenceFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDateFormat\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amDateFormat', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amDateFormatFilter(value, format, preprocess, timezone) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date, timezone).format(format);\n\t\t\t\t}\n\n\t\t\t\tamDateFormatFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDateFormatFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDurationFormat\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amDurationFormat', ['moment', 'angularMomentConfig', function (moment, angularMomentConfig) {\n\t\t\t\tfunction amDurationFormatFilter(value, format, suffix) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn moment.duration(value, format).humanize(suffix);\n\t\t\t\t}\n\n\t\t\t\tamDurationFormatFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDurationFormatFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amTimeAgo\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amTimeAgo', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amTimeAgoFilter(value, preprocess, suffix) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date).fromNow(suffix);\n\t\t\t\t}\n\n\t\t\t\tamTimeAgoFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amTimeAgoFilter;\n\t\t\t}]);\n\t}\n\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(['angular', 'moment'], angularMoment);\n\t} else if (typeof module !== 'undefined' && module && module.exports) {\n\t\tangularMoment(angular, require('moment'));\n\t\tmodule.exports = 'angularMoment';\n\t} else {\n\t\tangularMoment(angular, window.moment);\n\t}\n})();\n"
  },
  {
    "path": "www/lib/angular-moment/angular-moment.nuspec",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd\">\n    <metadata>\n        <id>angular-moment</id>\n        <version>0.10.0</version>\n        <title>Angular Moment</title>\n        <authors>urish</authors>\n        <projectUrl>https://github.com/urish/angular-moment</projectUrl>\n        <requireLicenseAcceptance>false</requireLicenseAcceptance>\n        <description>Moment.JS directives for AngularJS (timeago and more)</description>\n        <summary>Moment.JS directives for AngularJS (timeago and more).</summary>\n        <releaseNotes />\n        <copyright />\n        <dependencies>\n            <dependency id=\"Moment.js\" version=\"2.10.2\" />\n        </dependencies>\n        <tags>AngularJS MomentJS Moment</tags>\n    </metadata>\n    <files>\n        <file src=\"angular-moment.js\" target=\"content\\Scripts\\angular-moment.js\" />\n        <file src=\"angular-moment.min.js\" target=\"content\\Scripts\\angular-moment.min.js\" />\n        <file src=\"angular-moment.min.js.map\" target=\"content\\Scripts\\angular-moment.min.js.map\" />\n    </files>\n</package>\n"
  },
  {
    "path": "www/lib/angular-moment/bower.json",
    "content": "{\n\t\"name\": \"angular-moment\",\n\t\"version\": \"0.10.0\",\n\t\"description\": \"Moment.JS directives & filters for AngularJS (timeago alternative)\",\n\t\"author\": \"Uri Shaked\",\n\t\"license\": \"MIT\",\n\t\"homepage\": \"http://github.com/urish/angular-moment\",\n\t\"main\": \"./angular-moment.js\",\n\t\"ignore\": [\n\t],\n\t\"dependencies\": {\n\t\t\"angular\": \">=1.2.0 <1.5.0\",\n\t\t\"moment\": \">=2.8.0 <2.11.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"angular-mocks\": \"1.3.x\",\n\t\t\"moment-timezone\": \"0.3.1\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git://github.com/urish/angular-moment.git\"\n\t}\n}\n"
  },
  {
    "path": "www/lib/angular-moment/karma.conf.js",
    "content": "/* License: MIT.\n * Copyright (C) 2013, 2014, 2015, Uri Shaked.\n */\n\n'use strict';\n\nmodule.exports = function (config) {\n\tconfig.set({\n\t\tbasePath: '',\n\t\tframeworks: ['jasmine'],\n\t\tlogLevel: config.LOG_INFO,\n\t\tbrowsers: ['PhantomJS'],\n\t\tautoWatch: true,\n\t\treporters: ['dots', 'coverage'],\n\t\tfiles: [\n\t\t\t'bower_components/angular/angular.js',\n\t\t\t'bower_components/moment/moment.js',\n\t\t\t'bower_components/moment/{locale,lang}/fr.js',\n\t\t\t'bower_components/moment-timezone/moment-timezone.js',\n\t\t\t'angular-moment.js',\n\n\t\t\t// angular-mocks defines a global variable named 'module' which confuses moment-timezone.js.\n\t\t\t// Therefore, it must be included after moment-timezone.js.\n\t\t\t'bower_components/angular-mocks/angular-mocks.js',\n\n\t\t\t'tests.js'\n\t\t],\n\t\tpreprocessors: {\n\t\t\t'angular-moment.js': 'coverage'\n\t\t},\n\t\tcoverageReporter: {\n\t\t\ttype: 'lcov',\n\t\t\tdir: 'coverage/'\n\t\t}\n\t});\n};\n"
  },
  {
    "path": "www/lib/angular-moment/package.json",
    "content": "{\n  \"name\": \"angular-moment\",\n  \"version\": \"0.10.0\",\n  \"main\": \"angular-moment.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"http://github.com/urish/angular-moment.git\"\n  },\n  \"dependencies\": {\n    \"moment\": \">=2.8.0 <2.11.0\"\n  },\n  \"devDependencies\": {\n    \"bower\": \"^1.3.12\",\n    \"coveralls\": \"~2.11.0\",\n    \"grunt\": \"~0.4.1\",\n    \"grunt-cli\": \"^0.1.13\",\n    \"grunt-contrib-jshint\": \"~0.11.0\",\n    \"grunt-contrib-uglify\": \"0.8.1\",\n    \"grunt-karma\": \"~0.10.1\",\n    \"grunt-ngdocs\": \"^0.2.7\",\n    \"karma\": \"~0.12.0\",\n    \"karma-coverage\": \"~0.2.0\",\n    \"karma-jasmine\": \"~0.3.5\",\n    \"karma-phantomjs-launcher\": \"~0.1.1\",\n    \"load-grunt-tasks\": \"3.1.0\"\n  },\n  \"engines\": {\n    \"node\": \">=0.10.0\"\n  },\n  \"scripts\": {\n    \"bower\": \"node_modules/.bin/bower install\",\n    \"test\": \"node_modules/.bin/grunt test\",\n    \"build\": \"node_modules/.bin/grunt build\"\n  }\n}\n"
  },
  {
    "path": "www/lib/angular-moment/tests.js",
    "content": "/* License: MIT.\n * Copyright (C) 2013, 2014, 2015, Uri Shaked.\n */\n\n/* global describe, inject, module, beforeEach, afterEach, it, expect, spyOn, jasmine */\n\n'use strict';\n\ndescribe('module angularMoment', function () {\n\tvar $rootScope, $compile, $window, $filter, moment, amTimeAgoConfig, originalTimeAgoConfig, angularMomentConfig,\n\t\toriginalAngularMomentConfig, amMoment;\n\n\tbeforeEach(module('angularMoment'));\n\n\tbeforeEach(inject(function ($injector) {\n\t\t$rootScope = $injector.get('$rootScope');\n\t\t$compile = $injector.get('$compile');\n\t\t$window = $injector.get('$window');\n\t\t$filter = $injector.get('$filter');\n\t\tmoment = $injector.get('moment');\n\t\tamMoment = $injector.get('amMoment');\n\t\tamTimeAgoConfig = $injector.get('amTimeAgoConfig');\n\t\tangularMomentConfig = $injector.get('angularMomentConfig');\n\t\toriginalTimeAgoConfig = angular.copy(amTimeAgoConfig);\n\t\toriginalAngularMomentConfig = angular.copy(angularMomentConfig);\n\n\t\t// Ensure the locale of moment.js is set to en by default\n\t\t(moment.locale || moment.lang)('en');\n\t\t// Add a sample timezones for tests\n\t\tmoment.tz.add('UTC|UTC|0|0|');\n\t\tmoment.tz.add('Pacific/Tahiti|LMT TAHT|9W.g a0|01|-2joe1.I');\n\t}));\n\n\tafterEach(function () {\n\t\t// Restore original configuration after each test\n\t\tangular.copy(originalTimeAgoConfig, amTimeAgoConfig);\n\t\tangular.copy(originalAngularMomentConfig, angularMomentConfig);\n\t\tjasmine.clock().uninstall();\n\t});\n\n\n\tdescribe('am-time-ago directive', function () {\n\t\tit('should change the text of the element to \"a few seconds ago\" when given unix timestamp', function () {\n\t\t\t$rootScope.testDate = new Date().getTime() / 1000;\n\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-preprocess=\"unix\"></span>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should change the text of the element to \"a few seconds ago\" when given current time', function () {\n\t\t\t$rootScope.testDate = new Date();\n\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should change the text of the div to \"3 minutes ago\" when given a date 3 minutes ago', function () {\n\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 3 * 60 * 1000);\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('3 minutes ago');\n\t\t});\n\n\t\tit('should change the text of the div to \"2 hours ago\" when given a date 2 hours ago', function () {\n\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 2 * 60 * 60 * 1000);\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('2 hours ago');\n\t\t});\n\n\t\tit('should change the text of the div to \"one year ago\" when given a date one year ago', function () {\n\t\t\tvar today = new Date();\n\t\t\t$rootScope.testDate = new Date(today.getFullYear() - 1, today.getMonth(), today.getDate());\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a year ago');\n\t\t});\n\n\t\tit('should parse correctly numeric dates as milliseconds since the epoch', function () {\n\t\t\t$rootScope.testDate = new Date().getTime();\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should update the value if date changes on scope', function () {\n\t\t\tvar today = new Date();\n\t\t\t$rootScope.testDate = new Date(today.getFullYear() - 1, today.getMonth(), today.getDate()).getTime();\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a year ago');\n\t\t\t$rootScope.testDate = new Date();\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should update the span text as time passes', function (done) {\n\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 44000);\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\n\t\t\tvar waitsInterval = setInterval(function () {\n\t\t\t\t// Wait until $rootScope.date is more than 45 seconds old\n\t\t\t\tif (new Date().getTime() - $rootScope.testDate.getTime() < 45000) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclearInterval(waitsInterval);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a minute ago');\n\t\t\t\tdone();\n\t\t\t}, 50);\n\t\t});\n\n\t\tit('should schedule the update timer to one hour ahead for date in the far future (#73)', function () {\n\t\t\t$rootScope.testDate = new Date(new Date().getTime() + 86400000);\n\t\t\tjasmine.clock().install();\n\t\t\tspyOn($window, 'setTimeout');\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect($window.setTimeout).toHaveBeenCalledWith(jasmine.any(Function), 3600000);\n\t\t});\n\n\t\tdescribe('bindonce', function () {\n\t\t\tit('should change the text of the div to \"3 minutes ago\" when given a date 3 minutes ago with one time binding', function () {\n\t\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 3 * 60 * 1000);\n\t\t\t\tvar element = angular.element('<div am-time-ago=\"::testDate\"></div>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('3 minutes ago');\n\t\t\t});\n\n\t\t\tit('should parse correctly numeric dates as milliseconds since the epoch with one time binding', function () {\n\t\t\t\t$rootScope.testDate = new Date().getTime();\n\t\t\t\tvar element = angular.element('<div am-time-ago=\"::testDate\"></div>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\t});\n\n\t\t\tit('should not update the value if date changes on scope when using one time binding', function () {\n\t\t\t\tvar today = new Date();\n\t\t\t\t$rootScope.testDate = new Date(today.getFullYear() - 1, today.getMonth(), today.getDate()).getTime();\n\t\t\t\tvar element = angular.element('<div am-time-ago=\"::testDate\"></div>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a year ago');\n\t\t\t\t$rootScope.testDate = new Date();\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a year ago');\n\t\t\t});\n\t\t});\n\n\t\tit('should handle undefined data', function () {\n\t\t\t$rootScope.testDate = null;\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\tvar digest = function () {\n\t\t\t\t$rootScope.$digest();\n\t\t\t};\n\t\t\texpect(digest).not.toThrow();\n\t\t});\n\n\t\tit('should remove the element text and cancel the timer when an empty string is given (#15)', function () {\n\t\t\t$rootScope.testDate = new Date().getTime();\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\"></div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\t$rootScope.testDate = '';\n\t\t\tspyOn($window, 'clearTimeout').and.callThrough();\n\t\t\t$rootScope.$digest();\n\t\t\texpect($window.clearTimeout).toHaveBeenCalled();\n\t\t\texpect(element.text()).toBe('');\n\t\t});\n\n\t\tit('should not change the contents of the element until a date is given', function () {\n\t\t\t$rootScope.testDate = null;\n\t\t\tvar element = angular.element('<div am-time-ago=\"testDate\">Initial text</div>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('Initial text');\n\t\t\t$rootScope.testDate = new Date().getTime();\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should cancel the timer when the scope is destroyed', function () {\n\t\t\tvar scope = $rootScope.$new();\n\t\t\t$rootScope.testDate = new Date();\n\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\telement = $compile(element)(scope);\n\t\t\t$rootScope.$digest();\n\t\t\tspyOn($window, 'clearTimeout').and.callThrough();\n\t\t\tscope.$destroy();\n\t\t\texpect($window.clearTimeout).toHaveBeenCalled();\n\t\t});\n\n\t\tit('should generate a time string without suffix when configured to do so', function () {\n\t\t\tamTimeAgoConfig.withoutSuffix = true;\n\t\t\t$rootScope.testDate = new Date();\n\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds');\n\t\t});\n\n\t\tit('should generate update the text following a locale change via amMoment.changeLocale() method', function () {\n\t\t\t$rootScope.testDate = new Date();\n\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\tamMoment.changeLocale('fr');\n\t\t\texpect(element.text()).toBe('il y a quelques secondes');\n\t\t});\n\n\t\tit('should update the `datetime` attr if applied to a TIME element', function () {\n\t\t\t$rootScope.testDate = Date.UTC(2012, 8, 20, 15, 20, 12);\n\t\t\tvar element = angular.element('<time am-time-ago=\"testDate\"></span>');\n\t\t\telement = $compile(element)($rootScope);\n\t\t\t$rootScope.$digest();\n\t\t\texpect(element.attr('datetime')).toBe('2012-09-20T15:20:12.000Z');\n\t\t});\n\n\t\tdescribe('setting the element title', function () {\n\t\t\tit('should not set the title attribute of the element to the date by default', function () {\n\t\t\t\t$rootScope.testDate = new Date().getTime() / 1000;\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.attr('title')).toBeUndefined();\n\t\t\t});\n\n\t\t\tit('should not change the title attribute of the element if the element already has a title', function () {\n\t\t\t\tamTimeAgoConfig.titleFormat = 'MMMM Do YYYY, h:mm:ss a';\n\t\t\t\t$rootScope.testDate = new Date().getTime() / 1000;\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" title=\"test\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.attr('title')).toBe('test');\n\t\t\t});\n\n\t\t\tit('should set the title attribute of the element to the formatted date as per the config', function () {\n\t\t\t\tamTimeAgoConfig.titleFormat = 'MMMM Do YYYY, h:mm:ss a';\n\t\t\t\t$rootScope.testDate = new Date().getTime() / 1000;\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\tvar testDateWithCustomFormatting = moment($rootScope.testDate).format(amTimeAgoConfig.titleFormat);\n\t\t\t\texpect(element.attr('title')).toBe(testDateWithCustomFormatting);\n\t\t\t});\n\n\t\t\tdescribe('full date support', function () {\n\t\t\t\tit('should display relative time if the date is recent', function () {\n\t\t\t\t\tamTimeAgoConfig.fullDateThreshold = 7;\n\t\t\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 2 * 24 * 60 * 60 * 1000);\n\t\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toBe('2 days ago');\n\t\t\t\t});\n\n\t\t\t\tit('should display full time if the date is past the threshold', function () {\n\t\t\t\t\tamTimeAgoConfig.fullDateThreshold = 7;\n\t\t\t\t\t$rootScope.testDate = new Date(2012, 5, 5);\n\t\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toMatch(/^2012-06-05T00:00:00\\+\\d\\d:\\d\\d$/);\n\t\t\t\t});\n\n\t\t\t\tit('should display full time using the given format', function () {\n\t\t\t\t\tamTimeAgoConfig.fullDateThreshold = 7;\n\t\t\t\t\tamTimeAgoConfig.fullDateFormat = 'YYYY,DD,MM';\n\t\t\t\t\t$rootScope.testDate = new Date(2010, 1, 8);\n\t\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toBe('2010,08,02');\n\t\t\t\t});\n\n\t\t\t\tit('should support changing the full date threshold through attribute', function () {\n\t\t\t\t\t$rootScope.threshold = 7;\n\t\t\t\t\t$rootScope.testDate = new Date(new Date().getTime() - 12 * 24 * 60 * 60 * 1000);\n\t\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-full-date-threshold=\"{{threshold}}\"></span>');\n\t\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toBe(moment($rootScope.testDate).format());\n\n\t\t\t\t\t$rootScope.threshold = 20;\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toBe('12 days ago');\n\t\t\t\t});\n\n\t\t\t\tit('should support setting the full date format through attribute', function () {\n\t\t\t\t\tamTimeAgoConfig.fullDateThreshold = 7;\n\t\t\t\t\t$rootScope.testDate =  new Date(2013, 11, 15);\n\t\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-full-date-format=\"YYYY-MM-DD\"></span>');\n\t\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t\t$rootScope.$digest();\n\t\t\t\t\texpect(element.text()).toBe('2013-12-15');\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tdescribe('am-without-suffix attribute', function () {\n\t\t\tit('should generate a time string without suffix when true', function () {\n\t\t\t\t$rootScope.testDate = new Date();\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-without-suffix=\"true\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds');\n\t\t\t});\n\n\t\t\tit('should generate a time string with suffix when false', function () {\n\t\t\t\tamTimeAgoConfig.withoutSuffix = true;\n\t\t\t\t$rootScope.testDate = new Date();\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-without-suffix=\"false\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\t});\n\n\t\t\tit('should support expressions', function () {\n\t\t\t\t$rootScope.testDate = new Date();\n\t\t\t\t$rootScope.withSuffix = false;\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-without-suffix=\"!withSuffix\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds');\n\t\t\t\t$rootScope.withSuffix = true;\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\t});\n\n\t\t\tit('should ignore non-boolean values', function () {\n\t\t\t\t$rootScope.testDate = new Date();\n\t\t\t\t$rootScope.withoutSuffix = 'string';\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-without-suffix=\"withoutSuffix\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a few seconds ago');\n\t\t\t});\n\t\t});\n\n\t\tdescribe('am-format attribute', function () {\n\t\t\tit('should support custom date format', function () {\n\t\t\t\tvar today = new Date();\n\t\t\t\t$rootScope.testDate = today.getFullYear() + '#' + today.getDate() + '#' + today.getMonth();\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-format=\"YYYY#DD#MM\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a month ago');\n\t\t\t});\n\n\t\t\tit('should support angular expressions in date format', function () {\n\t\t\t\tvar today = new Date();\n\t\t\t\t$rootScope.testDate = today.getMonth() + '@' + today.getFullYear() + '@' + today.getDate();\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\" am-format=\"{{dateFormat}}\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\t$rootScope.dateFormat = 'MM@YYYY@DD';\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a month ago');\n\t\t\t});\n\t\t});\n\n\t\tdescribe('format config property', function () {\n\t\t\tit('should be used when no `am-format` attribute is found', function () {\n\t\t\t\tangularMomentConfig.format = 'MM@YYYY@DD';\n\t\t\t\tvar today = new Date();\n\t\t\t\t$rootScope.testDate = today.getMonth() + '@' + today.getFullYear() + '@' + today.getDate();\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a month ago');\n\t\t\t});\n\n\t\t\tit('should be overridable by `am-format` attribute', function () {\n\t\t\t\tangularMomentConfig.format = 'YYYY@MM@@DD';\n\t\t\t\tvar today = new Date();\n\t\t\t\t$rootScope.testDate = today.getMonth() + '@' + today.getFullYear() + '@' + today.getDate();\n\t\t\t\tvar element = angular.element('<span am-format=\"MM@YYYY@DD\" am-time-ago=\"testDate\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('a month ago');\n\t\t\t});\n\t\t});\n\n\t\tdescribe('serverTime configuration', function () {\n\t\t\tit('should calculate time ago in respect to the configured server time', function () {\n\t\t\t\tamTimeAgoConfig.serverTime = Date.UTC(2014, 5, 12, 5, 22, 11);\n\t\t\t\t$rootScope.testDate = Date.UTC(2014, 5, 12, 9, 22, 11);\n\t\t\t\tvar element = angular.element('<span am-time-ago=\"testDate\"></span>');\n\t\t\t\telement = $compile(element)($rootScope);\n\t\t\t\t$rootScope.$digest();\n\t\t\t\texpect(element.text()).toBe('in 4 hours');\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe('amCalendar filter', function () {\n\t\tvar amCalendar;\n\n\t\tbeforeEach(function () {\n\t\t\tamCalendar = $filter('amCalendar');\n\t\t});\n\n\t\tit('should convert today date to calendar form', function () {\n\t\t\tvar today = new Date();\n\t\t\tvar testDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 13, 33, 33);\n\t\t\texpect(amCalendar(testDate)).toBe('Today at 1:33 PM');\n\t\t});\n\n\t\tit('should convert date in long past to calendar form', function () {\n\t\t\texpect(amCalendar(new Date(2012, 2, 25, 13, 14, 15))).toBe('03/25/2012');\n\t\t});\n\n\t\tit('should gracefully handle undefined values', function () {\n\t\t\texpect(amCalendar()).toBe('');\n\t\t});\n\n\t\tit('should accept a numeric unix timestamp (milliseconds since the epoch) as input', function () {\n\t\t\texpect(amCalendar(new Date(2012, 0, 22, 4, 46, 54).getTime())).toBe('01/22/2012');\n\t\t});\n\n\t\tit('should respect the configured timezone', function () {\n\t\t\tangularMomentConfig.timezone = 'Pacific/Tahiti';\n\t\t\texpect(amCalendar(Date.UTC(2012, 0, 22, 4, 46, 54))).toBe('01/21/2012');\n\t\t});\n\n\t\tit('should apply the \"utc\" preprocessor when the string \"utc\" is given in the second argument', function () {\n\t\t\texpect(amCalendar(Date.UTC(2012, 0, 22, 0, 0, 0), 'utc')).toBe('01/22/2012');\n\t\t\texpect(amCalendar(Date.UTC(2012, 0, 22, 23, 59, 59), 'utc')).toBe('01/22/2012');\n\t\t});\n\n\t\tit('should apply the \"unix\" preprocessor if angularMomentConfig.preprocess is set to \"unix\" and no preprocessor is given', function () {\n\t\t\tvar unixDate = new Date(1970, 0, 2, 10, 0, 0).getTime() / 1000;\n\t\t\tangularMomentConfig.preprocess = 'unix';\n\t\t\texpect(amCalendar(unixDate)).toBe('01/02/1970');\n\t\t});\n\n\t\tit('should ignore the default preprocessor if we explicity give it null in the second argument', function () {\n\t\t\tvar unixDate = new Date(1970, 0, 1, 10, 0, 0).getTime();\n\t\t\tangularMomentConfig.preprocess = 'unix';\n\t\t\texpect(amCalendar(unixDate, null)).toBe('01/01/1970');\n\t\t});\n\n\t\tit('should gracefully handle the case where timezone is given but moment-timezone is not loaded', function () {\n\t\t\tangularMomentConfig.timezone = 'Pacific/Tahiti';\n\t\t\tvar originalMomentTz = moment.fn.tz;\n\t\t\ttry {\n\t\t\t\tdelete moment.fn.tz;\n\t\t\t\texpect(amCalendar(new Date(2012, 0, 22, 4, 46, 54).getTime())).toBe('01/22/2012');\n\t\t\t} finally {\n\t\t\t\tmoment.fn.tz = originalMomentTz;\n\t\t\t\tmoment.fn.tz = originalMomentTz;\n\t\t\t}\n\t\t});\n\n\t\tit('should return an empty string for invalid input', function () {\n\t\t\texpect(amCalendar('blah blah')).toBe('');\n\t\t});\n\t});\n\n\tdescribe('amDifference filter', function () {\n\t\tvar amDifference;\n\n\t\tbeforeEach(function () {\n\t\t\tamDifference = $filter('amDifference');\n\t\t});\n\n\t\tit('should take the difference of two dates in milliseconds', function () {\n\t\t\tvar today = new Date(2012, 0, 22, 0, 0, 0);\n\t\t\tvar testDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 13, 33, 33);\n\t\t\texpect(amDifference(testDate, today)).toBe(48813000);\n\t\t});\n\n\t\tit('should support passing \"years\", \"months\", \"days\", etc as a units parameter', function () {\n\t\t\tvar test = new Date(2012, 0, 22, 4, 46, 54);\n\t\t\tvar testDate1 = new Date(2013, 0, 22, 4, 46, 54);\n\t\t\texpect(amDifference(testDate1, test, 'years')).toBe(1);\n\t\t\tvar testDate2 = new Date(2012, 1, 22, 4, 46, 54);\n\t\t\texpect(amDifference(testDate2, test, 'months')).toBe(1);\n\t\t\tvar testDate3 = new Date(2012, 0, 23, 4, 46, 54);\n\t\t\texpect(amDifference(testDate3, test, 'days')).toBe(1);\n\t\t});\n\n\t\tit('should allow rounding to be disabled via parameter', function () {\n\t\t\tvar test = new Date(2012, 0, 22, 4, 46, 54);\n\t\t\tvar testDate1 = new Date(test.getFullYear() + 1, test.getMonth() + 6, test.getDate());\n\t\t\texpect(amDifference(testDate1, test, 'years')).toBe(1);\n\t\t\texpect(amDifference(testDate1, test, 'years', true)).toBeCloseTo(1.5);\n\t\t});\n\n\t\tit('dates from the future should return negative values', function () {\n\t\t\tvar today = new Date(2012, 0, 22, 4, 46, 54);\n\t\t\tvar testDate = new Date(2013, 0, 22, 4, 46, 54);\n\t\t\texpect(String(amDifference(today, testDate))).toContain('-');\n\t\t});\n\n\t\tit('should gracefully handle undefined values', function () {\n\t\t\texpect(amDifference()).toBe('');\n\t\t});\n\n\t\tit('should accept a numeric unix timestamp (milliseconds since the epoch) as input', function () {\n\t\t\texpect(amDifference(new Date(2012, 0, 22, 4, 46, 55).getTime(), new Date(2012, 0, 22, 4, 46, 54).getTime())).toBe(1000);\n\t\t});\n\n\t\tit('should apply the \"utc\" preprocessor when the string \"utc\" is given as a preprocessor argument', function () {\n\t\t\texpect(amDifference([2012, 0, 22, 0, 0, 1], Date.UTC(2012, 0, 22, 0, 0, 0), null, null, 'utc')).toBe(1000);\n\t\t\texpect(amDifference(Date.UTC(2012, 0, 22, 0, 0, 1), [2012, 0, 22, 0, 0, 0], null, null, null, 'utc')).toBe(1000);\n\t\t});\n\n\t\tit('should apply the \"unix\" preprocessor if angularMomentConfig.preprocess is set to \"unix\" and no preprocessor is given', function () {\n\t\t\tangularMomentConfig.preprocess = 'unix';\n\t\t\texpect(amDifference(100001, 100000)).toBe(1000);\n\t\t});\n\n\t\tit('should return an empty string for invalid input', function () {\n\t\t\texpect(amDifference('blah blah')).toBe('');\n\t\t});\n\t});\n\n\tdescribe('amDateFormat filter', function () {\n\t\tvar amDateFormat;\n\n\t\tbeforeEach(function () {\n\t\t\tamDateFormat = $filter('amDateFormat');\n\t\t});\n\n\t\tit('should support displaying format', function () {\n\t\t\tvar today = new Date();\n\t\t\tvar expectedResult = today.getDate() + '.' + (today.getMonth() + 1) + '.' + today.getFullYear();\n\t\t\texpect(amDateFormat(today, 'D.M.YYYY')).toBe(expectedResult);\n\t\t});\n\n\t\tit('should gracefully handle undefined values', function () {\n\t\t\texpect(amDateFormat(undefined, 'D.M.YYYY')).toBe('');\n\t\t});\n\n\t\tit('should accept a numeric unix timestamp (milliseconds since the epoch) as input', function () {\n\t\t\tvar timestamp = new Date(2012, 0, 22, 12, 46, 54).getTime();\n\t\t\texpect(amDateFormat(timestamp, '(HH,mm,ss);MM.DD.YYYY')).toBe('(12,46,54);01.22.2012');\n\t\t});\n\n\t\tit('should gracefully handle string unix timestamp as input', function () {\n\t\t\tvar strTimestamp = String(new Date(2012, 0, 22, 12, 46, 54).getTime());\n\t\t\texpect(amDateFormat(strTimestamp, '(HH,mm,ss);MM.DD.YYYY')).toBe('(12,46,54);01.22.2012');\n\t\t});\n\n\t\tit('should respect the configured timezone', function () {\n\t\t\tangularMomentConfig.timezone = 'Pacific/Tahiti';\n\t\t\tvar timestamp = Date.UTC(2012, 0, 22, 12, 46, 54);\n\t\t\texpect(amDateFormat(timestamp, '(HH,mm,ss);MM.DD.YYYY')).toBe('(02,46,54);01.22.2012');\n\t\t});\n\n\t\tit('should respect the timezone parameter', function () {\n\t\t\tvar timestamp = Date.UTC(2012, 0, 22, 12, 46, 54);\n\t\t\texpect(amDateFormat(timestamp, '(HH,mm,ss);MM.DD.YYYY', 'utc', 'Pacific/Tahiti')).toBe('(02,46,54);01.22.2012');\n\t\t});\n\n\t\tit('should return an empty string for invalid input', function () {\n\t\t\texpect(amDateFormat('blah blah', '(HH,mm,ss);MM.DD.YYYY')).toBe('');\n\t\t});\n\t});\n\n\tdescribe('amDurationFormat filter', function () {\n\t\tvar amDurationFormat;\n\n\t\tbeforeEach(function () {\n\t\t\tamDurationFormat = $filter('amDurationFormat');\n\t\t});\n\n\t\tit('should support return the given duration as text', function () {\n\t\t\texpect(amDurationFormat(1000, 'milliseconds')).toBe('a few seconds');\n\t\t});\n\n\t\tit('should support return a day given 24 hours', function () {\n\t\t\texpect(amDurationFormat(24, 'hours')).toBe('a day');\n\t\t});\n\n\t\tit('should add prefix the result with the word \"in\" if the third parameter (suffix) is true', function () {\n\t\t\texpect(amDurationFormat(1, 'minutes', true)).toBe('in a minute');\n\t\t});\n\n\t\tit('should add suffix the result with the word \"ago\" if the duration is negative and the third parameter is true', function () {\n\t\t\texpect(amDurationFormat(-1, 'minutes', true)).toBe('a minute ago');\n\t\t});\n\n\t\tit('should gracefully handle undefined values for duration', function () {\n\t\t\texpect(amDurationFormat(undefined, 'minutes')).toBe('');\n\t\t});\n\t});\n\n\n\tdescribe('amTimeAgo filter', function () {\n\t\tvar amTimeAgo;\n\n\t\tbeforeEach(function () {\n\t\t\tamTimeAgo = $filter('amTimeAgo');\n\t\t});\n\n\t\tit('should support return the time ago as text', function () {\n\t\t\tvar date = new Date();\n\t\t\texpect(amTimeAgo(date)).toBe('a few seconds ago');\n\t\t});\n\n\t\tit('should remove suffix from the result if the third parameter (suffix) is true', function () {\n\t\t\tvar date = new Date();\n\t\t\texpect(amTimeAgo(date, null, true)).toBe('a few seconds');\n\t\t});\n\n\t\tit('should gracefully handle undefined values', function () {\n\t\t\texpect(amTimeAgo()).toBe('');\n\t\t});\n\n\t\tit('should gracefully handle invalid input', function () {\n\t\t\texpect(amTimeAgo('noDate')).toBe('');\n\t\t});\n\n\t});\n\n\tdescribe('amMoment service', function () {\n\t\tdescribe('#changeLocale', function () {\n\t\t\tit('should convert today\\'s date to custom calendar format', function () {\n\t\t\t\tvar today = new Date();\n\t\t\t\tamMoment.changeLocale('en', {calendar: {sameDay: '[This Day]'}});\n\t\t\t\tvar amCalendar = $filter('amCalendar');\n\t\t\t\tvar testDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 13, 33, 33);\n\t\t\t\texpect(amCalendar(testDate)).toBe('This Day');\n\t\t\t});\n\n\t\t\tit('should return the current locale', function () {\n\t\t\t\texpect(amMoment.changeLocale()).toBe('en');\n\t\t\t});\n\n\t\t\tit('should broadcast an angularMoment:localeChanged event on the root scope if a locale is specified', function () {\n\t\t\t\tvar eventBroadcasted = false;\n\t\t\t\t$rootScope.$on('amMoment:localeChanged', function () {\n\t\t\t\t\teventBroadcasted = true;\n\t\t\t\t});\n\t\t\t\tamMoment.changeLocale('fr');\n\t\t\t\texpect(eventBroadcasted).toBe(true);\n\t\t\t});\n\n\t\t\tit('should not broadcast an angularMoment:localeChanged event on the root scope if no locale is specified', function () {\n\t\t\t\tvar eventBroadcasted = false;\n\t\t\t\t$rootScope.$on('amMoment:localeChanged', function () {\n\t\t\t\t\teventBroadcasted = true;\n\t\t\t\t});\n\t\t\t\tamMoment.changeLocale();\n\t\t\t\texpect(eventBroadcasted).toBe(false);\n\t\t\t});\n\t\t});\n\n\t\tdescribe('#changeTimezone', function () {\n\t\t\tit('Should update the current timezone', function () {\n\t\t\t\tamMoment.changeTimezone('UTC');\n\t\t\t\texpect(amMoment.applyTimezone(moment()).utcOffset()).toBe(0);\n\n\t\t\t\tamMoment.changeTimezone('Pacific/Tahiti');\n\t\t\t\texpect(amMoment.applyTimezone(moment()).utcOffset()).toBe(-600);\n\t\t\t});\n\n\t\t\tit('should broadcast an angularMoment:timezoneChanged event on the root scope with the new timezone value', function () {\n\t\t\t\tvar eventBroadcasted = false;\n\t\t\t\t$rootScope.$on('amMoment:timezoneChanged', function () {\n\t\t\t\t\teventBroadcasted = true;\n\t\t\t\t});\n\t\t\t\tamMoment.changeTimezone('UTC');\n\t\t\t\texpect(eventBroadcasted).toBe(true);\n\t\t\t});\n\t\t});\n\n\t\tdescribe('#preprocessDate', function () {\n\t\t\tit('should call a custom preprocessor that was registered on amMoment.preprocessors', function () {\n\t\t\t\tvar testDate = new Date(2013, 0, 22, 12, 46, 54);\n\t\t\t\tvar meeting = {\n\t\t\t\t\tname: 'Budget plan',\n\t\t\t\t\tdate: testDate\n\t\t\t\t};\n\n\t\t\t\tamMoment.preprocessors.foobar = function (value) {\n\t\t\t\t\treturn moment(value.date);\n\t\t\t\t};\n\n\t\t\t\texpect(amMoment.preprocessDate(meeting, 'foobar').valueOf()).toEqual(testDate.getTime());\n\t\t\t});\n\n\t\t\tit('should issue a warning if an unsupported preprocessor is used and fall-back to default processing', inject(function ($log) {\n\t\t\t\tvar testDate = new Date(2014, 0, 22, 12, 46, 54);\n\t\t\t\tspyOn($log, 'warn');\n\t\t\t\texpect(amMoment.preprocessDate(testDate.getTime(), 'blabla').valueOf()).toEqual(testDate.getTime());\n\t\t\t\texpect($log.warn).toHaveBeenCalledWith('angular-moment: Ignoring unsupported value for preprocess: blabla');\n\t\t\t}));\n\t\t});\n\t});\n\n\tdescribe('amTimeAgoConfig constant', function () {\n\t\tit('should generate time with suffix by default', function () {\n\t\t\texpect(amTimeAgoConfig.withoutSuffix).toBe(false);\n\t\t});\n\t});\n\n\tdescribe('angularMomentConfig constant', function () {\n\t\tit('should have an empty timezone value by default', function () {\n\t\t\texpect(angularMomentConfig.timezone).toBe('');\n\t\t});\n\t\tit('should have an empty preprocess value by default', function () {\n\t\t\texpect(angularMomentConfig.preprocess).toBe(null);\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "www/lib/angular-resource/.bower.json",
    "content": "{\n  \"name\": \"angular-resource\",\n  \"version\": \"1.3.15\",\n  \"main\": \"./angular-resource.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.15\"\n  },\n  \"homepage\": \"https://github.com/angular/bower-angular-resource\",\n  \"_release\": \"1.3.15\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v1.3.15\",\n    \"commit\": \"4cc3a759e2077f27aafb273a4a4929241aae1fd6\"\n  },\n  \"_source\": \"git://github.com/angular/bower-angular-resource.git\",\n  \"_target\": \"~1.3.15\",\n  \"_originalSource\": \"angular-resource\",\n  \"_direct\": true\n}"
  },
  {
    "path": "www/lib/angular-resource/README.md",
    "content": "# packaged angular-resource\n\nThis repo is for distribution on `npm` and `bower`. The source for this module is in the\n[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngResource).\nPlease file issues and pull requests against that repo.\n\n## Install\n\nYou can install this package either with `npm` or with `bower`.\n\n### npm\n\n```shell\nnpm install angular-resource\n```\n\nThen add `ngResource` as a dependency for your app:\n\n```javascript\nangular.module('myApp', [require('angular-resource')]);\n```\n\n### bower\n\n```shell\nbower install angular-resource\n```\n\nAdd a `<script>` to your `index.html`:\n\n```html\n<script src=\"/bower_components/angular-resource/angular-resource.js\"></script>\n```\n\nThen add `ngResource` as a dependency for your app:\n\n```javascript\nangular.module('myApp', ['ngResource']);\n```\n\n## Documentation\n\nDocumentation is available on the\n[AngularJS docs site](http://docs.angularjs.org/api/ngResource).\n\n## License\n\nThe MIT License\n\nCopyright (c) 2010-2015 Google, Inc. http://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": "www/lib/angular-resource/angular-resource.js",
    "content": "/**\n * @license AngularJS v1.3.15\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\nvar $resourceMinErr = angular.$$minErr('$resource');\n\n// Helper functions and regex to lookup a dotted path on an object\n// stopping at undefined/null.  The path must be composed of ASCII\n// identifiers (just like $parse)\nvar MEMBER_NAME_REGEX = /^(\\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;\n\nfunction isValidDottedPath(path) {\n  return (path != null && path !== '' && path !== 'hasOwnProperty' &&\n      MEMBER_NAME_REGEX.test('.' + path));\n}\n\nfunction lookupDottedPath(obj, path) {\n  if (!isValidDottedPath(path)) {\n    throw $resourceMinErr('badmember', 'Dotted member path \"@{0}\" is invalid.', path);\n  }\n  var keys = path.split('.');\n  for (var i = 0, ii = keys.length; i < ii && obj !== undefined; i++) {\n    var key = keys[i];\n    obj = (obj !== null) ? obj[key] : undefined;\n  }\n  return obj;\n}\n\n/**\n * Create a shallow copy of an object and clear other fields from the destination\n */\nfunction shallowClearAndCopy(src, dst) {\n  dst = dst || {};\n\n  angular.forEach(dst, function(value, key) {\n    delete dst[key];\n  });\n\n  for (var key in src) {\n    if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n      dst[key] = src[key];\n    }\n  }\n\n  return dst;\n}\n\n/**\n * @ngdoc module\n * @name ngResource\n * @description\n *\n * # ngResource\n *\n * The `ngResource` module provides interaction support with RESTful services\n * via the $resource service.\n *\n *\n * <div doc-module-components=\"ngResource\"></div>\n *\n * See {@link ngResource.$resource `$resource`} for usage.\n */\n\n/**\n * @ngdoc service\n * @name $resource\n * @requires $http\n *\n * @description\n * A factory which creates a resource object that lets you interact with\n * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.\n *\n * The returned resource object has action methods which provide high-level behaviors without\n * the need to interact with the low level {@link ng.$http $http} service.\n *\n * Requires the {@link ngResource `ngResource`} module to be installed.\n *\n * By default, trailing slashes will be stripped from the calculated URLs,\n * which can pose problems with server backends that do not expect that\n * behavior.  This can be disabled by configuring the `$resourceProvider` like\n * this:\n *\n * ```js\n     app.config(['$resourceProvider', function($resourceProvider) {\n       // Don't strip trailing slashes from calculated URLs\n       $resourceProvider.defaults.stripTrailingSlashes = false;\n     }]);\n * ```\n *\n * @param {string} url A parametrized URL template with parameters prefixed by `:` as in\n *   `/user/:username`. If you are using a URL with a port number (e.g.\n *   `http://example.com:8080/api`), it will be respected.\n *\n *   If you are using a url with a suffix, just add the suffix, like this:\n *   `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`\n *   or even `$resource('http://example.com/resource/:resource_id.:format')`\n *   If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be\n *   collapsed down to a single `.`.  If you need this sequence to appear and not collapse then you\n *   can escape it with `/\\.`.\n *\n * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in\n *   `actions` methods. If any of the parameter value is a function, it will be executed every time\n *   when a param value needs to be obtained for a request (unless the param was overridden).\n *\n *   Each key value in the parameter object is first bound to url template if present and then any\n *   excess keys are appended to the url search query after the `?`.\n *\n *   Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in\n *   URL `/path/greet?salutation=Hello`.\n *\n *   If the parameter value is prefixed with `@` then the value for that parameter will be extracted\n *   from the corresponding property on the `data` object (provided when calling an action method).  For\n *   example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`\n *   will be `data.someProp`.\n *\n * @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend\n *   the default set of resource actions. The declaration should be created in the format of {@link\n *   ng.$http#usage $http.config}:\n *\n *       {action1: {method:?, params:?, isArray:?, headers:?, ...},\n *        action2: {method:?, params:?, isArray:?, headers:?, ...},\n *        ...}\n *\n *   Where:\n *\n *   - **`action`** – {string} – The name of action. This name becomes the name of the method on\n *     your resource object.\n *   - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,\n *     `DELETE`, `JSONP`, etc).\n *   - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of\n *     the parameter value is a function, it will be executed every time when a param value needs to\n *     be obtained for a request (unless the param was overridden).\n *   - **`url`** – {string} – action specific `url` override. The url templating is supported just\n *     like for the resource-level urls.\n *   - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,\n *     see `returns` section.\n *   - **`transformRequest`** –\n *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n *     transform function or an array of such functions. The transform function takes the http\n *     request body and headers and returns its transformed (typically serialized) version.\n *     By default, transformRequest will contain one function that checks if the request data is\n *     an object and serializes to using `angular.toJson`. To prevent this behavior, set\n *     `transformRequest` to an empty array: `transformRequest: []`\n *   - **`transformResponse`** –\n *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n *     transform function or an array of such functions. The transform function takes the http\n *     response body and headers and returns its transformed (typically deserialized) version.\n *     By default, transformResponse will contain one function that checks if the response looks like\n *     a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set\n *     `transformResponse` to an empty array: `transformResponse: []`\n *   - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the\n *     GET request, otherwise if a cache instance built with\n *     {@link ng.$cacheFactory $cacheFactory}, this cache will be used for\n *     caching.\n *   - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that\n *     should abort the request when resolved.\n *   - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the\n *     XHR object. See\n *     [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)\n *     for more information.\n *   - **`responseType`** - `{string}` - see\n *     [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).\n *   - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -\n *     `response` and `responseError`. Both `response` and `responseError` interceptors get called\n *     with `http response` object. See {@link ng.$http $http interceptors}.\n *\n * @param {Object} options Hash with custom settings that should extend the\n *   default `$resourceProvider` behavior.  The only supported option is\n *\n *   Where:\n *\n *   - **`stripTrailingSlashes`** – {boolean} – If true then the trailing\n *   slashes from any calculated URL will be stripped. (Defaults to true.)\n *\n * @returns {Object} A resource \"class\" object with methods for the default set of resource actions\n *   optionally extended with custom `actions`. The default set contains these actions:\n *   ```js\n *   { 'get':    {method:'GET'},\n *     'save':   {method:'POST'},\n *     'query':  {method:'GET', isArray:true},\n *     'remove': {method:'DELETE'},\n *     'delete': {method:'DELETE'} };\n *   ```\n *\n *   Calling these methods invoke an {@link ng.$http} with the specified http method,\n *   destination and parameters. When the data is returned from the server then the object is an\n *   instance of the resource class. The actions `save`, `remove` and `delete` are available on it\n *   as  methods with the `$` prefix. This allows you to easily perform CRUD operations (create,\n *   read, update, delete) on server-side data like this:\n *   ```js\n *   var User = $resource('/user/:userId', {userId:'@id'});\n *   var user = User.get({userId:123}, function() {\n *     user.abc = true;\n *     user.$save();\n *   });\n *   ```\n *\n *   It is important to realize that invoking a $resource object method immediately returns an\n *   empty reference (object or array depending on `isArray`). Once the data is returned from the\n *   server the existing reference is populated with the actual data. This is a useful trick since\n *   usually the resource is assigned to a model which is then rendered by the view. Having an empty\n *   object results in no rendering, once the data arrives from the server then the object is\n *   populated with the data and the view automatically re-renders itself showing the new data. This\n *   means that in most cases one never has to write a callback function for the action methods.\n *\n *   The action methods on the class object or instance object can be invoked with the following\n *   parameters:\n *\n *   - HTTP GET \"class\" actions: `Resource.action([parameters], [success], [error])`\n *   - non-GET \"class\" actions: `Resource.action([parameters], postData, [success], [error])`\n *   - non-GET instance actions:  `instance.$action([parameters], [success], [error])`\n *\n *\n *   Success callback is called with (value, responseHeaders) arguments. Error callback is called\n *   with (httpResponse) argument.\n *\n *   Class actions return empty instance (with additional properties below).\n *   Instance actions return promise of the action.\n *\n *   The Resource instances and collection have these additional properties:\n *\n *   - `$promise`: the {@link ng.$q promise} of the original server interaction that created this\n *     instance or collection.\n *\n *     On success, the promise is resolved with the same resource instance or collection object,\n *     updated with data from server. This makes it easy to use in\n *     {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view\n *     rendering until the resource(s) are loaded.\n *\n *     On failure, the promise is resolved with the {@link ng.$http http response} object, without\n *     the `resource` property.\n *\n *     If an interceptor object was provided, the promise will instead be resolved with the value\n *     returned by the interceptor.\n *\n *   - `$resolved`: `true` after first server interaction is completed (either with success or\n *      rejection), `false` before that. Knowing if the Resource has been resolved is useful in\n *      data-binding.\n *\n * @example\n *\n * # Credit card resource\n *\n * ```js\n     // Define CreditCard class\n     var CreditCard = $resource('/user/:userId/card/:cardId',\n      {userId:123, cardId:'@id'}, {\n       charge: {method:'POST', params:{charge:true}}\n      });\n\n     // We can retrieve a collection from the server\n     var cards = CreditCard.query(function() {\n       // GET: /user/123/card\n       // server returns: [ {id:456, number:'1234', name:'Smith'} ];\n\n       var card = cards[0];\n       // each item is an instance of CreditCard\n       expect(card instanceof CreditCard).toEqual(true);\n       card.name = \"J. Smith\";\n       // non GET methods are mapped onto the instances\n       card.$save();\n       // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}\n       // server returns: {id:456, number:'1234', name: 'J. Smith'};\n\n       // our custom method is mapped as well.\n       card.$charge({amount:9.99});\n       // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}\n     });\n\n     // we can create an instance as well\n     var newCard = new CreditCard({number:'0123'});\n     newCard.name = \"Mike Smith\";\n     newCard.$save();\n     // POST: /user/123/card {number:'0123', name:'Mike Smith'}\n     // server returns: {id:789, number:'0123', name: 'Mike Smith'};\n     expect(newCard.id).toEqual(789);\n * ```\n *\n * The object returned from this function execution is a resource \"class\" which has \"static\" method\n * for each action in the definition.\n *\n * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and\n * `headers`.\n * When the data is returned from the server then the object is an instance of the resource type and\n * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD\n * operations (create, read, update, delete) on server-side data.\n\n   ```js\n     var User = $resource('/user/:userId', {userId:'@id'});\n     User.get({userId:123}, function(user) {\n       user.abc = true;\n       user.$save();\n     });\n   ```\n *\n * It's worth noting that the success callback for `get`, `query` and other methods gets passed\n * in the response that came from the server as well as $http header getter function, so one\n * could rewrite the above example and get access to http headers as:\n *\n   ```js\n     var User = $resource('/user/:userId', {userId:'@id'});\n     User.get({userId:123}, function(u, getResponseHeaders){\n       u.abc = true;\n       u.$save(function(u, putResponseHeaders) {\n         //u => saved user object\n         //putResponseHeaders => $http header getter\n       });\n     });\n   ```\n *\n * You can also access the raw `$http` promise via the `$promise` property on the object returned\n *\n   ```\n     var User = $resource('/user/:userId', {userId:'@id'});\n     User.get({userId:123})\n         .$promise.then(function(user) {\n           $scope.user = user;\n         });\n   ```\n\n * # Creating a custom 'PUT' request\n * In this example we create a custom method on our resource to make a PUT request\n * ```js\n *    var app = angular.module('app', ['ngResource', 'ngRoute']);\n *\n *    // Some APIs expect a PUT request in the format URL/object/ID\n *    // Here we are creating an 'update' method\n *    app.factory('Notes', ['$resource', function($resource) {\n *    return $resource('/notes/:id', null,\n *        {\n *            'update': { method:'PUT' }\n *        });\n *    }]);\n *\n *    // In our controller we get the ID from the URL using ngRoute and $routeParams\n *    // We pass in $routeParams and our Notes factory along with $scope\n *    app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',\n                                      function($scope, $routeParams, Notes) {\n *    // First get a note object from the factory\n *    var note = Notes.get({ id:$routeParams.id });\n *    $id = note.id;\n *\n *    // Now call update passing in the ID first then the object you are updating\n *    Notes.update({ id:$id }, note);\n *\n *    // This will PUT /notes/ID with the note object in the request payload\n *    }]);\n * ```\n */\nangular.module('ngResource', ['ng']).\n  provider('$resource', function() {\n    var provider = this;\n\n    this.defaults = {\n      // Strip slashes by default\n      stripTrailingSlashes: true,\n\n      // Default actions configuration\n      actions: {\n        'get': {method: 'GET'},\n        'save': {method: 'POST'},\n        'query': {method: 'GET', isArray: true},\n        'remove': {method: 'DELETE'},\n        'delete': {method: 'DELETE'}\n      }\n    };\n\n    this.$get = ['$http', '$q', function($http, $q) {\n\n      var noop = angular.noop,\n        forEach = angular.forEach,\n        extend = angular.extend,\n        copy = angular.copy,\n        isFunction = angular.isFunction;\n\n      /**\n       * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n       * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set\n       * (pchar) allowed in path segments:\n       *    segment       = *pchar\n       *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n       *    pct-encoded   = \"%\" HEXDIG HEXDIG\n       *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n       *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n       *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n       */\n      function encodeUriSegment(val) {\n        return encodeUriQuery(val, true).\n          replace(/%26/gi, '&').\n          replace(/%3D/gi, '=').\n          replace(/%2B/gi, '+');\n      }\n\n\n      /**\n       * This method is intended for encoding *key* or *value* parts of query component. We need a\n       * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't\n       * have to be encoded per http://tools.ietf.org/html/rfc3986:\n       *    query       = *( pchar / \"/\" / \"?\" )\n       *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n       *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n       *    pct-encoded   = \"%\" HEXDIG HEXDIG\n       *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n       *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n       */\n      function encodeUriQuery(val, pctEncodeSpaces) {\n        return encodeURIComponent(val).\n          replace(/%40/gi, '@').\n          replace(/%3A/gi, ':').\n          replace(/%24/g, '$').\n          replace(/%2C/gi, ',').\n          replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n      }\n\n      function Route(template, defaults) {\n        this.template = template;\n        this.defaults = extend({}, provider.defaults, defaults);\n        this.urlParams = {};\n      }\n\n      Route.prototype = {\n        setUrlParams: function(config, params, actionUrl) {\n          var self = this,\n            url = actionUrl || self.template,\n            val,\n            encodedVal;\n\n          var urlParams = self.urlParams = {};\n          forEach(url.split(/\\W/), function(param) {\n            if (param === 'hasOwnProperty') {\n              throw $resourceMinErr('badname', \"hasOwnProperty is not a valid parameter name.\");\n            }\n            if (!(new RegExp(\"^\\\\d+$\").test(param)) && param &&\n              (new RegExp(\"(^|[^\\\\\\\\]):\" + param + \"(\\\\W|$)\").test(url))) {\n              urlParams[param] = true;\n            }\n          });\n          url = url.replace(/\\\\:/g, ':');\n\n          params = params || {};\n          forEach(self.urlParams, function(_, urlParam) {\n            val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];\n            if (angular.isDefined(val) && val !== null) {\n              encodedVal = encodeUriSegment(val);\n              url = url.replace(new RegExp(\":\" + urlParam + \"(\\\\W|$)\", \"g\"), function(match, p1) {\n                return encodedVal + p1;\n              });\n            } else {\n              url = url.replace(new RegExp(\"(\\/?):\" + urlParam + \"(\\\\W|$)\", \"g\"), function(match,\n                  leadingSlashes, tail) {\n                if (tail.charAt(0) == '/') {\n                  return tail;\n                } else {\n                  return leadingSlashes + tail;\n                }\n              });\n            }\n          });\n\n          // strip trailing slashes and set the url (unless this behavior is specifically disabled)\n          if (self.defaults.stripTrailingSlashes) {\n            url = url.replace(/\\/+$/, '') || '/';\n          }\n\n          // then replace collapse `/.` if found in the last URL path segment before the query\n          // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`\n          url = url.replace(/\\/\\.(?=\\w+($|\\?))/, '.');\n          // replace escaped `/\\.` with `/.`\n          config.url = url.replace(/\\/\\\\\\./, '/.');\n\n\n          // set params - delegate param encoding to $http\n          forEach(params, function(value, key) {\n            if (!self.urlParams[key]) {\n              config.params = config.params || {};\n              config.params[key] = value;\n            }\n          });\n        }\n      };\n\n\n      function resourceFactory(url, paramDefaults, actions, options) {\n        var route = new Route(url, options);\n\n        actions = extend({}, provider.defaults.actions, actions);\n\n        function extractParams(data, actionParams) {\n          var ids = {};\n          actionParams = extend({}, paramDefaults, actionParams);\n          forEach(actionParams, function(value, key) {\n            if (isFunction(value)) { value = value(); }\n            ids[key] = value && value.charAt && value.charAt(0) == '@' ?\n              lookupDottedPath(data, value.substr(1)) : value;\n          });\n          return ids;\n        }\n\n        function defaultResponseInterceptor(response) {\n          return response.resource;\n        }\n\n        function Resource(value) {\n          shallowClearAndCopy(value || {}, this);\n        }\n\n        Resource.prototype.toJSON = function() {\n          var data = extend({}, this);\n          delete data.$promise;\n          delete data.$resolved;\n          return data;\n        };\n\n        forEach(actions, function(action, name) {\n          var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);\n\n          Resource[name] = function(a1, a2, a3, a4) {\n            var params = {}, data, success, error;\n\n            /* jshint -W086 */ /* (purposefully fall through case statements) */\n            switch (arguments.length) {\n              case 4:\n                error = a4;\n                success = a3;\n              //fallthrough\n              case 3:\n              case 2:\n                if (isFunction(a2)) {\n                  if (isFunction(a1)) {\n                    success = a1;\n                    error = a2;\n                    break;\n                  }\n\n                  success = a2;\n                  error = a3;\n                  //fallthrough\n                } else {\n                  params = a1;\n                  data = a2;\n                  success = a3;\n                  break;\n                }\n              case 1:\n                if (isFunction(a1)) success = a1;\n                else if (hasBody) data = a1;\n                else params = a1;\n                break;\n              case 0: break;\n              default:\n                throw $resourceMinErr('badargs',\n                  \"Expected up to 4 arguments [params, data, success, error], got {0} arguments\",\n                  arguments.length);\n            }\n            /* jshint +W086 */ /* (purposefully fall through case statements) */\n\n            var isInstanceCall = this instanceof Resource;\n            var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));\n            var httpConfig = {};\n            var responseInterceptor = action.interceptor && action.interceptor.response ||\n              defaultResponseInterceptor;\n            var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||\n              undefined;\n\n            forEach(action, function(value, key) {\n              if (key != 'params' && key != 'isArray' && key != 'interceptor') {\n                httpConfig[key] = copy(value);\n              }\n            });\n\n            if (hasBody) httpConfig.data = data;\n            route.setUrlParams(httpConfig,\n              extend({}, extractParams(data, action.params || {}), params),\n              action.url);\n\n            var promise = $http(httpConfig).then(function(response) {\n              var data = response.data,\n                promise = value.$promise;\n\n              if (data) {\n                // Need to convert action.isArray to boolean in case it is undefined\n                // jshint -W018\n                if (angular.isArray(data) !== (!!action.isArray)) {\n                  throw $resourceMinErr('badcfg',\n                      'Error in resource configuration for action `{0}`. Expected response to ' +\n                      'contain an {1} but got an {2}', name, action.isArray ? 'array' : 'object',\n                    angular.isArray(data) ? 'array' : 'object');\n                }\n                // jshint +W018\n                if (action.isArray) {\n                  value.length = 0;\n                  forEach(data, function(item) {\n                    if (typeof item === \"object\") {\n                      value.push(new Resource(item));\n                    } else {\n                      // Valid JSON values may be string literals, and these should not be converted\n                      // into objects. These items will not have access to the Resource prototype\n                      // methods, but unfortunately there\n                      value.push(item);\n                    }\n                  });\n                } else {\n                  shallowClearAndCopy(data, value);\n                  value.$promise = promise;\n                }\n              }\n\n              value.$resolved = true;\n\n              response.resource = value;\n\n              return response;\n            }, function(response) {\n              value.$resolved = true;\n\n              (error || noop)(response);\n\n              return $q.reject(response);\n            });\n\n            promise = promise.then(\n              function(response) {\n                var value = responseInterceptor(response);\n                (success || noop)(value, response.headers);\n                return value;\n              },\n              responseErrorInterceptor);\n\n            if (!isInstanceCall) {\n              // we are creating instance / collection\n              // - set the initial promise\n              // - return the instance / collection\n              value.$promise = promise;\n              value.$resolved = false;\n\n              return value;\n            }\n\n            // instance call\n            return promise;\n          };\n\n\n          Resource.prototype['$' + name] = function(params, success, error) {\n            if (isFunction(params)) {\n              error = success; success = params; params = {};\n            }\n            var result = Resource[name].call(this, params, this, success, error);\n            return result.$promise || result;\n          };\n        });\n\n        Resource.bind = function(additionalParamDefaults) {\n          return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);\n        };\n\n        return Resource;\n      }\n\n      return resourceFactory;\n    }];\n  });\n\n\n})(window, window.angular);\n"
  },
  {
    "path": "www/lib/angular-resource/bower.json",
    "content": "{\n  \"name\": \"angular-resource\",\n  \"version\": \"1.3.15\",\n  \"main\": \"./angular-resource.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.15\"\n  }\n}\n"
  },
  {
    "path": "www/lib/angular-resource/index.js",
    "content": "require('./angular-resource');\nmodule.exports = 'ngResource';\n"
  },
  {
    "path": "www/lib/angular-resource/package.json",
    "content": "{\n  \"name\": \"angular-resource\",\n  \"version\": \"1.3.15\",\n  \"description\": \"AngularJS module for interacting with RESTful server-side data sources\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/angular/angular.js.git\"\n  },\n  \"keywords\": [\n    \"angular\",\n    \"framework\",\n    \"browser\",\n    \"rest\",\n    \"client-side\"\n  ],\n  \"author\": \"Angular Core Team <angular-core+npm@google.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/angular/angular.js/issues\"\n  },\n  \"homepage\": \"http://angularjs.org\"\n}\n"
  },
  {
    "path": "www/lib/angular-sanitize/.bower.json",
    "content": "{\n  \"name\": \"angular-sanitize\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular-sanitize.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.13\"\n  },\n  \"homepage\": \"https://github.com/angular/bower-angular-sanitize\",\n  \"_release\": \"1.3.13\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v1.3.13\",\n    \"commit\": \"ee7a595d32ae566701da29873eb1dfb466e3cfef\"\n  },\n  \"_source\": \"git://github.com/angular/bower-angular-sanitize.git\",\n  \"_target\": \"1.3.13\",\n  \"_originalSource\": \"angular-sanitize\"\n}"
  },
  {
    "path": "www/lib/angular-sanitize/README.md",
    "content": "# packaged angular-sanitize\n\nThis repo is for distribution on `npm` and `bower`. The source for this module is in the\n[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngSanitize).\nPlease file issues and pull requests against that repo.\n\n## Install\n\nYou can install this package either with `npm` or with `bower`.\n\n### npm\n\n```shell\nnpm install angular-sanitize\n```\n\nAdd a `<script>` to your `index.html`:\n\n```html\n<script src=\"/node_modules/angular-sanitize/angular-sanitize.js\"></script>\n```\n\nThen add `ngSanitize` as a dependency for your app:\n\n```javascript\nangular.module('myApp', ['ngSanitize']);\n```\n\nNote that this package is not in CommonJS format, so doing `require('angular-sanitize')` will\nreturn `undefined`.\n\n### bower\n\n```shell\nbower install angular-sanitize\n```\n\nAdd a `<script>` to your `index.html`:\n\n```html\n<script src=\"/bower_components/angular-sanitize/angular-sanitize.js\"></script>\n```\n\nThen add `ngSanitize` as a dependency for your app:\n\n```javascript\nangular.module('myApp', ['ngSanitize']);\n```\n\n## Documentation\n\nDocumentation is available on the\n[AngularJS docs site](http://docs.angularjs.org/api/ngSanitize).\n\n## License\n\nThe MIT License\n\nCopyright (c) 2010-2012 Google, Inc. http://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": "www/lib/angular-sanitize/angular-sanitize.js",
    "content": "/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\nvar $sanitizeMinErr = angular.$$minErr('$sanitize');\n\n/**\n * @ngdoc module\n * @name ngSanitize\n * @description\n *\n * # ngSanitize\n *\n * The `ngSanitize` module provides functionality to sanitize HTML.\n *\n *\n * <div doc-module-components=\"ngSanitize\"></div>\n *\n * See {@link ngSanitize.$sanitize `$sanitize`} for usage.\n */\n\n/*\n * HTML Parser By Misko Hevery (misko@hevery.com)\n * based on:  HTML Parser By John Resig (ejohn.org)\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n *\n * // Use like so:\n * htmlParser(htmlString, {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * });\n *\n */\n\n\n/**\n * @ngdoc service\n * @name $sanitize\n * @kind function\n *\n * @description\n *   The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are\n *   then serialized back to properly escaped html string. This means that no unsafe input can make\n *   it into the returned string, however, since our parser is more strict than a typical browser\n *   parser, it's possible that some obscure input, which would be recognized as valid HTML by a\n *   browser, won't make it through the sanitizer. The input may also contain SVG markup.\n *   The whitelist is configured using the functions `aHrefSanitizationWhitelist` and\n *   `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.\n *\n * @param {string} html HTML input.\n * @returns {string} Sanitized HTML.\n *\n * @example\n   <example module=\"sanitizeExample\" deps=\"angular-sanitize.js\">\n   <file name=\"index.html\">\n     <script>\n         angular.module('sanitizeExample', ['ngSanitize'])\n           .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {\n             $scope.snippet =\n               '<p style=\"color:blue\">an html\\n' +\n               '<em onmouseover=\"this.textContent=\\'PWN3D!\\'\">click here</em>\\n' +\n               'snippet</p>';\n             $scope.deliberatelyTrustDangerousSnippet = function() {\n               return $sce.trustAsHtml($scope.snippet);\n             };\n           }]);\n     </script>\n     <div ng-controller=\"ExampleController\">\n        Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n       <table>\n         <tr>\n           <td>Directive</td>\n           <td>How</td>\n           <td>Source</td>\n           <td>Rendered</td>\n         </tr>\n         <tr id=\"bind-html-with-sanitize\">\n           <td>ng-bind-html</td>\n           <td>Automatically uses $sanitize</td>\n           <td><pre>&lt;div ng-bind-html=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n           <td><div ng-bind-html=\"snippet\"></div></td>\n         </tr>\n         <tr id=\"bind-html-with-trust\">\n           <td>ng-bind-html</td>\n           <td>Bypass $sanitize by explicitly trusting the dangerous value</td>\n           <td>\n           <pre>&lt;div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"&gt;\n&lt;/div&gt;</pre>\n           </td>\n           <td><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"></div></td>\n         </tr>\n         <tr id=\"bind-default\">\n           <td>ng-bind</td>\n           <td>Automatically escapes</td>\n           <td><pre>&lt;div ng-bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n           <td><div ng-bind=\"snippet\"></div></td>\n         </tr>\n       </table>\n       </div>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n     it('should sanitize the html snippet by default', function() {\n       expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n         toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n     });\n\n     it('should inline raw snippet if bound to a trusted value', function() {\n       expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).\n         toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n              \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n              \"snippet</p>\");\n     });\n\n     it('should escape snippet without any filter', function() {\n       expect(element(by.css('#bind-default div')).getInnerHtml()).\n         toBe(\"&lt;p style=\\\"color:blue\\\"&gt;an html\\n\" +\n              \"&lt;em onmouseover=\\\"this.textContent='PWN3D!'\\\"&gt;click here&lt;/em&gt;\\n\" +\n              \"snippet&lt;/p&gt;\");\n     });\n\n     it('should update', function() {\n       element(by.model('snippet')).clear();\n       element(by.model('snippet')).sendKeys('new <b onclick=\"alert(1)\">text</b>');\n       expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n         toBe('new <b>text</b>');\n       expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n         'new <b onclick=\"alert(1)\">text</b>');\n       expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n         \"new &lt;b onclick=\\\"alert(1)\\\"&gt;text&lt;/b&gt;\");\n     });\n   </file>\n   </example>\n */\nfunction $SanitizeProvider() {\n  this.$get = ['$$sanitizeUri', function($$sanitizeUri) {\n    return function(html) {\n      var buf = [];\n      htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {\n        return !/^unsafe/.test($$sanitizeUri(uri, isImage));\n      }));\n      return buf.join('');\n    };\n  }];\n}\n\nfunction sanitizeText(chars) {\n  var buf = [];\n  var writer = htmlSanitizeWriter(buf, angular.noop);\n  writer.chars(chars);\n  return buf.join('');\n}\n\n\n// Regular Expressions for parsing tags and attributes\nvar START_TAG_REGEXP =\n       /^<((?:[a-zA-Z])[\\w:-]*)((?:\\s+[\\w:-]+(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)\\s*(>?)/,\n  END_TAG_REGEXP = /^<\\/\\s*([\\w:-]+)[^>]*>/,\n  ATTR_REGEXP = /([\\w:-]+)(?:\\s*=\\s*(?:(?:\"((?:[^\"])*)\")|(?:'((?:[^'])*)')|([^>\\s]+)))?/g,\n  BEGIN_TAG_REGEXP = /^</,\n  BEGING_END_TAGE_REGEXP = /^<\\//,\n  COMMENT_REGEXP = /<!--(.*?)-->/g,\n  DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,\n  CDATA_REGEXP = /<!\\[CDATA\\[(.*?)]]>/g,\n  SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n  // Match everything outside of normal chars and \" (quote character)\n  NON_ALPHANUMERIC_REGEXP = /([^\\#-~| |!])/g;\n\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar voidElements = makeMap(\"area,br,col,hr,img,wbr\");\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar optionalEndTagBlockElements = makeMap(\"colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr\"),\n    optionalEndTagInlineElements = makeMap(\"rp,rt\"),\n    optionalEndTagElements = angular.extend({},\n                                            optionalEndTagInlineElements,\n                                            optionalEndTagBlockElements);\n\n// Safe Block Elements - HTML5\nvar blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap(\"address,article,\" +\n        \"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,\" +\n        \"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul\"));\n\n// Inline Elements - HTML5\nvar inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap(\"a,abbr,acronym,b,\" +\n        \"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,\" +\n        \"samp,small,span,strike,strong,sub,sup,time,tt,u,var\"));\n\n// SVG Elements\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements\nvar svgElements = makeMap(\"animate,animateColor,animateMotion,animateTransform,circle,defs,\" +\n        \"desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,\" +\n        \"line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,\" +\n        \"stop,svg,switch,text,title,tspan,use\");\n\n// Special Elements (can contain anything)\nvar specialElements = makeMap(\"script,style\");\n\nvar validElements = angular.extend({},\n                                   voidElements,\n                                   blockElements,\n                                   inlineElements,\n                                   optionalEndTagElements,\n                                   svgElements);\n\n//Attributes that have href and hence need to be sanitized\nvar uriAttrs = makeMap(\"background,cite,href,longdesc,src,usemap,xlink:href\");\n\nvar htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +\n    'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +\n    'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +\n    'scope,scrolling,shape,size,span,start,summary,target,title,type,' +\n    'valign,value,vspace,width');\n\n// SVG attributes (without \"id\" and \"name\" attributes)\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes\nvar svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +\n    'attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,' +\n    'color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,' +\n    'font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,' +\n    'gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,' +\n    'keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,' +\n    'markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,' +\n    'overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,' +\n    'repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,' +\n    'stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,' +\n    'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,' +\n    'stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,' +\n    'underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,' +\n    'viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,' +\n    'xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,' +\n    'zoomAndPan');\n\nvar validAttrs = angular.extend({},\n                                uriAttrs,\n                                svgAttrs,\n                                htmlAttrs);\n\nfunction makeMap(str) {\n  var obj = {}, items = str.split(','), i;\n  for (i = 0; i < items.length; i++) obj[items[i]] = true;\n  return obj;\n}\n\n\n/**\n * @example\n * htmlParser(htmlString, {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * });\n *\n * @param {string} html string\n * @param {object} handler\n */\nfunction htmlParser(html, handler) {\n  if (typeof html !== 'string') {\n    if (html === null || typeof html === 'undefined') {\n      html = '';\n    } else {\n      html = '' + html;\n    }\n  }\n  var index, chars, match, stack = [], last = html, text;\n  stack.last = function() { return stack[stack.length - 1]; };\n\n  while (html) {\n    text = '';\n    chars = true;\n\n    // Make sure we're not in a script or style element\n    if (!stack.last() || !specialElements[stack.last()]) {\n\n      // Comment\n      if (html.indexOf(\"<!--\") === 0) {\n        // comments containing -- are not allowed unless they terminate the comment\n        index = html.indexOf(\"--\", 4);\n\n        if (index >= 0 && html.lastIndexOf(\"-->\", index) === index) {\n          if (handler.comment) handler.comment(html.substring(4, index));\n          html = html.substring(index + 3);\n          chars = false;\n        }\n      // DOCTYPE\n      } else if (DOCTYPE_REGEXP.test(html)) {\n        match = html.match(DOCTYPE_REGEXP);\n\n        if (match) {\n          html = html.replace(match[0], '');\n          chars = false;\n        }\n      // end tag\n      } else if (BEGING_END_TAGE_REGEXP.test(html)) {\n        match = html.match(END_TAG_REGEXP);\n\n        if (match) {\n          html = html.substring(match[0].length);\n          match[0].replace(END_TAG_REGEXP, parseEndTag);\n          chars = false;\n        }\n\n      // start tag\n      } else if (BEGIN_TAG_REGEXP.test(html)) {\n        match = html.match(START_TAG_REGEXP);\n\n        if (match) {\n          // We only have a valid start-tag if there is a '>'.\n          if (match[4]) {\n            html = html.substring(match[0].length);\n            match[0].replace(START_TAG_REGEXP, parseStartTag);\n          }\n          chars = false;\n        } else {\n          // no ending tag found --- this piece should be encoded as an entity.\n          text += '<';\n          html = html.substring(1);\n        }\n      }\n\n      if (chars) {\n        index = html.indexOf(\"<\");\n\n        text += index < 0 ? html : html.substring(0, index);\n        html = index < 0 ? \"\" : html.substring(index);\n\n        if (handler.chars) handler.chars(decodeEntities(text));\n      }\n\n    } else {\n      // IE versions 9 and 10 do not understand the regex '[^]', so using a workaround with [\\W\\w].\n      html = html.replace(new RegExp(\"([\\\\W\\\\w]*)<\\\\s*\\\\/\\\\s*\" + stack.last() + \"[^>]*>\", 'i'),\n        function(all, text) {\n          text = text.replace(COMMENT_REGEXP, \"$1\").replace(CDATA_REGEXP, \"$1\");\n\n          if (handler.chars) handler.chars(decodeEntities(text));\n\n          return \"\";\n      });\n\n      parseEndTag(\"\", stack.last());\n    }\n\n    if (html == last) {\n      throw $sanitizeMinErr('badparse', \"The sanitizer was unable to parse the following block \" +\n                                        \"of html: {0}\", html);\n    }\n    last = html;\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function parseStartTag(tag, tagName, rest, unary) {\n    tagName = angular.lowercase(tagName);\n    if (blockElements[tagName]) {\n      while (stack.last() && inlineElements[stack.last()]) {\n        parseEndTag(\"\", stack.last());\n      }\n    }\n\n    if (optionalEndTagElements[tagName] && stack.last() == tagName) {\n      parseEndTag(\"\", tagName);\n    }\n\n    unary = voidElements[tagName] || !!unary;\n\n    if (!unary)\n      stack.push(tagName);\n\n    var attrs = {};\n\n    rest.replace(ATTR_REGEXP,\n      function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {\n        var value = doubleQuotedValue\n          || singleQuotedValue\n          || unquotedValue\n          || '';\n\n        attrs[name] = decodeEntities(value);\n    });\n    if (handler.start) handler.start(tagName, attrs, unary);\n  }\n\n  function parseEndTag(tag, tagName) {\n    var pos = 0, i;\n    tagName = angular.lowercase(tagName);\n    if (tagName)\n      // Find the closest opened tag of the same type\n      for (pos = stack.length - 1; pos >= 0; pos--)\n        if (stack[pos] == tagName)\n          break;\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (i = stack.length - 1; i >= pos; i--)\n        if (handler.end) handler.end(stack[i]);\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n    }\n  }\n}\n\nvar hiddenPre=document.createElement(\"pre\");\nvar spaceRe = /^(\\s*)([\\s\\S]*?)(\\s*)$/;\n/**\n * decodes all entities into regular string\n * @param value\n * @returns {string} A string with decoded entities.\n */\nfunction decodeEntities(value) {\n  if (!value) { return ''; }\n\n  // Note: IE8 does not preserve spaces at the start/end of innerHTML\n  // so we must capture them and reattach them afterward\n  var parts = spaceRe.exec(value);\n  var spaceBefore = parts[1];\n  var spaceAfter = parts[3];\n  var content = parts[2];\n  if (content) {\n    hiddenPre.innerHTML=content.replace(/</g,\"&lt;\");\n    // innerText depends on styling as it doesn't display hidden elements.\n    // Therefore, it's better to use textContent not to cause unnecessary\n    // reflows. However, IE<9 don't support textContent so the innerText\n    // fallback is necessary.\n    content = 'textContent' in hiddenPre ?\n      hiddenPre.textContent : hiddenPre.innerText;\n  }\n  return spaceBefore + content + spaceAfter;\n}\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n * @returns {string} escaped text\n */\nfunction encodeEntities(value) {\n  return value.\n    replace(/&/g, '&amp;').\n    replace(SURROGATE_PAIR_REGEXP, function(value) {\n      var hi = value.charCodeAt(0);\n      var low = value.charCodeAt(1);\n      return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n    }).\n    replace(NON_ALPHANUMERIC_REGEXP, function(value) {\n      return '&#' + value.charCodeAt(0) + ';';\n    }).\n    replace(/</g, '&lt;').\n    replace(/>/g, '&gt;');\n}\n\n/**\n * create an HTML/XML writer which writes to buffer\n * @param {Array} buf use buf.jain('') to get out sanitized html string\n * @returns {object} in the form of {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * }\n */\nfunction htmlSanitizeWriter(buf, uriValidator) {\n  var ignore = false;\n  var out = angular.bind(buf, buf.push);\n  return {\n    start: function(tag, attrs, unary) {\n      tag = angular.lowercase(tag);\n      if (!ignore && specialElements[tag]) {\n        ignore = tag;\n      }\n      if (!ignore && validElements[tag] === true) {\n        out('<');\n        out(tag);\n        angular.forEach(attrs, function(value, key) {\n          var lkey=angular.lowercase(key);\n          var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');\n          if (validAttrs[lkey] === true &&\n            (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {\n            out(' ');\n            out(key);\n            out('=\"');\n            out(encodeEntities(value));\n            out('\"');\n          }\n        });\n        out(unary ? '/>' : '>');\n      }\n    },\n    end: function(tag) {\n        tag = angular.lowercase(tag);\n        if (!ignore && validElements[tag] === true) {\n          out('</');\n          out(tag);\n          out('>');\n        }\n        if (tag == ignore) {\n          ignore = false;\n        }\n      },\n    chars: function(chars) {\n        if (!ignore) {\n          out(encodeEntities(chars));\n        }\n      }\n  };\n}\n\n\n// define ngSanitize module and register $sanitize service\nangular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);\n\n/* global sanitizeText: false */\n\n/**\n * @ngdoc filter\n * @name linky\n * @kind function\n *\n * @description\n * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and\n * plain email address links.\n *\n * Requires the {@link ngSanitize `ngSanitize`} module to be installed.\n *\n * @param {string} text Input text.\n * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.\n * @returns {string} Html-linkified text.\n *\n * @usage\n   <span ng-bind-html=\"linky_expression | linky\"></span>\n *\n * @example\n   <example module=\"linkyExample\" deps=\"angular-sanitize.js\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('linkyExample', ['ngSanitize'])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.snippet =\n               'Pretty text with some links:\\n'+\n               'http://angularjs.org/,\\n'+\n               'mailto:us@somewhere.org,\\n'+\n               'another@somewhere.org,\\n'+\n               'and one more: ftp://127.0.0.1/.';\n             $scope.snippetWithTarget = 'http://angularjs.org/';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n       Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n       <table>\n         <tr>\n           <td>Filter</td>\n           <td>Source</td>\n           <td>Rendered</td>\n         </tr>\n         <tr id=\"linky-filter\">\n           <td>linky filter</td>\n           <td>\n             <pre>&lt;div ng-bind-html=\"snippet | linky\"&gt;<br>&lt;/div&gt;</pre>\n           </td>\n           <td>\n             <div ng-bind-html=\"snippet | linky\"></div>\n           </td>\n         </tr>\n         <tr id=\"linky-target\">\n          <td>linky target</td>\n          <td>\n            <pre>&lt;div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"&gt;<br>&lt;/div&gt;</pre>\n          </td>\n          <td>\n            <div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"></div>\n          </td>\n         </tr>\n         <tr id=\"escaped-html\">\n           <td>no filter</td>\n           <td><pre>&lt;div ng-bind=\"snippet\"&gt;<br>&lt;/div&gt;</pre></td>\n           <td><div ng-bind=\"snippet\"></div></td>\n         </tr>\n       </table>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should linkify the snippet with urls', function() {\n         expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n             toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +\n                  'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n         expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);\n       });\n\n       it('should not linkify snippet without the linky filter', function() {\n         expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).\n             toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +\n                  'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n         expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);\n       });\n\n       it('should update', function() {\n         element(by.model('snippet')).clear();\n         element(by.model('snippet')).sendKeys('new http://link.');\n         expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n             toBe('new http://link.');\n         expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);\n         expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())\n             .toBe('new http://link.');\n       });\n\n       it('should work with the target property', function() {\n        expect(element(by.id('linky-target')).\n            element(by.binding(\"snippetWithTarget | linky:'_blank'\")).getText()).\n            toBe('http://angularjs.org/');\n        expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');\n       });\n     </file>\n   </example>\n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n  var LINKY_URL_REGEXP =\n        /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]/,\n      MAILTO_REGEXP = /^mailto:/;\n\n  return function(text, target) {\n    if (!text) return text;\n    var match;\n    var raw = text;\n    var html = [];\n    var url;\n    var i;\n    while ((match = raw.match(LINKY_URL_REGEXP))) {\n      // We can not end in these as they are sometimes found at the end of the sentence\n      url = match[0];\n      // if we did not match ftp/http/www/mailto then assume mailto\n      if (!match[2] && !match[4]) {\n        url = (match[3] ? 'http://' : 'mailto:') + url;\n      }\n      i = match.index;\n      addText(raw.substr(0, i));\n      addLink(url, match[0].replace(MAILTO_REGEXP, ''));\n      raw = raw.substring(i + match[0].length);\n    }\n    addText(raw);\n    return $sanitize(html.join(''));\n\n    function addText(text) {\n      if (!text) {\n        return;\n      }\n      html.push(sanitizeText(text));\n    }\n\n    function addLink(url, text) {\n      html.push('<a ');\n      if (angular.isDefined(target)) {\n        html.push('target=\"',\n                  target,\n                  '\" ');\n      }\n      html.push('href=\"',\n                url.replace(/\"/g, '&quot;'),\n                '\">');\n      addText(text);\n      html.push('</a>');\n    }\n  };\n}]);\n\n\n})(window, window.angular);\n"
  },
  {
    "path": "www/lib/angular-sanitize/bower.json",
    "content": "{\n  \"name\": \"angular-sanitize\",\n  \"version\": \"1.3.13\",\n  \"main\": \"./angular-sanitize.js\",\n  \"ignore\": [],\n  \"dependencies\": {\n    \"angular\": \"1.3.13\"\n  }\n}\n"
  },
  {
    "path": "www/lib/angular-sanitize/package.json",
    "content": "{\n  \"name\": \"angular-sanitize\",\n  \"version\": \"1.3.13\",\n  \"description\": \"AngularJS module for sanitizing HTML\",\n  \"main\": \"angular-sanitize.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/angular/angular.js.git\"\n  },\n  \"keywords\": [\n    \"angular\",\n    \"framework\",\n    \"browser\",\n    \"html\",\n    \"client-side\"\n  ],\n  \"author\": \"Angular Core Team <angular-core+npm@google.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/angular/angular.js/issues\"\n  },\n  \"homepage\": \"http://angularjs.org\"\n}\n"
  },
  {
    "path": "www/lib/angular-ui-router/.bower.json",
    "content": "{\n  \"name\": \"angular-ui-router\",\n  \"version\": \"0.2.13\",\n  \"main\": \"./release/angular-ui-router.js\",\n  \"dependencies\": {\n    \"angular\": \">= 1.0.8\"\n  },\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"component.json\",\n    \"package.json\",\n    \"lib\",\n    \"config\",\n    \"sample\",\n    \"test\",\n    \"tests\",\n    \"ngdoc_assets\",\n    \"Gruntfile.js\",\n    \"files.js\"\n  ],\n  \"homepage\": \"https://github.com/angular-ui/ui-router\",\n  \"_release\": \"0.2.13\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"0.2.13\",\n    \"commit\": \"c3d543aae43d4600512520a0d70723ac31f2cb62\"\n  },\n  \"_source\": \"git://github.com/angular-ui/ui-router.git\",\n  \"_target\": \"0.2.13\",\n  \"_originalSource\": \"angular-ui-router\"\n}"
  },
  {
    "path": "www/lib/angular-ui-router/CHANGELOG.md",
    "content": "<a name=\"0.2.13\"></a>\n### 0.2.13 (2014-11-20)\n\nThis release primarily fixes issues reported against 0.2.12\n\n#### Bug Fixes\n\n* **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513))\n  * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573))\n* **$urlMatcherFactory:**\n  * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293))\n  * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564))\n  * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c))\n  * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562))\n  * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119))\n  * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543))\n* **ArrayType:**\n  * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511))\n  * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538))\n* **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554))\n* **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563))\n* **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556))\n\n\n#### Features\n\n* add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a))\n\n\n<a name=\"0.2.12\"></a>\n### 0.2.12 (2014-11-13)\n\n#### Bug Fixes\n\n* **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353])\n* **$state:**\n  * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396])\n  * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582])\n  * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387))\n  * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))\n  * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))\n* **$urlMatcherFactory:**\n  * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476])\n  * made path params default value \"\" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba))\n  * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3))\n  * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860))\n  * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0))\n  * \"string\" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119])\n  * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394])\n  * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488))\n  * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487))\n  * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41))\n  * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414))\n  * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395])\n* **ui-sref:**\n  * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0))\n  * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0))\n  * nagivate to state when url is \"\" fix($state.href): generate href for state with  ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363))\n  * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332))\n* **uiView:**\n  * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324))\n  * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345))\n* **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48))\n* **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479])\n* **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383])\n* **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e))\n* **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3))\n\n\n#### Features\n\n##### Default and Typed params\n\nThis release includes a lot of bug fixes around default/optional and typed parameters.  As such, 0.2.12 is the first release where we recommend those features be used.\n\n* **$state:**\n  * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433))\n  * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852))\n  * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373))\n* **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287])\n* **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2))\n\n\n\n<a name=\"0.2.11\"></a>\n### 0.2.11 (2014-08-26)\n\n\n#### Bug Fixes\n\n* **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9))\n* **$state:**\n  * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769))\n  * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980))\n  * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35))\n  * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a))\n* **$urlMatcherFactory:**\n  * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5))\n  * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3))\n* **UrlMatcher:**\n  * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51))\n  * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e))\n* **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48))\n* **uiSref:**\n  * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad))\n  * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb))\n  * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022))\n* **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194))\n* **docs:**\n  * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33))\n  * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1))\n  * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d))\n  * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377))\n\n\n#### Features\n\n* **$state:**\n  * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822))\n    * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null.\n  * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172))\n* **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f))\n* **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e))\n* **uiSrefActive:** \n  * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818))\n    * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance.\n\n  * uiSrefActiveEq: new directive with old ui-sref-active behavior\n* **$urlRouter:**\n  * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7))\n  * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6))\n  * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50))\n* **$urlMatcherFactory:**\n  * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221))\n  * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb))\n  * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4))\n* **UrlMatcher:**\n  * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373))\n  * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec))\n  * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11))\n  * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5))\n  * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11))\n  * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3))\n  * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580))\n    * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name.\n\n### 0.2.10 (2014-03-12)\n\n\n#### Bug Fixes\n\n* **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d))\n* **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e))\n* **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b))\n* **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7))\n* **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418))\n* **uiView:**\n  * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807))\n  * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552))\n\n\n#### Features\n\n* **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b))\n* **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5))\n* **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a))\n* **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d))\n\n\n### 0.2.9 (2014-01-17)\n\n\nThis release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower.\n\n\n### 0.2.8 (2014-01-16)\n\n\n#### Bug Fixes\n\n* **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178))\n* **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb))\n* **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3))\n* **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671))\n* **uiView:**\n  * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a))\n  * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9))\n  * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de))\n  * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff))\n\n\n#### Features\n\n* **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e))\n* **uiView:**\n  * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252))\n  * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258))\n"
  },
  {
    "path": "www/lib/angular-ui-router/CONTRIBUTING.md",
    "content": "\n# Report an Issue\n\nHelp us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure\nit hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues)\nto see if someone's reported one similar to yours.\n\nIf not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code\nas possible: the more minimalist, the faster we can debug it).\n\nNext, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem,\nand provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to\nthat plunkr you created!\n\n**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure\nis a bug, it's best to talk it out on\n[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This\nkeeps development streamlined, and helps us focus on building great software.\n\n\nIssues only! |\n-------------|\nPlease keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). |\n\n####Purple Labels\nA purple label means that **you** need to take some further action.  \n - ![Not Actionable - Need Info](http://angular-ui.github.io/ui-router/images/notactionable.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue.\n - ![Plunkr Please](http://angular-ui.github.io/ui-router/images/plunkrplease.png): Please [create a plunkr](http://bit.ly/UIR-Plunk)\n - ![StackOverflow](http://angular-ui.github.io/ui-router/images/stackoverflow.png): We suspect your issue is really a help request, or could be answered by the community.  Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router).  If you determine that is an actual issue, please explain why.\n \nIf your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately.\n\n# Contribute\n\n**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine.\n\n**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed.\n\n**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea.\n\n**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules:\n\n- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests\n- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one\n- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release.\n- Changes should always respect the coding style of the project\n\n\n\n# Developing\n\nUI-Router uses <code>grunt >= 0.4.x</code>. Make sure to upgrade your environment and read the\n[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4).\n\nDependencies for building from source and running tests:\n\n* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli`\n* Then, install the development dependencies by running `$ npm install` from the project directory\n\nThere are a number of targets in the gruntfile that are used to generating different builds:\n\n* `grunt`: Perform a normal build, runs jshint and karma tests\n* `grunt build`: Perform a normal build\n* `grunt dist`: Perform a clean build and generate documentation\n* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes.\n"
  },
  {
    "path": "www/lib/angular-ui-router/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2014 The AngularUI Team, Karsten Sperling\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": "www/lib/angular-ui-router/README.md",
    "content": "# AngularUI Router &nbsp;[![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router)\n\n#### The de-facto solution to flexible routing with nested views\n---\n**[Download 0.2.11](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|**\n**[Guide](https://github.com/angular-ui/ui-router/wiki) |**\n**[API](http://angular-ui.github.io/ui-router/site) |**\n**[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |**\n**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |**\n**[Resources](#resources) |**\n**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |**\n**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |**\n**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |**\n**[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)**\n\n---\n\nAngularUI Router is a routing framework for [AngularJS](http://angularjs.org), which allows you to organize the\nparts of your interface into a [*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine). Unlike the\n[`$route` service](http://docs.angularjs.org/api/ngRoute.$route) in the Angular ngRoute module, which is organized around URL\nroutes, UI-Router is organized around [*states*](https://github.com/angular-ui/ui-router/wiki),\nwhich may optionally have routes, as well as other behavior, attached.\n\nStates are bound to *named*, *nested* and *parallel views*, allowing you to powerfully manage your application's interface.\n\nCheck out the sample app: http://angular-ui.github.io/ui-router/sample/\n\n-\n**Note:** *UI-Router is under active development. As such, while this library is well-tested, the API may change. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.*\n\n\n## Get Started\n\n**(1)** Get UI-Router in one of the following ways:\n - clone & [build](CONTRIBUTING.md#developing) this repository\n - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js))\n - via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console\n - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console\n - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console\n\n**(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step)\n\n**(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`)\n\nWhen you're done, your setup should look similar to the following:\n\n>\n```html\n<!doctype html>\n<html ng-app=\"myApp\">\n<head>\n    <script src=\"//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js\"></script>\n    <script src=\"js/angular-ui-router.min.js\"></script>\n    <script>\n        var myApp = angular.module('myApp', ['ui.router']);\n        // For Component users, it should look like this:\n        // var myApp = angular.module('myApp', [require('angular-ui-router')]);\n    </script>\n    ...\n</head>\n<body>\n    ...\n</body>\n</html>\n```\n\n### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)\n\nThe majority of UI-Router's power is in its ability to nest states & views.\n\n**(1)** First, follow the [setup](#get-started) instructions detailed above.\n\n**(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `<body />` of your app.\n\n>\n```html\n<!-- index.html -->\n<body>\n    <div ui-view></div>\n    <!-- We'll also add some navigation: -->\n    <a ui-sref=\"state1\">State 1</a>\n    <a ui-sref=\"state2\">State 2</a>\n</body>\n```\n\n**(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `<a />` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views.\n\n>\n```html\n<!-- partials/state1.html -->\n<h1>State 1</h1>\n<hr/>\n<a ui-sref=\"state1.list\">Show List</a>\n<div ui-view></div>\n```\n```html\n<!-- partials/state2.html -->\n<h1>State 2</h1>\n<hr/>\n<a ui-sref=\"state2.list\">Show List</a>\n<div ui-view></div>\n```\n\n**(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates.\n\n>\n```html\n<!-- partials/state1.list.html -->\n<h3>List of State 1 Items</h3>\n<ul>\n  <li ng-repeat=\"item in items\">{{ item }}</li>\n</ul>\n```\n\n>\n```html\n<!-- partials/state2.list.html -->\n<h3>List of State 2 Things</h3>\n<ul>\n  <li ng-repeat=\"thing in things\">{{ thing }}</li>\n</ul>\n```\n\n**(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following:\n\n\n>\n```javascript\nmyApp.config(function($stateProvider, $urlRouterProvider) {\n  //\n  // For any unmatched url, redirect to /state1\n  $urlRouterProvider.otherwise(\"/state1\");\n  //\n  // Now set up the states\n  $stateProvider\n    .state('state1', {\n      url: \"/state1\",\n      templateUrl: \"partials/state1.html\"\n    })\n    .state('state1.list', {\n      url: \"/list\",\n      templateUrl: \"partials/state1.list.html\",\n      controller: function($scope) {\n        $scope.items = [\"A\", \"List\", \"Of\", \"Items\"];\n      }\n    })\n    .state('state2', {\n      url: \"/state2\",\n      templateUrl: \"partials/state2.html\"\n    })\n    .state('state2.list', {\n      url: \"/list\",\n      templateUrl: \"partials/state2.list.html\",\n      controller: function($scope) {\n        $scope.things = [\"A\", \"Set\", \"Of\", \"Things\"];\n      }\n    });\n});\n```\n\n**(6)** See this quick start example in action.\n>**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)**\n\n**(7)** This only scratches the surface\n>**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)**\n\n\n### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)\n\nAnother great feature is the ability to have multiple `ui-view`s view per template.\n\n**Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your\ninterfaces more effectively by nesting your views, and pairing those views with nested states.*\n\n**(1)** Follow the [setup](#get-started) instructions detailed above.\n\n**(2)** Add one or more `ui-view` to your app, give them names.\n>\n```html\n<!-- index.html -->\n<body>\n    <div ui-view=\"viewA\"></div>\n    <div ui-view=\"viewB\"></div>\n    <!-- Also a way to navigate -->\n    <a ui-sref=\"route1\">Route 1</a>\n    <a ui-sref=\"route2\">Route 2</a>\n</body>\n```\n\n**(3)** Set up your states in the module config:\n>\n```javascript\nmyApp.config(function($stateProvider) {\n  $stateProvider\n    .state('index', {\n      url: \"\",\n      views: {\n        \"viewA\": { template: \"index.viewA\" },\n        \"viewB\": { template: \"index.viewB\" }\n      }\n    })\n    .state('route1', {\n      url: \"/route1\",\n      views: {\n        \"viewA\": { template: \"route1.viewA\" },\n        \"viewB\": { template: \"route1.viewB\" }\n      }\n    })\n    .state('route2', {\n      url: \"/route2\",\n      views: {\n        \"viewA\": { template: \"route2.viewA\" },\n        \"viewB\": { template: \"route2.viewB\" }\n      }\n    })\n});\n```\n\n**(4)** See this quick start example in action.\n>**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)**\n\n\n## Resources\n\n* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki)\n* [API Reference](http://angular-ui.github.io/ui-router/site)\n* [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample))\n* [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions)\n* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/)\n* [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen)\n \n### Videos\n\n* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io)\n* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg)\n* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io)\n* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy)\n\n\n\n## Reporting issues and Contributing\n\nPlease read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request.\n"
  },
  {
    "path": "www/lib/angular-ui-router/api/angular-ui-router.d.ts",
    "content": "// Type definitions for Angular JS 1.1.5+ (ui.router module)\n// Project: https://github.com/angular-ui/ui-router\n// Definitions by: Michel Salib <https://github.com/michelsalib>\n// Definitions: https://github.com/borisyankov/DefinitelyTyped\n\ndeclare module ng.ui {\n\n    interface IState {\n        name?: string;\n        template?: string;\n        templateUrl?: any; // string || () => string\n        templateProvider?: any; // () => string || IPromise<string>\n        controller?: any;\n        controllerAs?: string;    \n        controllerProvider?: any;\n        resolve?: {};\n        url?: string;\n        params?: any;\n        views?: {};\n        abstract?: boolean;\n        onEnter?: (...args: any[]) => void;\n        onExit?: (...args: any[]) => void;\n        data?: any;\n        reloadOnSearch?: boolean;\n    }\n\n    interface ITypedState<T> extends IState {\n        data?: T;\n    }\n\n    interface IStateProvider extends IServiceProvider {\n        state(name: string, config: IState): IStateProvider;\n        state(config: IState): IStateProvider;\n        decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;\n    }\n\n    interface IUrlMatcher {\n        concat(pattern: string): IUrlMatcher;\n        exec(path: string, searchParams: {}): {};\n        parameters(): string[];\n        format(values: {}): string;\n    }\n\n    interface IUrlMatcherFactory {\n        compile(pattern: string): IUrlMatcher;\n        isMatcher(o: any): boolean;\n    }\n\n    interface IUrlRouterProvider extends IServiceProvider {\n        when(whenPath: RegExp, handler: Function): IUrlRouterProvider;\n        when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;\n        when(whenPath: RegExp, toPath: string): IUrlRouterProvider;\n        when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider;\n        when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider;\n        when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider;\n        when(whenPath: string, handler: Function): IUrlRouterProvider;\n        when(whenPath: string, handler: any[]): IUrlRouterProvider;\n        when(whenPath: string, toPath: string): IUrlRouterProvider;\n        otherwise(handler: Function): IUrlRouterProvider;\n        otherwise(handler: any[]): IUrlRouterProvider;\n        otherwise(path: string): IUrlRouterProvider;\n        rule(handler: Function): IUrlRouterProvider;\n        rule(handler: any[]): IUrlRouterProvider;\n    }\n\n    interface IStateOptions {\n        location?: any;\n        inherit?: boolean;\n        relative?: IState;\n        notify?: boolean;\n        reload?: boolean;\n    }\n\n    interface IHrefOptions {\n        lossy?: boolean;\n        inherit?: boolean;\n        relative?: IState;\n        absolute?: boolean;\n    }\n\n    interface IStateService {\n        go(to: string, params?: {}, options?: IStateOptions): IPromise<any>;\n        transitionTo(state: string, params?: {}, updateLocation?: boolean): void;\n        transitionTo(state: string, params?: {}, options?: IStateOptions): void;\n        includes(state: string, params?: {}): boolean;\n        is(state:string, params?: {}): boolean;\n        is(state: IState, params?: {}): boolean;\n        href(state: IState, params?: {}, options?: IHrefOptions): string;\n        href(state: string, params?: {}, options?: IHrefOptions): string;\n        get(state: string): IState;\n        get(): IState[];\n        current: IState;\n        params: any;\n        reload(): void;\n    }\n\n    interface IStateParamsService {\n        [key: string]: any;\n    }\n\n    interface IStateParams {\n        [key: string]: any;\n    }\n\n    interface IUrlRouterService {\n        /*\n         * Triggers an update; the same update that happens when the address bar\n         * url changes, aka $locationChangeSuccess.\n         *\n         * This method is useful when you need to use preventDefault() on the\n         * $locationChangeSuccess event, perform some custom logic (route protection,\n         * auth, config, redirection, etc) and then finally proceed with the transition\n         * by calling $urlRouter.sync().\n         *\n         */\n        sync(): void;\n    }\n\n    interface IUiViewScrollProvider {\n        /*\n         * Reverts back to using the core $anchorScroll service for scrolling \n         * based on the url anchor.\n         */\n        useAnchorScroll(): void;\n    }\n}\n"
  },
  {
    "path": "www/lib/angular-ui-router/bower.json",
    "content": "{\n  \"name\": \"angular-ui-router\",\n  \"version\": \"0.2.13\",\n  \"main\": \"./release/angular-ui-router.js\",\n  \"dependencies\": {\n    \"angular\": \">= 1.0.8\"\n  },\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"component.json\",\n    \"package.json\",\n    \"lib\",\n    \"config\",\n    \"sample\",\n    \"test\",\n    \"tests\",\n    \"ngdoc_assets\",\n    \"Gruntfile.js\",\n    \"files.js\"\n  ]\n}\n"
  },
  {
    "path": "www/lib/angular-ui-router/release/angular-ui-router.js",
    "content": "/**\n * State-based routing for AngularJS\n * @version v0.2.13\n * @link http://angular-ui.github.com/\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n\n/* commonjs package manager support (eg componentjs) */\nif (typeof module !== \"undefined\" && typeof exports !== \"undefined\" && module.exports === exports){\n  module.exports = 'ui.router';\n}\n\n(function (window, angular, undefined) {\n/*jshint globalstrict:true*/\n/*global angular:false*/\n'use strict';\n\nvar isDefined = angular.isDefined,\n    isFunction = angular.isFunction,\n    isString = angular.isString,\n    isObject = angular.isObject,\n    isArray = angular.isArray,\n    forEach = angular.forEach,\n    extend = angular.extend,\n    copy = angular.copy;\n\nfunction inherit(parent, extra) {\n  return extend(new (extend(function() {}, { prototype: parent }))(), extra);\n}\n\nfunction merge(dst) {\n  forEach(arguments, function(obj) {\n    if (obj !== dst) {\n      forEach(obj, function(value, key) {\n        if (!dst.hasOwnProperty(key)) dst[key] = value;\n      });\n    }\n  });\n  return dst;\n}\n\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n  var path = [];\n\n  for (var n in first.path) {\n    if (first.path[n] !== second.path[n]) break;\n    path.push(first.path[n]);\n  }\n  return path;\n}\n\n/**\n * IE8-safe wrapper for `Object.keys()`.\n *\n * @param {Object} object A JavaScript object.\n * @return {Array} Returns the keys of the object as an array.\n */\nfunction objectKeys(object) {\n  if (Object.keys) {\n    return Object.keys(object);\n  }\n  var result = [];\n\n  angular.forEach(object, function(val, key) {\n    result.push(key);\n  });\n  return result;\n}\n\n/**\n * IE8-safe wrapper for `Array.prototype.indexOf()`.\n *\n * @param {Array} array A JavaScript array.\n * @param {*} value A value to search the array for.\n * @return {Number} Returns the array index value of `value`, or `-1` if not present.\n */\nfunction indexOf(array, value) {\n  if (Array.prototype.indexOf) {\n    return array.indexOf(value, Number(arguments[2]) || 0);\n  }\n  var len = array.length >>> 0, from = Number(arguments[2]) || 0;\n  from = (from < 0) ? Math.ceil(from) : Math.floor(from);\n\n  if (from < 0) from += len;\n\n  for (; from < len; from++) {\n    if (from in array && array[from] === value) return from;\n  }\n  return -1;\n}\n\n/**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} currentParams The value of the current state parameters ($stateParams).\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\nfunction inheritParams(currentParams, newParams, $current, $to) {\n  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];\n\n  for (var i in parents) {\n    if (!parents[i].params) continue;\n    parentParams = objectKeys(parents[i].params);\n    if (!parentParams.length) continue;\n\n    for (var j in parentParams) {\n      if (indexOf(inheritList, parentParams[j]) >= 0) continue;\n      inheritList.push(parentParams[j]);\n      inherited[parentParams[j]] = currentParams[parentParams[j]];\n    }\n  }\n  return extend({}, inherited, newParams);\n}\n\n/**\n * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.\n *\n * @param {Object} a The first object.\n * @param {Object} b The second object.\n * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,\n *                     it defaults to the list of keys in `a`.\n * @return {Boolean} Returns `true` if the keys match, otherwise `false`.\n */\nfunction equalForKeys(a, b, keys) {\n  if (!keys) {\n    keys = [];\n    for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n  }\n\n  for (var i=0; i<keys.length; i++) {\n    var k = keys[i];\n    if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n  }\n  return true;\n}\n\n/**\n * Returns the subset of an object, based on a list of keys.\n *\n * @param {Array} keys\n * @param {Object} values\n * @return {Boolean} Returns a subset of `values`.\n */\nfunction filterByKeys(keys, values) {\n  var filtered = {};\n\n  forEach(keys, function (name) {\n    filtered[name] = values[name];\n  });\n  return filtered;\n}\n\n// like _.indexBy\n// when you know that your index values will be unique, or you want last-one-in to win\nfunction indexBy(array, propName) {\n  var result = {};\n  forEach(array, function(item) {\n    result[item[propName]] = item;\n  });\n  return result;\n}\n\n// extracted from underscore.js\n// Return a copy of the object only containing the whitelisted properties.\nfunction pick(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  forEach(keys, function(key) {\n    if (key in obj) copy[key] = obj[key];\n  });\n  return copy;\n}\n\n// extracted from underscore.js\n// Return a copy of the object omitting the blacklisted properties.\nfunction omit(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  for (var key in obj) {\n    if (indexOf(keys, key) == -1) copy[key] = obj[key];\n  }\n  return copy;\n}\n\nfunction pluck(collection, key) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = isFunction(key) ? key(val) : val[key];\n  });\n  return result;\n}\n\nfunction filter(collection, callback) {\n  var array = isArray(collection);\n  var result = array ? [] : {};\n  forEach(collection, function(val, i) {\n    if (callback(val, i)) {\n      result[array ? result.length : i] = val;\n    }\n  });\n  return result;\n}\n\nfunction map(collection, callback) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = callback(val, i);\n  });\n  return result;\n}\n\n/**\n * @ngdoc overview\n * @name ui.router.util\n *\n * @description\n * # ui.router.util sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n *\n */\nangular.module('ui.router.util', ['ng']);\n\n/**\n * @ngdoc overview\n * @name ui.router.router\n * \n * @requires ui.router.util\n *\n * @description\n * # ui.router.router sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n */\nangular.module('ui.router.router', ['ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router.state\n * \n * @requires ui.router.router\n * @requires ui.router.util\n *\n * @description\n * # ui.router.state sub-module\n *\n * This module is a dependency of the main ui.router module. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n * \n */\nangular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router\n *\n * @requires ui.router.state\n *\n * @description\n * # ui.router\n * \n * ## The main module for ui.router \n * There are several sub-modules included with the ui.router module, however only this module is needed\n * as a dependency within your angular app. The other modules are for organization purposes. \n *\n * The modules are:\n * * ui.router - the main \"umbrella\" module\n * * ui.router.router - \n * \n * *You'll need to include **only** this module as the dependency within your angular app.*\n * \n * <pre>\n * <!doctype html>\n * <html ng-app=\"myApp\">\n * <head>\n *   <script src=\"js/angular.js\"></script>\n *   <!-- Include the ui-router script -->\n *   <script src=\"js/angular-ui-router.min.js\"></script>\n *   <script>\n *     // ...and add 'ui.router' as a dependency\n *     var myApp = angular.module('myApp', ['ui.router']);\n *   </script>\n * </head>\n * <body>\n * </body>\n * </html>\n * </pre>\n */\nangular.module('ui.router', ['ui.router.state']);\n\nangular.module('ui.router.compat', ['ui.router']);\n\n/**\n * @ngdoc object\n * @name ui.router.util.$resolve\n *\n * @requires $q\n * @requires $injector\n *\n * @description\n * Manages resolution of (acyclic) graphs of promises.\n */\n$Resolve.$inject = ['$q', '$injector'];\nfunction $Resolve(  $q,    $injector) {\n  \n  var VISIT_IN_PROGRESS = 1,\n      VISIT_DONE = 2,\n      NOTHING = {},\n      NO_DEPENDENCIES = [],\n      NO_LOCALS = NOTHING,\n      NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n  \n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#study\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Studies a set of invocables that are likely to be used multiple times.\n   * <pre>\n   * $resolve.study(invocables)(locals, parent, self)\n   * </pre>\n   * is equivalent to\n   * <pre>\n   * $resolve.resolve(invocables, locals, parent, self)\n   * </pre>\n   * but the former is more efficient (in fact `resolve` just calls `study` \n   * internally).\n   *\n   * @param {object} invocables Invocable objects\n   * @return {function} a function to pass in locals, parent and self\n   */\n  this.study = function (invocables) {\n    if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n    var invocableKeys = objectKeys(invocables || {});\n    \n    // Perform a topological sort of invocables to build an ordered plan\n    var plan = [], cycle = [], visited = {};\n    function visit(value, key) {\n      if (visited[key] === VISIT_DONE) return;\n      \n      cycle.push(key);\n      if (visited[key] === VISIT_IN_PROGRESS) {\n        cycle.splice(0, indexOf(cycle, key));\n        throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n      }\n      visited[key] = VISIT_IN_PROGRESS;\n      \n      if (isString(value)) {\n        plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n      } else {\n        var params = $injector.annotate(value);\n        forEach(params, function (param) {\n          if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n        });\n        plan.push(key, value, params);\n      }\n      \n      cycle.pop();\n      visited[key] = VISIT_DONE;\n    }\n    forEach(invocables, visit);\n    invocables = cycle = visited = null; // plan is all that's required\n    \n    function isResolve(value) {\n      return isObject(value) && value.then && value.$$promises;\n    }\n    \n    return function (locals, parent, self) {\n      if (isResolve(locals) && self === undefined) {\n        self = parent; parent = locals; locals = null;\n      }\n      if (!locals) locals = NO_LOCALS;\n      else if (!isObject(locals)) {\n        throw new Error(\"'locals' must be an object\");\n      }       \n      if (!parent) parent = NO_PARENT;\n      else if (!isResolve(parent)) {\n        throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n      }\n      \n      // To complete the overall resolution, we have to wait for the parent\n      // promise and for the promise for each invokable in our plan.\n      var resolution = $q.defer(),\n          result = resolution.promise,\n          promises = result.$$promises = {},\n          values = extend({}, locals),\n          wait = 1 + plan.length/3,\n          merged = false;\n          \n      function done() {\n        // Merge parent values we haven't got yet and publish our own $$values\n        if (!--wait) {\n          if (!merged) merge(values, parent.$$values); \n          result.$$values = values;\n          result.$$promises = result.$$promises || true; // keep for isResolve()\n          delete result.$$inheritedValues;\n          resolution.resolve(values);\n        }\n      }\n      \n      function fail(reason) {\n        result.$$failure = reason;\n        resolution.reject(reason);\n      }\n\n      // Short-circuit if parent has already failed\n      if (isDefined(parent.$$failure)) {\n        fail(parent.$$failure);\n        return result;\n      }\n      \n      if (parent.$$inheritedValues) {\n        merge(values, omit(parent.$$inheritedValues, invocableKeys));\n      }\n\n      // Merge parent values if the parent has already resolved, or merge\n      // parent promises and wait if the parent resolve is still in progress.\n      extend(promises, parent.$$promises);\n      if (parent.$$values) {\n        merged = merge(values, omit(parent.$$values, invocableKeys));\n        result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n        done();\n      } else {\n        if (parent.$$inheritedValues) {\n          result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n        }        \n        parent.then(done, fail);\n      }\n      \n      // Process each invocable in the plan, but ignore any where a local of the same name exists.\n      for (var i=0, ii=plan.length; i<ii; i+=3) {\n        if (locals.hasOwnProperty(plan[i])) done();\n        else invoke(plan[i], plan[i+1], plan[i+2]);\n      }\n      \n      function invoke(key, invocable, params) {\n        // Create a deferred for this invocation. Failures will propagate to the resolution as well.\n        var invocation = $q.defer(), waitParams = 0;\n        function onfailure(reason) {\n          invocation.reject(reason);\n          fail(reason);\n        }\n        // Wait for any parameter that we have a promise for (either from parent or from this\n        // resolve; in that case study() will have made sure it's ordered before us in the plan).\n        forEach(params, function (dep) {\n          if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {\n            waitParams++;\n            promises[dep].then(function (result) {\n              values[dep] = result;\n              if (!(--waitParams)) proceed();\n            }, onfailure);\n          }\n        });\n        if (!waitParams) proceed();\n        function proceed() {\n          if (isDefined(result.$$failure)) return;\n          try {\n            invocation.resolve($injector.invoke(invocable, self, values));\n            invocation.promise.then(function (result) {\n              values[key] = result;\n              done();\n            }, onfailure);\n          } catch (e) {\n            onfailure(e);\n          }\n        }\n        // Publish promise synchronously; invocations further down in the plan may depend on it.\n        promises[key] = invocation.promise;\n      }\n      \n      return result;\n    };\n  };\n  \n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#resolve\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Resolves a set of invocables. An invocable is a function to be invoked via \n   * `$injector.invoke()`, and can have an arbitrary number of dependencies. \n   * An invocable can either return a value directly,\n   * or a `$q` promise. If a promise is returned it will be resolved and the \n   * resulting value will be used instead. Dependencies of invocables are resolved \n   * (in this order of precedence)\n   *\n   * - from the specified `locals`\n   * - from another invocable that is part of this `$resolve` call\n   * - from an invocable that is inherited from a `parent` call to `$resolve` \n   *   (or recursively\n   * - from any ancestor `$resolve` of that parent).\n   *\n   * The return value of `$resolve` is a promise for an object that contains \n   * (in this order of precedence)\n   *\n   * - any `locals` (if specified)\n   * - the resolved return values of all injectables\n   * - any values inherited from a `parent` call to `$resolve` (if specified)\n   *\n   * The promise will resolve after the `parent` promise (if any) and all promises \n   * returned by injectables have been resolved. If any invocable \n   * (or `$injector.invoke`) throws an exception, or if a promise returned by an \n   * invocable is rejected, the `$resolve` promise is immediately rejected with the \n   * same error. A rejection of a `parent` promise (if specified) will likewise be \n   * propagated immediately. Once the `$resolve` promise has been rejected, no \n   * further invocables will be called.\n   * \n   * Cyclic dependencies between invocables are not permitted and will caues `$resolve`\n   * to throw an error. As a special case, an injectable can depend on a parameter \n   * with the same name as the injectable, which will be fulfilled from the `parent` \n   * injectable of the same name. This allows inherited values to be decorated. \n   * Note that in this case any other injectable in the same `$resolve` with the same\n   * dependency would see the decorated value, not the inherited value.\n   *\n   * Note that missing dependencies -- unlike cyclic dependencies -- will cause an \n   * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) \n   * exception.\n   *\n   * Invocables are invoked eagerly as soon as all dependencies are available. \n   * This is true even for dependencies inherited from a `parent` call to `$resolve`.\n   *\n   * As a special case, an invocable can be a string, in which case it is taken to \n   * be a service name to be passed to `$injector.get()`. This is supported primarily \n   * for backwards-compatibility with the `resolve` property of `$routeProvider` \n   * routes.\n   *\n   * @param {object} invocables functions to invoke or \n   * `$injector` services to fetch.\n   * @param {object} locals  values to make available to the injectables\n   * @param {object} parent  a promise returned by another call to `$resolve`.\n   * @param {object} self  the `this` for the invoked methods\n   * @return {object} Promise for an object that contains the resolved return value\n   * of all invocables, as well as any inherited and local values.\n   */\n  this.resolve = function (invocables, locals, parent, self) {\n    return this.study(invocables)(locals, parent, self);\n  };\n}\n\nangular.module('ui.router.util').service('$resolve', $Resolve);\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\n$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];\nfunction $TemplateFactory(  $http,   $templateCache,   $injector) {\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromConfig\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a configuration object. \n   *\n   * @param {object} config Configuration object for which to load a template. \n   * The following properties are search in the specified order, and the first one \n   * that is defined is used to create the template:\n   *\n   * @param {string|object} config.template html string template or function to \n   * load via {@link ui.router.util.$templateFactory#fromString fromString}.\n   * @param {string|object} config.templateUrl url to load or a function returning \n   * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.\n   * @param {Function} config.templateProvider function to invoke via \n   * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.\n   * @param {object} params  Parameters to pass to the template function.\n   * @param {object} locals Locals to pass to `invoke` if the template is loaded \n   * via a `templateProvider`. Defaults to `{ params: params }`.\n   *\n   * @return {string|object}  The template html as a string, or a promise for \n   * that string,or `null` if no template is configured.\n   */\n  this.fromConfig = function (config, params, locals) {\n    return (\n      isDefined(config.template) ? this.fromString(config.template, params) :\n      isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :\n      isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :\n      null\n    );\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromString\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a string or a function returning a string.\n   *\n   * @param {string|object} template html template as a string or function that \n   * returns an html template as a string.\n   * @param {object} params Parameters to pass to the template function.\n   *\n   * @return {string|object} The template html as a string, or a promise for that \n   * string.\n   */\n  this.fromString = function (template, params) {\n    return isFunction(template) ? template(params) : template;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromUrl\n   * @methodOf ui.router.util.$templateFactory\n   * \n   * @description\n   * Loads a template from the a URL via `$http` and `$templateCache`.\n   *\n   * @param {string|Function} url url of the template to load, or a function \n   * that returns a url.\n   * @param {Object} params Parameters to pass to the url function.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromUrl = function (url, params) {\n    if (isFunction(url)) url = url(params);\n    if (url == null) return null;\n    else return $http\n        .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n        .then(function(response) { return response.data; });\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromProvider\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template by invoking an injectable provider function.\n   *\n   * @param {Function} provider Function to invoke via `$injector.invoke`\n   * @param {Object} params Parameters for the template.\n   * @param {Object} locals Locals to pass to `invoke`. Defaults to \n   * `{ params: params }`.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromProvider = function (provider, params, locals) {\n    return $injector.invoke(provider, null, locals || { params: params });\n  };\n}\n\nangular.module('ui.router.util').service('$templateFactory', $TemplateFactory);\n\nvar $$UMFP; // reference to $UrlMatcherFactoryProvider\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:UrlMatcher\n *\n * @description\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n * \n * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n * syntax, which optionally allows a regular expression for the parameter to be specified:\n *\n * * `':'` name - colon placeholder\n * * `'*'` name - catch-all placeholder\n * * `'{' name '}'` - curly placeholder\n * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n *   regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters). For colon \n * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n * number of characters other than '/'. For catch-all placeholders the path parameter matches\n * any number of characters.\n * \n * Examples:\n * \n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n *   trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n *   parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n *   path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n *   in the built-in  `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n * @param {string} pattern  The pattern to compile into a matcher.\n * @param {Object} config  A configuration object hash:\n * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n *   an existing UrlMatcher\n *\n * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n *\n * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any\n *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n *   non-null) will start with this prefix.\n *\n * @property {string} source  The pattern that was passed into the constructor\n *\n * @property {string} sourcePath  The path portion of the source property\n *\n * @property {string} sourceSearch  The search portion of the source property\n *\n * @property {string} regex  The constructed regex that will be used to match against the url when \n *   it is time to determine which url will match.\n *\n * @returns {Object}  New `UrlMatcher` object\n */\nfunction UrlMatcher(pattern, config, parentMatcher) {\n  config = extend({ params: {} }, isObject(config) ? config : {});\n\n  // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n  //   '*' name\n  //   ':' name\n  //   '{' name '}'\n  //   '{' name ':' regexp '}'\n  // The regular expression is somewhat complicated due to the need to allow curly braces\n  // inside the regular expression. The placeholder regexp breaks down as follows:\n  //    ([:*])([\\w\\[\\]]+)              - classic placeholder ($1 / $2) (search version has - for snake-case)\n  //    \\{([\\w\\[\\]]+)(?:\\:( ... ))?\\}  - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n  //    (?: ... | ... | ... )+         - the regexp consists of any number of atoms, an atom being either\n  //    [^{}\\\\]+                       - anything other than curly braces or backslash\n  //    \\\\.                            - a backslash escape\n  //    \\{(?:[^{}\\\\]+|\\\\.)*\\}          - a matched set of curly braces containing other atoms\n  var placeholder       = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      searchPlaceholder = /([:]?)([\\w\\[\\]-]+)|\\{([\\w\\[\\]-]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      compiled = '^', last = 0, m,\n      segments = this.segments = [],\n      parentParams = parentMatcher ? parentMatcher.params : {},\n      params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n      paramNames = [];\n\n  function addParameter(id, type, config, location) {\n    paramNames.push(id);\n    if (parentParams[id]) return parentParams[id];\n    if (!/^\\w+(-+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    params[id] = new $$UMFP.Param(id, type, config, location);\n    return params[id];\n  }\n\n  function quoteRegExp(string, pattern, squash) {\n    var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n    if (!pattern) return result;\n    switch(squash) {\n      case false: surroundPattern = ['(', ')'];   break;\n      case true:  surroundPattern = ['?(', ')?']; break;\n      default:    surroundPattern = ['(' + squash + \"|\", ')?'];  break;\n    }\n    return result + surroundPattern[0] + pattern + surroundPattern[1];\n  }\n\n  this.source = pattern;\n\n  // Split into static segments separated by path parameter placeholders.\n  // The number of segments is always 1 more than the number of parameters.\n  function matchDetails(m, isSearch) {\n    var id, regexp, segment, type, cfg, arrayMode;\n    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n    cfg         = config.params[id];\n    segment     = pattern.substring(last, m.index);\n    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n    type        = $$UMFP.type(regexp || \"string\") || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp) });\n    return {\n      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n    };\n  }\n\n  var p, param, segment;\n  while ((m = placeholder.exec(pattern))) {\n    p = matchDetails(m, false);\n    if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\n    param = addParameter(p.id, p.type, p.cfg, \"path\");\n    compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash);\n    segments.push(p.segment);\n    last = placeholder.lastIndex;\n  }\n  segment = pattern.substring(last);\n\n  // Find any search parameter names and remove them from the last segment\n  var i = segment.indexOf('?');\n\n  if (i >= 0) {\n    var search = this.sourceSearch = segment.substring(i);\n    segment = segment.substring(0, i);\n    this.sourcePath = pattern.substring(0, last + i);\n\n    if (search.length > 0) {\n      last = 0;\n      while ((m = searchPlaceholder.exec(search))) {\n        p = matchDetails(m, true);\n        param = addParameter(p.id, p.type, p.cfg, \"search\");\n        last = placeholder.lastIndex;\n        // check if ?&\n      }\n    }\n  } else {\n    this.sourcePath = pattern;\n    this.sourceSearch = '';\n  }\n\n  compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n  segments.push(segment);\n\n  this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n  this.prefix = segments[0];\n  this.$$paramNames = paramNames;\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#concat\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns a new matcher for a pattern constructed by appending the path part and adding the\n * search parameters of the specified pattern to this pattern. The current pattern is not\n * modified. This can be understood as creating a pattern for URLs that are relative to (or\n * suffixes of) the current pattern.\n *\n * @example\n * The following two matchers are equivalent:\n * <pre>\n * new UrlMatcher('/user/{id}?q').concat('/details?date');\n * new UrlMatcher('/user/{id}/details?q&date');\n * </pre>\n *\n * @param {string} pattern  The pattern to append.\n * @param {Object} config  An object hash of the configuration for the matcher.\n * @returns {UrlMatcher}  A matcher for the concatenated pattern.\n */\nUrlMatcher.prototype.concat = function (pattern, config) {\n  // Because order of search parameters is irrelevant, we can add our own search\n  // parameters to the end of the new pattern. Parse the new pattern by itself\n  // and then join the bits together, but it's much easier to do this on a string level.\n  var defaultConfig = {\n    caseInsensitive: $$UMFP.caseInsensitive(),\n    strict: $$UMFP.strictMode(),\n    squash: $$UMFP.defaultSquashPolicy()\n  };\n  return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n};\n\nUrlMatcher.prototype.toString = function () {\n  return this.source;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#exec\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Tests the specified path against this matcher, and returns an object containing the captured\n * parameter values, or null if the path does not match. The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `searchParams`. This means that search parameters are always treated\n * as optional.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n *   x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * </pre>\n *\n * @param {string} path  The URL path to match, e.g. `$location.path()`.\n * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.\n * @returns {Object}  The captured parameter values.\n */\nUrlMatcher.prototype.exec = function (path, searchParams) {\n  var m = this.regexp.exec(path);\n  if (!m) return null;\n  searchParams = searchParams || {};\n\n  var paramNames = this.parameters(), nTotal = paramNames.length,\n    nPath = this.segments.length - 1,\n    values = {}, i, j, cfg, paramName;\n\n  if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\n  function decodePathArray(string) {\n    function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n    function unquoteDashes(str) { return str.replace(/\\\\-/, \"-\"); }\n\n    var split = reverseString(string).split(/-(?!\\\\)/);\n    var allReversed = map(split, reverseString);\n    return map(allReversed, unquoteDashes).reverse();\n  }\n\n  for (i = 0; i < nPath; i++) {\n    paramName = paramNames[i];\n    var param = this.params[paramName];\n    var paramVal = m[i+1];\n    // if the param value matches a pre-replace pair, replace the value before decoding.\n    for (j = 0; j < param.replace; j++) {\n      if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n    }\n    if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n    values[paramName] = param.value(paramVal);\n  }\n  for (/**/; i < nTotal; i++) {\n    paramName = paramNames[i];\n    values[paramName] = this.params[paramName].value(searchParams[paramName]);\n  }\n\n  return values;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#parameters\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns the names of all path and search parameters of this pattern in an unspecified order.\n * \n * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the\n *    pattern has no parameters, an empty array is returned.\n */\nUrlMatcher.prototype.parameters = function (param) {\n  if (!isDefined(param)) return this.$$paramNames;\n  return this.params[param] || null;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#validate\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param {Object} params The object hash of parameters to validate.\n * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n */\nUrlMatcher.prototype.validates = function (params) {\n  return this.params.$$validates(params);\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#format\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters. Null values for path parameters are\n * treated as empty strings.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * </pre>\n *\n * @param {Object} values  the values to substitute for the parameters in this pattern.\n * @returns {string}  the formatted URL (path and optionally search part).\n */\nUrlMatcher.prototype.format = function (values) {\n  values = values || {};\n  var segments = this.segments, params = this.parameters(), paramset = this.params;\n  if (!this.validates(values)) return null;\n\n  var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\n  function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n    return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n  }\n\n  for (i = 0; i < nTotal; i++) {\n    var isPathParam = i < nPath;\n    var name = params[i], param = paramset[name], value = param.value(values[name]);\n    var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n    var squash = isDefaultValue ? param.squash : false;\n    var encoded = param.type.encode(value);\n\n    if (isPathParam) {\n      var nextSegment = segments[i + 1];\n      if (squash === false) {\n        if (encoded != null) {\n          if (isArray(encoded)) {\n            result += map(encoded, encodeDashes).join(\"-\");\n          } else {\n            result += encodeURIComponent(encoded);\n          }\n        }\n        result += nextSegment;\n      } else if (squash === true) {\n        var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n        result += nextSegment.match(capture)[1];\n      } else if (isString(squash)) {\n        result += squash + nextSegment;\n      }\n    } else {\n      if (encoded == null || (isDefaultValue && squash !== false)) continue;\n      if (!isArray(encoded)) encoded = [ encoded ];\n      encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n      result += (search ? '&' : '?') + (name + '=' + encoded);\n      search = true;\n    }\n  }\n\n  return result;\n};\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:Type\n *\n * @description\n * Implements an interface to define custom parameter types that can be decoded from and encoded to\n * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n * objects when matching or formatting URLs, or comparing or validating parameter values.\n *\n * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n * information on registering custom types.\n *\n * @param {Object} config  A configuration object which contains the custom type definition.  The object's\n *        properties will override the default methods and/or pattern in `Type`'s public interface.\n * @example\n * <pre>\n * {\n *   decode: function(val) { return parseInt(val, 10); },\n *   encode: function(val) { return val && val.toString(); },\n *   equals: function(a, b) { return this.is(a) && a === b; },\n *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n *   pattern: /\\d+/\n * }\n * </pre>\n *\n * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n *           coming from a substring of a URL.\n *\n * @returns {Object}  Returns a new `Type` object.\n */\nfunction Type(config) {\n  extend(this, config);\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#is\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Detects whether a value is of a particular type. Accepts a native (decoded) value\n * and determines whether it matches the current `Type` object.\n *\n * @param {*} val  The value to check.\n * @param {string} key  Optional. If the type check is happening in the context of a specific\n *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.\n */\nType.prototype.is = function(val, key) {\n  return true;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#encode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n * only needs to be a representation of `val` that has been coerced to a string.\n *\n * @param {*} val  The value to encode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.\n */\nType.prototype.encode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#decode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Converts a parameter value (from URL string or transition param) to a custom/native value.\n *\n * @param {string} val  The URL parameter value to decode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {*}  Returns a custom representation of the URL parameter value.\n */\nType.prototype.decode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#equals\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Determines whether two decoded values are equivalent.\n *\n * @param {*} a  A value to compare against.\n * @param {*} b  A value to compare against.\n * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.\n */\nType.prototype.equals = function(a, b) {\n  return a == b;\n};\n\nType.prototype.$subPattern = function() {\n  var sub = this.pattern.toString();\n  return sub.substr(1, sub.length - 2);\n};\n\nType.prototype.pattern = /.*/;\n\nType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\n/*\n * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\nType.prototype.$asArray = function(mode, isSearch) {\n  if (!mode) return this;\n  if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n  return new ArrayType(this, mode);\n\n  function ArrayType(type, mode) {\n    function bindTo(type, callbackName) {\n      return function() {\n        return type[callbackName].apply(type, arguments);\n      };\n    }\n\n    // Wrap non-array value as array\n    function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n    // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n    function arrayUnwrap(val) {\n      switch(val.length) {\n        case 0: return undefined;\n        case 1: return mode === \"auto\" ? val[0] : val;\n        default: return val;\n      }\n    }\n    function falsey(val) { return !val; }\n\n    // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n    function arrayHandler(callback, allTruthyMode) {\n      return function handleArray(val) {\n        val = arrayWrap(val);\n        var result = map(val, callback);\n        if (allTruthyMode === true)\n          return filter(result, falsey).length === 0;\n        return arrayUnwrap(result);\n      };\n    }\n\n    // Wraps type (.equals) functions to operate on each value of an array\n    function arrayEqualsHandler(callback) {\n      return function handleArray(val1, val2) {\n        var left = arrayWrap(val1), right = arrayWrap(val2);\n        if (left.length !== right.length) return false;\n        for (var i = 0; i < left.length; i++) {\n          if (!callback(left[i], right[i])) return false;\n        }\n        return true;\n      };\n    }\n\n    this.encode = arrayHandler(bindTo(type, 'encode'));\n    this.decode = arrayHandler(bindTo(type, 'decode'));\n    this.is     = arrayHandler(bindTo(type, 'is'), true);\n    this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n    this.pattern = type.pattern;\n    this.$arrayMode = mode;\n  }\n};\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$urlMatcherFactory\n *\n * @description\n * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n * is also available to providers under the name `$urlMatcherFactoryProvider`.\n */\nfunction $UrlMatcherFactory() {\n  $$UMFP = this;\n\n  var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\n  function valToString(val) { return val != null ? val.toString().replace(/\\//g, \"%2F\") : val; }\n  function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, \"/\") : val; }\n//  TODO: in 1.0, make string .is() return false if value is undefined by default.\n//  function regexpMatches(val) { /*jshint validthis:true */ return isDefined(val) && this.pattern.test(val); }\n  function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); }\n\n  var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n    string: {\n      encode: valToString,\n      decode: valFromString,\n      is: regexpMatches,\n      pattern: /[^/]*/\n    },\n    int: {\n      encode: valToString,\n      decode: function(val) { return parseInt(val, 10); },\n      is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },\n      pattern: /\\d+/\n    },\n    bool: {\n      encode: function(val) { return val ? 1 : 0; },\n      decode: function(val) { return parseInt(val, 10) !== 0; },\n      is: function(val) { return val === true || val === false; },\n      pattern: /0|1/\n    },\n    date: {\n      encode: function (val) {\n        if (!this.is(val))\n          return undefined;\n        return [ val.getFullYear(),\n          ('0' + (val.getMonth() + 1)).slice(-2),\n          ('0' + val.getDate()).slice(-2)\n        ].join(\"-\");\n      },\n      decode: function (val) {\n        if (this.is(val)) return val;\n        var match = this.capture.exec(val);\n        return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n      },\n      is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n      equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n      pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n      capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n    },\n    json: {\n      encode: angular.toJson,\n      decode: angular.fromJson,\n      is: angular.isObject,\n      equals: angular.equals,\n      pattern: /[^/]*/\n    },\n    any: { // does not encode/decode\n      encode: angular.identity,\n      decode: angular.identity,\n      is: angular.identity,\n      equals: angular.equals,\n      pattern: /.*/\n    }\n  };\n\n  function getDefaultConfig() {\n    return {\n      strict: isStrictMode,\n      caseInsensitive: isCaseInsensitive\n    };\n  }\n\n  function isInjectable(value) {\n    return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n  }\n\n  /**\n   * [Internal] Get the default value of a parameter, which may be an injectable function.\n   */\n  $UrlMatcherFactory.$$getDefaultValue = function(config) {\n    if (!isInjectable(config.value)) return config.value;\n    if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n    return injector.invoke(config.value);\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URL matching should be case sensitive (the default behavior), or not.\n   *\n   * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n   * @returns {boolean} the current value of caseInsensitive\n   */\n  this.caseInsensitive = function(value) {\n    if (isDefined(value))\n      isCaseInsensitive = value;\n    return isCaseInsensitive;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#strictMode\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URLs should match trailing slashes, or not (the default behavior).\n   *\n   * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n   * @returns {boolean} the current value of strictMode\n   */\n  this.strictMode = function(value) {\n    if (isDefined(value))\n      isStrictMode = value;\n    return isStrictMode;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Sets the default behavior when generating or matching URLs with default parameter values.\n   *\n   * @param {string} value A string that defines the default parameter URL squashing behavior.\n   *    `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n   *    `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n   *             parameter is surrounded by slashes, squash (remove) one slash from the URL\n   *    any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n   *             the parameter value from the URL and replace it with this string.\n   */\n  this.defaultSquashPolicy = function(value) {\n    if (!isDefined(value)) return defaultSquashPolicy;\n    if (value !== true && value !== false && !isString(value))\n      throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n    defaultSquashPolicy = value;\n    return value;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#compile\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n   *\n   * @param {string} pattern  The URL pattern.\n   * @param {Object} config  The config object hash.\n   * @returns {UrlMatcher}  The UrlMatcher.\n   */\n  this.compile = function (pattern, config) {\n    return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#isMatcher\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n   *\n   * @param {Object} object  The object to perform the type check against.\n   * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by\n   *          implementing all the same methods.\n   */\n  this.isMatcher = function (o) {\n    if (!isObject(o)) return false;\n    var result = true;\n\n    forEach(UrlMatcher.prototype, function(val, name) {\n      if (isFunction(val)) {\n        result = result && (isDefined(o[name]) && isFunction(o[name]));\n      }\n    });\n    return result;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#type\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n   * generate URLs with typed parameters.\n   *\n   * @param {string} name  The type name.\n   * @param {Object|Function} definition   The type definition. See\n   *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n   *        runtime starts.  The result of this function is merged into the existing `definition`.\n   *        See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   *\n   * @returns {Object}  Returns `$urlMatcherFactoryProvider`.\n   *\n   * @example\n   * This is a simple example of a custom type that encodes and decodes items from an\n   * array, using the array index as the URL-encoded value:\n   *\n   * <pre>\n   * var list = ['John', 'Paul', 'George', 'Ringo'];\n   *\n   * $urlMatcherFactoryProvider.type('listItem', {\n   *   encode: function(item) {\n   *     // Represent the list item in the URL using its corresponding index\n   *     return list.indexOf(item);\n   *   },\n   *   decode: function(item) {\n   *     // Look up the list item by index\n   *     return list[parseInt(item, 10)];\n   *   },\n   *   is: function(item) {\n   *     // Ensure the item is valid by checking to see that it appears\n   *     // in the list\n   *     return list.indexOf(item) > -1;\n   *   }\n   * });\n   *\n   * $stateProvider.state('list', {\n   *   url: \"/list/{item:listItem}\",\n   *   controller: function($scope, $stateParams) {\n   *     console.log($stateParams.item);\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * // Changes URL to '/list/3', logs \"Ringo\" to the console\n   * $state.go('list', { item: \"Ringo\" });\n   * </pre>\n   *\n   * This is a more complex example of a type that relies on dependency injection to\n   * interact with services, and uses the parameter name from the URL to infer how to\n   * handle encoding and decoding parameter values:\n   *\n   * <pre>\n   * // Defines a custom type that gets a value from a service,\n   * // where each service gets different types of values from\n   * // a backend API:\n   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n   *\n   *   // Matches up services to URL parameter names\n   *   var services = {\n   *     user: Users,\n   *     post: Posts\n   *   };\n   *\n   *   return {\n   *     encode: function(object) {\n   *       // Represent the object in the URL using its unique ID\n   *       return object.id;\n   *     },\n   *     decode: function(value, key) {\n   *       // Look up the object by ID, using the parameter\n   *       // name (key) to call the correct service\n   *       return services[key].findById(value);\n   *     },\n   *     is: function(object, key) {\n   *       // Check that object is a valid dbObject\n   *       return angular.isObject(object) && object.id && services[key];\n   *     }\n   *     equals: function(a, b) {\n   *       // Check the equality of decoded objects by comparing\n   *       // their unique IDs\n   *       return a.id === b.id;\n   *     }\n   *   };\n   * });\n   *\n   * // In a config() block, you can then attach URLs with\n   * // type-annotated parameters:\n   * $stateProvider.state('users', {\n   *   url: \"/users\",\n   *   // ...\n   * }).state('users.item', {\n   *   url: \"/{user:dbObject}\",\n   *   controller: function($scope, $stateParams) {\n   *     // $stateParams.user will now be an object returned from\n   *     // the Users service\n   *   },\n   *   // ...\n   * });\n   * </pre>\n   */\n  this.type = function (name, definition, definitionFn) {\n    if (!isDefined(definition)) return $types[name];\n    if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\n    $types[name] = new Type(extend({ name: name }, definition));\n    if (definitionFn) {\n      typeQueue.push({ name: name, def: definitionFn });\n      if (!enqueue) flushTypeQueue();\n    }\n    return this;\n  };\n\n  // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n  function flushTypeQueue() {\n    while(typeQueue.length) {\n      var type = typeQueue.shift();\n      if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n      angular.extend($types[type.name], injector.invoke(type.def));\n    }\n  }\n\n  // Register default types. Store them in the prototype of $types.\n  forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n  $types = inherit($types, {});\n\n  /* No need to document $get, since it returns this */\n  this.$get = ['$injector', function ($injector) {\n    injector = $injector;\n    enqueue = false;\n    flushTypeQueue();\n\n    forEach(defaultTypes, function(type, name) {\n      if (!$types[name]) $types[name] = new Type(type);\n    });\n    return this;\n  }];\n\n  this.Param = function Param(id, type, config, location) {\n    var self = this;\n    config = unwrapShorthand(config);\n    type = getType(config, type, location);\n    var arrayMode = getArrayMode();\n    type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n    if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n      config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n    var isOptional = config.value !== undefined;\n    var squash = getSquashPolicy(config, isOptional);\n    var replace = getReplace(config, arrayMode, isOptional, squash);\n\n    function unwrapShorthand(config) {\n      var keys = isObject(config) ? objectKeys(config) : [];\n      var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n                        indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n      if (isShorthand) config = { value: config };\n      config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n      return config;\n    }\n\n    function getType(config, urlType, location) {\n      if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n      if (urlType) return urlType;\n      if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n      return config.type instanceof Type ? config.type : new Type(config.type);\n    }\n\n    // array config: param name (param[]) overrides default settings.  explicit config overrides param name.\n    function getArrayMode() {\n      var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n      var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n      return extend(arrayDefaults, arrayParamNomenclature, config).array;\n    }\n\n    /**\n     * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n     */\n    function getSquashPolicy(config, isOptional) {\n      var squash = config.squash;\n      if (!isOptional || squash === false) return false;\n      if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n      if (squash === true || isString(squash)) return squash;\n      throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n    }\n\n    function getReplace(config, arrayMode, isOptional, squash) {\n      var replace, configuredKeys, defaultPolicy = [\n        { from: \"\",   to: (isOptional || arrayMode ? undefined : \"\") },\n        { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n      ];\n      replace = isArray(config.replace) ? config.replace : [];\n      if (isString(squash))\n        replace.push({ from: squash, to: undefined });\n      configuredKeys = map(replace, function(item) { return item.from; } );\n      return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n    }\n\n    /**\n     * [Internal] Get the default value of a parameter, which may be an injectable function.\n     */\n    function $$getDefaultValue() {\n      if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n      return injector.invoke(config.$$fn);\n    }\n\n    /**\n     * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n     * default value, which may be the result of an injectable function.\n     */\n    function $value(value) {\n      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n      function $replace(value) {\n        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n        return replacement.length ? replacement[0] : value;\n      }\n      value = $replace(value);\n      return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n    }\n\n    function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\n    extend(this, {\n      id: id,\n      type: type,\n      location: location,\n      array: arrayMode,\n      squash: squash,\n      replace: replace,\n      isOptional: isOptional,\n      value: $value,\n      dynamic: undefined,\n      config: config,\n      toString: toString\n    });\n  };\n\n  function ParamSet(params) {\n    extend(this, params || {});\n  }\n\n  ParamSet.prototype = {\n    $$new: function() {\n      return inherit(this, extend(new ParamSet(), { $$parent: this}));\n    },\n    $$keys: function () {\n      var keys = [], chain = [], parent = this,\n        ignore = objectKeys(ParamSet.prototype);\n      while (parent) { chain.push(parent); parent = parent.$$parent; }\n      chain.reverse();\n      forEach(chain, function(paramset) {\n        forEach(objectKeys(paramset), function(key) {\n            if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n        });\n      });\n      return keys;\n    },\n    $$values: function(paramValues) {\n      var values = {}, self = this;\n      forEach(self.$$keys(), function(key) {\n        values[key] = self[key].value(paramValues && paramValues[key]);\n      });\n      return values;\n    },\n    $$equals: function(paramValues1, paramValues2) {\n      var equal = true, self = this;\n      forEach(self.$$keys(), function(key) {\n        var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n        if (!self[key].type.equals(left, right)) equal = false;\n      });\n      return equal;\n    },\n    $$validates: function $$validate(paramValues) {\n      var result = true, isOptional, val, param, self = this;\n\n      forEach(this.$$keys(), function(key) {\n        param = self[key];\n        val = paramValues[key];\n        isOptional = !val && param.isOptional;\n        result = result && (isOptional || !!param.type.is(val));\n      });\n      return result;\n    },\n    $$parent: undefined\n  };\n\n  this.ParamSet = ParamSet;\n}\n\n// Register as a provider so it's available to other providers\nangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\nangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n\n/**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider\n *\n * @requires ui.router.util.$urlMatcherFactoryProvider\n * @requires $locationProvider\n *\n * @description\n * `$urlRouterProvider` has the responsibility of watching `$location`. \n * When `$location` changes it runs through a list of rules one by one until a \n * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n *\n * There are several methods on `$urlRouterProvider` that make it useful to use directly\n * in your module config.\n */\n$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\nfunction $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {\n  var rules = [], otherwise = null, interceptDeferred = false, listener;\n\n  // Returns a string that is a prefix of all strings matching the RegExp\n  function regExpPrefix(re) {\n    var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n    return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n  }\n\n  // Interpolates matched values into a String.replace()-style pattern\n  function interpolate(pattern, match) {\n    return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n      return match[what === '$' ? 0 : Number(what)];\n    });\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#rule\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines rules that are used by `$urlRouterProvider` to find matches for\n   * specific URLs.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // Here's an example of how you might allow case insensitive urls\n   *   $urlRouterProvider.rule(function ($injector, $location) {\n   *     var path = $location.path(),\n   *         normalized = path.toLowerCase();\n   *\n   *     if (path !== normalized) {\n   *       return normalized;\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {object} rule Handler function that takes `$injector` and `$location`\n   * services as arguments. You can use them to return a valid path as a string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.rule = function (rule) {\n    if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    rules.push(rule);\n    return this;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouterProvider#otherwise\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines a path that is used when an invalid route is requested.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // if the path doesn't match any of the urls you configured\n   *   // otherwise will take care of routing the user to the\n   *   // specified url\n   *   $urlRouterProvider.otherwise('/index');\n   *\n   *   // Example of using function rule as param\n   *   $urlRouterProvider.otherwise(function ($injector, $location) {\n   *     return '/a/valid/url';\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} rule The url path you want to redirect to or a function \n   * rule that returns the url path. The function version is passed two params: \n   * `$injector` and `$location` services, and must return a url string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.otherwise = function (rule) {\n    if (isString(rule)) {\n      var redirect = rule;\n      rule = function () { return redirect; };\n    }\n    else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    otherwise = rule;\n    return this;\n  };\n\n\n  function handleIfMatch($injector, handler, match) {\n    if (!match) return false;\n    var result = $injector.invoke(handler, handler, { $match: match });\n    return isDefined(result) ? result : true;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#when\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Registers a handler for a given url matching. if handle is a string, it is\n   * treated as a redirect, and is interpolated according to the syntax of match\n   * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n   *\n   * If the handler is a function, it is injectable. It gets invoked if `$location`\n   * matches. You have the option of inject the match object as `$match`.\n   *\n   * The handler can return\n   *\n   * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n   *   will continue trying to find another one that matches.\n   * - **string** which is treated as a redirect and passed to `$location.url()`\n   * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n   *     if ($state.$current.navigable !== state ||\n   *         !equalForKeys($match, $stateParams) {\n   *      $state.transitionTo(state, $match, false);\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} what The incoming path that you want to redirect.\n   * @param {string|object} handler The path you want to redirect your user to.\n   */\n  this.when = function (what, handler) {\n    var redirect, handlerIsString = isString(handler);\n    if (isString(what)) what = $urlMatcherFactory.compile(what);\n\n    if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n      throw new Error(\"invalid 'handler' in when()\");\n\n    var strategies = {\n      matcher: function (what, handler) {\n        if (handlerIsString) {\n          redirect = $urlMatcherFactory.compile(handler);\n          handler = ['$match', function ($match) { return redirect.format($match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n        }, {\n          prefix: isString(what.prefix) ? what.prefix : ''\n        });\n      },\n      regex: function (what, handler) {\n        if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\n        if (handlerIsString) {\n          redirect = handler;\n          handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path()));\n        }, {\n          prefix: regExpPrefix(what)\n        });\n      }\n    };\n\n    var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\n    for (var n in check) {\n      if (check[n]) return this.rule(strategies[n](what, handler));\n    }\n\n    throw new Error(\"invalid 'what' in when()\");\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#deferIntercept\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Disables (or enables) deferring location change interception.\n   *\n   * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n   * defer a transition but maintain the current URL), call this method at configuration time.\n   * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n   * `$locationChangeSuccess` event handler.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *\n   *   // Prevent $urlRouter from automatically intercepting URL changes;\n   *   // this allows you to configure custom behavior in between\n   *   // location changes and route synchronization:\n   *   $urlRouterProvider.deferIntercept();\n   *\n   * }).run(function ($rootScope, $urlRouter, UserService) {\n   *\n   *   $rootScope.$on('$locationChangeSuccess', function(e) {\n   *     // UserService is an example service for managing user state\n   *     if (UserService.isLoggedIn()) return;\n   *\n   *     // Prevent $urlRouter's default handler from firing\n   *     e.preventDefault();\n   *\n   *     UserService.handleLogin().then(function() {\n   *       // Once the user has logged in, sync the current URL\n   *       // to the router:\n   *       $urlRouter.sync();\n   *     });\n   *   });\n   *\n   *   // Configures $urlRouter's listener *after* your custom listener\n   *   $urlRouter.listen();\n   * });\n   * </pre>\n   *\n   * @param {boolean} defer Indicates whether to defer location change interception. Passing\n            no parameter is equivalent to `true`.\n   */\n  this.deferIntercept = function (defer) {\n    if (defer === undefined) defer = true;\n    interceptDeferred = defer;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouter\n   *\n   * @requires $location\n   * @requires $rootScope\n   * @requires $injector\n   * @requires $browser\n   *\n   * @description\n   *\n   */\n  this.$get = $get;\n  $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];\n  function $get(   $location,   $rootScope,   $injector,   $browser) {\n\n    var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\n    function appendBasePath(url, isHtml5, absolute) {\n      if (baseHref === '/') return url;\n      if (isHtml5) return baseHref.slice(0, -1) + url;\n      if (absolute) return baseHref.slice(1) + url;\n      return url;\n    }\n\n    // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n    function update(evt) {\n      if (evt && evt.defaultPrevented) return;\n      var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n      lastPushedUrl = undefined;\n      if (ignoreUpdate) return true;\n\n      function check(rule) {\n        var handled = rule($injector, $location);\n\n        if (!handled) return false;\n        if (isString(handled)) $location.replace().url(handled);\n        return true;\n      }\n      var n = rules.length, i;\n\n      for (i = 0; i < n; i++) {\n        if (check(rules[i])) return;\n      }\n      // always check otherwise last to allow dynamic updates to the set of rules\n      if (otherwise) check(otherwise);\n    }\n\n    function listen() {\n      listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n      return listener;\n    }\n\n    if (!interceptDeferred) listen();\n\n    return {\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#sync\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n       * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n       * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n       * with the transition by calling `$urlRouter.sync()`.\n       *\n       * @example\n       * <pre>\n       * angular.module('app', ['ui.router'])\n       *   .run(function($rootScope, $urlRouter) {\n       *     $rootScope.$on('$locationChangeSuccess', function(evt) {\n       *       // Halt state change from even starting\n       *       evt.preventDefault();\n       *       // Perform custom logic\n       *       var meetsRequirement = ...\n       *       // Continue with the update and state transition if logic allows\n       *       if (meetsRequirement) $urlRouter.sync();\n       *     });\n       * });\n       * </pre>\n       */\n      sync: function() {\n        update();\n      },\n\n      listen: function() {\n        return listen();\n      },\n\n      update: function(read) {\n        if (read) {\n          location = $location.url();\n          return;\n        }\n        if ($location.url() === location) return;\n\n        $location.url(location);\n        $location.replace();\n      },\n\n      push: function(urlMatcher, params, options) {\n        $location.url(urlMatcher.format(params || {}));\n        lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n        if (options && options.replace) $location.replace();\n      },\n\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#href\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * A URL generation method that returns the compiled URL for a given\n       * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n       *\n       * @example\n       * <pre>\n       * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n       *   person: \"bob\"\n       * });\n       * // $bob == \"/about/bob\";\n       * </pre>\n       *\n       * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n       * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n       * @param {object=} options Options object. The options are:\n       *\n       * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n       *\n       * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n       */\n      href: function(urlMatcher, params, options) {\n        if (!urlMatcher.validates(params)) return null;\n\n        var isHtml5 = $locationProvider.html5Mode();\n        if (angular.isObject(isHtml5)) {\n          isHtml5 = isHtml5.enabled;\n        }\n        \n        var url = urlMatcher.format(params);\n        options = options || {};\n\n        if (!isHtml5 && url !== null) {\n          url = \"#\" + $locationProvider.hashPrefix() + url;\n        }\n        url = appendBasePath(url, isHtml5, options.absolute);\n\n        if (!options.absolute || !url) {\n          return url;\n        }\n\n        var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n        port = (port === 80 || port === 443 ? '' : ':' + port);\n\n        return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n      }\n    };\n  }\n}\n\nangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$stateProvider\n *\n * @requires ui.router.router.$urlRouterProvider\n * @requires ui.router.util.$urlMatcherFactoryProvider\n *\n * @description\n * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\n$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\nfunction $StateProvider(   $urlRouterProvider,   $urlMatcherFactory) {\n\n  var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\n  // Builds state properties from definition passed to registerState()\n  var stateBuilder = {\n\n    // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n    // state.children = [];\n    // if (parent) parent.children.push(state);\n    parent: function(state) {\n      if (isDefined(state.parent) && state.parent) return findState(state.parent);\n      // regex matches any valid composite state name\n      // would match \"contact.list\" but not \"contacts\"\n      var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n      return compositeName ? findState(compositeName[1]) : root;\n    },\n\n    // inherit 'data' from parent and override by own values (if any)\n    data: function(state) {\n      if (state.parent && state.parent.data) {\n        state.data = state.self.data = extend({}, state.parent.data, state.data);\n      }\n      return state.data;\n    },\n\n    // Build a URLMatcher if necessary, either via a relative or absolute URL\n    url: function(state) {\n      var url = state.url, config = { params: state.params || {} };\n\n      if (isString(url)) {\n        if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n        return (state.parent.navigable || root).url.concat(url, config);\n      }\n\n      if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n      throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n    },\n\n    // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n    navigable: function(state) {\n      return state.url ? state : (state.parent ? state.parent.navigable : null);\n    },\n\n    // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n    ownParams: function(state) {\n      var params = state.url && state.url.params || new $$UMFP.ParamSet();\n      forEach(state.params || {}, function(config, id) {\n        if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n      });\n      return params;\n    },\n\n    // Derive parameters for this state and ensure they're a super-set of parent's parameters\n    params: function(state) {\n      return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();\n    },\n\n    // If there is no explicit multi-view configuration, make one up so we don't have\n    // to handle both cases in the view directive later. Note that having an explicit\n    // 'views' property will mean the default unnamed view properties are ignored. This\n    // is also a good time to resolve view names to absolute names, so everything is a\n    // straight lookup at link time.\n    views: function(state) {\n      var views = {};\n\n      forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n        if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n        views[name] = view;\n      });\n      return views;\n    },\n\n    // Keep a full path from the root down to this state as this is needed for state activation.\n    path: function(state) {\n      return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n    },\n\n    // Speed up $state.contains() as it's used a lot\n    includes: function(state) {\n      var includes = state.parent ? extend({}, state.parent.includes) : {};\n      includes[state.name] = true;\n      return includes;\n    },\n\n    $delegates: {}\n  };\n\n  function isRelative(stateName) {\n    return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n  }\n\n  function findState(stateOrName, base) {\n    if (!stateOrName) return undefined;\n\n    var isStr = isString(stateOrName),\n        name  = isStr ? stateOrName : stateOrName.name,\n        path  = isRelative(name);\n\n    if (path) {\n      if (!base) throw new Error(\"No reference point given for path '\"  + name + \"'\");\n      base = findState(base);\n      \n      var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\n      for (; i < pathLength; i++) {\n        if (rel[i] === \"\" && i === 0) {\n          current = base;\n          continue;\n        }\n        if (rel[i] === \"^\") {\n          if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n          current = current.parent;\n          continue;\n        }\n        break;\n      }\n      rel = rel.slice(i).join(\".\");\n      name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n    }\n    var state = states[name];\n\n    if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n      return state;\n    }\n    return undefined;\n  }\n\n  function queueState(parentName, state) {\n    if (!queue[parentName]) {\n      queue[parentName] = [];\n    }\n    queue[parentName].push(state);\n  }\n\n  function flushQueuedChildren(parentName) {\n    var queued = queue[parentName] || [];\n    while(queued.length) {\n      registerState(queued.shift());\n    }\n  }\n\n  function registerState(state) {\n    // Wrap a new object around the state so we can store our private details easily.\n    state = inherit(state, {\n      self: state,\n      resolve: state.resolve || {},\n      toString: function() { return this.name; }\n    });\n\n    var name = state.name;\n    if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n    if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"'' is already defined\");\n\n    // Get parent name\n    var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n        : (isString(state.parent)) ? state.parent\n        : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n        : '';\n\n    // If parent is not registered yet, add state to queue and register later\n    if (parentName && !states[parentName]) {\n      return queueState(parentName, state.self);\n    }\n\n    for (var key in stateBuilder) {\n      if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n    }\n    states[name] = state;\n\n    // Register the state in the global state list and with $urlRouter if necessary.\n    if (!state[abstractKey] && state.url) {\n      $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n        if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n          $state.transitionTo(state, $match, { inherit: true, location: false });\n        }\n      }]);\n    }\n\n    // Register any queued children\n    flushQueuedChildren(name);\n\n    return state;\n  }\n\n  // Checks text to see if it looks like a glob.\n  function isGlob (text) {\n    return text.indexOf('*') > -1;\n  }\n\n  // Returns true if glob matches current $state name.\n  function doesStateMatchGlob (glob) {\n    var globSegments = glob.split('.'),\n        segments = $state.$current.name.split('.');\n\n    //match greedy starts\n    if (globSegments[0] === '**') {\n       segments = segments.slice(indexOf(segments, globSegments[1]));\n       segments.unshift('**');\n    }\n    //match greedy ends\n    if (globSegments[globSegments.length - 1] === '**') {\n       segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n       segments.push('**');\n    }\n\n    if (globSegments.length != segments.length) {\n      return false;\n    }\n\n    //match single stars\n    for (var i = 0, l = globSegments.length; i < l; i++) {\n      if (globSegments[i] === '*') {\n        segments[i] = '*';\n      }\n    }\n\n    return segments.join('') === globSegments.join('');\n  }\n\n\n  // Implicit root state that is always active\n  root = registerState({\n    name: '',\n    url: '^',\n    views: null,\n    'abstract': true\n  });\n  root.navigable = null;\n\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#decorator\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Allows you to extend (carefully) or override (at your own peril) the \n   * `stateBuilder` object used internally by `$stateProvider`. This can be used \n   * to add custom functionality to ui-router, for example inferring templateUrl \n   * based on the state name.\n   *\n   * When passing only a name, it returns the current (original or decorated) builder\n   * function that matches `name`.\n   *\n   * The builder functions that can be decorated are listed below. Though not all\n   * necessarily have a good use case for decoration, that is up to you to decide.\n   *\n   * In addition, users can attach custom decorators, which will generate new \n   * properties within the state's internal definition. There is currently no clear \n   * use-case for this beyond accessing internal states (i.e. $state.$current), \n   * however, expect this to become increasingly relevant as we introduce additional \n   * meta-programming features.\n   *\n   * **Warning**: Decorators should not be interdependent because the order of \n   * execution of the builder functions in non-deterministic. Builder functions \n   * should only be dependent on the state definition object and super function.\n   *\n   *\n   * Existing builder functions and current return values:\n   *\n   * - **parent** `{object}` - returns the parent state object.\n   * - **data** `{object}` - returns state data, including any inherited data that is not\n   *   overridden by own values (if any).\n   * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n   *   or `null`.\n   * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n   *   navigable).\n   * - **params** `{object}` - returns an array of state params that are ensured to \n   *   be a super-set of parent's params.\n   * - **views** `{object}` - returns a views object where each key is an absolute view \n   *   name (i.e. \"viewName@stateName\") and each value is the config object \n   *   (template, controller) for the view. Even when you don't use the views object \n   *   explicitly on a state config, one is still created for you internally.\n   *   So by decorating this builder function you have access to decorating template \n   *   and controller properties.\n   * - **ownParams** `{object}` - returns an array of params that belong to the state, \n   *   not including any params defined by ancestor states.\n   * - **path** `{string}` - returns the full path from the root down to this state. \n   *   Needed for state activation.\n   * - **includes** `{object}` - returns an object that includes every state that \n   *   would pass a `$state.includes()` test.\n   *\n   * @example\n   * <pre>\n   * // Override the internal 'views' builder with a function that takes the state\n   * // definition, and a reference to the internal function being overridden:\n   * $stateProvider.decorator('views', function (state, parent) {\n   *   var result = {},\n   *       views = parent(state);\n   *\n   *   angular.forEach(views, function (config, name) {\n   *     var autoName = (state.name + '.' + name).replace('.', '/');\n   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n   *     result[name] = config;\n   *   });\n   *   return result;\n   * });\n   *\n   * $stateProvider.state('home', {\n   *   views: {\n   *     'contact.list': { controller: 'ListController' },\n   *     'contact.item': { controller: 'ItemController' }\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * $state.go('home');\n   * // Auto-populates list and item views with /partials/home/contact/list.html,\n   * // and /partials/home/contact/item.html, respectively.\n   * </pre>\n   *\n   * @param {string} name The name of the builder function to decorate. \n   * @param {object} func A function that is responsible for decorating the original \n   * builder function. The function receives two parameters:\n   *\n   *   - `{object}` - state - The state config object.\n   *   - `{object}` - super - The original builder function.\n   *\n   * @return {object} $stateProvider - $stateProvider instance\n   */\n  this.decorator = decorator;\n  function decorator(name, func) {\n    /*jshint validthis: true */\n    if (isString(name) && !isDefined(func)) {\n      return stateBuilder[name];\n    }\n    if (!isFunction(func) || !isString(name)) {\n      return this;\n    }\n    if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n      stateBuilder.$delegates[name] = stateBuilder[name];\n    }\n    stateBuilder[name] = func;\n    return this;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#state\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Registers a state configuration under a given state name. The stateConfig object\n   * has the following acceptable properties.\n   *\n   * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n   * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n   * @param {object} stateConfig State configuration object.\n   * @param {string|function=} stateConfig.template\n   * <a id='template'></a>\n   *   html template as a string or a function that returns\n   *   an html template as a string which should be used by the uiView directives. This property \n   *   takes precedence over templateUrl.\n   *   \n   *   If `template` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by\n   *     applying the current state\n   *\n   * <pre>template:\n   *   \"<h1>inline template definition</h1>\" +\n   *   \"<div ui-view></div>\"</pre>\n   * <pre>template: function(params) {\n   *       return \"<h1>generated template</h1>\"; }</pre>\n   * </div>\n   *\n   * @param {string|function=} stateConfig.templateUrl\n   * <a id='templateUrl'></a>\n   *\n   *   path or function that returns a path to an html\n   *   template that should be used by uiView.\n   *   \n   *   If `templateUrl` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by \n   *     applying the current state\n   *\n   * <pre>templateUrl: \"home.html\"</pre>\n   * <pre>templateUrl: function(params) {\n   *     return myTemplates[params.pageId]; }</pre>\n   *\n   * @param {function=} stateConfig.templateProvider\n   * <a id='templateProvider'></a>\n   *    Provider function that returns HTML content string.\n   * <pre> templateProvider:\n   *       function(MyTemplateService, params) {\n   *         return MyTemplateService.getTemplate(params.pageId);\n   *       }</pre>\n   *\n   * @param {string|function=} stateConfig.controller\n   * <a id='controller'></a>\n   *\n   *  Controller fn that should be associated with newly\n   *   related scope or the name of a registered controller if passed as a string.\n   *   Optionally, the ControllerAs may be declared here.\n   * <pre>controller: \"MyRegisteredController\"</pre>\n   * <pre>controller:\n   *     \"MyRegisteredController as fooCtrl\"}</pre>\n   * <pre>controller: function($scope, MyService) {\n   *     $scope.data = MyService.getData(); }</pre>\n   *\n   * @param {function=} stateConfig.controllerProvider\n   * <a id='controllerProvider'></a>\n   *\n   * Injectable provider function that returns the actual controller or string.\n   * <pre>controllerProvider:\n   *   function(MyResolveData) {\n   *     if (MyResolveData.foo)\n   *       return \"FooCtrl\"\n   *     else if (MyResolveData.bar)\n   *       return \"BarCtrl\";\n   *     else return function($scope) {\n   *       $scope.baz = \"Qux\";\n   *     }\n   *   }</pre>\n   *\n   * @param {string=} stateConfig.controllerAs\n   * <a id='controllerAs'></a>\n   * \n   * A controller alias name. If present the controller will be\n   *   published to scope under the controllerAs name.\n   * <pre>controllerAs: \"myCtrl\"</pre>\n   *\n   * @param {object=} stateConfig.resolve\n   * <a id='resolve'></a>\n   *\n   * An optional map&lt;string, function&gt; of dependencies which\n   *   should be injected into the controller. If any of these dependencies are promises, \n   *   the router will wait for them all to be resolved before the controller is instantiated.\n   *   If all the promises are resolved successfully, the $stateChangeSuccess event is fired\n   *   and the values of the resolved promises are injected into any controllers that reference them.\n   *   If any  of the promises are rejected the $stateChangeError event is fired.\n   *\n   *   The map object is:\n   *   \n   *   - key - {string}: name of dependency to be injected into controller\n   *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, \n   *     it is injected and return value it treated as dependency. If result is a promise, it is \n   *     resolved before its value is injected into controller.\n   *\n   * <pre>resolve: {\n   *     myResolve1:\n   *       function($http, $stateParams) {\n   *         return $http.get(\"/api/foos/\"+stateParams.fooID);\n   *       }\n   *     }</pre>\n   *\n   * @param {string=} stateConfig.url\n   * <a id='url'></a>\n   *\n   *   A url fragment with optional parameters. When a state is navigated or\n   *   transitioned to, the `$stateParams` service will be populated with any \n   *   parameters that were passed.\n   *\n   * examples:\n   * <pre>url: \"/home\"\n   * url: \"/users/:userid\"\n   * url: \"/books/{bookid:[a-zA-Z_-]}\"\n   * url: \"/books/{categoryid:int}\"\n   * url: \"/books/{publishername:string}/{categoryid:int}\"\n   * url: \"/messages?before&after\"\n   * url: \"/messages?{before:date}&{after:date}\"</pre>\n   * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n   *\n   * @param {object=} stateConfig.views\n   * <a id='views'></a>\n   * an optional map&lt;string, object&gt; which defined multiple views, or targets views\n   * manually/explicitly.\n   *\n   * Examples:\n   *\n   * Targets three named `ui-view`s in the parent state's template\n   * <pre>views: {\n   *     header: {\n   *       controller: \"headerCtrl\",\n   *       templateUrl: \"header.html\"\n   *     }, body: {\n   *       controller: \"bodyCtrl\",\n   *       templateUrl: \"body.html\"\n   *     }, footer: {\n   *       controller: \"footCtrl\",\n   *       templateUrl: \"footer.html\"\n   *     }\n   *   }</pre>\n   *\n   * Targets named `ui-view=\"header\"` from grandparent state 'top''s template, and named `ui-view=\"body\" from parent state's template.\n   * <pre>views: {\n   *     'header@top': {\n   *       controller: \"msgHeaderCtrl\",\n   *       templateUrl: \"msgHeader.html\"\n   *     }, 'body': {\n   *       controller: \"messagesCtrl\",\n   *       templateUrl: \"messages.html\"\n   *     }\n   *   }</pre>\n   *\n   * @param {boolean=} [stateConfig.abstract=false]\n   * <a id='abstract'></a>\n   * An abstract state will never be directly activated,\n   *   but can provide inherited properties to its common children states.\n   * <pre>abstract: true</pre>\n   *\n   * @param {function=} stateConfig.onEnter\n   * <a id='onEnter'></a>\n   *\n   * Callback function for when a state is entered. Good way\n   *   to trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onEnter: function(MyService, $stateParams) {\n   *     MyService.foo($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {function=} stateConfig.onExit\n   * <a id='onExit'></a>\n   *\n   * Callback function for when a state is exited. Good way to\n   *   trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onExit: function(MyService, $stateParams) {\n   *     MyService.cleanup($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {boolean=} [stateConfig.reloadOnSearch=true]\n   * <a id='reloadOnSearch'></a>\n   *\n   * If `false`, will not retrigger the same state\n   *   just because a search/query parameter has changed (via $location.search() or $location.hash()). \n   *   Useful for when you'd like to modify $location.search() without triggering a reload.\n   * <pre>reloadOnSearch: false</pre>\n   *\n   * @param {object=} stateConfig.data\n   * <a id='data'></a>\n   *\n   * Arbitrary data object, useful for custom configuration.  The parent state's `data` is\n   *   prototypally inherited.  In other words, adding a data property to a state adds it to\n   *   the entire subtree via prototypal inheritance.\n   *\n   * <pre>data: {\n   *     requiredRole: 'foo'\n   * } </pre>\n   *\n   * @param {object=} stateConfig.params\n   * <a id='params'></a>\n   *\n   * A map which optionally configures parameters declared in the `url`, or\n   *   defines additional non-url parameters.  For each parameter being\n   *   configured, add a configuration object keyed to the name of the parameter.\n   *\n   *   Each parameter configuration object may contain the following properties:\n   *\n   *   - ** value ** - {object|function=}: specifies the default value for this\n   *     parameter.  This implicitly sets this parameter as optional.\n   *\n   *     When UI-Router routes to a state and no value is\n   *     specified for this parameter in the URL or transition, the\n   *     default value will be used instead.  If `value` is a function,\n   *     it will be injected and invoked, and the return value used.\n   *\n   *     *Note*: `undefined` is treated as \"no default value\" while `null`\n   *     is treated as \"the default value is `null`\".\n   *\n   *     *Shorthand*: If you only need to configure the default value of the\n   *     parameter, you may use a shorthand syntax.   In the **`params`**\n   *     map, instead mapping the param name to a full parameter configuration\n   *     object, simply set map it to the default parameter value, e.g.:\n   *\n   * <pre>// define a parameter's default value\n   * params: {\n   *     param1: { value: \"defaultValue\" }\n   * }\n   * // shorthand default values\n   * params: {\n   *     param1: \"defaultValue\",\n   *     param2: \"param2Default\"\n   * }</pre>\n   *\n   *   - ** array ** - {boolean=}: *(default: false)* If true, the param value will be\n   *     treated as an array of values.  If you specified a Type, the value will be\n   *     treated as an array of the specified Type.  Note: query parameter values\n   *     default to a special `\"auto\"` mode.\n   *\n   *     For query parameters in `\"auto\"` mode, if multiple  values for a single parameter\n   *     are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values\n   *     are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`).  However, if\n   *     only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single\n   *     value (e.g.: `{ foo: '1' }`).\n   *\n   * <pre>params: {\n   *     param1: { array: true }\n   * }</pre>\n   *\n   *   - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when\n   *     the current parameter value is the same as the default value. If `squash` is not set, it uses the\n   *     configured default squash policy.\n   *     (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})\n   *\n   *   There are three squash settings:\n   *\n   *     - false: The parameter's default value is not squashed.  It is encoded and included in the URL\n   *     - true: The parameter's default value is omitted from the URL.  If the parameter is preceeded and followed\n   *       by slashes in the state's `url` declaration, then one of those slashes are omitted.\n   *       This can allow for cleaner looking URLs.\n   *     - `\"<arbitrary string>\"`: The parameter's default value is replaced with an arbitrary placeholder of  your choice.\n   *\n   * <pre>params: {\n   *     param1: {\n   *       value: \"defaultId\",\n   *       squash: true\n   * } }\n   * // squash \"defaultValue\" to \"~\"\n   * params: {\n   *     param1: {\n   *       value: \"defaultValue\",\n   *       squash: \"~\"\n   * } }\n   * </pre>\n   *\n   *\n   * @example\n   * <pre>\n   * // Some state name examples\n   *\n   * // stateName can be a single top-level name (must be unique).\n   * $stateProvider.state(\"home\", {});\n   *\n   * // Or it can be a nested state name. This state is a child of the\n   * // above \"home\" state.\n   * $stateProvider.state(\"home.newest\", {});\n   *\n   * // Nest states as deeply as needed.\n   * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n   *\n   * // state() returns $stateProvider, so you can chain state declarations.\n   * $stateProvider\n   *   .state(\"home\", {})\n   *   .state(\"about\", {})\n   *   .state(\"contacts\", {});\n   * </pre>\n   *\n   */\n  this.state = state;\n  function state(name, definition) {\n    /*jshint validthis: true */\n    if (isObject(name)) definition = name;\n    else definition.name = name;\n    registerState(definition);\n    return this;\n  }\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$state\n   *\n   * @requires $rootScope\n   * @requires $q\n   * @requires ui.router.state.$view\n   * @requires $injector\n   * @requires ui.router.util.$resolve\n   * @requires ui.router.state.$stateParams\n   * @requires ui.router.router.$urlRouter\n   *\n   * @property {object} params A param object, e.g. {sectionId: section.id)}, that \n   * you'd like to test against the current active state.\n   * @property {object} current A reference to the state's config object. However \n   * you passed it in. Useful for accessing custom data.\n   * @property {object} transition Currently pending transition. A promise that'll \n   * resolve or reject.\n   *\n   * @description\n   * `$state` service is responsible for representing states as well as transitioning\n   * between them. It also provides interfaces to ask for current state or even states\n   * you're coming from.\n   */\n  this.$get = $get;\n  $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];\n  function $get(   $rootScope,   $q,   $view,   $injector,   $resolve,   $stateParams,   $urlRouter,   $location,   $urlMatcherFactory) {\n\n    var TransitionSuperseded = $q.reject(new Error('transition superseded'));\n    var TransitionPrevented = $q.reject(new Error('transition prevented'));\n    var TransitionAborted = $q.reject(new Error('transition aborted'));\n    var TransitionFailed = $q.reject(new Error('transition failed'));\n\n    // Handles the case where a state which is the target of a transition is not found, and the user\n    // can optionally retry or defer the transition\n    function handleRedirect(redirect, state, params, options) {\n      /**\n       * @ngdoc event\n       * @name ui.router.state.$state#$stateNotFound\n       * @eventOf ui.router.state.$state\n       * @eventType broadcast on root scope\n       * @description\n       * Fired when a requested state **cannot be found** using the provided state name during transition.\n       * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n       * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n       * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n       * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n       *\n       * @param {Object} event Event object.\n       * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n       * @param {State} fromState Current state object.\n       * @param {Object} fromParams Current state params.\n       *\n       * @example\n       *\n       * <pre>\n       * // somewhere, assume lazy.state has not been defined\n       * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n       *\n       * // somewhere else\n       * $scope.$on('$stateNotFound',\n       * function(event, unfoundState, fromState, fromParams){\n       *     console.log(unfoundState.to); // \"lazy.state\"\n       *     console.log(unfoundState.toParams); // {a:1, b:2}\n       *     console.log(unfoundState.options); // {inherit:false} + default options\n       * })\n       * </pre>\n       */\n      var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n      if (evt.defaultPrevented) {\n        $urlRouter.update();\n        return TransitionAborted;\n      }\n\n      if (!evt.retry) {\n        return null;\n      }\n\n      // Allow the handler to return a promise to defer state lookup retry\n      if (options.$retry) {\n        $urlRouter.update();\n        return TransitionFailed;\n      }\n      var retryTransition = $state.transition = $q.when(evt.retry);\n\n      retryTransition.then(function() {\n        if (retryTransition !== $state.transition) return TransitionSuperseded;\n        redirect.options.$retry = true;\n        return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n      }, function() {\n        return TransitionAborted;\n      });\n      $urlRouter.update();\n\n      return retryTransition;\n    }\n\n    root.locals = { resolve: null, globals: { $stateParams: {} } };\n\n    $state = {\n      params: {},\n      current: root.self,\n      $current: root,\n      transition: null\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#reload\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired, \n     * and controllers reinstantiated (bug with controllers reinstantiating right now, fixing soon).\n     *\n     * @example\n     * <pre>\n     * var app angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.reload = function(){\n     *     $state.reload();\n     *   }\n     * });\n     * </pre>\n     *\n     * `reload()` is just an alias for:\n     * <pre>\n     * $state.transitionTo($state.current, $stateParams, { \n     *   reload: true, inherit: false, notify: true\n     * });\n     * </pre>\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.reload = function reload() {\n      return $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#go\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Convenience method for transitioning to a new state. `$state.go` calls \n     * `$state.transitionTo` internally but automatically sets options to \n     * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. \n     * This allows you to easily use an absolute or relative to path and specify \n     * only the parameters you'd like to update (while letting unspecified parameters \n     * inherit from the currently active ancestor states).\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.go('contact.detail');\n     *   };\n     * });\n     * </pre>\n     * <img src='../ngdoc_assets/StateGoExamples.png'/>\n     *\n     * @param {string} to Absolute state name or relative state path. Some examples:\n     *\n     * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n     * - `$state.go('^')` - will go to a parent state\n     * - `$state.go('^.sibling')` - will go to a sibling state\n     * - `$state.go('.child.grandchild')` - will go to grandchild state\n     *\n     * @param {object=} params A map of the parameters that will be sent to the state, \n     * will populate $stateParams. Any parameters that are not specified will be inherited from currently \n     * defined parameters. This allows, for example, going to a sibling state that shares parameters\n     * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.\n     * transitioning to a sibling will get you the parameters for all parents, transitioning to a child\n     * will get you all current parameters, etc.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition.\n     *\n     * Possible success values:\n     *\n     * - $state.current\n     *\n     * <br/>Possible rejection values:\n     *\n     * - 'transition superseded' - when a newer transition has been started after this one\n     * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener\n     * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or\n     *   when a `$stateNotFound` `event.retry` promise errors.\n     * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.\n     * - *resolve error* - when an error has occurred with a `resolve`\n     *\n     */\n    $state.go = function go(to, params, options) {\n      return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#transitionTo\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}\n     * uses `transitionTo` internally. `$state.go` is recommended in most situations.\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.transitionTo('contact.detail');\n     *   };\n     * });\n     * </pre>\n     *\n     * @param {string} to State name.\n     * @param {object=} toParams A map of the parameters that will be sent to the state,\n     * will populate $stateParams.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.transitionTo = function transitionTo(to, toParams, options) {\n      toParams = toParams || {};\n      options = extend({\n        location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false\n      }, options || {});\n\n      var from = $state.$current, fromParams = $state.params, fromPath = from.path;\n      var evt, toState = findState(to, options.relative);\n\n      if (!isDefined(toState)) {\n        var redirect = { to: to, toParams: toParams, options: options };\n        var redirectResult = handleRedirect(redirect, from.self, fromParams, options);\n\n        if (redirectResult) {\n          return redirectResult;\n        }\n\n        // Always retry once if the $stateNotFound was not prevented\n        // (handles either redirect changed or state lazy-definition)\n        to = redirect.to;\n        toParams = redirect.toParams;\n        options = redirect.options;\n        toState = findState(to, options.relative);\n\n        if (!isDefined(toState)) {\n          if (!options.relative) throw new Error(\"No such state '\" + to + \"'\");\n          throw new Error(\"Could not resolve '\" + to + \"' from state '\" + options.relative + \"'\");\n        }\n      }\n      if (toState[abstractKey]) throw new Error(\"Cannot transition to abstract state '\" + to + \"'\");\n      if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);\n      if (!toState.params.$$validates(toParams)) return TransitionFailed;\n\n      toParams = toState.params.$$values(toParams);\n      to = toState;\n\n      var toPath = to.path;\n\n      // Starting from the root of the path, keep all levels that haven't changed\n      var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];\n\n      if (!options.reload) {\n        while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {\n          locals = toLocals[keep] = state.locals;\n          keep++;\n          state = toPath[keep];\n        }\n      }\n\n      // If we're going to the same state and all locals are kept, we've got nothing to do.\n      // But clear 'transition', as we still want to cancel any other pending transitions.\n      // TODO: We may not want to bump 'transition' if we're called from a location change\n      // that we've initiated ourselves, because we might accidentally abort a legitimate\n      // transition initiated from code?\n      if (shouldTriggerReload(to, from, locals, options)) {\n        if (to.self.reloadOnSearch !== false) $urlRouter.update();\n        $state.transition = null;\n        return $q.when($state.current);\n      }\n\n      // Filter parameters before we pass them to event handlers etc.\n      toParams = filterByKeys(to.params.$$keys(), toParams || {});\n\n      // Broadcast start event and cancel the transition if requested\n      if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeStart\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when the state transition **begins**. You can use `event.preventDefault()`\n         * to prevent the transition from happening and then the transition promise will be\n         * rejected with a `'transition prevented'` value.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         *\n         * @example\n         *\n         * <pre>\n         * $rootScope.$on('$stateChangeStart',\n         * function(event, toState, toParams, fromState, fromParams){\n         *     event.preventDefault();\n         *     // transitionTo() promise will be rejected with\n         *     // a 'transition prevented' error\n         * })\n         * </pre>\n         */\n        if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {\n          $urlRouter.update();\n          return TransitionPrevented;\n        }\n      }\n\n      // Resolve locals for the remaining states, but don't update any global state just\n      // yet -- if anything fails to resolve the current state needs to remain untouched.\n      // We also set up an inheritance chain for the locals here. This allows the view directive\n      // to quickly look up the correct definition for each view in the current state. Even\n      // though we create the locals object itself outside resolveState(), it is initially\n      // empty and gets filled asynchronously. We need to keep track of the promise for the\n      // (fully resolved) current locals, and pass this down the chain.\n      var resolved = $q.when(locals);\n\n      for (var l = keep; l < toPath.length; l++, state = toPath[l]) {\n        locals = toLocals[l] = inherit(locals);\n        resolved = resolveState(state, toParams, state === to, resolved, locals, options);\n      }\n\n      // Once everything is resolved, we are ready to perform the actual transition\n      // and return a promise for the new state. We also keep track of what the\n      // current promise is, so that we can detect overlapping transitions and\n      // keep only the outcome of the last transition.\n      var transition = $state.transition = resolved.then(function () {\n        var l, entering, exiting;\n\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Exit 'from' states not kept\n        for (l = fromPath.length - 1; l >= keep; l--) {\n          exiting = fromPath[l];\n          if (exiting.self.onExit) {\n            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);\n          }\n          exiting.locals = null;\n        }\n\n        // Enter 'to' states not kept\n        for (l = keep; l < toPath.length; l++) {\n          entering = toPath[l];\n          entering.locals = toLocals[l];\n          if (entering.self.onEnter) {\n            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);\n          }\n        }\n\n        // Run it again, to catch any transitions in callbacks\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Update globals in $state\n        $state.$current = to;\n        $state.current = to.self;\n        $state.params = toParams;\n        copy($state.params, $stateParams);\n        $state.transition = null;\n\n        if (options.location && to.navigable) {\n          $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {\n            $$avoidResync: true, replace: options.location === 'replace'\n          });\n        }\n\n        if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeSuccess\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired once the state transition is **complete**.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         */\n          $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);\n        }\n        $urlRouter.update(true);\n\n        return $state.current;\n      }, function (error) {\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        $state.transition = null;\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeError\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when an **error occurs** during transition. It's important to note that if you\n         * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n         * they will not throw traditionally. You must listen for this $stateChangeError event to\n         * catch **ALL** errors.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         * @param {Error} error The resolve error object.\n         */\n        evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);\n\n        if (!evt.defaultPrevented) {\n            $urlRouter.update();\n        }\n\n        return $q.reject(error);\n      });\n\n      return transition;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#is\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Similar to {@link ui.router.state.$state#methods_includes $state.includes},\n     * but only checks for the full state name. If params is supplied then it will be\n     * tested for strict equality against the current active params object, so all params\n     * must match with none missing and no extras.\n     *\n     * @example\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // absolute name\n     * $state.is('contact.details.item'); // returns true\n     * $state.is(contactDetailItemStateObject); // returns true\n     *\n     * // relative name (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like\n     * to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object} -  If `stateOrName` is a relative state name and `options.relative` is set, .is will\n     * test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it is the state.\n     */\n    $state.is = function is(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) { return undefined; }\n      if ($state.$current !== state) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#includes\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method to determine if the current active state is equal to or is the child of the\n     * state stateName. If any params are passed then they will be tested for a match as well.\n     * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n     *\n     * @example\n     * Partial and relative names\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // Using partial names\n     * $state.includes(\"contacts\"); // returns true\n     * $state.includes(\"contacts.details\"); // returns true\n     * $state.includes(\"contacts.details.item\"); // returns true\n     * $state.includes(\"contacts.list\"); // returns false\n     * $state.includes(\"about\"); // returns false\n     *\n     * // Using relative names (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.includes('.item')}\">Item</div>\n     * </pre>\n     *\n     * Basic globbing patterns\n     * <pre>\n     * $state.$current.name = 'contacts.details.item.url';\n     *\n     * $state.includes(\"*.details.*.*\"); // returns true\n     * $state.includes(\"*.details.**\"); // returns true\n     * $state.includes(\"**.item.**\"); // returns true\n     * $state.includes(\"*.details.item.url\"); // returns true\n     * $state.includes(\"*.details.*.url\"); // returns true\n     * $state.includes(\"*.details.*\"); // returns false\n     * $state.includes(\"item.**\"); // returns false\n     * </pre>\n     *\n     * @param {string} stateOrName A partial name, relative name, or glob pattern\n     * to be searched for within the current state name.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`,\n     * that you'd like to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object=} -  If `stateOrName` is a relative state reference and `options.relative` is set,\n     * .includes will test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it does include the state\n     */\n    $state.includes = function includes(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      if (isString(stateOrName) && isGlob(stateOrName)) {\n        if (!doesStateMatchGlob(stateOrName)) {\n          return false;\n        }\n        stateOrName = $state.$current.name;\n      }\n\n      var state = findState(stateOrName, options.relative);\n      if (!isDefined(state)) { return undefined; }\n      if (!isDefined($state.$current.includes[state.name])) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;\n    };\n\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#href\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A url generation method that returns the compiled url for the given state populated with the given params.\n     *\n     * @example\n     * <pre>\n     * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.\n     * @param {object=} params An object of parameter values to fill the state's required parameters.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the\n     *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka\n     *    ancestor with a valid url).\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n     * \n     * @returns {string} compiled state url\n     */\n    $state.href = function href(stateOrName, params, options) {\n      options = extend({\n        lossy:    true,\n        inherit:  true,\n        absolute: false,\n        relative: $state.$current\n      }, options || {});\n\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) return null;\n      if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);\n      \n      var nav = (state && options.lossy) ? state.navigable : state;\n\n      if (!nav || nav.url === undefined || nav.url === null) {\n        return null;\n      }\n      return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys(), params || {}), {\n        absolute: options.absolute\n      });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#get\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Returns the state configuration object for any specific state or all states.\n     *\n     * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for\n     * the requested state. If not provided, returns an array of ALL state configs.\n     * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.\n     * @returns {Object|Array} State configuration object or array of all objects.\n     */\n    $state.get = function (stateOrName, context) {\n      if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });\n      var state = findState(stateOrName, context || $state.$current);\n      return (state && state.self) ? state.self : null;\n    };\n\n    function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {\n      // Make a restricted $stateParams with only the parameters that apply to this state if\n      // necessary. In addition to being available to the controller and onEnter/onExit callbacks,\n      // we also need $stateParams to be available for any $injector calls we make during the\n      // dependency resolution process.\n      var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);\n      var locals = { $stateParams: $stateParams };\n\n      // Resolve 'global' dependencies for the state, i.e. those not specific to a view.\n      // We're also including $stateParams in this; that way the parameters are restricted\n      // to the set that should be visible to the state, and are independent of when we update\n      // the global $state and $stateParams values.\n      dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);\n      var promises = [dst.resolve.then(function (globals) {\n        dst.globals = globals;\n      })];\n      if (inherited) promises.push(inherited);\n\n      // Resolve template and dependencies for all views.\n      forEach(state.views, function (view, name) {\n        var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});\n        injectables.$template = [ function () {\n          return $view.load(name, { view: view, locals: locals, params: $stateParams, notify: options.notify }) || '';\n        }];\n\n        promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {\n          // References to the controller (only instantiated at link time)\n          if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {\n            var injectLocals = angular.extend({}, injectables, locals);\n            result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);\n          } else {\n            result.$$controller = view.controller;\n          }\n          // Provide access to the state itself for internal use\n          result.$$state = state;\n          result.$$controllerAs = view.controllerAs;\n          dst[name] = result;\n        }));\n      });\n\n      // Wait for all the promises and then return the activation object\n      return $q.all(promises).then(function (values) {\n        return dst;\n      });\n    }\n\n    return $state;\n  }\n\n  function shouldTriggerReload(to, from, locals, options) {\n    if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {\n      return true;\n    }\n  }\n}\n\nangular.module('ui.router.state')\n  .value('$stateParams', {})\n  .provider('$state', $StateProvider);\n\n\n$ViewProvider.$inject = [];\nfunction $ViewProvider() {\n\n  this.$get = $get;\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$view\n   *\n   * @requires ui.router.util.$templateFactory\n   * @requires $rootScope\n   *\n   * @description\n   *\n   */\n  $get.$inject = ['$rootScope', '$templateFactory'];\n  function $get(   $rootScope,   $templateFactory) {\n    return {\n      // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })\n      /**\n       * @ngdoc function\n       * @name ui.router.state.$view#load\n       * @methodOf ui.router.state.$view\n       *\n       * @description\n       *\n       * @param {string} name name\n       * @param {object} options option object.\n       */\n      load: function load(name, options) {\n        var result, defaults = {\n          template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}\n        };\n        options = extend(defaults, options);\n\n        if (options.view) {\n          result = $templateFactory.fromConfig(options.view, options.params, options.locals);\n        }\n        if (result && options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$viewContentLoading\n         * @eventOf ui.router.state.$view\n         * @eventType broadcast on root scope\n         * @description\n         *\n         * Fired once the view **begins loading**, *before* the DOM is rendered.\n         *\n         * @param {Object} event Event object.\n         * @param {Object} viewConfig The view config properties (template, controller, etc).\n         *\n         * @example\n         *\n         * <pre>\n         * $scope.$on('$viewContentLoading',\n         * function(event, viewConfig){\n         *     // Access to all the view config properties.\n         *     // and one special property 'targetView'\n         *     // viewConfig.targetView\n         * });\n         * </pre>\n         */\n          $rootScope.$broadcast('$viewContentLoading', options);\n        }\n        return result;\n      }\n    };\n  }\n}\n\nangular.module('ui.router.state').provider('$view', $ViewProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.\n */\nfunction $ViewScrollProvider() {\n\n  var useAnchorScroll = false;\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll\n   * @methodOf ui.router.state.$uiViewScrollProvider\n   *\n   * @description\n   * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for\n   * scrolling based on the url anchor.\n   */\n  this.useAnchorScroll = function () {\n    useAnchorScroll = true;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$uiViewScroll\n   *\n   * @requires $anchorScroll\n   * @requires $timeout\n   *\n   * @description\n   * When called with a jqLite element, it scrolls the element into view (after a\n   * `$timeout` so the DOM has time to refresh).\n   *\n   * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n   * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.\n   */\n  this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n    if (useAnchorScroll) {\n      return $anchorScroll;\n    }\n\n    return function ($element) {\n      $timeout(function () {\n        $element[0].scrollIntoView();\n      }, 0, false);\n    };\n  }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-view\n *\n * @requires ui.router.state.$state\n * @requires $compile\n * @requires $controller\n * @requires $injector\n * @requires ui.router.state.$uiViewScroll\n * @requires $document\n *\n * @restrict ECA\n *\n * @description\n * The ui-view directive tells $state where to place your templates.\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states.\n *\n * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window\n * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll\n * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you\n * scroll ui-view elements into view when they are populated during a state activation.\n *\n * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*\n *\n * @param {string=} onload Expression to evaluate whenever the view updates.\n * \n * @example\n * A view can be unnamed or named. \n * <pre>\n * <!-- Unnamed -->\n * <div ui-view></div> \n * \n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n * </pre>\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a \n * single view and it is unnamed then you can populate it like so:\n * <pre>\n * <div ui-view></div> \n * $stateProvider.state(\"home\", {\n *   template: \"<h1>HELLO!</h1>\"\n * })\n * </pre>\n * \n * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}\n * config property, by name, in this case an empty name:\n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * But typically you'll only use the views property if you name your view or have more than one view \n * in the same template. There's not really a compelling reason to name a view if its the only one, \n * but you could if you wanted, like so:\n * <pre>\n * <div ui-view=\"main\"></div>\n * </pre> \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"main\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * Really though, you'll use views to set up multiple views:\n * <pre>\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div> \n * <div ui-view=\"data\"></div> \n * </pre>\n * \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     },\n *     \"chart\": {\n *       template: \"<chart_thing/>\"\n *     },\n *     \"data\": {\n *       template: \"<data_thing/>\"\n *     }\n *   }    \n * })\n * </pre>\n *\n * Examples for `autoscroll`:\n *\n * <pre>\n * <!-- If autoscroll present with no expression,\n *      then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n *      then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * </pre>\n */\n$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];\nfunction $ViewDirective(   $state,   $injector,   $uiViewScroll,   $interpolate) {\n\n  function getService() {\n    return ($injector.has) ? function(service) {\n      return $injector.has(service) ? $injector.get(service) : null;\n    } : function(service) {\n      try {\n        return $injector.get(service);\n      } catch (e) {\n        return null;\n      }\n    };\n  }\n\n  var service = getService(),\n      $animator = service('$animator'),\n      $animate = service('$animate');\n\n  // Returns a set of DOM manipulation functions based on which Angular version\n  // it should use\n  function getRenderer(attrs, scope) {\n    var statics = function() {\n      return {\n        enter: function (element, target, cb) { target.after(element); cb(); },\n        leave: function (element, cb) { element.remove(); cb(); }\n      };\n    };\n\n    if ($animate) {\n      return {\n        enter: function(element, target, cb) {\n          var promise = $animate.enter(element, null, target, cb);\n          if (promise && promise.then) promise.then(cb);\n        },\n        leave: function(element, cb) {\n          var promise = $animate.leave(element, cb);\n          if (promise && promise.then) promise.then(cb);\n        }\n      };\n    }\n\n    if ($animator) {\n      var animate = $animator && $animator(scope, attrs);\n\n      return {\n        enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n        leave: function(element, cb) { animate.leave(element); cb(); }\n      };\n    }\n\n    return statics();\n  }\n\n  var directive = {\n    restrict: 'ECA',\n    terminal: true,\n    priority: 400,\n    transclude: 'element',\n    compile: function (tElement, tAttrs, $transclude) {\n      return function (scope, $element, attrs) {\n        var previousEl, currentEl, currentScope, latestLocals,\n            onloadExp     = attrs.onload || '',\n            autoScrollExp = attrs.autoscroll,\n            renderer      = getRenderer(attrs, scope);\n\n        scope.$on('$stateChangeSuccess', function() {\n          updateView(false);\n        });\n        scope.$on('$viewContentLoading', function() {\n          updateView(false);\n        });\n\n        updateView(true);\n\n        function cleanupLastView() {\n          if (previousEl) {\n            previousEl.remove();\n            previousEl = null;\n          }\n\n          if (currentScope) {\n            currentScope.$destroy();\n            currentScope = null;\n          }\n\n          if (currentEl) {\n            renderer.leave(currentEl, function() {\n              previousEl = null;\n            });\n\n            previousEl = currentEl;\n            currentEl = null;\n          }\n        }\n\n        function updateView(firstTime) {\n          var newScope,\n              name            = getUiViewName(scope, attrs, $element, $interpolate),\n              previousLocals  = name && $state.$current && $state.$current.locals[name];\n\n          if (!firstTime && previousLocals === latestLocals) return; // nothing to do\n          newScope = scope.$new();\n          latestLocals = $state.$current.locals[name];\n\n          var clone = $transclude(newScope, function(clone) {\n            renderer.enter(clone, $element, function onUiViewEnter() {\n              if(currentScope) {\n                currentScope.$emit('$viewContentAnimationEnded');\n              }\n\n              if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n                $uiViewScroll(clone);\n              }\n            });\n            cleanupLastView();\n          });\n\n          currentEl = clone;\n          currentScope = newScope;\n          /**\n           * @ngdoc event\n           * @name ui.router.state.directive:ui-view#$viewContentLoaded\n           * @eventOf ui.router.state.directive:ui-view\n           * @eventType emits on ui-view directive scope\n           * @description           *\n           * Fired once the view is **loaded**, *after* the DOM is rendered.\n           *\n           * @param {Object} event Event object.\n           */\n          currentScope.$emit('$viewContentLoaded');\n          currentScope.$eval(onloadExp);\n        }\n      };\n    }\n  };\n\n  return directive;\n}\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\nfunction $ViewDirectiveFill (  $compile,   $controller,   $state,   $interpolate) {\n  return {\n    restrict: 'ECA',\n    priority: -400,\n    compile: function (tElement) {\n      var initial = tElement.html();\n      return function (scope, $element, attrs) {\n        var current = $state.$current,\n            name = getUiViewName(scope, attrs, $element, $interpolate),\n            locals  = current && current.locals[name];\n\n        if (! locals) {\n          return;\n        }\n\n        $element.data('$uiView', { name: name, state: locals.$$state });\n        $element.html(locals.$template ? locals.$template : initial);\n\n        var link = $compile($element.contents());\n\n        if (locals.$$controller) {\n          locals.$scope = scope;\n          var controller = $controller(locals.$$controller, locals);\n          if (locals.$$controllerAs) {\n            scope[locals.$$controllerAs] = controller;\n          }\n          $element.data('$ngControllerController', controller);\n          $element.children().data('$ngControllerController', controller);\n        }\n\n        link(scope);\n      };\n    }\n  };\n}\n\n/**\n * Shared ui-view code for both directives:\n * Given scope, element, and its attributes, return the view's name\n */\nfunction getUiViewName(scope, attrs, element, $interpolate) {\n  var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n  var inherited = element.inheritedData('$uiView');\n  return name.indexOf('@') >= 0 ?  name :  (name + '@' + (inherited ? inherited.state.name : ''));\n}\n\nangular.module('ui.router.state').directive('uiView', $ViewDirective);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\nfunction parseStateRef(ref, current) {\n  var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n  if (preparsed) ref = current + '(' + preparsed[1] + ')';\n  parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n  if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n  return { state: parsed[1], paramExpr: parsed[3] || null };\n}\n\nfunction stateContext(el) {\n  var stateData = el.parent().inheritedData('$uiView');\n\n  if (stateData && stateData.state && stateData.state.name) {\n    return stateData.state;\n  }\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref\n *\n * @requires ui.router.state.$state\n * @requires $timeout\n *\n * @restrict A\n *\n * @description\n * A directive that binds a link (`<a>` tag) to a state. If the state has an associated \n * URL, the directive will automatically generate & update the `href` attribute via \n * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking \n * the link will trigger a state transition with optional parameters. \n *\n * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be \n * handled natively by the browser.\n *\n * You can also use relative state paths within ui-sref, just like the relative \n * paths passed to `$state.go()`. You just need to be aware that the path is relative\n * to the state that the link lives in, in other words the state that loaded the \n * template containing the link.\n *\n * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}\n * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n * and `reload`.\n *\n * @example\n * Here's an example of how you'd use ui-sref and how it would compile. If you have the \n * following template:\n * <pre>\n * <a ui-sref=\"home\">Home</a> | <a ui-sref=\"about\">About</a> | <a ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n *     </li>\n * </ul>\n * </pre>\n * \n * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n * <pre>\n * <a href=\"#/home\" ui-sref=\"home\">Home</a> | <a href=\"#/about\" ui-sref=\"about\">About</a> | <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n *     </li>\n * </ul>\n *\n * <a ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * </pre>\n *\n * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDirective($state, $timeout) {\n  var allowedOptions = ['location', 'inherit', 'reload'];\n\n  return {\n    restrict: 'A',\n    require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n    link: function(scope, element, attrs, uiSrefActive) {\n      var ref = parseStateRef(attrs.uiSref, $state.current.name);\n      var params = null, url = null, base = stateContext(element) || $state.$current;\n      var newHref = null, isAnchor = element.prop(\"tagName\") === \"A\";\n      var isForm = element[0].nodeName === \"FORM\";\n      var attr = isForm ? \"action\" : \"href\", nav = true;\n\n      var options = { relative: base, inherit: true };\n      var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};\n\n      angular.forEach(allowedOptions, function(option) {\n        if (option in optionsOverride) {\n          options[option] = optionsOverride[option];\n        }\n      });\n\n      var update = function(newVal) {\n        if (newVal) params = angular.copy(newVal);\n        if (!nav) return;\n\n        newHref = $state.href(ref.state, params, options);\n\n        var activeDirective = uiSrefActive[1] || uiSrefActive[0];\n        if (activeDirective) {\n          activeDirective.$$setStateInfo(ref.state, params);\n        }\n        if (newHref === null) {\n          nav = false;\n          return false;\n        }\n        attrs.$set(attr, newHref);\n      };\n\n      if (ref.paramExpr) {\n        scope.$watch(ref.paramExpr, function(newVal, oldVal) {\n          if (newVal !== params) update(newVal);\n        }, true);\n        params = angular.copy(scope.$eval(ref.paramExpr));\n      }\n      update();\n\n      if (isForm) return;\n\n      element.bind(\"click\", function(e) {\n        var button = e.which || e.button;\n        if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {\n          // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n          var transition = $timeout(function() {\n            $state.go(ref.state, params, options);\n          });\n          e.preventDefault();\n\n          // if the state has no URL, ignore one preventDefault from the <a> directive.\n          var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;\n          e.preventDefault = function() {\n            if (ignorePreventDefaultCount-- <= 0)\n              $timeout.cancel(transition);\n          };\n        }\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * A directive working alongside ui-sref to add classes to an element when the\n * related ui-sref directive's state is active, and removing them when it is inactive.\n * The primary use-case is to simplify the special appearance of navigation menus\n * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n * distinguishing it from the inactive menu items.\n *\n * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n * ui-sref-active found at the same level or above the ui-sref will be used.\n *\n * Will activate when the ui-sref's target state or any child state is active. If you\n * need to activate only when the ui-sref target state is active and *not* any of\n * it's children, then you will use\n * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n *\n * @example\n * Given the following template:\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item\">\n *     <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n *\n * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item active\">\n *     <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n * The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * Multiple classes may be specified in a space-separated format:\n * <pre>\n * <ul>\n *   <li ui-sref-active='class1 class2 class3'>\n *     <a ui-sref=\"app.user\">link</a>\n *   </li>\n * </ul>\n * </pre>\n */\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active-eq\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n * when the exact target state used in the `ui-sref` is active; no child states.\n *\n */\n$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\nfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n  return  {\n    restrict: \"A\",\n    controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\n      var state, params, activeClass;\n\n      // There probably isn't much point in $observing this\n      // uiSrefActive and uiSrefActiveEq share the same directive object with some\n      // slight difference in logic routing\n      activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);\n\n      // Allow uiSref to communicate with uiSrefActive[Equals]\n      this.$$setStateInfo = function (newState, newParams) {\n        state = $state.get(newState, stateContext($element));\n        params = newParams;\n        update();\n      };\n\n      $scope.$on('$stateChangeSuccess', update);\n\n      // Update route state\n      function update() {\n        if (isMatch()) {\n          $element.addClass(activeClass);\n        } else {\n          $element.removeClass(activeClass);\n        }\n      }\n\n      function isMatch() {\n        if (typeof $attrs.uiSrefActiveEq !== 'undefined') {\n          return state && $state.is(state.name, params);\n        } else {\n          return state && $state.includes(state.name, params);\n        }\n      }\n    }]\n  };\n}\n\nangular.module('ui.router.state')\n  .directive('uiSref', $StateRefDirective)\n  .directive('uiSrefActive', $StateRefActiveDirective)\n  .directive('uiSrefActiveEq', $StateRefActiveDirective);\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:isState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n  var isFilter = function (state) {\n    return $state.is(state);\n  };\n  isFilter.$stateful = true;\n  return isFilter;\n}\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:includedByState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n  var includesFilter = function (state) {\n    return $state.includes(state);\n  };\n  includesFilter.$stateful = true;\n  return  includesFilter;\n}\n\nangular.module('ui.router.state')\n  .filter('isState', $IsStateFilter)\n  .filter('includedByState', $IncludedByStateFilter);\n})(window, window.angular);"
  },
  {
    "path": "www/lib/angular-ui-router/src/common.js",
    "content": "/*jshint globalstrict:true*/\n/*global angular:false*/\n'use strict';\n\nvar isDefined = angular.isDefined,\n    isFunction = angular.isFunction,\n    isString = angular.isString,\n    isObject = angular.isObject,\n    isArray = angular.isArray,\n    forEach = angular.forEach,\n    extend = angular.extend,\n    copy = angular.copy;\n\nfunction inherit(parent, extra) {\n  return extend(new (extend(function() {}, { prototype: parent }))(), extra);\n}\n\nfunction merge(dst) {\n  forEach(arguments, function(obj) {\n    if (obj !== dst) {\n      forEach(obj, function(value, key) {\n        if (!dst.hasOwnProperty(key)) dst[key] = value;\n      });\n    }\n  });\n  return dst;\n}\n\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n  var path = [];\n\n  for (var n in first.path) {\n    if (first.path[n] !== second.path[n]) break;\n    path.push(first.path[n]);\n  }\n  return path;\n}\n\n/**\n * IE8-safe wrapper for `Object.keys()`.\n *\n * @param {Object} object A JavaScript object.\n * @return {Array} Returns the keys of the object as an array.\n */\nfunction objectKeys(object) {\n  if (Object.keys) {\n    return Object.keys(object);\n  }\n  var result = [];\n\n  angular.forEach(object, function(val, key) {\n    result.push(key);\n  });\n  return result;\n}\n\n/**\n * IE8-safe wrapper for `Array.prototype.indexOf()`.\n *\n * @param {Array} array A JavaScript array.\n * @param {*} value A value to search the array for.\n * @return {Number} Returns the array index value of `value`, or `-1` if not present.\n */\nfunction indexOf(array, value) {\n  if (Array.prototype.indexOf) {\n    return array.indexOf(value, Number(arguments[2]) || 0);\n  }\n  var len = array.length >>> 0, from = Number(arguments[2]) || 0;\n  from = (from < 0) ? Math.ceil(from) : Math.floor(from);\n\n  if (from < 0) from += len;\n\n  for (; from < len; from++) {\n    if (from in array && array[from] === value) return from;\n  }\n  return -1;\n}\n\n/**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} currentParams The value of the current state parameters ($stateParams).\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\nfunction inheritParams(currentParams, newParams, $current, $to) {\n  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];\n\n  for (var i in parents) {\n    if (!parents[i].params) continue;\n    parentParams = objectKeys(parents[i].params);\n    if (!parentParams.length) continue;\n\n    for (var j in parentParams) {\n      if (indexOf(inheritList, parentParams[j]) >= 0) continue;\n      inheritList.push(parentParams[j]);\n      inherited[parentParams[j]] = currentParams[parentParams[j]];\n    }\n  }\n  return extend({}, inherited, newParams);\n}\n\n/**\n * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.\n *\n * @param {Object} a The first object.\n * @param {Object} b The second object.\n * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,\n *                     it defaults to the list of keys in `a`.\n * @return {Boolean} Returns `true` if the keys match, otherwise `false`.\n */\nfunction equalForKeys(a, b, keys) {\n  if (!keys) {\n    keys = [];\n    for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n  }\n\n  for (var i=0; i<keys.length; i++) {\n    var k = keys[i];\n    if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n  }\n  return true;\n}\n\n/**\n * Returns the subset of an object, based on a list of keys.\n *\n * @param {Array} keys\n * @param {Object} values\n * @return {Boolean} Returns a subset of `values`.\n */\nfunction filterByKeys(keys, values) {\n  var filtered = {};\n\n  forEach(keys, function (name) {\n    filtered[name] = values[name];\n  });\n  return filtered;\n}\n\n// like _.indexBy\n// when you know that your index values will be unique, or you want last-one-in to win\nfunction indexBy(array, propName) {\n  var result = {};\n  forEach(array, function(item) {\n    result[item[propName]] = item;\n  });\n  return result;\n}\n\n// extracted from underscore.js\n// Return a copy of the object only containing the whitelisted properties.\nfunction pick(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  forEach(keys, function(key) {\n    if (key in obj) copy[key] = obj[key];\n  });\n  return copy;\n}\n\n// extracted from underscore.js\n// Return a copy of the object omitting the blacklisted properties.\nfunction omit(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  for (var key in obj) {\n    if (indexOf(keys, key) == -1) copy[key] = obj[key];\n  }\n  return copy;\n}\n\nfunction pluck(collection, key) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = isFunction(key) ? key(val) : val[key];\n  });\n  return result;\n}\n\nfunction filter(collection, callback) {\n  var array = isArray(collection);\n  var result = array ? [] : {};\n  forEach(collection, function(val, i) {\n    if (callback(val, i)) {\n      result[array ? result.length : i] = val;\n    }\n  });\n  return result;\n}\n\nfunction map(collection, callback) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = callback(val, i);\n  });\n  return result;\n}\n\n/**\n * @ngdoc overview\n * @name ui.router.util\n *\n * @description\n * # ui.router.util sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n *\n */\nangular.module('ui.router.util', ['ng']);\n\n/**\n * @ngdoc overview\n * @name ui.router.router\n * \n * @requires ui.router.util\n *\n * @description\n * # ui.router.router sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n */\nangular.module('ui.router.router', ['ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router.state\n * \n * @requires ui.router.router\n * @requires ui.router.util\n *\n * @description\n * # ui.router.state sub-module\n *\n * This module is a dependency of the main ui.router module. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n * \n */\nangular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router\n *\n * @requires ui.router.state\n *\n * @description\n * # ui.router\n * \n * ## The main module for ui.router \n * There are several sub-modules included with the ui.router module, however only this module is needed\n * as a dependency within your angular app. The other modules are for organization purposes. \n *\n * The modules are:\n * * ui.router - the main \"umbrella\" module\n * * ui.router.router - \n * \n * *You'll need to include **only** this module as the dependency within your angular app.*\n * \n * <pre>\n * <!doctype html>\n * <html ng-app=\"myApp\">\n * <head>\n *   <script src=\"js/angular.js\"></script>\n *   <!-- Include the ui-router script -->\n *   <script src=\"js/angular-ui-router.min.js\"></script>\n *   <script>\n *     // ...and add 'ui.router' as a dependency\n *     var myApp = angular.module('myApp', ['ui.router']);\n *   </script>\n * </head>\n * <body>\n * </body>\n * </html>\n * </pre>\n */\nangular.module('ui.router', ['ui.router.state']);\n\nangular.module('ui.router.compat', ['ui.router']);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/resolve.js",
    "content": "/**\n * @ngdoc object\n * @name ui.router.util.$resolve\n *\n * @requires $q\n * @requires $injector\n *\n * @description\n * Manages resolution of (acyclic) graphs of promises.\n */\n$Resolve.$inject = ['$q', '$injector'];\nfunction $Resolve(  $q,    $injector) {\n  \n  var VISIT_IN_PROGRESS = 1,\n      VISIT_DONE = 2,\n      NOTHING = {},\n      NO_DEPENDENCIES = [],\n      NO_LOCALS = NOTHING,\n      NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n  \n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#study\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Studies a set of invocables that are likely to be used multiple times.\n   * <pre>\n   * $resolve.study(invocables)(locals, parent, self)\n   * </pre>\n   * is equivalent to\n   * <pre>\n   * $resolve.resolve(invocables, locals, parent, self)\n   * </pre>\n   * but the former is more efficient (in fact `resolve` just calls `study` \n   * internally).\n   *\n   * @param {object} invocables Invocable objects\n   * @return {function} a function to pass in locals, parent and self\n   */\n  this.study = function (invocables) {\n    if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n    var invocableKeys = objectKeys(invocables || {});\n    \n    // Perform a topological sort of invocables to build an ordered plan\n    var plan = [], cycle = [], visited = {};\n    function visit(value, key) {\n      if (visited[key] === VISIT_DONE) return;\n      \n      cycle.push(key);\n      if (visited[key] === VISIT_IN_PROGRESS) {\n        cycle.splice(0, indexOf(cycle, key));\n        throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n      }\n      visited[key] = VISIT_IN_PROGRESS;\n      \n      if (isString(value)) {\n        plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n      } else {\n        var params = $injector.annotate(value);\n        forEach(params, function (param) {\n          if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n        });\n        plan.push(key, value, params);\n      }\n      \n      cycle.pop();\n      visited[key] = VISIT_DONE;\n    }\n    forEach(invocables, visit);\n    invocables = cycle = visited = null; // plan is all that's required\n    \n    function isResolve(value) {\n      return isObject(value) && value.then && value.$$promises;\n    }\n    \n    return function (locals, parent, self) {\n      if (isResolve(locals) && self === undefined) {\n        self = parent; parent = locals; locals = null;\n      }\n      if (!locals) locals = NO_LOCALS;\n      else if (!isObject(locals)) {\n        throw new Error(\"'locals' must be an object\");\n      }       \n      if (!parent) parent = NO_PARENT;\n      else if (!isResolve(parent)) {\n        throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n      }\n      \n      // To complete the overall resolution, we have to wait for the parent\n      // promise and for the promise for each invokable in our plan.\n      var resolution = $q.defer(),\n          result = resolution.promise,\n          promises = result.$$promises = {},\n          values = extend({}, locals),\n          wait = 1 + plan.length/3,\n          merged = false;\n          \n      function done() {\n        // Merge parent values we haven't got yet and publish our own $$values\n        if (!--wait) {\n          if (!merged) merge(values, parent.$$values); \n          result.$$values = values;\n          result.$$promises = result.$$promises || true; // keep for isResolve()\n          delete result.$$inheritedValues;\n          resolution.resolve(values);\n        }\n      }\n      \n      function fail(reason) {\n        result.$$failure = reason;\n        resolution.reject(reason);\n      }\n\n      // Short-circuit if parent has already failed\n      if (isDefined(parent.$$failure)) {\n        fail(parent.$$failure);\n        return result;\n      }\n      \n      if (parent.$$inheritedValues) {\n        merge(values, omit(parent.$$inheritedValues, invocableKeys));\n      }\n\n      // Merge parent values if the parent has already resolved, or merge\n      // parent promises and wait if the parent resolve is still in progress.\n      extend(promises, parent.$$promises);\n      if (parent.$$values) {\n        merged = merge(values, omit(parent.$$values, invocableKeys));\n        result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n        done();\n      } else {\n        if (parent.$$inheritedValues) {\n          result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n        }        \n        parent.then(done, fail);\n      }\n      \n      // Process each invocable in the plan, but ignore any where a local of the same name exists.\n      for (var i=0, ii=plan.length; i<ii; i+=3) {\n        if (locals.hasOwnProperty(plan[i])) done();\n        else invoke(plan[i], plan[i+1], plan[i+2]);\n      }\n      \n      function invoke(key, invocable, params) {\n        // Create a deferred for this invocation. Failures will propagate to the resolution as well.\n        var invocation = $q.defer(), waitParams = 0;\n        function onfailure(reason) {\n          invocation.reject(reason);\n          fail(reason);\n        }\n        // Wait for any parameter that we have a promise for (either from parent or from this\n        // resolve; in that case study() will have made sure it's ordered before us in the plan).\n        forEach(params, function (dep) {\n          if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {\n            waitParams++;\n            promises[dep].then(function (result) {\n              values[dep] = result;\n              if (!(--waitParams)) proceed();\n            }, onfailure);\n          }\n        });\n        if (!waitParams) proceed();\n        function proceed() {\n          if (isDefined(result.$$failure)) return;\n          try {\n            invocation.resolve($injector.invoke(invocable, self, values));\n            invocation.promise.then(function (result) {\n              values[key] = result;\n              done();\n            }, onfailure);\n          } catch (e) {\n            onfailure(e);\n          }\n        }\n        // Publish promise synchronously; invocations further down in the plan may depend on it.\n        promises[key] = invocation.promise;\n      }\n      \n      return result;\n    };\n  };\n  \n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#resolve\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Resolves a set of invocables. An invocable is a function to be invoked via \n   * `$injector.invoke()`, and can have an arbitrary number of dependencies. \n   * An invocable can either return a value directly,\n   * or a `$q` promise. If a promise is returned it will be resolved and the \n   * resulting value will be used instead. Dependencies of invocables are resolved \n   * (in this order of precedence)\n   *\n   * - from the specified `locals`\n   * - from another invocable that is part of this `$resolve` call\n   * - from an invocable that is inherited from a `parent` call to `$resolve` \n   *   (or recursively\n   * - from any ancestor `$resolve` of that parent).\n   *\n   * The return value of `$resolve` is a promise for an object that contains \n   * (in this order of precedence)\n   *\n   * - any `locals` (if specified)\n   * - the resolved return values of all injectables\n   * - any values inherited from a `parent` call to `$resolve` (if specified)\n   *\n   * The promise will resolve after the `parent` promise (if any) and all promises \n   * returned by injectables have been resolved. If any invocable \n   * (or `$injector.invoke`) throws an exception, or if a promise returned by an \n   * invocable is rejected, the `$resolve` promise is immediately rejected with the \n   * same error. A rejection of a `parent` promise (if specified) will likewise be \n   * propagated immediately. Once the `$resolve` promise has been rejected, no \n   * further invocables will be called.\n   * \n   * Cyclic dependencies between invocables are not permitted and will caues `$resolve`\n   * to throw an error. As a special case, an injectable can depend on a parameter \n   * with the same name as the injectable, which will be fulfilled from the `parent` \n   * injectable of the same name. This allows inherited values to be decorated. \n   * Note that in this case any other injectable in the same `$resolve` with the same\n   * dependency would see the decorated value, not the inherited value.\n   *\n   * Note that missing dependencies -- unlike cyclic dependencies -- will cause an \n   * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) \n   * exception.\n   *\n   * Invocables are invoked eagerly as soon as all dependencies are available. \n   * This is true even for dependencies inherited from a `parent` call to `$resolve`.\n   *\n   * As a special case, an invocable can be a string, in which case it is taken to \n   * be a service name to be passed to `$injector.get()`. This is supported primarily \n   * for backwards-compatibility with the `resolve` property of `$routeProvider` \n   * routes.\n   *\n   * @param {object} invocables functions to invoke or \n   * `$injector` services to fetch.\n   * @param {object} locals  values to make available to the injectables\n   * @param {object} parent  a promise returned by another call to `$resolve`.\n   * @param {object} self  the `this` for the invoked methods\n   * @return {object} Promise for an object that contains the resolved return value\n   * of all invocables, as well as any inherited and local values.\n   */\n  this.resolve = function (invocables, locals, parent, self) {\n    return this.study(invocables)(locals, parent, self);\n  };\n}\n\nangular.module('ui.router.util').service('$resolve', $Resolve);\n\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/state.js",
    "content": "/**\n * @ngdoc object\n * @name ui.router.state.$stateProvider\n *\n * @requires ui.router.router.$urlRouterProvider\n * @requires ui.router.util.$urlMatcherFactoryProvider\n *\n * @description\n * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\n$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\nfunction $StateProvider(   $urlRouterProvider,   $urlMatcherFactory) {\n\n  var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\n  // Builds state properties from definition passed to registerState()\n  var stateBuilder = {\n\n    // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n    // state.children = [];\n    // if (parent) parent.children.push(state);\n    parent: function(state) {\n      if (isDefined(state.parent) && state.parent) return findState(state.parent);\n      // regex matches any valid composite state name\n      // would match \"contact.list\" but not \"contacts\"\n      var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n      return compositeName ? findState(compositeName[1]) : root;\n    },\n\n    // inherit 'data' from parent and override by own values (if any)\n    data: function(state) {\n      if (state.parent && state.parent.data) {\n        state.data = state.self.data = extend({}, state.parent.data, state.data);\n      }\n      return state.data;\n    },\n\n    // Build a URLMatcher if necessary, either via a relative or absolute URL\n    url: function(state) {\n      var url = state.url, config = { params: state.params || {} };\n\n      if (isString(url)) {\n        if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n        return (state.parent.navigable || root).url.concat(url, config);\n      }\n\n      if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n      throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n    },\n\n    // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n    navigable: function(state) {\n      return state.url ? state : (state.parent ? state.parent.navigable : null);\n    },\n\n    // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n    ownParams: function(state) {\n      var params = state.url && state.url.params || new $$UMFP.ParamSet();\n      forEach(state.params || {}, function(config, id) {\n        if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n      });\n      return params;\n    },\n\n    // Derive parameters for this state and ensure they're a super-set of parent's parameters\n    params: function(state) {\n      return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();\n    },\n\n    // If there is no explicit multi-view configuration, make one up so we don't have\n    // to handle both cases in the view directive later. Note that having an explicit\n    // 'views' property will mean the default unnamed view properties are ignored. This\n    // is also a good time to resolve view names to absolute names, so everything is a\n    // straight lookup at link time.\n    views: function(state) {\n      var views = {};\n\n      forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n        if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n        views[name] = view;\n      });\n      return views;\n    },\n\n    // Keep a full path from the root down to this state as this is needed for state activation.\n    path: function(state) {\n      return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n    },\n\n    // Speed up $state.contains() as it's used a lot\n    includes: function(state) {\n      var includes = state.parent ? extend({}, state.parent.includes) : {};\n      includes[state.name] = true;\n      return includes;\n    },\n\n    $delegates: {}\n  };\n\n  function isRelative(stateName) {\n    return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n  }\n\n  function findState(stateOrName, base) {\n    if (!stateOrName) return undefined;\n\n    var isStr = isString(stateOrName),\n        name  = isStr ? stateOrName : stateOrName.name,\n        path  = isRelative(name);\n\n    if (path) {\n      if (!base) throw new Error(\"No reference point given for path '\"  + name + \"'\");\n      base = findState(base);\n      \n      var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\n      for (; i < pathLength; i++) {\n        if (rel[i] === \"\" && i === 0) {\n          current = base;\n          continue;\n        }\n        if (rel[i] === \"^\") {\n          if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n          current = current.parent;\n          continue;\n        }\n        break;\n      }\n      rel = rel.slice(i).join(\".\");\n      name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n    }\n    var state = states[name];\n\n    if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n      return state;\n    }\n    return undefined;\n  }\n\n  function queueState(parentName, state) {\n    if (!queue[parentName]) {\n      queue[parentName] = [];\n    }\n    queue[parentName].push(state);\n  }\n\n  function flushQueuedChildren(parentName) {\n    var queued = queue[parentName] || [];\n    while(queued.length) {\n      registerState(queued.shift());\n    }\n  }\n\n  function registerState(state) {\n    // Wrap a new object around the state so we can store our private details easily.\n    state = inherit(state, {\n      self: state,\n      resolve: state.resolve || {},\n      toString: function() { return this.name; }\n    });\n\n    var name = state.name;\n    if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n    if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"'' is already defined\");\n\n    // Get parent name\n    var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n        : (isString(state.parent)) ? state.parent\n        : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n        : '';\n\n    // If parent is not registered yet, add state to queue and register later\n    if (parentName && !states[parentName]) {\n      return queueState(parentName, state.self);\n    }\n\n    for (var key in stateBuilder) {\n      if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n    }\n    states[name] = state;\n\n    // Register the state in the global state list and with $urlRouter if necessary.\n    if (!state[abstractKey] && state.url) {\n      $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n        if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n          $state.transitionTo(state, $match, { inherit: true, location: false });\n        }\n      }]);\n    }\n\n    // Register any queued children\n    flushQueuedChildren(name);\n\n    return state;\n  }\n\n  // Checks text to see if it looks like a glob.\n  function isGlob (text) {\n    return text.indexOf('*') > -1;\n  }\n\n  // Returns true if glob matches current $state name.\n  function doesStateMatchGlob (glob) {\n    var globSegments = glob.split('.'),\n        segments = $state.$current.name.split('.');\n\n    //match greedy starts\n    if (globSegments[0] === '**') {\n       segments = segments.slice(indexOf(segments, globSegments[1]));\n       segments.unshift('**');\n    }\n    //match greedy ends\n    if (globSegments[globSegments.length - 1] === '**') {\n       segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n       segments.push('**');\n    }\n\n    if (globSegments.length != segments.length) {\n      return false;\n    }\n\n    //match single stars\n    for (var i = 0, l = globSegments.length; i < l; i++) {\n      if (globSegments[i] === '*') {\n        segments[i] = '*';\n      }\n    }\n\n    return segments.join('') === globSegments.join('');\n  }\n\n\n  // Implicit root state that is always active\n  root = registerState({\n    name: '',\n    url: '^',\n    views: null,\n    'abstract': true\n  });\n  root.navigable = null;\n\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#decorator\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Allows you to extend (carefully) or override (at your own peril) the \n   * `stateBuilder` object used internally by `$stateProvider`. This can be used \n   * to add custom functionality to ui-router, for example inferring templateUrl \n   * based on the state name.\n   *\n   * When passing only a name, it returns the current (original or decorated) builder\n   * function that matches `name`.\n   *\n   * The builder functions that can be decorated are listed below. Though not all\n   * necessarily have a good use case for decoration, that is up to you to decide.\n   *\n   * In addition, users can attach custom decorators, which will generate new \n   * properties within the state's internal definition. There is currently no clear \n   * use-case for this beyond accessing internal states (i.e. $state.$current), \n   * however, expect this to become increasingly relevant as we introduce additional \n   * meta-programming features.\n   *\n   * **Warning**: Decorators should not be interdependent because the order of \n   * execution of the builder functions in non-deterministic. Builder functions \n   * should only be dependent on the state definition object and super function.\n   *\n   *\n   * Existing builder functions and current return values:\n   *\n   * - **parent** `{object}` - returns the parent state object.\n   * - **data** `{object}` - returns state data, including any inherited data that is not\n   *   overridden by own values (if any).\n   * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n   *   or `null`.\n   * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n   *   navigable).\n   * - **params** `{object}` - returns an array of state params that are ensured to \n   *   be a super-set of parent's params.\n   * - **views** `{object}` - returns a views object where each key is an absolute view \n   *   name (i.e. \"viewName@stateName\") and each value is the config object \n   *   (template, controller) for the view. Even when you don't use the views object \n   *   explicitly on a state config, one is still created for you internally.\n   *   So by decorating this builder function you have access to decorating template \n   *   and controller properties.\n   * - **ownParams** `{object}` - returns an array of params that belong to the state, \n   *   not including any params defined by ancestor states.\n   * - **path** `{string}` - returns the full path from the root down to this state. \n   *   Needed for state activation.\n   * - **includes** `{object}` - returns an object that includes every state that \n   *   would pass a `$state.includes()` test.\n   *\n   * @example\n   * <pre>\n   * // Override the internal 'views' builder with a function that takes the state\n   * // definition, and a reference to the internal function being overridden:\n   * $stateProvider.decorator('views', function (state, parent) {\n   *   var result = {},\n   *       views = parent(state);\n   *\n   *   angular.forEach(views, function (config, name) {\n   *     var autoName = (state.name + '.' + name).replace('.', '/');\n   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n   *     result[name] = config;\n   *   });\n   *   return result;\n   * });\n   *\n   * $stateProvider.state('home', {\n   *   views: {\n   *     'contact.list': { controller: 'ListController' },\n   *     'contact.item': { controller: 'ItemController' }\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * $state.go('home');\n   * // Auto-populates list and item views with /partials/home/contact/list.html,\n   * // and /partials/home/contact/item.html, respectively.\n   * </pre>\n   *\n   * @param {string} name The name of the builder function to decorate. \n   * @param {object} func A function that is responsible for decorating the original \n   * builder function. The function receives two parameters:\n   *\n   *   - `{object}` - state - The state config object.\n   *   - `{object}` - super - The original builder function.\n   *\n   * @return {object} $stateProvider - $stateProvider instance\n   */\n  this.decorator = decorator;\n  function decorator(name, func) {\n    /*jshint validthis: true */\n    if (isString(name) && !isDefined(func)) {\n      return stateBuilder[name];\n    }\n    if (!isFunction(func) || !isString(name)) {\n      return this;\n    }\n    if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n      stateBuilder.$delegates[name] = stateBuilder[name];\n    }\n    stateBuilder[name] = func;\n    return this;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#state\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Registers a state configuration under a given state name. The stateConfig object\n   * has the following acceptable properties.\n   *\n   * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n   * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n   * @param {object} stateConfig State configuration object.\n   * @param {string|function=} stateConfig.template\n   * <a id='template'></a>\n   *   html template as a string or a function that returns\n   *   an html template as a string which should be used by the uiView directives. This property \n   *   takes precedence over templateUrl.\n   *   \n   *   If `template` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by\n   *     applying the current state\n   *\n   * <pre>template:\n   *   \"<h1>inline template definition</h1>\" +\n   *   \"<div ui-view></div>\"</pre>\n   * <pre>template: function(params) {\n   *       return \"<h1>generated template</h1>\"; }</pre>\n   * </div>\n   *\n   * @param {string|function=} stateConfig.templateUrl\n   * <a id='templateUrl'></a>\n   *\n   *   path or function that returns a path to an html\n   *   template that should be used by uiView.\n   *   \n   *   If `templateUrl` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by \n   *     applying the current state\n   *\n   * <pre>templateUrl: \"home.html\"</pre>\n   * <pre>templateUrl: function(params) {\n   *     return myTemplates[params.pageId]; }</pre>\n   *\n   * @param {function=} stateConfig.templateProvider\n   * <a id='templateProvider'></a>\n   *    Provider function that returns HTML content string.\n   * <pre> templateProvider:\n   *       function(MyTemplateService, params) {\n   *         return MyTemplateService.getTemplate(params.pageId);\n   *       }</pre>\n   *\n   * @param {string|function=} stateConfig.controller\n   * <a id='controller'></a>\n   *\n   *  Controller fn that should be associated with newly\n   *   related scope or the name of a registered controller if passed as a string.\n   *   Optionally, the ControllerAs may be declared here.\n   * <pre>controller: \"MyRegisteredController\"</pre>\n   * <pre>controller:\n   *     \"MyRegisteredController as fooCtrl\"}</pre>\n   * <pre>controller: function($scope, MyService) {\n   *     $scope.data = MyService.getData(); }</pre>\n   *\n   * @param {function=} stateConfig.controllerProvider\n   * <a id='controllerProvider'></a>\n   *\n   * Injectable provider function that returns the actual controller or string.\n   * <pre>controllerProvider:\n   *   function(MyResolveData) {\n   *     if (MyResolveData.foo)\n   *       return \"FooCtrl\"\n   *     else if (MyResolveData.bar)\n   *       return \"BarCtrl\";\n   *     else return function($scope) {\n   *       $scope.baz = \"Qux\";\n   *     }\n   *   }</pre>\n   *\n   * @param {string=} stateConfig.controllerAs\n   * <a id='controllerAs'></a>\n   * \n   * A controller alias name. If present the controller will be\n   *   published to scope under the controllerAs name.\n   * <pre>controllerAs: \"myCtrl\"</pre>\n   *\n   * @param {object=} stateConfig.resolve\n   * <a id='resolve'></a>\n   *\n   * An optional map&lt;string, function&gt; of dependencies which\n   *   should be injected into the controller. If any of these dependencies are promises, \n   *   the router will wait for them all to be resolved before the controller is instantiated.\n   *   If all the promises are resolved successfully, the $stateChangeSuccess event is fired\n   *   and the values of the resolved promises are injected into any controllers that reference them.\n   *   If any  of the promises are rejected the $stateChangeError event is fired.\n   *\n   *   The map object is:\n   *   \n   *   - key - {string}: name of dependency to be injected into controller\n   *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, \n   *     it is injected and return value it treated as dependency. If result is a promise, it is \n   *     resolved before its value is injected into controller.\n   *\n   * <pre>resolve: {\n   *     myResolve1:\n   *       function($http, $stateParams) {\n   *         return $http.get(\"/api/foos/\"+stateParams.fooID);\n   *       }\n   *     }</pre>\n   *\n   * @param {string=} stateConfig.url\n   * <a id='url'></a>\n   *\n   *   A url fragment with optional parameters. When a state is navigated or\n   *   transitioned to, the `$stateParams` service will be populated with any \n   *   parameters that were passed.\n   *\n   * examples:\n   * <pre>url: \"/home\"\n   * url: \"/users/:userid\"\n   * url: \"/books/{bookid:[a-zA-Z_-]}\"\n   * url: \"/books/{categoryid:int}\"\n   * url: \"/books/{publishername:string}/{categoryid:int}\"\n   * url: \"/messages?before&after\"\n   * url: \"/messages?{before:date}&{after:date}\"</pre>\n   * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n   *\n   * @param {object=} stateConfig.views\n   * <a id='views'></a>\n   * an optional map&lt;string, object&gt; which defined multiple views, or targets views\n   * manually/explicitly.\n   *\n   * Examples:\n   *\n   * Targets three named `ui-view`s in the parent state's template\n   * <pre>views: {\n   *     header: {\n   *       controller: \"headerCtrl\",\n   *       templateUrl: \"header.html\"\n   *     }, body: {\n   *       controller: \"bodyCtrl\",\n   *       templateUrl: \"body.html\"\n   *     }, footer: {\n   *       controller: \"footCtrl\",\n   *       templateUrl: \"footer.html\"\n   *     }\n   *   }</pre>\n   *\n   * Targets named `ui-view=\"header\"` from grandparent state 'top''s template, and named `ui-view=\"body\" from parent state's template.\n   * <pre>views: {\n   *     'header@top': {\n   *       controller: \"msgHeaderCtrl\",\n   *       templateUrl: \"msgHeader.html\"\n   *     }, 'body': {\n   *       controller: \"messagesCtrl\",\n   *       templateUrl: \"messages.html\"\n   *     }\n   *   }</pre>\n   *\n   * @param {boolean=} [stateConfig.abstract=false]\n   * <a id='abstract'></a>\n   * An abstract state will never be directly activated,\n   *   but can provide inherited properties to its common children states.\n   * <pre>abstract: true</pre>\n   *\n   * @param {function=} stateConfig.onEnter\n   * <a id='onEnter'></a>\n   *\n   * Callback function for when a state is entered. Good way\n   *   to trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onEnter: function(MyService, $stateParams) {\n   *     MyService.foo($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {function=} stateConfig.onExit\n   * <a id='onExit'></a>\n   *\n   * Callback function for when a state is exited. Good way to\n   *   trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onExit: function(MyService, $stateParams) {\n   *     MyService.cleanup($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {boolean=} [stateConfig.reloadOnSearch=true]\n   * <a id='reloadOnSearch'></a>\n   *\n   * If `false`, will not retrigger the same state\n   *   just because a search/query parameter has changed (via $location.search() or $location.hash()). \n   *   Useful for when you'd like to modify $location.search() without triggering a reload.\n   * <pre>reloadOnSearch: false</pre>\n   *\n   * @param {object=} stateConfig.data\n   * <a id='data'></a>\n   *\n   * Arbitrary data object, useful for custom configuration.  The parent state's `data` is\n   *   prototypally inherited.  In other words, adding a data property to a state adds it to\n   *   the entire subtree via prototypal inheritance.\n   *\n   * <pre>data: {\n   *     requiredRole: 'foo'\n   * } </pre>\n   *\n   * @param {object=} stateConfig.params\n   * <a id='params'></a>\n   *\n   * A map which optionally configures parameters declared in the `url`, or\n   *   defines additional non-url parameters.  For each parameter being\n   *   configured, add a configuration object keyed to the name of the parameter.\n   *\n   *   Each parameter configuration object may contain the following properties:\n   *\n   *   - ** value ** - {object|function=}: specifies the default value for this\n   *     parameter.  This implicitly sets this parameter as optional.\n   *\n   *     When UI-Router routes to a state and no value is\n   *     specified for this parameter in the URL or transition, the\n   *     default value will be used instead.  If `value` is a function,\n   *     it will be injected and invoked, and the return value used.\n   *\n   *     *Note*: `undefined` is treated as \"no default value\" while `null`\n   *     is treated as \"the default value is `null`\".\n   *\n   *     *Shorthand*: If you only need to configure the default value of the\n   *     parameter, you may use a shorthand syntax.   In the **`params`**\n   *     map, instead mapping the param name to a full parameter configuration\n   *     object, simply set map it to the default parameter value, e.g.:\n   *\n   * <pre>// define a parameter's default value\n   * params: {\n   *     param1: { value: \"defaultValue\" }\n   * }\n   * // shorthand default values\n   * params: {\n   *     param1: \"defaultValue\",\n   *     param2: \"param2Default\"\n   * }</pre>\n   *\n   *   - ** array ** - {boolean=}: *(default: false)* If true, the param value will be\n   *     treated as an array of values.  If you specified a Type, the value will be\n   *     treated as an array of the specified Type.  Note: query parameter values\n   *     default to a special `\"auto\"` mode.\n   *\n   *     For query parameters in `\"auto\"` mode, if multiple  values for a single parameter\n   *     are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values\n   *     are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`).  However, if\n   *     only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single\n   *     value (e.g.: `{ foo: '1' }`).\n   *\n   * <pre>params: {\n   *     param1: { array: true }\n   * }</pre>\n   *\n   *   - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when\n   *     the current parameter value is the same as the default value. If `squash` is not set, it uses the\n   *     configured default squash policy.\n   *     (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})\n   *\n   *   There are three squash settings:\n   *\n   *     - false: The parameter's default value is not squashed.  It is encoded and included in the URL\n   *     - true: The parameter's default value is omitted from the URL.  If the parameter is preceeded and followed\n   *       by slashes in the state's `url` declaration, then one of those slashes are omitted.\n   *       This can allow for cleaner looking URLs.\n   *     - `\"<arbitrary string>\"`: The parameter's default value is replaced with an arbitrary placeholder of  your choice.\n   *\n   * <pre>params: {\n   *     param1: {\n   *       value: \"defaultId\",\n   *       squash: true\n   * } }\n   * // squash \"defaultValue\" to \"~\"\n   * params: {\n   *     param1: {\n   *       value: \"defaultValue\",\n   *       squash: \"~\"\n   * } }\n   * </pre>\n   *\n   *\n   * @example\n   * <pre>\n   * // Some state name examples\n   *\n   * // stateName can be a single top-level name (must be unique).\n   * $stateProvider.state(\"home\", {});\n   *\n   * // Or it can be a nested state name. This state is a child of the\n   * // above \"home\" state.\n   * $stateProvider.state(\"home.newest\", {});\n   *\n   * // Nest states as deeply as needed.\n   * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n   *\n   * // state() returns $stateProvider, so you can chain state declarations.\n   * $stateProvider\n   *   .state(\"home\", {})\n   *   .state(\"about\", {})\n   *   .state(\"contacts\", {});\n   * </pre>\n   *\n   */\n  this.state = state;\n  function state(name, definition) {\n    /*jshint validthis: true */\n    if (isObject(name)) definition = name;\n    else definition.name = name;\n    registerState(definition);\n    return this;\n  }\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$state\n   *\n   * @requires $rootScope\n   * @requires $q\n   * @requires ui.router.state.$view\n   * @requires $injector\n   * @requires ui.router.util.$resolve\n   * @requires ui.router.state.$stateParams\n   * @requires ui.router.router.$urlRouter\n   *\n   * @property {object} params A param object, e.g. {sectionId: section.id)}, that \n   * you'd like to test against the current active state.\n   * @property {object} current A reference to the state's config object. However \n   * you passed it in. Useful for accessing custom data.\n   * @property {object} transition Currently pending transition. A promise that'll \n   * resolve or reject.\n   *\n   * @description\n   * `$state` service is responsible for representing states as well as transitioning\n   * between them. It also provides interfaces to ask for current state or even states\n   * you're coming from.\n   */\n  this.$get = $get;\n  $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];\n  function $get(   $rootScope,   $q,   $view,   $injector,   $resolve,   $stateParams,   $urlRouter,   $location,   $urlMatcherFactory) {\n\n    var TransitionSuperseded = $q.reject(new Error('transition superseded'));\n    var TransitionPrevented = $q.reject(new Error('transition prevented'));\n    var TransitionAborted = $q.reject(new Error('transition aborted'));\n    var TransitionFailed = $q.reject(new Error('transition failed'));\n\n    // Handles the case where a state which is the target of a transition is not found, and the user\n    // can optionally retry or defer the transition\n    function handleRedirect(redirect, state, params, options) {\n      /**\n       * @ngdoc event\n       * @name ui.router.state.$state#$stateNotFound\n       * @eventOf ui.router.state.$state\n       * @eventType broadcast on root scope\n       * @description\n       * Fired when a requested state **cannot be found** using the provided state name during transition.\n       * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n       * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n       * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n       * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n       *\n       * @param {Object} event Event object.\n       * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n       * @param {State} fromState Current state object.\n       * @param {Object} fromParams Current state params.\n       *\n       * @example\n       *\n       * <pre>\n       * // somewhere, assume lazy.state has not been defined\n       * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n       *\n       * // somewhere else\n       * $scope.$on('$stateNotFound',\n       * function(event, unfoundState, fromState, fromParams){\n       *     console.log(unfoundState.to); // \"lazy.state\"\n       *     console.log(unfoundState.toParams); // {a:1, b:2}\n       *     console.log(unfoundState.options); // {inherit:false} + default options\n       * })\n       * </pre>\n       */\n      var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n      if (evt.defaultPrevented) {\n        $urlRouter.update();\n        return TransitionAborted;\n      }\n\n      if (!evt.retry) {\n        return null;\n      }\n\n      // Allow the handler to return a promise to defer state lookup retry\n      if (options.$retry) {\n        $urlRouter.update();\n        return TransitionFailed;\n      }\n      var retryTransition = $state.transition = $q.when(evt.retry);\n\n      retryTransition.then(function() {\n        if (retryTransition !== $state.transition) return TransitionSuperseded;\n        redirect.options.$retry = true;\n        return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n      }, function() {\n        return TransitionAborted;\n      });\n      $urlRouter.update();\n\n      return retryTransition;\n    }\n\n    root.locals = { resolve: null, globals: { $stateParams: {} } };\n\n    $state = {\n      params: {},\n      current: root.self,\n      $current: root,\n      transition: null\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#reload\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired, \n     * and controllers reinstantiated (bug with controllers reinstantiating right now, fixing soon).\n     *\n     * @example\n     * <pre>\n     * var app angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.reload = function(){\n     *     $state.reload();\n     *   }\n     * });\n     * </pre>\n     *\n     * `reload()` is just an alias for:\n     * <pre>\n     * $state.transitionTo($state.current, $stateParams, { \n     *   reload: true, inherit: false, notify: true\n     * });\n     * </pre>\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.reload = function reload() {\n      return $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#go\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Convenience method for transitioning to a new state. `$state.go` calls \n     * `$state.transitionTo` internally but automatically sets options to \n     * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. \n     * This allows you to easily use an absolute or relative to path and specify \n     * only the parameters you'd like to update (while letting unspecified parameters \n     * inherit from the currently active ancestor states).\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.go('contact.detail');\n     *   };\n     * });\n     * </pre>\n     * <img src='../ngdoc_assets/StateGoExamples.png'/>\n     *\n     * @param {string} to Absolute state name or relative state path. Some examples:\n     *\n     * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n     * - `$state.go('^')` - will go to a parent state\n     * - `$state.go('^.sibling')` - will go to a sibling state\n     * - `$state.go('.child.grandchild')` - will go to grandchild state\n     *\n     * @param {object=} params A map of the parameters that will be sent to the state, \n     * will populate $stateParams. Any parameters that are not specified will be inherited from currently \n     * defined parameters. This allows, for example, going to a sibling state that shares parameters\n     * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.\n     * transitioning to a sibling will get you the parameters for all parents, transitioning to a child\n     * will get you all current parameters, etc.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition.\n     *\n     * Possible success values:\n     *\n     * - $state.current\n     *\n     * <br/>Possible rejection values:\n     *\n     * - 'transition superseded' - when a newer transition has been started after this one\n     * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener\n     * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or\n     *   when a `$stateNotFound` `event.retry` promise errors.\n     * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.\n     * - *resolve error* - when an error has occurred with a `resolve`\n     *\n     */\n    $state.go = function go(to, params, options) {\n      return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#transitionTo\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}\n     * uses `transitionTo` internally. `$state.go` is recommended in most situations.\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.transitionTo('contact.detail');\n     *   };\n     * });\n     * </pre>\n     *\n     * @param {string} to State name.\n     * @param {object=} toParams A map of the parameters that will be sent to the state,\n     * will populate $stateParams.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.transitionTo = function transitionTo(to, toParams, options) {\n      toParams = toParams || {};\n      options = extend({\n        location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false\n      }, options || {});\n\n      var from = $state.$current, fromParams = $state.params, fromPath = from.path;\n      var evt, toState = findState(to, options.relative);\n\n      if (!isDefined(toState)) {\n        var redirect = { to: to, toParams: toParams, options: options };\n        var redirectResult = handleRedirect(redirect, from.self, fromParams, options);\n\n        if (redirectResult) {\n          return redirectResult;\n        }\n\n        // Always retry once if the $stateNotFound was not prevented\n        // (handles either redirect changed or state lazy-definition)\n        to = redirect.to;\n        toParams = redirect.toParams;\n        options = redirect.options;\n        toState = findState(to, options.relative);\n\n        if (!isDefined(toState)) {\n          if (!options.relative) throw new Error(\"No such state '\" + to + \"'\");\n          throw new Error(\"Could not resolve '\" + to + \"' from state '\" + options.relative + \"'\");\n        }\n      }\n      if (toState[abstractKey]) throw new Error(\"Cannot transition to abstract state '\" + to + \"'\");\n      if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);\n      if (!toState.params.$$validates(toParams)) return TransitionFailed;\n\n      toParams = toState.params.$$values(toParams);\n      to = toState;\n\n      var toPath = to.path;\n\n      // Starting from the root of the path, keep all levels that haven't changed\n      var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];\n\n      if (!options.reload) {\n        while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {\n          locals = toLocals[keep] = state.locals;\n          keep++;\n          state = toPath[keep];\n        }\n      }\n\n      // If we're going to the same state and all locals are kept, we've got nothing to do.\n      // But clear 'transition', as we still want to cancel any other pending transitions.\n      // TODO: We may not want to bump 'transition' if we're called from a location change\n      // that we've initiated ourselves, because we might accidentally abort a legitimate\n      // transition initiated from code?\n      if (shouldTriggerReload(to, from, locals, options)) {\n        if (to.self.reloadOnSearch !== false) $urlRouter.update();\n        $state.transition = null;\n        return $q.when($state.current);\n      }\n\n      // Filter parameters before we pass them to event handlers etc.\n      toParams = filterByKeys(to.params.$$keys(), toParams || {});\n\n      // Broadcast start event and cancel the transition if requested\n      if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeStart\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when the state transition **begins**. You can use `event.preventDefault()`\n         * to prevent the transition from happening and then the transition promise will be\n         * rejected with a `'transition prevented'` value.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         *\n         * @example\n         *\n         * <pre>\n         * $rootScope.$on('$stateChangeStart',\n         * function(event, toState, toParams, fromState, fromParams){\n         *     event.preventDefault();\n         *     // transitionTo() promise will be rejected with\n         *     // a 'transition prevented' error\n         * })\n         * </pre>\n         */\n        if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {\n          $urlRouter.update();\n          return TransitionPrevented;\n        }\n      }\n\n      // Resolve locals for the remaining states, but don't update any global state just\n      // yet -- if anything fails to resolve the current state needs to remain untouched.\n      // We also set up an inheritance chain for the locals here. This allows the view directive\n      // to quickly look up the correct definition for each view in the current state. Even\n      // though we create the locals object itself outside resolveState(), it is initially\n      // empty and gets filled asynchronously. We need to keep track of the promise for the\n      // (fully resolved) current locals, and pass this down the chain.\n      var resolved = $q.when(locals);\n\n      for (var l = keep; l < toPath.length; l++, state = toPath[l]) {\n        locals = toLocals[l] = inherit(locals);\n        resolved = resolveState(state, toParams, state === to, resolved, locals, options);\n      }\n\n      // Once everything is resolved, we are ready to perform the actual transition\n      // and return a promise for the new state. We also keep track of what the\n      // current promise is, so that we can detect overlapping transitions and\n      // keep only the outcome of the last transition.\n      var transition = $state.transition = resolved.then(function () {\n        var l, entering, exiting;\n\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Exit 'from' states not kept\n        for (l = fromPath.length - 1; l >= keep; l--) {\n          exiting = fromPath[l];\n          if (exiting.self.onExit) {\n            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);\n          }\n          exiting.locals = null;\n        }\n\n        // Enter 'to' states not kept\n        for (l = keep; l < toPath.length; l++) {\n          entering = toPath[l];\n          entering.locals = toLocals[l];\n          if (entering.self.onEnter) {\n            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);\n          }\n        }\n\n        // Run it again, to catch any transitions in callbacks\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Update globals in $state\n        $state.$current = to;\n        $state.current = to.self;\n        $state.params = toParams;\n        copy($state.params, $stateParams);\n        $state.transition = null;\n\n        if (options.location && to.navigable) {\n          $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {\n            $$avoidResync: true, replace: options.location === 'replace'\n          });\n        }\n\n        if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeSuccess\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired once the state transition is **complete**.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         */\n          $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);\n        }\n        $urlRouter.update(true);\n\n        return $state.current;\n      }, function (error) {\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        $state.transition = null;\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeError\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when an **error occurs** during transition. It's important to note that if you\n         * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n         * they will not throw traditionally. You must listen for this $stateChangeError event to\n         * catch **ALL** errors.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         * @param {Error} error The resolve error object.\n         */\n        evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);\n\n        if (!evt.defaultPrevented) {\n            $urlRouter.update();\n        }\n\n        return $q.reject(error);\n      });\n\n      return transition;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#is\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Similar to {@link ui.router.state.$state#methods_includes $state.includes},\n     * but only checks for the full state name. If params is supplied then it will be\n     * tested for strict equality against the current active params object, so all params\n     * must match with none missing and no extras.\n     *\n     * @example\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // absolute name\n     * $state.is('contact.details.item'); // returns true\n     * $state.is(contactDetailItemStateObject); // returns true\n     *\n     * // relative name (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like\n     * to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object} -  If `stateOrName` is a relative state name and `options.relative` is set, .is will\n     * test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it is the state.\n     */\n    $state.is = function is(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) { return undefined; }\n      if ($state.$current !== state) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#includes\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method to determine if the current active state is equal to or is the child of the\n     * state stateName. If any params are passed then they will be tested for a match as well.\n     * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n     *\n     * @example\n     * Partial and relative names\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // Using partial names\n     * $state.includes(\"contacts\"); // returns true\n     * $state.includes(\"contacts.details\"); // returns true\n     * $state.includes(\"contacts.details.item\"); // returns true\n     * $state.includes(\"contacts.list\"); // returns false\n     * $state.includes(\"about\"); // returns false\n     *\n     * // Using relative names (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.includes('.item')}\">Item</div>\n     * </pre>\n     *\n     * Basic globbing patterns\n     * <pre>\n     * $state.$current.name = 'contacts.details.item.url';\n     *\n     * $state.includes(\"*.details.*.*\"); // returns true\n     * $state.includes(\"*.details.**\"); // returns true\n     * $state.includes(\"**.item.**\"); // returns true\n     * $state.includes(\"*.details.item.url\"); // returns true\n     * $state.includes(\"*.details.*.url\"); // returns true\n     * $state.includes(\"*.details.*\"); // returns false\n     * $state.includes(\"item.**\"); // returns false\n     * </pre>\n     *\n     * @param {string} stateOrName A partial name, relative name, or glob pattern\n     * to be searched for within the current state name.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`,\n     * that you'd like to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object=} -  If `stateOrName` is a relative state reference and `options.relative` is set,\n     * .includes will test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it does include the state\n     */\n    $state.includes = function includes(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      if (isString(stateOrName) && isGlob(stateOrName)) {\n        if (!doesStateMatchGlob(stateOrName)) {\n          return false;\n        }\n        stateOrName = $state.$current.name;\n      }\n\n      var state = findState(stateOrName, options.relative);\n      if (!isDefined(state)) { return undefined; }\n      if (!isDefined($state.$current.includes[state.name])) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;\n    };\n\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#href\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A url generation method that returns the compiled url for the given state populated with the given params.\n     *\n     * @example\n     * <pre>\n     * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.\n     * @param {object=} params An object of parameter values to fill the state's required parameters.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the\n     *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka\n     *    ancestor with a valid url).\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n     * \n     * @returns {string} compiled state url\n     */\n    $state.href = function href(stateOrName, params, options) {\n      options = extend({\n        lossy:    true,\n        inherit:  true,\n        absolute: false,\n        relative: $state.$current\n      }, options || {});\n\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) return null;\n      if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);\n      \n      var nav = (state && options.lossy) ? state.navigable : state;\n\n      if (!nav || nav.url === undefined || nav.url === null) {\n        return null;\n      }\n      return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys(), params || {}), {\n        absolute: options.absolute\n      });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#get\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Returns the state configuration object for any specific state or all states.\n     *\n     * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for\n     * the requested state. If not provided, returns an array of ALL state configs.\n     * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.\n     * @returns {Object|Array} State configuration object or array of all objects.\n     */\n    $state.get = function (stateOrName, context) {\n      if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });\n      var state = findState(stateOrName, context || $state.$current);\n      return (state && state.self) ? state.self : null;\n    };\n\n    function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {\n      // Make a restricted $stateParams with only the parameters that apply to this state if\n      // necessary. In addition to being available to the controller and onEnter/onExit callbacks,\n      // we also need $stateParams to be available for any $injector calls we make during the\n      // dependency resolution process.\n      var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);\n      var locals = { $stateParams: $stateParams };\n\n      // Resolve 'global' dependencies for the state, i.e. those not specific to a view.\n      // We're also including $stateParams in this; that way the parameters are restricted\n      // to the set that should be visible to the state, and are independent of when we update\n      // the global $state and $stateParams values.\n      dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);\n      var promises = [dst.resolve.then(function (globals) {\n        dst.globals = globals;\n      })];\n      if (inherited) promises.push(inherited);\n\n      // Resolve template and dependencies for all views.\n      forEach(state.views, function (view, name) {\n        var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});\n        injectables.$template = [ function () {\n          return $view.load(name, { view: view, locals: locals, params: $stateParams, notify: options.notify }) || '';\n        }];\n\n        promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {\n          // References to the controller (only instantiated at link time)\n          if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {\n            var injectLocals = angular.extend({}, injectables, locals);\n            result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);\n          } else {\n            result.$$controller = view.controller;\n          }\n          // Provide access to the state itself for internal use\n          result.$$state = state;\n          result.$$controllerAs = view.controllerAs;\n          dst[name] = result;\n        }));\n      });\n\n      // Wait for all the promises and then return the activation object\n      return $q.all(promises).then(function (values) {\n        return dst;\n      });\n    }\n\n    return $state;\n  }\n\n  function shouldTriggerReload(to, from, locals, options) {\n    if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {\n      return true;\n    }\n  }\n}\n\nangular.module('ui.router.state')\n  .value('$stateParams', {})\n  .provider('$state', $StateProvider);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/stateDirectives.js",
    "content": "function parseStateRef(ref, current) {\n  var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n  if (preparsed) ref = current + '(' + preparsed[1] + ')';\n  parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n  if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n  return { state: parsed[1], paramExpr: parsed[3] || null };\n}\n\nfunction stateContext(el) {\n  var stateData = el.parent().inheritedData('$uiView');\n\n  if (stateData && stateData.state && stateData.state.name) {\n    return stateData.state;\n  }\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref\n *\n * @requires ui.router.state.$state\n * @requires $timeout\n *\n * @restrict A\n *\n * @description\n * A directive that binds a link (`<a>` tag) to a state. If the state has an associated \n * URL, the directive will automatically generate & update the `href` attribute via \n * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking \n * the link will trigger a state transition with optional parameters. \n *\n * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be \n * handled natively by the browser.\n *\n * You can also use relative state paths within ui-sref, just like the relative \n * paths passed to `$state.go()`. You just need to be aware that the path is relative\n * to the state that the link lives in, in other words the state that loaded the \n * template containing the link.\n *\n * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}\n * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n * and `reload`.\n *\n * @example\n * Here's an example of how you'd use ui-sref and how it would compile. If you have the \n * following template:\n * <pre>\n * <a ui-sref=\"home\">Home</a> | <a ui-sref=\"about\">About</a> | <a ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n *     </li>\n * </ul>\n * </pre>\n * \n * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n * <pre>\n * <a href=\"#/home\" ui-sref=\"home\">Home</a> | <a href=\"#/about\" ui-sref=\"about\">About</a> | <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n *     </li>\n * </ul>\n *\n * <a ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * </pre>\n *\n * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDirective($state, $timeout) {\n  var allowedOptions = ['location', 'inherit', 'reload'];\n\n  return {\n    restrict: 'A',\n    require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n    link: function(scope, element, attrs, uiSrefActive) {\n      var ref = parseStateRef(attrs.uiSref, $state.current.name);\n      var params = null, url = null, base = stateContext(element) || $state.$current;\n      var newHref = null, isAnchor = element.prop(\"tagName\") === \"A\";\n      var isForm = element[0].nodeName === \"FORM\";\n      var attr = isForm ? \"action\" : \"href\", nav = true;\n\n      var options = { relative: base, inherit: true };\n      var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};\n\n      angular.forEach(allowedOptions, function(option) {\n        if (option in optionsOverride) {\n          options[option] = optionsOverride[option];\n        }\n      });\n\n      var update = function(newVal) {\n        if (newVal) params = angular.copy(newVal);\n        if (!nav) return;\n\n        newHref = $state.href(ref.state, params, options);\n\n        var activeDirective = uiSrefActive[1] || uiSrefActive[0];\n        if (activeDirective) {\n          activeDirective.$$setStateInfo(ref.state, params);\n        }\n        if (newHref === null) {\n          nav = false;\n          return false;\n        }\n        attrs.$set(attr, newHref);\n      };\n\n      if (ref.paramExpr) {\n        scope.$watch(ref.paramExpr, function(newVal, oldVal) {\n          if (newVal !== params) update(newVal);\n        }, true);\n        params = angular.copy(scope.$eval(ref.paramExpr));\n      }\n      update();\n\n      if (isForm) return;\n\n      element.bind(\"click\", function(e) {\n        var button = e.which || e.button;\n        if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {\n          // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n          var transition = $timeout(function() {\n            $state.go(ref.state, params, options);\n          });\n          e.preventDefault();\n\n          // if the state has no URL, ignore one preventDefault from the <a> directive.\n          var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;\n          e.preventDefault = function() {\n            if (ignorePreventDefaultCount-- <= 0)\n              $timeout.cancel(transition);\n          };\n        }\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * A directive working alongside ui-sref to add classes to an element when the\n * related ui-sref directive's state is active, and removing them when it is inactive.\n * The primary use-case is to simplify the special appearance of navigation menus\n * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n * distinguishing it from the inactive menu items.\n *\n * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n * ui-sref-active found at the same level or above the ui-sref will be used.\n *\n * Will activate when the ui-sref's target state or any child state is active. If you\n * need to activate only when the ui-sref target state is active and *not* any of\n * it's children, then you will use\n * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n *\n * @example\n * Given the following template:\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item\">\n *     <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n *\n * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item active\">\n *     <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n * The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * Multiple classes may be specified in a space-separated format:\n * <pre>\n * <ul>\n *   <li ui-sref-active='class1 class2 class3'>\n *     <a ui-sref=\"app.user\">link</a>\n *   </li>\n * </ul>\n * </pre>\n */\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active-eq\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n * when the exact target state used in the `ui-sref` is active; no child states.\n *\n */\n$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\nfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n  return  {\n    restrict: \"A\",\n    controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\n      var state, params, activeClass;\n\n      // There probably isn't much point in $observing this\n      // uiSrefActive and uiSrefActiveEq share the same directive object with some\n      // slight difference in logic routing\n      activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);\n\n      // Allow uiSref to communicate with uiSrefActive[Equals]\n      this.$$setStateInfo = function (newState, newParams) {\n        state = $state.get(newState, stateContext($element));\n        params = newParams;\n        update();\n      };\n\n      $scope.$on('$stateChangeSuccess', update);\n\n      // Update route state\n      function update() {\n        if (isMatch()) {\n          $element.addClass(activeClass);\n        } else {\n          $element.removeClass(activeClass);\n        }\n      }\n\n      function isMatch() {\n        if (typeof $attrs.uiSrefActiveEq !== 'undefined') {\n          return state && $state.is(state.name, params);\n        } else {\n          return state && $state.includes(state.name, params);\n        }\n      }\n    }]\n  };\n}\n\nangular.module('ui.router.state')\n  .directive('uiSref', $StateRefDirective)\n  .directive('uiSrefActive', $StateRefActiveDirective)\n  .directive('uiSrefActiveEq', $StateRefActiveDirective);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/stateFilters.js",
    "content": "/**\n * @ngdoc filter\n * @name ui.router.state.filter:isState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n  var isFilter = function (state) {\n    return $state.is(state);\n  };\n  isFilter.$stateful = true;\n  return isFilter;\n}\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:includedByState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n  var includesFilter = function (state) {\n    return $state.includes(state);\n  };\n  includesFilter.$stateful = true;\n  return  includesFilter;\n}\n\nangular.module('ui.router.state')\n  .filter('isState', $IsStateFilter)\n  .filter('includedByState', $IncludedByStateFilter);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/templateFactory.js",
    "content": "/**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\n$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];\nfunction $TemplateFactory(  $http,   $templateCache,   $injector) {\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromConfig\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a configuration object. \n   *\n   * @param {object} config Configuration object for which to load a template. \n   * The following properties are search in the specified order, and the first one \n   * that is defined is used to create the template:\n   *\n   * @param {string|object} config.template html string template or function to \n   * load via {@link ui.router.util.$templateFactory#fromString fromString}.\n   * @param {string|object} config.templateUrl url to load or a function returning \n   * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.\n   * @param {Function} config.templateProvider function to invoke via \n   * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.\n   * @param {object} params  Parameters to pass to the template function.\n   * @param {object} locals Locals to pass to `invoke` if the template is loaded \n   * via a `templateProvider`. Defaults to `{ params: params }`.\n   *\n   * @return {string|object}  The template html as a string, or a promise for \n   * that string,or `null` if no template is configured.\n   */\n  this.fromConfig = function (config, params, locals) {\n    return (\n      isDefined(config.template) ? this.fromString(config.template, params) :\n      isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :\n      isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :\n      null\n    );\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromString\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a string or a function returning a string.\n   *\n   * @param {string|object} template html template as a string or function that \n   * returns an html template as a string.\n   * @param {object} params Parameters to pass to the template function.\n   *\n   * @return {string|object} The template html as a string, or a promise for that \n   * string.\n   */\n  this.fromString = function (template, params) {\n    return isFunction(template) ? template(params) : template;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromUrl\n   * @methodOf ui.router.util.$templateFactory\n   * \n   * @description\n   * Loads a template from the a URL via `$http` and `$templateCache`.\n   *\n   * @param {string|Function} url url of the template to load, or a function \n   * that returns a url.\n   * @param {Object} params Parameters to pass to the url function.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromUrl = function (url, params) {\n    if (isFunction(url)) url = url(params);\n    if (url == null) return null;\n    else return $http\n        .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n        .then(function(response) { return response.data; });\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromProvider\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template by invoking an injectable provider function.\n   *\n   * @param {Function} provider Function to invoke via `$injector.invoke`\n   * @param {Object} params Parameters for the template.\n   * @param {Object} locals Locals to pass to `invoke`. Defaults to \n   * `{ params: params }`.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromProvider = function (provider, params, locals) {\n    return $injector.invoke(provider, null, locals || { params: params });\n  };\n}\n\nangular.module('ui.router.util').service('$templateFactory', $TemplateFactory);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/urlMatcherFactory.js",
    "content": "var $$UMFP; // reference to $UrlMatcherFactoryProvider\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:UrlMatcher\n *\n * @description\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n * \n * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n * syntax, which optionally allows a regular expression for the parameter to be specified:\n *\n * * `':'` name - colon placeholder\n * * `'*'` name - catch-all placeholder\n * * `'{' name '}'` - curly placeholder\n * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n *   regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters). For colon \n * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n * number of characters other than '/'. For catch-all placeholders the path parameter matches\n * any number of characters.\n * \n * Examples:\n * \n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n *   trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n *   parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n *   path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n *   in the built-in  `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n * @param {string} pattern  The pattern to compile into a matcher.\n * @param {Object} config  A configuration object hash:\n * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n *   an existing UrlMatcher\n *\n * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n *\n * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any\n *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n *   non-null) will start with this prefix.\n *\n * @property {string} source  The pattern that was passed into the constructor\n *\n * @property {string} sourcePath  The path portion of the source property\n *\n * @property {string} sourceSearch  The search portion of the source property\n *\n * @property {string} regex  The constructed regex that will be used to match against the url when \n *   it is time to determine which url will match.\n *\n * @returns {Object}  New `UrlMatcher` object\n */\nfunction UrlMatcher(pattern, config, parentMatcher) {\n  config = extend({ params: {} }, isObject(config) ? config : {});\n\n  // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n  //   '*' name\n  //   ':' name\n  //   '{' name '}'\n  //   '{' name ':' regexp '}'\n  // The regular expression is somewhat complicated due to the need to allow curly braces\n  // inside the regular expression. The placeholder regexp breaks down as follows:\n  //    ([:*])([\\w\\[\\]]+)              - classic placeholder ($1 / $2) (search version has - for snake-case)\n  //    \\{([\\w\\[\\]]+)(?:\\:( ... ))?\\}  - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n  //    (?: ... | ... | ... )+         - the regexp consists of any number of atoms, an atom being either\n  //    [^{}\\\\]+                       - anything other than curly braces or backslash\n  //    \\\\.                            - a backslash escape\n  //    \\{(?:[^{}\\\\]+|\\\\.)*\\}          - a matched set of curly braces containing other atoms\n  var placeholder       = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      searchPlaceholder = /([:]?)([\\w\\[\\]-]+)|\\{([\\w\\[\\]-]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      compiled = '^', last = 0, m,\n      segments = this.segments = [],\n      parentParams = parentMatcher ? parentMatcher.params : {},\n      params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n      paramNames = [];\n\n  function addParameter(id, type, config, location) {\n    paramNames.push(id);\n    if (parentParams[id]) return parentParams[id];\n    if (!/^\\w+(-+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    params[id] = new $$UMFP.Param(id, type, config, location);\n    return params[id];\n  }\n\n  function quoteRegExp(string, pattern, squash) {\n    var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n    if (!pattern) return result;\n    switch(squash) {\n      case false: surroundPattern = ['(', ')'];   break;\n      case true:  surroundPattern = ['?(', ')?']; break;\n      default:    surroundPattern = ['(' + squash + \"|\", ')?'];  break;\n    }\n    return result + surroundPattern[0] + pattern + surroundPattern[1];\n  }\n\n  this.source = pattern;\n\n  // Split into static segments separated by path parameter placeholders.\n  // The number of segments is always 1 more than the number of parameters.\n  function matchDetails(m, isSearch) {\n    var id, regexp, segment, type, cfg, arrayMode;\n    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n    cfg         = config.params[id];\n    segment     = pattern.substring(last, m.index);\n    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n    type        = $$UMFP.type(regexp || \"string\") || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp) });\n    return {\n      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n    };\n  }\n\n  var p, param, segment;\n  while ((m = placeholder.exec(pattern))) {\n    p = matchDetails(m, false);\n    if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\n    param = addParameter(p.id, p.type, p.cfg, \"path\");\n    compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash);\n    segments.push(p.segment);\n    last = placeholder.lastIndex;\n  }\n  segment = pattern.substring(last);\n\n  // Find any search parameter names and remove them from the last segment\n  var i = segment.indexOf('?');\n\n  if (i >= 0) {\n    var search = this.sourceSearch = segment.substring(i);\n    segment = segment.substring(0, i);\n    this.sourcePath = pattern.substring(0, last + i);\n\n    if (search.length > 0) {\n      last = 0;\n      while ((m = searchPlaceholder.exec(search))) {\n        p = matchDetails(m, true);\n        param = addParameter(p.id, p.type, p.cfg, \"search\");\n        last = placeholder.lastIndex;\n        // check if ?&\n      }\n    }\n  } else {\n    this.sourcePath = pattern;\n    this.sourceSearch = '';\n  }\n\n  compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n  segments.push(segment);\n\n  this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n  this.prefix = segments[0];\n  this.$$paramNames = paramNames;\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#concat\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns a new matcher for a pattern constructed by appending the path part and adding the\n * search parameters of the specified pattern to this pattern. The current pattern is not\n * modified. This can be understood as creating a pattern for URLs that are relative to (or\n * suffixes of) the current pattern.\n *\n * @example\n * The following two matchers are equivalent:\n * <pre>\n * new UrlMatcher('/user/{id}?q').concat('/details?date');\n * new UrlMatcher('/user/{id}/details?q&date');\n * </pre>\n *\n * @param {string} pattern  The pattern to append.\n * @param {Object} config  An object hash of the configuration for the matcher.\n * @returns {UrlMatcher}  A matcher for the concatenated pattern.\n */\nUrlMatcher.prototype.concat = function (pattern, config) {\n  // Because order of search parameters is irrelevant, we can add our own search\n  // parameters to the end of the new pattern. Parse the new pattern by itself\n  // and then join the bits together, but it's much easier to do this on a string level.\n  var defaultConfig = {\n    caseInsensitive: $$UMFP.caseInsensitive(),\n    strict: $$UMFP.strictMode(),\n    squash: $$UMFP.defaultSquashPolicy()\n  };\n  return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n};\n\nUrlMatcher.prototype.toString = function () {\n  return this.source;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#exec\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Tests the specified path against this matcher, and returns an object containing the captured\n * parameter values, or null if the path does not match. The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `searchParams`. This means that search parameters are always treated\n * as optional.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n *   x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * </pre>\n *\n * @param {string} path  The URL path to match, e.g. `$location.path()`.\n * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.\n * @returns {Object}  The captured parameter values.\n */\nUrlMatcher.prototype.exec = function (path, searchParams) {\n  var m = this.regexp.exec(path);\n  if (!m) return null;\n  searchParams = searchParams || {};\n\n  var paramNames = this.parameters(), nTotal = paramNames.length,\n    nPath = this.segments.length - 1,\n    values = {}, i, j, cfg, paramName;\n\n  if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\n  function decodePathArray(string) {\n    function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n    function unquoteDashes(str) { return str.replace(/\\\\-/, \"-\"); }\n\n    var split = reverseString(string).split(/-(?!\\\\)/);\n    var allReversed = map(split, reverseString);\n    return map(allReversed, unquoteDashes).reverse();\n  }\n\n  for (i = 0; i < nPath; i++) {\n    paramName = paramNames[i];\n    var param = this.params[paramName];\n    var paramVal = m[i+1];\n    // if the param value matches a pre-replace pair, replace the value before decoding.\n    for (j = 0; j < param.replace; j++) {\n      if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n    }\n    if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n    values[paramName] = param.value(paramVal);\n  }\n  for (/**/; i < nTotal; i++) {\n    paramName = paramNames[i];\n    values[paramName] = this.params[paramName].value(searchParams[paramName]);\n  }\n\n  return values;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#parameters\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns the names of all path and search parameters of this pattern in an unspecified order.\n * \n * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the\n *    pattern has no parameters, an empty array is returned.\n */\nUrlMatcher.prototype.parameters = function (param) {\n  if (!isDefined(param)) return this.$$paramNames;\n  return this.params[param] || null;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#validate\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param {Object} params The object hash of parameters to validate.\n * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n */\nUrlMatcher.prototype.validates = function (params) {\n  return this.params.$$validates(params);\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#format\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters. Null values for path parameters are\n * treated as empty strings.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * </pre>\n *\n * @param {Object} values  the values to substitute for the parameters in this pattern.\n * @returns {string}  the formatted URL (path and optionally search part).\n */\nUrlMatcher.prototype.format = function (values) {\n  values = values || {};\n  var segments = this.segments, params = this.parameters(), paramset = this.params;\n  if (!this.validates(values)) return null;\n\n  var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\n  function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n    return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n  }\n\n  for (i = 0; i < nTotal; i++) {\n    var isPathParam = i < nPath;\n    var name = params[i], param = paramset[name], value = param.value(values[name]);\n    var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n    var squash = isDefaultValue ? param.squash : false;\n    var encoded = param.type.encode(value);\n\n    if (isPathParam) {\n      var nextSegment = segments[i + 1];\n      if (squash === false) {\n        if (encoded != null) {\n          if (isArray(encoded)) {\n            result += map(encoded, encodeDashes).join(\"-\");\n          } else {\n            result += encodeURIComponent(encoded);\n          }\n        }\n        result += nextSegment;\n      } else if (squash === true) {\n        var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n        result += nextSegment.match(capture)[1];\n      } else if (isString(squash)) {\n        result += squash + nextSegment;\n      }\n    } else {\n      if (encoded == null || (isDefaultValue && squash !== false)) continue;\n      if (!isArray(encoded)) encoded = [ encoded ];\n      encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n      result += (search ? '&' : '?') + (name + '=' + encoded);\n      search = true;\n    }\n  }\n\n  return result;\n};\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:Type\n *\n * @description\n * Implements an interface to define custom parameter types that can be decoded from and encoded to\n * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n * objects when matching or formatting URLs, or comparing or validating parameter values.\n *\n * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n * information on registering custom types.\n *\n * @param {Object} config  A configuration object which contains the custom type definition.  The object's\n *        properties will override the default methods and/or pattern in `Type`'s public interface.\n * @example\n * <pre>\n * {\n *   decode: function(val) { return parseInt(val, 10); },\n *   encode: function(val) { return val && val.toString(); },\n *   equals: function(a, b) { return this.is(a) && a === b; },\n *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n *   pattern: /\\d+/\n * }\n * </pre>\n *\n * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n *           coming from a substring of a URL.\n *\n * @returns {Object}  Returns a new `Type` object.\n */\nfunction Type(config) {\n  extend(this, config);\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#is\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Detects whether a value is of a particular type. Accepts a native (decoded) value\n * and determines whether it matches the current `Type` object.\n *\n * @param {*} val  The value to check.\n * @param {string} key  Optional. If the type check is happening in the context of a specific\n *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.\n */\nType.prototype.is = function(val, key) {\n  return true;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#encode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n * only needs to be a representation of `val` that has been coerced to a string.\n *\n * @param {*} val  The value to encode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.\n */\nType.prototype.encode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#decode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Converts a parameter value (from URL string or transition param) to a custom/native value.\n *\n * @param {string} val  The URL parameter value to decode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {*}  Returns a custom representation of the URL parameter value.\n */\nType.prototype.decode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#equals\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Determines whether two decoded values are equivalent.\n *\n * @param {*} a  A value to compare against.\n * @param {*} b  A value to compare against.\n * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.\n */\nType.prototype.equals = function(a, b) {\n  return a == b;\n};\n\nType.prototype.$subPattern = function() {\n  var sub = this.pattern.toString();\n  return sub.substr(1, sub.length - 2);\n};\n\nType.prototype.pattern = /.*/;\n\nType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\n/*\n * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\nType.prototype.$asArray = function(mode, isSearch) {\n  if (!mode) return this;\n  if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n  return new ArrayType(this, mode);\n\n  function ArrayType(type, mode) {\n    function bindTo(type, callbackName) {\n      return function() {\n        return type[callbackName].apply(type, arguments);\n      };\n    }\n\n    // Wrap non-array value as array\n    function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n    // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n    function arrayUnwrap(val) {\n      switch(val.length) {\n        case 0: return undefined;\n        case 1: return mode === \"auto\" ? val[0] : val;\n        default: return val;\n      }\n    }\n    function falsey(val) { return !val; }\n\n    // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n    function arrayHandler(callback, allTruthyMode) {\n      return function handleArray(val) {\n        val = arrayWrap(val);\n        var result = map(val, callback);\n        if (allTruthyMode === true)\n          return filter(result, falsey).length === 0;\n        return arrayUnwrap(result);\n      };\n    }\n\n    // Wraps type (.equals) functions to operate on each value of an array\n    function arrayEqualsHandler(callback) {\n      return function handleArray(val1, val2) {\n        var left = arrayWrap(val1), right = arrayWrap(val2);\n        if (left.length !== right.length) return false;\n        for (var i = 0; i < left.length; i++) {\n          if (!callback(left[i], right[i])) return false;\n        }\n        return true;\n      };\n    }\n\n    this.encode = arrayHandler(bindTo(type, 'encode'));\n    this.decode = arrayHandler(bindTo(type, 'decode'));\n    this.is     = arrayHandler(bindTo(type, 'is'), true);\n    this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n    this.pattern = type.pattern;\n    this.$arrayMode = mode;\n  }\n};\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$urlMatcherFactory\n *\n * @description\n * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n * is also available to providers under the name `$urlMatcherFactoryProvider`.\n */\nfunction $UrlMatcherFactory() {\n  $$UMFP = this;\n\n  var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\n  function valToString(val) { return val != null ? val.toString().replace(/\\//g, \"%2F\") : val; }\n  function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, \"/\") : val; }\n//  TODO: in 1.0, make string .is() return false if value is undefined by default.\n//  function regexpMatches(val) { /*jshint validthis:true */ return isDefined(val) && this.pattern.test(val); }\n  function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); }\n\n  var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n    string: {\n      encode: valToString,\n      decode: valFromString,\n      is: regexpMatches,\n      pattern: /[^/]*/\n    },\n    int: {\n      encode: valToString,\n      decode: function(val) { return parseInt(val, 10); },\n      is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },\n      pattern: /\\d+/\n    },\n    bool: {\n      encode: function(val) { return val ? 1 : 0; },\n      decode: function(val) { return parseInt(val, 10) !== 0; },\n      is: function(val) { return val === true || val === false; },\n      pattern: /0|1/\n    },\n    date: {\n      encode: function (val) {\n        if (!this.is(val))\n          return undefined;\n        return [ val.getFullYear(),\n          ('0' + (val.getMonth() + 1)).slice(-2),\n          ('0' + val.getDate()).slice(-2)\n        ].join(\"-\");\n      },\n      decode: function (val) {\n        if (this.is(val)) return val;\n        var match = this.capture.exec(val);\n        return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n      },\n      is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n      equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n      pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n      capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n    },\n    json: {\n      encode: angular.toJson,\n      decode: angular.fromJson,\n      is: angular.isObject,\n      equals: angular.equals,\n      pattern: /[^/]*/\n    },\n    any: { // does not encode/decode\n      encode: angular.identity,\n      decode: angular.identity,\n      is: angular.identity,\n      equals: angular.equals,\n      pattern: /.*/\n    }\n  };\n\n  function getDefaultConfig() {\n    return {\n      strict: isStrictMode,\n      caseInsensitive: isCaseInsensitive\n    };\n  }\n\n  function isInjectable(value) {\n    return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n  }\n\n  /**\n   * [Internal] Get the default value of a parameter, which may be an injectable function.\n   */\n  $UrlMatcherFactory.$$getDefaultValue = function(config) {\n    if (!isInjectable(config.value)) return config.value;\n    if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n    return injector.invoke(config.value);\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URL matching should be case sensitive (the default behavior), or not.\n   *\n   * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n   * @returns {boolean} the current value of caseInsensitive\n   */\n  this.caseInsensitive = function(value) {\n    if (isDefined(value))\n      isCaseInsensitive = value;\n    return isCaseInsensitive;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#strictMode\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URLs should match trailing slashes, or not (the default behavior).\n   *\n   * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n   * @returns {boolean} the current value of strictMode\n   */\n  this.strictMode = function(value) {\n    if (isDefined(value))\n      isStrictMode = value;\n    return isStrictMode;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Sets the default behavior when generating or matching URLs with default parameter values.\n   *\n   * @param {string} value A string that defines the default parameter URL squashing behavior.\n   *    `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n   *    `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n   *             parameter is surrounded by slashes, squash (remove) one slash from the URL\n   *    any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n   *             the parameter value from the URL and replace it with this string.\n   */\n  this.defaultSquashPolicy = function(value) {\n    if (!isDefined(value)) return defaultSquashPolicy;\n    if (value !== true && value !== false && !isString(value))\n      throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n    defaultSquashPolicy = value;\n    return value;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#compile\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n   *\n   * @param {string} pattern  The URL pattern.\n   * @param {Object} config  The config object hash.\n   * @returns {UrlMatcher}  The UrlMatcher.\n   */\n  this.compile = function (pattern, config) {\n    return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#isMatcher\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n   *\n   * @param {Object} object  The object to perform the type check against.\n   * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by\n   *          implementing all the same methods.\n   */\n  this.isMatcher = function (o) {\n    if (!isObject(o)) return false;\n    var result = true;\n\n    forEach(UrlMatcher.prototype, function(val, name) {\n      if (isFunction(val)) {\n        result = result && (isDefined(o[name]) && isFunction(o[name]));\n      }\n    });\n    return result;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#type\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n   * generate URLs with typed parameters.\n   *\n   * @param {string} name  The type name.\n   * @param {Object|Function} definition   The type definition. See\n   *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n   *        runtime starts.  The result of this function is merged into the existing `definition`.\n   *        See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   *\n   * @returns {Object}  Returns `$urlMatcherFactoryProvider`.\n   *\n   * @example\n   * This is a simple example of a custom type that encodes and decodes items from an\n   * array, using the array index as the URL-encoded value:\n   *\n   * <pre>\n   * var list = ['John', 'Paul', 'George', 'Ringo'];\n   *\n   * $urlMatcherFactoryProvider.type('listItem', {\n   *   encode: function(item) {\n   *     // Represent the list item in the URL using its corresponding index\n   *     return list.indexOf(item);\n   *   },\n   *   decode: function(item) {\n   *     // Look up the list item by index\n   *     return list[parseInt(item, 10)];\n   *   },\n   *   is: function(item) {\n   *     // Ensure the item is valid by checking to see that it appears\n   *     // in the list\n   *     return list.indexOf(item) > -1;\n   *   }\n   * });\n   *\n   * $stateProvider.state('list', {\n   *   url: \"/list/{item:listItem}\",\n   *   controller: function($scope, $stateParams) {\n   *     console.log($stateParams.item);\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * // Changes URL to '/list/3', logs \"Ringo\" to the console\n   * $state.go('list', { item: \"Ringo\" });\n   * </pre>\n   *\n   * This is a more complex example of a type that relies on dependency injection to\n   * interact with services, and uses the parameter name from the URL to infer how to\n   * handle encoding and decoding parameter values:\n   *\n   * <pre>\n   * // Defines a custom type that gets a value from a service,\n   * // where each service gets different types of values from\n   * // a backend API:\n   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n   *\n   *   // Matches up services to URL parameter names\n   *   var services = {\n   *     user: Users,\n   *     post: Posts\n   *   };\n   *\n   *   return {\n   *     encode: function(object) {\n   *       // Represent the object in the URL using its unique ID\n   *       return object.id;\n   *     },\n   *     decode: function(value, key) {\n   *       // Look up the object by ID, using the parameter\n   *       // name (key) to call the correct service\n   *       return services[key].findById(value);\n   *     },\n   *     is: function(object, key) {\n   *       // Check that object is a valid dbObject\n   *       return angular.isObject(object) && object.id && services[key];\n   *     }\n   *     equals: function(a, b) {\n   *       // Check the equality of decoded objects by comparing\n   *       // their unique IDs\n   *       return a.id === b.id;\n   *     }\n   *   };\n   * });\n   *\n   * // In a config() block, you can then attach URLs with\n   * // type-annotated parameters:\n   * $stateProvider.state('users', {\n   *   url: \"/users\",\n   *   // ...\n   * }).state('users.item', {\n   *   url: \"/{user:dbObject}\",\n   *   controller: function($scope, $stateParams) {\n   *     // $stateParams.user will now be an object returned from\n   *     // the Users service\n   *   },\n   *   // ...\n   * });\n   * </pre>\n   */\n  this.type = function (name, definition, definitionFn) {\n    if (!isDefined(definition)) return $types[name];\n    if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\n    $types[name] = new Type(extend({ name: name }, definition));\n    if (definitionFn) {\n      typeQueue.push({ name: name, def: definitionFn });\n      if (!enqueue) flushTypeQueue();\n    }\n    return this;\n  };\n\n  // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n  function flushTypeQueue() {\n    while(typeQueue.length) {\n      var type = typeQueue.shift();\n      if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n      angular.extend($types[type.name], injector.invoke(type.def));\n    }\n  }\n\n  // Register default types. Store them in the prototype of $types.\n  forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n  $types = inherit($types, {});\n\n  /* No need to document $get, since it returns this */\n  this.$get = ['$injector', function ($injector) {\n    injector = $injector;\n    enqueue = false;\n    flushTypeQueue();\n\n    forEach(defaultTypes, function(type, name) {\n      if (!$types[name]) $types[name] = new Type(type);\n    });\n    return this;\n  }];\n\n  this.Param = function Param(id, type, config, location) {\n    var self = this;\n    config = unwrapShorthand(config);\n    type = getType(config, type, location);\n    var arrayMode = getArrayMode();\n    type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n    if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n      config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n    var isOptional = config.value !== undefined;\n    var squash = getSquashPolicy(config, isOptional);\n    var replace = getReplace(config, arrayMode, isOptional, squash);\n\n    function unwrapShorthand(config) {\n      var keys = isObject(config) ? objectKeys(config) : [];\n      var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n                        indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n      if (isShorthand) config = { value: config };\n      config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n      return config;\n    }\n\n    function getType(config, urlType, location) {\n      if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n      if (urlType) return urlType;\n      if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n      return config.type instanceof Type ? config.type : new Type(config.type);\n    }\n\n    // array config: param name (param[]) overrides default settings.  explicit config overrides param name.\n    function getArrayMode() {\n      var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n      var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n      return extend(arrayDefaults, arrayParamNomenclature, config).array;\n    }\n\n    /**\n     * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n     */\n    function getSquashPolicy(config, isOptional) {\n      var squash = config.squash;\n      if (!isOptional || squash === false) return false;\n      if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n      if (squash === true || isString(squash)) return squash;\n      throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n    }\n\n    function getReplace(config, arrayMode, isOptional, squash) {\n      var replace, configuredKeys, defaultPolicy = [\n        { from: \"\",   to: (isOptional || arrayMode ? undefined : \"\") },\n        { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n      ];\n      replace = isArray(config.replace) ? config.replace : [];\n      if (isString(squash))\n        replace.push({ from: squash, to: undefined });\n      configuredKeys = map(replace, function(item) { return item.from; } );\n      return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n    }\n\n    /**\n     * [Internal] Get the default value of a parameter, which may be an injectable function.\n     */\n    function $$getDefaultValue() {\n      if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n      return injector.invoke(config.$$fn);\n    }\n\n    /**\n     * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n     * default value, which may be the result of an injectable function.\n     */\n    function $value(value) {\n      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n      function $replace(value) {\n        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n        return replacement.length ? replacement[0] : value;\n      }\n      value = $replace(value);\n      return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n    }\n\n    function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\n    extend(this, {\n      id: id,\n      type: type,\n      location: location,\n      array: arrayMode,\n      squash: squash,\n      replace: replace,\n      isOptional: isOptional,\n      value: $value,\n      dynamic: undefined,\n      config: config,\n      toString: toString\n    });\n  };\n\n  function ParamSet(params) {\n    extend(this, params || {});\n  }\n\n  ParamSet.prototype = {\n    $$new: function() {\n      return inherit(this, extend(new ParamSet(), { $$parent: this}));\n    },\n    $$keys: function () {\n      var keys = [], chain = [], parent = this,\n        ignore = objectKeys(ParamSet.prototype);\n      while (parent) { chain.push(parent); parent = parent.$$parent; }\n      chain.reverse();\n      forEach(chain, function(paramset) {\n        forEach(objectKeys(paramset), function(key) {\n            if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n        });\n      });\n      return keys;\n    },\n    $$values: function(paramValues) {\n      var values = {}, self = this;\n      forEach(self.$$keys(), function(key) {\n        values[key] = self[key].value(paramValues && paramValues[key]);\n      });\n      return values;\n    },\n    $$equals: function(paramValues1, paramValues2) {\n      var equal = true, self = this;\n      forEach(self.$$keys(), function(key) {\n        var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n        if (!self[key].type.equals(left, right)) equal = false;\n      });\n      return equal;\n    },\n    $$validates: function $$validate(paramValues) {\n      var result = true, isOptional, val, param, self = this;\n\n      forEach(this.$$keys(), function(key) {\n        param = self[key];\n        val = paramValues[key];\n        isOptional = !val && param.isOptional;\n        result = result && (isOptional || !!param.type.is(val));\n      });\n      return result;\n    },\n    $$parent: undefined\n  };\n\n  this.ParamSet = ParamSet;\n}\n\n// Register as a provider so it's available to other providers\nangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\nangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/urlRouter.js",
    "content": "/**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider\n *\n * @requires ui.router.util.$urlMatcherFactoryProvider\n * @requires $locationProvider\n *\n * @description\n * `$urlRouterProvider` has the responsibility of watching `$location`. \n * When `$location` changes it runs through a list of rules one by one until a \n * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n *\n * There are several methods on `$urlRouterProvider` that make it useful to use directly\n * in your module config.\n */\n$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\nfunction $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {\n  var rules = [], otherwise = null, interceptDeferred = false, listener;\n\n  // Returns a string that is a prefix of all strings matching the RegExp\n  function regExpPrefix(re) {\n    var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n    return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n  }\n\n  // Interpolates matched values into a String.replace()-style pattern\n  function interpolate(pattern, match) {\n    return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n      return match[what === '$' ? 0 : Number(what)];\n    });\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#rule\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines rules that are used by `$urlRouterProvider` to find matches for\n   * specific URLs.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // Here's an example of how you might allow case insensitive urls\n   *   $urlRouterProvider.rule(function ($injector, $location) {\n   *     var path = $location.path(),\n   *         normalized = path.toLowerCase();\n   *\n   *     if (path !== normalized) {\n   *       return normalized;\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {object} rule Handler function that takes `$injector` and `$location`\n   * services as arguments. You can use them to return a valid path as a string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.rule = function (rule) {\n    if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    rules.push(rule);\n    return this;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouterProvider#otherwise\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines a path that is used when an invalid route is requested.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // if the path doesn't match any of the urls you configured\n   *   // otherwise will take care of routing the user to the\n   *   // specified url\n   *   $urlRouterProvider.otherwise('/index');\n   *\n   *   // Example of using function rule as param\n   *   $urlRouterProvider.otherwise(function ($injector, $location) {\n   *     return '/a/valid/url';\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} rule The url path you want to redirect to or a function \n   * rule that returns the url path. The function version is passed two params: \n   * `$injector` and `$location` services, and must return a url string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.otherwise = function (rule) {\n    if (isString(rule)) {\n      var redirect = rule;\n      rule = function () { return redirect; };\n    }\n    else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    otherwise = rule;\n    return this;\n  };\n\n\n  function handleIfMatch($injector, handler, match) {\n    if (!match) return false;\n    var result = $injector.invoke(handler, handler, { $match: match });\n    return isDefined(result) ? result : true;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#when\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Registers a handler for a given url matching. if handle is a string, it is\n   * treated as a redirect, and is interpolated according to the syntax of match\n   * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n   *\n   * If the handler is a function, it is injectable. It gets invoked if `$location`\n   * matches. You have the option of inject the match object as `$match`.\n   *\n   * The handler can return\n   *\n   * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n   *   will continue trying to find another one that matches.\n   * - **string** which is treated as a redirect and passed to `$location.url()`\n   * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n   *     if ($state.$current.navigable !== state ||\n   *         !equalForKeys($match, $stateParams) {\n   *      $state.transitionTo(state, $match, false);\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} what The incoming path that you want to redirect.\n   * @param {string|object} handler The path you want to redirect your user to.\n   */\n  this.when = function (what, handler) {\n    var redirect, handlerIsString = isString(handler);\n    if (isString(what)) what = $urlMatcherFactory.compile(what);\n\n    if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n      throw new Error(\"invalid 'handler' in when()\");\n\n    var strategies = {\n      matcher: function (what, handler) {\n        if (handlerIsString) {\n          redirect = $urlMatcherFactory.compile(handler);\n          handler = ['$match', function ($match) { return redirect.format($match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n        }, {\n          prefix: isString(what.prefix) ? what.prefix : ''\n        });\n      },\n      regex: function (what, handler) {\n        if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\n        if (handlerIsString) {\n          redirect = handler;\n          handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path()));\n        }, {\n          prefix: regExpPrefix(what)\n        });\n      }\n    };\n\n    var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\n    for (var n in check) {\n      if (check[n]) return this.rule(strategies[n](what, handler));\n    }\n\n    throw new Error(\"invalid 'what' in when()\");\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#deferIntercept\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Disables (or enables) deferring location change interception.\n   *\n   * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n   * defer a transition but maintain the current URL), call this method at configuration time.\n   * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n   * `$locationChangeSuccess` event handler.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *\n   *   // Prevent $urlRouter from automatically intercepting URL changes;\n   *   // this allows you to configure custom behavior in between\n   *   // location changes and route synchronization:\n   *   $urlRouterProvider.deferIntercept();\n   *\n   * }).run(function ($rootScope, $urlRouter, UserService) {\n   *\n   *   $rootScope.$on('$locationChangeSuccess', function(e) {\n   *     // UserService is an example service for managing user state\n   *     if (UserService.isLoggedIn()) return;\n   *\n   *     // Prevent $urlRouter's default handler from firing\n   *     e.preventDefault();\n   *\n   *     UserService.handleLogin().then(function() {\n   *       // Once the user has logged in, sync the current URL\n   *       // to the router:\n   *       $urlRouter.sync();\n   *     });\n   *   });\n   *\n   *   // Configures $urlRouter's listener *after* your custom listener\n   *   $urlRouter.listen();\n   * });\n   * </pre>\n   *\n   * @param {boolean} defer Indicates whether to defer location change interception. Passing\n            no parameter is equivalent to `true`.\n   */\n  this.deferIntercept = function (defer) {\n    if (defer === undefined) defer = true;\n    interceptDeferred = defer;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouter\n   *\n   * @requires $location\n   * @requires $rootScope\n   * @requires $injector\n   * @requires $browser\n   *\n   * @description\n   *\n   */\n  this.$get = $get;\n  $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];\n  function $get(   $location,   $rootScope,   $injector,   $browser) {\n\n    var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\n    function appendBasePath(url, isHtml5, absolute) {\n      if (baseHref === '/') return url;\n      if (isHtml5) return baseHref.slice(0, -1) + url;\n      if (absolute) return baseHref.slice(1) + url;\n      return url;\n    }\n\n    // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n    function update(evt) {\n      if (evt && evt.defaultPrevented) return;\n      var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n      lastPushedUrl = undefined;\n      if (ignoreUpdate) return true;\n\n      function check(rule) {\n        var handled = rule($injector, $location);\n\n        if (!handled) return false;\n        if (isString(handled)) $location.replace().url(handled);\n        return true;\n      }\n      var n = rules.length, i;\n\n      for (i = 0; i < n; i++) {\n        if (check(rules[i])) return;\n      }\n      // always check otherwise last to allow dynamic updates to the set of rules\n      if (otherwise) check(otherwise);\n    }\n\n    function listen() {\n      listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n      return listener;\n    }\n\n    if (!interceptDeferred) listen();\n\n    return {\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#sync\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n       * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n       * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n       * with the transition by calling `$urlRouter.sync()`.\n       *\n       * @example\n       * <pre>\n       * angular.module('app', ['ui.router'])\n       *   .run(function($rootScope, $urlRouter) {\n       *     $rootScope.$on('$locationChangeSuccess', function(evt) {\n       *       // Halt state change from even starting\n       *       evt.preventDefault();\n       *       // Perform custom logic\n       *       var meetsRequirement = ...\n       *       // Continue with the update and state transition if logic allows\n       *       if (meetsRequirement) $urlRouter.sync();\n       *     });\n       * });\n       * </pre>\n       */\n      sync: function() {\n        update();\n      },\n\n      listen: function() {\n        return listen();\n      },\n\n      update: function(read) {\n        if (read) {\n          location = $location.url();\n          return;\n        }\n        if ($location.url() === location) return;\n\n        $location.url(location);\n        $location.replace();\n      },\n\n      push: function(urlMatcher, params, options) {\n        $location.url(urlMatcher.format(params || {}));\n        lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n        if (options && options.replace) $location.replace();\n      },\n\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#href\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * A URL generation method that returns the compiled URL for a given\n       * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n       *\n       * @example\n       * <pre>\n       * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n       *   person: \"bob\"\n       * });\n       * // $bob == \"/about/bob\";\n       * </pre>\n       *\n       * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n       * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n       * @param {object=} options Options object. The options are:\n       *\n       * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n       *\n       * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n       */\n      href: function(urlMatcher, params, options) {\n        if (!urlMatcher.validates(params)) return null;\n\n        var isHtml5 = $locationProvider.html5Mode();\n        if (angular.isObject(isHtml5)) {\n          isHtml5 = isHtml5.enabled;\n        }\n        \n        var url = urlMatcher.format(params);\n        options = options || {};\n\n        if (!isHtml5 && url !== null) {\n          url = \"#\" + $locationProvider.hashPrefix() + url;\n        }\n        url = appendBasePath(url, isHtml5, options.absolute);\n\n        if (!options.absolute || !url) {\n          return url;\n        }\n\n        var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n        port = (port === 80 || port === 443 ? '' : ':' + port);\n\n        return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n      }\n    };\n  }\n}\n\nangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/view.js",
    "content": "\n$ViewProvider.$inject = [];\nfunction $ViewProvider() {\n\n  this.$get = $get;\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$view\n   *\n   * @requires ui.router.util.$templateFactory\n   * @requires $rootScope\n   *\n   * @description\n   *\n   */\n  $get.$inject = ['$rootScope', '$templateFactory'];\n  function $get(   $rootScope,   $templateFactory) {\n    return {\n      // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })\n      /**\n       * @ngdoc function\n       * @name ui.router.state.$view#load\n       * @methodOf ui.router.state.$view\n       *\n       * @description\n       *\n       * @param {string} name name\n       * @param {object} options option object.\n       */\n      load: function load(name, options) {\n        var result, defaults = {\n          template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}\n        };\n        options = extend(defaults, options);\n\n        if (options.view) {\n          result = $templateFactory.fromConfig(options.view, options.params, options.locals);\n        }\n        if (result && options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$viewContentLoading\n         * @eventOf ui.router.state.$view\n         * @eventType broadcast on root scope\n         * @description\n         *\n         * Fired once the view **begins loading**, *before* the DOM is rendered.\n         *\n         * @param {Object} event Event object.\n         * @param {Object} viewConfig The view config properties (template, controller, etc).\n         *\n         * @example\n         *\n         * <pre>\n         * $scope.$on('$viewContentLoading',\n         * function(event, viewConfig){\n         *     // Access to all the view config properties.\n         *     // and one special property 'targetView'\n         *     // viewConfig.targetView\n         * });\n         * </pre>\n         */\n          $rootScope.$broadcast('$viewContentLoading', options);\n        }\n        return result;\n      }\n    };\n  }\n}\n\nangular.module('ui.router.state').provider('$view', $ViewProvider);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/viewDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-view\n *\n * @requires ui.router.state.$state\n * @requires $compile\n * @requires $controller\n * @requires $injector\n * @requires ui.router.state.$uiViewScroll\n * @requires $document\n *\n * @restrict ECA\n *\n * @description\n * The ui-view directive tells $state where to place your templates.\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states.\n *\n * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window\n * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll\n * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you\n * scroll ui-view elements into view when they are populated during a state activation.\n *\n * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*\n *\n * @param {string=} onload Expression to evaluate whenever the view updates.\n * \n * @example\n * A view can be unnamed or named. \n * <pre>\n * <!-- Unnamed -->\n * <div ui-view></div> \n * \n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n * </pre>\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a \n * single view and it is unnamed then you can populate it like so:\n * <pre>\n * <div ui-view></div> \n * $stateProvider.state(\"home\", {\n *   template: \"<h1>HELLO!</h1>\"\n * })\n * </pre>\n * \n * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}\n * config property, by name, in this case an empty name:\n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * But typically you'll only use the views property if you name your view or have more than one view \n * in the same template. There's not really a compelling reason to name a view if its the only one, \n * but you could if you wanted, like so:\n * <pre>\n * <div ui-view=\"main\"></div>\n * </pre> \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"main\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * Really though, you'll use views to set up multiple views:\n * <pre>\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div> \n * <div ui-view=\"data\"></div> \n * </pre>\n * \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     },\n *     \"chart\": {\n *       template: \"<chart_thing/>\"\n *     },\n *     \"data\": {\n *       template: \"<data_thing/>\"\n *     }\n *   }    \n * })\n * </pre>\n *\n * Examples for `autoscroll`:\n *\n * <pre>\n * <!-- If autoscroll present with no expression,\n *      then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n *      then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * </pre>\n */\n$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];\nfunction $ViewDirective(   $state,   $injector,   $uiViewScroll,   $interpolate) {\n\n  function getService() {\n    return ($injector.has) ? function(service) {\n      return $injector.has(service) ? $injector.get(service) : null;\n    } : function(service) {\n      try {\n        return $injector.get(service);\n      } catch (e) {\n        return null;\n      }\n    };\n  }\n\n  var service = getService(),\n      $animator = service('$animator'),\n      $animate = service('$animate');\n\n  // Returns a set of DOM manipulation functions based on which Angular version\n  // it should use\n  function getRenderer(attrs, scope) {\n    var statics = function() {\n      return {\n        enter: function (element, target, cb) { target.after(element); cb(); },\n        leave: function (element, cb) { element.remove(); cb(); }\n      };\n    };\n\n    if ($animate) {\n      return {\n        enter: function(element, target, cb) {\n          var promise = $animate.enter(element, null, target, cb);\n          if (promise && promise.then) promise.then(cb);\n        },\n        leave: function(element, cb) {\n          var promise = $animate.leave(element, cb);\n          if (promise && promise.then) promise.then(cb);\n        }\n      };\n    }\n\n    if ($animator) {\n      var animate = $animator && $animator(scope, attrs);\n\n      return {\n        enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n        leave: function(element, cb) { animate.leave(element); cb(); }\n      };\n    }\n\n    return statics();\n  }\n\n  var directive = {\n    restrict: 'ECA',\n    terminal: true,\n    priority: 400,\n    transclude: 'element',\n    compile: function (tElement, tAttrs, $transclude) {\n      return function (scope, $element, attrs) {\n        var previousEl, currentEl, currentScope, latestLocals,\n            onloadExp     = attrs.onload || '',\n            autoScrollExp = attrs.autoscroll,\n            renderer      = getRenderer(attrs, scope);\n\n        scope.$on('$stateChangeSuccess', function() {\n          updateView(false);\n        });\n        scope.$on('$viewContentLoading', function() {\n          updateView(false);\n        });\n\n        updateView(true);\n\n        function cleanupLastView() {\n          if (previousEl) {\n            previousEl.remove();\n            previousEl = null;\n          }\n\n          if (currentScope) {\n            currentScope.$destroy();\n            currentScope = null;\n          }\n\n          if (currentEl) {\n            renderer.leave(currentEl, function() {\n              previousEl = null;\n            });\n\n            previousEl = currentEl;\n            currentEl = null;\n          }\n        }\n\n        function updateView(firstTime) {\n          var newScope,\n              name            = getUiViewName(scope, attrs, $element, $interpolate),\n              previousLocals  = name && $state.$current && $state.$current.locals[name];\n\n          if (!firstTime && previousLocals === latestLocals) return; // nothing to do\n          newScope = scope.$new();\n          latestLocals = $state.$current.locals[name];\n\n          var clone = $transclude(newScope, function(clone) {\n            renderer.enter(clone, $element, function onUiViewEnter() {\n              if(currentScope) {\n                currentScope.$emit('$viewContentAnimationEnded');\n              }\n\n              if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n                $uiViewScroll(clone);\n              }\n            });\n            cleanupLastView();\n          });\n\n          currentEl = clone;\n          currentScope = newScope;\n          /**\n           * @ngdoc event\n           * @name ui.router.state.directive:ui-view#$viewContentLoaded\n           * @eventOf ui.router.state.directive:ui-view\n           * @eventType emits on ui-view directive scope\n           * @description           *\n           * Fired once the view is **loaded**, *after* the DOM is rendered.\n           *\n           * @param {Object} event Event object.\n           */\n          currentScope.$emit('$viewContentLoaded');\n          currentScope.$eval(onloadExp);\n        }\n      };\n    }\n  };\n\n  return directive;\n}\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\nfunction $ViewDirectiveFill (  $compile,   $controller,   $state,   $interpolate) {\n  return {\n    restrict: 'ECA',\n    priority: -400,\n    compile: function (tElement) {\n      var initial = tElement.html();\n      return function (scope, $element, attrs) {\n        var current = $state.$current,\n            name = getUiViewName(scope, attrs, $element, $interpolate),\n            locals  = current && current.locals[name];\n\n        if (! locals) {\n          return;\n        }\n\n        $element.data('$uiView', { name: name, state: locals.$$state });\n        $element.html(locals.$template ? locals.$template : initial);\n\n        var link = $compile($element.contents());\n\n        if (locals.$$controller) {\n          locals.$scope = scope;\n          var controller = $controller(locals.$$controller, locals);\n          if (locals.$$controllerAs) {\n            scope[locals.$$controllerAs] = controller;\n          }\n          $element.data('$ngControllerController', controller);\n          $element.children().data('$ngControllerController', controller);\n        }\n\n        link(scope);\n      };\n    }\n  };\n}\n\n/**\n * Shared ui-view code for both directives:\n * Given scope, element, and its attributes, return the view's name\n */\nfunction getUiViewName(scope, attrs, element, $interpolate) {\n  var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n  var inherited = element.inheritedData('$uiView');\n  return name.indexOf('@') >= 0 ?  name :  (name + '@' + (inherited ? inherited.state.name : ''));\n}\n\nangular.module('ui.router.state').directive('uiView', $ViewDirective);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n"
  },
  {
    "path": "www/lib/angular-ui-router/src/viewScroll.js",
    "content": "/**\n * @ngdoc object\n * @name ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.\n */\nfunction $ViewScrollProvider() {\n\n  var useAnchorScroll = false;\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll\n   * @methodOf ui.router.state.$uiViewScrollProvider\n   *\n   * @description\n   * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for\n   * scrolling based on the url anchor.\n   */\n  this.useAnchorScroll = function () {\n    useAnchorScroll = true;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$uiViewScroll\n   *\n   * @requires $anchorScroll\n   * @requires $timeout\n   *\n   * @description\n   * When called with a jqLite element, it scrolls the element into view (after a\n   * `$timeout` so the DOM has time to refresh).\n   *\n   * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n   * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.\n   */\n  this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n    if (useAnchorScroll) {\n      return $anchorScroll;\n    }\n\n    return function ($element) {\n      $timeout(function () {\n        $element[0].scrollIntoView();\n      }, 0, false);\n    };\n  }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n"
  },
  {
    "path": "www/lib/ionic/.bower.json",
    "content": "{\n  \"name\": \"ionic\",\n  \"version\": \"1.0.0\",\n  \"codename\": \"uranium-unicorn\",\n  \"homepage\": \"https://github.com/driftyco/ionic\",\n  \"authors\": [\n    \"Max Lynch <max@drifty.com>\",\n    \"Adam Bradley <adam@drifty.com>\",\n    \"Ben Sperry <ben@drifty.com>\"\n  ],\n  \"description\": \"Advanced HTML5 hybrid mobile app development framework.\",\n  \"main\": [\n    \"css/ionic.css\",\n    \"fonts/*\",\n    \"js/ionic.js\",\n    \"js/ionic-angular.js\"\n  ],\n  \"keywords\": [\n    \"mobile\",\n    \"html5\",\n    \"ionic\",\n    \"cordova\",\n    \"phonegap\",\n    \"trigger\",\n    \"triggerio\",\n    \"angularjs\",\n    \"angular\"\n  ],\n  \"license\": \"MIT\",\n  \"private\": false,\n  \"dependencies\": {\n    \"angular\": \"1.3.13\",\n    \"angular-animate\": \"1.3.13\",\n    \"angular-sanitize\": \"1.3.13\",\n    \"angular-ui-router\": \"0.2.13\"\n  },\n  \"_release\": \"1.0.0\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v1.0.0\",\n    \"commit\": \"3ea71d863e53b7a8d3d75a2757386fd7124b0653\"\n  },\n  \"_source\": \"git://github.com/driftyco/ionic-bower.git\",\n  \"_target\": \"1.0.0\",\n  \"_originalSource\": \"driftyco/ionic-bower\"\n}"
  },
  {
    "path": "www/lib/ionic/README.md",
    "content": "# ionic-bower\n\nBower repository for [Ionic Framework](http://github.com/driftyco/ionic)\n\n### Usage\n\nInclude `js/ionic.bundle.js` to get ionic and all of its dependencies.\n\nAlternatively, include the individual ionic files with the dependencies separately.\n\n### Versions\n\nTo install the latest stable version, `bower install driftyco/ionic-bower#v1.0.0-beta.13`\n\nTo install the latest nightly release, `bower install driftyco/ionic-bower#master`\n"
  },
  {
    "path": "www/lib/ionic/bower.json",
    "content": "{\n  \"name\": \"ionic\",\n  \"version\": \"1.0.0\",\n  \"codename\": \"uranium-unicorn\",\n  \"homepage\": \"https://github.com/driftyco/ionic\",\n  \"authors\": [\n    \"Max Lynch <max@drifty.com>\",\n    \"Adam Bradley <adam@drifty.com>\",\n    \"Ben Sperry <ben@drifty.com>\"\n  ],\n  \"description\": \"Advanced HTML5 hybrid mobile app development framework.\",\n  \"main\": [\n    \"css/ionic.css\",\n    \"fonts/*\",\n    \"js/ionic.js\",\n    \"js/ionic-angular.js\"\n  ],\n  \"keywords\": [\n    \"mobile\",\n    \"html5\",\n    \"ionic\",\n    \"cordova\",\n    \"phonegap\",\n    \"trigger\",\n    \"triggerio\",\n    \"angularjs\",\n    \"angular\"\n  ],\n  \"license\": \"MIT\",\n  \"private\": false,\n  \"dependencies\": {\n    \"angular\": \"1.3.13\",\n    \"angular-animate\": \"1.3.13\",\n    \"angular-sanitize\": \"1.3.13\",\n    \"angular-ui-router\": \"0.2.13\"\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/css/ionic.css",
    "content": "/*!\n * Copyright 2014 Drifty Co.\n * http://drifty.com/\n *\n * Ionic, v1.0.0\n * A powerful HTML5 mobile app framework.\n * http://ionicframework.com/\n *\n * By @maxlynch, @benjsperry, @adamdbradley <3\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n/*!\n  Ionicons, v2.0.1\n  Created by Ben Sperry for the Ionic Framework, http://ionicons.com/\n  https://twitter.com/benjsperry  https://twitter.com/ionicframework\n  MIT License: https://github.com/driftyco/ionicons\n\n  Android-style icons originally built by Google’s\n  Material Design Icons: https://github.com/google/material-design-icons\n  used under CC BY http://creativecommons.org/licenses/by/4.0/\n  Modified icons to fit ionicon’s grid from original.\n*/\n@font-face {\n  font-family: \"Ionicons\";\n  src: url(\"../fonts/ionicons.eot?v=2.0.1\");\n  src: url(\"../fonts/ionicons.eot?v=2.0.1#iefix\") format(\"embedded-opentype\"), url(\"../fonts/ionicons.ttf?v=2.0.1\") format(\"truetype\"), url(\"../fonts/ionicons.woff?v=2.0.1\") format(\"woff\"), url(\"../fonts/ionicons.woff\") format(\"woff\"), url(\"../fonts/ionicons.svg?v=2.0.1#Ionicons\") format(\"svg\");\n  font-weight: normal;\n  font-style: normal; }\n\n.ion, .ionicons, .ion-alert:before, .ion-alert-circled:before, .ion-android-add:before, .ion-android-add-circle:before, .ion-android-alarm-clock:before, .ion-android-alert:before, .ion-android-apps:before, .ion-android-archive:before, .ion-android-arrow-back:before, .ion-android-arrow-down:before, .ion-android-arrow-dropdown:before, .ion-android-arrow-dropdown-circle:before, .ion-android-arrow-dropleft:before, .ion-android-arrow-dropleft-circle:before, .ion-android-arrow-dropright:before, .ion-android-arrow-dropright-circle:before, .ion-android-arrow-dropup:before, .ion-android-arrow-dropup-circle:before, .ion-android-arrow-forward:before, .ion-android-arrow-up:before, .ion-android-attach:before, .ion-android-bar:before, .ion-android-bicycle:before, .ion-android-boat:before, .ion-android-bookmark:before, .ion-android-bulb:before, .ion-android-bus:before, .ion-android-calendar:before, .ion-android-call:before, .ion-android-camera:before, .ion-android-cancel:before, .ion-android-car:before, .ion-android-cart:before, .ion-android-chat:before, .ion-android-checkbox:before, .ion-android-checkbox-blank:before, .ion-android-checkbox-outline:before, .ion-android-checkbox-outline-blank:before, .ion-android-checkmark-circle:before, .ion-android-clipboard:before, .ion-android-close:before, .ion-android-cloud:before, .ion-android-cloud-circle:before, .ion-android-cloud-done:before, .ion-android-cloud-outline:before, .ion-android-color-palette:before, .ion-android-compass:before, .ion-android-contact:before, .ion-android-contacts:before, .ion-android-contract:before, .ion-android-create:before, .ion-android-delete:before, .ion-android-desktop:before, .ion-android-document:before, .ion-android-done:before, .ion-android-done-all:before, .ion-android-download:before, .ion-android-drafts:before, .ion-android-exit:before, .ion-android-expand:before, .ion-android-favorite:before, .ion-android-favorite-outline:before, .ion-android-film:before, .ion-android-folder:before, .ion-android-folder-open:before, .ion-android-funnel:before, .ion-android-globe:before, .ion-android-hand:before, .ion-android-hangout:before, .ion-android-happy:before, .ion-android-home:before, .ion-android-image:before, .ion-android-laptop:before, .ion-android-list:before, .ion-android-locate:before, .ion-android-lock:before, .ion-android-mail:before, .ion-android-map:before, .ion-android-menu:before, .ion-android-microphone:before, .ion-android-microphone-off:before, .ion-android-more-horizontal:before, .ion-android-more-vertical:before, .ion-android-navigate:before, .ion-android-notifications:before, .ion-android-notifications-none:before, .ion-android-notifications-off:before, .ion-android-open:before, .ion-android-options:before, .ion-android-people:before, .ion-android-person:before, .ion-android-person-add:before, .ion-android-phone-landscape:before, .ion-android-phone-portrait:before, .ion-android-pin:before, .ion-android-plane:before, .ion-android-playstore:before, .ion-android-print:before, .ion-android-radio-button-off:before, .ion-android-radio-button-on:before, .ion-android-refresh:before, .ion-android-remove:before, .ion-android-remove-circle:before, .ion-android-restaurant:before, .ion-android-sad:before, .ion-android-search:before, .ion-android-send:before, .ion-android-settings:before, .ion-android-share:before, .ion-android-share-alt:before, .ion-android-star:before, .ion-android-star-half:before, .ion-android-star-outline:before, .ion-android-stopwatch:before, .ion-android-subway:before, .ion-android-sunny:before, .ion-android-sync:before, .ion-android-textsms:before, .ion-android-time:before, .ion-android-train:before, .ion-android-unlock:before, .ion-android-upload:before, .ion-android-volume-down:before, .ion-android-volume-mute:before, .ion-android-volume-off:before, .ion-android-volume-up:before, .ion-android-walk:before, .ion-android-warning:before, .ion-android-watch:before, .ion-android-wifi:before, .ion-aperture:before, .ion-archive:before, .ion-arrow-down-a:before, .ion-arrow-down-b:before, .ion-arrow-down-c:before, .ion-arrow-expand:before, .ion-arrow-graph-down-left:before, .ion-arrow-graph-down-right:before, .ion-arrow-graph-up-left:before, .ion-arrow-graph-up-right:before, .ion-arrow-left-a:before, .ion-arrow-left-b:before, .ion-arrow-left-c:before, .ion-arrow-move:before, .ion-arrow-resize:before, .ion-arrow-return-left:before, .ion-arrow-return-right:before, .ion-arrow-right-a:before, .ion-arrow-right-b:before, .ion-arrow-right-c:before, .ion-arrow-shrink:before, .ion-arrow-swap:before, .ion-arrow-up-a:before, .ion-arrow-up-b:before, .ion-arrow-up-c:before, .ion-asterisk:before, .ion-at:before, .ion-backspace:before, .ion-backspace-outline:before, .ion-bag:before, .ion-battery-charging:before, .ion-battery-empty:before, .ion-battery-full:before, .ion-battery-half:before, .ion-battery-low:before, .ion-beaker:before, .ion-beer:before, .ion-bluetooth:before, .ion-bonfire:before, .ion-bookmark:before, .ion-bowtie:before, .ion-briefcase:before, .ion-bug:before, .ion-calculator:before, .ion-calendar:before, .ion-camera:before, .ion-card:before, .ion-cash:before, .ion-chatbox:before, .ion-chatbox-working:before, .ion-chatboxes:before, .ion-chatbubble:before, .ion-chatbubble-working:before, .ion-chatbubbles:before, .ion-checkmark:before, .ion-checkmark-circled:before, .ion-checkmark-round:before, .ion-chevron-down:before, .ion-chevron-left:before, .ion-chevron-right:before, .ion-chevron-up:before, .ion-clipboard:before, .ion-clock:before, .ion-close:before, .ion-close-circled:before, .ion-close-round:before, .ion-closed-captioning:before, .ion-cloud:before, .ion-code:before, .ion-code-download:before, .ion-code-working:before, .ion-coffee:before, .ion-compass:before, .ion-compose:before, .ion-connection-bars:before, .ion-contrast:before, .ion-crop:before, .ion-cube:before, .ion-disc:before, .ion-document:before, .ion-document-text:before, .ion-drag:before, .ion-earth:before, .ion-easel:before, .ion-edit:before, .ion-egg:before, .ion-eject:before, .ion-email:before, .ion-email-unread:before, .ion-erlenmeyer-flask:before, .ion-erlenmeyer-flask-bubbles:before, .ion-eye:before, .ion-eye-disabled:before, .ion-female:before, .ion-filing:before, .ion-film-marker:before, .ion-fireball:before, .ion-flag:before, .ion-flame:before, .ion-flash:before, .ion-flash-off:before, .ion-folder:before, .ion-fork:before, .ion-fork-repo:before, .ion-forward:before, .ion-funnel:before, .ion-gear-a:before, .ion-gear-b:before, .ion-grid:before, .ion-hammer:before, .ion-happy:before, .ion-happy-outline:before, .ion-headphone:before, .ion-heart:before, .ion-heart-broken:before, .ion-help:before, .ion-help-buoy:before, .ion-help-circled:before, .ion-home:before, .ion-icecream:before, .ion-image:before, .ion-images:before, .ion-information:before, .ion-information-circled:before, .ion-ionic:before, .ion-ios-alarm:before, .ion-ios-alarm-outline:before, .ion-ios-albums:before, .ion-ios-albums-outline:before, .ion-ios-americanfootball:before, .ion-ios-americanfootball-outline:before, .ion-ios-analytics:before, .ion-ios-analytics-outline:before, .ion-ios-arrow-back:before, .ion-ios-arrow-down:before, .ion-ios-arrow-forward:before, .ion-ios-arrow-left:before, .ion-ios-arrow-right:before, .ion-ios-arrow-thin-down:before, .ion-ios-arrow-thin-left:before, .ion-ios-arrow-thin-right:before, .ion-ios-arrow-thin-up:before, .ion-ios-arrow-up:before, .ion-ios-at:before, .ion-ios-at-outline:before, .ion-ios-barcode:before, .ion-ios-barcode-outline:before, .ion-ios-baseball:before, .ion-ios-baseball-outline:before, .ion-ios-basketball:before, .ion-ios-basketball-outline:before, .ion-ios-bell:before, .ion-ios-bell-outline:before, .ion-ios-body:before, .ion-ios-body-outline:before, .ion-ios-bolt:before, .ion-ios-bolt-outline:before, .ion-ios-book:before, .ion-ios-book-outline:before, .ion-ios-bookmarks:before, .ion-ios-bookmarks-outline:before, .ion-ios-box:before, .ion-ios-box-outline:before, .ion-ios-briefcase:before, .ion-ios-briefcase-outline:before, .ion-ios-browsers:before, .ion-ios-browsers-outline:before, .ion-ios-calculator:before, .ion-ios-calculator-outline:before, .ion-ios-calendar:before, .ion-ios-calendar-outline:before, .ion-ios-camera:before, .ion-ios-camera-outline:before, .ion-ios-cart:before, .ion-ios-cart-outline:before, .ion-ios-chatboxes:before, .ion-ios-chatboxes-outline:before, .ion-ios-chatbubble:before, .ion-ios-chatbubble-outline:before, .ion-ios-checkmark:before, .ion-ios-checkmark-empty:before, .ion-ios-checkmark-outline:before, .ion-ios-circle-filled:before, .ion-ios-circle-outline:before, .ion-ios-clock:before, .ion-ios-clock-outline:before, .ion-ios-close:before, .ion-ios-close-empty:before, .ion-ios-close-outline:before, .ion-ios-cloud:before, .ion-ios-cloud-download:before, .ion-ios-cloud-download-outline:before, .ion-ios-cloud-outline:before, .ion-ios-cloud-upload:before, .ion-ios-cloud-upload-outline:before, .ion-ios-cloudy:before, .ion-ios-cloudy-night:before, .ion-ios-cloudy-night-outline:before, .ion-ios-cloudy-outline:before, .ion-ios-cog:before, .ion-ios-cog-outline:before, .ion-ios-color-filter:before, .ion-ios-color-filter-outline:before, .ion-ios-color-wand:before, .ion-ios-color-wand-outline:before, .ion-ios-compose:before, .ion-ios-compose-outline:before, .ion-ios-contact:before, .ion-ios-contact-outline:before, .ion-ios-copy:before, .ion-ios-copy-outline:before, .ion-ios-crop:before, .ion-ios-crop-strong:before, .ion-ios-download:before, .ion-ios-download-outline:before, .ion-ios-drag:before, .ion-ios-email:before, .ion-ios-email-outline:before, .ion-ios-eye:before, .ion-ios-eye-outline:before, .ion-ios-fastforward:before, .ion-ios-fastforward-outline:before, .ion-ios-filing:before, .ion-ios-filing-outline:before, .ion-ios-film:before, .ion-ios-film-outline:before, .ion-ios-flag:before, .ion-ios-flag-outline:before, .ion-ios-flame:before, .ion-ios-flame-outline:before, .ion-ios-flask:before, .ion-ios-flask-outline:before, .ion-ios-flower:before, .ion-ios-flower-outline:before, .ion-ios-folder:before, .ion-ios-folder-outline:before, .ion-ios-football:before, .ion-ios-football-outline:before, .ion-ios-game-controller-a:before, .ion-ios-game-controller-a-outline:before, .ion-ios-game-controller-b:before, .ion-ios-game-controller-b-outline:before, .ion-ios-gear:before, .ion-ios-gear-outline:before, .ion-ios-glasses:before, .ion-ios-glasses-outline:before, .ion-ios-grid-view:before, .ion-ios-grid-view-outline:before, .ion-ios-heart:before, .ion-ios-heart-outline:before, .ion-ios-help:before, .ion-ios-help-empty:before, .ion-ios-help-outline:before, .ion-ios-home:before, .ion-ios-home-outline:before, .ion-ios-infinite:before, .ion-ios-infinite-outline:before, .ion-ios-information:before, .ion-ios-information-empty:before, .ion-ios-information-outline:before, .ion-ios-ionic-outline:before, .ion-ios-keypad:before, .ion-ios-keypad-outline:before, .ion-ios-lightbulb:before, .ion-ios-lightbulb-outline:before, .ion-ios-list:before, .ion-ios-list-outline:before, .ion-ios-location:before, .ion-ios-location-outline:before, .ion-ios-locked:before, .ion-ios-locked-outline:before, .ion-ios-loop:before, .ion-ios-loop-strong:before, .ion-ios-medical:before, .ion-ios-medical-outline:before, .ion-ios-medkit:before, .ion-ios-medkit-outline:before, .ion-ios-mic:before, .ion-ios-mic-off:before, .ion-ios-mic-outline:before, .ion-ios-minus:before, .ion-ios-minus-empty:before, .ion-ios-minus-outline:before, .ion-ios-monitor:before, .ion-ios-monitor-outline:before, .ion-ios-moon:before, .ion-ios-moon-outline:before, .ion-ios-more:before, .ion-ios-more-outline:before, .ion-ios-musical-note:before, .ion-ios-musical-notes:before, .ion-ios-navigate:before, .ion-ios-navigate-outline:before, .ion-ios-nutrition:before, .ion-ios-nutrition-outline:before, .ion-ios-paper:before, .ion-ios-paper-outline:before, .ion-ios-paperplane:before, .ion-ios-paperplane-outline:before, .ion-ios-partlysunny:before, .ion-ios-partlysunny-outline:before, .ion-ios-pause:before, .ion-ios-pause-outline:before, .ion-ios-paw:before, .ion-ios-paw-outline:before, .ion-ios-people:before, .ion-ios-people-outline:before, .ion-ios-person:before, .ion-ios-person-outline:before, .ion-ios-personadd:before, .ion-ios-personadd-outline:before, .ion-ios-photos:before, .ion-ios-photos-outline:before, .ion-ios-pie:before, .ion-ios-pie-outline:before, .ion-ios-pint:before, .ion-ios-pint-outline:before, .ion-ios-play:before, .ion-ios-play-outline:before, .ion-ios-plus:before, .ion-ios-plus-empty:before, .ion-ios-plus-outline:before, .ion-ios-pricetag:before, .ion-ios-pricetag-outline:before, .ion-ios-pricetags:before, .ion-ios-pricetags-outline:before, .ion-ios-printer:before, .ion-ios-printer-outline:before, .ion-ios-pulse:before, .ion-ios-pulse-strong:before, .ion-ios-rainy:before, .ion-ios-rainy-outline:before, .ion-ios-recording:before, .ion-ios-recording-outline:before, .ion-ios-redo:before, .ion-ios-redo-outline:before, .ion-ios-refresh:before, .ion-ios-refresh-empty:before, .ion-ios-refresh-outline:before, .ion-ios-reload:before, .ion-ios-reverse-camera:before, .ion-ios-reverse-camera-outline:before, .ion-ios-rewind:before, .ion-ios-rewind-outline:before, .ion-ios-rose:before, .ion-ios-rose-outline:before, .ion-ios-search:before, .ion-ios-search-strong:before, .ion-ios-settings:before, .ion-ios-settings-strong:before, .ion-ios-shuffle:before, .ion-ios-shuffle-strong:before, .ion-ios-skipbackward:before, .ion-ios-skipbackward-outline:before, .ion-ios-skipforward:before, .ion-ios-skipforward-outline:before, .ion-ios-snowy:before, .ion-ios-speedometer:before, .ion-ios-speedometer-outline:before, .ion-ios-star:before, .ion-ios-star-half:before, .ion-ios-star-outline:before, .ion-ios-stopwatch:before, .ion-ios-stopwatch-outline:before, .ion-ios-sunny:before, .ion-ios-sunny-outline:before, .ion-ios-telephone:before, .ion-ios-telephone-outline:before, .ion-ios-tennisball:before, .ion-ios-tennisball-outline:before, .ion-ios-thunderstorm:before, .ion-ios-thunderstorm-outline:before, .ion-ios-time:before, .ion-ios-time-outline:before, .ion-ios-timer:before, .ion-ios-timer-outline:before, .ion-ios-toggle:before, .ion-ios-toggle-outline:before, .ion-ios-trash:before, .ion-ios-trash-outline:before, .ion-ios-undo:before, .ion-ios-undo-outline:before, .ion-ios-unlocked:before, .ion-ios-unlocked-outline:before, .ion-ios-upload:before, .ion-ios-upload-outline:before, .ion-ios-videocam:before, .ion-ios-videocam-outline:before, .ion-ios-volume-high:before, .ion-ios-volume-low:before, .ion-ios-wineglass:before, .ion-ios-wineglass-outline:before, .ion-ios-world:before, .ion-ios-world-outline:before, .ion-ipad:before, .ion-iphone:before, .ion-ipod:before, .ion-jet:before, .ion-key:before, .ion-knife:before, .ion-laptop:before, .ion-leaf:before, .ion-levels:before, .ion-lightbulb:before, .ion-link:before, .ion-load-a:before, .ion-load-b:before, .ion-load-c:before, .ion-load-d:before, .ion-location:before, .ion-lock-combination:before, .ion-locked:before, .ion-log-in:before, .ion-log-out:before, .ion-loop:before, .ion-magnet:before, .ion-male:before, .ion-man:before, .ion-map:before, .ion-medkit:before, .ion-merge:before, .ion-mic-a:before, .ion-mic-b:before, .ion-mic-c:before, .ion-minus:before, .ion-minus-circled:before, .ion-minus-round:before, .ion-model-s:before, .ion-monitor:before, .ion-more:before, .ion-mouse:before, .ion-music-note:before, .ion-navicon:before, .ion-navicon-round:before, .ion-navigate:before, .ion-network:before, .ion-no-smoking:before, .ion-nuclear:before, .ion-outlet:before, .ion-paintbrush:before, .ion-paintbucket:before, .ion-paper-airplane:before, .ion-paperclip:before, .ion-pause:before, .ion-person:before, .ion-person-add:before, .ion-person-stalker:before, .ion-pie-graph:before, .ion-pin:before, .ion-pinpoint:before, .ion-pizza:before, .ion-plane:before, .ion-planet:before, .ion-play:before, .ion-playstation:before, .ion-plus:before, .ion-plus-circled:before, .ion-plus-round:before, .ion-podium:before, .ion-pound:before, .ion-power:before, .ion-pricetag:before, .ion-pricetags:before, .ion-printer:before, .ion-pull-request:before, .ion-qr-scanner:before, .ion-quote:before, .ion-radio-waves:before, .ion-record:before, .ion-refresh:before, .ion-reply:before, .ion-reply-all:before, .ion-ribbon-a:before, .ion-ribbon-b:before, .ion-sad:before, .ion-sad-outline:before, .ion-scissors:before, .ion-search:before, .ion-settings:before, .ion-share:before, .ion-shuffle:before, .ion-skip-backward:before, .ion-skip-forward:before, .ion-social-android:before, .ion-social-android-outline:before, .ion-social-angular:before, .ion-social-angular-outline:before, .ion-social-apple:before, .ion-social-apple-outline:before, .ion-social-bitcoin:before, .ion-social-bitcoin-outline:before, .ion-social-buffer:before, .ion-social-buffer-outline:before, .ion-social-chrome:before, .ion-social-chrome-outline:before, .ion-social-codepen:before, .ion-social-codepen-outline:before, .ion-social-css3:before, .ion-social-css3-outline:before, .ion-social-designernews:before, .ion-social-designernews-outline:before, .ion-social-dribbble:before, .ion-social-dribbble-outline:before, .ion-social-dropbox:before, .ion-social-dropbox-outline:before, .ion-social-euro:before, .ion-social-euro-outline:before, .ion-social-facebook:before, .ion-social-facebook-outline:before, .ion-social-foursquare:before, .ion-social-foursquare-outline:before, .ion-social-freebsd-devil:before, .ion-social-github:before, .ion-social-github-outline:before, .ion-social-google:before, .ion-social-google-outline:before, .ion-social-googleplus:before, .ion-social-googleplus-outline:before, .ion-social-hackernews:before, .ion-social-hackernews-outline:before, .ion-social-html5:before, .ion-social-html5-outline:before, .ion-social-instagram:before, .ion-social-instagram-outline:before, .ion-social-javascript:before, .ion-social-javascript-outline:before, .ion-social-linkedin:before, .ion-social-linkedin-outline:before, .ion-social-markdown:before, .ion-social-nodejs:before, .ion-social-octocat:before, .ion-social-pinterest:before, .ion-social-pinterest-outline:before, .ion-social-python:before, .ion-social-reddit:before, .ion-social-reddit-outline:before, .ion-social-rss:before, .ion-social-rss-outline:before, .ion-social-sass:before, .ion-social-skype:before, .ion-social-skype-outline:before, .ion-social-snapchat:before, .ion-social-snapchat-outline:before, .ion-social-tumblr:before, .ion-social-tumblr-outline:before, .ion-social-tux:before, .ion-social-twitch:before, .ion-social-twitch-outline:before, .ion-social-twitter:before, .ion-social-twitter-outline:before, .ion-social-usd:before, .ion-social-usd-outline:before, .ion-social-vimeo:before, .ion-social-vimeo-outline:before, .ion-social-whatsapp:before, .ion-social-whatsapp-outline:before, .ion-social-windows:before, .ion-social-windows-outline:before, .ion-social-wordpress:before, .ion-social-wordpress-outline:before, .ion-social-yahoo:before, .ion-social-yahoo-outline:before, .ion-social-yen:before, .ion-social-yen-outline:before, .ion-social-youtube:before, .ion-social-youtube-outline:before, .ion-soup-can:before, .ion-soup-can-outline:before, .ion-speakerphone:before, .ion-speedometer:before, .ion-spoon:before, .ion-star:before, .ion-stats-bars:before, .ion-steam:before, .ion-stop:before, .ion-thermometer:before, .ion-thumbsdown:before, .ion-thumbsup:before, .ion-toggle:before, .ion-toggle-filled:before, .ion-transgender:before, .ion-trash-a:before, .ion-trash-b:before, .ion-trophy:before, .ion-tshirt:before, .ion-tshirt-outline:before, .ion-umbrella:before, .ion-university:before, .ion-unlocked:before, .ion-upload:before, .ion-usb:before, .ion-videocamera:before, .ion-volume-high:before, .ion-volume-low:before, .ion-volume-medium:before, .ion-volume-mute:before, .ion-wand:before, .ion-waterdrop:before, .ion-wifi:before, .ion-wineglass:before, .ion-woman:before, .ion-wrench:before, .ion-xbox:before {\n  display: inline-block;\n  font-family: \"Ionicons\";\n  speak: none;\n  font-style: normal;\n  font-weight: normal;\n  font-variant: normal;\n  text-transform: none;\n  text-rendering: auto;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale; }\n\n.ion-alert:before {\n  content: \"\\f101\"; }\n\n.ion-alert-circled:before {\n  content: \"\\f100\"; }\n\n.ion-android-add:before {\n  content: \"\\f2c7\"; }\n\n.ion-android-add-circle:before {\n  content: \"\\f359\"; }\n\n.ion-android-alarm-clock:before {\n  content: \"\\f35a\"; }\n\n.ion-android-alert:before {\n  content: \"\\f35b\"; }\n\n.ion-android-apps:before {\n  content: \"\\f35c\"; }\n\n.ion-android-archive:before {\n  content: \"\\f2c9\"; }\n\n.ion-android-arrow-back:before {\n  content: \"\\f2ca\"; }\n\n.ion-android-arrow-down:before {\n  content: \"\\f35d\"; }\n\n.ion-android-arrow-dropdown:before {\n  content: \"\\f35f\"; }\n\n.ion-android-arrow-dropdown-circle:before {\n  content: \"\\f35e\"; }\n\n.ion-android-arrow-dropleft:before {\n  content: \"\\f361\"; }\n\n.ion-android-arrow-dropleft-circle:before {\n  content: \"\\f360\"; }\n\n.ion-android-arrow-dropright:before {\n  content: \"\\f363\"; }\n\n.ion-android-arrow-dropright-circle:before {\n  content: \"\\f362\"; }\n\n.ion-android-arrow-dropup:before {\n  content: \"\\f365\"; }\n\n.ion-android-arrow-dropup-circle:before {\n  content: \"\\f364\"; }\n\n.ion-android-arrow-forward:before {\n  content: \"\\f30f\"; }\n\n.ion-android-arrow-up:before {\n  content: \"\\f366\"; }\n\n.ion-android-attach:before {\n  content: \"\\f367\"; }\n\n.ion-android-bar:before {\n  content: \"\\f368\"; }\n\n.ion-android-bicycle:before {\n  content: \"\\f369\"; }\n\n.ion-android-boat:before {\n  content: \"\\f36a\"; }\n\n.ion-android-bookmark:before {\n  content: \"\\f36b\"; }\n\n.ion-android-bulb:before {\n  content: \"\\f36c\"; }\n\n.ion-android-bus:before {\n  content: \"\\f36d\"; }\n\n.ion-android-calendar:before {\n  content: \"\\f2d1\"; }\n\n.ion-android-call:before {\n  content: \"\\f2d2\"; }\n\n.ion-android-camera:before {\n  content: \"\\f2d3\"; }\n\n.ion-android-cancel:before {\n  content: \"\\f36e\"; }\n\n.ion-android-car:before {\n  content: \"\\f36f\"; }\n\n.ion-android-cart:before {\n  content: \"\\f370\"; }\n\n.ion-android-chat:before {\n  content: \"\\f2d4\"; }\n\n.ion-android-checkbox:before {\n  content: \"\\f374\"; }\n\n.ion-android-checkbox-blank:before {\n  content: \"\\f371\"; }\n\n.ion-android-checkbox-outline:before {\n  content: \"\\f373\"; }\n\n.ion-android-checkbox-outline-blank:before {\n  content: \"\\f372\"; }\n\n.ion-android-checkmark-circle:before {\n  content: \"\\f375\"; }\n\n.ion-android-clipboard:before {\n  content: \"\\f376\"; }\n\n.ion-android-close:before {\n  content: \"\\f2d7\"; }\n\n.ion-android-cloud:before {\n  content: \"\\f37a\"; }\n\n.ion-android-cloud-circle:before {\n  content: \"\\f377\"; }\n\n.ion-android-cloud-done:before {\n  content: \"\\f378\"; }\n\n.ion-android-cloud-outline:before {\n  content: \"\\f379\"; }\n\n.ion-android-color-palette:before {\n  content: \"\\f37b\"; }\n\n.ion-android-compass:before {\n  content: \"\\f37c\"; }\n\n.ion-android-contact:before {\n  content: \"\\f2d8\"; }\n\n.ion-android-contacts:before {\n  content: \"\\f2d9\"; }\n\n.ion-android-contract:before {\n  content: \"\\f37d\"; }\n\n.ion-android-create:before {\n  content: \"\\f37e\"; }\n\n.ion-android-delete:before {\n  content: \"\\f37f\"; }\n\n.ion-android-desktop:before {\n  content: \"\\f380\"; }\n\n.ion-android-document:before {\n  content: \"\\f381\"; }\n\n.ion-android-done:before {\n  content: \"\\f383\"; }\n\n.ion-android-done-all:before {\n  content: \"\\f382\"; }\n\n.ion-android-download:before {\n  content: \"\\f2dd\"; }\n\n.ion-android-drafts:before {\n  content: \"\\f384\"; }\n\n.ion-android-exit:before {\n  content: \"\\f385\"; }\n\n.ion-android-expand:before {\n  content: \"\\f386\"; }\n\n.ion-android-favorite:before {\n  content: \"\\f388\"; }\n\n.ion-android-favorite-outline:before {\n  content: \"\\f387\"; }\n\n.ion-android-film:before {\n  content: \"\\f389\"; }\n\n.ion-android-folder:before {\n  content: \"\\f2e0\"; }\n\n.ion-android-folder-open:before {\n  content: \"\\f38a\"; }\n\n.ion-android-funnel:before {\n  content: \"\\f38b\"; }\n\n.ion-android-globe:before {\n  content: \"\\f38c\"; }\n\n.ion-android-hand:before {\n  content: \"\\f2e3\"; }\n\n.ion-android-hangout:before {\n  content: \"\\f38d\"; }\n\n.ion-android-happy:before {\n  content: \"\\f38e\"; }\n\n.ion-android-home:before {\n  content: \"\\f38f\"; }\n\n.ion-android-image:before {\n  content: \"\\f2e4\"; }\n\n.ion-android-laptop:before {\n  content: \"\\f390\"; }\n\n.ion-android-list:before {\n  content: \"\\f391\"; }\n\n.ion-android-locate:before {\n  content: \"\\f2e9\"; }\n\n.ion-android-lock:before {\n  content: \"\\f392\"; }\n\n.ion-android-mail:before {\n  content: \"\\f2eb\"; }\n\n.ion-android-map:before {\n  content: \"\\f393\"; }\n\n.ion-android-menu:before {\n  content: \"\\f394\"; }\n\n.ion-android-microphone:before {\n  content: \"\\f2ec\"; }\n\n.ion-android-microphone-off:before {\n  content: \"\\f395\"; }\n\n.ion-android-more-horizontal:before {\n  content: \"\\f396\"; }\n\n.ion-android-more-vertical:before {\n  content: \"\\f397\"; }\n\n.ion-android-navigate:before {\n  content: \"\\f398\"; }\n\n.ion-android-notifications:before {\n  content: \"\\f39b\"; }\n\n.ion-android-notifications-none:before {\n  content: \"\\f399\"; }\n\n.ion-android-notifications-off:before {\n  content: \"\\f39a\"; }\n\n.ion-android-open:before {\n  content: \"\\f39c\"; }\n\n.ion-android-options:before {\n  content: \"\\f39d\"; }\n\n.ion-android-people:before {\n  content: \"\\f39e\"; }\n\n.ion-android-person:before {\n  content: \"\\f3a0\"; }\n\n.ion-android-person-add:before {\n  content: \"\\f39f\"; }\n\n.ion-android-phone-landscape:before {\n  content: \"\\f3a1\"; }\n\n.ion-android-phone-portrait:before {\n  content: \"\\f3a2\"; }\n\n.ion-android-pin:before {\n  content: \"\\f3a3\"; }\n\n.ion-android-plane:before {\n  content: \"\\f3a4\"; }\n\n.ion-android-playstore:before {\n  content: \"\\f2f0\"; }\n\n.ion-android-print:before {\n  content: \"\\f3a5\"; }\n\n.ion-android-radio-button-off:before {\n  content: \"\\f3a6\"; }\n\n.ion-android-radio-button-on:before {\n  content: \"\\f3a7\"; }\n\n.ion-android-refresh:before {\n  content: \"\\f3a8\"; }\n\n.ion-android-remove:before {\n  content: \"\\f2f4\"; }\n\n.ion-android-remove-circle:before {\n  content: \"\\f3a9\"; }\n\n.ion-android-restaurant:before {\n  content: \"\\f3aa\"; }\n\n.ion-android-sad:before {\n  content: \"\\f3ab\"; }\n\n.ion-android-search:before {\n  content: \"\\f2f5\"; }\n\n.ion-android-send:before {\n  content: \"\\f2f6\"; }\n\n.ion-android-settings:before {\n  content: \"\\f2f7\"; }\n\n.ion-android-share:before {\n  content: \"\\f2f8\"; }\n\n.ion-android-share-alt:before {\n  content: \"\\f3ac\"; }\n\n.ion-android-star:before {\n  content: \"\\f2fc\"; }\n\n.ion-android-star-half:before {\n  content: \"\\f3ad\"; }\n\n.ion-android-star-outline:before {\n  content: \"\\f3ae\"; }\n\n.ion-android-stopwatch:before {\n  content: \"\\f2fd\"; }\n\n.ion-android-subway:before {\n  content: \"\\f3af\"; }\n\n.ion-android-sunny:before {\n  content: \"\\f3b0\"; }\n\n.ion-android-sync:before {\n  content: \"\\f3b1\"; }\n\n.ion-android-textsms:before {\n  content: \"\\f3b2\"; }\n\n.ion-android-time:before {\n  content: \"\\f3b3\"; }\n\n.ion-android-train:before {\n  content: \"\\f3b4\"; }\n\n.ion-android-unlock:before {\n  content: \"\\f3b5\"; }\n\n.ion-android-upload:before {\n  content: \"\\f3b6\"; }\n\n.ion-android-volume-down:before {\n  content: \"\\f3b7\"; }\n\n.ion-android-volume-mute:before {\n  content: \"\\f3b8\"; }\n\n.ion-android-volume-off:before {\n  content: \"\\f3b9\"; }\n\n.ion-android-volume-up:before {\n  content: \"\\f3ba\"; }\n\n.ion-android-walk:before {\n  content: \"\\f3bb\"; }\n\n.ion-android-warning:before {\n  content: \"\\f3bc\"; }\n\n.ion-android-watch:before {\n  content: \"\\f3bd\"; }\n\n.ion-android-wifi:before {\n  content: \"\\f305\"; }\n\n.ion-aperture:before {\n  content: \"\\f313\"; }\n\n.ion-archive:before {\n  content: \"\\f102\"; }\n\n.ion-arrow-down-a:before {\n  content: \"\\f103\"; }\n\n.ion-arrow-down-b:before {\n  content: \"\\f104\"; }\n\n.ion-arrow-down-c:before {\n  content: \"\\f105\"; }\n\n.ion-arrow-expand:before {\n  content: \"\\f25e\"; }\n\n.ion-arrow-graph-down-left:before {\n  content: \"\\f25f\"; }\n\n.ion-arrow-graph-down-right:before {\n  content: \"\\f260\"; }\n\n.ion-arrow-graph-up-left:before {\n  content: \"\\f261\"; }\n\n.ion-arrow-graph-up-right:before {\n  content: \"\\f262\"; }\n\n.ion-arrow-left-a:before {\n  content: \"\\f106\"; }\n\n.ion-arrow-left-b:before {\n  content: \"\\f107\"; }\n\n.ion-arrow-left-c:before {\n  content: \"\\f108\"; }\n\n.ion-arrow-move:before {\n  content: \"\\f263\"; }\n\n.ion-arrow-resize:before {\n  content: \"\\f264\"; }\n\n.ion-arrow-return-left:before {\n  content: \"\\f265\"; }\n\n.ion-arrow-return-right:before {\n  content: \"\\f266\"; }\n\n.ion-arrow-right-a:before {\n  content: \"\\f109\"; }\n\n.ion-arrow-right-b:before {\n  content: \"\\f10a\"; }\n\n.ion-arrow-right-c:before {\n  content: \"\\f10b\"; }\n\n.ion-arrow-shrink:before {\n  content: \"\\f267\"; }\n\n.ion-arrow-swap:before {\n  content: \"\\f268\"; }\n\n.ion-arrow-up-a:before {\n  content: \"\\f10c\"; }\n\n.ion-arrow-up-b:before {\n  content: \"\\f10d\"; }\n\n.ion-arrow-up-c:before {\n  content: \"\\f10e\"; }\n\n.ion-asterisk:before {\n  content: \"\\f314\"; }\n\n.ion-at:before {\n  content: \"\\f10f\"; }\n\n.ion-backspace:before {\n  content: \"\\f3bf\"; }\n\n.ion-backspace-outline:before {\n  content: \"\\f3be\"; }\n\n.ion-bag:before {\n  content: \"\\f110\"; }\n\n.ion-battery-charging:before {\n  content: \"\\f111\"; }\n\n.ion-battery-empty:before {\n  content: \"\\f112\"; }\n\n.ion-battery-full:before {\n  content: \"\\f113\"; }\n\n.ion-battery-half:before {\n  content: \"\\f114\"; }\n\n.ion-battery-low:before {\n  content: \"\\f115\"; }\n\n.ion-beaker:before {\n  content: \"\\f269\"; }\n\n.ion-beer:before {\n  content: \"\\f26a\"; }\n\n.ion-bluetooth:before {\n  content: \"\\f116\"; }\n\n.ion-bonfire:before {\n  content: \"\\f315\"; }\n\n.ion-bookmark:before {\n  content: \"\\f26b\"; }\n\n.ion-bowtie:before {\n  content: \"\\f3c0\"; }\n\n.ion-briefcase:before {\n  content: \"\\f26c\"; }\n\n.ion-bug:before {\n  content: \"\\f2be\"; }\n\n.ion-calculator:before {\n  content: \"\\f26d\"; }\n\n.ion-calendar:before {\n  content: \"\\f117\"; }\n\n.ion-camera:before {\n  content: \"\\f118\"; }\n\n.ion-card:before {\n  content: \"\\f119\"; }\n\n.ion-cash:before {\n  content: \"\\f316\"; }\n\n.ion-chatbox:before {\n  content: \"\\f11b\"; }\n\n.ion-chatbox-working:before {\n  content: \"\\f11a\"; }\n\n.ion-chatboxes:before {\n  content: \"\\f11c\"; }\n\n.ion-chatbubble:before {\n  content: \"\\f11e\"; }\n\n.ion-chatbubble-working:before {\n  content: \"\\f11d\"; }\n\n.ion-chatbubbles:before {\n  content: \"\\f11f\"; }\n\n.ion-checkmark:before {\n  content: \"\\f122\"; }\n\n.ion-checkmark-circled:before {\n  content: \"\\f120\"; }\n\n.ion-checkmark-round:before {\n  content: \"\\f121\"; }\n\n.ion-chevron-down:before {\n  content: \"\\f123\"; }\n\n.ion-chevron-left:before {\n  content: \"\\f124\"; }\n\n.ion-chevron-right:before {\n  content: \"\\f125\"; }\n\n.ion-chevron-up:before {\n  content: \"\\f126\"; }\n\n.ion-clipboard:before {\n  content: \"\\f127\"; }\n\n.ion-clock:before {\n  content: \"\\f26e\"; }\n\n.ion-close:before {\n  content: \"\\f12a\"; }\n\n.ion-close-circled:before {\n  content: \"\\f128\"; }\n\n.ion-close-round:before {\n  content: \"\\f129\"; }\n\n.ion-closed-captioning:before {\n  content: \"\\f317\"; }\n\n.ion-cloud:before {\n  content: \"\\f12b\"; }\n\n.ion-code:before {\n  content: \"\\f271\"; }\n\n.ion-code-download:before {\n  content: \"\\f26f\"; }\n\n.ion-code-working:before {\n  content: \"\\f270\"; }\n\n.ion-coffee:before {\n  content: \"\\f272\"; }\n\n.ion-compass:before {\n  content: \"\\f273\"; }\n\n.ion-compose:before {\n  content: \"\\f12c\"; }\n\n.ion-connection-bars:before {\n  content: \"\\f274\"; }\n\n.ion-contrast:before {\n  content: \"\\f275\"; }\n\n.ion-crop:before {\n  content: \"\\f3c1\"; }\n\n.ion-cube:before {\n  content: \"\\f318\"; }\n\n.ion-disc:before {\n  content: \"\\f12d\"; }\n\n.ion-document:before {\n  content: \"\\f12f\"; }\n\n.ion-document-text:before {\n  content: \"\\f12e\"; }\n\n.ion-drag:before {\n  content: \"\\f130\"; }\n\n.ion-earth:before {\n  content: \"\\f276\"; }\n\n.ion-easel:before {\n  content: \"\\f3c2\"; }\n\n.ion-edit:before {\n  content: \"\\f2bf\"; }\n\n.ion-egg:before {\n  content: \"\\f277\"; }\n\n.ion-eject:before {\n  content: \"\\f131\"; }\n\n.ion-email:before {\n  content: \"\\f132\"; }\n\n.ion-email-unread:before {\n  content: \"\\f3c3\"; }\n\n.ion-erlenmeyer-flask:before {\n  content: \"\\f3c5\"; }\n\n.ion-erlenmeyer-flask-bubbles:before {\n  content: \"\\f3c4\"; }\n\n.ion-eye:before {\n  content: \"\\f133\"; }\n\n.ion-eye-disabled:before {\n  content: \"\\f306\"; }\n\n.ion-female:before {\n  content: \"\\f278\"; }\n\n.ion-filing:before {\n  content: \"\\f134\"; }\n\n.ion-film-marker:before {\n  content: \"\\f135\"; }\n\n.ion-fireball:before {\n  content: \"\\f319\"; }\n\n.ion-flag:before {\n  content: \"\\f279\"; }\n\n.ion-flame:before {\n  content: \"\\f31a\"; }\n\n.ion-flash:before {\n  content: \"\\f137\"; }\n\n.ion-flash-off:before {\n  content: \"\\f136\"; }\n\n.ion-folder:before {\n  content: \"\\f139\"; }\n\n.ion-fork:before {\n  content: \"\\f27a\"; }\n\n.ion-fork-repo:before {\n  content: \"\\f2c0\"; }\n\n.ion-forward:before {\n  content: \"\\f13a\"; }\n\n.ion-funnel:before {\n  content: \"\\f31b\"; }\n\n.ion-gear-a:before {\n  content: \"\\f13d\"; }\n\n.ion-gear-b:before {\n  content: \"\\f13e\"; }\n\n.ion-grid:before {\n  content: \"\\f13f\"; }\n\n.ion-hammer:before {\n  content: \"\\f27b\"; }\n\n.ion-happy:before {\n  content: \"\\f31c\"; }\n\n.ion-happy-outline:before {\n  content: \"\\f3c6\"; }\n\n.ion-headphone:before {\n  content: \"\\f140\"; }\n\n.ion-heart:before {\n  content: \"\\f141\"; }\n\n.ion-heart-broken:before {\n  content: \"\\f31d\"; }\n\n.ion-help:before {\n  content: \"\\f143\"; }\n\n.ion-help-buoy:before {\n  content: \"\\f27c\"; }\n\n.ion-help-circled:before {\n  content: \"\\f142\"; }\n\n.ion-home:before {\n  content: \"\\f144\"; }\n\n.ion-icecream:before {\n  content: \"\\f27d\"; }\n\n.ion-image:before {\n  content: \"\\f147\"; }\n\n.ion-images:before {\n  content: \"\\f148\"; }\n\n.ion-information:before {\n  content: \"\\f14a\"; }\n\n.ion-information-circled:before {\n  content: \"\\f149\"; }\n\n.ion-ionic:before {\n  content: \"\\f14b\"; }\n\n.ion-ios-alarm:before {\n  content: \"\\f3c8\"; }\n\n.ion-ios-alarm-outline:before {\n  content: \"\\f3c7\"; }\n\n.ion-ios-albums:before {\n  content: \"\\f3ca\"; }\n\n.ion-ios-albums-outline:before {\n  content: \"\\f3c9\"; }\n\n.ion-ios-americanfootball:before {\n  content: \"\\f3cc\"; }\n\n.ion-ios-americanfootball-outline:before {\n  content: \"\\f3cb\"; }\n\n.ion-ios-analytics:before {\n  content: \"\\f3ce\"; }\n\n.ion-ios-analytics-outline:before {\n  content: \"\\f3cd\"; }\n\n.ion-ios-arrow-back:before {\n  content: \"\\f3cf\"; }\n\n.ion-ios-arrow-down:before {\n  content: \"\\f3d0\"; }\n\n.ion-ios-arrow-forward:before {\n  content: \"\\f3d1\"; }\n\n.ion-ios-arrow-left:before {\n  content: \"\\f3d2\"; }\n\n.ion-ios-arrow-right:before {\n  content: \"\\f3d3\"; }\n\n.ion-ios-arrow-thin-down:before {\n  content: \"\\f3d4\"; }\n\n.ion-ios-arrow-thin-left:before {\n  content: \"\\f3d5\"; }\n\n.ion-ios-arrow-thin-right:before {\n  content: \"\\f3d6\"; }\n\n.ion-ios-arrow-thin-up:before {\n  content: \"\\f3d7\"; }\n\n.ion-ios-arrow-up:before {\n  content: \"\\f3d8\"; }\n\n.ion-ios-at:before {\n  content: \"\\f3da\"; }\n\n.ion-ios-at-outline:before {\n  content: \"\\f3d9\"; }\n\n.ion-ios-barcode:before {\n  content: \"\\f3dc\"; }\n\n.ion-ios-barcode-outline:before {\n  content: \"\\f3db\"; }\n\n.ion-ios-baseball:before {\n  content: \"\\f3de\"; }\n\n.ion-ios-baseball-outline:before {\n  content: \"\\f3dd\"; }\n\n.ion-ios-basketball:before {\n  content: \"\\f3e0\"; }\n\n.ion-ios-basketball-outline:before {\n  content: \"\\f3df\"; }\n\n.ion-ios-bell:before {\n  content: \"\\f3e2\"; }\n\n.ion-ios-bell-outline:before {\n  content: \"\\f3e1\"; }\n\n.ion-ios-body:before {\n  content: \"\\f3e4\"; }\n\n.ion-ios-body-outline:before {\n  content: \"\\f3e3\"; }\n\n.ion-ios-bolt:before {\n  content: \"\\f3e6\"; }\n\n.ion-ios-bolt-outline:before {\n  content: \"\\f3e5\"; }\n\n.ion-ios-book:before {\n  content: \"\\f3e8\"; }\n\n.ion-ios-book-outline:before {\n  content: \"\\f3e7\"; }\n\n.ion-ios-bookmarks:before {\n  content: \"\\f3ea\"; }\n\n.ion-ios-bookmarks-outline:before {\n  content: \"\\f3e9\"; }\n\n.ion-ios-box:before {\n  content: \"\\f3ec\"; }\n\n.ion-ios-box-outline:before {\n  content: \"\\f3eb\"; }\n\n.ion-ios-briefcase:before {\n  content: \"\\f3ee\"; }\n\n.ion-ios-briefcase-outline:before {\n  content: \"\\f3ed\"; }\n\n.ion-ios-browsers:before {\n  content: \"\\f3f0\"; }\n\n.ion-ios-browsers-outline:before {\n  content: \"\\f3ef\"; }\n\n.ion-ios-calculator:before {\n  content: \"\\f3f2\"; }\n\n.ion-ios-calculator-outline:before {\n  content: \"\\f3f1\"; }\n\n.ion-ios-calendar:before {\n  content: \"\\f3f4\"; }\n\n.ion-ios-calendar-outline:before {\n  content: \"\\f3f3\"; }\n\n.ion-ios-camera:before {\n  content: \"\\f3f6\"; }\n\n.ion-ios-camera-outline:before {\n  content: \"\\f3f5\"; }\n\n.ion-ios-cart:before {\n  content: \"\\f3f8\"; }\n\n.ion-ios-cart-outline:before {\n  content: \"\\f3f7\"; }\n\n.ion-ios-chatboxes:before {\n  content: \"\\f3fa\"; }\n\n.ion-ios-chatboxes-outline:before {\n  content: \"\\f3f9\"; }\n\n.ion-ios-chatbubble:before {\n  content: \"\\f3fc\"; }\n\n.ion-ios-chatbubble-outline:before {\n  content: \"\\f3fb\"; }\n\n.ion-ios-checkmark:before {\n  content: \"\\f3ff\"; }\n\n.ion-ios-checkmark-empty:before {\n  content: \"\\f3fd\"; }\n\n.ion-ios-checkmark-outline:before {\n  content: \"\\f3fe\"; }\n\n.ion-ios-circle-filled:before {\n  content: \"\\f400\"; }\n\n.ion-ios-circle-outline:before {\n  content: \"\\f401\"; }\n\n.ion-ios-clock:before {\n  content: \"\\f403\"; }\n\n.ion-ios-clock-outline:before {\n  content: \"\\f402\"; }\n\n.ion-ios-close:before {\n  content: \"\\f406\"; }\n\n.ion-ios-close-empty:before {\n  content: \"\\f404\"; }\n\n.ion-ios-close-outline:before {\n  content: \"\\f405\"; }\n\n.ion-ios-cloud:before {\n  content: \"\\f40c\"; }\n\n.ion-ios-cloud-download:before {\n  content: \"\\f408\"; }\n\n.ion-ios-cloud-download-outline:before {\n  content: \"\\f407\"; }\n\n.ion-ios-cloud-outline:before {\n  content: \"\\f409\"; }\n\n.ion-ios-cloud-upload:before {\n  content: \"\\f40b\"; }\n\n.ion-ios-cloud-upload-outline:before {\n  content: \"\\f40a\"; }\n\n.ion-ios-cloudy:before {\n  content: \"\\f410\"; }\n\n.ion-ios-cloudy-night:before {\n  content: \"\\f40e\"; }\n\n.ion-ios-cloudy-night-outline:before {\n  content: \"\\f40d\"; }\n\n.ion-ios-cloudy-outline:before {\n  content: \"\\f40f\"; }\n\n.ion-ios-cog:before {\n  content: \"\\f412\"; }\n\n.ion-ios-cog-outline:before {\n  content: \"\\f411\"; }\n\n.ion-ios-color-filter:before {\n  content: \"\\f414\"; }\n\n.ion-ios-color-filter-outline:before {\n  content: \"\\f413\"; }\n\n.ion-ios-color-wand:before {\n  content: \"\\f416\"; }\n\n.ion-ios-color-wand-outline:before {\n  content: \"\\f415\"; }\n\n.ion-ios-compose:before {\n  content: \"\\f418\"; }\n\n.ion-ios-compose-outline:before {\n  content: \"\\f417\"; }\n\n.ion-ios-contact:before {\n  content: \"\\f41a\"; }\n\n.ion-ios-contact-outline:before {\n  content: \"\\f419\"; }\n\n.ion-ios-copy:before {\n  content: \"\\f41c\"; }\n\n.ion-ios-copy-outline:before {\n  content: \"\\f41b\"; }\n\n.ion-ios-crop:before {\n  content: \"\\f41e\"; }\n\n.ion-ios-crop-strong:before {\n  content: \"\\f41d\"; }\n\n.ion-ios-download:before {\n  content: \"\\f420\"; }\n\n.ion-ios-download-outline:before {\n  content: \"\\f41f\"; }\n\n.ion-ios-drag:before {\n  content: \"\\f421\"; }\n\n.ion-ios-email:before {\n  content: \"\\f423\"; }\n\n.ion-ios-email-outline:before {\n  content: \"\\f422\"; }\n\n.ion-ios-eye:before {\n  content: \"\\f425\"; }\n\n.ion-ios-eye-outline:before {\n  content: \"\\f424\"; }\n\n.ion-ios-fastforward:before {\n  content: \"\\f427\"; }\n\n.ion-ios-fastforward-outline:before {\n  content: \"\\f426\"; }\n\n.ion-ios-filing:before {\n  content: \"\\f429\"; }\n\n.ion-ios-filing-outline:before {\n  content: \"\\f428\"; }\n\n.ion-ios-film:before {\n  content: \"\\f42b\"; }\n\n.ion-ios-film-outline:before {\n  content: \"\\f42a\"; }\n\n.ion-ios-flag:before {\n  content: \"\\f42d\"; }\n\n.ion-ios-flag-outline:before {\n  content: \"\\f42c\"; }\n\n.ion-ios-flame:before {\n  content: \"\\f42f\"; }\n\n.ion-ios-flame-outline:before {\n  content: \"\\f42e\"; }\n\n.ion-ios-flask:before {\n  content: \"\\f431\"; }\n\n.ion-ios-flask-outline:before {\n  content: \"\\f430\"; }\n\n.ion-ios-flower:before {\n  content: \"\\f433\"; }\n\n.ion-ios-flower-outline:before {\n  content: \"\\f432\"; }\n\n.ion-ios-folder:before {\n  content: \"\\f435\"; }\n\n.ion-ios-folder-outline:before {\n  content: \"\\f434\"; }\n\n.ion-ios-football:before {\n  content: \"\\f437\"; }\n\n.ion-ios-football-outline:before {\n  content: \"\\f436\"; }\n\n.ion-ios-game-controller-a:before {\n  content: \"\\f439\"; }\n\n.ion-ios-game-controller-a-outline:before {\n  content: \"\\f438\"; }\n\n.ion-ios-game-controller-b:before {\n  content: \"\\f43b\"; }\n\n.ion-ios-game-controller-b-outline:before {\n  content: \"\\f43a\"; }\n\n.ion-ios-gear:before {\n  content: \"\\f43d\"; }\n\n.ion-ios-gear-outline:before {\n  content: \"\\f43c\"; }\n\n.ion-ios-glasses:before {\n  content: \"\\f43f\"; }\n\n.ion-ios-glasses-outline:before {\n  content: \"\\f43e\"; }\n\n.ion-ios-grid-view:before {\n  content: \"\\f441\"; }\n\n.ion-ios-grid-view-outline:before {\n  content: \"\\f440\"; }\n\n.ion-ios-heart:before {\n  content: \"\\f443\"; }\n\n.ion-ios-heart-outline:before {\n  content: \"\\f442\"; }\n\n.ion-ios-help:before {\n  content: \"\\f446\"; }\n\n.ion-ios-help-empty:before {\n  content: \"\\f444\"; }\n\n.ion-ios-help-outline:before {\n  content: \"\\f445\"; }\n\n.ion-ios-home:before {\n  content: \"\\f448\"; }\n\n.ion-ios-home-outline:before {\n  content: \"\\f447\"; }\n\n.ion-ios-infinite:before {\n  content: \"\\f44a\"; }\n\n.ion-ios-infinite-outline:before {\n  content: \"\\f449\"; }\n\n.ion-ios-information:before {\n  content: \"\\f44d\"; }\n\n.ion-ios-information-empty:before {\n  content: \"\\f44b\"; }\n\n.ion-ios-information-outline:before {\n  content: \"\\f44c\"; }\n\n.ion-ios-ionic-outline:before {\n  content: \"\\f44e\"; }\n\n.ion-ios-keypad:before {\n  content: \"\\f450\"; }\n\n.ion-ios-keypad-outline:before {\n  content: \"\\f44f\"; }\n\n.ion-ios-lightbulb:before {\n  content: \"\\f452\"; }\n\n.ion-ios-lightbulb-outline:before {\n  content: \"\\f451\"; }\n\n.ion-ios-list:before {\n  content: \"\\f454\"; }\n\n.ion-ios-list-outline:before {\n  content: \"\\f453\"; }\n\n.ion-ios-location:before {\n  content: \"\\f456\"; }\n\n.ion-ios-location-outline:before {\n  content: \"\\f455\"; }\n\n.ion-ios-locked:before {\n  content: \"\\f458\"; }\n\n.ion-ios-locked-outline:before {\n  content: \"\\f457\"; }\n\n.ion-ios-loop:before {\n  content: \"\\f45a\"; }\n\n.ion-ios-loop-strong:before {\n  content: \"\\f459\"; }\n\n.ion-ios-medical:before {\n  content: \"\\f45c\"; }\n\n.ion-ios-medical-outline:before {\n  content: \"\\f45b\"; }\n\n.ion-ios-medkit:before {\n  content: \"\\f45e\"; }\n\n.ion-ios-medkit-outline:before {\n  content: \"\\f45d\"; }\n\n.ion-ios-mic:before {\n  content: \"\\f461\"; }\n\n.ion-ios-mic-off:before {\n  content: \"\\f45f\"; }\n\n.ion-ios-mic-outline:before {\n  content: \"\\f460\"; }\n\n.ion-ios-minus:before {\n  content: \"\\f464\"; }\n\n.ion-ios-minus-empty:before {\n  content: \"\\f462\"; }\n\n.ion-ios-minus-outline:before {\n  content: \"\\f463\"; }\n\n.ion-ios-monitor:before {\n  content: \"\\f466\"; }\n\n.ion-ios-monitor-outline:before {\n  content: \"\\f465\"; }\n\n.ion-ios-moon:before {\n  content: \"\\f468\"; }\n\n.ion-ios-moon-outline:before {\n  content: \"\\f467\"; }\n\n.ion-ios-more:before {\n  content: \"\\f46a\"; }\n\n.ion-ios-more-outline:before {\n  content: \"\\f469\"; }\n\n.ion-ios-musical-note:before {\n  content: \"\\f46b\"; }\n\n.ion-ios-musical-notes:before {\n  content: \"\\f46c\"; }\n\n.ion-ios-navigate:before {\n  content: \"\\f46e\"; }\n\n.ion-ios-navigate-outline:before {\n  content: \"\\f46d\"; }\n\n.ion-ios-nutrition:before {\n  content: \"\\f470\"; }\n\n.ion-ios-nutrition-outline:before {\n  content: \"\\f46f\"; }\n\n.ion-ios-paper:before {\n  content: \"\\f472\"; }\n\n.ion-ios-paper-outline:before {\n  content: \"\\f471\"; }\n\n.ion-ios-paperplane:before {\n  content: \"\\f474\"; }\n\n.ion-ios-paperplane-outline:before {\n  content: \"\\f473\"; }\n\n.ion-ios-partlysunny:before {\n  content: \"\\f476\"; }\n\n.ion-ios-partlysunny-outline:before {\n  content: \"\\f475\"; }\n\n.ion-ios-pause:before {\n  content: \"\\f478\"; }\n\n.ion-ios-pause-outline:before {\n  content: \"\\f477\"; }\n\n.ion-ios-paw:before {\n  content: \"\\f47a\"; }\n\n.ion-ios-paw-outline:before {\n  content: \"\\f479\"; }\n\n.ion-ios-people:before {\n  content: \"\\f47c\"; }\n\n.ion-ios-people-outline:before {\n  content: \"\\f47b\"; }\n\n.ion-ios-person:before {\n  content: \"\\f47e\"; }\n\n.ion-ios-person-outline:before {\n  content: \"\\f47d\"; }\n\n.ion-ios-personadd:before {\n  content: \"\\f480\"; }\n\n.ion-ios-personadd-outline:before {\n  content: \"\\f47f\"; }\n\n.ion-ios-photos:before {\n  content: \"\\f482\"; }\n\n.ion-ios-photos-outline:before {\n  content: \"\\f481\"; }\n\n.ion-ios-pie:before {\n  content: \"\\f484\"; }\n\n.ion-ios-pie-outline:before {\n  content: \"\\f483\"; }\n\n.ion-ios-pint:before {\n  content: \"\\f486\"; }\n\n.ion-ios-pint-outline:before {\n  content: \"\\f485\"; }\n\n.ion-ios-play:before {\n  content: \"\\f488\"; }\n\n.ion-ios-play-outline:before {\n  content: \"\\f487\"; }\n\n.ion-ios-plus:before {\n  content: \"\\f48b\"; }\n\n.ion-ios-plus-empty:before {\n  content: \"\\f489\"; }\n\n.ion-ios-plus-outline:before {\n  content: \"\\f48a\"; }\n\n.ion-ios-pricetag:before {\n  content: \"\\f48d\"; }\n\n.ion-ios-pricetag-outline:before {\n  content: \"\\f48c\"; }\n\n.ion-ios-pricetags:before {\n  content: \"\\f48f\"; }\n\n.ion-ios-pricetags-outline:before {\n  content: \"\\f48e\"; }\n\n.ion-ios-printer:before {\n  content: \"\\f491\"; }\n\n.ion-ios-printer-outline:before {\n  content: \"\\f490\"; }\n\n.ion-ios-pulse:before {\n  content: \"\\f493\"; }\n\n.ion-ios-pulse-strong:before {\n  content: \"\\f492\"; }\n\n.ion-ios-rainy:before {\n  content: \"\\f495\"; }\n\n.ion-ios-rainy-outline:before {\n  content: \"\\f494\"; }\n\n.ion-ios-recording:before {\n  content: \"\\f497\"; }\n\n.ion-ios-recording-outline:before {\n  content: \"\\f496\"; }\n\n.ion-ios-redo:before {\n  content: \"\\f499\"; }\n\n.ion-ios-redo-outline:before {\n  content: \"\\f498\"; }\n\n.ion-ios-refresh:before {\n  content: \"\\f49c\"; }\n\n.ion-ios-refresh-empty:before {\n  content: \"\\f49a\"; }\n\n.ion-ios-refresh-outline:before {\n  content: \"\\f49b\"; }\n\n.ion-ios-reload:before {\n  content: \"\\f49d\"; }\n\n.ion-ios-reverse-camera:before {\n  content: \"\\f49f\"; }\n\n.ion-ios-reverse-camera-outline:before {\n  content: \"\\f49e\"; }\n\n.ion-ios-rewind:before {\n  content: \"\\f4a1\"; }\n\n.ion-ios-rewind-outline:before {\n  content: \"\\f4a0\"; }\n\n.ion-ios-rose:before {\n  content: \"\\f4a3\"; }\n\n.ion-ios-rose-outline:before {\n  content: \"\\f4a2\"; }\n\n.ion-ios-search:before {\n  content: \"\\f4a5\"; }\n\n.ion-ios-search-strong:before {\n  content: \"\\f4a4\"; }\n\n.ion-ios-settings:before {\n  content: \"\\f4a7\"; }\n\n.ion-ios-settings-strong:before {\n  content: \"\\f4a6\"; }\n\n.ion-ios-shuffle:before {\n  content: \"\\f4a9\"; }\n\n.ion-ios-shuffle-strong:before {\n  content: \"\\f4a8\"; }\n\n.ion-ios-skipbackward:before {\n  content: \"\\f4ab\"; }\n\n.ion-ios-skipbackward-outline:before {\n  content: \"\\f4aa\"; }\n\n.ion-ios-skipforward:before {\n  content: \"\\f4ad\"; }\n\n.ion-ios-skipforward-outline:before {\n  content: \"\\f4ac\"; }\n\n.ion-ios-snowy:before {\n  content: \"\\f4ae\"; }\n\n.ion-ios-speedometer:before {\n  content: \"\\f4b0\"; }\n\n.ion-ios-speedometer-outline:before {\n  content: \"\\f4af\"; }\n\n.ion-ios-star:before {\n  content: \"\\f4b3\"; }\n\n.ion-ios-star-half:before {\n  content: \"\\f4b1\"; }\n\n.ion-ios-star-outline:before {\n  content: \"\\f4b2\"; }\n\n.ion-ios-stopwatch:before {\n  content: \"\\f4b5\"; }\n\n.ion-ios-stopwatch-outline:before {\n  content: \"\\f4b4\"; }\n\n.ion-ios-sunny:before {\n  content: \"\\f4b7\"; }\n\n.ion-ios-sunny-outline:before {\n  content: \"\\f4b6\"; }\n\n.ion-ios-telephone:before {\n  content: \"\\f4b9\"; }\n\n.ion-ios-telephone-outline:before {\n  content: \"\\f4b8\"; }\n\n.ion-ios-tennisball:before {\n  content: \"\\f4bb\"; }\n\n.ion-ios-tennisball-outline:before {\n  content: \"\\f4ba\"; }\n\n.ion-ios-thunderstorm:before {\n  content: \"\\f4bd\"; }\n\n.ion-ios-thunderstorm-outline:before {\n  content: \"\\f4bc\"; }\n\n.ion-ios-time:before {\n  content: \"\\f4bf\"; }\n\n.ion-ios-time-outline:before {\n  content: \"\\f4be\"; }\n\n.ion-ios-timer:before {\n  content: \"\\f4c1\"; }\n\n.ion-ios-timer-outline:before {\n  content: \"\\f4c0\"; }\n\n.ion-ios-toggle:before {\n  content: \"\\f4c3\"; }\n\n.ion-ios-toggle-outline:before {\n  content: \"\\f4c2\"; }\n\n.ion-ios-trash:before {\n  content: \"\\f4c5\"; }\n\n.ion-ios-trash-outline:before {\n  content: \"\\f4c4\"; }\n\n.ion-ios-undo:before {\n  content: \"\\f4c7\"; }\n\n.ion-ios-undo-outline:before {\n  content: \"\\f4c6\"; }\n\n.ion-ios-unlocked:before {\n  content: \"\\f4c9\"; }\n\n.ion-ios-unlocked-outline:before {\n  content: \"\\f4c8\"; }\n\n.ion-ios-upload:before {\n  content: \"\\f4cb\"; }\n\n.ion-ios-upload-outline:before {\n  content: \"\\f4ca\"; }\n\n.ion-ios-videocam:before {\n  content: \"\\f4cd\"; }\n\n.ion-ios-videocam-outline:before {\n  content: \"\\f4cc\"; }\n\n.ion-ios-volume-high:before {\n  content: \"\\f4ce\"; }\n\n.ion-ios-volume-low:before {\n  content: \"\\f4cf\"; }\n\n.ion-ios-wineglass:before {\n  content: \"\\f4d1\"; }\n\n.ion-ios-wineglass-outline:before {\n  content: \"\\f4d0\"; }\n\n.ion-ios-world:before {\n  content: \"\\f4d3\"; }\n\n.ion-ios-world-outline:before {\n  content: \"\\f4d2\"; }\n\n.ion-ipad:before {\n  content: \"\\f1f9\"; }\n\n.ion-iphone:before {\n  content: \"\\f1fa\"; }\n\n.ion-ipod:before {\n  content: \"\\f1fb\"; }\n\n.ion-jet:before {\n  content: \"\\f295\"; }\n\n.ion-key:before {\n  content: \"\\f296\"; }\n\n.ion-knife:before {\n  content: \"\\f297\"; }\n\n.ion-laptop:before {\n  content: \"\\f1fc\"; }\n\n.ion-leaf:before {\n  content: \"\\f1fd\"; }\n\n.ion-levels:before {\n  content: \"\\f298\"; }\n\n.ion-lightbulb:before {\n  content: \"\\f299\"; }\n\n.ion-link:before {\n  content: \"\\f1fe\"; }\n\n.ion-load-a:before {\n  content: \"\\f29a\"; }\n\n.ion-load-b:before {\n  content: \"\\f29b\"; }\n\n.ion-load-c:before {\n  content: \"\\f29c\"; }\n\n.ion-load-d:before {\n  content: \"\\f29d\"; }\n\n.ion-location:before {\n  content: \"\\f1ff\"; }\n\n.ion-lock-combination:before {\n  content: \"\\f4d4\"; }\n\n.ion-locked:before {\n  content: \"\\f200\"; }\n\n.ion-log-in:before {\n  content: \"\\f29e\"; }\n\n.ion-log-out:before {\n  content: \"\\f29f\"; }\n\n.ion-loop:before {\n  content: \"\\f201\"; }\n\n.ion-magnet:before {\n  content: \"\\f2a0\"; }\n\n.ion-male:before {\n  content: \"\\f2a1\"; }\n\n.ion-man:before {\n  content: \"\\f202\"; }\n\n.ion-map:before {\n  content: \"\\f203\"; }\n\n.ion-medkit:before {\n  content: \"\\f2a2\"; }\n\n.ion-merge:before {\n  content: \"\\f33f\"; }\n\n.ion-mic-a:before {\n  content: \"\\f204\"; }\n\n.ion-mic-b:before {\n  content: \"\\f205\"; }\n\n.ion-mic-c:before {\n  content: \"\\f206\"; }\n\n.ion-minus:before {\n  content: \"\\f209\"; }\n\n.ion-minus-circled:before {\n  content: \"\\f207\"; }\n\n.ion-minus-round:before {\n  content: \"\\f208\"; }\n\n.ion-model-s:before {\n  content: \"\\f2c1\"; }\n\n.ion-monitor:before {\n  content: \"\\f20a\"; }\n\n.ion-more:before {\n  content: \"\\f20b\"; }\n\n.ion-mouse:before {\n  content: \"\\f340\"; }\n\n.ion-music-note:before {\n  content: \"\\f20c\"; }\n\n.ion-navicon:before {\n  content: \"\\f20e\"; }\n\n.ion-navicon-round:before {\n  content: \"\\f20d\"; }\n\n.ion-navigate:before {\n  content: \"\\f2a3\"; }\n\n.ion-network:before {\n  content: \"\\f341\"; }\n\n.ion-no-smoking:before {\n  content: \"\\f2c2\"; }\n\n.ion-nuclear:before {\n  content: \"\\f2a4\"; }\n\n.ion-outlet:before {\n  content: \"\\f342\"; }\n\n.ion-paintbrush:before {\n  content: \"\\f4d5\"; }\n\n.ion-paintbucket:before {\n  content: \"\\f4d6\"; }\n\n.ion-paper-airplane:before {\n  content: \"\\f2c3\"; }\n\n.ion-paperclip:before {\n  content: \"\\f20f\"; }\n\n.ion-pause:before {\n  content: \"\\f210\"; }\n\n.ion-person:before {\n  content: \"\\f213\"; }\n\n.ion-person-add:before {\n  content: \"\\f211\"; }\n\n.ion-person-stalker:before {\n  content: \"\\f212\"; }\n\n.ion-pie-graph:before {\n  content: \"\\f2a5\"; }\n\n.ion-pin:before {\n  content: \"\\f2a6\"; }\n\n.ion-pinpoint:before {\n  content: \"\\f2a7\"; }\n\n.ion-pizza:before {\n  content: \"\\f2a8\"; }\n\n.ion-plane:before {\n  content: \"\\f214\"; }\n\n.ion-planet:before {\n  content: \"\\f343\"; }\n\n.ion-play:before {\n  content: \"\\f215\"; }\n\n.ion-playstation:before {\n  content: \"\\f30a\"; }\n\n.ion-plus:before {\n  content: \"\\f218\"; }\n\n.ion-plus-circled:before {\n  content: \"\\f216\"; }\n\n.ion-plus-round:before {\n  content: \"\\f217\"; }\n\n.ion-podium:before {\n  content: \"\\f344\"; }\n\n.ion-pound:before {\n  content: \"\\f219\"; }\n\n.ion-power:before {\n  content: \"\\f2a9\"; }\n\n.ion-pricetag:before {\n  content: \"\\f2aa\"; }\n\n.ion-pricetags:before {\n  content: \"\\f2ab\"; }\n\n.ion-printer:before {\n  content: \"\\f21a\"; }\n\n.ion-pull-request:before {\n  content: \"\\f345\"; }\n\n.ion-qr-scanner:before {\n  content: \"\\f346\"; }\n\n.ion-quote:before {\n  content: \"\\f347\"; }\n\n.ion-radio-waves:before {\n  content: \"\\f2ac\"; }\n\n.ion-record:before {\n  content: \"\\f21b\"; }\n\n.ion-refresh:before {\n  content: \"\\f21c\"; }\n\n.ion-reply:before {\n  content: \"\\f21e\"; }\n\n.ion-reply-all:before {\n  content: \"\\f21d\"; }\n\n.ion-ribbon-a:before {\n  content: \"\\f348\"; }\n\n.ion-ribbon-b:before {\n  content: \"\\f349\"; }\n\n.ion-sad:before {\n  content: \"\\f34a\"; }\n\n.ion-sad-outline:before {\n  content: \"\\f4d7\"; }\n\n.ion-scissors:before {\n  content: \"\\f34b\"; }\n\n.ion-search:before {\n  content: \"\\f21f\"; }\n\n.ion-settings:before {\n  content: \"\\f2ad\"; }\n\n.ion-share:before {\n  content: \"\\f220\"; }\n\n.ion-shuffle:before {\n  content: \"\\f221\"; }\n\n.ion-skip-backward:before {\n  content: \"\\f222\"; }\n\n.ion-skip-forward:before {\n  content: \"\\f223\"; }\n\n.ion-social-android:before {\n  content: \"\\f225\"; }\n\n.ion-social-android-outline:before {\n  content: \"\\f224\"; }\n\n.ion-social-angular:before {\n  content: \"\\f4d9\"; }\n\n.ion-social-angular-outline:before {\n  content: \"\\f4d8\"; }\n\n.ion-social-apple:before {\n  content: \"\\f227\"; }\n\n.ion-social-apple-outline:before {\n  content: \"\\f226\"; }\n\n.ion-social-bitcoin:before {\n  content: \"\\f2af\"; }\n\n.ion-social-bitcoin-outline:before {\n  content: \"\\f2ae\"; }\n\n.ion-social-buffer:before {\n  content: \"\\f229\"; }\n\n.ion-social-buffer-outline:before {\n  content: \"\\f228\"; }\n\n.ion-social-chrome:before {\n  content: \"\\f4db\"; }\n\n.ion-social-chrome-outline:before {\n  content: \"\\f4da\"; }\n\n.ion-social-codepen:before {\n  content: \"\\f4dd\"; }\n\n.ion-social-codepen-outline:before {\n  content: \"\\f4dc\"; }\n\n.ion-social-css3:before {\n  content: \"\\f4df\"; }\n\n.ion-social-css3-outline:before {\n  content: \"\\f4de\"; }\n\n.ion-social-designernews:before {\n  content: \"\\f22b\"; }\n\n.ion-social-designernews-outline:before {\n  content: \"\\f22a\"; }\n\n.ion-social-dribbble:before {\n  content: \"\\f22d\"; }\n\n.ion-social-dribbble-outline:before {\n  content: \"\\f22c\"; }\n\n.ion-social-dropbox:before {\n  content: \"\\f22f\"; }\n\n.ion-social-dropbox-outline:before {\n  content: \"\\f22e\"; }\n\n.ion-social-euro:before {\n  content: \"\\f4e1\"; }\n\n.ion-social-euro-outline:before {\n  content: \"\\f4e0\"; }\n\n.ion-social-facebook:before {\n  content: \"\\f231\"; }\n\n.ion-social-facebook-outline:before {\n  content: \"\\f230\"; }\n\n.ion-social-foursquare:before {\n  content: \"\\f34d\"; }\n\n.ion-social-foursquare-outline:before {\n  content: \"\\f34c\"; }\n\n.ion-social-freebsd-devil:before {\n  content: \"\\f2c4\"; }\n\n.ion-social-github:before {\n  content: \"\\f233\"; }\n\n.ion-social-github-outline:before {\n  content: \"\\f232\"; }\n\n.ion-social-google:before {\n  content: \"\\f34f\"; }\n\n.ion-social-google-outline:before {\n  content: \"\\f34e\"; }\n\n.ion-social-googleplus:before {\n  content: \"\\f235\"; }\n\n.ion-social-googleplus-outline:before {\n  content: \"\\f234\"; }\n\n.ion-social-hackernews:before {\n  content: \"\\f237\"; }\n\n.ion-social-hackernews-outline:before {\n  content: \"\\f236\"; }\n\n.ion-social-html5:before {\n  content: \"\\f4e3\"; }\n\n.ion-social-html5-outline:before {\n  content: \"\\f4e2\"; }\n\n.ion-social-instagram:before {\n  content: \"\\f351\"; }\n\n.ion-social-instagram-outline:before {\n  content: \"\\f350\"; }\n\n.ion-social-javascript:before {\n  content: \"\\f4e5\"; }\n\n.ion-social-javascript-outline:before {\n  content: \"\\f4e4\"; }\n\n.ion-social-linkedin:before {\n  content: \"\\f239\"; }\n\n.ion-social-linkedin-outline:before {\n  content: \"\\f238\"; }\n\n.ion-social-markdown:before {\n  content: \"\\f4e6\"; }\n\n.ion-social-nodejs:before {\n  content: \"\\f4e7\"; }\n\n.ion-social-octocat:before {\n  content: \"\\f4e8\"; }\n\n.ion-social-pinterest:before {\n  content: \"\\f2b1\"; }\n\n.ion-social-pinterest-outline:before {\n  content: \"\\f2b0\"; }\n\n.ion-social-python:before {\n  content: \"\\f4e9\"; }\n\n.ion-social-reddit:before {\n  content: \"\\f23b\"; }\n\n.ion-social-reddit-outline:before {\n  content: \"\\f23a\"; }\n\n.ion-social-rss:before {\n  content: \"\\f23d\"; }\n\n.ion-social-rss-outline:before {\n  content: \"\\f23c\"; }\n\n.ion-social-sass:before {\n  content: \"\\f4ea\"; }\n\n.ion-social-skype:before {\n  content: \"\\f23f\"; }\n\n.ion-social-skype-outline:before {\n  content: \"\\f23e\"; }\n\n.ion-social-snapchat:before {\n  content: \"\\f4ec\"; }\n\n.ion-social-snapchat-outline:before {\n  content: \"\\f4eb\"; }\n\n.ion-social-tumblr:before {\n  content: \"\\f241\"; }\n\n.ion-social-tumblr-outline:before {\n  content: \"\\f240\"; }\n\n.ion-social-tux:before {\n  content: \"\\f2c5\"; }\n\n.ion-social-twitch:before {\n  content: \"\\f4ee\"; }\n\n.ion-social-twitch-outline:before {\n  content: \"\\f4ed\"; }\n\n.ion-social-twitter:before {\n  content: \"\\f243\"; }\n\n.ion-social-twitter-outline:before {\n  content: \"\\f242\"; }\n\n.ion-social-usd:before {\n  content: \"\\f353\"; }\n\n.ion-social-usd-outline:before {\n  content: \"\\f352\"; }\n\n.ion-social-vimeo:before {\n  content: \"\\f245\"; }\n\n.ion-social-vimeo-outline:before {\n  content: \"\\f244\"; }\n\n.ion-social-whatsapp:before {\n  content: \"\\f4f0\"; }\n\n.ion-social-whatsapp-outline:before {\n  content: \"\\f4ef\"; }\n\n.ion-social-windows:before {\n  content: \"\\f247\"; }\n\n.ion-social-windows-outline:before {\n  content: \"\\f246\"; }\n\n.ion-social-wordpress:before {\n  content: \"\\f249\"; }\n\n.ion-social-wordpress-outline:before {\n  content: \"\\f248\"; }\n\n.ion-social-yahoo:before {\n  content: \"\\f24b\"; }\n\n.ion-social-yahoo-outline:before {\n  content: \"\\f24a\"; }\n\n.ion-social-yen:before {\n  content: \"\\f4f2\"; }\n\n.ion-social-yen-outline:before {\n  content: \"\\f4f1\"; }\n\n.ion-social-youtube:before {\n  content: \"\\f24d\"; }\n\n.ion-social-youtube-outline:before {\n  content: \"\\f24c\"; }\n\n.ion-soup-can:before {\n  content: \"\\f4f4\"; }\n\n.ion-soup-can-outline:before {\n  content: \"\\f4f3\"; }\n\n.ion-speakerphone:before {\n  content: \"\\f2b2\"; }\n\n.ion-speedometer:before {\n  content: \"\\f2b3\"; }\n\n.ion-spoon:before {\n  content: \"\\f2b4\"; }\n\n.ion-star:before {\n  content: \"\\f24e\"; }\n\n.ion-stats-bars:before {\n  content: \"\\f2b5\"; }\n\n.ion-steam:before {\n  content: \"\\f30b\"; }\n\n.ion-stop:before {\n  content: \"\\f24f\"; }\n\n.ion-thermometer:before {\n  content: \"\\f2b6\"; }\n\n.ion-thumbsdown:before {\n  content: \"\\f250\"; }\n\n.ion-thumbsup:before {\n  content: \"\\f251\"; }\n\n.ion-toggle:before {\n  content: \"\\f355\"; }\n\n.ion-toggle-filled:before {\n  content: \"\\f354\"; }\n\n.ion-transgender:before {\n  content: \"\\f4f5\"; }\n\n.ion-trash-a:before {\n  content: \"\\f252\"; }\n\n.ion-trash-b:before {\n  content: \"\\f253\"; }\n\n.ion-trophy:before {\n  content: \"\\f356\"; }\n\n.ion-tshirt:before {\n  content: \"\\f4f7\"; }\n\n.ion-tshirt-outline:before {\n  content: \"\\f4f6\"; }\n\n.ion-umbrella:before {\n  content: \"\\f2b7\"; }\n\n.ion-university:before {\n  content: \"\\f357\"; }\n\n.ion-unlocked:before {\n  content: \"\\f254\"; }\n\n.ion-upload:before {\n  content: \"\\f255\"; }\n\n.ion-usb:before {\n  content: \"\\f2b8\"; }\n\n.ion-videocamera:before {\n  content: \"\\f256\"; }\n\n.ion-volume-high:before {\n  content: \"\\f257\"; }\n\n.ion-volume-low:before {\n  content: \"\\f258\"; }\n\n.ion-volume-medium:before {\n  content: \"\\f259\"; }\n\n.ion-volume-mute:before {\n  content: \"\\f25a\"; }\n\n.ion-wand:before {\n  content: \"\\f358\"; }\n\n.ion-waterdrop:before {\n  content: \"\\f25b\"; }\n\n.ion-wifi:before {\n  content: \"\\f25c\"; }\n\n.ion-wineglass:before {\n  content: \"\\f2b9\"; }\n\n.ion-woman:before {\n  content: \"\\f25d\"; }\n\n.ion-wrench:before {\n  content: \"\\f2ba\"; }\n\n.ion-xbox:before {\n  content: \"\\f30c\"; }\n\n/**\n * Resets\n * --------------------------------------------------\n * Adapted from normalize.css and some reset.css. We don't care even one\n * bit about old IE, so we don't need any hacks for that in here.\n *\n * There are probably other things we could remove here, as well.\n *\n * normalize.css v2.1.2 | MIT License | git.io/normalize\n\n * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)\n * http://cssreset.com\n */\nhtml, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, i, u, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, fieldset, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  vertical-align: baseline;\n  font: inherit;\n  font-size: 100%; }\n\nol, ul {\n  list-style: none; }\n\nblockquote, q {\n  quotes: none; }\n\nblockquote:before, blockquote:after, q:before, q:after {\n  content: '';\n  content: none; }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\naudio:not([controls]) {\n  display: none;\n  height: 0; }\n\n/**\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n[hidden], template {\n  display: none; }\n\nscript {\n  display: none !important; }\n\n/* ==========================================================================\n   Base\n   ========================================================================== */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *  user zoom.\n */\nhtml {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  font-family: sans-serif;\n  /* 1 */\n  -webkit-text-size-adjust: 100%;\n  -ms-text-size-adjust: 100%;\n  /* 2 */\n  -webkit-text-size-adjust: 100%;\n  /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n  margin: 0;\n  line-height: 1; }\n\n/**\n * Remove default outlines.\n */\na, button, :focus, a:focus, button:focus, a:active, a:hover {\n  outline: 0; }\n\n/* *\n * Remove tap highlight color\n */\na {\n  -webkit-user-drag: none;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n  -webkit-tap-highlight-color: transparent; }\n  a[href]:hover {\n    cursor: pointer; }\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\nb, strong {\n  font-weight: bold; }\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\ndfn {\n  font-style: italic; }\n\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0; }\n\n/**\n * Correct font family set oddly in Safari 5 and Chrome.\n */\ncode, kbd, pre, samp {\n  font-size: 1em;\n  font-family: monospace, serif; }\n\n/**\n * Improve readability of pre-formatted text in all browsers.\n */\npre {\n  white-space: pre-wrap; }\n\n/**\n * Set consistent quote types.\n */\nq {\n  quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\"; }\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n  font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub, sup {\n  position: relative;\n  vertical-align: baseline;\n  font-size: 75%;\n  line-height: 0; }\n\nsup {\n  top: -0.5em; }\n\nsub {\n  bottom: -0.25em; }\n\n/**\n * Define consistent border, margin, and padding.\n */\nfieldset {\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n  border: 1px solid #c0c0c0; }\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n  padding: 0;\n  /* 2 */\n  border: 0;\n  /* 1 */ }\n\n/**\n * 1. Correct font family not being inherited in all browsers.\n * 2. Correct font size not being inherited in all browsers.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n * 4. Remove any default :focus styles\n * 5. Make sure webkit font smoothing is being inherited\n * 6. Remove default gradient in Android Firefox / FirefoxOS\n */\nbutton, input, select, textarea {\n  margin: 0;\n  /* 3 */\n  font-size: 100%;\n  /* 2 */\n  font-family: inherit;\n  /* 1 */\n  outline-offset: 0;\n  /* 4 */\n  outline-style: none;\n  /* 4 */\n  outline-width: 0;\n  /* 4 */\n  -webkit-font-smoothing: inherit;\n  /* 5 */\n  background-image: none;\n  /* 6 */ }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `importnt` in\n * the UA stylesheet.\n */\nbutton, input {\n  line-height: normal; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.\n * Correct `select` style inheritance in Firefox 4+ and Opera.\n */\nbutton, select {\n  text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *  and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *  `input` and others.\n */\nbutton, html input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"] {\n  cursor: pointer;\n  /* 3 */\n  -webkit-appearance: button;\n  /* 2 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled], html input[disabled] {\n  cursor: default; }\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n *  (include `-moz` to future-proof).\n */\ninput[type=\"search\"] {\n  -webkit-box-sizing: content-box;\n  /* 2 */\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  -webkit-appearance: textfield;\n  /* 1 */ }\n\n/**\n * Remove inner padding and search cancel button in Safari 5 and Chrome\n * on OS X.\n */\ninput[type=\"search\"]::-webkit-search-cancel-button, input[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner, input::-moz-focus-inner {\n  padding: 0;\n  border: 0; }\n\n/**\n * 1. Remove default vertical scrollbar in IE 8/9.\n * 2. Improve readability and alignment in all browsers.\n */\ntextarea {\n  overflow: auto;\n  /* 1 */\n  vertical-align: top;\n  /* 2 */ }\n\nimg {\n  -webkit-user-drag: none; }\n\n/* ==========================================================================\n   Tables\n   ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n  border-spacing: 0;\n  border-collapse: collapse; }\n\n/**\n * Scaffolding\n * --------------------------------------------------\n */\n*, *:before, *:after {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box; }\n\nhtml {\n  overflow: hidden;\n  -ms-touch-action: pan-y;\n  touch-action: pan-y; }\n\nbody, .ionic-body {\n  -webkit-touch-callout: none;\n  -webkit-font-smoothing: antialiased;\n  font-smoothing: antialiased;\n  -webkit-text-size-adjust: none;\n  -moz-text-size-adjust: none;\n  text-size-adjust: none;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n  -webkit-tap-highlight-color: transparent;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  margin: 0;\n  padding: 0;\n  color: #000;\n  word-wrap: break-word;\n  font-size: 14px;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  line-height: 20px;\n  text-rendering: optimizeLegibility;\n  -webkit-backface-visibility: hidden;\n  -webkit-user-drag: none;\n  -ms-content-zooming: none; }\n\nbody.grade-b, body.grade-c {\n  text-rendering: auto; }\n\n.content {\n  position: relative; }\n\n.scroll-content {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  margin-top: -1px;\n  padding-top: 1px;\n  margin-bottom: -1px;\n  width: auto;\n  height: auto; }\n\n.menu .scroll-content.scroll-content-false {\n  z-index: 11; }\n\n.scroll-view {\n  position: relative;\n  display: block;\n  overflow: hidden;\n  margin-top: -1px; }\n\n/**\n * Scroll is the scroll view component available for complex and custom\n * scroll view functionality.\n */\n.scroll {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-text-size-adjust: none;\n  -moz-text-size-adjust: none;\n  text-size-adjust: none;\n  -webkit-transform-origin: left top;\n  transform-origin: left top; }\n\n/**\n * Set ms-viewport to prevent MS \"page squish\" and allow fluid scrolling\n * https://msdn.microsoft.com/en-us/library/ie/hh869615(v=vs.85).aspx\n */\n@-ms-viewport {\n  width: device-width; }\n\n.scroll-bar {\n  position: absolute;\n  z-index: 9999; }\n\n.ng-animate .scroll-bar {\n  visibility: hidden; }\n\n.scroll-bar-h {\n  right: 2px;\n  bottom: 3px;\n  left: 2px;\n  height: 3px; }\n  .scroll-bar-h .scroll-bar-indicator {\n    height: 100%; }\n\n.scroll-bar-v {\n  top: 2px;\n  right: 3px;\n  bottom: 2px;\n  width: 3px; }\n  .scroll-bar-v .scroll-bar-indicator {\n    width: 100%; }\n\n.scroll-bar-indicator {\n  position: absolute;\n  border-radius: 4px;\n  background: rgba(0, 0, 0, 0.3);\n  opacity: 1;\n  -webkit-transition: opacity 0.3s linear;\n  transition: opacity 0.3s linear; }\n  .scroll-bar-indicator.scroll-bar-fade-out {\n    opacity: 0; }\n\n.platform-android .scroll-bar-indicator {\n  border-radius: 0; }\n\n.grade-b .scroll-bar-indicator, .grade-c .scroll-bar-indicator {\n  background: #aaa; }\n  .grade-b .scroll-bar-indicator.scroll-bar-fade-out, .grade-c .scroll-bar-indicator.scroll-bar-fade-out {\n    -webkit-transition: none;\n    transition: none; }\n\nion-infinite-scroll {\n  height: 60px;\n  width: 100%;\n  display: block;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -moz-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center; }\n  ion-infinite-scroll .icon {\n    color: #666666;\n    font-size: 30px;\n    color: #666666; }\n  ion-infinite-scroll .icon:before, ion-infinite-scroll .spinner {\n    -webkit-transform: translate3d(0, 0, 0);\n    transform: translate3d(0, 0, 0); }\n  ion-infinite-scroll:not(.active) .spinner, ion-infinite-scroll:not(.active) .icon:before {\n    -webkit-transform: translate3d(-1000px, 0, 0);\n    transform: translate3d(-1000px, 0, 0); }\n\n.overflow-scroll {\n  overflow-x: hidden;\n  overflow-y: scroll;\n  -webkit-overflow-scrolling: touch;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  position: absolute; }\n  .overflow-scroll .scroll {\n    position: static;\n    height: 100%;\n    -webkit-transform: translate3d(0, 0, 0); }\n\n/* If you change these, change platform.scss as well */\n.has-header {\n  top: 44px; }\n\n.no-header {\n  top: 0; }\n\n.has-subheader {\n  top: 88px; }\n\n.has-tabs-top {\n  top: 93px; }\n\n.has-header.has-subheader.has-tabs-top {\n  top: 137px; }\n\n.has-footer {\n  bottom: 44px; }\n\n.has-subfooter {\n  bottom: 88px; }\n\n.has-tabs, .bar-footer.has-tabs {\n  bottom: 49px; }\n  .has-tabs.pane, .bar-footer.has-tabs.pane {\n    bottom: 49px;\n    height: auto; }\n\n.has-footer.has-tabs {\n  bottom: 93px; }\n\n.pane {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  -webkit-transition-duration: 0;\n  transition-duration: 0;\n  z-index: 1; }\n\n.view {\n  z-index: 1; }\n\n.pane, .view {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #fff;\n  overflow: hidden; }\n\n.view-container {\n  position: absolute;\n  display: block;\n  width: 100%;\n  height: 100%; }\n\n/**\n * Typography\n * --------------------------------------------------\n */\np {\n  margin: 0 0 10px; }\n\nsmall {\n  font-size: 85%; }\n\ncite {\n  font-style: normal; }\n\n.text-left {\n  text-align: left; }\n\n.text-right {\n  text-align: right; }\n\n.text-center {\n  text-align: center; }\n\nh1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {\n  color: #000;\n  font-weight: 500;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  line-height: 1.2; }\n  h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small {\n    font-weight: normal;\n    line-height: 1; }\n\nh1, .h1, h2, .h2, h3, .h3 {\n  margin-top: 20px;\n  margin-bottom: 10px; }\n  h1:first-child, .h1:first-child, h2:first-child, .h2:first-child, h3:first-child, .h3:first-child {\n    margin-top: 0; }\n  h1 + h1, h1 + .h1, h1 + h2, h1 + .h2, h1 + h3, h1 + .h3, .h1 + h1, .h1 + .h1, .h1 + h2, .h1 + .h2, .h1 + h3, .h1 + .h3, h2 + h1, h2 + .h1, h2 + h2, h2 + .h2, h2 + h3, h2 + .h3, .h2 + h1, .h2 + .h1, .h2 + h2, .h2 + .h2, .h2 + h3, .h2 + .h3, h3 + h1, h3 + .h1, h3 + h2, h3 + .h2, h3 + h3, h3 + .h3, .h3 + h1, .h3 + .h1, .h3 + h2, .h3 + .h2, .h3 + h3, .h3 + .h3 {\n    margin-top: 10px; }\n\nh4, .h4, h5, .h5, h6, .h6 {\n  margin-top: 10px;\n  margin-bottom: 10px; }\n\nh1, .h1 {\n  font-size: 36px; }\n\nh2, .h2 {\n  font-size: 30px; }\n\nh3, .h3 {\n  font-size: 24px; }\n\nh4, .h4 {\n  font-size: 18px; }\n\nh5, .h5 {\n  font-size: 14px; }\n\nh6, .h6 {\n  font-size: 12px; }\n\nh1 small, .h1 small {\n  font-size: 24px; }\n\nh2 small, .h2 small {\n  font-size: 18px; }\n\nh3 small, .h3 small, h4 small, .h4 small {\n  font-size: 14px; }\n\ndl {\n  margin-bottom: 20px; }\n\ndt, dd {\n  line-height: 1.42857; }\n\ndt {\n  font-weight: bold; }\n\nblockquote {\n  margin: 0 0 20px;\n  padding: 10px 20px;\n  border-left: 5px solid gray; }\n  blockquote p {\n    font-weight: 300;\n    font-size: 17.5px;\n    line-height: 1.25; }\n  blockquote p:last-child {\n    margin-bottom: 0; }\n  blockquote small {\n    display: block;\n    line-height: 1.42857; }\n    blockquote small:before {\n      content: '\\2014 \\00A0'; }\n\nq:before, q:after, blockquote:before, blockquote:after {\n  content: \"\"; }\n\naddress {\n  display: block;\n  margin-bottom: 20px;\n  font-style: normal;\n  line-height: 1.42857; }\n\na.subdued {\n  padding-right: 10px;\n  color: #888;\n  text-decoration: none; }\n  a.subdued:hover {\n    text-decoration: none; }\n  a.subdued:last-child {\n    padding-right: 0; }\n\n/**\n * Action Sheets\n * --------------------------------------------------\n */\n.action-sheet-backdrop {\n  -webkit-transition: background-color 150ms ease-in-out;\n  transition: background-color 150ms ease-in-out;\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 11;\n  width: 100%;\n  height: 100%;\n  background-color: rgba(0, 0, 0, 0); }\n  .action-sheet-backdrop.active {\n    background-color: rgba(0, 0, 0, 0.4); }\n\n.action-sheet-wrapper {\n  -webkit-transform: translate3d(0, 100%, 0);\n  transform: translate3d(0, 100%, 0);\n  -webkit-transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;\n  transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  width: 100%;\n  max-width: 500px;\n  margin: auto; }\n\n.action-sheet-up {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0); }\n\n.action-sheet {\n  margin-left: 8px;\n  margin-right: 8px;\n  width: auto;\n  z-index: 11;\n  overflow: hidden; }\n  .action-sheet .button {\n    display: block;\n    padding: 1px;\n    width: 100%;\n    border-radius: 0;\n    border-color: #d1d3d6;\n    background-color: transparent;\n    color: #007aff;\n    font-size: 21px; }\n    .action-sheet .button:hover {\n      color: #007aff; }\n    .action-sheet .button.destructive {\n      color: #ff3b30; }\n      .action-sheet .button.destructive:hover {\n        color: #ff3b30; }\n  .action-sheet .button.active, .action-sheet .button.activated {\n    box-shadow: none;\n    border-color: #d1d3d6;\n    color: #007aff;\n    background: #e4e5e7; }\n\n.action-sheet-has-icons .icon {\n  position: absolute;\n  left: 16px; }\n\n.action-sheet-title {\n  padding: 16px;\n  color: #8f8f8f;\n  text-align: center;\n  font-size: 13px; }\n\n.action-sheet-group {\n  margin-bottom: 8px;\n  border-radius: 4px;\n  background-color: #fff;\n  overflow: hidden; }\n  .action-sheet-group .button {\n    border-width: 1px 0px 0px 0px; }\n  .action-sheet-group .button:first-child:last-child {\n    border-width: 0; }\n\n.action-sheet-options {\n  background: #f1f2f3; }\n\n.action-sheet-cancel .button {\n  font-weight: 500; }\n\n.action-sheet-open {\n  pointer-events: none; }\n  .action-sheet-open.modal-open .modal {\n    pointer-events: none; }\n  .action-sheet-open .action-sheet-backdrop {\n    pointer-events: auto; }\n\n.platform-android .action-sheet-backdrop.active {\n  background-color: rgba(0, 0, 0, 0.2); }\n.platform-android .action-sheet {\n  margin: 0; }\n  .platform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {\n    text-align: left;\n    border-color: transparent;\n    font-size: 16px;\n    color: inherit; }\n  .platform-android .action-sheet .action-sheet-title {\n    font-size: 14px;\n    padding: 16px;\n    color: #666; }\n  .platform-android .action-sheet .button.active, .platform-android .action-sheet .button.activated {\n    background: #e8e8e8; }\n.platform-android .action-sheet-group {\n  margin: 0;\n  border-radius: 0;\n  background-color: #fafafa; }\n.platform-android .action-sheet-cancel {\n  display: none; }\n.platform-android .action-sheet-has-icons .button {\n  padding-left: 56px; }\n\n.backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 11;\n  width: 100%;\n  height: 100%;\n  background-color: rgba(0, 0, 0, 0.4);\n  visibility: hidden;\n  opacity: 0;\n  -webkit-transition: 0.1s opacity linear;\n  transition: 0.1s opacity linear; }\n  .backdrop.visible {\n    visibility: visible; }\n  .backdrop.active {\n    opacity: 1; }\n\n/**\n * Bar (Headers and Footers)\n * --------------------------------------------------\n */\n.bar {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  position: absolute;\n  right: 0;\n  left: 0;\n  z-index: 9;\n  box-sizing: border-box;\n  padding: 5px;\n  width: 100%;\n  height: 44px;\n  border-width: 0;\n  border-style: solid;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid #ddd;\n  background-color: white;\n  /* border-width: 1px will actually create 2 device pixels on retina */\n  /* this nifty trick sets an actual 1px border on hi-res displays */\n  background-size: 0; }\n  @media (min--moz-device-pixel-ratio: 1.5), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx) {\n    .bar {\n      border: none;\n      background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n      background-position: bottom;\n      background-size: 100% 1px;\n      background-repeat: no-repeat; } }\n  .bar.bar-clear {\n    border: none;\n    background: none;\n    color: #fff; }\n    .bar.bar-clear .button {\n      color: #fff; }\n    .bar.bar-clear .title {\n      color: #fff; }\n  .bar.item-input-inset .item-input-wrapper {\n    margin-top: -1px; }\n    .bar.item-input-inset .item-input-wrapper input {\n      padding-left: 8px;\n      width: 94%;\n      height: 28px;\n      background: transparent; }\n  .bar.bar-light {\n    border-color: #ddd;\n    background-color: white;\n    background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n    color: #444; }\n    .bar.bar-light .title {\n      color: #444; }\n    .bar.bar-light.bar-footer {\n      background-image: linear-gradient(180deg, #ddd, #ddd 50%, transparent 50%); }\n  .bar.bar-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n    color: #444; }\n    .bar.bar-stable .title {\n      color: #444; }\n    .bar.bar-stable.bar-footer {\n      background-image: linear-gradient(180deg, #b2b2b2, #b2b2b2 50%, transparent 50%); }\n  .bar.bar-positive {\n    border-color: #0c63ee;\n    background-color: #387ef5;\n    background-image: linear-gradient(0deg, #0c63ee, #0c63ee 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-positive .title {\n      color: #fff; }\n    .bar.bar-positive.bar-footer {\n      background-image: linear-gradient(180deg, #0c63ee, #0c63ee 50%, transparent 50%); }\n  .bar.bar-calm {\n    border-color: #0a9ec7;\n    background-color: #11c1f3;\n    background-image: linear-gradient(0deg, #0a9ec7, #0a9ec7 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-calm .title {\n      color: #fff; }\n    .bar.bar-calm.bar-footer {\n      background-image: linear-gradient(180deg, #0a9ec7, #0a9ec7 50%, transparent 50%); }\n  .bar.bar-assertive {\n    border-color: #e42012;\n    background-color: #ef473a;\n    background-image: linear-gradient(0deg, #e42012, #e42012 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-assertive .title {\n      color: #fff; }\n    .bar.bar-assertive.bar-footer {\n      background-image: linear-gradient(180deg, #e42012, #e42012 50%, transparent 50%); }\n  .bar.bar-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-balanced .title {\n      color: #fff; }\n    .bar.bar-balanced.bar-footer {\n      background-image: linear-gradient(180deg, #28a54c, #0c63ee 50%, transparent 50%); }\n  .bar.bar-energized {\n    border-color: #e6b400;\n    background-color: #ffc900;\n    background-image: linear-gradient(0deg, #e6b400, #e6b400 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-energized .title {\n      color: #fff; }\n    .bar.bar-energized.bar-footer {\n      background-image: linear-gradient(180deg, #e6b400, #e6b400 50%, transparent 50%); }\n  .bar.bar-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-royal .title {\n      color: #fff; }\n    .bar.bar-royal.bar-footer {\n      background-image: linear-gradient(180deg, #6b46e5, #6b46e5 50%, transparent 50%); }\n  .bar.bar-dark {\n    border-color: #111;\n    background-color: #444444;\n    background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n    color: #fff; }\n    .bar.bar-dark .title {\n      color: #fff; }\n    .bar.bar-dark.bar-footer {\n      background-image: linear-gradient(180deg, #111, #111 50%, transparent 50%); }\n  .bar .title {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 0;\n    z-index: 0;\n    overflow: hidden;\n    margin: 0 10px;\n    min-width: 30px;\n    height: 43px;\n    text-align: center;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    font-size: 17px;\n    font-weight: 500;\n    line-height: 44px; }\n    .bar .title.title-left {\n      text-align: left; }\n    .bar .title.title-right {\n      text-align: right; }\n  .bar .title a {\n    color: inherit; }\n  .bar .button {\n    z-index: 1;\n    padding: 0 8px;\n    min-width: initial;\n    min-height: 31px;\n    font-weight: 400;\n    font-size: 13px;\n    line-height: 32px; }\n    .bar .button.button-icon:before, .bar .button .icon:before, .bar .button.icon:before, .bar .button.icon-left:before, .bar .button.icon-right:before {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-size: 20px;\n      line-height: 32px; }\n    .bar .button.button-icon {\n      font-size: 17px; }\n      .bar .button.button-icon .icon:before, .bar .button.button-icon:before, .bar .button.button-icon.icon-left:before, .bar .button.button-icon.icon-right:before {\n        vertical-align: top;\n        font-size: 32px;\n        line-height: 32px; }\n    .bar .button.button-clear {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-weight: 300;\n      font-size: 17px; }\n      .bar .button.button-clear .icon:before, .bar .button.button-clear.icon:before, .bar .button.button-clear.icon-left:before, .bar .button.button-clear.icon-right:before {\n        font-size: 32px;\n        line-height: 32px; }\n    .bar .button.back-button {\n      display: block;\n      margin-right: 5px;\n      padding: 0;\n      white-space: nowrap;\n      font-weight: 400; }\n    .bar .button.back-button.active, .bar .button.back-button.activated {\n      opacity: 0.2; }\n  .bar .button-bar > .button, .bar .buttons > .button {\n    min-height: 31px;\n    line-height: 32px; }\n  .bar .button-bar + .button, .bar .button + .button-bar {\n    margin-left: 5px; }\n  .bar .buttons, .bar .buttons.primary-buttons, .bar .buttons.secondary-buttons {\n    display: inherit; }\n  .bar .buttons span {\n    display: inline-block; }\n  .bar .buttons-left span {\n    margin-right: 5px;\n    display: inherit; }\n  .bar .buttons-right span {\n    margin-left: 5px;\n    display: inherit; }\n  .bar .title + .button:last-child, .bar > .button + .button:last-child, .bar > .button.pull-right, .bar .buttons.pull-right, .bar .title + .buttons {\n    position: absolute;\n    top: 5px;\n    right: 5px;\n    bottom: 5px; }\n\n.platform-android .nav-bar-has-subheader .bar {\n  background-image: none; }\n.platform-android .bar .back-button .icon:before {\n  font-size: 24px; }\n.platform-android .bar .title {\n  font-size: 19px;\n  line-height: 44px; }\n\n.bar-light .button {\n  border-color: #ddd;\n  background-color: white;\n  color: #444; }\n  .bar-light .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .bar-light .button.active, .bar-light .button.activated {\n    border-color: #ccc;\n    background-color: #fafafa;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-light .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #444;\n    font-size: 17px; }\n  .bar-light .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-stable .button {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444; }\n  .bar-stable .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .bar-stable .button.active, .bar-stable .button.activated {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-stable .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #444;\n    font-size: 17px; }\n  .bar-stable .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-positive .button {\n  border-color: #0c63ee;\n  background-color: #387ef5;\n  color: #fff; }\n  .bar-positive .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-positive .button.active, .bar-positive .button.activated {\n    border-color: #0c63ee;\n    background-color: #0c63ee;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-positive .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-positive .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-calm .button {\n  border-color: #0a9ec7;\n  background-color: #11c1f3;\n  color: #fff; }\n  .bar-calm .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-calm .button.active, .bar-calm .button.activated {\n    border-color: #0a9ec7;\n    background-color: #0a9ec7;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-calm .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-calm .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-assertive .button {\n  border-color: #e42012;\n  background-color: #ef473a;\n  color: #fff; }\n  .bar-assertive .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-assertive .button.active, .bar-assertive .button.activated {\n    border-color: #e42012;\n    background-color: #e42012;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-assertive .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-assertive .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-balanced .button {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  color: #fff; }\n  .bar-balanced .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-balanced .button.active, .bar-balanced .button.activated {\n    border-color: #28a54c;\n    background-color: #28a54c;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-balanced .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-balanced .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-energized .button {\n  border-color: #e6b400;\n  background-color: #ffc900;\n  color: #fff; }\n  .bar-energized .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-energized .button.active, .bar-energized .button.activated {\n    border-color: #e6b400;\n    background-color: #e6b400;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-energized .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-energized .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-royal .button {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  color: #fff; }\n  .bar-royal .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-royal .button.active, .bar-royal .button.activated {\n    border-color: #6b46e5;\n    background-color: #6b46e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-royal .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-royal .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-dark .button {\n  border-color: #111;\n  background-color: #444444;\n  color: #fff; }\n  .bar-dark .button:hover {\n    color: #fff;\n    text-decoration: none; }\n  .bar-dark .button.active, .bar-dark .button.activated {\n    border-color: #000;\n    background-color: #262626;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .bar-dark .button.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #fff;\n    font-size: 17px; }\n  .bar-dark .button.button-icon {\n    border-color: transparent;\n    background: none; }\n\n.bar-header {\n  top: 0;\n  border-top-width: 0;\n  border-bottom-width: 1px; }\n  .bar-header.has-tabs-top {\n    border-bottom-width: 0px;\n    background-image: none; }\n\n.tabs-top .bar-header {\n  border-bottom-width: 0px;\n  background-image: none; }\n\n.bar-footer {\n  bottom: 0;\n  border-top-width: 1px;\n  border-bottom-width: 0;\n  background-position: top;\n  height: 44px; }\n  .bar-footer.item-input-inset {\n    position: absolute; }\n\n.bar-tabs {\n  padding: 0; }\n\n.bar-subheader {\n  top: 44px;\n  display: block;\n  height: 44px; }\n\n.bar-subfooter {\n  bottom: 44px;\n  display: block;\n  height: 44px; }\n\n.nav-bar-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  left: 0;\n  z-index: 9; }\n\n.bar .back-button.hide, .bar .buttons .hide {\n  display: none; }\n\n.nav-bar-tabs-top .bar {\n  background-image: none; }\n\n/**\n * Tabs\n * --------------------------------------------------\n * A navigation bar with any number of tab items supported.\n */\n.tabs {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: horizontal;\n  -moz-flex-direction: horizontal;\n  -ms-flex-direction: horizontal;\n  flex-direction: horizontal;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  color: #444;\n  position: absolute;\n  bottom: 0;\n  z-index: 5;\n  width: 100%;\n  height: 49px;\n  border-style: solid;\n  border-top-width: 1px;\n  background-size: 0;\n  line-height: 49px; }\n  .tabs .tab-item .badge {\n    background-color: #444;\n    color: #f8f8f8; }\n  @media (min--moz-device-pixel-ratio: 1.5), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx) {\n    .tabs {\n      padding-top: 2px;\n      border-top: none !important;\n      border-bottom: none;\n      background-position: top;\n      background-size: 100% 1px;\n      background-repeat: no-repeat; } }\n\n/* Allow parent element of tabs to define color, or just the tab itself */\n.tabs-light > .tabs, .tabs.tabs-light {\n  border-color: #ddd;\n  background-color: #fff;\n  background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n  color: #444; }\n  .tabs-light > .tabs .tab-item .badge, .tabs.tabs-light .tab-item .badge {\n    background-color: #444;\n    color: #fff; }\n\n.tabs-stable > .tabs, .tabs.tabs-stable {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  color: #444; }\n  .tabs-stable > .tabs .tab-item .badge, .tabs.tabs-stable .tab-item .badge {\n    background-color: #444;\n    color: #f8f8f8; }\n\n.tabs-positive > .tabs, .tabs.tabs-positive {\n  border-color: #0c63ee;\n  background-color: #387ef5;\n  background-image: linear-gradient(0deg, #0c63ee, #0c63ee 50%, transparent 50%);\n  color: #fff; }\n  .tabs-positive > .tabs .tab-item .badge, .tabs.tabs-positive .tab-item .badge {\n    background-color: #fff;\n    color: #387ef5; }\n\n.tabs-calm > .tabs, .tabs.tabs-calm {\n  border-color: #0a9ec7;\n  background-color: #11c1f3;\n  background-image: linear-gradient(0deg, #0a9ec7, #0a9ec7 50%, transparent 50%);\n  color: #fff; }\n  .tabs-calm > .tabs .tab-item .badge, .tabs.tabs-calm .tab-item .badge {\n    background-color: #fff;\n    color: #11c1f3; }\n\n.tabs-assertive > .tabs, .tabs.tabs-assertive {\n  border-color: #e42012;\n  background-color: #ef473a;\n  background-image: linear-gradient(0deg, #e42012, #e42012 50%, transparent 50%);\n  color: #fff; }\n  .tabs-assertive > .tabs .tab-item .badge, .tabs.tabs-assertive .tab-item .badge {\n    background-color: #fff;\n    color: #ef473a; }\n\n.tabs-balanced > .tabs, .tabs.tabs-balanced {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n  color: #fff; }\n  .tabs-balanced > .tabs .tab-item .badge, .tabs.tabs-balanced .tab-item .badge {\n    background-color: #fff;\n    color: #33cd5f; }\n\n.tabs-energized > .tabs, .tabs.tabs-energized {\n  border-color: #e6b400;\n  background-color: #ffc900;\n  background-image: linear-gradient(0deg, #e6b400, #e6b400 50%, transparent 50%);\n  color: #fff; }\n  .tabs-energized > .tabs .tab-item .badge, .tabs.tabs-energized .tab-item .badge {\n    background-color: #fff;\n    color: #ffc900; }\n\n.tabs-royal > .tabs, .tabs.tabs-royal {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n  color: #fff; }\n  .tabs-royal > .tabs .tab-item .badge, .tabs.tabs-royal .tab-item .badge {\n    background-color: #fff;\n    color: #886aea; }\n\n.tabs-dark > .tabs, .tabs.tabs-dark {\n  border-color: #111;\n  background-color: #444;\n  background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n  color: #fff; }\n  .tabs-dark > .tabs .tab-item .badge, .tabs.tabs-dark .tab-item .badge {\n    background-color: #fff;\n    color: #444; }\n\n.tabs-striped .tabs {\n  background-color: white;\n  background-image: none;\n  border: none;\n  border-bottom: 1px solid #ddd;\n  padding-top: 2px; }\n.tabs-striped .tab-item.tab-item-active, .tabs-striped .tab-item.active, .tabs-striped .tab-item.activated {\n  margin-top: -2px;\n  border-style: solid;\n  border-width: 2px 0 0 0;\n  border-color: #444; }\n  .tabs-striped .tab-item.tab-item-active .badge, .tabs-striped .tab-item.active .badge, .tabs-striped .tab-item.activated .badge {\n    top: 2px;\n    opacity: 1; }\n.tabs-striped.tabs-light .tabs {\n  background-color: #fff; }\n.tabs-striped.tabs-light .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-light .tab-item.tab-item-active, .tabs-striped.tabs-light .tab-item.active, .tabs-striped.tabs-light .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #444; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-stable .tabs {\n  background-color: #f8f8f8; }\n.tabs-striped.tabs-stable .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-stable .tab-item.tab-item-active, .tabs-striped.tabs-stable .tab-item.active, .tabs-striped.tabs-stable .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #444; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-positive .tabs {\n  background-color: #387ef5; }\n.tabs-striped.tabs-positive .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-positive .tab-item.tab-item-active, .tabs-striped.tabs-positive .tab-item.active, .tabs-striped.tabs-positive .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-calm .tabs {\n  background-color: #11c1f3; }\n.tabs-striped.tabs-calm .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-calm .tab-item.tab-item-active, .tabs-striped.tabs-calm .tab-item.active, .tabs-striped.tabs-calm .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-assertive .tabs {\n  background-color: #ef473a; }\n.tabs-striped.tabs-assertive .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-assertive .tab-item.tab-item-active, .tabs-striped.tabs-assertive .tab-item.active, .tabs-striped.tabs-assertive .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-balanced .tabs {\n  background-color: #33cd5f; }\n.tabs-striped.tabs-balanced .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-balanced .tab-item.tab-item-active, .tabs-striped.tabs-balanced .tab-item.active, .tabs-striped.tabs-balanced .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-energized .tabs {\n  background-color: #ffc900; }\n.tabs-striped.tabs-energized .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-energized .tab-item.tab-item-active, .tabs-striped.tabs-energized .tab-item.active, .tabs-striped.tabs-energized .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-royal .tabs {\n  background-color: #886aea; }\n.tabs-striped.tabs-royal .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-royal .tab-item.tab-item-active, .tabs-striped.tabs-royal .tab-item.active, .tabs-striped.tabs-royal .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-dark .tabs {\n  background-color: #444; }\n.tabs-striped.tabs-dark .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-dark .tab-item.tab-item-active, .tabs-striped.tabs-dark .tab-item.active, .tabs-striped.tabs-dark .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border-style: solid;\n    border-width: 2px 0 0 0;\n    border-color: #fff; }\n.tabs-striped.tabs-top .tab-item.tab-item-active .badge, .tabs-striped.tabs-top .tab-item.active .badge, .tabs-striped.tabs-top .tab-item.activated .badge {\n  top: 4%; }\n.tabs-striped.tabs-background-light .tabs {\n  background-color: #fff;\n  background-image: none; }\n.tabs-striped.tabs-background-stable .tabs {\n  background-color: #f8f8f8;\n  background-image: none; }\n.tabs-striped.tabs-background-positive .tabs {\n  background-color: #387ef5;\n  background-image: none; }\n.tabs-striped.tabs-background-calm .tabs {\n  background-color: #11c1f3;\n  background-image: none; }\n.tabs-striped.tabs-background-assertive .tabs {\n  background-color: #ef473a;\n  background-image: none; }\n.tabs-striped.tabs-background-balanced .tabs {\n  background-color: #33cd5f;\n  background-image: none; }\n.tabs-striped.tabs-background-energized .tabs {\n  background-color: #ffc900;\n  background-image: none; }\n.tabs-striped.tabs-background-royal .tabs {\n  background-color: #886aea;\n  background-image: none; }\n.tabs-striped.tabs-background-dark .tabs {\n  background-color: #444;\n  background-image: none; }\n.tabs-striped.tabs-color-light .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-light .tab-item.tab-item-active, .tabs-striped.tabs-color-light .tab-item.active, .tabs-striped.tabs-color-light .tab-item.activated {\n    margin-top: -2px;\n    color: #fff;\n    border: 0 solid #fff;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-light .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-light .tab-item.active .badge, .tabs-striped.tabs-color-light .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-stable .tab-item {\n  color: rgba(248, 248, 248, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-stable .tab-item.tab-item-active, .tabs-striped.tabs-color-stable .tab-item.active, .tabs-striped.tabs-color-stable .tab-item.activated {\n    margin-top: -2px;\n    color: #f8f8f8;\n    border: 0 solid #f8f8f8;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-stable .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-stable .tab-item.active .badge, .tabs-striped.tabs-color-stable .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-positive .tab-item {\n  color: rgba(56, 126, 245, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-positive .tab-item.tab-item-active, .tabs-striped.tabs-color-positive .tab-item.active, .tabs-striped.tabs-color-positive .tab-item.activated {\n    margin-top: -2px;\n    color: #387ef5;\n    border: 0 solid #387ef5;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-positive .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-positive .tab-item.active .badge, .tabs-striped.tabs-color-positive .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-calm .tab-item {\n  color: rgba(17, 193, 243, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-calm .tab-item.tab-item-active, .tabs-striped.tabs-color-calm .tab-item.active, .tabs-striped.tabs-color-calm .tab-item.activated {\n    margin-top: -2px;\n    color: #11c1f3;\n    border: 0 solid #11c1f3;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-calm .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-calm .tab-item.active .badge, .tabs-striped.tabs-color-calm .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-assertive .tab-item {\n  color: rgba(239, 71, 58, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-assertive .tab-item.tab-item-active, .tabs-striped.tabs-color-assertive .tab-item.active, .tabs-striped.tabs-color-assertive .tab-item.activated {\n    margin-top: -2px;\n    color: #ef473a;\n    border: 0 solid #ef473a;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-assertive .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-assertive .tab-item.active .badge, .tabs-striped.tabs-color-assertive .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-balanced .tab-item {\n  color: rgba(51, 205, 95, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-balanced .tab-item.tab-item-active, .tabs-striped.tabs-color-balanced .tab-item.active, .tabs-striped.tabs-color-balanced .tab-item.activated {\n    margin-top: -2px;\n    color: #33cd5f;\n    border: 0 solid #33cd5f;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-balanced .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-balanced .tab-item.active .badge, .tabs-striped.tabs-color-balanced .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-energized .tab-item {\n  color: rgba(255, 201, 0, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-energized .tab-item.tab-item-active, .tabs-striped.tabs-color-energized .tab-item.active, .tabs-striped.tabs-color-energized .tab-item.activated {\n    margin-top: -2px;\n    color: #ffc900;\n    border: 0 solid #ffc900;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-energized .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-energized .tab-item.active .badge, .tabs-striped.tabs-color-energized .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-royal .tab-item {\n  color: rgba(136, 106, 234, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-royal .tab-item.tab-item-active, .tabs-striped.tabs-color-royal .tab-item.active, .tabs-striped.tabs-color-royal .tab-item.activated {\n    margin-top: -2px;\n    color: #886aea;\n    border: 0 solid #886aea;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-royal .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-royal .tab-item.active .badge, .tabs-striped.tabs-color-royal .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n.tabs-striped.tabs-color-dark .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-striped.tabs-color-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-striped.tabs-color-dark .tab-item.tab-item-active, .tabs-striped.tabs-color-dark .tab-item.active, .tabs-striped.tabs-color-dark .tab-item.activated {\n    margin-top: -2px;\n    color: #444;\n    border: 0 solid #444;\n    border-top-width: 2px; }\n    .tabs-striped.tabs-color-dark .tab-item.tab-item-active .badge, .tabs-striped.tabs-color-dark .tab-item.active .badge, .tabs-striped.tabs-color-dark .tab-item.activated .badge {\n      top: 2px;\n      opacity: 1; }\n\n.tabs-background-light .tabs, .tabs-background-light > .tabs {\n  background-color: #fff;\n  background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);\n  border-color: #ddd; }\n\n.tabs-background-stable .tabs, .tabs-background-stable > .tabs {\n  background-color: #f8f8f8;\n  background-image: linear-gradient(0deg, #b2b2b2, #b2b2b2 50%, transparent 50%);\n  border-color: #b2b2b2; }\n\n.tabs-background-positive .tabs, .tabs-background-positive > .tabs {\n  background-color: #387ef5;\n  background-image: linear-gradient(0deg, #0c63ee, #0c63ee 50%, transparent 50%);\n  border-color: #0c63ee; }\n\n.tabs-background-calm .tabs, .tabs-background-calm > .tabs {\n  background-color: #11c1f3;\n  background-image: linear-gradient(0deg, #0a9ec7, #0a9ec7 50%, transparent 50%);\n  border-color: #0a9ec7; }\n\n.tabs-background-assertive .tabs, .tabs-background-assertive > .tabs {\n  background-color: #ef473a;\n  background-image: linear-gradient(0deg, #e42012, #e42012 50%, transparent 50%);\n  border-color: #e42012; }\n\n.tabs-background-balanced .tabs, .tabs-background-balanced > .tabs {\n  background-color: #33cd5f;\n  background-image: linear-gradient(0deg, #28a54c, #28a54c 50%, transparent 50%);\n  border-color: #28a54c; }\n\n.tabs-background-energized .tabs, .tabs-background-energized > .tabs {\n  background-color: #ffc900;\n  background-image: linear-gradient(0deg, #e6b400, #e6b400 50%, transparent 50%);\n  border-color: #e6b400; }\n\n.tabs-background-royal .tabs, .tabs-background-royal > .tabs {\n  background-color: #886aea;\n  background-image: linear-gradient(0deg, #6b46e5, #6b46e5 50%, transparent 50%);\n  border-color: #6b46e5; }\n\n.tabs-background-dark .tabs, .tabs-background-dark > .tabs {\n  background-color: #444;\n  background-image: linear-gradient(0deg, #111, #111 50%, transparent 50%);\n  border-color: #111; }\n\n.tabs-color-light .tab-item {\n  color: rgba(255, 255, 255, 0.4);\n  opacity: 1; }\n  .tabs-color-light .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-light .tab-item.tab-item-active, .tabs-color-light .tab-item.active, .tabs-color-light .tab-item.activated {\n    color: #fff;\n    border: 0 solid #fff; }\n    .tabs-color-light .tab-item.tab-item-active .badge, .tabs-color-light .tab-item.active .badge, .tabs-color-light .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-stable .tab-item {\n  color: rgba(248, 248, 248, 0.4);\n  opacity: 1; }\n  .tabs-color-stable .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-stable .tab-item.tab-item-active, .tabs-color-stable .tab-item.active, .tabs-color-stable .tab-item.activated {\n    color: #f8f8f8;\n    border: 0 solid #f8f8f8; }\n    .tabs-color-stable .tab-item.tab-item-active .badge, .tabs-color-stable .tab-item.active .badge, .tabs-color-stable .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-positive .tab-item {\n  color: rgba(56, 126, 245, 0.4);\n  opacity: 1; }\n  .tabs-color-positive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-positive .tab-item.tab-item-active, .tabs-color-positive .tab-item.active, .tabs-color-positive .tab-item.activated {\n    color: #387ef5;\n    border: 0 solid #387ef5; }\n    .tabs-color-positive .tab-item.tab-item-active .badge, .tabs-color-positive .tab-item.active .badge, .tabs-color-positive .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-calm .tab-item {\n  color: rgba(17, 193, 243, 0.4);\n  opacity: 1; }\n  .tabs-color-calm .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-calm .tab-item.tab-item-active, .tabs-color-calm .tab-item.active, .tabs-color-calm .tab-item.activated {\n    color: #11c1f3;\n    border: 0 solid #11c1f3; }\n    .tabs-color-calm .tab-item.tab-item-active .badge, .tabs-color-calm .tab-item.active .badge, .tabs-color-calm .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-assertive .tab-item {\n  color: rgba(239, 71, 58, 0.4);\n  opacity: 1; }\n  .tabs-color-assertive .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-assertive .tab-item.tab-item-active, .tabs-color-assertive .tab-item.active, .tabs-color-assertive .tab-item.activated {\n    color: #ef473a;\n    border: 0 solid #ef473a; }\n    .tabs-color-assertive .tab-item.tab-item-active .badge, .tabs-color-assertive .tab-item.active .badge, .tabs-color-assertive .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-balanced .tab-item {\n  color: rgba(51, 205, 95, 0.4);\n  opacity: 1; }\n  .tabs-color-balanced .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-balanced .tab-item.tab-item-active, .tabs-color-balanced .tab-item.active, .tabs-color-balanced .tab-item.activated {\n    color: #33cd5f;\n    border: 0 solid #33cd5f; }\n    .tabs-color-balanced .tab-item.tab-item-active .badge, .tabs-color-balanced .tab-item.active .badge, .tabs-color-balanced .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-energized .tab-item {\n  color: rgba(255, 201, 0, 0.4);\n  opacity: 1; }\n  .tabs-color-energized .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-energized .tab-item.tab-item-active, .tabs-color-energized .tab-item.active, .tabs-color-energized .tab-item.activated {\n    color: #ffc900;\n    border: 0 solid #ffc900; }\n    .tabs-color-energized .tab-item.tab-item-active .badge, .tabs-color-energized .tab-item.active .badge, .tabs-color-energized .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-royal .tab-item {\n  color: rgba(136, 106, 234, 0.4);\n  opacity: 1; }\n  .tabs-color-royal .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-royal .tab-item.tab-item-active, .tabs-color-royal .tab-item.active, .tabs-color-royal .tab-item.activated {\n    color: #886aea;\n    border: 0 solid #886aea; }\n    .tabs-color-royal .tab-item.tab-item-active .badge, .tabs-color-royal .tab-item.active .badge, .tabs-color-royal .tab-item.activated .badge {\n      opacity: 1; }\n\n.tabs-color-dark .tab-item {\n  color: rgba(68, 68, 68, 0.4);\n  opacity: 1; }\n  .tabs-color-dark .tab-item .badge {\n    opacity: 0.4; }\n  .tabs-color-dark .tab-item.tab-item-active, .tabs-color-dark .tab-item.active, .tabs-color-dark .tab-item.activated {\n    color: #444;\n    border: 0 solid #444; }\n    .tabs-color-dark .tab-item.tab-item-active .badge, .tabs-color-dark .tab-item.active .badge, .tabs-color-dark .tab-item.activated .badge {\n      opacity: 1; }\n\nion-tabs.tabs-color-active-light .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-light .tab-item.tab-item-active, ion-tabs.tabs-color-active-light .tab-item.active, ion-tabs.tabs-color-active-light .tab-item.activated {\n    color: #fff; }\nion-tabs.tabs-color-active-stable .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-stable .tab-item.tab-item-active, ion-tabs.tabs-color-active-stable .tab-item.active, ion-tabs.tabs-color-active-stable .tab-item.activated {\n    color: #f8f8f8; }\nion-tabs.tabs-color-active-positive .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-positive .tab-item.tab-item-active, ion-tabs.tabs-color-active-positive .tab-item.active, ion-tabs.tabs-color-active-positive .tab-item.activated {\n    color: #387ef5; }\nion-tabs.tabs-color-active-calm .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-calm .tab-item.tab-item-active, ion-tabs.tabs-color-active-calm .tab-item.active, ion-tabs.tabs-color-active-calm .tab-item.activated {\n    color: #11c1f3; }\nion-tabs.tabs-color-active-assertive .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-assertive .tab-item.tab-item-active, ion-tabs.tabs-color-active-assertive .tab-item.active, ion-tabs.tabs-color-active-assertive .tab-item.activated {\n    color: #ef473a; }\nion-tabs.tabs-color-active-balanced .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-balanced .tab-item.tab-item-active, ion-tabs.tabs-color-active-balanced .tab-item.active, ion-tabs.tabs-color-active-balanced .tab-item.activated {\n    color: #33cd5f; }\nion-tabs.tabs-color-active-energized .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-energized .tab-item.tab-item-active, ion-tabs.tabs-color-active-energized .tab-item.active, ion-tabs.tabs-color-active-energized .tab-item.activated {\n    color: #ffc900; }\nion-tabs.tabs-color-active-royal .tab-item {\n  color: #444; }\n  ion-tabs.tabs-color-active-royal .tab-item.tab-item-active, ion-tabs.tabs-color-active-royal .tab-item.active, ion-tabs.tabs-color-active-royal .tab-item.activated {\n    color: #886aea; }\nion-tabs.tabs-color-active-dark .tab-item {\n  color: #fff; }\n  ion-tabs.tabs-color-active-dark .tab-item.tab-item-active, ion-tabs.tabs-color-active-dark .tab-item.active, ion-tabs.tabs-color-active-dark .tab-item.activated {\n    color: #444; }\n\n.tabs-top.tabs-striped {\n  padding-bottom: 0; }\n  .tabs-top.tabs-striped .tab-item {\n    background: transparent;\n    -webkit-transition: color 0.1s ease;\n    -moz-transition: color 0.1s ease;\n    -ms-transition: color 0.1s ease;\n    -o-transition: color 0.1s ease;\n    transition: color 0.1s ease; }\n    .tabs-top.tabs-striped .tab-item.tab-item-active, .tabs-top.tabs-striped .tab-item.active, .tabs-top.tabs-striped .tab-item.activated {\n      margin-top: 1px;\n      border-width: 0px 0px 2px 0px !important;\n      border-style: solid; }\n      .tabs-top.tabs-striped .tab-item.tab-item-active > .badge, .tabs-top.tabs-striped .tab-item.tab-item-active > i, .tabs-top.tabs-striped .tab-item.active > .badge, .tabs-top.tabs-striped .tab-item.active > i, .tabs-top.tabs-striped .tab-item.activated > .badge, .tabs-top.tabs-striped .tab-item.activated > i {\n        margin-top: -1px; }\n    .tabs-top.tabs-striped .tab-item .badge {\n      -webkit-transition: color 0.2s ease;\n      -moz-transition: color 0.2s ease;\n      -ms-transition: color 0.2s ease;\n      -o-transition: color 0.2s ease;\n      transition: color 0.2s ease; }\n\n/* Allow parent element to have tabs-top */\n/* If you change this, change platform.scss as well */\n.tabs-top > .tabs, .tabs.tabs-top {\n  top: 44px;\n  padding-top: 0;\n  background-position: bottom;\n  border-top-width: 0;\n  border-bottom-width: 1px; }\n  .tabs-top > .tabs .tab-item.tab-item-active .badge, .tabs-top > .tabs .tab-item.active .badge, .tabs-top > .tabs .tab-item.activated .badge, .tabs.tabs-top .tab-item.tab-item-active .badge, .tabs.tabs-top .tab-item.active .badge, .tabs.tabs-top .tab-item.activated .badge {\n    top: 4%; }\n\n.tabs-top ~ .bar-header {\n  border-bottom-width: 0; }\n\n.tab-item {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  overflow: hidden;\n  max-width: 150px;\n  height: 100%;\n  color: inherit;\n  text-align: center;\n  text-decoration: none;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-weight: 400;\n  font-size: 14px;\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif;\n  opacity: 0.7; }\n  .tab-item:hover {\n    cursor: pointer; }\n  .tab-item.tab-hidden {\n    display: none; }\n\n.tabs-item-hide > .tabs, .tabs.tabs-item-hide {\n  display: none; }\n\n.tabs-icon-top > .tabs .tab-item, .tabs-icon-top.tabs .tab-item, .tabs-icon-bottom > .tabs .tab-item, .tabs-icon-bottom.tabs .tab-item {\n  font-size: 10px;\n  line-height: 14px; }\n\n.tab-item .icon {\n  display: block;\n  margin: 0 auto;\n  height: 32px;\n  font-size: 32px; }\n\n.tabs-icon-left.tabs .tab-item, .tabs-icon-left > .tabs .tab-item, .tabs-icon-right.tabs .tab-item, .tabs-icon-right > .tabs .tab-item {\n  font-size: 10px; }\n  .tabs-icon-left.tabs .tab-item .icon, .tabs-icon-left > .tabs .tab-item .icon, .tabs-icon-right.tabs .tab-item .icon, .tabs-icon-right > .tabs .tab-item .icon {\n    display: inline-block;\n    vertical-align: top;\n    margin-top: -0.1em; }\n    .tabs-icon-left.tabs .tab-item .icon:before, .tabs-icon-left > .tabs .tab-item .icon:before, .tabs-icon-right.tabs .tab-item .icon:before, .tabs-icon-right > .tabs .tab-item .icon:before {\n      font-size: 24px;\n      line-height: 49px; }\n\n.tabs-icon-left > .tabs .tab-item .icon, .tabs-icon-left.tabs .tab-item .icon {\n  padding-right: 3px; }\n\n.tabs-icon-right > .tabs .tab-item .icon, .tabs-icon-right.tabs .tab-item .icon {\n  padding-left: 3px; }\n\n.tabs-icon-only > .tabs .icon, .tabs-icon-only.tabs .icon {\n  line-height: inherit; }\n\n.tab-item.has-badge {\n  position: relative; }\n\n.tab-item .badge {\n  position: absolute;\n  top: 4%;\n  right: 33%;\n  right: calc(50% - 26px);\n  padding: 1px 6px;\n  height: auto;\n  font-size: 12px;\n  line-height: 16px; }\n\n/* Navigational tab */\n/* Active state for tab */\n.tab-item.tab-item-active, .tab-item.active, .tab-item.activated {\n  opacity: 1; }\n  .tab-item.tab-item-active.tab-item-light, .tab-item.active.tab-item-light, .tab-item.activated.tab-item-light {\n    color: #fff; }\n  .tab-item.tab-item-active.tab-item-stable, .tab-item.active.tab-item-stable, .tab-item.activated.tab-item-stable {\n    color: #f8f8f8; }\n  .tab-item.tab-item-active.tab-item-positive, .tab-item.active.tab-item-positive, .tab-item.activated.tab-item-positive {\n    color: #387ef5; }\n  .tab-item.tab-item-active.tab-item-calm, .tab-item.active.tab-item-calm, .tab-item.activated.tab-item-calm {\n    color: #11c1f3; }\n  .tab-item.tab-item-active.tab-item-assertive, .tab-item.active.tab-item-assertive, .tab-item.activated.tab-item-assertive {\n    color: #ef473a; }\n  .tab-item.tab-item-active.tab-item-balanced, .tab-item.active.tab-item-balanced, .tab-item.activated.tab-item-balanced {\n    color: #33cd5f; }\n  .tab-item.tab-item-active.tab-item-energized, .tab-item.active.tab-item-energized, .tab-item.activated.tab-item-energized {\n    color: #ffc900; }\n  .tab-item.tab-item-active.tab-item-royal, .tab-item.active.tab-item-royal, .tab-item.activated.tab-item-royal {\n    color: #886aea; }\n  .tab-item.tab-item-active.tab-item-dark, .tab-item.active.tab-item-dark, .tab-item.activated.tab-item-dark {\n    color: #444; }\n\n.item.tabs {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  padding: 0; }\n  .item.tabs .icon:before {\n    position: relative; }\n\n.tab-item.disabled, .tab-item[disabled] {\n  opacity: 0.4;\n  cursor: default;\n  pointer-events: none; }\n\n/**\n * Menus\n * --------------------------------------------------\n * Side panel structure\n */\n.menu {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  z-index: 0;\n  overflow: hidden;\n  min-height: 100%;\n  max-height: 100%;\n  width: 275px;\n  background-color: #fff; }\n  .menu .scroll-content {\n    z-index: 10; }\n  .menu .bar-header {\n    z-index: 11; }\n\n.menu-content {\n  -webkit-transform: none;\n  transform: none;\n  box-shadow: -1px 0px 2px rgba(0, 0, 0, 0.2), 1px 0px 2px rgba(0, 0, 0, 0.2); }\n\n.menu-open .menu-content .pane, .menu-open .menu-content .scroll-content {\n  pointer-events: none; }\n\n.grade-b .menu-content, .grade-c .menu-content {\n  -webkit-box-sizing: content-box;\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  right: -1px;\n  left: -1px;\n  border-right: 1px solid #ccc;\n  border-left: 1px solid #ccc;\n  box-shadow: none; }\n\n.menu-left {\n  left: 0; }\n\n.menu-right {\n  right: 0; }\n\n.aside-open.aside-resizing .menu-right {\n  display: none; }\n\n.menu-animated {\n  -webkit-transition: -webkit-transform 200ms ease;\n  transition: transform 200ms ease; }\n\n/**\n * Modals\n * --------------------------------------------------\n * Modals are independent windows that slide in from off-screen.\n */\n.modal-backdrop, .modal-backdrop-bg {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 10;\n  width: 100%;\n  height: 100%; }\n\n.modal-backdrop-bg {\n  pointer-events: none; }\n\n.modal {\n  display: block;\n  position: absolute;\n  top: 0;\n  z-index: 10;\n  overflow: hidden;\n  min-height: 100%;\n  width: 100%;\n  background-color: #fff; }\n\n@media (min-width: 680px) {\n  .modal {\n    top: 20%;\n    right: 20%;\n    bottom: 20%;\n    left: 20%;\n    min-height: 240px;\n    width: 60%; }\n  .modal.ng-leave-active {\n    bottom: 0; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .bar-header:not(.bar-subheader) {\n    height: 44px; }\n    .platform-ios.platform-cordova .modal-wrapper .modal .bar-header:not(.bar-subheader) > * {\n      margin-top: 0; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .tabs-top > .tabs, .platform-ios.platform-cordova .modal-wrapper .modal .tabs.tabs-top {\n    top: 44px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header, .platform-ios.platform-cordova .modal-wrapper .modal .bar-subheader {\n    top: 44px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-subheader {\n    top: 88px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header.has-tabs-top {\n    top: 93px; }\n  .platform-ios.platform-cordova .modal-wrapper .modal .has-header.has-subheader.has-tabs-top {\n    top: 137px; }\n  .modal-backdrop-bg {\n    -webkit-transition: opacity 300ms ease-in-out;\n    transition: opacity 300ms ease-in-out;\n    background-color: #000;\n    opacity: 0; }\n  .active .modal-backdrop-bg {\n    opacity: 0.5; } }\n\n.modal-open {\n  pointer-events: none; }\n  .modal-open .modal, .modal-open .modal-backdrop {\n    pointer-events: auto; }\n  .modal-open.loading-active .modal, .modal-open.loading-active .modal-backdrop {\n    pointer-events: none; }\n\n/**\n * Popovers\n * --------------------------------------------------\n * Popovers are independent views which float over content\n */\n.popover-backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 10;\n  width: 100%;\n  height: 100%;\n  background-color: rgba(0, 0, 0, 0); }\n  .popover-backdrop.active {\n    background-color: rgba(0, 0, 0, 0.1); }\n\n.popover {\n  position: absolute;\n  top: 25%;\n  left: 50%;\n  z-index: 10;\n  display: block;\n  margin-top: 12px;\n  margin-left: -110px;\n  height: 280px;\n  width: 220px;\n  background-color: #fff;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);\n  opacity: 0; }\n  .popover .item:first-child {\n    border-top: 0; }\n  .popover .item:last-child {\n    border-bottom: 0; }\n  .popover.popover-bottom {\n    margin-top: -12px; }\n\n.popover, .popover .bar-header {\n  border-radius: 2px; }\n\n.popover .scroll-content {\n  z-index: 1;\n  margin: 2px 0; }\n\n.popover .bar-header {\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0; }\n\n.popover .has-header {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0; }\n\n.popover-arrow {\n  display: none; }\n\n.platform-ios .popover {\n  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);\n  border-radius: 10px; }\n.platform-ios .popover .bar-header {\n  -webkit-border-top-right-radius: 10px;\n  border-top-right-radius: 10px;\n  -webkit-border-top-left-radius: 10px;\n  border-top-left-radius: 10px; }\n.platform-ios .popover .scroll-content {\n  margin: 8px 0;\n  border-radius: 10px; }\n.platform-ios .popover .scroll-content.has-header {\n  margin-top: 0; }\n.platform-ios .popover-arrow {\n  position: absolute;\n  display: block;\n  top: -17px;\n  width: 30px;\n  height: 19px;\n  overflow: hidden; }\n  .platform-ios .popover-arrow:after {\n    position: absolute;\n    top: 12px;\n    left: 5px;\n    width: 20px;\n    height: 20px;\n    background-color: #fff;\n    border-radius: 3px;\n    content: '';\n    -webkit-transform: rotate(-45deg);\n    transform: rotate(-45deg); }\n.platform-ios .popover-bottom .popover-arrow {\n  top: auto;\n  bottom: -10px; }\n  .platform-ios .popover-bottom .popover-arrow:after {\n    top: -6px; }\n\n.platform-android .popover {\n  margin-top: -32px;\n  background-color: #fafafa;\n  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }\n  .platform-android .popover .item {\n    border-color: #fafafa;\n    background-color: #fafafa;\n    color: #4d4d4d; }\n  .platform-android .popover.popover-bottom {\n    margin-top: 32px; }\n.platform-android .popover-backdrop, .platform-android .popover-backdrop.active {\n  background-color: transparent; }\n\n.popover-open {\n  pointer-events: none; }\n  .popover-open .popover, .popover-open .popover-backdrop {\n    pointer-events: auto; }\n  .popover-open.loading-active .popover, .popover-open.loading-active .popover-backdrop {\n    pointer-events: none; }\n\n@media (min-width: 680px) {\n  .popover {\n    width: 360px; } }\n\n/**\n * Popups\n * --------------------------------------------------\n */\n.popup-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  background: rgba(0, 0, 0, 0);\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  z-index: 12;\n  visibility: hidden; }\n  .popup-container.popup-showing {\n    visibility: visible; }\n  .popup-container.popup-hidden .popup {\n    -webkit-animation-name: scaleOut;\n    animation-name: scaleOut;\n    -webkit-animation-duration: 0.1s;\n    animation-duration: 0.1s;\n    -webkit-animation-timing-function: ease-in-out;\n    animation-timing-function: ease-in-out;\n    -webkit-animation-fill-mode: both;\n    animation-fill-mode: both; }\n  .popup-container.active .popup {\n    -webkit-animation-name: superScaleIn;\n    animation-name: superScaleIn;\n    -webkit-animation-duration: 0.2s;\n    animation-duration: 0.2s;\n    -webkit-animation-timing-function: ease-in-out;\n    animation-timing-function: ease-in-out;\n    -webkit-animation-fill-mode: both;\n    animation-fill-mode: both; }\n  .popup-container .popup {\n    width: 250px;\n    max-width: 100%;\n    max-height: 90%;\n    border-radius: 0px;\n    background-color: rgba(255, 255, 255, 0.9);\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -moz-flex;\n    display: -ms-flexbox;\n    display: flex;\n    -webkit-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -moz-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n  .popup-container input, .popup-container textarea {\n    width: 100%; }\n\n.popup-head {\n  padding: 15px 10px;\n  border-bottom: 1px solid #eee;\n  text-align: center; }\n\n.popup-title {\n  margin: 0;\n  padding: 0;\n  font-size: 15px; }\n\n.popup-sub-title {\n  margin: 5px 0 0 0;\n  padding: 0;\n  font-weight: normal;\n  font-size: 11px; }\n\n.popup-body {\n  padding: 10px;\n  overflow: auto; }\n\n.popup-buttons {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-direction: normal;\n  -webkit-box-orient: horizontal;\n  -webkit-flex-direction: row;\n  -moz-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n  padding: 10px;\n  min-height: 65px; }\n  .popup-buttons .button {\n    -webkit-box-flex: 1;\n    -webkit-flex: 1;\n    -moz-box-flex: 1;\n    -moz-flex: 1;\n    -ms-flex: 1;\n    flex: 1;\n    display: block;\n    min-height: 45px;\n    border-radius: 2px;\n    line-height: 20px;\n    margin-right: 5px; }\n    .popup-buttons .button:last-child {\n      margin-right: 0px; }\n\n.popup-open {\n  pointer-events: none; }\n  .popup-open.modal-open .modal {\n    pointer-events: none; }\n  .popup-open .popup-backdrop, .popup-open .popup {\n    pointer-events: auto; }\n\n/**\n * Loading\n * --------------------------------------------------\n */\n.loading-container {\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 13;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  -webkit-justify-content: center;\n  -moz-justify-content: center;\n  justify-content: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  -webkit-transition: 0.2s opacity linear;\n  transition: 0.2s opacity linear;\n  visibility: hidden;\n  opacity: 0; }\n  .loading-container:not(.visible) .icon {\n    display: none; }\n  .loading-container.visible {\n    visibility: visible; }\n  .loading-container.active {\n    opacity: 1; }\n  .loading-container .loading {\n    padding: 20px;\n    border-radius: 5px;\n    background-color: rgba(0, 0, 0, 0.7);\n    color: #fff;\n    text-align: center;\n    text-overflow: ellipsis;\n    font-size: 15px; }\n    .loading-container .loading h1, .loading-container .loading h2, .loading-container .loading h3, .loading-container .loading h4, .loading-container .loading h5, .loading-container .loading h6 {\n      color: #fff; }\n\n/**\n * Items\n * --------------------------------------------------\n */\n.item {\n  border-color: #ddd;\n  background-color: #fff;\n  color: #444;\n  position: relative;\n  z-index: 2;\n  display: block;\n  margin: -1px;\n  padding: 16px;\n  border-width: 1px;\n  border-style: solid;\n  font-size: 16px; }\n  .item h2 {\n    margin: 0 0 2px 0;\n    font-size: 16px;\n    font-weight: normal; }\n  .item h3 {\n    margin: 0 0 4px 0;\n    font-size: 14px; }\n  .item h4 {\n    margin: 0 0 4px 0;\n    font-size: 12px; }\n  .item h5, .item h6 {\n    margin: 0 0 3px 0;\n    font-size: 10px; }\n  .item p {\n    color: #666;\n    font-size: 14px;\n    margin-bottom: 2px; }\n  .item h1:last-child, .item h2:last-child, .item h3:last-child, .item h4:last-child, .item h5:last-child, .item h6:last-child, .item p:last-child {\n    margin-bottom: 0; }\n  .item .badge {\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -moz-flex;\n    display: -ms-flexbox;\n    display: flex;\n    position: absolute;\n    top: 16px;\n    right: 32px; }\n  .item.item-button-right .badge {\n    right: 67px; }\n  .item.item-divider .badge {\n    top: 8px; }\n  .item .badge + .badge {\n    margin-right: 5px; }\n  .item.item-light {\n    border-color: #ddd;\n    background-color: #fff;\n    color: #444; }\n  .item.item-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    color: #444; }\n  .item.item-positive {\n    border-color: #0c63ee;\n    background-color: #387ef5;\n    color: #fff; }\n  .item.item-calm {\n    border-color: #0a9ec7;\n    background-color: #11c1f3;\n    color: #fff; }\n  .item.item-assertive {\n    border-color: #e42012;\n    background-color: #ef473a;\n    color: #fff; }\n  .item.item-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    color: #fff; }\n  .item.item-energized {\n    border-color: #e6b400;\n    background-color: #ffc900;\n    color: #fff; }\n  .item.item-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    color: #fff; }\n  .item.item-dark {\n    border-color: #111;\n    background-color: #444;\n    color: #fff; }\n  .item[ng-click]:hover {\n    cursor: pointer; }\n\n.list-borderless .item, .item-borderless {\n  border-width: 0; }\n\n.item.active, .item.activated, .item-complex.active .item-content, .item-complex.activated .item-content, .item .item-content.active, .item .item-content.activated {\n  border-color: #ccc;\n  background-color: #D9D9D9; }\n  .item.active.item-light, .item.activated.item-light, .item-complex.active .item-content.item-light, .item-complex.activated .item-content.item-light, .item .item-content.active.item-light, .item .item-content.activated.item-light {\n    border-color: #ccc;\n    background-color: #fafafa; }\n  .item.active.item-stable, .item.activated.item-stable, .item-complex.active .item-content.item-stable, .item-complex.activated .item-content.item-stable, .item .item-content.active.item-stable, .item .item-content.activated.item-stable {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5; }\n  .item.active.item-positive, .item.activated.item-positive, .item-complex.active .item-content.item-positive, .item-complex.activated .item-content.item-positive, .item .item-content.active.item-positive, .item .item-content.activated.item-positive {\n    border-color: #0c63ee;\n    background-color: #0c63ee; }\n  .item.active.item-calm, .item.activated.item-calm, .item-complex.active .item-content.item-calm, .item-complex.activated .item-content.item-calm, .item .item-content.active.item-calm, .item .item-content.activated.item-calm {\n    border-color: #0a9ec7;\n    background-color: #0a9ec7; }\n  .item.active.item-assertive, .item.activated.item-assertive, .item-complex.active .item-content.item-assertive, .item-complex.activated .item-content.item-assertive, .item .item-content.active.item-assertive, .item .item-content.activated.item-assertive {\n    border-color: #e42012;\n    background-color: #e42012; }\n  .item.active.item-balanced, .item.activated.item-balanced, .item-complex.active .item-content.item-balanced, .item-complex.activated .item-content.item-balanced, .item .item-content.active.item-balanced, .item .item-content.activated.item-balanced {\n    border-color: #28a54c;\n    background-color: #28a54c; }\n  .item.active.item-energized, .item.activated.item-energized, .item-complex.active .item-content.item-energized, .item-complex.activated .item-content.item-energized, .item .item-content.active.item-energized, .item .item-content.activated.item-energized {\n    border-color: #e6b400;\n    background-color: #e6b400; }\n  .item.active.item-royal, .item.activated.item-royal, .item-complex.active .item-content.item-royal, .item-complex.activated .item-content.item-royal, .item .item-content.active.item-royal, .item .item-content.activated.item-royal {\n    border-color: #6b46e5;\n    background-color: #6b46e5; }\n  .item.active.item-dark, .item.activated.item-dark, .item-complex.active .item-content.item-dark, .item-complex.activated .item-content.item-dark, .item .item-content.active.item-dark, .item .item-content.activated.item-dark {\n    border-color: #000;\n    background-color: #262626; }\n\n.item, .item h1, .item h2, .item h3, .item h4, .item h5, .item h6, .item p, .item-content, .item-content h1, .item-content h2, .item-content h3, .item-content h4, .item-content h5, .item-content h6, .item-content p {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap; }\n\na.item {\n  color: inherit;\n  text-decoration: none; }\n  a.item:hover, a.item:focus {\n    text-decoration: none; }\n\n/**\n * Complex Items\n * --------------------------------------------------\n * Adding .item-complex allows the .item to be slidable and\n * have options underneath the button, but also requires an\n * additional .item-content element inside .item.\n * Basically .item-complex removes any default settings which\n * .item added, so that .item-content looks them as just .item.\n */\n.item-complex, a.item.item-complex, button.item.item-complex {\n  padding: 0; }\n\n.item-complex .item-content, .item-radio .item-content {\n  position: relative;\n  z-index: 2;\n  padding: 16px 49px 16px 16px;\n  border: none;\n  background-color: white; }\n\na.item-content {\n  display: block;\n  color: inherit;\n  text-decoration: none; }\n\n.item-text-wrap .item, .item-text-wrap .item-content, .item-text-wrap, .item-text-wrap h1, .item-text-wrap h2, .item-text-wrap h3, .item-text-wrap h4, .item-text-wrap h5, .item-text-wrap h6, .item-text-wrap p, .item-complex.item-text-wrap .item-content, .item-body h1, .item-body h2, .item-body h3, .item-body h4, .item-body h5, .item-body h6, .item-body p {\n  overflow: visible;\n  white-space: normal; }\n\n.item-complex.item-text-wrap, .item-complex.item-text-wrap h1, .item-complex.item-text-wrap h2, .item-complex.item-text-wrap h3, .item-complex.item-text-wrap h4, .item-complex.item-text-wrap h5, .item-complex.item-text-wrap h6, .item-complex.item-text-wrap p {\n  overflow: visible;\n  white-space: normal; }\n\n.item-complex.item-light > .item-content {\n  border-color: #ddd;\n  background-color: #fff;\n  color: #444; }\n  .item-complex.item-light > .item-content.active, .item-complex.item-light > .item-content:active {\n    border-color: #ccc;\n    background-color: #fafafa; }\n.item-complex.item-stable > .item-content {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444; }\n  .item-complex.item-stable > .item-content.active, .item-complex.item-stable > .item-content:active {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5; }\n.item-complex.item-positive > .item-content {\n  border-color: #0c63ee;\n  background-color: #387ef5;\n  color: #fff; }\n  .item-complex.item-positive > .item-content.active, .item-complex.item-positive > .item-content:active {\n    border-color: #0c63ee;\n    background-color: #0c63ee; }\n.item-complex.item-calm > .item-content {\n  border-color: #0a9ec7;\n  background-color: #11c1f3;\n  color: #fff; }\n  .item-complex.item-calm > .item-content.active, .item-complex.item-calm > .item-content:active {\n    border-color: #0a9ec7;\n    background-color: #0a9ec7; }\n.item-complex.item-assertive > .item-content {\n  border-color: #e42012;\n  background-color: #ef473a;\n  color: #fff; }\n  .item-complex.item-assertive > .item-content.active, .item-complex.item-assertive > .item-content:active {\n    border-color: #e42012;\n    background-color: #e42012; }\n.item-complex.item-balanced > .item-content {\n  border-color: #28a54c;\n  background-color: #33cd5f;\n  color: #fff; }\n  .item-complex.item-balanced > .item-content.active, .item-complex.item-balanced > .item-content:active {\n    border-color: #28a54c;\n    background-color: #28a54c; }\n.item-complex.item-energized > .item-content {\n  border-color: #e6b400;\n  background-color: #ffc900;\n  color: #fff; }\n  .item-complex.item-energized > .item-content.active, .item-complex.item-energized > .item-content:active {\n    border-color: #e6b400;\n    background-color: #e6b400; }\n.item-complex.item-royal > .item-content {\n  border-color: #6b46e5;\n  background-color: #886aea;\n  color: #fff; }\n  .item-complex.item-royal > .item-content.active, .item-complex.item-royal > .item-content:active {\n    border-color: #6b46e5;\n    background-color: #6b46e5; }\n.item-complex.item-dark > .item-content {\n  border-color: #111;\n  background-color: #444;\n  color: #fff; }\n  .item-complex.item-dark > .item-content.active, .item-complex.item-dark > .item-content:active {\n    border-color: #000;\n    background-color: #262626; }\n\n/**\n * Item Icons\n * --------------------------------------------------\n */\n.item-icon-left .icon, .item-icon-right .icon {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 0;\n  height: 100%;\n  font-size: 32px; }\n  .item-icon-left .icon:before, .item-icon-right .icon:before {\n    display: block;\n    width: 32px;\n    text-align: center; }\n\n.item .fill-icon {\n  min-width: 30px;\n  min-height: 30px;\n  font-size: 28px; }\n\n.item-icon-left {\n  padding-left: 54px; }\n  .item-icon-left .icon {\n    left: 11px; }\n\n.item-complex.item-icon-left {\n  padding-left: 0; }\n  .item-complex.item-icon-left .item-content {\n    padding-left: 54px; }\n\n.item-icon-right {\n  padding-right: 54px; }\n  .item-icon-right .icon {\n    right: 11px; }\n\n.item-complex.item-icon-right {\n  padding-right: 0; }\n  .item-complex.item-icon-right .item-content {\n    padding-right: 54px; }\n\n.item-icon-left.item-icon-right .icon:first-child {\n  right: auto; }\n\n.item-icon-left.item-icon-right .icon:last-child, .item-icon-left .item-delete .icon {\n  left: auto; }\n\n.item-icon-left .icon-accessory, .item-icon-right .icon-accessory {\n  color: #ccc;\n  font-size: 16px; }\n\n.item-icon-left .icon-accessory {\n  left: 3px; }\n\n.item-icon-right .icon-accessory {\n  right: 3px; }\n\n/**\n * Item Button\n * --------------------------------------------------\n * An item button is a child button inside an .item (not the entire .item)\n */\n.item-button-left {\n  padding-left: 72px; }\n\n.item-button-left > .button, .item-button-left .item-content > .button {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 8px;\n  left: 11px;\n  min-width: 34px;\n  min-height: 34px;\n  font-size: 18px;\n  line-height: 32px; }\n  .item-button-left > .button .icon:before, .item-button-left .item-content > .button .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: 31px; }\n  .item-button-left > .button > .button, .item-button-left .item-content > .button > .button {\n    margin: 0px 2px;\n    min-height: 34px;\n    font-size: 18px;\n    line-height: 32px; }\n\n.item-button-right, a.item.item-button-right, button.item.item-button-right {\n  padding-right: 80px; }\n\n.item-button-right > .button, .item-button-right .item-content > .button, .item-button-right > .buttons, .item-button-right .item-content > .buttons {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: absolute;\n  top: 8px;\n  right: 16px;\n  min-width: 34px;\n  min-height: 34px;\n  font-size: 18px;\n  line-height: 32px; }\n  .item-button-right > .button .icon:before, .item-button-right .item-content > .button .icon:before, .item-button-right > .buttons .icon:before, .item-button-right .item-content > .buttons .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: 31px; }\n  .item-button-right > .button > .button, .item-button-right .item-content > .button > .button, .item-button-right > .buttons > .button, .item-button-right .item-content > .buttons > .button {\n    margin: 0px 2px;\n    min-width: 34px;\n    min-height: 34px;\n    font-size: 18px;\n    line-height: 32px; }\n\n.item-avatar, .item-avatar .item-content, .item-avatar-left, .item-avatar-left .item-content {\n  padding-left: 72px;\n  min-height: 72px; }\n  .item-avatar > img:first-child, .item-avatar .item-image, .item-avatar .item-content > img:first-child, .item-avatar .item-content .item-image, .item-avatar-left > img:first-child, .item-avatar-left .item-image, .item-avatar-left .item-content > img:first-child, .item-avatar-left .item-content .item-image {\n    position: absolute;\n    top: 16px;\n    left: 16px;\n    max-width: 40px;\n    max-height: 40px;\n    width: 100%;\n    height: 100%;\n    border-radius: 50%; }\n\n.item-avatar-right, .item-avatar-right .item-content {\n  padding-right: 72px;\n  min-height: 72px; }\n  .item-avatar-right > img:first-child, .item-avatar-right .item-image, .item-avatar-right .item-content > img:first-child, .item-avatar-right .item-content .item-image {\n    position: absolute;\n    top: 16px;\n    right: 16px;\n    max-width: 40px;\n    max-height: 40px;\n    width: 100%;\n    height: 100%;\n    border-radius: 50%; }\n\n.item-thumbnail-left, .item-thumbnail-left .item-content {\n  padding-top: 8px;\n  padding-left: 106px;\n  min-height: 100px; }\n  .item-thumbnail-left > img:first-child, .item-thumbnail-left .item-image, .item-thumbnail-left .item-content > img:first-child, .item-thumbnail-left .item-content .item-image {\n    position: absolute;\n    top: 10px;\n    left: 10px;\n    max-width: 80px;\n    max-height: 80px;\n    width: 100%;\n    height: 100%; }\n\n.item-avatar.item-complex, .item-avatar-left.item-complex, .item-thumbnail-left.item-complex {\n  padding-top: 0;\n  padding-left: 0; }\n\n.item-thumbnail-right, .item-thumbnail-right .item-content {\n  padding-top: 8px;\n  padding-right: 106px;\n  min-height: 100px; }\n  .item-thumbnail-right > img:first-child, .item-thumbnail-right .item-image, .item-thumbnail-right .item-content > img:first-child, .item-thumbnail-right .item-content .item-image {\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    max-width: 80px;\n    max-height: 80px;\n    width: 100%;\n    height: 100%; }\n\n.item-avatar-right.item-complex, .item-thumbnail-right.item-complex {\n  padding-top: 0;\n  padding-right: 0; }\n\n.item-image {\n  padding: 0;\n  text-align: center; }\n  .item-image img:first-child, .item-image .list-img {\n    width: 100%;\n    vertical-align: middle; }\n\n.item-body {\n  overflow: auto;\n  padding: 16px;\n  text-overflow: inherit;\n  white-space: normal; }\n  .item-body h1, .item-body h2, .item-body h3, .item-body h4, .item-body h5, .item-body h6, .item-body p {\n    margin-top: 16px;\n    margin-bottom: 16px; }\n\n.item-divider {\n  padding-top: 8px;\n  padding-bottom: 8px;\n  min-height: 30px;\n  background-color: #f5f5f5;\n  color: #222;\n  font-weight: 500; }\n\n.platform-ios .item-divider-platform, .item-divider-ios {\n  padding-top: 26px;\n  text-transform: uppercase;\n  font-weight: 300;\n  font-size: 13px;\n  background-color: #efeff4;\n  color: #555; }\n\n.platform-android .item-divider-platform, .item-divider-android {\n  font-weight: 300;\n  font-size: 13px; }\n\n.item-note {\n  float: right;\n  color: #aaa;\n  font-size: 14px; }\n\n.item-left-editable .item-content, .item-right-editable .item-content {\n  -webkit-transition-duration: 250ms;\n  transition-duration: 250ms;\n  -webkit-transition-timing-function: ease-in-out;\n  transition-timing-function: ease-in-out;\n  -webkit-transition-property: -webkit-transform;\n  -moz-transition-property: -moz-transform;\n  transition-property: transform; }\n\n.list-left-editing .item-left-editable .item-content, .item-left-editing.item-left-editable .item-content {\n  -webkit-transform: translate3d(50px, 0, 0);\n  transform: translate3d(50px, 0, 0); }\n\n.item-remove-animate.ng-leave {\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms; }\n.item-remove-animate.ng-leave .item-content, .item-remove-animate.ng-leave:last-of-type {\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms;\n  -webkit-transition-timing-function: ease-in;\n  transition-timing-function: ease-in;\n  -webkit-transition-property: all;\n  transition-property: all; }\n.item-remove-animate.ng-leave.ng-leave-active .item-content {\n  opacity: 0;\n  -webkit-transform: translate3d(-100%, 0, 0) !important;\n  transform: translate3d(-100%, 0, 0) !important; }\n.item-remove-animate.ng-leave.ng-leave-active:last-of-type {\n  opacity: 0; }\n.item-remove-animate.ng-leave.ng-leave-active ~ ion-item:not(.ng-leave) {\n  -webkit-transform: translate3d(0, -webkit-calc(-100% + 1px), 0);\n  transform: translate3d(0, calc(-100% + 1px), 0);\n  -webkit-transition-duration: 300ms;\n  transition-duration: 300ms;\n  -webkit-transition-timing-function: cubic-bezier(0.25, 0.81, 0.24, 1);\n  transition-timing-function: cubic-bezier(0.25, 0.81, 0.24, 1);\n  -webkit-transition-property: all;\n  transition-property: all; }\n\n.item-left-edit {\n  -webkit-transition: all ease-in-out 125ms;\n  transition: all ease-in-out 125ms;\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 0;\n  width: 50px;\n  height: 100%;\n  line-height: 100%;\n  display: none;\n  opacity: 0;\n  -webkit-transform: translate3d(-21px, 0, 0);\n  transform: translate3d(-21px, 0, 0); }\n  .item-left-edit .button {\n    height: 100%; }\n    .item-left-edit .button.icon {\n      display: -webkit-box;\n      display: -webkit-flex;\n      display: -moz-box;\n      display: -moz-flex;\n      display: -ms-flexbox;\n      display: flex;\n      -webkit-box-align: center;\n      -ms-flex-align: center;\n      -webkit-align-items: center;\n      -moz-align-items: center;\n      align-items: center;\n      position: absolute;\n      top: 0;\n      height: 100%; }\n  .item-left-edit.visible {\n    display: block; }\n    .item-left-edit.visible.active {\n      opacity: 1;\n      -webkit-transform: translate3d(8px, 0, 0);\n      transform: translate3d(8px, 0, 0); }\n\n.list-left-editing .item-left-edit {\n  -webkit-transition-delay: 125ms;\n  transition-delay: 125ms; }\n\n.item-delete .button.icon {\n  color: #ef473a;\n  font-size: 24px; }\n  .item-delete .button.icon:hover {\n    opacity: 0.7; }\n\n.item-right-edit {\n  -webkit-transition: all ease-in-out 250ms;\n  transition: all ease-in-out 250ms;\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 3;\n  width: 75px;\n  height: 100%;\n  background: inherit;\n  padding-left: 20px;\n  display: block;\n  opacity: 0;\n  -webkit-transform: translate3d(75px, 0, 0);\n  transform: translate3d(75px, 0, 0); }\n  .item-right-edit .button {\n    min-width: 50px;\n    height: 100%; }\n    .item-right-edit .button.icon {\n      display: -webkit-box;\n      display: -webkit-flex;\n      display: -moz-box;\n      display: -moz-flex;\n      display: -ms-flexbox;\n      display: flex;\n      -webkit-box-align: center;\n      -ms-flex-align: center;\n      -webkit-align-items: center;\n      -moz-align-items: center;\n      align-items: center;\n      position: absolute;\n      top: 0;\n      height: 100%;\n      font-size: 32px; }\n  .item-right-edit.visible {\n    display: block; }\n    .item-right-edit.visible.active {\n      opacity: 1;\n      -webkit-transform: translate3d(0, 0, 0);\n      transform: translate3d(0, 0, 0); }\n\n.item-reorder .button.icon {\n  color: #444;\n  font-size: 32px; }\n\n.item-reordering {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 9;\n  width: 100%;\n  box-shadow: 0px 0px 10px 0px #aaa; }\n  .item-reordering .item-reorder {\n    z-index: 9; }\n\n.item-placeholder {\n  opacity: 0.7; }\n\n/**\n * The hidden right-side buttons that can be exposed under a list item\n * with dragging.\n */\n.item-options {\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 1;\n  height: 100%; }\n  .item-options .button {\n    height: 100%;\n    border: none;\n    border-radius: 0;\n    display: -webkit-inline-box;\n    display: -webkit-inline-flex;\n    display: -moz-inline-flex;\n    display: -ms-inline-flexbox;\n    display: inline-flex;\n    -webkit-box-align: center;\n    -ms-flex-align: center;\n    -webkit-align-items: center;\n    -moz-align-items: center;\n    align-items: center; }\n    .item-options .button:before {\n      margin: 0 auto; }\n\n/**\n * Lists\n * --------------------------------------------------\n */\n.list {\n  position: relative;\n  padding-top: 1px;\n  padding-bottom: 1px;\n  padding-left: 0;\n  margin-bottom: 20px; }\n\n.list:last-child {\n  margin-bottom: 0px; }\n  .list:last-child.card {\n    margin-bottom: 40px; }\n\n/**\n * List Header\n * --------------------------------------------------\n */\n.list-header {\n  margin-top: 20px;\n  padding: 5px 15px;\n  background-color: transparent;\n  color: #222;\n  font-weight: bold; }\n\n.card.list .list-item {\n  padding-right: 1px;\n  padding-left: 1px; }\n\n/**\n * Cards and Inset Lists\n * --------------------------------------------------\n * A card and list-inset are close to the same thing, except a card as a box shadow.\n */\n.card, .list-inset {\n  overflow: hidden;\n  margin: 20px 10px;\n  border-radius: 2px;\n  background-color: #fff; }\n\n.card {\n  padding-top: 1px;\n  padding-bottom: 1px;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }\n  .card .item {\n    border-left: 0;\n    border-right: 0; }\n  .card .item:first-child {\n    border-top: 0; }\n  .card .item:last-child {\n    border-bottom: 0; }\n\n.padding .card, .padding .list-inset {\n  margin-left: 0;\n  margin-right: 0; }\n\n.card .item:first-child, .list-inset .item:first-child, .padding > .list .item:first-child {\n  border-top-left-radius: 2px;\n  border-top-right-radius: 2px; }\n  .card .item:first-child .item-content, .list-inset .item:first-child .item-content, .padding > .list .item:first-child .item-content {\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px; }\n.card .item:last-child, .list-inset .item:last-child, .padding > .list .item:last-child {\n  border-bottom-right-radius: 2px;\n  border-bottom-left-radius: 2px; }\n  .card .item:last-child .item-content, .list-inset .item:last-child .item-content, .padding > .list .item:last-child .item-content {\n    border-bottom-right-radius: 2px;\n    border-bottom-left-radius: 2px; }\n\n.card .item:last-child, .list-inset .item:last-child {\n  margin-bottom: -1px; }\n\n.card .item, .list-inset .item, .padding > .list .item, .padding-horizontal > .list .item {\n  margin-right: 0;\n  margin-left: 0; }\n  .card .item.item-input input, .list-inset .item.item-input input, .padding > .list .item.item-input input, .padding-horizontal > .list .item.item-input input {\n    padding-right: 44px; }\n\n.padding-left > .list .item {\n  margin-left: 0; }\n\n.padding-right > .list .item {\n  margin-right: 0; }\n\n/**\n * Badges\n * --------------------------------------------------\n */\n.badge {\n  background-color: transparent;\n  color: #AAAAAA;\n  z-index: 1;\n  display: inline-block;\n  padding: 3px 8px;\n  min-width: 10px;\n  border-radius: 10px;\n  vertical-align: baseline;\n  text-align: center;\n  white-space: nowrap;\n  font-weight: bold;\n  font-size: 14px;\n  line-height: 16px; }\n  .badge:empty {\n    display: none; }\n\n.tabs .tab-item .badge.badge-light, .badge.badge-light {\n  background-color: #fff;\n  color: #444; }\n.tabs .tab-item .badge.badge-stable, .badge.badge-stable {\n  background-color: #f8f8f8;\n  color: #444; }\n.tabs .tab-item .badge.badge-positive, .badge.badge-positive {\n  background-color: #387ef5;\n  color: #fff; }\n.tabs .tab-item .badge.badge-calm, .badge.badge-calm {\n  background-color: #11c1f3;\n  color: #fff; }\n.tabs .tab-item .badge.badge-assertive, .badge.badge-assertive {\n  background-color: #ef473a;\n  color: #fff; }\n.tabs .tab-item .badge.badge-balanced, .badge.badge-balanced {\n  background-color: #33cd5f;\n  color: #fff; }\n.tabs .tab-item .badge.badge-energized, .badge.badge-energized {\n  background-color: #ffc900;\n  color: #fff; }\n.tabs .tab-item .badge.badge-royal, .badge.badge-royal {\n  background-color: #886aea;\n  color: #fff; }\n.tabs .tab-item .badge.badge-dark, .badge.badge-dark {\n  background-color: #444;\n  color: #fff; }\n\n.button .badge {\n  position: relative;\n  top: -1px; }\n\n/**\n * Slide Box\n * --------------------------------------------------\n */\n.slider {\n  position: relative;\n  visibility: hidden;\n  overflow: hidden; }\n\n.slider-slides {\n  position: relative;\n  height: 100%; }\n\n.slider-slide {\n  position: relative;\n  display: block;\n  float: left;\n  width: 100%;\n  height: 100%;\n  vertical-align: top; }\n\n.slider-slide-image > img {\n  width: 100%; }\n\n.slider-pager {\n  position: absolute;\n  bottom: 20px;\n  z-index: 1;\n  width: 100%;\n  height: 15px;\n  text-align: center; }\n  .slider-pager .slider-pager-page {\n    display: inline-block;\n    margin: 0px 3px;\n    width: 15px;\n    color: #000;\n    text-decoration: none;\n    opacity: 0.3; }\n    .slider-pager .slider-pager-page.active {\n      -webkit-transition: opacity 0.4s ease-in;\n      transition: opacity 0.4s ease-in;\n      opacity: 1; }\n\n.scroll-refresher {\n  position: absolute;\n  top: -60px;\n  right: 0;\n  left: 0;\n  overflow: hidden;\n  margin: auto;\n  height: 60px; }\n  .scroll-refresher .ionic-refresher-content {\n    position: absolute;\n    bottom: 15px;\n    left: 0;\n    width: 100%;\n    color: #666666;\n    text-align: center;\n    font-size: 30px; }\n    .scroll-refresher .ionic-refresher-content .text-refreshing, .scroll-refresher .ionic-refresher-content .text-pulling {\n      font-size: 16px;\n      line-height: 16px; }\n    .scroll-refresher .ionic-refresher-content.ionic-refresher-with-text {\n      bottom: 10px; }\n  .scroll-refresher .icon-refreshing, .scroll-refresher .icon-pulling {\n    width: 100%;\n    -webkit-backface-visibility: hidden;\n    backface-visibility: hidden;\n    -webkit-transform-style: preserve-3d;\n    transform-style: preserve-3d; }\n  .scroll-refresher .icon-pulling {\n    -webkit-animation-name: refresh-spin-back;\n    animation-name: refresh-spin-back;\n    -webkit-animation-duration: 200ms;\n    animation-duration: 200ms;\n    -webkit-animation-timing-function: linear;\n    animation-timing-function: linear;\n    -webkit-animation-fill-mode: none;\n    animation-fill-mode: none;\n    -webkit-transform: translate3d(0, 0, 0) rotate(0deg);\n    transform: translate3d(0, 0, 0) rotate(0deg); }\n  .scroll-refresher .icon-refreshing, .scroll-refresher .text-refreshing {\n    display: none; }\n  .scroll-refresher .icon-refreshing {\n    -webkit-animation-duration: 1.5s;\n    animation-duration: 1.5s; }\n  .scroll-refresher.active .icon-pulling:not(.pulling-rotation-disabled) {\n    -webkit-animation-name: refresh-spin;\n    animation-name: refresh-spin;\n    -webkit-transform: translate3d(0, 0, 0) rotate(-180deg);\n    transform: translate3d(0, 0, 0) rotate(-180deg); }\n  .scroll-refresher.active.refreshing {\n    -webkit-transition: -webkit-transform 0.2s;\n    transition: -webkit-transform 0.2s;\n    -webkit-transition: transform 0.2s;\n    transition: transform 0.2s;\n    -webkit-transform: scale(1, 1);\n    transform: scale(1, 1); }\n    .scroll-refresher.active.refreshing .icon-pulling, .scroll-refresher.active.refreshing .text-pulling {\n      display: none; }\n    .scroll-refresher.active.refreshing .icon-refreshing, .scroll-refresher.active.refreshing .text-refreshing {\n      display: block; }\n    .scroll-refresher.active.refreshing.refreshing-tail {\n      -webkit-transform: scale(0, 0);\n      transform: scale(0, 0); }\n\n.overflow-scroll > .scroll {\n  -webkit-overflow-scrolling: touch;\n  width: 100%; }\n  .overflow-scroll > .scroll.overscroll {\n    position: fixed; }\n\n@-webkit-keyframes refresh-spin {\n  0% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(0); }\n\n  100% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(180deg); } }\n\n@keyframes refresh-spin {\n  0% {\n    transform: translate3d(0, 0, 0) rotate(0); }\n\n  100% {\n    transform: translate3d(0, 0, 0) rotate(180deg); } }\n\n@-webkit-keyframes refresh-spin-back {\n  0% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(180deg); }\n\n  100% {\n    -webkit-transform: translate3d(0, 0, 0) rotate(0); } }\n\n@keyframes refresh-spin-back {\n  0% {\n    transform: translate3d(0, 0, 0) rotate(180deg); }\n\n  100% {\n    transform: translate3d(0, 0, 0) rotate(0); } }\n\n/**\n * Spinners\n * --------------------------------------------------\n */\n.spinner {\n  stroke: #444;\n  fill: #444; }\n  .spinner svg {\n    width: 28px;\n    height: 28px; }\n  .spinner.spinner-light {\n    stroke: #fff;\n    fill: #fff; }\n  .spinner.spinner-stable {\n    stroke: #f8f8f8;\n    fill: #f8f8f8; }\n  .spinner.spinner-positive {\n    stroke: #387ef5;\n    fill: #387ef5; }\n  .spinner.spinner-calm {\n    stroke: #11c1f3;\n    fill: #11c1f3; }\n  .spinner.spinner-balanced {\n    stroke: #33cd5f;\n    fill: #33cd5f; }\n  .spinner.spinner-assertive {\n    stroke: #ef473a;\n    fill: #ef473a; }\n  .spinner.spinner-energized {\n    stroke: #ffc900;\n    fill: #ffc900; }\n  .spinner.spinner-royal {\n    stroke: #886aea;\n    fill: #886aea; }\n  .spinner.spinner-dark {\n    stroke: #444;\n    fill: #444; }\n\n.spinner-android {\n  stroke: #4b8bf4; }\n\n.spinner-ios, .spinner-ios-small {\n  stroke: #69717d; }\n\n.spinner-spiral .stop1 {\n  stop-color: #fff;\n  stop-opacity: 0; }\n.spinner-spiral.spinner-light .stop1 {\n  stop-color: #444; }\n.spinner-spiral.spinner-light .stop2 {\n  stop-color: #fff; }\n.spinner-spiral.spinner-stable .stop2 {\n  stop-color: #f8f8f8; }\n.spinner-spiral.spinner-positive .stop2 {\n  stop-color: #387ef5; }\n.spinner-spiral.spinner-calm .stop2 {\n  stop-color: #11c1f3; }\n.spinner-spiral.spinner-balanced .stop2 {\n  stop-color: #33cd5f; }\n.spinner-spiral.spinner-assertive .stop2 {\n  stop-color: #ef473a; }\n.spinner-spiral.spinner-energized .stop2 {\n  stop-color: #ffc900; }\n.spinner-spiral.spinner-royal .stop2 {\n  stop-color: #886aea; }\n.spinner-spiral.spinner-dark .stop2 {\n  stop-color: #444; }\n\n/**\n * Forms\n * --------------------------------------------------\n */\nform {\n  margin: 0 0 1.42857; }\n\nlegend {\n  display: block;\n  margin-bottom: 1.42857;\n  padding: 0;\n  width: 100%;\n  border: 1px solid #ddd;\n  color: #444;\n  font-size: 21px;\n  line-height: 2.85714; }\n  legend small {\n    color: #f8f8f8;\n    font-size: 1.07143; }\n\nlabel, input, button, select, textarea {\n  font-weight: normal;\n  font-size: 14px;\n  line-height: 1.42857; }\n\ninput, button, select, textarea {\n  font-family: \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif; }\n\n.item-input {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: relative;\n  overflow: hidden;\n  padding: 6px 0 5px 16px; }\n  .item-input input {\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-box-flex: 1;\n    -webkit-flex: 1 220px;\n    -moz-box-flex: 1;\n    -moz-flex: 1 220px;\n    -ms-flex: 1 220px;\n    flex: 1 220px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none;\n    margin: 0;\n    padding-right: 24px;\n    background-color: transparent; }\n  .item-input .button .icon {\n    -webkit-box-flex: 0;\n    -webkit-flex: 0 0 24px;\n    -moz-box-flex: 0;\n    -moz-flex: 0 0 24px;\n    -ms-flex: 0 0 24px;\n    flex: 0 0 24px;\n    position: static;\n    display: inline-block;\n    height: auto;\n    text-align: center;\n    font-size: 16px; }\n  .item-input .button-bar {\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-box-flex: 1;\n    -webkit-flex: 1 0 220px;\n    -moz-box-flex: 1;\n    -moz-flex: 1 0 220px;\n    -ms-flex: 1 0 220px;\n    flex: 1 0 220px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none; }\n  .item-input .icon {\n    min-width: 14px; }\n\n.platform-windowsphone .item-input input {\n  flex-shrink: 1; }\n\n.item-input-inset {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  position: relative;\n  overflow: hidden;\n  padding: 10.66667px; }\n\n.item-input-wrapper {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 1;\n  -webkit-flex: 1 0;\n  -moz-box-flex: 1;\n  -moz-flex: 1 0;\n  -ms-flex: 1 0;\n  flex: 1 0;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  -webkit-border-radius: 4px;\n  border-radius: 4px;\n  padding-right: 8px;\n  padding-left: 8px;\n  background: #eee; }\n\n.item-input-inset .item-input-wrapper input {\n  padding-left: 4px;\n  height: 29px;\n  background: transparent;\n  line-height: 18px; }\n\n.item-input-wrapper ~ .button {\n  margin-left: 10.66667px; }\n\n.input-label {\n  display: table;\n  padding: 7px 10px 7px 0px;\n  max-width: 200px;\n  width: 35%;\n  color: #444;\n  font-size: 16px; }\n\n.placeholder-icon {\n  color: #aaa; }\n  .placeholder-icon:first-child {\n    padding-right: 6px; }\n  .placeholder-icon:last-child {\n    padding-left: 6px; }\n\n.item-stacked-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none; }\n  .item-stacked-label .input-label, .item-stacked-label .icon {\n    display: inline-block;\n    padding: 4px 0 0 0px;\n    vertical-align: middle; }\n\n.item-stacked-label input, .item-stacked-label textarea {\n  -webkit-border-radius: 2px;\n  border-radius: 2px;\n  padding: 4px 8px 3px 0;\n  border: none;\n  background-color: #fff; }\n\n.item-stacked-label input {\n  overflow: hidden;\n  height: 46px; }\n\n.item-floating-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none; }\n  .item-floating-label .input-label {\n    position: relative;\n    padding: 5px 0 0 0;\n    opacity: 0;\n    top: 10px;\n    -webkit-transition: opacity 0.15s ease-in, top 0.2s linear;\n    transition: opacity 0.15s ease-in, top 0.2s linear; }\n    .item-floating-label .input-label.has-input {\n      opacity: 1;\n      top: 0;\n      -webkit-transition: opacity 0.15s ease-in, top 0.2s linear;\n      transition: opacity 0.15s ease-in, top 0.2s linear; }\n\ntextarea, input[type=\"text\"], input[type=\"password\"], input[type=\"datetime\"], input[type=\"datetime-local\"], input[type=\"date\"], input[type=\"month\"], input[type=\"time\"], input[type=\"week\"], input[type=\"number\"], input[type=\"email\"], input[type=\"url\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"color\"] {\n  display: block;\n  padding-top: 2px;\n  padding-left: 0;\n  height: 34px;\n  color: #111;\n  vertical-align: middle;\n  font-size: 14px;\n  line-height: 16px; }\n\n.platform-ios input[type=\"datetime-local\"], .platform-ios input[type=\"date\"], .platform-ios input[type=\"month\"], .platform-ios input[type=\"time\"], .platform-ios input[type=\"week\"], .platform-android input[type=\"datetime-local\"], .platform-android input[type=\"date\"], .platform-android input[type=\"month\"], .platform-android input[type=\"time\"], .platform-android input[type=\"week\"] {\n  padding-top: 8px; }\n\n.item-input input, .item-input textarea {\n  width: 100%; }\n\ntextarea {\n  padding-left: 0; }\n  textarea::-moz-placeholder {\n    color: #aaaaaa; }\n  textarea:-ms-input-placeholder {\n    color: #aaaaaa; }\n  textarea::-webkit-input-placeholder {\n    color: #aaaaaa;\n    text-indent: -3px; }\n\ntextarea {\n  height: auto; }\n\ntextarea, input[type=\"text\"], input[type=\"password\"], input[type=\"datetime\"], input[type=\"datetime-local\"], input[type=\"date\"], input[type=\"month\"], input[type=\"time\"], input[type=\"week\"], input[type=\"number\"], input[type=\"email\"], input[type=\"url\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"color\"] {\n  border: 0; }\n\ninput[type=\"radio\"], input[type=\"checkbox\"] {\n  margin: 0;\n  line-height: normal; }\n\n.item-input input[type=\"file\"], .item-input input[type=\"image\"], .item-input input[type=\"submit\"], .item-input input[type=\"reset\"], .item-input input[type=\"button\"], .item-input input[type=\"radio\"], .item-input input[type=\"checkbox\"] {\n  width: auto; }\n\ninput[type=\"file\"] {\n  line-height: 34px; }\n\n.previous-input-focus, .cloned-text-input + input, .cloned-text-input + textarea {\n  position: absolute !important;\n  left: -9999px;\n  width: 200px; }\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n  color: #aaaaaa; }\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n  color: #aaaaaa; }\ninput::-webkit-input-placeholder, textarea::-webkit-input-placeholder {\n  color: #aaaaaa;\n  text-indent: 0; }\n\ninput[disabled], select[disabled], textarea[disabled], input[readonly]:not(.cloned-text-input), textarea[readonly]:not(.cloned-text-input), select[readonly] {\n  background-color: #f8f8f8;\n  cursor: not-allowed; }\n\ninput[type=\"radio\"][disabled], input[type=\"checkbox\"][disabled], input[type=\"radio\"][readonly], input[type=\"checkbox\"][readonly] {\n  background-color: transparent; }\n\n/**\n * Checkbox\n * --------------------------------------------------\n */\n.checkbox {\n  position: relative;\n  display: inline-block;\n  padding: 7px 7px;\n  cursor: pointer; }\n  .checkbox input:before, .checkbox .checkbox-icon:before {\n    border-color: #ddd; }\n  .checkbox input:checked:before, .checkbox input:checked + .checkbox-icon:before {\n    background: #387ef5;\n    border-color: #387ef5; }\n\n.checkbox-light input:before, .checkbox-light .checkbox-icon:before {\n  border-color: #ddd; }\n.checkbox-light input:checked:before, .checkbox-light input:checked + .checkbox-icon:before {\n  background: #ddd;\n  border-color: #ddd; }\n\n.checkbox-stable input:before, .checkbox-stable .checkbox-icon:before {\n  border-color: #b2b2b2; }\n.checkbox-stable input:checked:before, .checkbox-stable input:checked + .checkbox-icon:before {\n  background: #b2b2b2;\n  border-color: #b2b2b2; }\n\n.checkbox-positive input:before, .checkbox-positive .checkbox-icon:before {\n  border-color: #387ef5; }\n.checkbox-positive input:checked:before, .checkbox-positive input:checked + .checkbox-icon:before {\n  background: #387ef5;\n  border-color: #387ef5; }\n\n.checkbox-calm input:before, .checkbox-calm .checkbox-icon:before {\n  border-color: #11c1f3; }\n.checkbox-calm input:checked:before, .checkbox-calm input:checked + .checkbox-icon:before {\n  background: #11c1f3;\n  border-color: #11c1f3; }\n\n.checkbox-assertive input:before, .checkbox-assertive .checkbox-icon:before {\n  border-color: #ef473a; }\n.checkbox-assertive input:checked:before, .checkbox-assertive input:checked + .checkbox-icon:before {\n  background: #ef473a;\n  border-color: #ef473a; }\n\n.checkbox-balanced input:before, .checkbox-balanced .checkbox-icon:before {\n  border-color: #33cd5f; }\n.checkbox-balanced input:checked:before, .checkbox-balanced input:checked + .checkbox-icon:before {\n  background: #33cd5f;\n  border-color: #33cd5f; }\n\n.checkbox-energized input:before, .checkbox-energized .checkbox-icon:before {\n  border-color: #ffc900; }\n.checkbox-energized input:checked:before, .checkbox-energized input:checked + .checkbox-icon:before {\n  background: #ffc900;\n  border-color: #ffc900; }\n\n.checkbox-royal input:before, .checkbox-royal .checkbox-icon:before {\n  border-color: #886aea; }\n.checkbox-royal input:checked:before, .checkbox-royal input:checked + .checkbox-icon:before {\n  background: #886aea;\n  border-color: #886aea; }\n\n.checkbox-dark input:before, .checkbox-dark .checkbox-icon:before {\n  border-color: #444; }\n.checkbox-dark input:checked:before, .checkbox-dark input:checked + .checkbox-icon:before {\n  background: #444;\n  border-color: #444; }\n\n.checkbox input:disabled:before, .checkbox input:disabled + .checkbox-icon:before {\n  border-color: #ddd; }\n\n.checkbox input:disabled:checked:before, .checkbox input:disabled:checked + .checkbox-icon:before {\n  background: #ddd; }\n\n.checkbox.checkbox-input-hidden input {\n  display: none !important; }\n\n.checkbox input, .checkbox-icon {\n  position: relative;\n  width: 28px;\n  height: 28px;\n  display: block;\n  border: 0;\n  background: transparent;\n  cursor: pointer;\n  -webkit-appearance: none; }\n  .checkbox input:before, .checkbox-icon:before {\n    display: table;\n    width: 100%;\n    height: 100%;\n    border-width: 1px;\n    border-style: solid;\n    border-radius: 28px;\n    background: #fff;\n    content: ' ';\n    -webkit-transition: background-color 20ms ease-in-out;\n    transition: background-color 20ms ease-in-out; }\n\n.checkbox input:checked:before, input:checked + .checkbox-icon:before {\n  border-width: 2px; }\n\n.checkbox input:after, .checkbox-icon:after {\n  -webkit-transition: opacity 0.05s ease-in-out;\n  transition: opacity 0.05s ease-in-out;\n  -webkit-transform: rotate(-45deg);\n  transform: rotate(-45deg);\n  position: absolute;\n  top: 33%;\n  left: 25%;\n  display: table;\n  width: 14px;\n  height: 6px;\n  border: 1px solid #fff;\n  border-top: 0;\n  border-right: 0;\n  content: ' ';\n  opacity: 0; }\n\n.platform-android .checkbox-platform input:before, .platform-android .checkbox-platform .checkbox-icon:before, .checkbox-square input:before, .checkbox-square .checkbox-icon:before {\n  border-radius: 2px;\n  width: 72%;\n  height: 72%;\n  margin-top: 14%;\n  margin-left: 14%;\n  border-width: 2px; }\n\n.platform-android .checkbox-platform input:after, .platform-android .checkbox-platform .checkbox-icon:after, .checkbox-square input:after, .checkbox-square .checkbox-icon:after {\n  border-width: 2px;\n  top: 19%;\n  left: 25%;\n  width: 13px;\n  height: 7px; }\n\n.grade-c .checkbox input:after, .grade-c .checkbox-icon:after {\n  -webkit-transform: rotate(0);\n  transform: rotate(0);\n  top: 3px;\n  left: 4px;\n  border: none;\n  color: #fff;\n  content: '\\2713';\n  font-weight: bold;\n  font-size: 20px; }\n\n.checkbox input:checked:after, input:checked + .checkbox-icon:after {\n  opacity: 1; }\n\n.item-checkbox {\n  padding-left: 60px; }\n  .item-checkbox.active {\n    box-shadow: none; }\n\n.item-checkbox .checkbox {\n  position: absolute;\n  top: 50%;\n  right: 8px;\n  left: 8px;\n  z-index: 3;\n  margin-top: -21px; }\n\n.item-checkbox.item-checkbox-right {\n  padding-right: 60px;\n  padding-left: 16px; }\n\n.item-checkbox-right .checkbox input, .item-checkbox-right .checkbox-icon {\n  float: right; }\n\n/**\n * Toggle\n * --------------------------------------------------\n */\n.item-toggle {\n  pointer-events: none; }\n\n.toggle {\n  position: relative;\n  display: inline-block;\n  pointer-events: auto;\n  margin: -5px;\n  padding: 5px; }\n  .toggle input:checked + .track {\n    border-color: #4cd964;\n    background-color: #4cd964; }\n  .toggle.dragging .handle {\n    background-color: #f2f2f2 !important; }\n\n.toggle.toggle-light input:checked + .track {\n  border-color: #ddd;\n  background-color: #ddd; }\n.toggle.toggle-stable input:checked + .track {\n  border-color: #b2b2b2;\n  background-color: #b2b2b2; }\n.toggle.toggle-positive input:checked + .track {\n  border-color: #387ef5;\n  background-color: #387ef5; }\n.toggle.toggle-calm input:checked + .track {\n  border-color: #11c1f3;\n  background-color: #11c1f3; }\n.toggle.toggle-assertive input:checked + .track {\n  border-color: #ef473a;\n  background-color: #ef473a; }\n.toggle.toggle-balanced input:checked + .track {\n  border-color: #33cd5f;\n  background-color: #33cd5f; }\n.toggle.toggle-energized input:checked + .track {\n  border-color: #ffc900;\n  background-color: #ffc900; }\n.toggle.toggle-royal input:checked + .track {\n  border-color: #886aea;\n  background-color: #886aea; }\n.toggle.toggle-dark input:checked + .track {\n  border-color: #444;\n  background-color: #444; }\n\n.toggle input {\n  display: none; }\n\n/* the track appearance when the toggle is \"off\" */\n.toggle .track {\n  -webkit-transition-timing-function: ease-in-out;\n  transition-timing-function: ease-in-out;\n  -webkit-transition-duration: 0.3s;\n  transition-duration: 0.3s;\n  -webkit-transition-property: background-color, border;\n  transition-property: background-color, border;\n  display: inline-block;\n  box-sizing: border-box;\n  width: 51px;\n  height: 31px;\n  border: solid 2px #e6e6e6;\n  border-radius: 20px;\n  background-color: #fff;\n  content: ' ';\n  cursor: pointer;\n  pointer-events: none; }\n\n/* Fix to avoid background color bleeding */\n/* (occured on (at least) Android 4.2, Asus MeMO Pad HD7 ME173X) */\n.platform-android4_2 .toggle .track {\n  -webkit-background-clip: padding-box; }\n\n/* the handle (circle) thats inside the toggle's track area */\n/* also the handle's appearance when it is \"off\" */\n.toggle .handle {\n  -webkit-transition: 0.3s cubic-bezier(0, 1.1, 1, 1.1);\n  transition: 0.3s cubic-bezier(0, 1.1, 1, 1.1);\n  -webkit-transition-property: background-color, transform;\n  transition-property: background-color, transform;\n  position: absolute;\n  display: block;\n  width: 27px;\n  height: 27px;\n  border-radius: 27px;\n  background-color: #fff;\n  top: 7px;\n  left: 7px;\n  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.15); }\n  .toggle .handle:before {\n    position: absolute;\n    top: -4px;\n    left: -21.5px;\n    padding: 18.5px 34px;\n    content: \" \"; }\n\n.toggle input:checked + .track .handle {\n  -webkit-transform: translate3d(20px, 0, 0);\n  transform: translate3d(20px, 0, 0);\n  background-color: #fff; }\n\n.item-toggle.active {\n  box-shadow: none; }\n\n.item-toggle, .item-toggle.item-complex .item-content {\n  padding-right: 99px; }\n\n.item-toggle.item-complex {\n  padding-right: 0; }\n\n.item-toggle .toggle {\n  position: absolute;\n  top: 10px;\n  right: 16px;\n  z-index: 3; }\n\n.toggle input:disabled + .track {\n  opacity: 0.6; }\n\n.toggle-small .track {\n  border: 0;\n  width: 34px;\n  height: 15px;\n  background: #9e9e9e; }\n.toggle-small input:checked + .track {\n  background: rgba(0, 150, 137, 0.5); }\n.toggle-small .handle {\n  top: 2px;\n  left: 4px;\n  width: 21px;\n  height: 21px;\n  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); }\n.toggle-small input:checked + .track .handle {\n  -webkit-transform: translate3d(16px, 0, 0);\n  transform: translate3d(16px, 0, 0);\n  background: #009689; }\n.toggle-small.item-toggle .toggle {\n  top: 19px; }\n.toggle-small .toggle-light input:checked + .track {\n  background-color: rgba(221, 221, 221, 0.5); }\n.toggle-small .toggle-light input:checked + .track .handle {\n  background-color: #ddd; }\n.toggle-small .toggle-stable input:checked + .track {\n  background-color: rgba(178, 178, 178, 0.5); }\n.toggle-small .toggle-stable input:checked + .track .handle {\n  background-color: #b2b2b2; }\n.toggle-small .toggle-positive input:checked + .track {\n  background-color: rgba(56, 126, 245, 0.5); }\n.toggle-small .toggle-positive input:checked + .track .handle {\n  background-color: #387ef5; }\n.toggle-small .toggle-calm input:checked + .track {\n  background-color: rgba(17, 193, 243, 0.5); }\n.toggle-small .toggle-calm input:checked + .track .handle {\n  background-color: #11c1f3; }\n.toggle-small .toggle-assertive input:checked + .track {\n  background-color: rgba(239, 71, 58, 0.5); }\n.toggle-small .toggle-assertive input:checked + .track .handle {\n  background-color: #ef473a; }\n.toggle-small .toggle-balanced input:checked + .track {\n  background-color: rgba(51, 205, 95, 0.5); }\n.toggle-small .toggle-balanced input:checked + .track .handle {\n  background-color: #33cd5f; }\n.toggle-small .toggle-energized input:checked + .track {\n  background-color: rgba(255, 201, 0, 0.5); }\n.toggle-small .toggle-energized input:checked + .track .handle {\n  background-color: #ffc900; }\n.toggle-small .toggle-royal input:checked + .track {\n  background-color: rgba(136, 106, 234, 0.5); }\n.toggle-small .toggle-royal input:checked + .track .handle {\n  background-color: #886aea; }\n.toggle-small .toggle-dark input:checked + .track {\n  background-color: rgba(68, 68, 68, 0.5); }\n.toggle-small .toggle-dark input:checked + .track .handle {\n  background-color: #444; }\n\n/**\n * Radio Button Inputs\n * --------------------------------------------------\n */\n.item-radio {\n  padding: 0; }\n  .item-radio:hover {\n    cursor: pointer; }\n\n.item-radio .item-content {\n  /* give some room to the right for the checkmark icon */\n  padding-right: 64px; }\n\n.item-radio .radio-icon {\n  /* checkmark icon will be hidden by default */\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 3;\n  visibility: hidden;\n  padding: 14px;\n  height: 100%;\n  font-size: 24px; }\n\n.item-radio input {\n  /* hide any radio button inputs elements (the ugly circles) */\n  position: absolute;\n  left: -9999px; }\n  .item-radio input:checked ~ .item-content {\n    /* style the item content when its checked */\n    background: #f7f7f7; }\n  .item-radio input:checked ~ .radio-icon {\n    /* show the checkmark icon when its checked */\n    visibility: visible; }\n\n.platform-android.grade-b .item-radio, .platform-android.grade-c .item-radio {\n  -webkit-animation: androidCheckedbugfix infinite 1s; }\n\n@-webkit-keyframes androidCheckedbugfix {\n  from {\n    padding: 0; }\n\n  to {\n    padding: 0; } }\n\n/**\n * Range\n * --------------------------------------------------\n */\n.range input {\n  display: inline-block;\n  overflow: hidden;\n  margin-top: 5px;\n  margin-bottom: 5px;\n  padding-right: 2px;\n  padding-left: 1px;\n  width: auto;\n  height: 43px;\n  outline: none;\n  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ccc), color-stop(100%, #ccc));\n  background: linear-gradient(to right, #ccc 0%, #ccc 100%);\n  background-position: center;\n  background-size: 99% 2px;\n  background-repeat: no-repeat;\n  -webkit-appearance: none; }\n  .range input::-webkit-slider-thumb {\n    position: relative;\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background-color: #fff;\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2);\n    cursor: pointer;\n    -webkit-appearance: none;\n    border: 0; }\n  .range input::-webkit-slider-thumb:before {\n    /* what creates the colorful line on the left side of the slider */\n    position: absolute;\n    top: 13px;\n    left: -2001px;\n    width: 2000px;\n    height: 2px;\n    background: #444;\n    content: ' '; }\n  .range input::-webkit-slider-thumb:after {\n    /* create a larger (but hidden) hit area */\n    position: absolute;\n    top: -15px;\n    left: -15px;\n    padding: 30px;\n    content: ' '; }\n  .range input::-ms-track {\n    background: transparent;\n    border-color: transparent;\n    border-width: 11px 0 16px;\n    color: transparent;\n    margin-top: 20px; }\n  .range input::-ms-thumb {\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background-color: #fff;\n    border-color: #fff;\n    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2);\n    margin-left: 1px;\n    margin-right: 1px;\n    outline: none; }\n  .range input::-ms-fill-lower {\n    height: 2px;\n    background: #444; }\n  .range input::-ms-fill-upper {\n    height: 2px;\n    background: #ccc; }\n\n.range {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center;\n  padding: 2px 11px; }\n  .range.range-light input::-webkit-slider-thumb:before {\n    background: #ddd; }\n  .range.range-light input::-ms-fill-lower {\n    background: #ddd; }\n  .range.range-stable input::-webkit-slider-thumb:before {\n    background: #b2b2b2; }\n  .range.range-stable input::-ms-fill-lower {\n    background: #b2b2b2; }\n  .range.range-positive input::-webkit-slider-thumb:before {\n    background: #387ef5; }\n  .range.range-positive input::-ms-fill-lower {\n    background: #387ef5; }\n  .range.range-calm input::-webkit-slider-thumb:before {\n    background: #11c1f3; }\n  .range.range-calm input::-ms-fill-lower {\n    background: #11c1f3; }\n  .range.range-balanced input::-webkit-slider-thumb:before {\n    background: #33cd5f; }\n  .range.range-balanced input::-ms-fill-lower {\n    background: #33cd5f; }\n  .range.range-assertive input::-webkit-slider-thumb:before {\n    background: #ef473a; }\n  .range.range-assertive input::-ms-fill-lower {\n    background: #ef473a; }\n  .range.range-energized input::-webkit-slider-thumb:before {\n    background: #ffc900; }\n  .range.range-energized input::-ms-fill-lower {\n    background: #ffc900; }\n  .range.range-royal input::-webkit-slider-thumb:before {\n    background: #886aea; }\n  .range.range-royal input::-ms-fill-lower {\n    background: #886aea; }\n  .range.range-dark input::-webkit-slider-thumb:before {\n    background: #444; }\n  .range.range-dark input::-ms-fill-lower {\n    background: #444; }\n\n.range .icon {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0;\n  -moz-box-flex: 0;\n  -moz-flex: 0;\n  -ms-flex: 0;\n  flex: 0;\n  display: block;\n  min-width: 24px;\n  text-align: center;\n  font-size: 24px; }\n\n.range input {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  margin-right: 10px;\n  margin-left: 10px; }\n\n.range-label {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 auto;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 auto;\n  -ms-flex: 0 0 auto;\n  flex: 0 0 auto;\n  display: block;\n  white-space: nowrap; }\n\n.range-label:first-child {\n  padding-left: 5px; }\n\n.range input + .range-label {\n  padding-right: 5px;\n  padding-left: 0; }\n\n.platform-windowsphone .range input {\n  height: auto; }\n\n/**\n * Select\n * --------------------------------------------------\n */\n.item-select {\n  position: relative; }\n  .item-select select {\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    appearance: none;\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    padding: 14px 48px 16px 16px;\n    max-width: 65%;\n    border: none;\n    background: #fff;\n    color: #333;\n    text-indent: 0.01px;\n    text-overflow: '';\n    white-space: nowrap;\n    font-size: 14px;\n    cursor: pointer;\n    direction: rtl; }\n  .item-select select::-ms-expand {\n    display: none; }\n  .item-select option {\n    direction: ltr; }\n  .item-select:after {\n    position: absolute;\n    top: 50%;\n    right: 16px;\n    margin-top: -3px;\n    width: 0;\n    height: 0;\n    border-top: 5px solid;\n    border-right: 5px solid rgba(0, 0, 0, 0);\n    border-left: 5px solid rgba(0, 0, 0, 0);\n    color: #999;\n    content: \"\";\n    pointer-events: none; }\n  .item-select.item-light select {\n    background: #fff;\n    color: #444; }\n  .item-select.item-stable select {\n    background: #f8f8f8;\n    color: #444; }\n  .item-select.item-stable:after, .item-select.item-stable .input-label {\n    color: #656565; }\n  .item-select.item-positive select {\n    background: #387ef5;\n    color: #fff; }\n  .item-select.item-positive:after, .item-select.item-positive .input-label {\n    color: #fff; }\n  .item-select.item-calm select {\n    background: #11c1f3;\n    color: #fff; }\n  .item-select.item-calm:after, .item-select.item-calm .input-label {\n    color: #fff; }\n  .item-select.item-assertive select {\n    background: #ef473a;\n    color: #fff; }\n  .item-select.item-assertive:after, .item-select.item-assertive .input-label {\n    color: #fff; }\n  .item-select.item-balanced select {\n    background: #33cd5f;\n    color: #fff; }\n  .item-select.item-balanced:after, .item-select.item-balanced .input-label {\n    color: #fff; }\n  .item-select.item-energized select {\n    background: #ffc900;\n    color: #fff; }\n  .item-select.item-energized:after, .item-select.item-energized .input-label {\n    color: #fff; }\n  .item-select.item-royal select {\n    background: #886aea;\n    color: #fff; }\n  .item-select.item-royal:after, .item-select.item-royal .input-label {\n    color: #fff; }\n  .item-select.item-dark select {\n    background: #444;\n    color: #fff; }\n  .item-select.item-dark:after, .item-select.item-dark .input-label {\n    color: #fff; }\n\nselect[multiple], select[size] {\n  height: auto; }\n\n/**\n * Progress\n * --------------------------------------------------\n */\nprogress {\n  display: block;\n  margin: 15px auto;\n  width: 100%; }\n\n/**\n * Buttons\n * --------------------------------------------------\n */\n.button {\n  border-color: #b2b2b2;\n  background-color: #f8f8f8;\n  color: #444;\n  position: relative;\n  display: inline-block;\n  margin: 0;\n  padding: 0 12px;\n  min-width: 52px;\n  min-height: 47px;\n  border-width: 1px;\n  border-style: solid;\n  border-radius: 2px;\n  vertical-align: top;\n  text-align: center;\n  text-overflow: ellipsis;\n  font-size: 16px;\n  line-height: 42px;\n  cursor: pointer; }\n  .button:hover {\n    color: #444;\n    text-decoration: none; }\n  .button.active, .button.activated {\n    border-color: #a2a2a2;\n    background-color: #e5e5e5;\n    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n  .button:after {\n    position: absolute;\n    top: -6px;\n    right: -6px;\n    bottom: -6px;\n    left: -6px;\n    content: ' '; }\n  .button .icon {\n    vertical-align: top;\n    pointer-events: none; }\n  .button .icon:before, .button.icon:before, .button.icon-left:before, .button.icon-right:before {\n    display: inline-block;\n    padding: 0 0 1px 0;\n    vertical-align: inherit;\n    font-size: 24px;\n    line-height: 41px;\n    pointer-events: none; }\n  .button.icon-left:before {\n    float: left;\n    padding-right: 0.2em;\n    padding-left: 0; }\n  .button.icon-right:before {\n    float: right;\n    padding-right: 0;\n    padding-left: 0.2em; }\n  .button.button-block, .button.button-full {\n    margin-top: 10px;\n    margin-bottom: 10px; }\n  .button.button-light {\n    border-color: #ddd;\n    background-color: #fff;\n    color: #444; }\n    .button.button-light:hover {\n      color: #444;\n      text-decoration: none; }\n    .button.button-light.active, .button.button-light.activated {\n      border-color: #ccc;\n      background-color: #fafafa;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-light.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ddd; }\n    .button.button-light.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-light.button-outline {\n      border-color: #ddd;\n      background: transparent;\n      color: #ddd; }\n      .button.button-light.button-outline.active, .button.button-light.button-outline.activated {\n        background-color: #ddd;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-stable {\n    border-color: #b2b2b2;\n    background-color: #f8f8f8;\n    color: #444; }\n    .button.button-stable:hover {\n      color: #444;\n      text-decoration: none; }\n    .button.button-stable.active, .button.button-stable.activated {\n      border-color: #a2a2a2;\n      background-color: #e5e5e5;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-stable.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #b2b2b2; }\n    .button.button-stable.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-stable.button-outline {\n      border-color: #b2b2b2;\n      background: transparent;\n      color: #b2b2b2; }\n      .button.button-stable.button-outline.active, .button.button-stable.button-outline.activated {\n        background-color: #b2b2b2;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-positive {\n    border-color: #0c63ee;\n    background-color: #387ef5;\n    color: #fff; }\n    .button.button-positive:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-positive.active, .button.button-positive.activated {\n      border-color: #0c63ee;\n      background-color: #0c63ee;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-positive.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #387ef5; }\n    .button.button-positive.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-positive.button-outline {\n      border-color: #387ef5;\n      background: transparent;\n      color: #387ef5; }\n      .button.button-positive.button-outline.active, .button.button-positive.button-outline.activated {\n        background-color: #387ef5;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-calm {\n    border-color: #0a9ec7;\n    background-color: #11c1f3;\n    color: #fff; }\n    .button.button-calm:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-calm.active, .button.button-calm.activated {\n      border-color: #0a9ec7;\n      background-color: #0a9ec7;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-calm.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #11c1f3; }\n    .button.button-calm.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-calm.button-outline {\n      border-color: #11c1f3;\n      background: transparent;\n      color: #11c1f3; }\n      .button.button-calm.button-outline.active, .button.button-calm.button-outline.activated {\n        background-color: #11c1f3;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-assertive {\n    border-color: #e42012;\n    background-color: #ef473a;\n    color: #fff; }\n    .button.button-assertive:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-assertive.active, .button.button-assertive.activated {\n      border-color: #e42012;\n      background-color: #e42012;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-assertive.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ef473a; }\n    .button.button-assertive.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-assertive.button-outline {\n      border-color: #ef473a;\n      background: transparent;\n      color: #ef473a; }\n      .button.button-assertive.button-outline.active, .button.button-assertive.button-outline.activated {\n        background-color: #ef473a;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-balanced {\n    border-color: #28a54c;\n    background-color: #33cd5f;\n    color: #fff; }\n    .button.button-balanced:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-balanced.active, .button.button-balanced.activated {\n      border-color: #28a54c;\n      background-color: #28a54c;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-balanced.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #33cd5f; }\n    .button.button-balanced.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-balanced.button-outline {\n      border-color: #33cd5f;\n      background: transparent;\n      color: #33cd5f; }\n      .button.button-balanced.button-outline.active, .button.button-balanced.button-outline.activated {\n        background-color: #33cd5f;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-energized {\n    border-color: #e6b400;\n    background-color: #ffc900;\n    color: #fff; }\n    .button.button-energized:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-energized.active, .button.button-energized.activated {\n      border-color: #e6b400;\n      background-color: #e6b400;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-energized.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #ffc900; }\n    .button.button-energized.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-energized.button-outline {\n      border-color: #ffc900;\n      background: transparent;\n      color: #ffc900; }\n      .button.button-energized.button-outline.active, .button.button-energized.button-outline.activated {\n        background-color: #ffc900;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-royal {\n    border-color: #6b46e5;\n    background-color: #886aea;\n    color: #fff; }\n    .button.button-royal:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-royal.active, .button.button-royal.activated {\n      border-color: #6b46e5;\n      background-color: #6b46e5;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-royal.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #886aea; }\n    .button.button-royal.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-royal.button-outline {\n      border-color: #886aea;\n      background: transparent;\n      color: #886aea; }\n      .button.button-royal.button-outline.active, .button.button-royal.button-outline.activated {\n        background-color: #886aea;\n        box-shadow: none;\n        color: #fff; }\n  .button.button-dark {\n    border-color: #111;\n    background-color: #444;\n    color: #fff; }\n    .button.button-dark:hover {\n      color: #fff;\n      text-decoration: none; }\n    .button.button-dark.active, .button.button-dark.activated {\n      border-color: #000;\n      background-color: #262626;\n      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1); }\n    .button.button-dark.button-clear {\n      border-color: transparent;\n      background: none;\n      box-shadow: none;\n      color: #444; }\n    .button.button-dark.button-icon {\n      border-color: transparent;\n      background: none; }\n    .button.button-dark.button-outline {\n      border-color: #444;\n      background: transparent;\n      color: #444; }\n      .button.button-dark.button-outline.active, .button.button-dark.button-outline.activated {\n        background-color: #444;\n        box-shadow: none;\n        color: #fff; }\n\n.button-small {\n  padding: 2px 4px 1px;\n  min-width: 28px;\n  min-height: 30px;\n  font-size: 12px;\n  line-height: 26px; }\n  .button-small .icon:before, .button-small.icon:before, .button-small.icon-left:before, .button-small.icon-right:before {\n    font-size: 16px;\n    line-height: 19px;\n    margin-top: 3px; }\n\n.button-large {\n  padding: 0 16px;\n  min-width: 68px;\n  min-height: 59px;\n  font-size: 20px;\n  line-height: 53px; }\n  .button-large .icon:before, .button-large.icon:before, .button-large.icon-left:before, .button-large.icon-right:before {\n    padding-bottom: 2px;\n    font-size: 32px;\n    line-height: 51px; }\n\n.button-icon {\n  -webkit-transition: opacity 0.1s;\n  transition: opacity 0.1s;\n  padding: 0 6px;\n  min-width: initial;\n  border-color: transparent;\n  background: none; }\n  .button-icon.button.active, .button-icon.button.activated {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    opacity: 0.3; }\n  .button-icon .icon:before, .button-icon.icon:before {\n    font-size: 32px; }\n\n.button-clear {\n  -webkit-transition: opacity 0.1s;\n  transition: opacity 0.1s;\n  padding: 0 6px;\n  max-height: 42px;\n  border-color: transparent;\n  background: none;\n  box-shadow: none; }\n  .button-clear.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: #b2b2b2; }\n  .button-clear.button-icon {\n    border-color: transparent;\n    background: none; }\n  .button-clear.active, .button-clear.activated {\n    opacity: 0.3; }\n\n.button-outline {\n  -webkit-transition: opacity 0.1s;\n  transition: opacity 0.1s;\n  background: none;\n  box-shadow: none; }\n  .button-outline.button-outline {\n    border-color: #b2b2b2;\n    background: transparent;\n    color: #b2b2b2; }\n    .button-outline.button-outline.active, .button-outline.button-outline.activated {\n      background-color: #b2b2b2;\n      box-shadow: none;\n      color: #fff; }\n\n.padding > .button.button-block:first-child {\n  margin-top: 0; }\n\n.button-block {\n  display: block;\n  clear: both; }\n  .button-block:after {\n    clear: both; }\n\n.button-full, .button-full > .button {\n  display: block;\n  margin-right: 0;\n  margin-left: 0;\n  border-right-width: 0;\n  border-left-width: 0;\n  border-radius: 0; }\n\nbutton.button-block, button.button-full, .button-full > button.button, input.button.button-block {\n  width: 100%; }\n\na.button {\n  text-decoration: none; }\n  a.button .icon:before, a.button.icon:before, a.button.icon-left:before, a.button.icon-right:before {\n    margin-top: 2px; }\n\n.button.disabled, .button[disabled] {\n  opacity: 0.4;\n  cursor: default !important;\n  pointer-events: none; }\n\n/**\n * Button Bar\n * --------------------------------------------------\n */\n.button-bar {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  width: 100%; }\n  .button-bar.button-bar-inline {\n    display: block;\n    width: auto;\n    *zoom: 1; }\n    .button-bar.button-bar-inline:before, .button-bar.button-bar-inline:after {\n      display: table;\n      content: \"\";\n      line-height: 0; }\n    .button-bar.button-bar-inline:after {\n      clear: both; }\n    .button-bar.button-bar-inline > .button {\n      width: auto;\n      display: inline-block;\n      float: left; }\n\n.button-bar > .button {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  overflow: hidden;\n  padding: 0 16px;\n  width: 0;\n  border-width: 1px 0px 1px 1px;\n  border-radius: 0;\n  text-align: center;\n  text-overflow: ellipsis;\n  white-space: nowrap; }\n  .button-bar > .button:before, .button-bar > .button .icon:before {\n    line-height: 44px; }\n  .button-bar > .button:first-child {\n    border-radius: 2px 0px 0px 2px; }\n  .button-bar > .button:last-child {\n    border-right-width: 1px;\n    border-radius: 0px 2px 2px 0px; }\n\n/**\n * Grid\n * --------------------------------------------------\n * Using flexbox for the grid, inspired by Philip Walton:\n * http://philipwalton.github.io/solved-by-flexbox/demos/grids/\n * By default each .col within a .row will evenly take up\n * available width, and the height of each .col with take\n * up the height of the tallest .col in the same .row.\n */\n.row {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n  padding: 5px;\n  width: 100%; }\n\n.row-wrap {\n  -webkit-flex-wrap: wrap;\n  -moz-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap; }\n\n.row-no-padding {\n  padding: 0; }\n  .row-no-padding > .col {\n    padding: 0; }\n\n.row + .row {\n  margin-top: -5px;\n  padding-top: 0; }\n\n.col {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1;\n  -moz-box-flex: 1;\n  -moz-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  display: block;\n  padding: 5px;\n  width: 100%; }\n\n/* Vertically Align Columns */\n/* .row-* vertically aligns every .col in the .row */\n.row-top {\n  -webkit-box-align: start;\n  -ms-flex-align: start;\n  -webkit-align-items: flex-start;\n  -moz-align-items: flex-start;\n  align-items: flex-start; }\n\n.row-bottom {\n  -webkit-box-align: end;\n  -ms-flex-align: end;\n  -webkit-align-items: flex-end;\n  -moz-align-items: flex-end;\n  align-items: flex-end; }\n\n.row-center {\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -moz-align-items: center;\n  align-items: center; }\n\n.row-stretch {\n  -webkit-box-align: stretch;\n  -ms-flex-align: stretch;\n  -webkit-align-items: stretch;\n  -moz-align-items: stretch;\n  align-items: stretch; }\n\n.row-baseline {\n  -webkit-box-align: baseline;\n  -ms-flex-align: baseline;\n  -webkit-align-items: baseline;\n  -moz-align-items: baseline;\n  align-items: baseline; }\n\n/* .col-* vertically aligns an individual .col */\n.col-top {\n  -webkit-align-self: flex-start;\n  -moz-align-self: flex-start;\n  -ms-flex-item-align: start;\n  align-self: flex-start; }\n\n.col-bottom {\n  -webkit-align-self: flex-end;\n  -moz-align-self: flex-end;\n  -ms-flex-item-align: end;\n  align-self: flex-end; }\n\n.col-center {\n  -webkit-align-self: center;\n  -moz-align-self: center;\n  -ms-flex-item-align: center;\n  align-self: center; }\n\n/* Column Offsets */\n.col-offset-10 {\n  margin-left: 10%; }\n\n.col-offset-20 {\n  margin-left: 20%; }\n\n.col-offset-25 {\n  margin-left: 25%; }\n\n.col-offset-33, .col-offset-34 {\n  margin-left: 33.3333%; }\n\n.col-offset-50 {\n  margin-left: 50%; }\n\n.col-offset-66, .col-offset-67 {\n  margin-left: 66.6666%; }\n\n.col-offset-75 {\n  margin-left: 75%; }\n\n.col-offset-80 {\n  margin-left: 80%; }\n\n.col-offset-90 {\n  margin-left: 90%; }\n\n/* Explicit Column Percent Sizes */\n/* By default each grid column will evenly distribute */\n/* across the grid. However, you can specify individual */\n/* columns to take up a certain size of the available area */\n.col-10 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 10%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 10%;\n  -ms-flex: 0 0 10%;\n  flex: 0 0 10%;\n  max-width: 10%; }\n\n.col-20 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 20%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 20%;\n  -ms-flex: 0 0 20%;\n  flex: 0 0 20%;\n  max-width: 20%; }\n\n.col-25 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 25%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 25%;\n  -ms-flex: 0 0 25%;\n  flex: 0 0 25%;\n  max-width: 25%; }\n\n.col-33, .col-34 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 33.3333%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 33.3333%;\n  -ms-flex: 0 0 33.3333%;\n  flex: 0 0 33.3333%;\n  max-width: 33.3333%; }\n\n.col-50 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 50%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 50%;\n  -ms-flex: 0 0 50%;\n  flex: 0 0 50%;\n  max-width: 50%; }\n\n.col-66, .col-67 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 66.6666%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 66.6666%;\n  -ms-flex: 0 0 66.6666%;\n  flex: 0 0 66.6666%;\n  max-width: 66.6666%; }\n\n.col-75 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 75%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 75%;\n  -ms-flex: 0 0 75%;\n  flex: 0 0 75%;\n  max-width: 75%; }\n\n.col-80 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 80%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 80%;\n  -ms-flex: 0 0 80%;\n  flex: 0 0 80%;\n  max-width: 80%; }\n\n.col-90 {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 90%;\n  -moz-box-flex: 0;\n  -moz-flex: 0 0 90%;\n  -ms-flex: 0 0 90%;\n  flex: 0 0 90%;\n  max-width: 90%; }\n\n/* Responsive Grid Classes */\n/* Adding a class of responsive-X to a row */\n/* will trigger the flex-direction to */\n/* change to column and add some margin */\n/* to any columns in the row for clearity */\n@media (max-width: 567px) {\n  .responsive-sm {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-sm .col, .responsive-sm .col-10, .responsive-sm .col-20, .responsive-sm .col-25, .responsive-sm .col-33, .responsive-sm .col-34, .responsive-sm .col-50, .responsive-sm .col-66, .responsive-sm .col-67, .responsive-sm .col-75, .responsive-sm .col-80, .responsive-sm .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n@media (max-width: 767px) {\n  .responsive-md {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-md .col, .responsive-md .col-10, .responsive-md .col-20, .responsive-md .col-25, .responsive-md .col-33, .responsive-md .col-34, .responsive-md .col-50, .responsive-md .col-66, .responsive-md .col-67, .responsive-md .col-75, .responsive-md .col-80, .responsive-md .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n@media (max-width: 1023px) {\n  .responsive-lg {\n    -webkit-box-direction: normal;\n    -moz-box-direction: normal;\n    -webkit-box-orient: vertical;\n    -moz-box-orient: vertical;\n    -webkit-flex-direction: column;\n    -ms-flex-direction: column;\n    flex-direction: column; }\n    .responsive-lg .col, .responsive-lg .col-10, .responsive-lg .col-20, .responsive-lg .col-25, .responsive-lg .col-33, .responsive-lg .col-34, .responsive-lg .col-50, .responsive-lg .col-66, .responsive-lg .col-67, .responsive-lg .col-75, .responsive-lg .col-80, .responsive-lg .col-90 {\n      -webkit-box-flex: 1;\n      -webkit-flex: 1;\n      -moz-box-flex: 1;\n      -moz-flex: 1;\n      -ms-flex: 1;\n      flex: 1;\n      margin-bottom: 15px;\n      margin-left: 0;\n      max-width: 100%;\n      width: 100%; } }\n\n/**\n * Utility Classes\n * --------------------------------------------------\n */\n.hide {\n  display: none; }\n\n.opacity-hide {\n  opacity: 0; }\n\n.grade-b .opacity-hide, .grade-c .opacity-hide {\n  opacity: 1;\n  display: none; }\n\n.show {\n  display: block; }\n\n.opacity-show {\n  opacity: 1; }\n\n.invisible {\n  visibility: hidden; }\n\n.keyboard-open .hide-on-keyboard-open {\n  display: none; }\n\n.keyboard-open .tabs.hide-on-keyboard-open + .pane .has-tabs, .keyboard-open .bar-footer.hide-on-keyboard-open + .pane .has-footer {\n  bottom: 0; }\n\n.inline {\n  display: inline-block; }\n\n.disable-pointer-events {\n  pointer-events: none; }\n\n.enable-pointer-events {\n  pointer-events: auto; }\n\n.disable-user-behavior {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n  -webkit-tap-highlight-color: transparent;\n  -webkit-user-drag: none;\n  -ms-touch-action: none;\n  -ms-content-zooming: none; }\n\n.click-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  opacity: 0;\n  z-index: 99999;\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0);\n  overflow: hidden; }\n\n.click-block-hide {\n  -webkit-transform: translate3d(-9999px, 0, 0);\n  transform: translate3d(-9999px, 0, 0); }\n\n.no-resize {\n  resize: none; }\n\n.block {\n  display: block;\n  clear: both; }\n  .block:after {\n    display: block;\n    visibility: hidden;\n    clear: both;\n    height: 0;\n    content: \".\"; }\n\n.full-image {\n  width: 100%; }\n\n.clearfix {\n  *zoom: 1; }\n  .clearfix:before, .clearfix:after {\n    display: table;\n    content: \"\";\n    line-height: 0; }\n  .clearfix:after {\n    clear: both; }\n\n/**\n * Content Padding\n * --------------------------------------------------\n */\n.padding {\n  padding: 10px; }\n\n.padding-top, .padding-vertical {\n  padding-top: 10px; }\n\n.padding-right, .padding-horizontal {\n  padding-right: 10px; }\n\n.padding-bottom, .padding-vertical {\n  padding-bottom: 10px; }\n\n.padding-left, .padding-horizontal {\n  padding-left: 10px; }\n\n/**\n * Scrollable iFrames\n * --------------------------------------------------\n */\n.iframe-wrapper {\n  position: fixed;\n  -webkit-overflow-scrolling: touch;\n  overflow: scroll; }\n  .iframe-wrapper iframe {\n    height: 100%;\n    width: 100%; }\n\n/**\n * Rounded\n * --------------------------------------------------\n */\n.rounded {\n  border-radius: 4px; }\n\n/**\n * Utility Colors\n * --------------------------------------------------\n * Utility colors are added to help set a naming convention. You'll\n * notice we purposely do not use words like \"red\" or \"blue\", but\n * instead have colors which represent an emotion or generic theme.\n */\n.light, a.light {\n  color: #fff; }\n\n.light-bg {\n  background-color: #fff; }\n\n.light-border {\n  border-color: #ddd; }\n\n.stable, a.stable {\n  color: #f8f8f8; }\n\n.stable-bg {\n  background-color: #f8f8f8; }\n\n.stable-border {\n  border-color: #b2b2b2; }\n\n.positive, a.positive {\n  color: #387ef5; }\n\n.positive-bg {\n  background-color: #387ef5; }\n\n.positive-border {\n  border-color: #0c63ee; }\n\n.calm, a.calm {\n  color: #11c1f3; }\n\n.calm-bg {\n  background-color: #11c1f3; }\n\n.calm-border {\n  border-color: #0a9ec7; }\n\n.assertive, a.assertive {\n  color: #ef473a; }\n\n.assertive-bg {\n  background-color: #ef473a; }\n\n.assertive-border {\n  border-color: #e42012; }\n\n.balanced, a.balanced {\n  color: #33cd5f; }\n\n.balanced-bg {\n  background-color: #33cd5f; }\n\n.balanced-border {\n  border-color: #28a54c; }\n\n.energized, a.energized {\n  color: #ffc900; }\n\n.energized-bg {\n  background-color: #ffc900; }\n\n.energized-border {\n  border-color: #e6b400; }\n\n.royal, a.royal {\n  color: #886aea; }\n\n.royal-bg {\n  background-color: #886aea; }\n\n.royal-border {\n  border-color: #6b46e5; }\n\n.dark, a.dark {\n  color: #444; }\n\n.dark-bg {\n  background-color: #444; }\n\n.dark-border {\n  border-color: #111; }\n\n[collection-repeat] {\n  /* Position is set by transforms */\n  left: 0 !important;\n  top: 0 !important;\n  position: absolute !important;\n  z-index: 1; }\n\n.collection-repeat-container {\n  position: relative;\n  z-index: 1; }\n\n.collection-repeat-after-container {\n  z-index: 0;\n  display: block;\n  /* when scrolling horizontally, make sure the after container doesn't take up 100% width */ }\n  .collection-repeat-after-container.horizontal {\n    display: inline-block; }\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {\n  display: none !important; }\n\n/**\n * Platform\n * --------------------------------------------------\n * Platform specific tweaks\n */\n.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) {\n  height: 64px; }\n  .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader).item-input-inset .item-input-wrapper {\n    margin-top: 19px !important; }\n  .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) > * {\n    margin-top: 20px; }\n.platform-ios.platform-cordova:not(.fullscreen) .tabs-top > .tabs, .platform-ios.platform-cordova:not(.fullscreen) .tabs.tabs-top {\n  top: 64px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header, .platform-ios.platform-cordova:not(.fullscreen) .bar-subheader {\n  top: 64px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-subheader {\n  top: 108px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-tabs-top {\n  top: 113px; }\n.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-subheader.has-tabs-top {\n  top: 157px; }\n.platform-ios.platform-cordova.status-bar-hide {\n  margin-bottom: 20px; }\n\n@media (orientation: landscape) {\n  .platform-ios.platform-browser.platform-ipad {\n    position: fixed; } }\n\n.platform-c:not(.enable-transitions) * {\n  -webkit-transition: none !important;\n  transition: none !important; }\n\n.slide-in-up {\n  -webkit-transform: translate3d(0, 100%, 0);\n  transform: translate3d(0, 100%, 0); }\n\n.slide-in-up.ng-enter, .slide-in-up > .ng-enter {\n  -webkit-transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;\n  transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms; }\n\n.slide-in-up.ng-enter-active, .slide-in-up > .ng-enter-active {\n  -webkit-transform: translate3d(0, 0, 0);\n  transform: translate3d(0, 0, 0); }\n\n.slide-in-up.ng-leave, .slide-in-up > .ng-leave {\n  -webkit-transition: all ease-in-out 250ms;\n  transition: all ease-in-out 250ms; }\n\n@-webkit-keyframes scaleOut {\n  from {\n    -webkit-transform: scale(1);\n    opacity: 1; }\n\n  to {\n    -webkit-transform: scale(0.8);\n    opacity: 0; } }\n\n@keyframes scaleOut {\n  from {\n    transform: scale(1);\n    opacity: 1; }\n\n  to {\n    transform: scale(0.8);\n    opacity: 0; } }\n\n@-webkit-keyframes superScaleIn {\n  from {\n    -webkit-transform: scale(1.2);\n    opacity: 0; }\n\n  to {\n    -webkit-transform: scale(1);\n    opacity: 1; } }\n\n@keyframes superScaleIn {\n  from {\n    transform: scale(1.2);\n    opacity: 0; }\n\n  to {\n    transform: scale(1);\n    opacity: 1; } }\n\n[nav-view-transition=\"ios\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"] [nav-view=\"leaving\"] {\n  -webkit-transition-duration: 500ms;\n  transition-duration: 500ms;\n  -webkit-transition-timing-function: cubic-bezier(0.36, 0.66, 0.04, 1);\n  transition-timing-function: cubic-bezier(0.36, 0.66, 0.04, 1);\n  -webkit-transition-property: opacity, -webkit-transform, box-shadow;\n  transition-property: opacity, transform, box-shadow; }\n[nav-view-transition=\"ios\"][nav-view-direction=\"forward\"], [nav-view-transition=\"ios\"][nav-view-direction=\"back\"] {\n  background-color: #000; }\n[nav-view-transition=\"ios\"] [nav-view=\"active\"], [nav-view-transition=\"ios\"][nav-view-direction=\"forward\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"][nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n  z-index: 3; }\n[nav-view-transition=\"ios\"][nav-view-direction=\"back\"] [nav-view=\"entering\"], [nav-view-transition=\"ios\"][nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n  z-index: 2; }\n\n[nav-bar-transition=\"ios\"] .title, [nav-bar-transition=\"ios\"] .buttons, [nav-bar-transition=\"ios\"] .back-text {\n  -webkit-transition-duration: 500ms;\n  transition-duration: 500ms;\n  -webkit-transition-timing-function: cubic-bezier(0.36, 0.66, 0.04, 1);\n  transition-timing-function: cubic-bezier(0.36, 0.66, 0.04, 1);\n  -webkit-transition-property: opacity, -webkit-transform;\n  transition-property: opacity, transform; }\n[nav-bar-transition=\"ios\"] [nav-bar=\"active\"], [nav-bar-transition=\"ios\"] [nav-bar=\"entering\"] {\n  z-index: 10; }\n  [nav-bar-transition=\"ios\"] [nav-bar=\"active\"] .bar, [nav-bar-transition=\"ios\"] [nav-bar=\"entering\"] .bar {\n    background: transparent; }\n[nav-bar-transition=\"ios\"] [nav-bar=\"cached\"] {\n  display: block; }\n  [nav-bar-transition=\"ios\"] [nav-bar=\"cached\"] .header-item {\n    display: none; }\n\n[nav-view-transition=\"android\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"] [nav-view=\"leaving\"] {\n  -webkit-transition-duration: 200ms;\n  transition-duration: 200ms;\n  -webkit-transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  -webkit-transition-property: -webkit-transform;\n  transition-property: transform; }\n[nav-view-transition=\"android\"] [nav-view=\"active\"], [nav-view-transition=\"android\"][nav-view-direction=\"forward\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"][nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n  z-index: 3; }\n[nav-view-transition=\"android\"][nav-view-direction=\"back\"] [nav-view=\"entering\"], [nav-view-transition=\"android\"][nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n  z-index: 2; }\n\n[nav-bar-transition=\"android\"] .title, [nav-bar-transition=\"android\"] .buttons {\n  -webkit-transition-duration: 200ms;\n  transition-duration: 200ms;\n  -webkit-transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  transition-timing-function: cubic-bezier(0.4, 0.6, 0.2, 1);\n  -webkit-transition-property: opacity;\n  transition-property: opacity; }\n[nav-bar-transition=\"android\"] [nav-bar=\"active\"], [nav-bar-transition=\"android\"] [nav-bar=\"entering\"] {\n  z-index: 10; }\n  [nav-bar-transition=\"android\"] [nav-bar=\"active\"] .bar, [nav-bar-transition=\"android\"] [nav-bar=\"entering\"] .bar {\n    background: transparent; }\n[nav-bar-transition=\"android\"] [nav-bar=\"cached\"] {\n  display: block; }\n  [nav-bar-transition=\"android\"] [nav-bar=\"cached\"] .header-item {\n    display: none; }\n\n[nav-swipe=\"fast\"] [nav-view], [nav-swipe=\"fast\"] .title, [nav-swipe=\"fast\"] .buttons, [nav-swipe=\"fast\"] .back-text {\n  -webkit-transition-duration: 50ms;\n  transition-duration: 50ms;\n  -webkit-transition-timing-function: linear;\n  transition-timing-function: linear; }\n\n[nav-swipe=\"slow\"] [nav-view], [nav-swipe=\"slow\"] .title, [nav-swipe=\"slow\"] .buttons, [nav-swipe=\"slow\"] .back-text {\n  -webkit-transition-duration: 160ms;\n  transition-duration: 160ms;\n  -webkit-transition-timing-function: linear;\n  transition-timing-function: linear; }\n\n[nav-view=\"cached\"], [nav-bar=\"cached\"] {\n  display: none; }\n\n[nav-view=\"stage\"] {\n  opacity: 0;\n  -webkit-transition-duration: 0;\n  transition-duration: 0; }\n\n[nav-bar=\"stage\"] .title, [nav-bar=\"stage\"] .buttons, [nav-bar=\"stage\"] .back-text {\n  position: absolute;\n  opacity: 0;\n  -webkit-transition-duration: 0s;\n  transition-duration: 0s; }\n"
  },
  {
    "path": "www/lib/ionic/js/ionic-angular.js",
    "content": "/*!\n * Copyright 2014 Drifty Co.\n * http://drifty.com/\n *\n * Ionic, v1.0.0\n * A powerful HTML5 mobile app framework.\n * http://ionicframework.com/\n *\n * By @maxlynch, @benjsperry, @adamdbradley <3\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n\n(function() {\n/* eslint no-unused-vars:0 */\nvar IonicModule = angular.module('ionic', ['ngAnimate', 'ngSanitize', 'ui.router']),\n  extend = angular.extend,\n  forEach = angular.forEach,\n  isDefined = angular.isDefined,\n  isNumber = angular.isNumber,\n  isString = angular.isString,\n  jqLite = angular.element,\n  noop = angular.noop;\n\n/**\n * @ngdoc service\n * @name $ionicActionSheet\n * @module ionic\n * @description\n * The Action Sheet is a slide-up pane that lets the user choose from a set of options.\n * Dangerous options are highlighted in red and made obvious.\n *\n * There are easy ways to cancel out of the action sheet, such as tapping the backdrop or even\n * hitting escape on the keyboard for desktop testing.\n *\n * ![Action Sheet](http://ionicframework.com.s3.amazonaws.com/docs/controllers/actionSheet.gif)\n *\n * @usage\n * To trigger an Action Sheet in your code, use the $ionicActionSheet service in your angular controllers:\n *\n * ```js\n * angular.module('mySuperApp', ['ionic'])\n * .controller(function($scope, $ionicActionSheet, $timeout) {\n *\n *  // Triggered on a button click, or some other target\n *  $scope.show = function() {\n *\n *    // Show the action sheet\n *    var hideSheet = $ionicActionSheet.show({\n *      buttons: [\n *        { text: '<b>Share</b> This' },\n *        { text: 'Move' }\n *      ],\n *      destructiveText: 'Delete',\n *      titleText: 'Modify your album',\n *      cancelText: 'Cancel',\n *      cancel: function() {\n          // add cancel code..\n        },\n *      buttonClicked: function(index) {\n *        return true;\n *      }\n *    });\n *\n *    // For example's sake, hide the sheet after two seconds\n *    $timeout(function() {\n *      hideSheet();\n *    }, 2000);\n *\n *  };\n * });\n * ```\n *\n */\nIonicModule\n.factory('$ionicActionSheet', [\n  '$rootScope',\n  '$compile',\n  '$animate',\n  '$timeout',\n  '$ionicTemplateLoader',\n  '$ionicPlatform',\n  '$ionicBody',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicPlatform, $ionicBody, IONIC_BACK_PRIORITY) {\n\n  return {\n    show: actionSheet\n  };\n\n  /**\n   * @ngdoc method\n   * @name $ionicActionSheet#show\n   * @description\n   * Load and return a new action sheet.\n   *\n   * A new isolated scope will be created for the\n   * action sheet and the new element will be appended into the body.\n   *\n   * @param {object} options The options for this ActionSheet. Properties:\n   *\n   *  - `[Object]` `buttons` Which buttons to show.  Each button is an object with a `text` field.\n   *  - `{string}` `titleText` The title to show on the action sheet.\n   *  - `{string=}` `cancelText` the text for a 'cancel' button on the action sheet.\n   *  - `{string=}` `destructiveText` The text for a 'danger' on the action sheet.\n   *  - `{function=}` `cancel` Called if the cancel button is pressed, the backdrop is tapped or\n   *     the hardware back button is pressed.\n   *  - `{function=}` `buttonClicked` Called when one of the non-destructive buttons is clicked,\n   *     with the index of the button that was clicked and the button object. Return true to close\n   *     the action sheet, or false to keep it opened.\n   *  - `{function=}` `destructiveButtonClicked` Called when the destructive button is clicked.\n   *     Return true to close the action sheet, or false to keep it opened.\n   *  -  `{boolean=}` `cancelOnStateChange` Whether to cancel the actionSheet when navigating\n   *     to a new state.  Default true.\n   *  - `{string}` `cssClass` The custom CSS class name.\n   *\n   * @returns {function} `hideSheet` A function which, when called, hides & cancels the action sheet.\n   */\n  function actionSheet(opts) {\n    var scope = $rootScope.$new(true);\n\n    extend(scope, {\n      cancel: noop,\n      destructiveButtonClicked: noop,\n      buttonClicked: noop,\n      $deregisterBackButton: noop,\n      buttons: [],\n      cancelOnStateChange: true\n    }, opts || {});\n\n    function textForIcon(text) {\n      if (text && /icon/.test(text)) {\n        scope.$actionSheetHasIcon = true;\n      }\n    }\n\n    for (var x = 0; x < scope.buttons.length; x++) {\n      textForIcon(scope.buttons[x].text);\n    }\n    textForIcon(scope.cancelText);\n    textForIcon(scope.destructiveText);\n\n    // Compile the template\n    var element = scope.element = $compile('<ion-action-sheet ng-class=\"cssClass\" buttons=\"buttons\"></ion-action-sheet>')(scope);\n\n    // Grab the sheet element for animation\n    var sheetEl = jqLite(element[0].querySelector('.action-sheet-wrapper'));\n\n    var stateChangeListenDone = scope.cancelOnStateChange ?\n      $rootScope.$on('$stateChangeSuccess', function() { scope.cancel(); }) :\n      noop;\n\n    // removes the actionSheet from the screen\n    scope.removeSheet = function(done) {\n      if (scope.removed) return;\n\n      scope.removed = true;\n      sheetEl.removeClass('action-sheet-up');\n      $timeout(function() {\n        // wait to remove this due to a 300ms delay native\n        // click which would trigging whatever was underneath this\n        $ionicBody.removeClass('action-sheet-open');\n      }, 400);\n      scope.$deregisterBackButton();\n      stateChangeListenDone();\n\n      $animate.removeClass(element, 'active').then(function() {\n        scope.$destroy();\n        element.remove();\n        // scope.cancel.$scope is defined near the bottom\n        scope.cancel.$scope = sheetEl = null;\n        (done || noop)();\n      });\n    };\n\n    scope.showSheet = function(done) {\n      if (scope.removed) return;\n\n      $ionicBody.append(element)\n                .addClass('action-sheet-open');\n\n      $animate.addClass(element, 'active').then(function() {\n        if (scope.removed) return;\n        (done || noop)();\n      });\n      $timeout(function() {\n        if (scope.removed) return;\n        sheetEl.addClass('action-sheet-up');\n      }, 20, false);\n    };\n\n    // registerBackButtonAction returns a callback to deregister the action\n    scope.$deregisterBackButton = $ionicPlatform.registerBackButtonAction(\n      function() {\n        $timeout(scope.cancel);\n      },\n      IONIC_BACK_PRIORITY.actionSheet\n    );\n\n    // called when the user presses the cancel button\n    scope.cancel = function() {\n      // after the animation is out, call the cancel callback\n      scope.removeSheet(opts.cancel);\n    };\n\n    scope.buttonClicked = function(index) {\n      // Check if the button click event returned true, which means\n      // we can close the action sheet\n      if (opts.buttonClicked(index, opts.buttons[index]) === true) {\n        scope.removeSheet();\n      }\n    };\n\n    scope.destructiveButtonClicked = function() {\n      // Check if the destructive button click event returned true, which means\n      // we can close the action sheet\n      if (opts.destructiveButtonClicked() === true) {\n        scope.removeSheet();\n      }\n    };\n\n    scope.showSheet();\n\n    // Expose the scope on $ionicActionSheet's return value for the sake\n    // of testing it.\n    scope.cancel.$scope = scope;\n\n    return scope.cancel;\n  }\n}]);\n\n\njqLite.prototype.addClass = function(cssClasses) {\n  var x, y, cssClass, el, splitClasses, existingClasses;\n  if (cssClasses && cssClasses != 'ng-scope' && cssClasses != 'ng-isolate-scope') {\n    for (x = 0; x < this.length; x++) {\n      el = this[x];\n      if (el.setAttribute) {\n\n        if (cssClasses.indexOf(' ') < 0 && el.classList.add) {\n          el.classList.add(cssClasses);\n        } else {\n          existingClasses = (' ' + (el.getAttribute('class') || '') + ' ')\n            .replace(/[\\n\\t]/g, \" \");\n          splitClasses = cssClasses.split(' ');\n\n          for (y = 0; y < splitClasses.length; y++) {\n            cssClass = splitClasses[y].trim();\n            if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n              existingClasses += cssClass + ' ';\n            }\n          }\n          el.setAttribute('class', existingClasses.trim());\n        }\n      }\n    }\n  }\n  return this;\n};\n\njqLite.prototype.removeClass = function(cssClasses) {\n  var x, y, splitClasses, cssClass, el;\n  if (cssClasses) {\n    for (x = 0; x < this.length; x++) {\n      el = this[x];\n      if (el.getAttribute) {\n        if (cssClasses.indexOf(' ') < 0 && el.classList.remove) {\n          el.classList.remove(cssClasses);\n        } else {\n          splitClasses = cssClasses.split(' ');\n\n          for (y = 0; y < splitClasses.length; y++) {\n            cssClass = splitClasses[y];\n            el.setAttribute('class', (\n                (\" \" + (el.getAttribute('class') || '') + \" \")\n                .replace(/[\\n\\t]/g, \" \")\n                .replace(\" \" + cssClass.trim() + \" \", \" \")).trim()\n            );\n          }\n        }\n      }\n    }\n  }\n  return this;\n};\n\n/**\n * @ngdoc service\n * @name $ionicBackdrop\n * @module ionic\n * @description\n * Shows and hides a backdrop over the UI.  Appears behind popups, loading,\n * and other overlays.\n *\n * Often, multiple UI components require a backdrop, but only one backdrop is\n * ever needed in the DOM at a time.\n *\n * Therefore, each component that requires the backdrop to be shown calls\n * `$ionicBackdrop.retain()` when it wants the backdrop, then `$ionicBackdrop.release()`\n * when it is done with the backdrop.\n *\n * For each time `retain` is called, the backdrop will be shown until `release` is called.\n *\n * For example, if `retain` is called three times, the backdrop will be shown until `release`\n * is called three times.\n *\n * @usage\n *\n * ```js\n * function MyController($scope, $ionicBackdrop, $timeout) {\n *   //Show a backdrop for one second\n *   $scope.action = function() {\n *     $ionicBackdrop.retain();\n *     $timeout(function() {\n *       $ionicBackdrop.release();\n *     }, 1000);\n *   };\n * }\n * ```\n */\nIonicModule\n.factory('$ionicBackdrop', [\n  '$document', '$timeout', '$$rAF',\nfunction($document, $timeout, $$rAF) {\n\n  var el = jqLite('<div class=\"backdrop\">');\n  var backdropHolds = 0;\n\n  $document[0].body.appendChild(el[0]);\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicBackdrop#retain\n     * @description Retains the backdrop.\n     */\n    retain: retain,\n    /**\n     * @ngdoc method\n     * @name $ionicBackdrop#release\n     * @description\n     * Releases the backdrop.\n     */\n    release: release,\n\n    getElement: getElement,\n\n    // exposed for testing\n    _element: el\n  };\n\n  function retain() {\n    backdropHolds++;\n    if (backdropHolds === 1) {\n      el.addClass('visible');\n      $$rAF(function() {\n        // If we're still at >0 backdropHolds after async...\n        if (backdropHolds >= 1) el.addClass('active');\n      });\n    }\n  }\n  function release() {\n    if (backdropHolds === 1) {\n      el.removeClass('active');\n      $timeout(function() {\n        // If we're still at 0 backdropHolds after async...\n        if (backdropHolds === 0) el.removeClass('visible');\n      }, 400, false);\n    }\n    backdropHolds = Math.max(0, backdropHolds - 1);\n  }\n\n  function getElement() {\n    return el;\n  }\n\n}]);\n\n/**\n * @private\n */\nIonicModule\n.factory('$ionicBind', ['$parse', '$interpolate', function($parse, $interpolate) {\n  var LOCAL_REGEXP = /^\\s*([@=&])(\\??)\\s*(\\w*)\\s*$/;\n  return function(scope, attrs, bindDefinition) {\n    forEach(bindDefinition || {}, function(definition, scopeName) {\n      //Adapted from angular.js $compile\n      var match = definition.match(LOCAL_REGEXP) || [],\n        attrName = match[3] || scopeName,\n        mode = match[1], // @, =, or &\n        parentGet,\n        unwatch;\n\n      switch (mode) {\n        case '@':\n          if (!attrs[attrName]) {\n            return;\n          }\n          attrs.$observe(attrName, function(value) {\n            scope[scopeName] = value;\n          });\n          // we trigger an interpolation to ensure\n          // the value is there for use immediately\n          if (attrs[attrName]) {\n            scope[scopeName] = $interpolate(attrs[attrName])(scope);\n          }\n          break;\n\n        case '=':\n          if (!attrs[attrName]) {\n            return;\n          }\n          unwatch = scope.$watch(attrs[attrName], function(value) {\n            scope[scopeName] = value;\n          });\n          //Destroy parent scope watcher when this scope is destroyed\n          scope.$on('$destroy', unwatch);\n          break;\n\n        case '&':\n          /* jshint -W044 */\n          if (attrs[attrName] && attrs[attrName].match(RegExp(scopeName + '\\(.*?\\)'))) {\n            throw new Error('& expression binding \"' + scopeName + '\" looks like it will recursively call \"' +\n                          attrs[attrName] + '\" and cause a stack overflow! Please choose a different scopeName.');\n          }\n          parentGet = $parse(attrs[attrName]);\n          scope[scopeName] = function(locals) {\n            return parentGet(scope, locals);\n          };\n          break;\n      }\n    });\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicBody\n * @module ionic\n * @description An angular utility service to easily and efficiently\n * add and remove CSS classes from the document's body element.\n */\nIonicModule\n.factory('$ionicBody', ['$document', function($document) {\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicBody#add\n     * @description Add a class to the document's body element.\n     * @param {string} class Each argument will be added to the body element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    addClass: function() {\n      for (var x = 0; x < arguments.length; x++) {\n        $document[0].body.classList.add(arguments[x]);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#removeClass\n     * @description Remove a class from the document's body element.\n     * @param {string} class Each argument will be removed from the body element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    removeClass: function() {\n      for (var x = 0; x < arguments.length; x++) {\n        $document[0].body.classList.remove(arguments[x]);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#enableClass\n     * @description Similar to the `add` method, except the first parameter accepts a boolean\n     * value determining if the class should be added or removed. Rather than writing user code,\n     * such as \"if true then add the class, else then remove the class\", this method can be\n     * given a true or false value which reduces redundant code.\n     * @param {boolean} shouldEnableClass A true/false value if the class should be added or removed.\n     * @param {string} class Each remaining argument would be added or removed depending on\n     * the first argument.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    enableClass: function(shouldEnableClass) {\n      var args = Array.prototype.slice.call(arguments).slice(1);\n      if (shouldEnableClass) {\n        this.addClass.apply(this, args);\n      } else {\n        this.removeClass.apply(this, args);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#append\n     * @description Append a child to the document's body.\n     * @param {element} element The element to be appended to the body. The passed in element\n     * can be either a jqLite element, or a DOM element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    append: function(ele) {\n      $document[0].body.appendChild(ele.length ? ele[0] : ele);\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#get\n     * @description Get the document's body element.\n     * @returns {element} Returns the document's body element.\n     */\n    get: function() {\n      return $document[0].body;\n    }\n  };\n}]);\n\nIonicModule\n.factory('$ionicClickBlock', [\n  '$document',\n  '$ionicBody',\n  '$timeout',\nfunction($document, $ionicBody, $timeout) {\n  var CSS_HIDE = 'click-block-hide';\n  var cbEle, fallbackTimer, pendingShow;\n\n  function preventClick(ev) {\n    ev.preventDefault();\n    ev.stopPropagation();\n  }\n\n  function addClickBlock() {\n    if (pendingShow) {\n      if (cbEle) {\n        cbEle.classList.remove(CSS_HIDE);\n      } else {\n        cbEle = $document[0].createElement('div');\n        cbEle.className = 'click-block';\n        $ionicBody.append(cbEle);\n        cbEle.addEventListener('touchstart', preventClick);\n        cbEle.addEventListener('mousedown', preventClick);\n      }\n      pendingShow = false;\n    }\n  }\n\n  function removeClickBlock() {\n    cbEle && cbEle.classList.add(CSS_HIDE);\n  }\n\n  return {\n    show: function(autoExpire) {\n      pendingShow = true;\n      $timeout.cancel(fallbackTimer);\n      fallbackTimer = $timeout(this.hide, autoExpire || 310, false);\n      addClickBlock();\n    },\n    hide: function() {\n      pendingShow = false;\n      $timeout.cancel(fallbackTimer);\n      removeClickBlock();\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicGesture\n * @module ionic\n * @description An angular service exposing ionic\n * {@link ionic.utility:ionic.EventController}'s gestures.\n */\nIonicModule\n.factory('$ionicGesture', [function() {\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicGesture#on\n     * @description Add an event listener for a gesture on an element. See {@link ionic.utility:ionic.EventController#onGesture}.\n     * @param {string} eventType The gesture event to listen for.\n     * @param {function(e)} callback The function to call when the gesture\n     * happens.\n     * @param {element} $element The angular element to listen for the event on.\n     * @param {object} options object.\n     * @returns {ionic.Gesture} The gesture object (use this to remove the gesture later on).\n     */\n    on: function(eventType, cb, $element, options) {\n      return window.ionic.onGesture(eventType, cb, $element[0], options);\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicGesture#off\n     * @description Remove an event listener for a gesture on an element. See {@link ionic.utility:ionic.EventController#offGesture}.\n     * @param {ionic.Gesture} gesture The gesture that should be removed.\n     * @param {string} eventType The gesture event to remove the listener for.\n     * @param {function(e)} callback The listener to remove.\n     */\n    off: function(gesture, eventType, cb) {\n      return window.ionic.offGesture(gesture, eventType, cb);\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicHistory\n * @module ionic\n * @description\n * $ionicHistory keeps track of views as the user navigates through an app. Similar to the way a\n * browser behaves, an Ionic app is able to keep track of the previous view, the current view, and\n * the forward view (if there is one).  However, a typical web browser only keeps track of one\n * history stack in a linear fashion.\n *\n * Unlike a traditional browser environment, apps and webapps have parallel independent histories,\n * such as with tabs. Should a user navigate few pages deep on one tab, and then switch to a new\n * tab and back, the back button relates not to the previous tab, but to the previous pages\n * visited within _that_ tab.\n *\n * `$ionicHistory` facilitates this parallel history architecture.\n */\n\nIonicModule\n.factory('$ionicHistory', [\n  '$rootScope',\n  '$state',\n  '$location',\n  '$window',\n  '$timeout',\n  '$ionicViewSwitcher',\n  '$ionicNavViewDelegate',\nfunction($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $ionicNavViewDelegate) {\n\n  // history actions while navigating views\n  var ACTION_INITIAL_VIEW = 'initialView';\n  var ACTION_NEW_VIEW = 'newView';\n  var ACTION_MOVE_BACK = 'moveBack';\n  var ACTION_MOVE_FORWARD = 'moveForward';\n\n  // direction of navigation\n  var DIRECTION_BACK = 'back';\n  var DIRECTION_FORWARD = 'forward';\n  var DIRECTION_ENTER = 'enter';\n  var DIRECTION_EXIT = 'exit';\n  var DIRECTION_SWAP = 'swap';\n  var DIRECTION_NONE = 'none';\n\n  var stateChangeCounter = 0;\n  var lastStateId, nextViewOptions, nextViewExpireTimer, forcedNav;\n\n  var viewHistory = {\n    histories: { root: { historyId: 'root', parentHistoryId: null, stack: [], cursor: -1 } },\n    views: {},\n    backView: null,\n    forwardView: null,\n    currentView: null\n  };\n\n  var View = function() {};\n  View.prototype.initialize = function(data) {\n    if (data) {\n      for (var name in data) this[name] = data[name];\n      return this;\n    }\n    return null;\n  };\n  View.prototype.go = function() {\n\n    if (this.stateName) {\n      return $state.go(this.stateName, this.stateParams);\n    }\n\n    if (this.url && this.url !== $location.url()) {\n\n      if (viewHistory.backView === this) {\n        return $window.history.go(-1);\n      } else if (viewHistory.forwardView === this) {\n        return $window.history.go(1);\n      }\n\n      $location.url(this.url);\n    }\n\n    return null;\n  };\n  View.prototype.destroy = function() {\n    if (this.scope) {\n      this.scope.$destroy && this.scope.$destroy();\n      this.scope = null;\n    }\n  };\n\n\n  function getViewById(viewId) {\n    return (viewId ? viewHistory.views[ viewId ] : null);\n  }\n\n  function getBackView(view) {\n    return (view ? getViewById(view.backViewId) : null);\n  }\n\n  function getForwardView(view) {\n    return (view ? getViewById(view.forwardViewId) : null);\n  }\n\n  function getHistoryById(historyId) {\n    return (historyId ? viewHistory.histories[ historyId ] : null);\n  }\n\n  function getHistory(scope) {\n    var histObj = getParentHistoryObj(scope);\n\n    if (!viewHistory.histories[ histObj.historyId ]) {\n      // this history object exists in parent scope, but doesn't\n      // exist in the history data yet\n      viewHistory.histories[ histObj.historyId ] = {\n        historyId: histObj.historyId,\n        parentHistoryId: getParentHistoryObj(histObj.scope.$parent).historyId,\n        stack: [],\n        cursor: -1\n      };\n    }\n    return getHistoryById(histObj.historyId);\n  }\n\n  function getParentHistoryObj(scope) {\n    var parentScope = scope;\n    while (parentScope) {\n      if (parentScope.hasOwnProperty('$historyId')) {\n        // this parent scope has a historyId\n        return { historyId: parentScope.$historyId, scope: parentScope };\n      }\n      // nothing found keep climbing up\n      parentScope = parentScope.$parent;\n    }\n    // no history for the parent, use the root\n    return { historyId: 'root', scope: $rootScope };\n  }\n\n  function setNavViews(viewId) {\n    viewHistory.currentView = getViewById(viewId);\n    viewHistory.backView = getBackView(viewHistory.currentView);\n    viewHistory.forwardView = getForwardView(viewHistory.currentView);\n  }\n\n  function getCurrentStateId() {\n    var id;\n    if ($state && $state.current && $state.current.name) {\n      id = $state.current.name;\n      if ($state.params) {\n        for (var key in $state.params) {\n          if ($state.params.hasOwnProperty(key) && $state.params[key]) {\n            id += \"_\" + key + \"=\" + $state.params[key];\n          }\n        }\n      }\n      return id;\n    }\n    // if something goes wrong make sure its got a unique stateId\n    return ionic.Utils.nextUid();\n  }\n\n  function getCurrentStateParams() {\n    var rtn;\n    if ($state && $state.params) {\n      for (var key in $state.params) {\n        if ($state.params.hasOwnProperty(key)) {\n          rtn = rtn || {};\n          rtn[key] = $state.params[key];\n        }\n      }\n    }\n    return rtn;\n  }\n\n\n  return {\n\n    register: function(parentScope, viewLocals) {\n\n      var currentStateId = getCurrentStateId(),\n          hist = getHistory(parentScope),\n          currentView = viewHistory.currentView,\n          backView = viewHistory.backView,\n          forwardView = viewHistory.forwardView,\n          viewId = null,\n          action = null,\n          direction = DIRECTION_NONE,\n          historyId = hist.historyId,\n          url = $location.url(),\n          tmp, x, ele;\n\n      if (lastStateId !== currentStateId) {\n        lastStateId = currentStateId;\n        stateChangeCounter++;\n      }\n\n      if (forcedNav) {\n        // we've previously set exactly what to do\n        viewId = forcedNav.viewId;\n        action = forcedNav.action;\n        direction = forcedNav.direction;\n        forcedNav = null;\n\n      } else if (backView && backView.stateId === currentStateId) {\n        // they went back one, set the old current view as a forward view\n        viewId = backView.viewId;\n        historyId = backView.historyId;\n        action = ACTION_MOVE_BACK;\n        if (backView.historyId === currentView.historyId) {\n          // went back in the same history\n          direction = DIRECTION_BACK;\n\n        } else if (currentView) {\n          direction = DIRECTION_EXIT;\n\n          tmp = getHistoryById(backView.historyId);\n          if (tmp && tmp.parentHistoryId === currentView.historyId) {\n            direction = DIRECTION_ENTER;\n\n          } else {\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n            }\n          }\n        }\n\n      } else if (forwardView && forwardView.stateId === currentStateId) {\n        // they went to the forward one, set the forward view to no longer a forward view\n        viewId = forwardView.viewId;\n        historyId = forwardView.historyId;\n        action = ACTION_MOVE_FORWARD;\n        if (forwardView.historyId === currentView.historyId) {\n          direction = DIRECTION_FORWARD;\n\n        } else if (currentView) {\n          direction = DIRECTION_EXIT;\n\n          if (currentView.historyId === hist.parentHistoryId) {\n            direction = DIRECTION_ENTER;\n\n          } else {\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n            }\n          }\n        }\n\n        tmp = getParentHistoryObj(parentScope);\n        if (forwardView.historyId && tmp.scope) {\n          // if a history has already been created by the forward view then make sure it stays the same\n          tmp.scope.$historyId = forwardView.historyId;\n          historyId = forwardView.historyId;\n        }\n\n      } else if (currentView && currentView.historyId !== historyId &&\n                hist.cursor > -1 && hist.stack.length > 0 && hist.cursor < hist.stack.length &&\n                hist.stack[hist.cursor].stateId === currentStateId) {\n        // they just changed to a different history and the history already has views in it\n        var switchToView = hist.stack[hist.cursor];\n        viewId = switchToView.viewId;\n        historyId = switchToView.historyId;\n        action = ACTION_MOVE_BACK;\n        direction = DIRECTION_SWAP;\n\n        tmp = getHistoryById(currentView.historyId);\n        if (tmp && tmp.parentHistoryId === historyId) {\n          direction = DIRECTION_EXIT;\n\n        } else {\n          tmp = getHistoryById(historyId);\n          if (tmp && tmp.parentHistoryId === currentView.historyId) {\n            direction = DIRECTION_ENTER;\n          }\n        }\n\n        // if switching to a different history, and the history of the view we're switching\n        // to has an existing back view from a different history than itself, then\n        // it's back view would be better represented using the current view as its back view\n        tmp = getViewById(switchToView.backViewId);\n        if (tmp && switchToView.historyId !== tmp.historyId) {\n          hist.stack[hist.cursor].backViewId = currentView.viewId;\n        }\n\n      } else {\n\n        // create an element from the viewLocals template\n        ele = $ionicViewSwitcher.createViewEle(viewLocals);\n        if (this.isAbstractEle(ele, viewLocals)) {\n          void 0;\n          return {\n            action: 'abstractView',\n            direction: DIRECTION_NONE,\n            ele: ele\n          };\n        }\n\n        // set a new unique viewId\n        viewId = ionic.Utils.nextUid();\n\n        if (currentView) {\n          // set the forward view if there is a current view (ie: if its not the first view)\n          currentView.forwardViewId = viewId;\n\n          action = ACTION_NEW_VIEW;\n\n          // check if there is a new forward view within the same history\n          if (forwardView && currentView.stateId !== forwardView.stateId &&\n             currentView.historyId === forwardView.historyId) {\n            // they navigated to a new view but the stack already has a forward view\n            // since its a new view remove any forwards that existed\n            tmp = getHistoryById(forwardView.historyId);\n            if (tmp) {\n              // the forward has a history\n              for (x = tmp.stack.length - 1; x >= forwardView.index; x--) {\n                // starting from the end destroy all forwards in this history from this point\n                var stackItem = tmp.stack[x];\n                stackItem && stackItem.destroy && stackItem.destroy();\n                tmp.stack.splice(x);\n              }\n              historyId = forwardView.historyId;\n            }\n          }\n\n          // its only moving forward if its in the same history\n          if (hist.historyId === currentView.historyId) {\n            direction = DIRECTION_FORWARD;\n\n          } else if (currentView.historyId !== hist.historyId) {\n            direction = DIRECTION_ENTER;\n\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n\n            } else {\n              tmp = getHistoryById(tmp.parentHistoryId);\n              if (tmp && tmp.historyId === hist.historyId) {\n                direction = DIRECTION_EXIT;\n              }\n            }\n          }\n\n        } else {\n          // there's no current view, so this must be the initial view\n          action = ACTION_INITIAL_VIEW;\n        }\n\n        if (stateChangeCounter < 2) {\n          // views that were spun up on the first load should not animate\n          direction = DIRECTION_NONE;\n        }\n\n        // add the new view\n        viewHistory.views[viewId] = this.createView({\n          viewId: viewId,\n          index: hist.stack.length,\n          historyId: hist.historyId,\n          backViewId: (currentView && currentView.viewId ? currentView.viewId : null),\n          forwardViewId: null,\n          stateId: currentStateId,\n          stateName: this.currentStateName(),\n          stateParams: getCurrentStateParams(),\n          url: url,\n          canSwipeBack: canSwipeBack(ele, viewLocals)\n        });\n\n        // add the new view to this history's stack\n        hist.stack.push(viewHistory.views[viewId]);\n      }\n\n      $timeout.cancel(nextViewExpireTimer);\n      if (nextViewOptions) {\n        if (nextViewOptions.disableAnimate) direction = DIRECTION_NONE;\n        if (nextViewOptions.disableBack) viewHistory.views[viewId].backViewId = null;\n        if (nextViewOptions.historyRoot) {\n          for (x = 0; x < hist.stack.length; x++) {\n            if (hist.stack[x].viewId === viewId) {\n              hist.stack[x].index = 0;\n              hist.stack[x].backViewId = hist.stack[x].forwardViewId = null;\n            } else {\n              delete viewHistory.views[hist.stack[x].viewId];\n            }\n          }\n          hist.stack = [viewHistory.views[viewId]];\n        }\n        nextViewOptions = null;\n      }\n\n      setNavViews(viewId);\n\n      if (viewHistory.backView && historyId == viewHistory.backView.historyId && currentStateId == viewHistory.backView.stateId && url == viewHistory.backView.url) {\n        for (x = 0; x < hist.stack.length; x++) {\n          if (hist.stack[x].viewId == viewId) {\n            action = 'dupNav';\n            direction = DIRECTION_NONE;\n            if (x > 0) {\n              hist.stack[x - 1].forwardViewId = null;\n            }\n            viewHistory.forwardView = null;\n            viewHistory.currentView.index = viewHistory.backView.index;\n            viewHistory.currentView.backViewId = viewHistory.backView.backViewId;\n            viewHistory.backView = getBackView(viewHistory.backView);\n            hist.stack.splice(x, 1);\n            break;\n          }\n        }\n      }\n\n      void 0;\n\n      hist.cursor = viewHistory.currentView.index;\n\n      return {\n        viewId: viewId,\n        action: action,\n        direction: direction,\n        historyId: historyId,\n        enableBack: this.enabledBack(viewHistory.currentView),\n        isHistoryRoot: (viewHistory.currentView.index === 0),\n        ele: ele\n      };\n    },\n\n    registerHistory: function(scope) {\n      scope.$historyId = ionic.Utils.nextUid();\n    },\n\n    createView: function(data) {\n      var newView = new View();\n      return newView.initialize(data);\n    },\n\n    getViewById: getViewById,\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#viewHistory\n     * @description The app's view history data, such as all the views and histories, along\n     * with how they are ordered and linked together within the navigation stack.\n     * @returns {object} Returns an object containing the apps view history data.\n     */\n    viewHistory: function() {\n      return viewHistory;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentView\n     * @description The app's current view.\n     * @returns {object} Returns the current view.\n     */\n    currentView: function(view) {\n      if (arguments.length) {\n        viewHistory.currentView = view;\n      }\n      return viewHistory.currentView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentHistoryId\n     * @description The ID of the history stack which is the parent container of the current view.\n     * @returns {string} Returns the current history ID.\n     */\n    currentHistoryId: function() {\n      return viewHistory.currentView ? viewHistory.currentView.historyId : null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentTitle\n     * @description Gets and sets the current view's title.\n     * @param {string=} val The title to update the current view with.\n     * @returns {string} Returns the current view's title.\n     */\n    currentTitle: function(val) {\n      if (viewHistory.currentView) {\n        if (arguments.length) {\n          viewHistory.currentView.title = val;\n        }\n        return viewHistory.currentView.title;\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#backView\n     * @description Returns the view that was before the current view in the history stack.\n     * If the user navigated from View A to View B, then View A would be the back view, and\n     * View B would be the current view.\n     * @returns {object} Returns the back view.\n     */\n    backView: function(view) {\n      if (arguments.length) {\n        viewHistory.backView = view;\n      }\n      return viewHistory.backView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#backTitle\n     * @description Gets the back view's title.\n     * @returns {string} Returns the back view's title.\n     */\n    backTitle: function(view) {\n      var backView = (view && getViewById(view.backViewId)) || viewHistory.backView;\n      return backView && backView.title;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#forwardView\n     * @description Returns the view that was in front of the current view in the history stack.\n     * A forward view would exist if the user navigated from View A to View B, then\n     * navigated back to View A. At this point then View B would be the forward view, and View\n     * A would be the current view.\n     * @returns {object} Returns the forward view.\n     */\n    forwardView: function(view) {\n      if (arguments.length) {\n        viewHistory.forwardView = view;\n      }\n      return viewHistory.forwardView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentStateName\n     * @description Returns the current state name.\n     * @returns {string}\n     */\n    currentStateName: function() {\n      return ($state && $state.current ? $state.current.name : null);\n    },\n\n    isCurrentStateNavView: function(navView) {\n      return !!($state && $state.current && $state.current.views && $state.current.views[navView]);\n    },\n\n    goToHistoryRoot: function(historyId) {\n      if (historyId) {\n        var hist = getHistoryById(historyId);\n        if (hist && hist.stack.length) {\n          if (viewHistory.currentView && viewHistory.currentView.viewId === hist.stack[0].viewId) {\n            return;\n          }\n          forcedNav = {\n            viewId: hist.stack[0].viewId,\n            action: ACTION_MOVE_BACK,\n            direction: DIRECTION_BACK\n          };\n          hist.stack[0].go();\n        }\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#goBack\n     * @param {number=} backCount Optional negative integer setting how many views to go\n     * back. By default it'll go back one view by using the value `-1`. To go back two\n     * views you would use `-2`. If the number goes farther back than the number of views\n     * in the current history's stack then it'll go to the first view in the current history's\n     * stack. If the number is zero or greater then it'll do nothing. It also does not\n     * cross history stacks, meaning it can only go as far back as the current history.\n     * @description Navigates the app to the back view, if a back view exists.\n     */\n    goBack: function(backCount) {\n      if (isDefined(backCount) && backCount !== -1) {\n        if (backCount > -1) return;\n\n        var currentHistory = viewHistory.histories[this.currentHistoryId()];\n        var newCursor = currentHistory.cursor + backCount + 1;\n        if (newCursor < 1) {\n          newCursor = 1;\n        }\n\n        currentHistory.cursor = newCursor;\n        setNavViews(currentHistory.stack[newCursor].viewId);\n\n        var cursor = newCursor - 1;\n        var clearStateIds = [];\n        var fwdView = getViewById(currentHistory.stack[cursor].forwardViewId);\n        while (fwdView) {\n          clearStateIds.push(fwdView.stateId || fwdView.viewId);\n          cursor++;\n          if (cursor >= currentHistory.stack.length) break;\n          fwdView = getViewById(currentHistory.stack[cursor].forwardViewId);\n        }\n\n        var self = this;\n        if (clearStateIds.length) {\n          $timeout(function() {\n            self.clearCache(clearStateIds);\n          }, 600);\n        }\n      }\n\n      viewHistory.backView && viewHistory.backView.go();\n    },\n\n\n    enabledBack: function(view) {\n      var backView = getBackView(view);\n      return !!(backView && backView.historyId === view.historyId);\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#clearHistory\n     * @description Clears out the app's entire history, except for the current view.\n     */\n    clearHistory: function() {\n      var\n      histories = viewHistory.histories,\n      currentView = viewHistory.currentView;\n\n      if (histories) {\n        for (var historyId in histories) {\n\n          if (histories[historyId].stack) {\n            histories[historyId].stack = [];\n            histories[historyId].cursor = -1;\n          }\n\n          if (currentView && currentView.historyId === historyId) {\n            currentView.backViewId = currentView.forwardViewId = null;\n            histories[historyId].stack.push(currentView);\n          } else if (histories[historyId].destroy) {\n            histories[historyId].destroy();\n          }\n\n        }\n      }\n\n      for (var viewId in viewHistory.views) {\n        if (viewId !== currentView.viewId) {\n          delete viewHistory.views[viewId];\n        }\n      }\n\n      if (currentView) {\n        setNavViews(currentView.viewId);\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#clearCache\n     * @description Removes all cached views within every {@link ionic.directive:ionNavView}.\n     * This both removes the view element from the DOM, and destroy it's scope.\n     */\n    clearCache: function(stateIds) {\n      $timeout(function() {\n        $ionicNavViewDelegate._instances.forEach(function(instance) {\n          instance.clearCache(stateIds);\n        });\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#nextViewOptions\n     * @description Sets options for the next view. This method can be useful to override\n     * certain view/transition defaults right before a view transition happens. For example,\n     * the {@link ionic.directive:menuClose} directive uses this method internally to ensure\n     * an animated view transition does not happen when a side menu is open, and also sets\n     * the next view as the root of its history stack. After the transition these options\n     * are set back to null.\n     *\n     * Available options:\n     *\n     * * `disableAnimate`: Do not animate the next transition.\n     * * `disableBack`: The next view should forget its back view, and set it to null.\n     * * `historyRoot`: The next view should become the root view in its history stack.\n     *\n     * ```js\n     * $ionicHistory.nextViewOptions({\n     *   disableAnimate: true,\n     *   disableBack: true\n     * });\n     * ```\n     */\n    nextViewOptions: function(opts) {\n      if (arguments.length) {\n        $timeout.cancel(nextViewExpireTimer);\n        if (opts === null) {\n          nextViewOptions = opts;\n        } else {\n          nextViewOptions = nextViewOptions || {};\n          extend(nextViewOptions, opts);\n          if (nextViewOptions.expire) {\n            nextViewExpireTimer = $timeout(function() {\n              nextViewOptions = null;\n            }, nextViewOptions.expire);\n          }\n        }\n      }\n      return nextViewOptions;\n    },\n\n    isAbstractEle: function(ele, viewLocals) {\n      if (viewLocals && viewLocals.$$state && viewLocals.$$state.self['abstract']) {\n        return true;\n      }\n      return !!(ele && (isAbstractTag(ele) || isAbstractTag(ele.children())));\n    },\n\n    isActiveScope: function(scope) {\n      if (!scope) return false;\n\n      var climbScope = scope;\n      var currentHistoryId = this.currentHistoryId();\n      var foundHistoryId;\n\n      while (climbScope) {\n        if (climbScope.$$disconnected) {\n          return false;\n        }\n\n        if (!foundHistoryId && climbScope.hasOwnProperty('$historyId')) {\n          foundHistoryId = true;\n        }\n\n        if (currentHistoryId) {\n          if (climbScope.hasOwnProperty('$historyId') && currentHistoryId == climbScope.$historyId) {\n            return true;\n          }\n          if (climbScope.hasOwnProperty('$activeHistoryId')) {\n            if (currentHistoryId == climbScope.$activeHistoryId) {\n              if (climbScope.hasOwnProperty('$historyId')) {\n                return true;\n              }\n              if (!foundHistoryId) {\n                return true;\n              }\n            }\n          }\n        }\n\n        if (foundHistoryId && climbScope.hasOwnProperty('$activeHistoryId')) {\n          foundHistoryId = false;\n        }\n\n        climbScope = climbScope.$parent;\n      }\n\n      return currentHistoryId ? currentHistoryId == 'root' : true;\n    }\n\n  };\n\n  function isAbstractTag(ele) {\n    return ele && ele.length && /ion-side-menus|ion-tabs/i.test(ele[0].tagName);\n  }\n\n  function canSwipeBack(ele, viewLocals) {\n    if (viewLocals && viewLocals.$$state && viewLocals.$$state.self.canSwipeBack === false) {\n      return false;\n    }\n    if (ele && ele.attr('can-swipe-back') === 'false') {\n      return false;\n    }\n    return true;\n  }\n\n}])\n\n.run([\n  '$rootScope',\n  '$state',\n  '$location',\n  '$document',\n  '$ionicPlatform',\n  '$ionicHistory',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $state, $location, $document, $ionicPlatform, $ionicHistory, IONIC_BACK_PRIORITY) {\n\n  // always reset the keyboard state when change stage\n  $rootScope.$on('$ionicView.beforeEnter', function() {\n    ionic.keyboard && ionic.keyboard.hide && ionic.keyboard.hide();\n  });\n\n  $rootScope.$on('$ionicHistory.change', function(e, data) {\n    if (!data) return null;\n\n    var viewHistory = $ionicHistory.viewHistory();\n\n    var hist = (data.historyId ? viewHistory.histories[ data.historyId ] : null);\n    if (hist && hist.cursor > -1 && hist.cursor < hist.stack.length) {\n      // the history they're going to already exists\n      // go to it's last view in its stack\n      var view = hist.stack[ hist.cursor ];\n      return view.go(data);\n    }\n\n    // this history does not have a URL, but it does have a uiSref\n    // figure out its URL from the uiSref\n    if (!data.url && data.uiSref) {\n      data.url = $state.href(data.uiSref);\n    }\n\n    if (data.url) {\n      // don't let it start with a #, messes with $location.url()\n      if (data.url.indexOf('#') === 0) {\n        data.url = data.url.replace('#', '');\n      }\n      if (data.url !== $location.url()) {\n        // we've got a good URL, ready GO!\n        $location.url(data.url);\n      }\n    }\n  });\n\n  $rootScope.$ionicGoBack = function(backCount) {\n    $ionicHistory.goBack(backCount);\n  };\n\n  // Set the document title when a new view is shown\n  $rootScope.$on('$ionicView.afterEnter', function(ev, data) {\n    if (data && data.title) {\n      $document[0].title = data.title;\n    }\n  });\n\n  // Triggered when devices with a hardware back button (Android) is clicked by the user\n  // This is a Cordova/Phonegap platform specifc method\n  function onHardwareBackButton(e) {\n    var backView = $ionicHistory.backView();\n    if (backView) {\n      // there is a back view, go to it\n      backView.go();\n    } else {\n      // there is no back view, so close the app instead\n      ionic.Platform.exitApp();\n    }\n    e.preventDefault();\n    return false;\n  }\n  $ionicPlatform.registerBackButtonAction(\n    onHardwareBackButton,\n    IONIC_BACK_PRIORITY.view\n  );\n\n}]);\n\n/**\n * @ngdoc provider\n * @name $ionicConfigProvider\n * @module ionic\n * @description\n * Ionic automatically takes platform configurations into account to adjust things like what\n * transition style to use and whether tab icons should show on the top or bottom. For example,\n * iOS will move forward by transitioning the entering view from right to center and the leaving\n * view from center to left. However, Android will transition with the entering view going from\n * bottom to center, covering the previous view, which remains stationary. It should be noted\n * that when a platform is not iOS or Android, then it'll default to iOS. So if you are\n * developing on a desktop browser, it's going to take on iOS default configs.\n *\n * These configs can be changed using the `$ionicConfigProvider` during the configuration phase\n * of your app. Additionally, `$ionicConfig` can also set and get config values during the run\n * phase and within the app itself.\n *\n * By default, all base config variables are set to `'platform'`, which means it'll take on the\n * default config of the platform on which it's running. Config variables can be set at this\n * level so all platforms follow the same setting, rather than its platform config.\n * The following code would set the same config variable for all platforms:\n *\n * ```js\n * $ionicConfigProvider.views.maxCache(10);\n * ```\n *\n * Additionally, each platform can have it's own config within the `$ionicConfigProvider.platform`\n * property. The config below would only apply to Android devices.\n *\n * ```js\n * $ionicConfigProvider.platform.android.views.maxCache(5);\n * ```\n *\n * @usage\n * ```js\n * var myApp = angular.module('reallyCoolApp', ['ionic']);\n *\n * myApp.config(function($ionicConfigProvider) {\n *   $ionicConfigProvider.views.maxCache(5);\n *\n *   // note that you can also chain configs\n *   $ionicConfigProvider.backButton.text('Go Back').icon('ion-chevron-left');\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.transition\n * @description Animation style when transitioning between views. Default `platform`.\n *\n * @param {string} transition Which style of view transitioning to use.\n *\n * * `platform`: Dynamically choose the correct transition style depending on the platform\n * the app is running from. If the platform is not `ios` or `android` then it will default\n * to `ios`.\n * * `ios`: iOS style transition.\n * * `android`: Android style transition.\n * * `none`: Do not perform animated transitions.\n *\n * @returns {string} value\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.maxCache\n * @description  Maximum number of view elements to cache in the DOM. When the max number is\n * exceeded, the view with the longest time period since it was accessed is removed. Views that\n * stay in the DOM cache the view's scope, current state, and scroll position. The scope is\n * disconnected from the `$watch` cycle when it is cached and reconnected when it enters again.\n * When the maximum cache is `0`, the leaving view's element will be removed from the DOM after\n * each view transition, and the next time the same view is shown, it will have to re-compile,\n * attach to the DOM, and link the element again. This disables caching, in effect.\n * @param {number} maxNumber Maximum number of views to retain. Default `10`.\n * @returns {number} How many views Ionic will hold onto until the a view is removed.\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.forwardCache\n * @description  By default, when navigating, views that were recently visited are cached, and\n * the same instance data and DOM elements are referenced when navigating back. However, when\n * navigating back in the history, the \"forward\" views are removed from the cache. If you\n * navigate forward to the same view again, it'll create a new DOM element and controller\n * instance. Basically, any forward views are reset each time. Set this config to `true` to have\n * forward views cached and not reset on each load.\n * @param {boolean} value\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#scrolling.jsScrolling\n * @description  Whether to use JS or Native scrolling. Defaults to JS scrolling. Setting this to\n * `false` has the same effect as setting each `ion-content` to have `overflow-scroll='true'`.\n * @param {boolean} value Defaults to `true`\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.icon\n * @description Back button icon.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.text\n * @description Back button text.\n * @param {string} value Defaults to `Back`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.previousTitleText\n * @description If the previous title text should become the back button text. This\n * is the default for iOS.\n * @param {boolean} value\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#form.checkbox\n * @description Checkbox style. Android defaults to `square` and iOS defaults to `circle`.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#form.toggle\n * @description Toggle item style. Android defaults to `small` and iOS defaults to `large`.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#tabs.style\n * @description Tab style. Android defaults to `striped` and iOS defaults to `standard`.\n * @param {string} value Available values include `striped` and `standard`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#tabs.position\n * @description Tab position. Android defaults to `top` and iOS defaults to `bottom`.\n * @param {string} value Available values include `top` and `bottom`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#templates.maxPrefetch\n * @description Sets the maximum number of templates to prefetch from the templateUrls defined in\n * $stateProvider.state. If set to `0`, the user will have to wait\n * for a template to be fetched the first time when navigating to a new page. Default `30`.\n * @param {integer} value Max number of template to prefetch from the templateUrls defined in\n * `$stateProvider.state()`.\n * @returns {integer}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#navBar.alignTitle\n * @description Which side of the navBar to align the title. Default `center`.\n *\n * @param {string} value side of the navBar to align the title.\n *\n * * `platform`: Dynamically choose the correct title style depending on the platform\n * the app is running from. If the platform is `ios`, it will default to `center`.\n * If the platform is `android`, it will default to `left`. If the platform is not\n * `ios` or `android`, it will default to `center`.\n *\n * * `left`: Left align the title in the navBar\n * * `center`: Center align the title in the navBar\n * * `right`: Right align the title in the navBar.\n *\n * @returns {string} value\n */\n\n/**\n  * @ngdoc method\n  * @name $ionicConfigProvider#navBar.positionPrimaryButtons\n  * @description Which side of the navBar to align the primary navBar buttons. Default `left`.\n  *\n  * @param {string} value side of the navBar to align the primary navBar buttons.\n  *\n  * * `platform`: Dynamically choose the correct title style depending on the platform\n  * the app is running from. If the platform is `ios`, it will default to `left`.\n  * If the platform is `android`, it will default to `right`. If the platform is not\n  * `ios` or `android`, it will default to `left`.\n  *\n  * * `left`: Left align the primary navBar buttons in the navBar\n  * * `right`: Right align the primary navBar buttons in the navBar.\n  *\n  * @returns {string} value\n  */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#navBar.positionSecondaryButtons\n * @description Which side of the navBar to align the secondary navBar buttons. Default `right`.\n *\n * @param {string} value side of the navBar to align the secondary navBar buttons.\n *\n * * `platform`: Dynamically choose the correct title style depending on the platform\n * the app is running from. If the platform is `ios`, it will default to `right`.\n * If the platform is `android`, it will default to `right`. If the platform is not\n * `ios` or `android`, it will default to `right`.\n *\n * * `left`: Left align the secondary navBar buttons in the navBar\n * * `right`: Right align the secondary navBar buttons in the navBar.\n *\n * @returns {string} value\n */\n\nIonicModule\n.provider('$ionicConfig', function() {\n\n  var provider = this;\n  provider.platform = {};\n  var PLATFORM = 'platform';\n\n  var configProperties = {\n    views: {\n      maxCache: PLATFORM,\n      forwardCache: PLATFORM,\n      transition: PLATFORM,\n      swipeBackEnabled: PLATFORM,\n      swipeBackHitWidth: PLATFORM\n    },\n    navBar: {\n      alignTitle: PLATFORM,\n      positionPrimaryButtons: PLATFORM,\n      positionSecondaryButtons: PLATFORM,\n      transition: PLATFORM\n    },\n    backButton: {\n      icon: PLATFORM,\n      text: PLATFORM,\n      previousTitleText: PLATFORM\n    },\n    form: {\n      checkbox: PLATFORM,\n      toggle: PLATFORM\n    },\n    scrolling: {\n      jsScrolling: PLATFORM\n    },\n    tabs: {\n      style: PLATFORM,\n      position: PLATFORM\n    },\n    templates: {\n      maxPrefetch: PLATFORM\n    },\n    platform: {}\n  };\n  createConfig(configProperties, provider, '');\n\n\n\n  // Default\n  // -------------------------\n  setPlatformConfig('default', {\n\n    views: {\n      maxCache: 10,\n      forwardCache: false,\n      transition: 'ios',\n      swipeBackEnabled: true,\n      swipeBackHitWidth: 45\n    },\n\n    navBar: {\n      alignTitle: 'center',\n      positionPrimaryButtons: 'left',\n      positionSecondaryButtons: 'right',\n      transition: 'view'\n    },\n\n    backButton: {\n      icon: 'ion-ios-arrow-back',\n      text: 'Back',\n      previousTitleText: true\n    },\n\n    form: {\n      checkbox: 'circle',\n      toggle: 'large'\n    },\n\n    scrolling: {\n      jsScrolling: true\n    },\n\n    tabs: {\n      style: 'standard',\n      position: 'bottom'\n    },\n\n    templates: {\n      maxPrefetch: 30\n    }\n\n  });\n\n\n\n  // iOS (it is the default already)\n  // -------------------------\n  setPlatformConfig('ios', {});\n\n\n\n  // Android\n  // -------------------------\n  setPlatformConfig('android', {\n\n    views: {\n      transition: 'android',\n      swipeBackEnabled: false\n    },\n\n    navBar: {\n      alignTitle: 'left',\n      positionPrimaryButtons: 'right',\n      positionSecondaryButtons: 'right'\n    },\n\n    backButton: {\n      icon: 'ion-android-arrow-back',\n      text: false,\n      previousTitleText: false\n    },\n\n    form: {\n      checkbox: 'square',\n      toggle: 'small'\n    },\n\n    tabs: {\n      style: 'striped',\n      position: 'top'\n    }\n\n  });\n\n  // Windows Phone\n  // -------------------------\n  setPlatformConfig('windowsphone', {\n    //scrolling: {\n    //  jsScrolling: false\n    //}\n  });\n\n\n  provider.transitions = {\n    views: {},\n    navBar: {}\n  };\n\n\n  // iOS Transitions\n  // -----------------------\n  provider.transitions.views.ios = function(enteringEle, leavingEle, direction, shouldAnimate) {\n\n    function setStyles(ele, opacity, x, boxShadowOpacity) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : 0;\n      css.opacity = opacity;\n      if (boxShadowOpacity > -1) {\n        css.boxShadow = '0 0 10px rgba(0,0,0,' + (d.shouldAnimate ? boxShadowOpacity * 0.45 : 0.3) + ')';\n      }\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + x + '%,0,0)';\n      ionic.DomUtil.cachedStyles(ele, css);\n    }\n\n    var d = {\n      run: function(step) {\n        if (direction == 'forward') {\n          setStyles(enteringEle, 1, (1 - step) * 99, 1 - step); // starting at 98% prevents a flicker\n          setStyles(leavingEle, (1 - 0.1 * step), step * -33, -1);\n\n        } else if (direction == 'back') {\n          setStyles(enteringEle, (1 - 0.1 * (1 - step)), (1 - step) * -33, -1);\n          setStyles(leavingEle, 1, step * 100, 1 - step);\n\n        } else {\n          // swap, enter, exit\n          setStyles(enteringEle, 1, 0, -1);\n          setStyles(leavingEle, 0, 0, -1);\n        }\n      },\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n\n    return d;\n  };\n\n  provider.transitions.navBar.ios = function(enteringHeaderBar, leavingHeaderBar, direction, shouldAnimate) {\n\n    function setStyles(ctrl, opacity, titleX, backTextX) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : '0ms';\n      css.opacity = opacity === 1 ? '' : opacity;\n\n      ctrl.setCss('buttons-left', css);\n      ctrl.setCss('buttons-right', css);\n      ctrl.setCss('back-button', css);\n\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + backTextX + 'px,0,0)';\n      ctrl.setCss('back-text', css);\n\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + titleX + 'px,0,0)';\n      ctrl.setCss('title', css);\n    }\n\n    function enter(ctrlA, ctrlB, step) {\n      if (!ctrlA || !ctrlB) return;\n      var titleX = (ctrlA.titleTextX() + ctrlA.titleWidth()) * (1 - step);\n      var backTextX = (ctrlB && (ctrlB.titleTextX() - ctrlA.backButtonTextLeft()) * (1 - step)) || 0;\n      setStyles(ctrlA, step, titleX, backTextX);\n    }\n\n    function leave(ctrlA, ctrlB, step) {\n      if (!ctrlA || !ctrlB) return;\n      var titleX = (-(ctrlA.titleTextX() - ctrlB.backButtonTextLeft()) - (ctrlA.titleLeftRight())) * step;\n      setStyles(ctrlA, 1 - step, titleX, 0);\n    }\n\n    var d = {\n      run: function(step) {\n        var enteringHeaderCtrl = enteringHeaderBar.controller();\n        var leavingHeaderCtrl = leavingHeaderBar && leavingHeaderBar.controller();\n        if (d.direction == 'back') {\n          leave(enteringHeaderCtrl, leavingHeaderCtrl, 1 - step);\n          enter(leavingHeaderCtrl, enteringHeaderCtrl, 1 - step);\n        } else {\n          enter(enteringHeaderCtrl, leavingHeaderCtrl, step);\n          leave(leavingHeaderCtrl, enteringHeaderCtrl, step);\n        }\n      },\n      direction: direction,\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n\n    return d;\n  };\n\n\n  // Android Transitions\n  // -----------------------\n\n  provider.transitions.views.android = function(enteringEle, leavingEle, direction, shouldAnimate) {\n    shouldAnimate = shouldAnimate && (direction == 'forward' || direction == 'back');\n\n    function setStyles(ele, x) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : 0;\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + x + '%,0,0)';\n      ionic.DomUtil.cachedStyles(ele, css);\n    }\n\n    var d = {\n      run: function(step) {\n        if (direction == 'forward') {\n          setStyles(enteringEle, (1 - step) * 99); // starting at 98% prevents a flicker\n          setStyles(leavingEle, step * -100);\n\n        } else if (direction == 'back') {\n          setStyles(enteringEle, (1 - step) * -100);\n          setStyles(leavingEle, step * 100);\n\n        } else {\n          // swap, enter, exit\n          setStyles(enteringEle, 0);\n          setStyles(leavingEle, 0);\n        }\n      },\n      shouldAnimate: shouldAnimate\n    };\n\n    return d;\n  };\n\n  provider.transitions.navBar.android = function(enteringHeaderBar, leavingHeaderBar, direction, shouldAnimate) {\n\n    function setStyles(ctrl, opacity) {\n      if (!ctrl) return;\n      var css = {};\n      css.opacity = opacity === 1 ? '' : opacity;\n\n      ctrl.setCss('buttons-left', css);\n      ctrl.setCss('buttons-right', css);\n      ctrl.setCss('back-button', css);\n      ctrl.setCss('back-text', css);\n      ctrl.setCss('title', css);\n    }\n\n    return {\n      run: function(step) {\n        setStyles(enteringHeaderBar.controller(), step);\n        setStyles(leavingHeaderBar && leavingHeaderBar.controller(), 1 - step);\n      },\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n  };\n\n\n  // No Transition\n  // -----------------------\n\n  provider.transitions.views.none = function(enteringEle, leavingEle) {\n    return {\n      run: function(step) {\n        provider.transitions.views.android(enteringEle, leavingEle, false, false).run(step);\n      },\n      shouldAnimate: false\n    };\n  };\n\n  provider.transitions.navBar.none = function(enteringHeaderBar, leavingHeaderBar) {\n    return {\n      run: function(step) {\n        provider.transitions.navBar.ios(enteringHeaderBar, leavingHeaderBar, false, false).run(step);\n        provider.transitions.navBar.android(enteringHeaderBar, leavingHeaderBar, false, false).run(step);\n      },\n      shouldAnimate: false\n    };\n  };\n\n\n  // private: used to set platform configs\n  function setPlatformConfig(platformName, platformConfigs) {\n    configProperties.platform[platformName] = platformConfigs;\n    provider.platform[platformName] = {};\n\n    addConfig(configProperties, configProperties.platform[platformName]);\n\n    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');\n  }\n\n\n  // private: used to recursively add new platform configs\n  function addConfig(configObj, platformObj) {\n    for (var n in configObj) {\n      if (n != PLATFORM && configObj.hasOwnProperty(n)) {\n        if (angular.isObject(configObj[n])) {\n          if (!isDefined(platformObj[n])) {\n            platformObj[n] = {};\n          }\n          addConfig(configObj[n], platformObj[n]);\n\n        } else if (!isDefined(platformObj[n])) {\n          platformObj[n] = null;\n        }\n      }\n    }\n  }\n\n\n  // private: create methods for each config to get/set\n  function createConfig(configObj, providerObj, platformPath) {\n    forEach(configObj, function(value, namespace) {\n\n      if (angular.isObject(configObj[namespace])) {\n        // recursively drill down the config object so we can create a method for each one\n        providerObj[namespace] = {};\n        createConfig(configObj[namespace], providerObj[namespace], platformPath + '.' + namespace);\n\n      } else {\n        // create a method for the provider/config methods that will be exposed\n        providerObj[namespace] = function(newValue) {\n          if (arguments.length) {\n            configObj[namespace] = newValue;\n            return providerObj;\n          }\n          if (configObj[namespace] == PLATFORM) {\n            // if the config is set to 'platform', then get this config's platform value\n            var platformConfig = stringObj(configProperties.platform, ionic.Platform.platform() + platformPath + '.' + namespace);\n            if (platformConfig || platformConfig === false) {\n              return platformConfig;\n            }\n            // didnt find a specific platform config, now try the default\n            return stringObj(configProperties.platform, 'default' + platformPath + '.' + namespace);\n          }\n          return configObj[namespace];\n        };\n      }\n\n    });\n  }\n\n  function stringObj(obj, str) {\n    str = str.split(\".\");\n    for (var i = 0; i < str.length; i++) {\n      if (obj && isDefined(obj[str[i]])) {\n        obj = obj[str[i]];\n      } else {\n        return null;\n      }\n    }\n    return obj;\n  }\n\n  provider.setPlatformConfig = setPlatformConfig;\n\n\n  // private: Service definition for internal Ionic use\n  /**\n   * @ngdoc service\n   * @name $ionicConfig\n   * @module ionic\n   * @private\n   */\n  provider.$get = function() {\n    return provider;\n  };\n})\n// Fix for URLs in Cordova apps on Windows Phone\n// http://blogs.msdn.com/b/msdn_answers/archive/2015/02/10/\n// running-cordova-apps-on-windows-and-windows-phone-8-1-using-ionic-angularjs-and-other-frameworks.aspx\n.config(['$compileProvider', function($compileProvider) {\n  $compileProvider.aHrefSanitizationWhitelist(/^\\s*(https?|tel|ftp|mailto|file|ghttps?|ms-appx|x-wmapp0):/);\n  $compileProvider.imgSrcSanitizationWhitelist(/^\\s*(https?|tel|ftp|file|blob|ms-appx|x-wmapp0):|data:image\\//);\n}]);\n\n\nvar LOADING_TPL =\n  '<div class=\"loading-container\">' +\n    '<div class=\"loading\">' +\n    '</div>' +\n  '</div>';\n\nvar LOADING_HIDE_DEPRECATED = '$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().';\nvar LOADING_SHOW_DEPRECATED = '$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().';\nvar LOADING_SET_DEPRECATED = '$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: \\'my content\\' }).';\n\n/**\n * @ngdoc service\n * @name $ionicLoading\n * @module ionic\n * @description\n * An overlay that can be used to indicate activity while blocking user\n * interaction.\n *\n * @usage\n * ```js\n * angular.module('LoadingApp', ['ionic'])\n * .controller('LoadingCtrl', function($scope, $ionicLoading) {\n *   $scope.show = function() {\n *     $ionicLoading.show({\n *       template: 'Loading...'\n *     });\n *   };\n *   $scope.hide = function(){\n *     $ionicLoading.hide();\n *   };\n * });\n * ```\n */\n/**\n * @ngdoc object\n * @name $ionicLoadingConfig\n * @module ionic\n * @description\n * Set the default options to be passed to the {@link ionic.service:$ionicLoading} service.\n *\n * @usage\n * ```js\n * var app = angular.module('myApp', ['ionic'])\n * app.constant('$ionicLoadingConfig', {\n *   template: 'Default Loading Template...'\n * });\n * app.controller('AppCtrl', function($scope, $ionicLoading) {\n *   $scope.showLoading = function() {\n *     $ionicLoading.show(); //options default to values in $ionicLoadingConfig\n *   };\n * });\n * ```\n */\nIonicModule\n.constant('$ionicLoadingConfig', {\n  template: '<ion-spinner></ion-spinner>'\n})\n.factory('$ionicLoading', [\n  '$ionicLoadingConfig',\n  '$ionicBody',\n  '$ionicTemplateLoader',\n  '$ionicBackdrop',\n  '$timeout',\n  '$q',\n  '$log',\n  '$compile',\n  '$ionicPlatform',\n  '$rootScope',\n  'IONIC_BACK_PRIORITY',\nfunction($ionicLoadingConfig, $ionicBody, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $compile, $ionicPlatform, $rootScope, IONIC_BACK_PRIORITY) {\n\n  var loaderInstance;\n  //default values\n  var deregisterBackAction = noop;\n  var deregisterStateListener1 = noop;\n  var deregisterStateListener2 = noop;\n  var loadingShowDelay = $q.when();\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicLoading#show\n     * @description Shows a loading indicator. If the indicator is already shown,\n     * it will set the options given and keep the indicator shown.\n     * @param {object} opts The options for the loading indicator. Available properties:\n     *  - `{string=}` `template` The html content of the indicator.\n     *  - `{string=}` `templateUrl` The url of an html template to load as the content of the indicator.\n     *  - `{object=}` `scope` The scope to be a child of. Default: creates a child of $rootScope.\n     *  - `{boolean=}` `noBackdrop` Whether to hide the backdrop. By default it will be shown.\n     *  - `{boolean=}` `hideOnStateChange` Whether to hide the loading spinner when navigating\n     *    to a new state. Default false.\n     *  - `{number=}` `delay` How many milliseconds to delay showing the indicator. By default there is no delay.\n     *  - `{number=}` `duration` How many milliseconds to wait until automatically\n     *  hiding the indicator. By default, the indicator will be shown until `.hide()` is called.\n     */\n    show: showLoader,\n    /**\n     * @ngdoc method\n     * @name $ionicLoading#hide\n     * @description Hides the loading indicator, if shown.\n     */\n    hide: hideLoader,\n    /**\n     * @private for testing\n     */\n    _getLoader: getLoader\n  };\n\n  function getLoader() {\n    if (!loaderInstance) {\n      loaderInstance = $ionicTemplateLoader.compile({\n        template: LOADING_TPL,\n        appendTo: $ionicBody.get()\n      })\n      .then(function(self) {\n        self.show = function(options) {\n          var templatePromise = options.templateUrl ?\n            $ionicTemplateLoader.load(options.templateUrl) :\n            //options.content: deprecated\n            $q.when(options.template || options.content || '');\n\n          self.scope = options.scope || self.scope;\n\n          if (!self.isShown) {\n            //options.showBackdrop: deprecated\n            self.hasBackdrop = !options.noBackdrop && options.showBackdrop !== false;\n            if (self.hasBackdrop) {\n              $ionicBackdrop.retain();\n              $ionicBackdrop.getElement().addClass('backdrop-loading');\n            }\n          }\n\n          if (options.duration) {\n            $timeout.cancel(self.durationTimeout);\n            self.durationTimeout = $timeout(\n              angular.bind(self, self.hide),\n              +options.duration\n            );\n          }\n\n          deregisterBackAction();\n          //Disable hardware back button while loading\n          deregisterBackAction = $ionicPlatform.registerBackButtonAction(\n            noop,\n            IONIC_BACK_PRIORITY.loading\n          );\n\n          templatePromise.then(function(html) {\n            if (html) {\n              var loading = self.element.children();\n              loading.html(html);\n              $compile(loading.contents())(self.scope);\n            }\n\n            //Don't show until template changes\n            if (self.isShown) {\n              self.element.addClass('visible');\n              ionic.requestAnimationFrame(function() {\n                if (self.isShown) {\n                  self.element.addClass('active');\n                  $ionicBody.addClass('loading-active');\n                }\n              });\n            }\n          });\n\n          self.isShown = true;\n        };\n        self.hide = function() {\n\n          deregisterBackAction();\n          if (self.isShown) {\n            if (self.hasBackdrop) {\n              $ionicBackdrop.release();\n              $ionicBackdrop.getElement().removeClass('backdrop-loading');\n            }\n            self.element.removeClass('active');\n            $ionicBody.removeClass('loading-active');\n            setTimeout(function() {\n              !self.isShown && self.element.removeClass('visible');\n            }, 200);\n          }\n          $timeout.cancel(self.durationTimeout);\n          self.isShown = false;\n        };\n\n        return self;\n      });\n    }\n    return loaderInstance;\n  }\n\n  function showLoader(options) {\n    options = extend({}, $ionicLoadingConfig || {}, options || {});\n    var delay = options.delay || options.showDelay || 0;\n\n    deregisterStateListener1();\n    deregisterStateListener2();\n    if (options.hideOnStateChange) {\n      deregisterStateListener1 = $rootScope.$on('$stateChangeSuccess', hideLoader);\n      deregisterStateListener2 = $rootScope.$on('$stateChangeError', hideLoader);\n    }\n\n    //If loading.show() was called previously, cancel it and show with our new options\n    $timeout.cancel(loadingShowDelay);\n    loadingShowDelay = $timeout(noop, delay);\n    loadingShowDelay.then(getLoader).then(function(loader) {\n      return loader.show(options);\n    });\n\n    return {\n      hide: function deprecatedHide() {\n        $log.error(LOADING_HIDE_DEPRECATED);\n        return hideLoader.apply(this, arguments);\n      },\n      show: function deprecatedShow() {\n        $log.error(LOADING_SHOW_DEPRECATED);\n        return showLoader.apply(this, arguments);\n      },\n      setContent: function deprecatedSetContent(content) {\n        $log.error(LOADING_SET_DEPRECATED);\n        return getLoader().then(function(loader) {\n          loader.show({ template: content });\n        });\n      }\n    };\n  }\n\n  function hideLoader() {\n    deregisterStateListener1();\n    deregisterStateListener2();\n    $timeout.cancel(loadingShowDelay);\n    getLoader().then(function(loader) {\n      loader.hide();\n    });\n  }\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicModal\n * @module ionic\n * @description\n *\n * Related: {@link ionic.controller:ionicModal ionicModal controller}.\n *\n * The Modal is a content pane that can go over the user's main view\n * temporarily.  Usually used for making a choice or editing an item.\n *\n * Put the content of the modal inside of an `<ion-modal-view>` element.\n *\n * **Notes:**\n * - A modal will broadcast 'modal.shown', 'modal.hidden', and 'modal.removed' events from its originating\n * scope, passing in itself as an event argument. Both the modal.removed and modal.hidden events are\n * called when the modal is removed.\n *\n * - This example assumes your modal is in your main index file or another template file. If it is in its own\n * template file, remove the script tags and call it by file name.\n *\n * @usage\n * ```html\n * <script id=\"my-modal.html\" type=\"text/ng-template\">\n *   <ion-modal-view>\n *     <ion-header-bar>\n *       <h1 class=\"title\">My Modal title</h1>\n *     </ion-header-bar>\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-modal-view>\n * </script>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $ionicModal) {\n *   $ionicModal.fromTemplateUrl('my-modal.html', {\n *     scope: $scope,\n *     animation: 'slide-in-up'\n *   }).then(function(modal) {\n *     $scope.modal = modal;\n *   });\n *   $scope.openModal = function() {\n *     $scope.modal.show();\n *   };\n *   $scope.closeModal = function() {\n *     $scope.modal.hide();\n *   };\n *   //Cleanup the modal when we're done with it!\n *   $scope.$on('$destroy', function() {\n *     $scope.modal.remove();\n *   });\n *   // Execute action on hide modal\n *   $scope.$on('modal.hidden', function() {\n *     // Execute action\n *   });\n *   // Execute action on remove modal\n *   $scope.$on('modal.removed', function() {\n *     // Execute action\n *   });\n * });\n * ```\n */\nIonicModule\n.factory('$ionicModal', [\n  '$rootScope',\n  '$ionicBody',\n  '$compile',\n  '$timeout',\n  '$ionicPlatform',\n  '$ionicTemplateLoader',\n  '$$q',\n  '$log',\n  '$ionicClickBlock',\n  '$window',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $ionicBody, $compile, $timeout, $ionicPlatform, $ionicTemplateLoader, $$q, $log, $ionicClickBlock, $window, IONIC_BACK_PRIORITY) {\n\n  /**\n   * @ngdoc controller\n   * @name ionicModal\n   * @module ionic\n   * @description\n   * Instantiated by the {@link ionic.service:$ionicModal} service.\n   *\n   * Be sure to call [remove()](#remove) when you are done with each modal\n   * to clean it up and avoid memory leaks.\n   *\n   * Note: a modal will broadcast 'modal.shown', 'modal.hidden', and 'modal.removed' events from its originating\n   * scope, passing in itself as an event argument. Note: both modal.removed and modal.hidden are\n   * called when the modal is removed.\n   */\n  var ModalView = ionic.views.Modal.inherit({\n    /**\n     * @ngdoc method\n     * @name ionicModal#initialize\n     * @description Creates a new modal controller instance.\n     * @param {object} options An options object with the following properties:\n     *  - `{object=}` `scope` The scope to be a child of.\n     *    Default: creates a child of $rootScope.\n     *  - `{string=}` `animation` The animation to show & hide with.\n     *    Default: 'slide-in-up'\n     *  - `{boolean=}` `focusFirstInput` Whether to autofocus the first input of\n     *    the modal when shown. Will only show the keyboard on iOS, to force the keyboard to show\n     *    on Android, please use the [Ionic keyboard plugin](https://github.com/driftyco/ionic-plugin-keyboard#keyboardshow).\n     *    Default: false.\n     *  - `{boolean=}` `backdropClickToClose` Whether to close the modal on clicking the backdrop.\n     *    Default: true.\n     *  - `{boolean=}` `hardwareBackButtonClose` Whether the modal can be closed using the hardware\n     *    back button on Android and similar devices.  Default: true.\n     */\n    initialize: function(opts) {\n      ionic.views.Modal.prototype.initialize.call(this, opts);\n      this.animation = opts.animation || 'slide-in-up';\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#show\n     * @description Show this modal instance.\n     * @returns {promise} A promise which is resolved when the modal is finished animating in.\n     */\n    show: function(target) {\n      var self = this;\n\n      if (self.scope.$$destroyed) {\n        $log.error('Cannot call ' + self.viewType + '.show() after remove(). Please create a new ' + self.viewType + ' instance.');\n        return $$q.when();\n      }\n\n      // on iOS, clicks will sometimes bleed through/ghost click on underlying\n      // elements\n      $ionicClickBlock.show(600);\n\n      var modalEl = jqLite(self.modalEl);\n\n      self.el.classList.remove('hide');\n      $timeout(function() {\n        if (!self._isShown) return;\n        $ionicBody.addClass(self.viewType + '-open');\n      }, 400, false);\n\n      if (!self.el.parentElement) {\n        modalEl.addClass(self.animation);\n        $ionicBody.append(self.el);\n      }\n\n      // if modal was closed while the keyboard was up, reset scroll view on\n      // next show since we can only resize it once it's visible\n      var scrollCtrl = modalEl.data('$$ionicScrollController');\n      scrollCtrl && scrollCtrl.resize();\n\n      if (target && self.positionView) {\n        self.positionView(target, modalEl);\n        // set up a listener for in case the window size changes\n\n        self._onWindowResize = function() {\n          if (self._isShown) self.positionView(target, modalEl);\n        };\n        ionic.on('resize', self._onWindowResize, window);\n      }\n\n      modalEl.addClass('ng-enter active')\n             .removeClass('ng-leave ng-leave-active');\n\n      self._isShown = true;\n      self._deregisterBackButton = $ionicPlatform.registerBackButtonAction(\n        self.hardwareBackButtonClose ? angular.bind(self, self.hide) : noop,\n        IONIC_BACK_PRIORITY.modal\n      );\n\n      ionic.views.Modal.prototype.show.call(self);\n\n      $timeout(function() {\n        if (!self._isShown) return;\n        modalEl.addClass('ng-enter-active');\n        ionic.trigger('resize');\n        self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.shown', self);\n        self.el.classList.add('active');\n        self.scope.$broadcast('$ionicHeader.align');\n      }, 20);\n\n      return $timeout(function() {\n        if (!self._isShown) return;\n        //After animating in, allow hide on backdrop click\n        self.$el.on('click', function(e) {\n          if (self.backdropClickToClose && e.target === self.el) {\n            self.hide();\n          }\n        });\n      }, 400);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#hide\n     * @description Hide this modal instance.\n     * @returns {promise} A promise which is resolved when the modal is finished animating out.\n     */\n    hide: function() {\n      var self = this;\n      var modalEl = jqLite(self.modalEl);\n\n      // on iOS, clicks will sometimes bleed through/ghost click on underlying\n      // elements\n      $ionicClickBlock.show(600);\n\n      self.el.classList.remove('active');\n      modalEl.addClass('ng-leave');\n\n      $timeout(function() {\n        if (self._isShown) return;\n        modalEl.addClass('ng-leave-active')\n               .removeClass('ng-enter ng-enter-active active');\n      }, 20, false);\n\n      self.$el.off('click');\n      self._isShown = false;\n      self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.hidden', self);\n      self._deregisterBackButton && self._deregisterBackButton();\n\n      ionic.views.Modal.prototype.hide.call(self);\n\n      // clean up event listeners\n      if (self.positionView) {\n        ionic.off('resize', self._onWindowResize, window);\n      }\n\n      return $timeout(function() {\n        $ionicBody.removeClass(self.viewType + '-open');\n        self.el.classList.add('hide');\n      }, self.hideDelay || 320);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#remove\n     * @description Remove this modal instance from the DOM and clean up.\n     * @returns {promise} A promise which is resolved when the modal is finished animating out.\n     */\n    remove: function() {\n      var self = this;\n      self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.removed', self);\n\n      return self.hide().then(function() {\n        self.scope.$destroy();\n        self.$el.remove();\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#isShown\n     * @returns boolean Whether this modal is currently shown.\n     */\n    isShown: function() {\n      return !!this._isShown;\n    }\n  });\n\n  var createModal = function(templateString, options) {\n    // Create a new scope for the modal\n    var scope = options.scope && options.scope.$new() || $rootScope.$new(true);\n\n    options.viewType = options.viewType || 'modal';\n\n    extend(scope, {\n      $hasHeader: false,\n      $hasSubheader: false,\n      $hasFooter: false,\n      $hasSubfooter: false,\n      $hasTabs: false,\n      $hasTabsTop: false\n    });\n\n    // Compile the template\n    var element = $compile('<ion-' + options.viewType + '>' + templateString + '</ion-' + options.viewType + '>')(scope);\n\n    options.$el = element;\n    options.el = element[0];\n    options.modalEl = options.el.querySelector('.' + options.viewType);\n    var modal = new ModalView(options);\n\n    modal.scope = scope;\n\n    // If this wasn't a defined scope, we can assign the viewType to the isolated scope\n    // we created\n    if (!options.scope) {\n      scope[ options.viewType ] = modal;\n    }\n\n    return modal;\n  };\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicModal#fromTemplate\n     * @param {string} templateString The template string to use as the modal's\n     * content.\n     * @param {object} options Options to be passed {@link ionic.controller:ionicModal#initialize ionicModal#initialize} method.\n     * @returns {object} An instance of an {@link ionic.controller:ionicModal}\n     * controller.\n     */\n    fromTemplate: function(templateString, options) {\n      var modal = createModal(templateString, options || {});\n      return modal;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicModal#fromTemplateUrl\n     * @param {string} templateUrl The url to load the template from.\n     * @param {object} options Options to be passed {@link ionic.controller:ionicModal#initialize ionicModal#initialize} method.\n     * options object.\n     * @returns {promise} A promise that will be resolved with an instance of\n     * an {@link ionic.controller:ionicModal} controller.\n     */\n    fromTemplateUrl: function(url, options, _) {\n      var cb;\n      //Deprecated: allow a callback as second parameter. Now we return a promise.\n      if (angular.isFunction(options)) {\n        cb = options;\n        options = _;\n      }\n      return $ionicTemplateLoader.load(url).then(function(templateString) {\n        var modal = createModal(templateString, options || {});\n        cb && cb(modal);\n        return modal;\n      });\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc service\n * @name $ionicNavBarDelegate\n * @module ionic\n * @description\n * Delegate for controlling the {@link ionic.directive:ionNavBar} directive.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MyCtrl\">\n *   <ion-nav-bar>\n *     <button ng-click=\"setNavTitle('banana')\">\n *       Set title to banana!\n *     </button>\n *   </ion-nav-bar>\n * </body>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicNavBarDelegate) {\n *   $scope.setNavTitle = function(title) {\n *     $ionicNavBarDelegate.title(title);\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicNavBarDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#align\n   * @description Aligns the title with the buttons in a given direction.\n   * @param {string=} direction The direction to the align the title text towards.\n   * Available: 'left', 'right', 'center'. Default: 'center'.\n   */\n  'align',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#showBackButton\n   * @description\n   * Set/get whether the {@link ionic.directive:ionNavBackButton} is shown\n   * (if it exists and there is a previous view that can be navigated to).\n   * @param {boolean=} show Whether to show the back button.\n   * @returns {boolean} Whether the back button is shown.\n   */\n  'showBackButton',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#showBar\n   * @description\n   * Set/get whether the {@link ionic.directive:ionNavBar} is shown.\n   * @param {boolean} show Whether to show the bar.\n   * @returns {boolean} Whether the bar is shown.\n   */\n  'showBar',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#title\n   * @description\n   * Set the title for the {@link ionic.directive:ionNavBar}.\n   * @param {string} title The new title to show.\n   */\n  'title',\n\n  // DEPRECATED, as of v1.0.0-beta14 -------\n  'changeTitle',\n  'setTitle',\n  'getTitle',\n  'back',\n  'getPreviousTitle'\n  // END DEPRECATED -------\n]));\n\n\nIonicModule\n.service('$ionicNavViewDelegate', ionic.DelegateService([\n  'clearCache'\n]));\n\n\n\n/**\n * @ngdoc service\n * @name $ionicPlatform\n * @module ionic\n * @description\n * An angular abstraction of {@link ionic.utility:ionic.Platform}.\n *\n * Used to detect the current platform, as well as do things like override the\n * Android back button in PhoneGap/Cordova.\n */\nIonicModule\n.constant('IONIC_BACK_PRIORITY', {\n  view: 100,\n  sideMenu: 150,\n  modal: 200,\n  actionSheet: 300,\n  popup: 400,\n  loading: 500\n})\n.provider('$ionicPlatform', function() {\n  return {\n    $get: ['$q', function($q) {\n      var self = {\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#onHardwareBackButton\n         * @description\n         * Some platforms have a hardware back button, so this is one way to\n         * bind to it.\n         * @param {function} callback the callback to trigger when this event occurs\n         */\n        onHardwareBackButton: function(cb) {\n          ionic.Platform.ready(function() {\n            document.addEventListener('backbutton', cb, false);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#offHardwareBackButton\n         * @description\n         * Remove an event listener for the backbutton.\n         * @param {function} callback The listener function that was\n         * originally bound.\n         */\n        offHardwareBackButton: function(fn) {\n          ionic.Platform.ready(function() {\n            document.removeEventListener('backbutton', fn);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#registerBackButtonAction\n         * @description\n         * Register a hardware back button action. Only one action will execute\n         * when the back button is clicked, so this method decides which of\n         * the registered back button actions has the highest priority.\n         *\n         * For example, if an actionsheet is showing, the back button should\n         * close the actionsheet, but it should not also go back a page view\n         * or close a modal which may be open.\n         *\n         * The priorities for the existing back button hooks are as follows:\n         *   Return to previous view = 100\n         *   Close side menu = 150\n         *   Dismiss modal = 200\n         *   Close action sheet = 300\n         *   Dismiss popup = 400\n         *   Dismiss loading overlay = 500\n         *\n         * Your back button action will override each of the above actions\n         * whose priority is less than the priority you provide. For example,\n         * an action assigned a priority of 101 will override the 'return to\n         * previous view' action, but not any of the other actions.\n         *\n         * @param {function} callback Called when the back button is pressed,\n         * if this listener is the highest priority.\n         * @param {number} priority Only the highest priority will execute.\n         * @param {*=} actionId The id to assign this action. Default: a\n         * random unique id.\n         * @returns {function} A function that, when called, will deregister\n         * this backButtonAction.\n         */\n        $backButtonActions: {},\n        registerBackButtonAction: function(fn, priority, actionId) {\n\n          if (!self._hasBackButtonHandler) {\n            // add a back button listener if one hasn't been setup yet\n            self.$backButtonActions = {};\n            self.onHardwareBackButton(self.hardwareBackButtonClick);\n            self._hasBackButtonHandler = true;\n          }\n\n          var action = {\n            id: (actionId ? actionId : ionic.Utils.nextUid()),\n            priority: (priority ? priority : 0),\n            fn: fn\n          };\n          self.$backButtonActions[action.id] = action;\n\n          // return a function to de-register this back button action\n          return function() {\n            delete self.$backButtonActions[action.id];\n          };\n        },\n\n        /**\n         * @private\n         */\n        hardwareBackButtonClick: function(e) {\n          // loop through all the registered back button actions\n          // and only run the last one of the highest priority\n          var priorityAction, actionId;\n          for (actionId in self.$backButtonActions) {\n            if (!priorityAction || self.$backButtonActions[actionId].priority >= priorityAction.priority) {\n              priorityAction = self.$backButtonActions[actionId];\n            }\n          }\n          if (priorityAction) {\n            priorityAction.fn(e);\n            return priorityAction;\n          }\n        },\n\n        is: function(type) {\n          return ionic.Platform.is(type);\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#on\n         * @description\n         * Add Cordova event listeners, such as `pause`, `resume`, `volumedownbutton`, `batterylow`,\n         * `offline`, etc. More information about available event types can be found in\n         * [Cordova's event documentation](https://cordova.apache.org/docs/en/edge/cordova_events_events.md.html#Events).\n         * @param {string} type Cordova [event type](https://cordova.apache.org/docs/en/edge/cordova_events_events.md.html#Events).\n         * @param {function} callback Called when the Cordova event is fired.\n         * @returns {function} Returns a deregistration function to remove the event listener.\n         */\n        on: function(type, cb) {\n          ionic.Platform.ready(function() {\n            document.addEventListener(type, cb, false);\n          });\n          return function() {\n            ionic.Platform.ready(function() {\n              document.removeEventListener(type, cb);\n            });\n          };\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#ready\n         * @description\n         * Trigger a callback once the device is ready,\n         * or immediately if the device is already ready.\n         * @param {function=} callback The function to call.\n         * @returns {promise} A promise which is resolved when the device is ready.\n         */\n        ready: function(cb) {\n          var q = $q.defer();\n\n          ionic.Platform.ready(function() {\n            q.resolve();\n            cb && cb();\n          });\n\n          return q.promise;\n        }\n      };\n      return self;\n    }]\n  };\n\n});\n\n/**\n * @ngdoc service\n * @name $ionicPopover\n * @module ionic\n * @description\n *\n * Related: {@link ionic.controller:ionicPopover ionicPopover controller}.\n *\n * The Popover is a view that floats above an app’s content. Popovers provide an\n * easy way to present or gather information from the user and are\n * commonly used in the following situations:\n *\n * - Show more info about the current view\n * - Select a commonly used tool or configuration\n * - Present a list of actions to perform inside one of your views\n *\n * Put the content of the popover inside of an `<ion-popover-view>` element.\n *\n * @usage\n * ```html\n * <p>\n *   <button ng-click=\"openPopover($event)\">Open Popover</button>\n * </p>\n *\n * <script id=\"my-popover.html\" type=\"text/ng-template\">\n *   <ion-popover-view>\n *     <ion-header-bar>\n *       <h1 class=\"title\">My Popover Title</h1>\n *     </ion-header-bar>\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-popover-view>\n * </script>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $ionicPopover) {\n *\n *   // .fromTemplate() method\n *   var template = '<ion-popover-view><ion-header-bar> <h1 class=\"title\">My Popover Title</h1> </ion-header-bar> <ion-content> Hello! </ion-content></ion-popover-view>';\n *\n *   $scope.popover = $ionicPopover.fromTemplate(template, {\n *     scope: $scope\n *   });\n *\n *   // .fromTemplateUrl() method\n *   $ionicPopover.fromTemplateUrl('my-popover.html', {\n *     scope: $scope\n *   }).then(function(popover) {\n *     $scope.popover = popover;\n *   });\n *\n *\n *   $scope.openPopover = function($event) {\n *     $scope.popover.show($event);\n *   };\n *   $scope.closePopover = function() {\n *     $scope.popover.hide();\n *   };\n *   //Cleanup the popover when we're done with it!\n *   $scope.$on('$destroy', function() {\n *     $scope.popover.remove();\n *   });\n *   // Execute action on hide popover\n *   $scope.$on('popover.hidden', function() {\n *     // Execute action\n *   });\n *   // Execute action on remove popover\n *   $scope.$on('popover.removed', function() {\n *     // Execute action\n *   });\n * });\n * ```\n */\n\n\nIonicModule\n.factory('$ionicPopover', ['$ionicModal', '$ionicPosition', '$document', '$window',\nfunction($ionicModal, $ionicPosition, $document, $window) {\n\n  var POPOVER_BODY_PADDING = 6;\n\n  var POPOVER_OPTIONS = {\n    viewType: 'popover',\n    hideDelay: 1,\n    animation: 'none',\n    positionView: positionView\n  };\n\n  function positionView(target, popoverEle) {\n    var targetEle = jqLite(target.target || target);\n    var buttonOffset = $ionicPosition.offset(targetEle);\n    var popoverWidth = popoverEle.prop('offsetWidth');\n    var popoverHeight = popoverEle.prop('offsetHeight');\n    // Use innerWidth and innerHeight, because clientWidth and clientHeight\n    // doesn't work consistently for body on all platforms\n    var bodyWidth = $window.innerWidth;\n    var bodyHeight = $window.innerHeight;\n\n    var popoverCSS = {\n      left: buttonOffset.left + buttonOffset.width / 2 - popoverWidth / 2\n    };\n    var arrowEle = jqLite(popoverEle[0].querySelector('.popover-arrow'));\n\n    if (popoverCSS.left < POPOVER_BODY_PADDING) {\n      popoverCSS.left = POPOVER_BODY_PADDING;\n    } else if (popoverCSS.left + popoverWidth + POPOVER_BODY_PADDING > bodyWidth) {\n      popoverCSS.left = bodyWidth - popoverWidth - POPOVER_BODY_PADDING;\n    }\n\n    // If the popover when popped down stretches past bottom of screen,\n    // make it pop up if there's room above\n    if (buttonOffset.top + buttonOffset.height + popoverHeight > bodyHeight &&\n        buttonOffset.top - popoverHeight > 0) {\n      popoverCSS.top = buttonOffset.top - popoverHeight;\n      popoverEle.addClass('popover-bottom');\n    } else {\n      popoverCSS.top = buttonOffset.top + buttonOffset.height;\n      popoverEle.removeClass('popover-bottom');\n    }\n\n    arrowEle.css({\n      left: buttonOffset.left + buttonOffset.width / 2 -\n        arrowEle.prop('offsetWidth') / 2 - popoverCSS.left + 'px'\n    });\n\n    popoverEle.css({\n      top: popoverCSS.top + 'px',\n      left: popoverCSS.left + 'px',\n      marginLeft: '0',\n      opacity: '1'\n    });\n\n  }\n\n  /**\n   * @ngdoc controller\n   * @name ionicPopover\n   * @module ionic\n   * @description\n   * Instantiated by the {@link ionic.service:$ionicPopover} service.\n   *\n   * Be sure to call [remove()](#remove) when you are done with each popover\n   * to clean it up and avoid memory leaks.\n   *\n   * Note: a popover will broadcast 'popover.shown', 'popover.hidden', and 'popover.removed' events from its originating\n   * scope, passing in itself as an event argument. Both the popover.removed and popover.hidden events are\n   * called when the popover is removed.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#initialize\n   * @description Creates a new popover controller instance.\n   * @param {object} options An options object with the following properties:\n   *  - `{object=}` `scope` The scope to be a child of.\n   *    Default: creates a child of $rootScope.\n   *  - `{boolean=}` `focusFirstInput` Whether to autofocus the first input of\n   *    the popover when shown.  Default: false.\n   *  - `{boolean=}` `backdropClickToClose` Whether to close the popover on clicking the backdrop.\n   *    Default: true.\n   *  - `{boolean=}` `hardwareBackButtonClose` Whether the popover can be closed using the hardware\n   *    back button on Android and similar devices.  Default: true.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#show\n   * @description Show this popover instance.\n   * @param {$event} $event The $event or target element which the popover should align\n   * itself next to.\n   * @returns {promise} A promise which is resolved when the popover is finished animating in.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#hide\n   * @description Hide this popover instance.\n   * @returns {promise} A promise which is resolved when the popover is finished animating out.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#remove\n   * @description Remove this popover instance from the DOM and clean up.\n   * @returns {promise} A promise which is resolved when the popover is finished animating out.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#isShown\n   * @returns boolean Whether this popover is currently shown.\n   */\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicPopover#fromTemplate\n     * @param {string} templateString The template string to use as the popovers's\n     * content.\n     * @param {object} options Options to be passed to the initialize method.\n     * @returns {object} An instance of an {@link ionic.controller:ionicPopover}\n     * controller (ionicPopover is built on top of $ionicPopover).\n     */\n    fromTemplate: function(templateString, options) {\n      return $ionicModal.fromTemplate(templateString, ionic.Utils.extend(POPOVER_OPTIONS, options || {}));\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicPopover#fromTemplateUrl\n     * @param {string} templateUrl The url to load the template from.\n     * @param {object} options Options to be passed to the initialize method.\n     * @returns {promise} A promise that will be resolved with an instance of\n     * an {@link ionic.controller:ionicPopover} controller (ionicPopover is built on top of $ionicPopover).\n     */\n    fromTemplateUrl: function(url, options) {\n      return $ionicModal.fromTemplateUrl(url, ionic.Utils.extend(POPOVER_OPTIONS, options || {}));\n    }\n  };\n\n}]);\n\n\nvar POPUP_TPL =\n  '<div class=\"popup-container\" ng-class=\"cssClass\">' +\n    '<div class=\"popup\">' +\n      '<div class=\"popup-head\">' +\n        '<h3 class=\"popup-title\" ng-bind-html=\"title\"></h3>' +\n        '<h5 class=\"popup-sub-title\" ng-bind-html=\"subTitle\" ng-if=\"subTitle\"></h5>' +\n      '</div>' +\n      '<div class=\"popup-body\">' +\n      '</div>' +\n      '<div class=\"popup-buttons\" ng-show=\"buttons.length\">' +\n        '<button ng-repeat=\"button in buttons\" ng-click=\"$buttonTapped(button, $event)\" class=\"button\" ng-class=\"button.type || \\'button-default\\'\" ng-bind-html=\"button.text\"></button>' +\n      '</div>' +\n    '</div>' +\n  '</div>';\n\n/**\n * @ngdoc service\n * @name $ionicPopup\n * @module ionic\n * @restrict E\n * @codepen zkmhJ\n * @description\n *\n * The Ionic Popup service allows programmatically creating and showing popup\n * windows that require the user to respond in order to continue.\n *\n * The popup system has support for more flexible versions of the built in `alert()`, `prompt()`,\n * and `confirm()` functions that users are used to, in addition to allowing popups with completely\n * custom content and look.\n *\n * An input can be given an `autofocus` attribute so it automatically receives focus when\n * the popup first shows. However, depending on certain use-cases this can cause issues with\n * the tap/click system, which is why Ionic prefers using the `autofocus` attribute as\n * an opt-in feature and not the default.\n *\n * @usage\n * A few basic examples, see below for details about all of the options available.\n *\n * ```js\n *angular.module('mySuperApp', ['ionic'])\n *.controller('PopupCtrl',function($scope, $ionicPopup, $timeout) {\n *\n * // Triggered on a button click, or some other target\n * $scope.showPopup = function() {\n *   $scope.data = {}\n *\n *   // An elaborate, custom popup\n *   var myPopup = $ionicPopup.show({\n *     template: '<input type=\"password\" ng-model=\"data.wifi\">',\n *     title: 'Enter Wi-Fi Password',\n *     subTitle: 'Please use normal things',\n *     scope: $scope,\n *     buttons: [\n *       { text: 'Cancel' },\n *       {\n *         text: '<b>Save</b>',\n *         type: 'button-positive',\n *         onTap: function(e) {\n *           if (!$scope.data.wifi) {\n *             //don't allow the user to close unless he enters wifi password\n *             e.preventDefault();\n *           } else {\n *             return $scope.data.wifi;\n *           }\n *         }\n *       }\n *     ]\n *   });\n *   myPopup.then(function(res) {\n *     console.log('Tapped!', res);\n *   });\n *   $timeout(function() {\n *      myPopup.close(); //close the popup after 3 seconds for some reason\n *   }, 3000);\n *  };\n *  // A confirm dialog\n *  $scope.showConfirm = function() {\n *    var confirmPopup = $ionicPopup.confirm({\n *      title: 'Consume Ice Cream',\n *      template: 'Are you sure you want to eat this ice cream?'\n *    });\n *    confirmPopup.then(function(res) {\n *      if(res) {\n *        console.log('You are sure');\n *      } else {\n *        console.log('You are not sure');\n *      }\n *    });\n *  };\n *\n *  // An alert dialog\n *  $scope.showAlert = function() {\n *    var alertPopup = $ionicPopup.alert({\n *      title: 'Don\\'t eat that!',\n *      template: 'It might taste good'\n *    });\n *    alertPopup.then(function(res) {\n *      console.log('Thank you for not eating my delicious ice cream cone');\n *    });\n *  };\n *});\n *```\n */\n\nIonicModule\n.factory('$ionicPopup', [\n  '$ionicTemplateLoader',\n  '$ionicBackdrop',\n  '$q',\n  '$timeout',\n  '$rootScope',\n  '$ionicBody',\n  '$compile',\n  '$ionicPlatform',\n  'IONIC_BACK_PRIORITY',\nfunction($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicBody, $compile, $ionicPlatform, IONIC_BACK_PRIORITY) {\n  //TODO allow this to be configured\n  var config = {\n    stackPushDelay: 75\n  };\n  var popupStack = [];\n\n  var $ionicPopup = {\n    /**\n     * @ngdoc method\n     * @description\n     * Show a complex popup. This is the master show function for all popups.\n     *\n     * A complex popup has a `buttons` array, with each button having a `text` and `type`\n     * field, in addition to an `onTap` function.  The `onTap` function, called when\n     * the corresponding button on the popup is tapped, will by default close the popup\n     * and resolve the popup promise with its return value.  If you wish to prevent the\n     * default and keep the popup open on button tap, call `event.preventDefault()` on the\n     * passed in tap event.  Details below.\n     *\n     * @name $ionicPopup#show\n     * @param {object} options The options for the new popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   scope: null, // Scope (optional). A scope to link to the popup content.\n     *   buttons: [{ // Array[Object] (optional). Buttons to place in the popup footer.\n     *     text: 'Cancel',\n     *     type: 'button-default',\n     *     onTap: function(e) {\n     *       // e.preventDefault() will stop the popup from closing when tapped.\n     *       e.preventDefault();\n     *     }\n     *   }, {\n     *     text: 'OK',\n     *     type: 'button-positive',\n     *     onTap: function(e) {\n     *       // Returning a value will cause the promise to resolve with the given value.\n     *       return scope.data.response;\n     *     }\n     *   }]\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has an additional\n     * `close` function, which can be used to programmatically close the popup.\n     */\n    show: showPopup,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#alert\n     * @description Show a simple alert popup with a message and one button that the user can\n     * tap to close the popup.\n     *\n     * @param {object} options The options for showing the alert, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   okText: '', // String (default: 'OK'). The text of the OK button.\n     *   okType: '', // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    alert: showAlert,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#confirm\n     * @description\n     * Show a simple confirm popup with a Cancel and OK button.\n     *\n     * Resolves the promise with true if the user presses the OK button, and false if the\n     * user presses the Cancel button.\n     *\n     * @param {object} options The options for showing the confirm popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   cancelText: '', // String (default: 'Cancel'). The text of the Cancel button.\n     *   cancelType: '', // String (default: 'button-default'). The type of the Cancel button.\n     *   okText: '', // String (default: 'OK'). The text of the OK button.\n     *   okType: '', // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    confirm: showConfirm,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#prompt\n     * @description Show a simple prompt popup, which has an input, OK button, and Cancel button.\n     * Resolves the promise with the value of the input if the user presses OK, and with undefined\n     * if the user presses Cancel.\n     *\n     * ```javascript\n     *  $ionicPopup.prompt({\n     *    title: 'Password Check',\n     *    template: 'Enter your secret password',\n     *    inputType: 'password',\n     *    inputPlaceholder: 'Your password'\n     *  }).then(function(res) {\n     *    console.log('Your password is', res);\n     *  });\n     * ```\n     * @param {object} options The options for showing the prompt popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   inputType: // String (default: 'text'). The type of input to use\n     *   inputPlaceholder: // String (default: ''). A placeholder to use for the input.\n     *   cancelText: // String (default: 'Cancel'. The text of the Cancel button.\n     *   cancelType: // String (default: 'button-default'). The type of the Cancel button.\n     *   okText: // String (default: 'OK'). The text of the OK button.\n     *   okType: // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    prompt: showPrompt,\n    /**\n     * @private for testing\n     */\n    _createPopup: createPopup,\n    _popupStack: popupStack\n  };\n\n  return $ionicPopup;\n\n  function createPopup(options) {\n    options = extend({\n      scope: null,\n      title: '',\n      buttons: []\n    }, options || {});\n\n    var self = {};\n    self.scope = (options.scope || $rootScope).$new();\n    self.element = jqLite(POPUP_TPL);\n    self.responseDeferred = $q.defer();\n\n    $ionicBody.get().appendChild(self.element[0]);\n    $compile(self.element)(self.scope);\n\n    extend(self.scope, {\n      title: options.title,\n      buttons: options.buttons,\n      subTitle: options.subTitle,\n      cssClass: options.cssClass,\n      $buttonTapped: function(button, event) {\n        var result = (button.onTap || noop)(event);\n        event = event.originalEvent || event; //jquery events\n\n        if (!event.defaultPrevented) {\n          self.responseDeferred.resolve(result);\n        }\n      }\n    });\n\n    $q.when(\n      options.templateUrl ?\n      $ionicTemplateLoader.load(options.templateUrl) :\n        (options.template || options.content || '')\n    ).then(function(template) {\n      var popupBody = jqLite(self.element[0].querySelector('.popup-body'));\n      if (template) {\n        popupBody.html(template);\n        $compile(popupBody.contents())(self.scope);\n      } else {\n        popupBody.remove();\n      }\n    });\n\n    self.show = function() {\n      if (self.isShown || self.removed) return;\n\n      self.isShown = true;\n      ionic.requestAnimationFrame(function() {\n        //if hidden while waiting for raf, don't show\n        if (!self.isShown) return;\n\n        self.element.removeClass('popup-hidden');\n        self.element.addClass('popup-showing active');\n        focusInput(self.element);\n      });\n    };\n\n    self.hide = function(callback) {\n      callback = callback || noop;\n      if (!self.isShown) return callback();\n\n      self.isShown = false;\n      self.element.removeClass('active');\n      self.element.addClass('popup-hidden');\n      $timeout(callback, 250, false);\n    };\n\n    self.remove = function() {\n      if (self.removed) return;\n\n      self.hide(function() {\n        self.element.remove();\n        self.scope.$destroy();\n      });\n\n      self.removed = true;\n    };\n\n    return self;\n  }\n\n  function onHardwareBackButton() {\n    var last = popupStack[popupStack.length - 1];\n    last && last.responseDeferred.resolve();\n  }\n\n  function showPopup(options) {\n    var popup = $ionicPopup._createPopup(options);\n    var showDelay = 0;\n\n    if (popupStack.length > 0) {\n      popupStack[popupStack.length - 1].hide();\n      showDelay = config.stackPushDelay;\n    } else {\n      //Add popup-open & backdrop if this is first popup\n      $ionicBody.addClass('popup-open');\n      $ionicBackdrop.retain();\n      //only show the backdrop on the first popup\n      $ionicPopup._backButtonActionDone = $ionicPlatform.registerBackButtonAction(\n        onHardwareBackButton,\n        IONIC_BACK_PRIORITY.popup\n      );\n    }\n\n    // Expose a 'close' method on the returned promise\n    popup.responseDeferred.promise.close = function popupClose(result) {\n      if (!popup.removed) popup.responseDeferred.resolve(result);\n    };\n    //DEPRECATED: notify the promise with an object with a close method\n    popup.responseDeferred.notify({ close: popup.responseDeferred.close });\n\n    doShow();\n\n    return popup.responseDeferred.promise;\n\n    function doShow() {\n      popupStack.push(popup);\n      $timeout(popup.show, showDelay, false);\n\n      popup.responseDeferred.promise.then(function(result) {\n        var index = popupStack.indexOf(popup);\n        if (index !== -1) {\n          popupStack.splice(index, 1);\n        }\n\n        if (popupStack.length > 0) {\n          popupStack[popupStack.length - 1].show();\n        } else {\n          $ionicBackdrop.release();\n          //Remove popup-open & backdrop if this is last popup\n          $timeout(function() {\n            // wait to remove this due to a 300ms delay native\n            // click which would trigging whatever was underneath this\n            if (!popupStack.length) {\n              $ionicBody.removeClass('popup-open');\n            }\n          }, 400, false);\n          ($ionicPopup._backButtonActionDone || noop)();\n        }\n\n        popup.remove();\n\n        return result;\n      });\n\n    }\n\n  }\n\n  function focusInput(element) {\n    var focusOn = element[0].querySelector('[autofocus]');\n    if (focusOn) {\n      focusOn.focus();\n    }\n  }\n\n  function showAlert(opts) {\n    return showPopup(extend({\n      buttons: [{\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() {\n          return true;\n        }\n      }]\n    }, opts || {}));\n  }\n\n  function showConfirm(opts) {\n    return showPopup(extend({\n      buttons: [{\n        text: opts.cancelText || 'Cancel',\n        type: opts.cancelType || 'button-default',\n        onTap: function() { return false; }\n      }, {\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() { return true; }\n      }]\n    }, opts || {}));\n  }\n\n  function showPrompt(opts) {\n    var scope = $rootScope.$new(true);\n    scope.data = {};\n    var text = '';\n    if (opts.template && /<[a-z][\\s\\S]*>/i.test(opts.template) === false) {\n      text = '<span>' + opts.template + '</span>';\n      delete opts.template;\n    }\n    return showPopup(extend({\n      template: text + '<input ng-model=\"data.response\" type=\"' + (opts.inputType || 'text') +\n        '\" placeholder=\"' + (opts.inputPlaceholder || '') + '\">',\n      scope: scope,\n      buttons: [{\n        text: opts.cancelText || 'Cancel',\n        type: opts.cancelType || 'button-default',\n        onTap: function() {}\n      }, {\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() {\n          return scope.data.response || '';\n        }\n      }]\n    }, opts || {}));\n  }\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicPosition\n * @module ionic\n * @description\n * A set of utility methods that can be use to retrieve position of DOM elements.\n * It is meant to be used where we need to absolute-position DOM elements in\n * relation to other, existing elements (this is the case for tooltips, popovers, etc.).\n *\n * Adapted from [AngularUI Bootstrap](https://github.com/angular-ui/bootstrap/blob/master/src/position/position.js),\n * ([license](https://github.com/angular-ui/bootstrap/blob/master/LICENSE))\n */\nIonicModule\n.factory('$ionicPosition', ['$document', '$window', function($document, $window) {\n\n  function getStyle(el, cssprop) {\n    if (el.currentStyle) { //IE\n      return el.currentStyle[cssprop];\n    } else if ($window.getComputedStyle) {\n      return $window.getComputedStyle(el)[cssprop];\n    }\n    // finally try and get inline style\n    return el.style[cssprop];\n  }\n\n  /**\n   * Checks if a given element is statically positioned\n   * @param element - raw DOM element\n   */\n  function isStaticPositioned(element) {\n    return (getStyle(element, 'position') || 'static') === 'static';\n  }\n\n  /**\n   * returns the closest, non-statically positioned parentOffset of a given element\n   * @param element\n   */\n  var parentOffsetEl = function(element) {\n    var docDomEl = $document[0];\n    var offsetParent = element.offsetParent || docDomEl;\n    while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent)) {\n      offsetParent = offsetParent.offsetParent;\n    }\n    return offsetParent || docDomEl;\n  };\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicPosition#position\n     * @description Get the current coordinates of the element, relative to the offset parent.\n     * Read-only equivalent of [jQuery's position function](http://api.jquery.com/position/).\n     * @param {element} element The element to get the position of.\n     * @returns {object} Returns an object containing the properties top, left, width and height.\n     */\n    position: function(element) {\n      var elBCR = this.offset(element);\n      var offsetParentBCR = { top: 0, left: 0 };\n      var offsetParentEl = parentOffsetEl(element[0]);\n      if (offsetParentEl != $document[0]) {\n        offsetParentBCR = this.offset(jqLite(offsetParentEl));\n        offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;\n        offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;\n      }\n\n      var boundingClientRect = element[0].getBoundingClientRect();\n      return {\n        width: boundingClientRect.width || element.prop('offsetWidth'),\n        height: boundingClientRect.height || element.prop('offsetHeight'),\n        top: elBCR.top - offsetParentBCR.top,\n        left: elBCR.left - offsetParentBCR.left\n      };\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicPosition#offset\n     * @description Get the current coordinates of the element, relative to the document.\n     * Read-only equivalent of [jQuery's offset function](http://api.jquery.com/offset/).\n     * @param {element} element The element to get the offset of.\n     * @returns {object} Returns an object containing the properties top, left, width and height.\n     */\n    offset: function(element) {\n      var boundingClientRect = element[0].getBoundingClientRect();\n      return {\n        width: boundingClientRect.width || element.prop('offsetWidth'),\n        height: boundingClientRect.height || element.prop('offsetHeight'),\n        top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop),\n        left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)\n      };\n    }\n\n  };\n}]);\n\n\n/**\n * @ngdoc service\n * @name $ionicScrollDelegate\n * @module ionic\n * @description\n * Delegate for controlling scrollViews (created by\n * {@link ionic.directive:ionContent} and\n * {@link ionic.directive:ionScroll} directives).\n *\n * Methods called directly on the $ionicScrollDelegate service will control all scroll\n * views.  Use the {@link ionic.service:$ionicScrollDelegate#$getByHandle $getByHandle}\n * method to control specific scrollViews.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-content>\n *     <button ng-click=\"scrollTop()\">Scroll to Top!</button>\n *   </ion-content>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicScrollDelegate) {\n *   $scope.scrollTop = function() {\n *     $ionicScrollDelegate.scrollTop();\n *   };\n * }\n * ```\n *\n * Example of advanced usage, with two scroll areas using `delegate-handle`\n * for fine control.\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-content delegate-handle=\"mainScroll\">\n *     <button ng-click=\"scrollMainToTop()\">\n *       Scroll content to top!\n *     </button>\n *     <ion-scroll delegate-handle=\"small\" style=\"height: 100px;\">\n *       <button ng-click=\"scrollSmallToTop()\">\n *         Scroll small area to top!\n *       </button>\n *     </ion-scroll>\n *   </ion-content>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicScrollDelegate) {\n *   $scope.scrollMainToTop = function() {\n *     $ionicScrollDelegate.$getByHandle('mainScroll').scrollTop();\n *   };\n *   $scope.scrollSmallToTop = function() {\n *     $ionicScrollDelegate.$getByHandle('small').scrollTop();\n *   };\n * }\n * ```\n */\nIonicModule\n.service('$ionicScrollDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#resize\n   * @description Tell the scrollView to recalculate the size of its container.\n   */\n  'resize',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollTop\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollTop',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollBottom\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollBottom',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollTo\n   * @param {number} left The x-value to scroll to.\n   * @param {number} top The y-value to scroll to.\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollTo',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollBy\n   * @param {number} left The x-offset to scroll by.\n   * @param {number} top The y-offset to scroll by.\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollBy',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#zoomTo\n   * @param {number} level Level to zoom to.\n   * @param {boolean=} animate Whether to animate the zoom.\n   * @param {number=} originLeft Zoom in at given left coordinate.\n   * @param {number=} originTop Zoom in at given top coordinate.\n   */\n  'zoomTo',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#zoomBy\n   * @param {number} factor The factor to zoom by.\n   * @param {boolean=} animate Whether to animate the zoom.\n   * @param {number=} originLeft Zoom in at given left coordinate.\n   * @param {number=} originTop Zoom in at given top coordinate.\n   */\n  'zoomBy',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#getScrollPosition\n   * @returns {object} The scroll position of this view, with the following properties:\n   *  - `{number}` `left` The distance the user has scrolled from the left (starts at 0).\n   *  - `{number}` `top` The distance the user has scrolled from the top (starts at 0).\n   */\n  'getScrollPosition',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#anchorScroll\n   * @description Tell the scrollView to scroll to the element with an id\n   * matching window.location.hash.\n   *\n   * If no matching element is found, it will scroll to top.\n   *\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'anchorScroll',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#freezeScroll\n   * @description Does not allow this scroll view to scroll either x or y.\n   * @param {boolean=} shouldFreeze Should this scroll view be prevented from scrolling or not.\n   * @returns {object} If the scroll view is being prevented from scrolling or not.\n   */\n  'freezeScroll',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#freezeAllScrolls\n   * @description Does not allow any of the app's scroll views to scroll either x or y.\n   * @param {boolean=} shouldFreeze Should all app scrolls be prevented from scrolling or not.\n   */\n  'freezeAllScrolls',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#getScrollView\n   * @returns {object} The scrollView associated with this delegate.\n   */\n  'getScrollView'\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * scrollViews with `delegate-handle` matching the given handle.\n   *\n   * Example: `$ionicScrollDelegate.$getByHandle('my-handle').scrollTop();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicSideMenuDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionSideMenus} directive.\n *\n * Methods called directly on the $ionicSideMenuDelegate service will control all side\n * menus.  Use the {@link ionic.service:$ionicSideMenuDelegate#$getByHandle $getByHandle}\n * method to control specific ionSideMenus instances.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-side-menus>\n *     <ion-side-menu-content>\n *       Content!\n *       <button ng-click=\"toggleLeftSideMenu()\">\n *         Toggle Left Side Menu\n *       </button>\n *     </ion-side-menu-content>\n *     <ion-side-menu side=\"left\">\n *       Left Menu!\n *     <ion-side-menu>\n *   </ion-side-menus>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicSideMenuDelegate) {\n *   $scope.toggleLeftSideMenu = function() {\n *     $ionicSideMenuDelegate.toggleLeft();\n *   };\n * }\n * ```\n */\nIonicModule\n.service('$ionicSideMenuDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#toggleLeft\n   * @description Toggle the left side menu (if it exists).\n   * @param {boolean=} isOpen Whether to open or close the menu.\n   * Default: Toggles the menu.\n   */\n  'toggleLeft',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#toggleRight\n   * @description Toggle the right side menu (if it exists).\n   * @param {boolean=} isOpen Whether to open or close the menu.\n   * Default: Toggles the menu.\n   */\n  'toggleRight',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#getOpenRatio\n   * @description Gets the ratio of open amount over menu width. For example, a\n   * menu of width 100 that is opened by 50 pixels is 50% opened, and would return\n   * a ratio of 0.5.\n   *\n   * @returns {float} 0 if nothing is open, between 0 and 1 if left menu is\n   * opened/opening, and between 0 and -1 if right menu is opened/opening.\n   */\n  'getOpenRatio',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpen\n   * @returns {boolean} Whether either the left or right menu is currently opened.\n   */\n  'isOpen',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpenLeft\n   * @returns {boolean} Whether the left menu is currently opened.\n   */\n  'isOpenLeft',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpenRight\n   * @returns {boolean} Whether the right menu is currently opened.\n   */\n  'isOpenRight',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#canDragContent\n   * @param {boolean=} canDrag Set whether the content can or cannot be dragged to open\n   * side menus.\n   * @returns {boolean} Whether the content can be dragged to open side menus.\n   */\n  'canDragContent',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#edgeDragThreshold\n   * @param {boolean|number=} value Set whether the content drag can only start if it is below a certain threshold distance from the edge of the screen. Accepts three different values:\n   *  - If a non-zero number is given, that many pixels is used as the maximum allowed distance from the edge that starts dragging the side menu.\n   *  - If true is given, the default number of pixels (25) is used as the maximum allowed distance.\n   *  - If false or 0 is given, the edge drag threshold is disabled, and dragging from anywhere on the content is allowed.\n   * @returns {boolean} Whether the drag can start only from within the edge of screen threshold.\n   */\n  'edgeDragThreshold'\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionSideMenus} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicSideMenuDelegate.$getByHandle('my-handle').toggleLeft();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicSlideBoxDelegate\n * @module ionic\n * @description\n * Delegate that controls the {@link ionic.directive:ionSlideBox} directive.\n *\n * Methods called directly on the $ionicSlideBoxDelegate service will control all slide boxes.  Use the {@link ionic.service:$ionicSlideBoxDelegate#$getByHandle $getByHandle}\n * method to control specific slide box instances.\n *\n * @usage\n *\n * ```html\n * <ion-view>\n *   <ion-slide-box>\n *     <ion-slide>\n *       <div class=\"box blue\">\n *         <button ng-click=\"nextSlide()\">Next slide!</button>\n *       </div>\n *     </ion-slide>\n *     <ion-slide>\n *       <div class=\"box red\">\n *         Slide 2!\n *       </div>\n *     </ion-slide>\n *   </ion-slide-box>\n * </ion-view>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicSlideBoxDelegate) {\n *   $scope.nextSlide = function() {\n *     $ionicSlideBoxDelegate.next();\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicSlideBoxDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#update\n   * @description\n   * Update the slidebox (for example if using Angular with ng-repeat,\n   * resize it for the elements inside).\n   */\n  'update',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#slide\n   * @param {number} to The index to slide to.\n   * @param {number=} speed The number of milliseconds the change should take.\n   */\n  'slide',\n  'select',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#enableSlide\n   * @param {boolean=} shouldEnable Whether to enable sliding the slidebox.\n   * @returns {boolean} Whether sliding is enabled.\n   */\n  'enableSlide',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#previous\n   * @param {number=} speed The number of milliseconds the change should take.\n   * @description Go to the previous slide. Wraps around if at the beginning.\n   */\n  'previous',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#next\n   * @param {number=} speed The number of milliseconds the change should take.\n   * @description Go to the next slide. Wraps around if at the end.\n   */\n  'next',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#stop\n   * @description Stop sliding. The slideBox will not move again until\n   * explicitly told to do so.\n   */\n  'stop',\n  'autoPlay',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#start\n   * @description Start sliding again if the slideBox was stopped.\n   */\n  'start',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#currentIndex\n   * @returns number The index of the current slide.\n   */\n  'currentIndex',\n  'selected',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#slidesCount\n   * @returns number The number of slides there are currently.\n   */\n  'slidesCount',\n  'count',\n  'loop'\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionSlideBox} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicSlideBoxDelegate.$getByHandle('my-handle').stop();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicTabsDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionTabs} directive.\n *\n * Methods called directly on the $ionicTabsDelegate service will control all ionTabs\n * directives. Use the {@link ionic.service:$ionicTabsDelegate#$getByHandle $getByHandle}\n * method to control specific ionTabs instances.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MyCtrl\">\n *   <ion-tabs>\n *\n *     <ion-tab title=\"Tab 1\">\n *       Hello tab 1!\n *       <button ng-click=\"selectTabWithIndex(1)\">Select tab 2!</button>\n *     </ion-tab>\n *     <ion-tab title=\"Tab 2\">Hello tab 2!</ion-tab>\n *\n *   </ion-tabs>\n * </body>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicTabsDelegate) {\n *   $scope.selectTabWithIndex = function(index) {\n *     $ionicTabsDelegate.select(index);\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicTabsDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#select\n   * @description Select the tab matching the given index.\n   *\n   * @param {number} index Index of the tab to select.\n   */\n  'select',\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#selectedIndex\n   * @returns `number` The index of the selected tab, or -1.\n   */\n  'selectedIndex'\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionTabs} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicTabsDelegate.$getByHandle('my-handle').select(0);`\n   */\n]));\n\n\n// closure to keep things neat\n(function() {\n  var templatesToCache = [];\n\n/**\n * @ngdoc service\n * @name $ionicTemplateCache\n * @module ionic\n * @description A service that preemptively caches template files to eliminate transition flicker and boost performance.\n * @usage\n * State templates are cached automatically, but you can optionally cache other templates.\n *\n * ```js\n * $ionicTemplateCache('myNgIncludeTemplate.html');\n * ```\n *\n * Optionally disable all preemptive caching with the `$ionicConfigProvider` or individual states by setting `prefetchTemplate`\n * in the `$state` definition\n *\n * ```js\n *   angular.module('myApp', ['ionic'])\n *   .config(function($stateProvider, $ionicConfigProvider) {\n *\n *     // disable preemptive template caching globally\n *     $ionicConfigProvider.templates.prefetch(false);\n *\n *     // disable individual states\n *     $stateProvider\n *       .state('tabs', {\n *         url: \"/tab\",\n *         abstract: true,\n *         prefetchTemplate: false,\n *         templateUrl: \"tabs-templates/tabs.html\"\n *       })\n *       .state('tabs.home', {\n *         url: \"/home\",\n *         views: {\n *           'home-tab': {\n *             prefetchTemplate: false,\n *             templateUrl: \"tabs-templates/home.html\",\n *             controller: 'HomeTabCtrl'\n *           }\n *         }\n *       });\n *   });\n * ```\n */\nIonicModule\n.factory('$ionicTemplateCache', [\n'$http',\n'$templateCache',\n'$timeout',\nfunction($http, $templateCache, $timeout) {\n  var toCache = templatesToCache,\n      hasRun;\n\n  function $ionicTemplateCache(templates) {\n    if (typeof templates === 'undefined') {\n      return run();\n    }\n    if (isString(templates)) {\n      templates = [templates];\n    }\n    forEach(templates, function(template) {\n      toCache.push(template);\n    });\n    if (hasRun) {\n      run();\n    }\n  }\n\n  // run through methods - internal method\n  function run() {\n    var template;\n    $ionicTemplateCache._runCount++;\n\n    hasRun = true;\n    // ignore if race condition already zeroed out array\n    if (toCache.length === 0) return;\n\n    var i = 0;\n    while (i < 4 && (template = toCache.pop())) {\n      // note that inline templates are ignored by this request\n      if (isString(template)) $http.get(template, { cache: $templateCache });\n      i++;\n    }\n    // only preload 3 templates a second\n    if (toCache.length) {\n      $timeout(run, 1000);\n    }\n  }\n\n  // exposing for testing\n  $ionicTemplateCache._runCount = 0;\n  // default method\n  return $ionicTemplateCache;\n}])\n\n// Intercepts the $stateprovider.state() command to look for templateUrls that can be cached\n.config([\n'$stateProvider',\n'$ionicConfigProvider',\nfunction($stateProvider, $ionicConfigProvider) {\n  var stateProviderState = $stateProvider.state;\n  $stateProvider.state = function(stateName, definition) {\n    // don't even bother if it's disabled. note, another config may run after this, so it's not a catch-all\n    if (typeof definition === 'object') {\n      var enabled = definition.prefetchTemplate !== false && templatesToCache.length < $ionicConfigProvider.templates.maxPrefetch();\n      if (enabled && isString(definition.templateUrl)) templatesToCache.push(definition.templateUrl);\n      if (angular.isObject(definition.views)) {\n        for (var key in definition.views) {\n          enabled = definition.views[key].prefetchTemplate !== false && templatesToCache.length < $ionicConfigProvider.templates.maxPrefetch();\n          if (enabled && isString(definition.views[key].templateUrl)) templatesToCache.push(definition.views[key].templateUrl);\n        }\n      }\n    }\n    return stateProviderState.call($stateProvider, stateName, definition);\n  };\n}])\n\n// process the templateUrls collected by the $stateProvider, adding them to the cache\n.run(['$ionicTemplateCache', function($ionicTemplateCache) {\n  $ionicTemplateCache();\n}]);\n\n})();\n\nIonicModule\n.factory('$ionicTemplateLoader', [\n  '$compile',\n  '$controller',\n  '$http',\n  '$q',\n  '$rootScope',\n  '$templateCache',\nfunction($compile, $controller, $http, $q, $rootScope, $templateCache) {\n\n  return {\n    load: fetchTemplate,\n    compile: loadAndCompile\n  };\n\n  function fetchTemplate(url) {\n    return $http.get(url, {cache: $templateCache})\n    .then(function(response) {\n      return response.data && response.data.trim();\n    });\n  }\n\n  function loadAndCompile(options) {\n    options = extend({\n      template: '',\n      templateUrl: '',\n      scope: null,\n      controller: null,\n      locals: {},\n      appendTo: null\n    }, options || {});\n\n    var templatePromise = options.templateUrl ?\n      this.load(options.templateUrl) :\n      $q.when(options.template);\n\n    return templatePromise.then(function(template) {\n      var controller;\n      var scope = options.scope || $rootScope.$new();\n\n      //Incase template doesn't have just one root element, do this\n      var element = jqLite('<div>').html(template).contents();\n\n      if (options.controller) {\n        controller = $controller(\n          options.controller,\n          extend(options.locals, {\n            $scope: scope\n          })\n        );\n        element.children().data('$ngControllerController', controller);\n      }\n      if (options.appendTo) {\n        jqLite(options.appendTo).append(element);\n      }\n\n      $compile(element)(scope);\n\n      return {\n        element: element,\n        scope: scope\n      };\n    });\n  }\n\n}]);\n\n/**\n * @private\n * DEPRECATED, as of v1.0.0-beta14 -------\n */\nIonicModule\n.factory('$ionicViewService', ['$ionicHistory', '$log', function($ionicHistory, $log) {\n\n  function warn(oldMethod, newMethod) {\n    $log.warn('$ionicViewService' + oldMethod + ' is deprecated, please use $ionicHistory' + newMethod + ' instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/');\n  }\n\n  warn('', '');\n\n  var methodsMap = {\n    getCurrentView: 'currentView',\n    getBackView: 'backView',\n    getForwardView: 'forwardView',\n    getCurrentStateName: 'currentStateName',\n    nextViewOptions: 'nextViewOptions',\n    clearHistory: 'clearHistory'\n  };\n\n  forEach(methodsMap, function(newMethod, oldMethod) {\n    methodsMap[oldMethod] = function() {\n      warn('.' + oldMethod, '.' + newMethod);\n      return $ionicHistory[newMethod].apply(this, arguments);\n    };\n  });\n\n  return methodsMap;\n\n}]);\n\n/**\n * @private\n * TODO document\n */\n\nIonicModule.factory('$ionicViewSwitcher', [\n  '$timeout',\n  '$document',\n  '$q',\n  '$ionicClickBlock',\n  '$ionicConfig',\n  '$ionicNavBarDelegate',\nfunction($timeout, $document, $q, $ionicClickBlock, $ionicConfig, $ionicNavBarDelegate) {\n\n  var TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n  var DATA_NO_CACHE = '$noCache';\n  var DATA_DESTROY_ELE = '$destroyEle';\n  var DATA_ELE_IDENTIFIER = '$eleId';\n  var DATA_VIEW_ACCESSED = '$accessed';\n  var DATA_FALLBACK_TIMER = '$fallbackTimer';\n  var DATA_VIEW = '$viewData';\n  var NAV_VIEW_ATTR = 'nav-view';\n  var VIEW_STATUS_ACTIVE = 'active';\n  var VIEW_STATUS_CACHED = 'cached';\n  var VIEW_STATUS_STAGED = 'stage';\n\n  var transitionCounter = 0;\n  var nextTransition, nextDirection;\n  ionic.transition = ionic.transition || {};\n  ionic.transition.isActive = false;\n  var isActiveTimer;\n  var cachedAttr = ionic.DomUtil.cachedAttr;\n  var transitionPromises = [];\n  var defaultTimeout = 1100;\n\n  var ionicViewSwitcher = {\n\n    create: function(navViewCtrl, viewLocals, enteringView, leavingView, renderStart, renderEnd) {\n      // get a reference to an entering/leaving element if they exist\n      // loop through to see if the view is already in the navViewElement\n      var enteringEle, leavingEle;\n      var transitionId = ++transitionCounter;\n      var alreadyInDom;\n\n      var switcher = {\n\n        init: function(registerData, callback) {\n          ionicViewSwitcher.isTransitioning(true);\n\n          switcher.loadViewElements(registerData);\n\n          switcher.render(registerData, function() {\n            callback && callback();\n          });\n        },\n\n        loadViewElements: function(registerData) {\n          var x, l, viewEle;\n          var viewElements = navViewCtrl.getViewElements();\n          var enteringEleIdentifier = getViewElementIdentifier(viewLocals, enteringView);\n          var navViewActiveEleId = navViewCtrl.activeEleId();\n\n          for (x = 0, l = viewElements.length; x < l; x++) {\n            viewEle = viewElements.eq(x);\n\n            if (viewEle.data(DATA_ELE_IDENTIFIER) === enteringEleIdentifier) {\n              // we found an existing element in the DOM that should be entering the view\n              if (viewEle.data(DATA_NO_CACHE)) {\n                // the existing element should not be cached, don't use it\n                viewEle.data(DATA_ELE_IDENTIFIER, enteringEleIdentifier + ionic.Utils.nextUid());\n                viewEle.data(DATA_DESTROY_ELE, true);\n\n              } else {\n                enteringEle = viewEle;\n              }\n\n            } else if (isDefined(navViewActiveEleId) && viewEle.data(DATA_ELE_IDENTIFIER) === navViewActiveEleId) {\n              leavingEle = viewEle;\n            }\n\n            if (enteringEle && leavingEle) break;\n          }\n\n          alreadyInDom = !!enteringEle;\n\n          if (!alreadyInDom) {\n            // still no existing element to use\n            // create it using existing template/scope/locals\n            enteringEle = registerData.ele || ionicViewSwitcher.createViewEle(viewLocals);\n\n            // existing elements in the DOM are looked up by their state name and state id\n            enteringEle.data(DATA_ELE_IDENTIFIER, enteringEleIdentifier);\n          }\n\n          if (renderEnd) {\n            navViewCtrl.activeEleId(enteringEleIdentifier);\n          }\n\n          registerData.ele = null;\n        },\n\n        render: function(registerData, callback) {\n          if (alreadyInDom) {\n            // it was already found in the DOM, just reconnect the scope\n            ionic.Utils.reconnectScope(enteringEle.scope());\n\n          } else {\n            // the entering element is not already in the DOM\n            // set that the entering element should be \"staged\" and its\n            // styles of where this element will go before it hits the DOM\n            navViewAttr(enteringEle, VIEW_STATUS_STAGED);\n\n            var enteringData = getTransitionData(viewLocals, enteringEle, registerData.direction, enteringView);\n            var transitionFn = $ionicConfig.transitions.views[enteringData.transition] || $ionicConfig.transitions.views.none;\n            transitionFn(enteringEle, null, enteringData.direction, true).run(0);\n\n            enteringEle.data(DATA_VIEW, {\n              viewId: enteringData.viewId,\n              historyId: enteringData.historyId,\n              stateName: enteringData.stateName,\n              stateParams: enteringData.stateParams\n            });\n\n            // if the current state has cache:false\n            // or the element has cache-view=\"false\" attribute\n            if (viewState(viewLocals).cache === false || viewState(viewLocals).cache === 'false' ||\n                enteringEle.attr('cache-view') == 'false' || $ionicConfig.views.maxCache() === 0) {\n              enteringEle.data(DATA_NO_CACHE, true);\n            }\n\n            // append the entering element to the DOM, create a new scope and run link\n            var viewScope = navViewCtrl.appendViewElement(enteringEle, viewLocals);\n\n            delete enteringData.direction;\n            delete enteringData.transition;\n            viewScope.$emit('$ionicView.loaded', enteringData);\n          }\n\n          // update that this view was just accessed\n          enteringEle.data(DATA_VIEW_ACCESSED, Date.now());\n\n          callback && callback();\n        },\n\n        transition: function(direction, enableBack, allowAnimate) {\n          var deferred;\n          var enteringData = getTransitionData(viewLocals, enteringEle, direction, enteringView);\n          var leavingData = extend(extend({}, enteringData), getViewData(leavingView));\n          enteringData.transitionId = leavingData.transitionId = transitionId;\n          enteringData.fromCache = !!alreadyInDom;\n          enteringData.enableBack = !!enableBack;\n          enteringData.renderStart = renderStart;\n          enteringData.renderEnd = renderEnd;\n\n          cachedAttr(enteringEle.parent(), 'nav-view-transition', enteringData.transition);\n          cachedAttr(enteringEle.parent(), 'nav-view-direction', enteringData.direction);\n\n          // cancel any previous transition complete fallbacks\n          $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n\n          // get the transition ready and see if it'll animate\n          var transitionFn = $ionicConfig.transitions.views[enteringData.transition] || $ionicConfig.transitions.views.none;\n          var viewTransition = transitionFn(enteringEle, leavingEle, enteringData.direction,\n                                            enteringData.shouldAnimate && allowAnimate && renderEnd);\n\n          if (viewTransition.shouldAnimate) {\n            // attach transitionend events (and fallback timer)\n            enteringEle.on(TRANSITIONEND_EVENT, completeOnTransitionEnd);\n            enteringEle.data(DATA_FALLBACK_TIMER, $timeout(transitionComplete, defaultTimeout));\n            $ionicClickBlock.show(defaultTimeout);\n          }\n\n          if (renderStart) {\n            // notify the views \"before\" the transition starts\n            switcher.emit('before', enteringData, leavingData);\n\n            // stage entering element, opacity 0, no transition duration\n            navViewAttr(enteringEle, VIEW_STATUS_STAGED);\n\n            // render the elements in the correct location for their starting point\n            viewTransition.run(0);\n          }\n\n          if (renderEnd) {\n            // create a promise so we can keep track of when all transitions finish\n            // only required if this transition should complete\n            deferred = $q.defer();\n            transitionPromises.push(deferred.promise);\n          }\n\n          if (renderStart && renderEnd) {\n            // CSS \"auto\" transitioned, not manually transitioned\n            // wait a frame so the styles apply before auto transitioning\n            $timeout(onReflow, 16);\n\n          } else if (!renderEnd) {\n            // just the start of a manual transition\n            // but it will not render the end of the transition\n            navViewAttr(enteringEle, 'entering');\n            navViewAttr(leavingEle, 'leaving');\n\n            // return the transition run method so each step can be ran manually\n            return {\n              run: viewTransition.run,\n              cancel: function(shouldAnimate) {\n                if (shouldAnimate) {\n                  enteringEle.on(TRANSITIONEND_EVENT, cancelOnTransitionEnd);\n                  enteringEle.data(DATA_FALLBACK_TIMER, $timeout(cancelTransition, defaultTimeout));\n                  $ionicClickBlock.show(defaultTimeout);\n                } else {\n                  cancelTransition();\n                }\n                viewTransition.shouldAnimate = shouldAnimate;\n                viewTransition.run(0);\n                viewTransition = null;\n              }\n            };\n\n          } else if (renderEnd) {\n            // just the end of a manual transition\n            // happens after the manual transition has completed\n            // and a full history change has happened\n            onReflow();\n          }\n\n\n          function onReflow() {\n            // remove that we're staging the entering element so it can auto transition\n            navViewAttr(enteringEle, viewTransition.shouldAnimate ? 'entering' : VIEW_STATUS_ACTIVE);\n            navViewAttr(leavingEle, viewTransition.shouldAnimate ? 'leaving' : VIEW_STATUS_CACHED);\n\n            // start the auto transition and let the CSS take over\n            viewTransition.run(1);\n\n            // trigger auto transitions on the associated nav bars\n            $ionicNavBarDelegate._instances.forEach(function(instance) {\n              instance.triggerTransitionStart(transitionId);\n            });\n\n            if (!viewTransition.shouldAnimate) {\n              // no animated auto transition\n              transitionComplete();\n            }\n          }\n\n          // Make sure that transitionend events bubbling up from children won't fire\n          // transitionComplete. Will only go forward if ev.target == the element listening.\n          function completeOnTransitionEnd(ev) {\n            if (ev.target !== this) return;\n            transitionComplete();\n          }\n          function transitionComplete() {\n            if (transitionComplete.x) return;\n            transitionComplete.x = true;\n\n            enteringEle.off(TRANSITIONEND_EVENT, completeOnTransitionEnd);\n            $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n            leavingEle && $timeout.cancel(leavingEle.data(DATA_FALLBACK_TIMER));\n\n            // emit that the views have finished transitioning\n            // each parent nav-view will update which views are active and cached\n            switcher.emit('after', enteringData, leavingData);\n\n            // resolve that this one transition (there could be many w/ nested views)\n            deferred && deferred.resolve(navViewCtrl);\n\n            // the most recent transition added has completed and all the active\n            // transition promises should be added to the services array of promises\n            if (transitionId === transitionCounter) {\n              $q.all(transitionPromises).then(ionicViewSwitcher.transitionEnd);\n              switcher.cleanup(enteringData);\n            }\n\n            // tell the nav bars that the transition has ended\n            $ionicNavBarDelegate._instances.forEach(function(instance) {\n              instance.triggerTransitionEnd();\n            });\n\n            // remove any references that could cause memory issues\n            nextTransition = nextDirection = enteringView = leavingView = enteringEle = leavingEle = null;\n          }\n\n          // Make sure that transitionend events bubbling up from children won't fire\n          // transitionComplete. Will only go forward if ev.target == the element listening.\n          function cancelOnTransitionEnd(ev) {\n            if (ev.target !== this) return;\n            cancelTransition();\n          }\n          function cancelTransition() {\n            navViewAttr(enteringEle, VIEW_STATUS_CACHED);\n            navViewAttr(leavingEle, VIEW_STATUS_ACTIVE);\n            enteringEle.off(TRANSITIONEND_EVENT, cancelOnTransitionEnd);\n            $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n            ionicViewSwitcher.transitionEnd([navViewCtrl]);\n          }\n\n        },\n\n        emit: function(step, enteringData, leavingData) {\n          var scope = enteringEle.scope();\n          if (scope) {\n            scope.$emit('$ionicView.' + step + 'Enter', enteringData);\n            if (step == 'after') {\n              scope.$emit('$ionicView.enter', enteringData);\n            }\n          }\n\n          if (leavingEle) {\n            scope = leavingEle.scope();\n            if (scope) {\n              scope.$emit('$ionicView.' + step + 'Leave', leavingData);\n              if (step == 'after') {\n                scope.$emit('$ionicView.leave', leavingData);\n              }\n            }\n\n          } else if (scope && leavingData && leavingData.viewId) {\n            scope.$emit('$ionicNavView.' + step + 'Leave', leavingData);\n            if (step == 'after') {\n              scope.$emit('$ionicNavView.leave', leavingData);\n            }\n          }\n        },\n\n        cleanup: function(transData) {\n          // check if any views should be removed\n          if (leavingEle && transData.direction == 'back' && !$ionicConfig.views.forwardCache()) {\n            // if they just navigated back we can destroy the forward view\n            // do not remove forward views if cacheForwardViews config is true\n            destroyViewEle(leavingEle);\n          }\n\n          var viewElements = navViewCtrl.getViewElements();\n          var viewElementsLength = viewElements.length;\n          var x, viewElement;\n          var removeOldestAccess = (viewElementsLength - 1) > $ionicConfig.views.maxCache();\n          var removableEle;\n          var oldestAccess = Date.now();\n\n          for (x = 0; x < viewElementsLength; x++) {\n            viewElement = viewElements.eq(x);\n\n            if (removeOldestAccess && viewElement.data(DATA_VIEW_ACCESSED) < oldestAccess) {\n              // remember what was the oldest element to be accessed so it can be destroyed\n              oldestAccess = viewElement.data(DATA_VIEW_ACCESSED);\n              removableEle = viewElements.eq(x);\n\n            } else if (viewElement.data(DATA_DESTROY_ELE) && navViewAttr(viewElement) != VIEW_STATUS_ACTIVE) {\n              destroyViewEle(viewElement);\n            }\n          }\n\n          destroyViewEle(removableEle);\n\n          if (enteringEle.data(DATA_NO_CACHE)) {\n            enteringEle.data(DATA_DESTROY_ELE, true);\n          }\n        },\n\n        enteringEle: function() { return enteringEle; },\n        leavingEle: function() { return leavingEle; }\n\n      };\n\n      return switcher;\n    },\n\n    transitionEnd: function(navViewCtrls) {\n      forEach(navViewCtrls, function(navViewCtrl) {\n        navViewCtrl.transitionEnd();\n      });\n\n      ionicViewSwitcher.isTransitioning(false);\n      $ionicClickBlock.hide();\n      transitionPromises = [];\n    },\n\n    nextTransition: function(val) {\n      nextTransition = val;\n    },\n\n    nextDirection: function(val) {\n      nextDirection = val;\n    },\n\n    isTransitioning: function(val) {\n      if (arguments.length) {\n        ionic.transition.isActive = !!val;\n        $timeout.cancel(isActiveTimer);\n        if (val) {\n          isActiveTimer = $timeout(function() {\n            ionicViewSwitcher.isTransitioning(false);\n          }, 999);\n        }\n      }\n      return ionic.transition.isActive;\n    },\n\n    createViewEle: function(viewLocals) {\n      var containerEle = $document[0].createElement('div');\n      if (viewLocals && viewLocals.$template) {\n        containerEle.innerHTML = viewLocals.$template;\n        if (containerEle.children.length === 1) {\n          containerEle.children[0].classList.add('pane');\n          return jqLite(containerEle.children[0]);\n        }\n      }\n      containerEle.className = \"pane\";\n      return jqLite(containerEle);\n    },\n\n    viewEleIsActive: function(viewEle, isActiveAttr) {\n      navViewAttr(viewEle, isActiveAttr ? VIEW_STATUS_ACTIVE : VIEW_STATUS_CACHED);\n    },\n\n    getTransitionData: getTransitionData,\n    navViewAttr: navViewAttr,\n    destroyViewEle: destroyViewEle\n\n  };\n\n  return ionicViewSwitcher;\n\n\n  function getViewElementIdentifier(locals, view) {\n    if (viewState(locals)['abstract']) return viewState(locals).name;\n    if (view) return view.stateId || view.viewId;\n    return ionic.Utils.nextUid();\n  }\n\n  function viewState(locals) {\n    return locals && locals.$$state && locals.$$state.self || {};\n  }\n\n  function getTransitionData(viewLocals, enteringEle, direction, view) {\n    // Priority\n    // 1) attribute directive on the button/link to this view\n    // 2) entering element's attribute\n    // 3) entering view's $state config property\n    // 4) view registration data\n    // 5) global config\n    // 6) fallback value\n\n    var state = viewState(viewLocals);\n    var viewTransition = nextTransition || cachedAttr(enteringEle, 'view-transition') || state.viewTransition || $ionicConfig.views.transition() || 'ios';\n    var navBarTransition = $ionicConfig.navBar.transition();\n    direction = nextDirection || cachedAttr(enteringEle, 'view-direction') || state.viewDirection || direction || 'none';\n\n    return extend(getViewData(view), {\n      transition: viewTransition,\n      navBarTransition: navBarTransition === 'view' ? viewTransition : navBarTransition,\n      direction: direction,\n      shouldAnimate: (viewTransition !== 'none' && direction !== 'none')\n    });\n  }\n\n  function getViewData(view) {\n    view = view || {};\n    return {\n      viewId: view.viewId,\n      historyId: view.historyId,\n      stateId: view.stateId,\n      stateName: view.stateName,\n      stateParams: view.stateParams\n    };\n  }\n\n  function navViewAttr(ele, value) {\n    if (arguments.length > 1) {\n      cachedAttr(ele, NAV_VIEW_ATTR, value);\n    } else {\n      return cachedAttr(ele, NAV_VIEW_ATTR);\n    }\n  }\n\n  function destroyViewEle(ele) {\n    // we found an element that should be removed\n    // destroy its scope, then remove the element\n    if (ele && ele.length) {\n      var viewScope = ele.scope();\n      if (viewScope) {\n        viewScope.$emit('$ionicView.unloaded', ele.data(DATA_VIEW));\n        viewScope.$destroy();\n      }\n      ele.remove();\n    }\n  }\n\n}]);\n\n/**\n * @private\n * Parts of Ionic requires that $scope data is attached to the element.\n * We do not want to disable adding $scope data to the $element when\n * $compileProvider.debugInfoEnabled(false) is used.\n */\nIonicModule.config(['$provide', function($provide) {\n  $provide.decorator('$compile', ['$delegate', function($compile) {\n     $compile.$$addScopeInfo = function $$addScopeInfo($element, scope, isolated, noTemplate) {\n       var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n       $element.data(dataName, scope);\n     };\n     return $compile;\n  }]);\n}]);\n\n/**\n * @private\n */\nIonicModule.config([\n  '$provide',\nfunction($provide) {\n  function $LocationDecorator($location, $timeout) {\n\n    $location.__hash = $location.hash;\n    //Fix: when window.location.hash is set, the scrollable area\n    //found nearest to body's scrollTop is set to scroll to an element\n    //with that ID.\n    $location.hash = function(value) {\n      if (isDefined(value)) {\n        $timeout(function() {\n          var scroll = document.querySelector('.scroll-content');\n          if (scroll) {\n            scroll.scrollTop = 0;\n          }\n        }, 0, false);\n      }\n      return $location.__hash(value);\n    };\n\n    return $location;\n  }\n\n  $provide.decorator('$location', ['$delegate', '$timeout', $LocationDecorator]);\n}]);\n\nIonicModule\n\n.controller('$ionicHeaderBar', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$q',\n  '$ionicConfig',\n  '$ionicHistory',\nfunction($scope, $element, $attrs, $q, $ionicConfig, $ionicHistory) {\n  var TITLE = 'title';\n  var BACK_TEXT = 'back-text';\n  var BACK_BUTTON = 'back-button';\n  var DEFAULT_TITLE = 'default-title';\n  var PREVIOUS_TITLE = 'previous-title';\n  var HIDE = 'hide';\n\n  var self = this;\n  var titleText = '';\n  var previousTitleText = '';\n  var titleLeft = 0;\n  var titleRight = 0;\n  var titleCss = '';\n  var isBackEnabled = false;\n  var isBackShown = true;\n  var isNavBackShown = true;\n  var isBackElementShown = false;\n  var titleTextWidth = 0;\n\n\n  self.beforeEnter = function(viewData) {\n    $scope.$broadcast('$ionicView.beforeEnter', viewData);\n  };\n\n\n  self.title = function(newTitleText) {\n    if (arguments.length && newTitleText !== titleText) {\n      getEle(TITLE).innerHTML = newTitleText;\n      titleText = newTitleText;\n      titleTextWidth = 0;\n    }\n    return titleText;\n  };\n\n\n  self.enableBack = function(shouldEnable, disableReset) {\n    // whether or not the back button show be visible, according\n    // to the navigation and history\n    if (arguments.length) {\n      isBackEnabled = shouldEnable;\n      if (!disableReset) self.updateBackButton();\n    }\n    return isBackEnabled;\n  };\n\n\n  self.showBack = function(shouldShow, disableReset) {\n    // different from enableBack() because this will always have the back\n    // visually hidden if false, even if the history says it should show\n    if (arguments.length) {\n      isBackShown = shouldShow;\n      if (!disableReset) self.updateBackButton();\n    }\n    return isBackShown;\n  };\n\n\n  self.showNavBack = function(shouldShow) {\n    // different from showBack() because this is for the entire nav bar's\n    // setting for all of it's child headers. For internal use.\n    isNavBackShown = shouldShow;\n    self.updateBackButton();\n  };\n\n\n  self.updateBackButton = function() {\n    var ele;\n    if ((isBackShown && isNavBackShown && isBackEnabled) !== isBackElementShown) {\n      isBackElementShown = isBackShown && isNavBackShown && isBackEnabled;\n      ele = getEle(BACK_BUTTON);\n      ele && ele.classList[ isBackElementShown ? 'remove' : 'add' ](HIDE);\n    }\n\n    if (isBackEnabled) {\n      ele = ele || getEle(BACK_BUTTON);\n      if (ele) {\n        if (self.backButtonIcon !== $ionicConfig.backButton.icon()) {\n          ele = getEle(BACK_BUTTON + ' .icon');\n          if (ele) {\n            self.backButtonIcon = $ionicConfig.backButton.icon();\n            ele.className = 'icon ' + self.backButtonIcon;\n          }\n        }\n\n        if (self.backButtonText !== $ionicConfig.backButton.text()) {\n          ele = getEle(BACK_BUTTON + ' .back-text');\n          if (ele) {\n            ele.textContent = self.backButtonText = $ionicConfig.backButton.text();\n          }\n        }\n      }\n    }\n  };\n\n\n  self.titleTextWidth = function() {\n    if (!titleTextWidth) {\n      var bounds = ionic.DomUtil.getTextBounds(getEle(TITLE));\n      titleTextWidth = Math.min(bounds && bounds.width || 30);\n    }\n    return titleTextWidth;\n  };\n\n\n  self.titleWidth = function() {\n    var titleWidth = self.titleTextWidth();\n    var offsetWidth = getEle(TITLE).offsetWidth;\n    if (offsetWidth < titleWidth) {\n      titleWidth = offsetWidth + (titleLeft - titleRight - 5);\n    }\n    return titleWidth;\n  };\n\n\n  self.titleTextX = function() {\n    return ($element[0].offsetWidth / 2) - (self.titleWidth() / 2);\n  };\n\n\n  self.titleLeftRight = function() {\n    return titleLeft - titleRight;\n  };\n\n\n  self.backButtonTextLeft = function() {\n    var offsetLeft = 0;\n    var ele = getEle(BACK_TEXT);\n    while (ele) {\n      offsetLeft += ele.offsetLeft;\n      ele = ele.parentElement;\n    }\n    return offsetLeft;\n  };\n\n\n  self.resetBackButton = function(viewData) {\n    if ($ionicConfig.backButton.previousTitleText()) {\n      var previousTitleEle = getEle(PREVIOUS_TITLE);\n      if (previousTitleEle) {\n        previousTitleEle.classList.remove(HIDE);\n\n        var view = (viewData && $ionicHistory.getViewById(viewData.viewId));\n        var newPreviousTitleText = $ionicHistory.backTitle(view);\n\n        if (newPreviousTitleText !== previousTitleText) {\n          previousTitleText = previousTitleEle.innerHTML = newPreviousTitleText;\n        }\n      }\n      var defaultTitleEle = getEle(DEFAULT_TITLE);\n      if (defaultTitleEle) {\n        defaultTitleEle.classList.remove(HIDE);\n      }\n    }\n  };\n\n\n  self.align = function(textAlign) {\n    var titleEle = getEle(TITLE);\n\n    textAlign = textAlign || $attrs.alignTitle || $ionicConfig.navBar.alignTitle();\n\n    var widths = self.calcWidths(textAlign, false);\n\n    if (isBackShown && previousTitleText && $ionicConfig.backButton.previousTitleText()) {\n      var previousTitleWidths = self.calcWidths(textAlign, true);\n\n      var availableTitleWidth = $element[0].offsetWidth - previousTitleWidths.titleLeft - previousTitleWidths.titleRight;\n\n      if (self.titleTextWidth() <= availableTitleWidth) {\n        widths = previousTitleWidths;\n      }\n    }\n\n    return self.updatePositions(titleEle, widths.titleLeft, widths.titleRight, widths.buttonsLeft, widths.buttonsRight, widths.css, widths.showPrevTitle);\n  };\n\n\n  self.calcWidths = function(textAlign, isPreviousTitle) {\n    var titleEle = getEle(TITLE);\n    var backBtnEle = getEle(BACK_BUTTON);\n    var x, y, z, b, c, d, childSize, bounds;\n    var childNodes = $element[0].childNodes;\n    var buttonsLeft = 0;\n    var buttonsRight = 0;\n    var isCountRightOfTitle;\n    var updateTitleLeft = 0;\n    var updateTitleRight = 0;\n    var updateCss = '';\n    var backButtonWidth = 0;\n\n    // Compute how wide the left children are\n    // Skip all titles (there may still be two titles, one leaving the dom)\n    // Once we encounter a titleEle, realize we are now counting the right-buttons, not left\n    for (x = 0; x < childNodes.length; x++) {\n      c = childNodes[x];\n\n      childSize = 0;\n      if (c.nodeType == 1) {\n        // element node\n        if (c === titleEle) {\n          isCountRightOfTitle = true;\n          continue;\n        }\n\n        if (c.classList.contains(HIDE)) {\n          continue;\n        }\n\n        if (isBackShown && c === backBtnEle) {\n\n          for (y = 0; y < c.childNodes.length; y++) {\n            b = c.childNodes[y];\n\n            if (b.nodeType == 1) {\n\n              if (b.classList.contains(BACK_TEXT)) {\n                for (z = 0; z < b.children.length; z++) {\n                  d = b.children[z];\n\n                  if (isPreviousTitle) {\n                    if (d.classList.contains(DEFAULT_TITLE)) continue;\n                    backButtonWidth += d.offsetWidth;\n                  } else {\n                    if (d.classList.contains(PREVIOUS_TITLE)) continue;\n                    backButtonWidth += d.offsetWidth;\n                  }\n                }\n\n              } else {\n                backButtonWidth += b.offsetWidth;\n              }\n\n            } else if (b.nodeType == 3 && b.nodeValue.trim()) {\n              bounds = ionic.DomUtil.getTextBounds(b);\n              backButtonWidth += bounds && bounds.width || 0;\n            }\n\n          }\n          childSize = backButtonWidth || c.offsetWidth;\n\n        } else {\n          // not the title, not the back button, not a hidden element\n          childSize = c.offsetWidth;\n        }\n\n      } else if (c.nodeType == 3 && c.nodeValue.trim()) {\n        // text node\n        bounds = ionic.DomUtil.getTextBounds(c);\n        childSize = bounds && bounds.width || 0;\n      }\n\n      if (isCountRightOfTitle) {\n        buttonsRight += childSize;\n      } else {\n        buttonsLeft += childSize;\n      }\n    }\n\n    // Size and align the header titleEle based on the sizes of the left and\n    // right children, and the desired alignment mode\n    if (textAlign == 'left') {\n      updateCss = 'title-left';\n      if (buttonsLeft) {\n        updateTitleLeft = buttonsLeft + 15;\n      }\n      if (buttonsRight) {\n        updateTitleRight = buttonsRight + 15;\n      }\n\n    } else if (textAlign == 'right') {\n      updateCss = 'title-right';\n      if (buttonsLeft) {\n        updateTitleLeft = buttonsLeft + 15;\n      }\n      if (buttonsRight) {\n        updateTitleRight = buttonsRight + 15;\n      }\n\n    } else {\n      // center the default\n      var margin = Math.max(buttonsLeft, buttonsRight) + 10;\n      if (margin > 10) {\n        updateTitleLeft = updateTitleRight = margin;\n      }\n    }\n\n    return {\n      backButtonWidth: backButtonWidth,\n      buttonsLeft: buttonsLeft,\n      buttonsRight: buttonsRight,\n      titleLeft: updateTitleLeft,\n      titleRight: updateTitleRight,\n      showPrevTitle: isPreviousTitle,\n      css: updateCss\n    };\n  };\n\n\n  self.updatePositions = function(titleEle, updateTitleLeft, updateTitleRight, buttonsLeft, buttonsRight, updateCss, showPreviousTitle) {\n    var deferred = $q.defer();\n\n    // only make DOM updates when there are actual changes\n    if (titleEle) {\n      if (updateTitleLeft !== titleLeft) {\n        titleEle.style.left = updateTitleLeft ? updateTitleLeft + 'px' : '';\n        titleLeft = updateTitleLeft;\n      }\n      if (updateTitleRight !== titleRight) {\n        titleEle.style.right = updateTitleRight ? updateTitleRight + 'px' : '';\n        titleRight = updateTitleRight;\n      }\n\n      if (updateCss !== titleCss) {\n        updateCss && titleEle.classList.add(updateCss);\n        titleCss && titleEle.classList.remove(titleCss);\n        titleCss = updateCss;\n      }\n    }\n\n    if ($ionicConfig.backButton.previousTitleText()) {\n      var prevTitle = getEle(PREVIOUS_TITLE);\n      var defaultTitle = getEle(DEFAULT_TITLE);\n\n      prevTitle && prevTitle.classList[ showPreviousTitle ? 'remove' : 'add'](HIDE);\n      defaultTitle && defaultTitle.classList[ showPreviousTitle ? 'add' : 'remove'](HIDE);\n    }\n\n    ionic.requestAnimationFrame(function() {\n      if (titleEle && titleEle.offsetWidth + 10 < titleEle.scrollWidth) {\n        var minRight = buttonsRight + 5;\n        var testRight = $element[0].offsetWidth - titleLeft - self.titleTextWidth() - 20;\n        updateTitleRight = testRight < minRight ? minRight : testRight;\n        if (updateTitleRight !== titleRight) {\n          titleEle.style.right = updateTitleRight + 'px';\n          titleRight = updateTitleRight;\n        }\n      }\n      deferred.resolve();\n    });\n\n    return deferred.promise;\n  };\n\n\n  self.setCss = function(elementClassname, css) {\n    ionic.DomUtil.cachedStyles(getEle(elementClassname), css);\n  };\n\n\n  var eleCache = {};\n  function getEle(className) {\n    if (!eleCache[className]) {\n      eleCache[className] = $element[0].querySelector('.' + className);\n    }\n    return eleCache[className];\n  }\n\n\n  $scope.$on('$destroy', function() {\n    for (var n in eleCache) eleCache[n] = null;\n  });\n\n}]);\n\nIonicModule\n.controller('$ionInfiniteScroll', [\n  '$scope',\n  '$attrs',\n  '$element',\n  '$timeout',\nfunction($scope, $attrs, $element, $timeout) {\n  var self = this;\n  self.isLoading = false;\n\n  $scope.icon = function() {\n    return isDefined($attrs.icon) ? $attrs.icon : 'ion-load-d';\n  };\n\n  $scope.spinner = function() {\n    return isDefined($attrs.spinner) ? $attrs.spinner : '';\n  };\n\n  $scope.$on('scroll.infiniteScrollComplete', function() {\n    finishInfiniteScroll();\n  });\n\n  $scope.$on('$destroy', function() {\n    if (self.scrollCtrl && self.scrollCtrl.$element) self.scrollCtrl.$element.off('scroll', self.checkBounds);\n    if (self.scrollEl && self.scrollEl.removeEventListener) {\n      self.scrollEl.removeEventListener('scroll', self.checkBounds);\n    }\n  });\n\n  // debounce checking infinite scroll events\n  self.checkBounds = ionic.Utils.throttle(checkInfiniteBounds, 300);\n\n  function onInfinite() {\n    ionic.requestAnimationFrame(function() {\n      $element[0].classList.add('active');\n    });\n    self.isLoading = true;\n    $scope.$parent && $scope.$parent.$apply($attrs.onInfinite || '');\n  }\n\n  function finishInfiniteScroll() {\n    ionic.requestAnimationFrame(function() {\n      $element[0].classList.remove('active');\n    });\n    $timeout(function() {\n      if (self.jsScrolling) self.scrollView.resize();\n      // only check bounds again immediately if the page isn't cached (scroll el has height)\n      if ((self.jsScrolling && self.scrollView.__container && self.scrollView.__container.offsetHeight > 0) ||\n      !self.jsScrolling) {\n        self.checkBounds();\n      }\n    }, 30, false);\n    self.isLoading = false;\n  }\n\n  // check if we've scrolled far enough to trigger an infinite scroll\n  function checkInfiniteBounds() {\n    if (self.isLoading) return;\n    var maxScroll = {};\n\n    if (self.jsScrolling) {\n      maxScroll = self.getJSMaxScroll();\n      var scrollValues = self.scrollView.getValues();\n      if ((maxScroll.left !== -1 && scrollValues.left >= maxScroll.left) ||\n        (maxScroll.top !== -1 && scrollValues.top >= maxScroll.top)) {\n        onInfinite();\n      }\n    } else {\n      maxScroll = self.getNativeMaxScroll();\n      if ((\n        maxScroll.left !== -1 &&\n        self.scrollEl.scrollLeft >= maxScroll.left - self.scrollEl.clientWidth\n        ) || (\n        maxScroll.top !== -1 &&\n        self.scrollEl.scrollTop >= maxScroll.top - self.scrollEl.clientHeight\n        )) {\n        onInfinite();\n      }\n    }\n  }\n\n  // determine the threshold at which we should fire an infinite scroll\n  // note: this gets processed every scroll event, can it be cached?\n  self.getJSMaxScroll = function() {\n    var maxValues = self.scrollView.getScrollMax();\n    return {\n      left: self.scrollView.options.scrollingX ?\n        calculateMaxValue(maxValues.left) :\n        -1,\n      top: self.scrollView.options.scrollingY ?\n        calculateMaxValue(maxValues.top) :\n        -1\n    };\n  };\n\n  self.getNativeMaxScroll = function() {\n    var maxValues = {\n      left: self.scrollEl.scrollWidth,\n      top: self.scrollEl.scrollHeight\n    };\n    var computedStyle = window.getComputedStyle(self.scrollEl) || {};\n    return {\n      left: computedStyle.overflowX === 'scroll' ||\n      computedStyle.overflowX === 'auto' ||\n      self.scrollEl.style['overflow-x'] === 'scroll' ?\n        calculateMaxValue(maxValues.left) : -1,\n      top: computedStyle.overflowY === 'scroll' ||\n      computedStyle.overflowY === 'auto' ||\n      self.scrollEl.style['overflow-y'] === 'scroll' ?\n        calculateMaxValue(maxValues.top) : -1\n    };\n  };\n\n  // determine pixel refresh distance based on % or value\n  function calculateMaxValue(maximum) {\n    var distance = ($attrs.distance || '2.5%').trim();\n    var isPercent = distance.indexOf('%') !== -1;\n    return isPercent ?\n    maximum * (1 - parseFloat(distance) / 100) :\n    maximum - parseFloat(distance);\n  }\n\n  //for testing\n  self.__finishInfiniteScroll = finishInfiniteScroll;\n\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicListDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionList} directive.\n *\n * Methods called directly on the $ionicListDelegate service will control all lists.\n * Use the {@link ionic.service:$ionicListDelegate#$getByHandle $getByHandle}\n * method to control specific ionList instances.\n *\n * @usage\n *\n * ````html\n * <ion-content ng-controller=\"MyCtrl\">\n *   <button class=\"button\" ng-click=\"showDeleteButtons()\"></button>\n *   <ion-list>\n *     <ion-item ng-repeat=\"i in items\">\n *       {% raw %}Hello, {{i}}!{% endraw %}\n *       <ion-delete-button class=\"ion-minus-circled\"></ion-delete-button>\n *     </ion-item>\n *   </ion-list>\n * </ion-content>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicListDelegate) {\n *   $scope.showDeleteButtons = function() {\n *     $ionicListDelegate.showDelete(true);\n *   };\n * }\n * ```\n */\nIonicModule.service('$ionicListDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#showReorder\n   * @param {boolean=} showReorder Set whether or not this list is showing its reorder buttons.\n   * @returns {boolean} Whether the reorder buttons are shown.\n   */\n  'showReorder',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#showDelete\n   * @param {boolean=} showDelete Set whether or not this list is showing its delete buttons.\n   * @returns {boolean} Whether the delete buttons are shown.\n   */\n  'showDelete',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#canSwipeItems\n   * @param {boolean=} canSwipeItems Set whether or not this list is able to swipe to show\n   * option buttons.\n   * @returns {boolean} Whether the list is able to swipe to show option buttons.\n   */\n  'canSwipeItems',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#closeOptionButtons\n   * @description Closes any option buttons on the list that are swiped open.\n   */\n  'closeOptionButtons'\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionList} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicListDelegate.$getByHandle('my-handle').showReorder(true);`\n   */\n]))\n\n.controller('$ionicList', [\n  '$scope',\n  '$attrs',\n  '$ionicListDelegate',\n  '$ionicHistory',\nfunction($scope, $attrs, $ionicListDelegate, $ionicHistory) {\n  var self = this;\n  var isSwipeable = true;\n  var isReorderShown = false;\n  var isDeleteShown = false;\n\n  var deregisterInstance = $ionicListDelegate._registerInstance(\n    self, $attrs.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n  $scope.$on('$destroy', deregisterInstance);\n\n  self.showReorder = function(show) {\n    if (arguments.length) {\n      isReorderShown = !!show;\n    }\n    return isReorderShown;\n  };\n\n  self.showDelete = function(show) {\n    if (arguments.length) {\n      isDeleteShown = !!show;\n    }\n    return isDeleteShown;\n  };\n\n  self.canSwipeItems = function(can) {\n    if (arguments.length) {\n      isSwipeable = !!can;\n    }\n    return isSwipeable;\n  };\n\n  self.closeOptionButtons = function() {\n    self.listView && self.listView.clearDragEffects();\n  };\n}]);\n\nIonicModule\n\n.controller('$ionicNavBar', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$timeout',\n  '$ionicNavBarDelegate',\n  '$ionicConfig',\n  '$ionicHistory',\nfunction($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $ionicConfig, $ionicHistory) {\n\n  var CSS_HIDE = 'hide';\n  var DATA_NAV_BAR_CTRL = '$ionNavBarController';\n  var PRIMARY_BUTTONS = 'primaryButtons';\n  var SECONDARY_BUTTONS = 'secondaryButtons';\n  var BACK_BUTTON = 'backButton';\n  var ITEM_TYPES = 'primaryButtons secondaryButtons leftButtons rightButtons title'.split(' ');\n\n  var self = this;\n  var headerBars = [];\n  var navElementHtml = {};\n  var isVisible = true;\n  var queuedTransitionStart, queuedTransitionEnd, latestTransitionId;\n\n  $element.parent().data(DATA_NAV_BAR_CTRL, self);\n\n  var delegateHandle = $attrs.delegateHandle || 'navBar' + ionic.Utils.nextUid();\n\n  var deregisterInstance = $ionicNavBarDelegate._registerInstance(self, delegateHandle);\n\n\n  self.init = function() {\n    $element.addClass('nav-bar-container');\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-transition', $ionicConfig.views.transition());\n\n    // create two nav bar blocks which will trade out which one is shown\n    self.createHeaderBar(false);\n    self.createHeaderBar(true);\n\n    $scope.$emit('ionNavBar.init', delegateHandle);\n  };\n\n\n  self.createHeaderBar = function(isActive) {\n    var containerEle = jqLite('<div class=\"nav-bar-block\">');\n    ionic.DomUtil.cachedAttr(containerEle, 'nav-bar', isActive ? 'active' : 'cached');\n\n    var alignTitle = $attrs.alignTitle || $ionicConfig.navBar.alignTitle();\n    var headerBarEle = jqLite('<ion-header-bar>').addClass($attrs['class']).attr('align-title', alignTitle);\n    if (isDefined($attrs.noTapScroll)) headerBarEle.attr('no-tap-scroll', $attrs.noTapScroll);\n    var titleEle = jqLite('<div class=\"title title-' + alignTitle + '\">');\n    var navEle = {};\n    var lastViewItemEle = {};\n    var leftButtonsEle, rightButtonsEle;\n\n    navEle[BACK_BUTTON] = createNavElement(BACK_BUTTON);\n    navEle[BACK_BUTTON] && headerBarEle.append(navEle[BACK_BUTTON]);\n\n    // append title in the header, this is the rock to where buttons append\n    headerBarEle.append(titleEle);\n\n    forEach(ITEM_TYPES, function(itemType) {\n      // create default button elements\n      navEle[itemType] = createNavElement(itemType);\n      // append and position buttons\n      positionItem(navEle[itemType], itemType);\n    });\n\n    // add header-item to the root children\n    for (var x = 0; x < headerBarEle[0].children.length; x++) {\n      headerBarEle[0].children[x].classList.add('header-item');\n    }\n\n    // compile header and append to the DOM\n    containerEle.append(headerBarEle);\n    $element.append($compile(containerEle)($scope.$new()));\n\n    var headerBarCtrl = headerBarEle.data('$ionHeaderBarController');\n    headerBarCtrl.backButtonIcon = $ionicConfig.backButton.icon();\n    headerBarCtrl.backButtonText = $ionicConfig.backButton.text();\n\n    var headerBarInstance = {\n      isActive: isActive,\n      title: function(newTitleText) {\n        headerBarCtrl.title(newTitleText);\n      },\n      setItem: function(navBarItemEle, itemType) {\n        // first make sure any exiting nav bar item has been removed\n        headerBarInstance.removeItem(itemType);\n\n        if (navBarItemEle) {\n          if (itemType === 'title') {\n            // clear out the text based title\n            headerBarInstance.title(\"\");\n          }\n\n          // there's a custom nav bar item\n          positionItem(navBarItemEle, itemType);\n\n          if (navEle[itemType]) {\n            // make sure the default on this itemType is hidden\n            navEle[itemType].addClass(CSS_HIDE);\n          }\n          lastViewItemEle[itemType] = navBarItemEle;\n\n        } else if (navEle[itemType]) {\n          // there's a default button for this side and no view button\n          navEle[itemType].removeClass(CSS_HIDE);\n        }\n      },\n      removeItem: function(itemType) {\n        if (lastViewItemEle[itemType]) {\n          lastViewItemEle[itemType].scope().$destroy();\n          lastViewItemEle[itemType].remove();\n          lastViewItemEle[itemType] = null;\n        }\n      },\n      containerEle: function() {\n        return containerEle;\n      },\n      headerBarEle: function() {\n        return headerBarEle;\n      },\n      afterLeave: function() {\n        forEach(ITEM_TYPES, function(itemType) {\n          headerBarInstance.removeItem(itemType);\n        });\n        headerBarCtrl.resetBackButton();\n      },\n      controller: function() {\n        return headerBarCtrl;\n      },\n      destroy: function() {\n        forEach(ITEM_TYPES, function(itemType) {\n          headerBarInstance.removeItem(itemType);\n        });\n        containerEle.scope().$destroy();\n        for (var n in navEle) {\n          if (navEle[n]) {\n            navEle[n].removeData();\n            navEle[n] = null;\n          }\n        }\n        leftButtonsEle && leftButtonsEle.removeData();\n        rightButtonsEle && rightButtonsEle.removeData();\n        titleEle.removeData();\n        headerBarEle.removeData();\n        containerEle.remove();\n        containerEle = headerBarEle = titleEle = leftButtonsEle = rightButtonsEle = null;\n      }\n    };\n\n    function positionItem(ele, itemType) {\n      if (!ele) return;\n\n      if (itemType === 'title') {\n        // title element\n        titleEle.append(ele);\n\n      } else if (itemType == 'rightButtons' ||\n                (itemType == SECONDARY_BUTTONS && $ionicConfig.navBar.positionSecondaryButtons() != 'left') ||\n                (itemType == PRIMARY_BUTTONS && $ionicConfig.navBar.positionPrimaryButtons() == 'right')) {\n        // right side\n        if (!rightButtonsEle) {\n          rightButtonsEle = jqLite('<div class=\"buttons buttons-right\">');\n          headerBarEle.append(rightButtonsEle);\n        }\n        if (itemType == SECONDARY_BUTTONS) {\n          rightButtonsEle.append(ele);\n        } else {\n          rightButtonsEle.prepend(ele);\n        }\n\n      } else {\n        // left side\n        if (!leftButtonsEle) {\n          leftButtonsEle = jqLite('<div class=\"buttons buttons-left\">');\n          if (navEle[BACK_BUTTON]) {\n            navEle[BACK_BUTTON].after(leftButtonsEle);\n          } else {\n            headerBarEle.prepend(leftButtonsEle);\n          }\n        }\n        if (itemType == SECONDARY_BUTTONS) {\n          leftButtonsEle.append(ele);\n        } else {\n          leftButtonsEle.prepend(ele);\n        }\n      }\n\n    }\n\n    headerBars.push(headerBarInstance);\n\n    return headerBarInstance;\n  };\n\n\n  self.navElement = function(type, html) {\n    if (isDefined(html)) {\n      navElementHtml[type] = html;\n    }\n    return navElementHtml[type];\n  };\n\n\n  self.update = function(viewData) {\n    var showNavBar = !viewData.hasHeaderBar && viewData.showNavBar;\n    viewData.transition = $ionicConfig.views.transition();\n\n    if (!showNavBar) {\n      viewData.direction = 'none';\n    }\n\n    self.enable(showNavBar);\n    var enteringHeaderBar = self.isInitialized ? getOffScreenHeaderBar() : getOnScreenHeaderBar();\n    var leavingHeaderBar = self.isInitialized ? getOnScreenHeaderBar() : null;\n    var enteringHeaderCtrl = enteringHeaderBar.controller();\n\n    // update if the entering header should show the back button or not\n    enteringHeaderCtrl.enableBack(viewData.enableBack, true);\n    enteringHeaderCtrl.showBack(viewData.showBack, true);\n    enteringHeaderCtrl.updateBackButton();\n\n    // update the entering header bar's title\n    self.title(viewData.title, enteringHeaderBar);\n\n    self.showBar(showNavBar);\n\n    // update the nav bar items, depending if the view has their own or not\n    if (viewData.navBarItems) {\n      forEach(ITEM_TYPES, function(itemType) {\n        enteringHeaderBar.setItem(viewData.navBarItems[itemType], itemType);\n      });\n    }\n\n    // begin transition of entering and leaving header bars\n    self.transition(enteringHeaderBar, leavingHeaderBar, viewData);\n\n    self.isInitialized = true;\n    navSwipeAttr('');\n  };\n\n\n  self.transition = function(enteringHeaderBar, leavingHeaderBar, viewData) {\n    var enteringHeaderBarCtrl = enteringHeaderBar.controller();\n    var transitionFn = $ionicConfig.transitions.navBar[viewData.navBarTransition] || $ionicConfig.transitions.navBar.none;\n    var transitionId = viewData.transitionId;\n\n    enteringHeaderBarCtrl.beforeEnter(viewData);\n\n    var navBarTransition = transitionFn(enteringHeaderBar, leavingHeaderBar, viewData.direction, viewData.shouldAnimate && self.isInitialized);\n\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-transition', viewData.navBarTransition);\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-direction', viewData.direction);\n\n    if (navBarTransition.shouldAnimate && viewData.renderEnd) {\n      navBarAttr(enteringHeaderBar, 'stage');\n    } else {\n      navBarAttr(enteringHeaderBar, 'entering');\n      navBarAttr(leavingHeaderBar, 'leaving');\n    }\n\n    enteringHeaderBarCtrl.resetBackButton(viewData);\n\n    navBarTransition.run(0);\n\n    self.activeTransition = {\n      run: function(step) {\n        navBarTransition.shouldAnimate = false;\n        navBarTransition.direction = 'back';\n        navBarTransition.run(step);\n      },\n      cancel: function(shouldAnimate, speed, cancelData) {\n        navSwipeAttr(speed);\n        navBarAttr(leavingHeaderBar, 'active');\n        navBarAttr(enteringHeaderBar, 'cached');\n        navBarTransition.shouldAnimate = shouldAnimate;\n        navBarTransition.run(0);\n        self.activeTransition = navBarTransition = null;\n\n        var runApply;\n        if (cancelData.showBar !== self.showBar()) {\n          self.showBar(cancelData.showBar);\n        }\n        if (cancelData.showBackButton !== self.showBackButton()) {\n          self.showBackButton(cancelData.showBackButton);\n        }\n        if (runApply) {\n          $scope.$apply();\n        }\n      },\n      complete: function(shouldAnimate, speed) {\n        navSwipeAttr(speed);\n        navBarTransition.shouldAnimate = shouldAnimate;\n        navBarTransition.run(1);\n        queuedTransitionEnd = transitionEnd;\n      }\n    };\n\n    $timeout(enteringHeaderBarCtrl.align, 16);\n\n    queuedTransitionStart = function() {\n      if (latestTransitionId !== transitionId) return;\n\n      navBarAttr(enteringHeaderBar, 'entering');\n      navBarAttr(leavingHeaderBar, 'leaving');\n\n      navBarTransition.run(1);\n\n      queuedTransitionEnd = function() {\n        if (latestTransitionId == transitionId || !navBarTransition.shouldAnimate) {\n          transitionEnd();\n        }\n      };\n\n      queuedTransitionStart = null;\n    };\n\n    function transitionEnd() {\n      for (var x = 0; x < headerBars.length; x++) {\n        headerBars[x].isActive = false;\n      }\n      enteringHeaderBar.isActive = true;\n\n      navBarAttr(enteringHeaderBar, 'active');\n      navBarAttr(leavingHeaderBar, 'cached');\n\n      self.activeTransition = navBarTransition = queuedTransitionEnd = null;\n    }\n\n    queuedTransitionStart();\n  };\n\n\n  self.triggerTransitionStart = function(triggerTransitionId) {\n    latestTransitionId = triggerTransitionId;\n    queuedTransitionStart && queuedTransitionStart();\n  };\n\n\n  self.triggerTransitionEnd = function() {\n    queuedTransitionEnd && queuedTransitionEnd();\n  };\n\n\n  self.showBar = function(shouldShow) {\n    if (arguments.length) {\n      self.visibleBar(shouldShow);\n      $scope.$parent.$hasHeader = !!shouldShow;\n    }\n    return !!$scope.$parent.$hasHeader;\n  };\n\n\n  self.visibleBar = function(shouldShow) {\n    if (shouldShow && !isVisible) {\n      $element.removeClass(CSS_HIDE);\n      self.align();\n    } else if (!shouldShow && isVisible) {\n      $element.addClass(CSS_HIDE);\n    }\n    isVisible = shouldShow;\n  };\n\n\n  self.enable = function(val) {\n    // set primary to show first\n    self.visibleBar(val);\n\n    // set non primary to hide second\n    for (var x = 0; x < $ionicNavBarDelegate._instances.length; x++) {\n      if ($ionicNavBarDelegate._instances[x] !== self) $ionicNavBarDelegate._instances[x].visibleBar(false);\n    }\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavBar#showBackButton\n   * @description Show/hide the nav bar back button when there is a\n   * back view. If the back button is not possible, for example, the\n   * first view in the stack, then this will not force the back button\n   * to show.\n   */\n  self.showBackButton = function(shouldShow) {\n    if (arguments.length) {\n      for (var x = 0; x < headerBars.length; x++) {\n        headerBars[x].controller().showNavBack(!!shouldShow);\n      }\n      $scope.$isBackButtonShown = !!shouldShow;\n    }\n    return $scope.$isBackButtonShown;\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavBar#showActiveBackButton\n   * @description Show/hide only the active header bar's back button.\n   */\n  self.showActiveBackButton = function(shouldShow) {\n    var headerBar = getOnScreenHeaderBar();\n    if (headerBar) {\n      if (arguments.length) {\n        return headerBar.controller().showBack(shouldShow);\n      }\n      return headerBar.controller().showBack();\n    }\n  };\n\n\n  self.title = function(newTitleText, headerBar) {\n    if (isDefined(newTitleText)) {\n      newTitleText = newTitleText || '';\n      headerBar = headerBar || getOnScreenHeaderBar();\n      headerBar && headerBar.title(newTitleText);\n      $scope.$title = newTitleText;\n      $ionicHistory.currentTitle(newTitleText);\n    }\n    return $scope.$title;\n  };\n\n\n  self.align = function(val, headerBar) {\n    headerBar = headerBar || getOnScreenHeaderBar();\n    headerBar && headerBar.controller().align(val);\n  };\n\n\n  self.hasTabsTop = function(isTabsTop) {\n    $element[isTabsTop ? 'addClass' : 'removeClass']('nav-bar-tabs-top');\n  };\n\n  self.hasBarSubheader = function(isBarSubheader) {\n    $element[isBarSubheader ? 'addClass' : 'removeClass']('nav-bar-has-subheader');\n  };\n\n  // DEPRECATED, as of v1.0.0-beta14 -------\n  self.changeTitle = function(val) {\n    deprecatedWarning('changeTitle(val)', 'title(val)');\n    self.title(val);\n  };\n  self.setTitle = function(val) {\n    deprecatedWarning('setTitle(val)', 'title(val)');\n    self.title(val);\n  };\n  self.getTitle = function() {\n    deprecatedWarning('getTitle()', 'title()');\n    return self.title();\n  };\n  self.back = function() {\n    deprecatedWarning('back()', '$ionicHistory.goBack()');\n    $ionicHistory.goBack();\n  };\n  self.getPreviousTitle = function() {\n    deprecatedWarning('getPreviousTitle()', '$ionicHistory.backTitle()');\n    $ionicHistory.goBack();\n  };\n  function deprecatedWarning(oldMethod, newMethod) {\n    var warn = console.warn || console.log;\n    warn && warn.call(console, 'navBarController.' + oldMethod + ' is deprecated, please use ' + newMethod + ' instead');\n  }\n  // END DEPRECATED -------\n\n\n  function createNavElement(type) {\n    if (navElementHtml[type]) {\n      return jqLite(navElementHtml[type]);\n    }\n  }\n\n\n  function getOnScreenHeaderBar() {\n    for (var x = 0; x < headerBars.length; x++) {\n      if (headerBars[x].isActive) return headerBars[x];\n    }\n  }\n\n\n  function getOffScreenHeaderBar() {\n    for (var x = 0; x < headerBars.length; x++) {\n      if (!headerBars[x].isActive) return headerBars[x];\n    }\n  }\n\n\n  function navBarAttr(ctrl, val) {\n    ctrl && ionic.DomUtil.cachedAttr(ctrl.containerEle(), 'nav-bar', val);\n  }\n\n  function navSwipeAttr(val) {\n    ionic.DomUtil.cachedAttr($element, 'nav-swipe', val);\n  }\n\n\n  $scope.$on('$destroy', function() {\n    $scope.$parent.$hasHeader = false;\n    $element.parent().removeData(DATA_NAV_BAR_CTRL);\n    for (var x = 0; x < headerBars.length; x++) {\n      headerBars[x].destroy();\n    }\n    $element.remove();\n    $element = headerBars = null;\n    deregisterInstance();\n  });\n\n}]);\n\nIonicModule\n.controller('$ionicNavView', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$controller',\n  '$ionicNavBarDelegate',\n  '$ionicNavViewDelegate',\n  '$ionicHistory',\n  '$ionicViewSwitcher',\n  '$ionicConfig',\n  '$ionicScrollDelegate',\nfunction($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate, $ionicNavViewDelegate, $ionicHistory, $ionicViewSwitcher, $ionicConfig, $ionicScrollDelegate) {\n\n  var DATA_ELE_IDENTIFIER = '$eleId';\n  var DATA_DESTROY_ELE = '$destroyEle';\n  var DATA_NO_CACHE = '$noCache';\n  var VIEW_STATUS_ACTIVE = 'active';\n  var VIEW_STATUS_CACHED = 'cached';\n\n  var self = this;\n  var direction;\n  var isPrimary = false;\n  var navBarDelegate;\n  var activeEleId;\n  var navViewAttr = $ionicViewSwitcher.navViewAttr;\n  var disableRenderStartViewId, disableAnimation;\n\n  self.scope = $scope;\n  self.element = $element;\n\n  self.init = function() {\n    var navViewName = $attrs.name || '';\n\n    // Find the details of the parent view directive (if any) and use it\n    // to derive our own qualified view name, then hang our own details\n    // off the DOM so child directives can find it.\n    var parent = $element.parent().inheritedData('$uiView');\n    var parentViewName = ((parent && parent.state) ? parent.state.name : '');\n    if (navViewName.indexOf('@') < 0) navViewName = navViewName + '@' + parentViewName;\n\n    var viewData = { name: navViewName, state: null };\n    $element.data('$uiView', viewData);\n\n    var deregisterInstance = $ionicNavViewDelegate._registerInstance(self, $attrs.delegateHandle);\n    $scope.$on('$destroy', function() {\n      deregisterInstance();\n\n      // ensure no scrolls have been left frozen\n      if (self.isSwipeFreeze) {\n        $ionicScrollDelegate.freezeAllScrolls(false);\n      }\n    });\n\n    $scope.$on('$ionicHistory.deselect', self.cacheCleanup);\n    $scope.$on('$ionicTabs.top', onTabsTop);\n    $scope.$on('$ionicSubheader', onBarSubheader);\n\n    $scope.$on('$ionicTabs.beforeLeave', onTabsLeave);\n    $scope.$on('$ionicTabs.afterLeave', onTabsLeave);\n    $scope.$on('$ionicTabs.leave', onTabsLeave);\n\n    ionic.Platform.ready(function() {\n      if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) {\n        self.initSwipeBack();\n      }\n    });\n\n    return viewData;\n  };\n\n\n  self.register = function(viewLocals) {\n    var leavingView = extend({}, $ionicHistory.currentView());\n\n    // register that a view is coming in and get info on how it should transition\n    var registerData = $ionicHistory.register($scope, viewLocals);\n\n    // update which direction\n    self.update(registerData);\n\n    // begin rendering and transitioning\n    var enteringView = $ionicHistory.getViewById(registerData.viewId) || {};\n\n    var renderStart = (disableRenderStartViewId !== registerData.viewId);\n    self.render(registerData, viewLocals, enteringView, leavingView, renderStart, true);\n  };\n\n\n  self.update = function(registerData) {\n    // always reset that this is the primary navView\n    isPrimary = true;\n\n    // remember what direction this navView should use\n    // this may get updated later by a child navView\n    direction = registerData.direction;\n\n    var parentNavViewCtrl = $element.parent().inheritedData('$ionNavViewController');\n    if (parentNavViewCtrl) {\n      // this navView is nested inside another one\n      // update the parent to use this direction and not\n      // the other it originally was set to\n\n      // inform the parent navView that it is not the primary navView\n      parentNavViewCtrl.isPrimary(false);\n\n      if (direction === 'enter' || direction === 'exit') {\n        // they're entering/exiting a history\n        // find parent navViewController\n        parentNavViewCtrl.direction(direction);\n\n        if (direction === 'enter') {\n          // reset the direction so this navView doesn't animate\n          // because it's parent will\n          direction = 'none';\n        }\n      }\n    }\n  };\n\n\n  self.render = function(registerData, viewLocals, enteringView, leavingView, renderStart, renderEnd) {\n    // register the view and figure out where it lives in the various\n    // histories and nav stacks, along with how views should enter/leave\n    var switcher = $ionicViewSwitcher.create(self, viewLocals, enteringView, leavingView, renderStart, renderEnd);\n\n    // init the rendering of views for this navView directive\n    switcher.init(registerData, function() {\n      // the view is now compiled, in the dom and linked, now lets transition the views.\n      // this uses a callback incase THIS nav-view has a nested nav-view, and after the NESTED\n      // nav-view links, the NESTED nav-view would update which direction THIS nav-view should use\n\n      // kick off the transition of views\n      switcher.transition(self.direction(), registerData.enableBack, !disableAnimation);\n\n      // reset private vars for next time\n      disableRenderStartViewId = disableAnimation = null;\n    });\n\n  };\n\n\n  self.beforeEnter = function(transitionData) {\n    if (isPrimary) {\n      // only update this nav-view's nav-bar if this is the primary nav-view\n      navBarDelegate = transitionData.navBarDelegate;\n      var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n      associatedNavBarCtrl && associatedNavBarCtrl.update(transitionData);\n      navSwipeAttr('');\n    }\n  };\n\n\n  self.activeEleId = function(eleId) {\n    if (arguments.length) {\n      activeEleId = eleId;\n    }\n    return activeEleId;\n  };\n\n\n  self.transitionEnd = function() {\n    var viewElements = $element.children();\n    var x, l, viewElement;\n\n    for (x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n\n      if (viewElement.data(DATA_ELE_IDENTIFIER) === activeEleId) {\n        // this is the active element\n        navViewAttr(viewElement, VIEW_STATUS_ACTIVE);\n\n      } else if (navViewAttr(viewElement) === 'leaving' || navViewAttr(viewElement) === VIEW_STATUS_ACTIVE || navViewAttr(viewElement) === VIEW_STATUS_CACHED) {\n        // this is a leaving element or was the former active element, or is an cached element\n        if (viewElement.data(DATA_DESTROY_ELE) || viewElement.data(DATA_NO_CACHE)) {\n          // this element shouldn't stay cached\n          $ionicViewSwitcher.destroyViewEle(viewElement);\n\n        } else {\n          // keep in the DOM, mark as cached\n          navViewAttr(viewElement, VIEW_STATUS_CACHED);\n\n          // disconnect the leaving scope\n          ionic.Utils.disconnectScope(viewElement.scope());\n        }\n      }\n    }\n\n    navSwipeAttr('');\n\n    // ensure no scrolls have been left frozen\n    if (self.isSwipeFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n  };\n\n\n  function onTabsLeave(ev, data) {\n    var viewElements = $element.children();\n    var viewElement, viewScope;\n\n    for (var x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n      if (navViewAttr(viewElement) == VIEW_STATUS_ACTIVE) {\n        viewScope = viewElement.scope();\n        viewScope && viewScope.$emit(ev.name.replace('Tabs', 'View'), data);\n        break;\n      }\n    }\n  }\n\n\n  self.cacheCleanup = function() {\n    var viewElements = $element.children();\n    for (var x = 0, l = viewElements.length; x < l; x++) {\n      if (viewElements.eq(x).data(DATA_DESTROY_ELE)) {\n        $ionicViewSwitcher.destroyViewEle(viewElements.eq(x));\n      }\n    }\n  };\n\n\n  self.clearCache = function(stateIds) {\n    var viewElements = $element.children();\n    var viewElement, viewScope, x, l, y, eleIdentifier;\n\n    for (x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n\n      if (stateIds) {\n        eleIdentifier = viewElement.data(DATA_ELE_IDENTIFIER);\n\n        for (y = 0; y < stateIds.length; y++) {\n          if (eleIdentifier === stateIds[y]) {\n            $ionicViewSwitcher.destroyViewEle(viewElement);\n          }\n        }\n        continue;\n      }\n\n      if (navViewAttr(viewElement) == VIEW_STATUS_CACHED) {\n        $ionicViewSwitcher.destroyViewEle(viewElement);\n\n      } else if (navViewAttr(viewElement) == VIEW_STATUS_ACTIVE) {\n        viewScope = viewElement.scope();\n        viewScope && viewScope.$broadcast('$ionicView.clearCache');\n      }\n\n    }\n  };\n\n\n  self.getViewElements = function() {\n    return $element.children();\n  };\n\n\n  self.appendViewElement = function(viewEle, viewLocals) {\n    // compile the entering element and get the link function\n    var linkFn = $compile(viewEle);\n\n    $element.append(viewEle);\n\n    var viewScope = $scope.$new();\n\n    if (viewLocals && viewLocals.$$controller) {\n      viewLocals.$scope = viewScope;\n      var controller = $controller(viewLocals.$$controller, viewLocals);\n      $element.children().data('$ngControllerController', controller);\n    }\n\n    linkFn(viewScope);\n\n    return viewScope;\n  };\n\n\n  self.title = function(val) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.title(val);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavView#enableBackButton\n   * @description Enable/disable if the back button can be shown or not. For\n   * example, the very first view in the navigation stack would not have a\n   * back view, so the back button would be disabled.\n   */\n  self.enableBackButton = function(shouldEnable) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.enableBackButton(shouldEnable);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavView#showBackButton\n   * @description Show/hide the nav bar active back button. If the back button\n   * is not possible this will not force the back button to show. The\n   * `enableBackButton()` method handles if a back button is even possible or not.\n   */\n  self.showBackButton = function(shouldShow) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    if (associatedNavBarCtrl) {\n      if (arguments.length) {\n        return associatedNavBarCtrl.showActiveBackButton(shouldShow);\n      }\n      return associatedNavBarCtrl.showActiveBackButton();\n    }\n    return true;\n  };\n\n\n  self.showBar = function(val) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    if (associatedNavBarCtrl) {\n      if (arguments.length) {\n        return associatedNavBarCtrl.showBar(val);\n      }\n      return associatedNavBarCtrl.showBar();\n    }\n    return true;\n  };\n\n\n  self.isPrimary = function(val) {\n    if (arguments.length) {\n      isPrimary = val;\n    }\n    return isPrimary;\n  };\n\n\n  self.direction = function(val) {\n    if (arguments.length) {\n      direction = val;\n    }\n    return direction;\n  };\n\n\n  self.initSwipeBack = function() {\n    var swipeBackHitWidth = $ionicConfig.views.swipeBackHitWidth();\n    var viewTransition, associatedNavBarCtrl, backView;\n    var deregDragStart, deregDrag, deregRelease;\n    var windowWidth, startDragX, dragPoints;\n    var cancelData = {};\n\n    function onDragStart(ev) {\n      if (!isPrimary) return;\n\n      startDragX = getDragX(ev);\n      if (startDragX > swipeBackHitWidth) return;\n\n      backView = $ionicHistory.backView();\n\n      var currentView = $ionicHistory.currentView();\n\n      if (!backView || backView.historyId !== currentView.historyId || currentView.canSwipeBack === false) return;\n\n      if (!windowWidth) windowWidth = window.innerWidth;\n\n      self.isSwipeFreeze = $ionicScrollDelegate.freezeAllScrolls(true);\n\n      var registerData = {\n        direction: 'back'\n      };\n\n      dragPoints = [];\n\n      cancelData = {\n        showBar: self.showBar(),\n        showBackButton: self.showBackButton()\n      };\n\n      var switcher = $ionicViewSwitcher.create(self, registerData, backView, currentView, true, false);\n      switcher.loadViewElements(registerData);\n      switcher.render(registerData);\n\n      viewTransition = switcher.transition('back', $ionicHistory.enabledBack(backView), true);\n\n      associatedNavBarCtrl = getAssociatedNavBarCtrl();\n\n      deregDrag = ionic.onGesture('drag', onDrag, $element[0]);\n      deregRelease = ionic.onGesture('release', onRelease, $element[0]);\n    }\n\n    function onDrag(ev) {\n      if (isPrimary && viewTransition) {\n        var dragX = getDragX(ev);\n\n        dragPoints.push({\n          t: Date.now(),\n          x: dragX\n        });\n\n        if (dragX >= windowWidth - 15) {\n          onRelease(ev);\n\n        } else {\n          var step = Math.min(Math.max(getSwipeCompletion(dragX), 0), 1);\n          viewTransition.run(step);\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.run(step);\n        }\n\n      }\n    }\n\n    function onRelease(ev) {\n      if (isPrimary && viewTransition && dragPoints && dragPoints.length > 1) {\n\n        var now = Date.now();\n        var releaseX = getDragX(ev);\n        var startDrag = dragPoints[dragPoints.length - 1];\n\n        for (var x = dragPoints.length - 2; x >= 0; x--) {\n          if (now - startDrag.t > 200) {\n            break;\n          }\n          startDrag = dragPoints[x];\n        }\n\n        var isSwipingRight = (releaseX >= dragPoints[dragPoints.length - 2].x);\n        var releaseSwipeCompletion = getSwipeCompletion(releaseX);\n        var velocity = Math.abs(startDrag.x - releaseX) / (now - startDrag.t);\n\n        // private variables because ui-router has no way to pass custom data using $state.go\n        disableRenderStartViewId = backView.viewId;\n        disableAnimation = (releaseSwipeCompletion < 0.03 || releaseSwipeCompletion > 0.97);\n\n        if (isSwipingRight && (releaseSwipeCompletion > 0.5 || velocity > 0.1)) {\n          // complete view transition on release\n          var speed = (velocity > 0.5 || velocity < 0.05 || releaseX > windowWidth - 45) ? 'fast' : 'slow';\n          navSwipeAttr(disableAnimation ? '' : speed);\n          backView.go();\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.complete(!disableAnimation, speed);\n\n        } else {\n          // cancel view transition on release\n          navSwipeAttr(disableAnimation ? '' : 'fast');\n          disableRenderStartViewId = null;\n          viewTransition.cancel(!disableAnimation);\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.cancel(!disableAnimation, 'fast', cancelData);\n          disableAnimation = null;\n        }\n\n      }\n\n      ionic.offGesture(deregDrag, 'drag', onDrag);\n      ionic.offGesture(deregRelease, 'release', onRelease);\n\n      windowWidth = viewTransition = dragPoints = null;\n\n      self.isSwipeFreeze = $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n\n    function getDragX(ev) {\n      return ionic.tap.pointerCoord(ev.gesture.srcEvent).x;\n    }\n\n    function getSwipeCompletion(dragX) {\n      return (dragX - startDragX) / windowWidth;\n    }\n\n    deregDragStart = ionic.onGesture('dragstart', onDragStart, $element[0]);\n\n    $scope.$on('$destroy', function() {\n      ionic.offGesture(deregDragStart, 'dragstart', onDragStart);\n      ionic.offGesture(deregDrag, 'drag', onDrag);\n      ionic.offGesture(deregRelease, 'release', onRelease);\n      self.element = viewTransition = associatedNavBarCtrl = null;\n    });\n  };\n\n\n  function navSwipeAttr(val) {\n    ionic.DomUtil.cachedAttr($element, 'nav-swipe', val);\n  }\n\n\n  function onTabsTop(ev, isTabsTop) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.hasTabsTop(isTabsTop);\n  }\n\n  function onBarSubheader(ev, isBarSubheader) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.hasBarSubheader(isBarSubheader);\n  }\n\n  function getAssociatedNavBarCtrl() {\n    if (navBarDelegate) {\n      for (var x = 0; x < $ionicNavBarDelegate._instances.length; x++) {\n        if ($ionicNavBarDelegate._instances[x].$$delegateHandle == navBarDelegate) {\n          return $ionicNavBarDelegate._instances[x];\n        }\n      }\n    }\n    return $element.inheritedData('$ionNavBarController');\n  }\n\n}]);\n\nIonicModule\n.controller('$ionicRefresher', [\n  '$scope',\n  '$attrs',\n  '$element',\n  '$ionicBind',\n  '$timeout',\n  function($scope, $attrs, $element, $ionicBind, $timeout) {\n    var self = this,\n        isDragging = false,\n        isOverscrolling = false,\n        dragOffset = 0,\n        lastOverscroll = 0,\n        ptrThreshold = 60,\n        activated = false,\n        scrollTime = 500,\n        startY = null,\n        deltaY = null,\n        canOverscroll = true,\n        scrollParent,\n        scrollChild;\n\n    if (!isDefined($attrs.pullingIcon)) {\n      $attrs.$set('pullingIcon', 'ion-android-arrow-down');\n    }\n\n    $scope.showSpinner = !isDefined($attrs.refreshingIcon) && $attrs.spinner != 'none';\n\n    $scope.showIcon = isDefined($attrs.refreshingIcon);\n\n    $ionicBind($scope, $attrs, {\n      pullingIcon: '@',\n      pullingText: '@',\n      refreshingIcon: '@',\n      refreshingText: '@',\n      spinner: '@',\n      disablePullingRotation: '@',\n      $onRefresh: '&onRefresh',\n      $onPulling: '&onPulling'\n    });\n\n    function handleTouchend() {\n      // if this wasn't an overscroll, get out immediately\n      if (!canOverscroll && !isDragging) {\n        return;\n      }\n      // reset Y\n      startY = null;\n      // the user has overscrolled but went back to native scrolling\n      if (!isDragging) {\n        dragOffset = 0;\n        isOverscrolling = false;\n        setScrollLock(false);\n      } else {\n        isDragging = false;\n        dragOffset = 0;\n\n        // the user has scroll far enough to trigger a refresh\n        if (lastOverscroll > ptrThreshold) {\n          start();\n          scrollTo(ptrThreshold, scrollTime);\n\n        // the user has overscrolled but not far enough to trigger a refresh\n        } else {\n          scrollTo(0, scrollTime, deactivate);\n          isOverscrolling = false;\n        }\n      }\n    }\n\n    function handleTouchmove(e) {\n      // if multitouch or regular scroll event, get out immediately\n      if (!canOverscroll || e.touches.length > 1) {\n        return;\n      }\n      //if this is a new drag, keep track of where we start\n      if (startY === null) {\n        startY = parseInt(e.touches[0].screenY, 10);\n      }\n\n      // kitkat fix for touchcancel events http://updates.html5rocks.com/2014/05/A-More-Compatible-Smoother-Touch\n      if (ionic.Platform.isAndroid() && ionic.Platform.version() === 4.4 && scrollParent.scrollTop === 0) {\n        isDragging = true;\n        e.preventDefault();\n      }\n\n      // how far have we dragged so far?\n      deltaY = parseInt(e.touches[0].screenY, 10) - startY;\n\n      // if we've dragged up and back down in to native scroll territory\n      if (deltaY - dragOffset <= 0 || scrollParent.scrollTop !== 0) {\n\n        if (isOverscrolling) {\n          isOverscrolling = false;\n          setScrollLock(false);\n        }\n\n        if (isDragging) {\n          nativescroll(scrollParent, parseInt(deltaY - dragOffset, 10) * -1);\n        }\n\n        // if we're not at overscroll 0 yet, 0 out\n        if (lastOverscroll !== 0) {\n          overscroll(0);\n        }\n        return;\n\n      } else if (deltaY > 0 && scrollParent.scrollTop === 0 && !isOverscrolling) {\n        // starting overscroll, but drag started below scrollTop 0, so we need to offset the position\n        dragOffset = deltaY;\n      }\n\n      // prevent native scroll events while overscrolling\n      e.preventDefault();\n\n      // if not overscrolling yet, initiate overscrolling\n      if (!isOverscrolling) {\n        isOverscrolling = true;\n        setScrollLock(true);\n      }\n\n      isDragging = true;\n      // overscroll according to the user's drag so far\n      overscroll(parseInt((deltaY - dragOffset) / 3, 10));\n\n      // update the icon accordingly\n      if (!activated && lastOverscroll > ptrThreshold) {\n        activated = true;\n        ionic.requestAnimationFrame(activate);\n\n      } else if (activated && lastOverscroll < ptrThreshold) {\n        activated = false;\n        ionic.requestAnimationFrame(deactivate);\n      }\n    }\n\n    function handleScroll(e) {\n      // canOverscrol is used to greatly simplify the drag handler during normal scrolling\n      canOverscroll = (e.target.scrollTop === 0) || isDragging;\n    }\n\n    function overscroll(val) {\n      scrollChild.style[ionic.CSS.TRANSFORM] = 'translateY(' + val + 'px)';\n      lastOverscroll = val;\n    }\n\n    function nativescroll(target, newScrollTop) {\n      // creates a scroll event that bubbles, can be cancelled, and with its view\n      // and detail property initialized to window and 1, respectively\n      target.scrollTop = newScrollTop;\n      var e = document.createEvent(\"UIEvents\");\n      e.initUIEvent(\"scroll\", true, true, window, 1);\n      target.dispatchEvent(e);\n    }\n\n    function setScrollLock(enabled) {\n      // set the scrollbar to be position:fixed in preparation to overscroll\n      // or remove it so the app can be natively scrolled\n      if (enabled) {\n        ionic.requestAnimationFrame(function() {\n          scrollChild.classList.add('overscroll');\n          show();\n        });\n\n      } else {\n        ionic.requestAnimationFrame(function() {\n          scrollChild.classList.remove('overscroll');\n          hide();\n          deactivate();\n        });\n      }\n    }\n\n    $scope.$on('scroll.refreshComplete', function() {\n      // prevent the complete from firing before the scroll has started\n      $timeout(function() {\n\n        ionic.requestAnimationFrame(tail);\n\n        // scroll back to home during tail animation\n        scrollTo(0, scrollTime, deactivate);\n\n        // return to native scrolling after tail animation has time to finish\n        $timeout(function() {\n\n          if (isOverscrolling) {\n            isOverscrolling = false;\n            setScrollLock(false);\n          }\n\n        }, scrollTime);\n\n      }, scrollTime);\n    });\n\n    function scrollTo(Y, duration, callback) {\n      // scroll animation loop w/ easing\n      // credit https://gist.github.com/dezinezync/5487119\n      var start = Date.now(),\n          from = lastOverscroll;\n\n      if (from === Y) {\n        callback();\n        return; /* Prevent scrolling to the Y point if already there */\n      }\n\n      // decelerating to zero velocity\n      function easeOutCubic(t) {\n        return (--t) * t * t + 1;\n      }\n\n      // scroll loop\n      function scroll() {\n        var currentTime = Date.now(),\n          time = Math.min(1, ((currentTime - start) / duration)),\n          // where .5 would be 50% of time on a linear scale easedT gives a\n          // fraction based on the easing method\n          easedT = easeOutCubic(time);\n\n        overscroll(parseInt((easedT * (Y - from)) + from, 10));\n\n        if (time < 1) {\n          ionic.requestAnimationFrame(scroll);\n\n        } else {\n\n          if (Y < 5 && Y > -5) {\n            isOverscrolling = false;\n            setScrollLock(false);\n          }\n\n          callback && callback();\n        }\n      }\n\n      // start scroll loop\n      ionic.requestAnimationFrame(scroll);\n    }\n\n\n    self.init = function() {\n      scrollParent = $element.parent().parent()[0];\n      scrollChild = $element.parent()[0];\n\n      if (!scrollParent || !scrollParent.classList.contains('ionic-scroll') ||\n        !scrollChild || !scrollChild.classList.contains('scroll')) {\n        throw new Error('Refresher must be immediate child of ion-content or ion-scroll');\n      }\n\n      ionic.on('touchmove', handleTouchmove, scrollChild);\n      ionic.on('touchend', handleTouchend, scrollChild);\n      ionic.on('scroll', handleScroll, scrollParent);\n\n      // cleanup when done\n      $scope.$on('$destroy', destroy);\n    };\n\n    function destroy() {\n      ionic.off('touchmove', handleTouchmove, scrollChild);\n      ionic.off('touchend', handleTouchend, scrollChild);\n      ionic.off('scroll', handleScroll, scrollParent);\n      scrollParent = null;\n      scrollChild = null;\n    }\n\n    // DOM manipulation and broadcast methods shared by JS and Native Scrolling\n    // getter used by JS Scrolling\n    self.getRefresherDomMethods = function() {\n      return {\n        activate: activate,\n        deactivate: deactivate,\n        start: start,\n        show: show,\n        hide: hide,\n        tail: tail\n      };\n    };\n\n    function activate() {\n      $element[0].classList.add('active');\n      $scope.$onPulling();\n    }\n\n    function deactivate() {\n      // give tail 150ms to finish\n      $timeout(function() {\n        // deactivateCallback\n        $element.removeClass('active refreshing refreshing-tail');\n        if (activated) activated = false;\n      }, 150);\n    }\n\n    function start() {\n      // startCallback\n      $element[0].classList.add('refreshing');\n      $scope.$onRefresh();\n    }\n\n    function show() {\n      // showCallback\n      $element[0].classList.remove('invisible');\n    }\n\n    function hide() {\n      // showCallback\n      $element[0].classList.add('invisible');\n    }\n\n    function tail() {\n      // tailCallback\n      $element[0].classList.add('refreshing-tail');\n    }\n\n    // for testing\n    self.__handleTouchmove = handleTouchmove;\n    self.__getScrollChild = function() { return scrollChild; };\n    self.__getScrollParent = function() { return scrollParent; };\n  }\n]);\n\n/**\n * @private\n */\nIonicModule\n\n.controller('$ionicScroll', [\n  '$scope',\n  'scrollViewOptions',\n  '$timeout',\n  '$window',\n  '$location',\n  '$document',\n  '$ionicScrollDelegate',\n  '$ionicHistory',\nfunction($scope,\n         scrollViewOptions,\n         $timeout,\n         $window,\n         $location,\n         $document,\n         $ionicScrollDelegate,\n         $ionicHistory) {\n\n  var self = this;\n  // for testing\n  self.__timeout = $timeout;\n\n  self._scrollViewOptions = scrollViewOptions; //for testing\n  self.isNative = function() {\n    return !!scrollViewOptions.nativeScrolling;\n  };\n\n  var element = self.element = scrollViewOptions.el;\n  var $element = self.$element = jqLite(element);\n  var scrollView;\n  if (self.isNative()) {\n    scrollView = self.scrollView = new ionic.views.ScrollNative(scrollViewOptions);\n  } else {\n    scrollView = self.scrollView = new ionic.views.Scroll(scrollViewOptions);\n  }\n\n\n  //Attach self to element as a controller so other directives can require this controller\n  //through `require: '$ionicScroll'\n  //Also attach to parent so that sibling elements can require this\n  ($element.parent().length ? $element.parent() : $element)\n    .data('$$ionicScrollController', self);\n\n  var deregisterInstance = $ionicScrollDelegate._registerInstance(\n    self, scrollViewOptions.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n\n  if (!isDefined(scrollViewOptions.bouncing)) {\n    ionic.Platform.ready(function() {\n      if (scrollView.options) {\n        scrollView.options.bouncing = true;\n        if (ionic.Platform.isAndroid()) {\n          // No bouncing by default on Android\n          scrollView.options.bouncing = false;\n          // Faster scroll decel\n          scrollView.options.deceleration = 0.95;\n        }\n      }\n    });\n  }\n\n  var resize = angular.bind(scrollView, scrollView.resize);\n  angular.element($window).on('resize', resize);\n\n  var scrollFunc = function(e) {\n    var detail = (e.originalEvent || e).detail || {};\n    $scope.$onScroll && $scope.$onScroll({\n      event: e,\n      scrollTop: detail.scrollTop || 0,\n      scrollLeft: detail.scrollLeft || 0\n    });\n  };\n\n  $element.on('scroll', scrollFunc);\n\n  $scope.$on('$destroy', function() {\n    deregisterInstance();\n    scrollView && scrollView.__cleanup && scrollView.__cleanup();\n    angular.element($window).off('resize', resize);\n    $element.off('scroll', scrollFunc);\n    scrollView = self.scrollView = scrollViewOptions = self._scrollViewOptions = scrollViewOptions.el = self._scrollViewOptions.el = $element = self.$element = element = null;\n  });\n\n  $timeout(function() {\n    scrollView && scrollView.run && scrollView.run();\n  });\n\n  self.getScrollView = function() {\n    return scrollView;\n  };\n\n  self.getScrollPosition = function() {\n    return scrollView.getValues();\n  };\n\n  self.resize = function() {\n    return $timeout(resize, 0, false).then(function() {\n      $element && $element.triggerHandler('scroll-resize');\n    });\n  };\n\n  self.scrollTop = function(shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollTo(0, 0, !!shouldAnimate);\n    });\n  };\n\n  self.scrollBottom = function(shouldAnimate) {\n    self.resize().then(function() {\n      var max = scrollView.getScrollMax();\n      scrollView.scrollTo(max.left, max.top, !!shouldAnimate);\n    });\n  };\n\n  self.scrollTo = function(left, top, shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollTo(left, top, !!shouldAnimate);\n    });\n  };\n\n  self.zoomTo = function(zoom, shouldAnimate, originLeft, originTop) {\n    self.resize().then(function() {\n      scrollView.zoomTo(zoom, !!shouldAnimate, originLeft, originTop);\n    });\n  };\n\n  self.zoomBy = function(zoom, shouldAnimate, originLeft, originTop) {\n    self.resize().then(function() {\n      scrollView.zoomBy(zoom, !!shouldAnimate, originLeft, originTop);\n    });\n  };\n\n  self.scrollBy = function(left, top, shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollBy(left, top, !!shouldAnimate);\n    });\n  };\n\n  self.anchorScroll = function(shouldAnimate) {\n    self.resize().then(function() {\n      var hash = $location.hash();\n      var elm = hash && $document[0].getElementById(hash);\n      if (!(hash && elm)) {\n        scrollView.scrollTo(0, 0, !!shouldAnimate);\n        return;\n      }\n      var curElm = elm;\n      var scrollLeft = 0, scrollTop = 0;\n      do {\n        if (curElm !== null) scrollLeft += curElm.offsetLeft;\n        if (curElm !== null) scrollTop += curElm.offsetTop;\n        curElm = curElm.offsetParent;\n      } while (curElm.attributes != self.element.attributes && curElm.offsetParent);\n      scrollView.scrollTo(scrollLeft, scrollTop, !!shouldAnimate);\n    });\n  };\n\n  self.freezeScroll = scrollView.freeze;\n\n  self.freezeAllScrolls = function(shouldFreeze) {\n    for (var i = 0; i < $ionicScrollDelegate._instances.length; i++) {\n      $ionicScrollDelegate._instances[i].freezeScroll(shouldFreeze);\n    }\n  };\n\n\n  /**\n   * @private\n   */\n  self._setRefresher = function(refresherScope, refresherElement, refresherMethods) {\n    self.refresher = refresherElement;\n    var refresherHeight = self.refresher.clientHeight || 60;\n    scrollView.activatePullToRefresh(\n      refresherHeight,\n      refresherMethods\n    );\n  };\n\n}]);\n\nIonicModule\n.controller('$ionicSideMenus', [\n  '$scope',\n  '$attrs',\n  '$ionicSideMenuDelegate',\n  '$ionicPlatform',\n  '$ionicBody',\n  '$ionicHistory',\n  '$ionicScrollDelegate',\n  'IONIC_BACK_PRIORITY',\nfunction($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $ionicHistory, $ionicScrollDelegate, IONIC_BACK_PRIORITY) {\n  var self = this;\n  var rightShowing, leftShowing, isDragging;\n  var startX, lastX, offsetX, isAsideExposed;\n  var enableMenuWithBackViews = true;\n\n  self.$scope = $scope;\n\n  self.initialize = function(options) {\n    self.left = options.left;\n    self.right = options.right;\n    self.setContent(options.content);\n    self.dragThresholdX = options.dragThresholdX || 10;\n    $ionicHistory.registerHistory(self.$scope);\n  };\n\n  /**\n   * Set the content view controller if not passed in the constructor options.\n   *\n   * @param {object} content\n   */\n  self.setContent = function(content) {\n    if (content) {\n      self.content = content;\n\n      self.content.onDrag = function(e) {\n        self._handleDrag(e);\n      };\n\n      self.content.endDrag = function(e) {\n        self._endDrag(e);\n      };\n    }\n  };\n\n  self.isOpenLeft = function() {\n    return self.getOpenAmount() > 0;\n  };\n\n  self.isOpenRight = function() {\n    return self.getOpenAmount() < 0;\n  };\n\n  /**\n   * Toggle the left menu to open 100%\n   */\n  self.toggleLeft = function(shouldOpen) {\n    if (isAsideExposed || !self.left.isEnabled) return;\n    var openAmount = self.getOpenAmount();\n    if (arguments.length === 0) {\n      shouldOpen = openAmount <= 0;\n    }\n    self.content.enableAnimation();\n    if (!shouldOpen) {\n      self.openPercentage(0);\n    } else {\n      self.openPercentage(100);\n    }\n  };\n\n  /**\n   * Toggle the right menu to open 100%\n   */\n  self.toggleRight = function(shouldOpen) {\n    if (isAsideExposed || !self.right.isEnabled) return;\n    var openAmount = self.getOpenAmount();\n    if (arguments.length === 0) {\n      shouldOpen = openAmount >= 0;\n    }\n    self.content.enableAnimation();\n    if (!shouldOpen) {\n      self.openPercentage(0);\n    } else {\n      self.openPercentage(-100);\n    }\n  };\n\n  self.toggle = function(side) {\n    if (side == 'right') {\n      self.toggleRight();\n    } else {\n      self.toggleLeft();\n    }\n  };\n\n  /**\n   * Close all menus.\n   */\n  self.close = function() {\n    self.openPercentage(0);\n  };\n\n  /**\n   * @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative)\n   */\n  self.getOpenAmount = function() {\n    return self.content && self.content.getTranslateX() || 0;\n  };\n\n  /**\n   * @return {float} The ratio of open amount over menu width. For example, a\n   * menu of width 100 open 50 pixels would be open 50% or a ratio of 0.5. Value is negative\n   * for right menu.\n   */\n  self.getOpenRatio = function() {\n    var amount = self.getOpenAmount();\n    if (amount >= 0) {\n      return amount / self.left.width;\n    }\n    return amount / self.right.width;\n  };\n\n  self.isOpen = function() {\n    return self.getOpenAmount() !== 0;\n  };\n\n  /**\n   * @return {float} The percentage of open amount over menu width. For example, a\n   * menu of width 100 open 50 pixels would be open 50%. Value is negative\n   * for right menu.\n   */\n  self.getOpenPercentage = function() {\n    return self.getOpenRatio() * 100;\n  };\n\n  /**\n   * Open the menu with a given percentage amount.\n   * @param {float} percentage The percentage (positive or negative for left/right) to open the menu.\n   */\n  self.openPercentage = function(percentage) {\n    var p = percentage / 100;\n\n    if (self.left && percentage >= 0) {\n      self.openAmount(self.left.width * p);\n    } else if (self.right && percentage < 0) {\n      self.openAmount(self.right.width * p);\n    }\n\n    // add the CSS class \"menu-open\" if the percentage does not\n    // equal 0, otherwise remove the class from the body element\n    $ionicBody.enableClass((percentage !== 0), 'menu-open');\n\n    freezeAllScrolls(false);\n  };\n\n  function freezeAllScrolls(shouldFreeze) {\n    if (shouldFreeze && !self.isScrollFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(shouldFreeze);\n\n    } else if (!shouldFreeze && self.isScrollFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n    self.isScrollFreeze = shouldFreeze;\n  }\n\n  /**\n   * Open the menu the given pixel amount.\n   * @param {float} amount the pixel amount to open the menu. Positive value for left menu,\n   * negative value for right menu (only one menu will be visible at a time).\n   */\n  self.openAmount = function(amount) {\n    var maxLeft = self.left && self.left.width || 0;\n    var maxRight = self.right && self.right.width || 0;\n\n    // Check if we can move to that side, depending if the left/right panel is enabled\n    if (!(self.left && self.left.isEnabled) && amount > 0) {\n      self.content.setTranslateX(0);\n      return;\n    }\n\n    if (!(self.right && self.right.isEnabled) && amount < 0) {\n      self.content.setTranslateX(0);\n      return;\n    }\n\n    if (leftShowing && amount > maxLeft) {\n      self.content.setTranslateX(maxLeft);\n      return;\n    }\n\n    if (rightShowing && amount < -maxRight) {\n      self.content.setTranslateX(-maxRight);\n      return;\n    }\n\n    self.content.setTranslateX(amount);\n\n    if (amount >= 0) {\n      leftShowing = true;\n      rightShowing = false;\n\n      if (amount > 0) {\n        // Push the z-index of the right menu down\n        self.right && self.right.pushDown && self.right.pushDown();\n        // Bring the z-index of the left menu up\n        self.left && self.left.bringUp && self.left.bringUp();\n      }\n    } else {\n      rightShowing = true;\n      leftShowing = false;\n\n      // Bring the z-index of the right menu up\n      self.right && self.right.bringUp && self.right.bringUp();\n      // Push the z-index of the left menu down\n      self.left && self.left.pushDown && self.left.pushDown();\n    }\n  };\n\n  /**\n   * Given an event object, find the final resting position of this side\n   * menu. For example, if the user \"throws\" the content to the right and\n   * releases the touch, the left menu should snap open (animated, of course).\n   *\n   * @param {Event} e the gesture event to use for snapping\n   */\n  self.snapToRest = function(e) {\n    // We want to animate at the end of this\n    self.content.enableAnimation();\n    isDragging = false;\n\n    // Check how much the panel is open after the drag, and\n    // what the drag velocity is\n    var ratio = self.getOpenRatio();\n\n    if (ratio === 0) {\n      // Just to be safe\n      self.openPercentage(0);\n      return;\n    }\n\n    var velocityThreshold = 0.3;\n    var velocityX = e.gesture.velocityX;\n    var direction = e.gesture.direction;\n\n    // Going right, less than half, too slow (snap back)\n    if (ratio > 0 && ratio < 0.5 && direction == 'right' && velocityX < velocityThreshold) {\n      self.openPercentage(0);\n    }\n\n    // Going left, more than half, too slow (snap back)\n    else if (ratio > 0.5 && direction == 'left' && velocityX < velocityThreshold) {\n      self.openPercentage(100);\n    }\n\n    // Going left, less than half, too slow (snap back)\n    else if (ratio < 0 && ratio > -0.5 && direction == 'left' && velocityX < velocityThreshold) {\n      self.openPercentage(0);\n    }\n\n    // Going right, more than half, too slow (snap back)\n    else if (ratio < 0.5 && direction == 'right' && velocityX < velocityThreshold) {\n      self.openPercentage(-100);\n    }\n\n    // Going right, more than half, or quickly (snap open)\n    else if (direction == 'right' && ratio >= 0 && (ratio >= 0.5 || velocityX > velocityThreshold)) {\n      self.openPercentage(100);\n    }\n\n    // Going left, more than half, or quickly (span open)\n    else if (direction == 'left' && ratio <= 0 && (ratio <= -0.5 || velocityX > velocityThreshold)) {\n      self.openPercentage(-100);\n    }\n\n    // Snap back for safety\n    else {\n      self.openPercentage(0);\n    }\n  };\n\n  self.enableMenuWithBackViews = function(val) {\n    if (arguments.length) {\n      enableMenuWithBackViews = !!val;\n    }\n    return enableMenuWithBackViews;\n  };\n\n  self.isAsideExposed = function() {\n    return !!isAsideExposed;\n  };\n\n  self.exposeAside = function(shouldExposeAside) {\n    if (!(self.left && self.left.isEnabled) && !(self.right && self.right.isEnabled)) return;\n    self.close();\n\n    isAsideExposed = shouldExposeAside;\n    if (self.left && self.left.isEnabled) {\n      // set the left marget width if it should be exposed\n      // otherwise set false so there's no left margin\n      self.content.setMarginLeft(isAsideExposed ? self.left.width : 0);\n    } else if (self.right && self.right.isEnabled) {\n      self.content.setMarginRight(isAsideExposed ? self.right.width : 0);\n    }\n\n    self.$scope.$emit('$ionicExposeAside', isAsideExposed);\n  };\n\n  self.activeAsideResizing = function(isResizing) {\n    $ionicBody.enableClass(isResizing, 'aside-resizing');\n  };\n\n  // End a drag with the given event\n  self._endDrag = function(e) {\n    freezeAllScrolls(false);\n\n    if (isAsideExposed) return;\n\n    if (isDragging) {\n      self.snapToRest(e);\n    }\n    startX = null;\n    lastX = null;\n    offsetX = null;\n  };\n\n  // Handle a drag event\n  self._handleDrag = function(e) {\n    if (isAsideExposed || !$scope.dragContent) return;\n\n    // If we don't have start coords, grab and store them\n    if (!startX) {\n      startX = e.gesture.touches[0].pageX;\n      lastX = startX;\n    } else {\n      // Grab the current tap coords\n      lastX = e.gesture.touches[0].pageX;\n    }\n\n    // Calculate difference from the tap points\n    if (!isDragging && Math.abs(lastX - startX) > self.dragThresholdX) {\n      // if the difference is greater than threshold, start dragging using the current\n      // point as the starting point\n      startX = lastX;\n\n      isDragging = true;\n      // Initialize dragging\n      self.content.disableAnimation();\n      offsetX = self.getOpenAmount();\n    }\n\n    if (isDragging) {\n      self.openAmount(offsetX + (lastX - startX));\n      freezeAllScrolls(true);\n    }\n  };\n\n  self.canDragContent = function(canDrag) {\n    if (arguments.length) {\n      $scope.dragContent = !!canDrag;\n    }\n    return $scope.dragContent;\n  };\n\n  self.edgeThreshold = 25;\n  self.edgeThresholdEnabled = false;\n  self.edgeDragThreshold = function(value) {\n    if (arguments.length) {\n      if (isNumber(value) && value > 0) {\n        self.edgeThreshold = value;\n        self.edgeThresholdEnabled = true;\n      } else {\n        self.edgeThresholdEnabled = !!value;\n      }\n    }\n    return self.edgeThresholdEnabled;\n  };\n\n  self.isDraggableTarget = function(e) {\n    //Only restrict edge when sidemenu is closed and restriction is enabled\n    var shouldOnlyAllowEdgeDrag = self.edgeThresholdEnabled && !self.isOpen();\n    var startX = e.gesture.startEvent && e.gesture.startEvent.center &&\n      e.gesture.startEvent.center.pageX;\n\n    var dragIsWithinBounds = !shouldOnlyAllowEdgeDrag ||\n      startX <= self.edgeThreshold ||\n      startX >= self.content.element.offsetWidth - self.edgeThreshold;\n\n    var backView = $ionicHistory.backView();\n    var menuEnabled = enableMenuWithBackViews ? true : !backView;\n    if (!menuEnabled) {\n      var currentView = $ionicHistory.currentView() || {};\n      return backView.historyId !== currentView.historyId;\n    }\n\n    return ($scope.dragContent || self.isOpen()) &&\n      dragIsWithinBounds &&\n      !e.gesture.srcEvent.defaultPrevented &&\n      menuEnabled &&\n      !e.target.tagName.match(/input|textarea|select|object|embed/i) &&\n      !e.target.isContentEditable &&\n      !(e.target.dataset ? e.target.dataset.preventScroll : e.target.getAttribute('data-prevent-scroll') == 'true');\n  };\n\n  $scope.sideMenuContentTranslateX = 0;\n\n  var deregisterBackButtonAction = noop;\n  var closeSideMenu = angular.bind(self, self.close);\n\n  $scope.$watch(function() {\n    return self.getOpenAmount() !== 0;\n  }, function(isOpen) {\n    deregisterBackButtonAction();\n    if (isOpen) {\n      deregisterBackButtonAction = $ionicPlatform.registerBackButtonAction(\n        closeSideMenu,\n        IONIC_BACK_PRIORITY.sideMenu\n      );\n    }\n  });\n\n  var deregisterInstance = $ionicSideMenuDelegate._registerInstance(\n    self, $attrs.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n\n  $scope.$on('$destroy', function() {\n    deregisterInstance();\n    deregisterBackButtonAction();\n    self.$scope = null;\n    if (self.content) {\n      self.content.element = null;\n      self.content = null;\n    }\n\n    // ensure scrolls are unfrozen\n    freezeAllScrolls(false);\n  });\n\n  self.initialize({\n    left: {\n      width: 275\n    },\n    right: {\n      width: 275\n    }\n  });\n\n}]);\n\n(function(ionic) {\n\n  var TRANSLATE32 = 'translate(32,32)';\n  var STROKE_OPACITY = 'stroke-opacity';\n  var ROUND = 'round';\n  var INDEFINITE = 'indefinite';\n  var DURATION = '750ms';\n  var NONE = 'none';\n  var SHORTCUTS = {\n    a: 'animate',\n    an: 'attributeName',\n    at: 'animateTransform',\n    c: 'circle',\n    da: 'stroke-dasharray',\n    os: 'stroke-dashoffset',\n    f: 'fill',\n    lc: 'stroke-linecap',\n    rc: 'repeatCount',\n    sw: 'stroke-width',\n    t: 'transform',\n    v: 'values'\n  };\n\n  var SPIN_ANIMATION = {\n    v: '0,32,32;360,32,32',\n    an: 'transform',\n    type: 'rotate',\n    rc: INDEFINITE,\n    dur: DURATION\n  };\n\n  function createSvgElement(tagName, data, parent, spinnerName) {\n    var ele = document.createElement(SHORTCUTS[tagName] || tagName);\n    var k, x, y;\n\n    for (k in data) {\n\n      if (angular.isArray(data[k])) {\n        for (x = 0; x < data[k].length; x++) {\n          if (data[k][x].fn) {\n            for (y = 0; y < data[k][x].t; y++) {\n              createSvgElement(k, data[k][x].fn(y, spinnerName), ele, spinnerName);\n            }\n          } else {\n            createSvgElement(k, data[k][x], ele, spinnerName);\n          }\n        }\n\n      } else {\n        setSvgAttribute(ele, k, data[k]);\n      }\n    }\n\n    parent.appendChild(ele);\n  }\n\n  function setSvgAttribute(ele, k, v) {\n    ele.setAttribute(SHORTCUTS[k] || k, v);\n  }\n\n  function animationValues(strValues, i) {\n    var values = strValues.split(';');\n    var back = values.slice(i);\n    var front = values.slice(0, values.length - back.length);\n    values = back.concat(front).reverse();\n    return values.join(';') + ';' + values[0];\n  }\n\n  var IOS_SPINNER = {\n    sw: 4,\n    lc: ROUND,\n    line: [{\n      fn: function(i, spinnerName) {\n        return {\n          y1: spinnerName == 'ios' ? 17 : 12,\n          y2: spinnerName == 'ios' ? 29 : 20,\n          t: TRANSLATE32 + ' rotate(' + (30 * i + (i < 6 ? 180 : -180)) + ')',\n          a: [{\n            fn: function() {\n              return {\n                an: STROKE_OPACITY,\n                dur: DURATION,\n                v: animationValues('0;.1;.15;.25;.35;.45;.55;.65;.7;.85;1', i),\n                rc: INDEFINITE\n              };\n            },\n            t: 1\n          }]\n        };\n      },\n      t: 12\n    }]\n  };\n\n  var spinners = {\n\n    android: {\n      c: [{\n        sw: 6,\n        da: 128,\n        os: 82,\n        r: 26,\n        cx: 32,\n        cy: 32,\n        f: NONE\n      }]\n    },\n\n    ios: IOS_SPINNER,\n\n    'ios-small': IOS_SPINNER,\n\n    bubbles: {\n      sw: 0,\n      c: [{\n        fn: function(i) {\n          return {\n            cx: 24 * Math.cos(2 * Math.PI * i / 8),\n            cy: 24 * Math.sin(2 * Math.PI * i / 8),\n            t: TRANSLATE32,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'r',\n                  dur: DURATION,\n                  v: animationValues('1;2;3;4;5;6;7;8', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 8\n      }]\n    },\n\n    circles: {\n\n      c: [{\n        fn: function(i) {\n          return {\n            r: 5,\n            cx: 24 * Math.cos(2 * Math.PI * i / 8),\n            cy: 24 * Math.sin(2 * Math.PI * i / 8),\n            t: TRANSLATE32,\n            sw: 0,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'fill-opacity',\n                  dur: DURATION,\n                  v: animationValues('.3;.3;.3;.4;.7;.85;.9;1', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 8\n      }]\n    },\n\n    crescent: {\n      c: [{\n        sw: 4,\n        da: 128,\n        os: 82,\n        r: 26,\n        cx: 32,\n        cy: 32,\n        f: NONE,\n        at: [SPIN_ANIMATION]\n      }]\n    },\n\n    dots: {\n\n      c: [{\n        fn: function(i) {\n          return {\n            cx: 16 + (16 * i),\n            cy: 32,\n            sw: 0,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'fill-opacity',\n                  dur: DURATION,\n                  v: animationValues('.5;.6;.8;1;.8;.6;.5', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: 'r',\n                  dur: DURATION,\n                  v: animationValues('4;5;6;5;4;3;3', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 3\n      }]\n    },\n\n    lines: {\n      sw: 7,\n      lc: ROUND,\n      line: [{\n        fn: function(i) {\n          return {\n            x1: 10 + (i * 14),\n            x2: 10 + (i * 14),\n            a: [{\n              fn: function() {\n                return {\n                  an: 'y1',\n                  dur: DURATION,\n                  v: animationValues('16;18;28;18;16', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: 'y2',\n                  dur: DURATION,\n                  v: animationValues('48;44;36;46;48', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: STROKE_OPACITY,\n                  dur: DURATION,\n                  v: animationValues('1;.8;.5;.4;1', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 4\n      }]\n    },\n\n    ripple: {\n      f: NONE,\n      'fill-rule': 'evenodd',\n      sw: 3,\n      circle: [{\n        fn: function(i) {\n          return {\n            cx: 32,\n            cy: 32,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'r',\n                  begin: (i * -1) + 's',\n                  dur: '2s',\n                  v: '0;24',\n                  keyTimes: '0;1',\n                  keySplines: '0.1,0.2,0.3,1',\n                  calcMode: 'spline',\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: STROKE_OPACITY,\n                  begin: (i * -1) + 's',\n                  dur: '2s',\n                  v: '.2;1;.2;0',\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 2\n      }]\n    },\n\n    spiral: {\n      defs: [{\n        linearGradient: [{\n          id: 'sGD',\n          gradientUnits: 'userSpaceOnUse',\n          x1: 55, y1: 46, x2: 2, y2: 46,\n          stop: [{\n            offset: 0.1,\n            class: 'stop1'\n          }, {\n            offset: 1,\n            class: 'stop2'\n          }]\n        }]\n      }],\n      g: [{\n        sw: 4,\n        lc: ROUND,\n        f: NONE,\n        path: [{\n          stroke: 'url(#sGD)',\n          d: 'M4,32 c0,15,12,28,28,28c8,0,16-4,21-9'\n        }, {\n          d: 'M60,32 C60,16,47.464,4,32,4S4,16,4,32'\n        }],\n        at: [SPIN_ANIMATION]\n      }]\n    }\n\n  };\n\n  var animations = {\n\n    android: function(ele) {\n      var rIndex = 0;\n      var rotateCircle = 0;\n      var startTime;\n      var svgEle = ele.querySelector('g');\n      var circleEle = ele.querySelector('circle');\n\n      function run() {\n        var v = easeInOutCubic(Date.now() - startTime, 650);\n        var scaleX = 1;\n        var translateX = 0;\n        var dasharray = (188 - (58 * v));\n        var dashoffset = (182 - (182 * v));\n\n        if (rIndex % 2) {\n          scaleX = -1;\n          translateX = -64;\n          dasharray = (128 - (-58 * v));\n          dashoffset = (182 * v);\n        }\n\n        var rotateLine = [0, -101, -90, -11, -180, 79, -270, -191][rIndex];\n\n        setSvgAttribute(circleEle, 'da', Math.max(Math.min(dasharray, 188), 128));\n        setSvgAttribute(circleEle, 'os', Math.max(Math.min(dashoffset, 182), 0));\n        setSvgAttribute(circleEle, 't', 'scale(' + scaleX + ',1) translate(' + translateX + ',0) rotate(' + rotateLine + ',32,32)');\n\n        rotateCircle += 4.1;\n        if (rotateCircle > 359) rotateCircle = 0;\n        setSvgAttribute(svgEle, 't', 'rotate(' + rotateCircle + ',32,32)');\n\n        if (v >= 1) {\n          rIndex++;\n          if (rIndex > 7) rIndex = 0;\n          startTime = Date.now();\n        }\n\n        ionic.requestAnimationFrame(run);\n      }\n\n      return function() {\n        startTime = Date.now();\n        run();\n      };\n\n    }\n\n  };\n\n  function easeInOutCubic(t, c) {\n    t /= c / 2;\n    if (t < 1) return 1 / 2 * t * t * t;\n    t -= 2;\n    return 1 / 2 * (t * t * t + 2);\n  }\n\n\n  IonicModule\n  .controller('$ionicSpinner', [\n    '$element',\n    '$attrs',\n  function($element, $attrs) {\n    var spinnerName, spinner;\n\n    this.init = function() {\n      var override = null;\n      if (ionic.Platform.platform() === 'windowsphone') {\n        override = 'android';\n      }\n      spinnerName = $attrs.icon || override || ionic.Platform.platform();\n      spinner = spinners[spinnerName];\n      if (!spinner) {\n        spinnerName = 'ios';\n        spinner = spinners.ios;\n      }\n\n      var container = document.createElement('div');\n      createSvgElement('svg', {\n        viewBox: '0 0 64 64',\n        g: [spinners[spinnerName]]\n      }, container, spinnerName);\n\n      // Specifically for animations to work,\n      // Android 4.3 and below requires the element to be\n      // added as an html string, rather than dynmically\n      // building up the svg element and appending it.\n      $element.html(container.innerHTML);\n\n      this.start();\n\n      return spinnerName;\n    };\n\n    this.start = function() {\n      animations[spinnerName] && animations[spinnerName]($element[0])();\n    };\n\n  }]);\n\n})(ionic);\n\nIonicModule\n.controller('$ionicTab', [\n  '$scope',\n  '$ionicHistory',\n  '$attrs',\n  '$location',\n  '$state',\nfunction($scope, $ionicHistory, $attrs, $location, $state) {\n  this.$scope = $scope;\n\n  //All of these exposed for testing\n  this.hrefMatchesState = function() {\n    return $attrs.href && $location.path().indexOf(\n      $attrs.href.replace(/^#/, '').replace(/\\/$/, '')\n    ) === 0;\n  };\n  this.srefMatchesState = function() {\n    return $attrs.uiSref && $state.includes($attrs.uiSref.split('(')[0]);\n  };\n  this.navNameMatchesState = function() {\n    return this.navViewName && $ionicHistory.isCurrentStateNavView(this.navViewName);\n  };\n\n  this.tabMatchesState = function() {\n    return this.hrefMatchesState() || this.srefMatchesState() || this.navNameMatchesState();\n  };\n}]);\n\nIonicModule\n.controller('$ionicTabs', [\n  '$scope',\n  '$element',\n  '$ionicHistory',\nfunction($scope, $element, $ionicHistory) {\n  var self = this;\n  var selectedTab = null;\n  var previousSelectedTab = null;\n  var selectedTabIndex;\n  self.tabs = [];\n\n  self.selectedIndex = function() {\n    return self.tabs.indexOf(selectedTab);\n  };\n  self.selectedTab = function() {\n    return selectedTab;\n  };\n  self.previousSelectedTab = function() {\n    return previousSelectedTab;\n  };\n\n  self.add = function(tab) {\n    $ionicHistory.registerHistory(tab);\n    self.tabs.push(tab);\n  };\n\n  self.remove = function(tab) {\n    var tabIndex = self.tabs.indexOf(tab);\n    if (tabIndex === -1) {\n      return;\n    }\n    //Use a field like '$tabSelected' so developers won't accidentally set it in controllers etc\n    if (tab.$tabSelected) {\n      self.deselect(tab);\n      //Try to select a new tab if we're removing a tab\n      if (self.tabs.length === 1) {\n        //Do nothing if there are no other tabs to select\n      } else {\n        //Select previous tab if it's the last tab, else select next tab\n        var newTabIndex = tabIndex === self.tabs.length - 1 ? tabIndex - 1 : tabIndex + 1;\n        self.select(self.tabs[newTabIndex]);\n      }\n    }\n    self.tabs.splice(tabIndex, 1);\n  };\n\n  self.deselect = function(tab) {\n    if (tab.$tabSelected) {\n      previousSelectedTab = selectedTab;\n      selectedTab = selectedTabIndex = null;\n      tab.$tabSelected = false;\n      (tab.onDeselect || noop)();\n      tab.$broadcast && tab.$broadcast('$ionicHistory.deselect');\n    }\n  };\n\n  self.select = function(tab, shouldEmitEvent) {\n    var tabIndex;\n    if (isNumber(tab)) {\n      tabIndex = tab;\n      if (tabIndex >= self.tabs.length) return;\n      tab = self.tabs[tabIndex];\n    } else {\n      tabIndex = self.tabs.indexOf(tab);\n    }\n\n    if (arguments.length === 1) {\n      shouldEmitEvent = !!(tab.navViewName || tab.uiSref);\n    }\n\n    if (selectedTab && selectedTab.$historyId == tab.$historyId) {\n      if (shouldEmitEvent) {\n        $ionicHistory.goToHistoryRoot(tab.$historyId);\n      }\n\n    } else if (selectedTabIndex !== tabIndex) {\n      forEach(self.tabs, function(tab) {\n        self.deselect(tab);\n      });\n\n      selectedTab = tab;\n      selectedTabIndex = tabIndex;\n\n      if (self.$scope && self.$scope.$parent) {\n        self.$scope.$parent.$activeHistoryId = tab.$historyId;\n      }\n\n      //Use a funny name like $tabSelected so the developer doesn't overwrite the var in a child scope\n      tab.$tabSelected = true;\n      (tab.onSelect || noop)();\n\n      if (shouldEmitEvent) {\n        $scope.$emit('$ionicHistory.change', {\n          type: 'tab',\n          tabIndex: tabIndex,\n          historyId: tab.$historyId,\n          navViewName: tab.navViewName,\n          hasNavView: !!tab.navViewName,\n          title: tab.title,\n          url: tab.href,\n          uiSref: tab.uiSref\n        });\n      }\n    }\n  };\n\n  self.hasActiveScope = function() {\n    for (var x = 0; x < self.tabs.length; x++) {\n      if ($ionicHistory.isActiveScope(self.tabs[x])) {\n        return true;\n      }\n    }\n    return false;\n  };\n\n}]);\n\nIonicModule\n.controller('$ionicView', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$rootScope',\nfunction($scope, $element, $attrs, $compile, $rootScope) {\n  var self = this;\n  var navElementHtml = {};\n  var navViewCtrl;\n  var navBarDelegateHandle;\n  var hasViewHeaderBar;\n  var deregisters = [];\n  var viewTitle;\n\n  var deregIonNavBarInit = $scope.$on('ionNavBar.init', function(ev, delegateHandle) {\n    // this view has its own ion-nav-bar, remember the navBarDelegateHandle for this view\n    ev.stopPropagation();\n    navBarDelegateHandle = delegateHandle;\n  });\n\n\n  self.init = function() {\n    deregIonNavBarInit();\n\n    var modalCtrl = $element.inheritedData('$ionModalController');\n    navViewCtrl = $element.inheritedData('$ionNavViewController');\n\n    // don't bother if inside a modal or there's no parent navView\n    if (!navViewCtrl || modalCtrl) return;\n\n    // add listeners for when this view changes\n    $scope.$on('$ionicView.beforeEnter', self.beforeEnter);\n    $scope.$on('$ionicView.afterEnter', afterEnter);\n    $scope.$on('$ionicView.beforeLeave', deregisterFns);\n  };\n\n  self.beforeEnter = function(ev, transData) {\n    // this event was emitted, starting at intial ion-view, then bubbles up\n    // only the first ion-view should do something with it, parent ion-views should ignore\n    if (transData && !transData.viewNotified) {\n      transData.viewNotified = true;\n\n      if (!$rootScope.$$phase) $scope.$digest();\n      viewTitle = isDefined($attrs.viewTitle) ? $attrs.viewTitle : $attrs.title;\n\n      var navBarItems = {};\n      for (var n in navElementHtml) {\n        navBarItems[n] = generateNavBarItem(navElementHtml[n]);\n      }\n\n      navViewCtrl.beforeEnter(extend(transData, {\n        title: viewTitle,\n        showBack: !attrTrue('hideBackButton'),\n        navBarItems: navBarItems,\n        navBarDelegate: navBarDelegateHandle || null,\n        showNavBar: !attrTrue('hideNavBar'),\n        hasHeaderBar: !!hasViewHeaderBar\n      }));\n\n      // make sure any existing observers are cleaned up\n      deregisterFns();\n    }\n  };\n\n\n  function afterEnter() {\n    // only listen for title updates after it has entered\n    // but also deregister the observe before it leaves\n    var viewTitleAttr = isDefined($attrs.viewTitle) && 'viewTitle' || isDefined($attrs.title) && 'title';\n    if (viewTitleAttr) {\n      titleUpdate($attrs[viewTitleAttr]);\n      deregisters.push($attrs.$observe(viewTitleAttr, titleUpdate));\n    }\n\n    if (isDefined($attrs.hideBackButton)) {\n      deregisters.push($scope.$watch($attrs.hideBackButton, function(val) {\n        navViewCtrl.showBackButton(!val);\n      }));\n    }\n\n    if (isDefined($attrs.hideNavBar)) {\n      deregisters.push($scope.$watch($attrs.hideNavBar, function(val) {\n        navViewCtrl.showBar(!val);\n      }));\n    }\n  }\n\n\n  function titleUpdate(newTitle) {\n    if (isDefined(newTitle) && newTitle !== viewTitle) {\n      viewTitle = newTitle;\n      navViewCtrl.title(viewTitle);\n    }\n  }\n\n\n  function deregisterFns() {\n    // remove all existing $attrs.$observe's\n    for (var x = 0; x < deregisters.length; x++) {\n      deregisters[x]();\n    }\n    deregisters = [];\n  }\n\n\n  function generateNavBarItem(html) {\n    if (html) {\n      // every time a view enters we need to recreate its view buttons if they exist\n      return $compile(html)($scope.$new());\n    }\n  }\n\n\n  function attrTrue(key) {\n    return !!$scope.$eval($attrs[key]);\n  }\n\n\n  self.navElement = function(type, html) {\n    navElementHtml[type] = html;\n  };\n\n}]);\n\n/*\n * We don't document the ionActionSheet directive, we instead document\n * the $ionicActionSheet service\n */\nIonicModule\n.directive('ionActionSheet', ['$document', function($document) {\n  return {\n    restrict: 'E',\n    scope: true,\n    replace: true,\n    link: function($scope, $element) {\n\n      var keyUp = function(e) {\n        if (e.which == 27) {\n          $scope.cancel();\n          $scope.$apply();\n        }\n      };\n\n      var backdropClick = function(e) {\n        if (e.target == $element[0]) {\n          $scope.cancel();\n          $scope.$apply();\n        }\n      };\n      $scope.$on('$destroy', function() {\n        $element.remove();\n        $document.unbind('keyup', keyUp);\n      });\n\n      $document.bind('keyup', keyUp);\n      $element.bind('click', backdropClick);\n    },\n    template: '<div class=\"action-sheet-backdrop\">' +\n                '<div class=\"action-sheet-wrapper\">' +\n                  '<div class=\"action-sheet\" ng-class=\"{\\'action-sheet-has-icons\\': $actionSheetHasIcon}\">' +\n                    '<div class=\"action-sheet-group action-sheet-options\">' +\n                      '<div class=\"action-sheet-title\" ng-if=\"titleText\" ng-bind-html=\"titleText\"></div>' +\n                      '<button class=\"button action-sheet-option\" ng-click=\"buttonClicked($index)\" ng-repeat=\"b in buttons\" ng-bind-html=\"b.text\"></button>' +\n                      '<button class=\"button destructive action-sheet-destructive\" ng-if=\"destructiveText\" ng-click=\"destructiveButtonClicked()\" ng-bind-html=\"destructiveText\"></button>' +\n                    '</div>' +\n                    '<div class=\"action-sheet-group action-sheet-cancel\" ng-if=\"cancelText\">' +\n                      '<button class=\"button\" ng-click=\"cancel()\" ng-bind-html=\"cancelText\"></button>' +\n                    '</div>' +\n                  '</div>' +\n                '</div>' +\n              '</div>'\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionCheckbox\n * @module ionic\n * @restrict E\n * @codepen hqcju\n * @description\n * The checkbox is no different than the HTML checkbox input, except it's styled differently.\n *\n * The checkbox behaves like any [AngularJS checkbox](http://docs.angularjs.org/api/ng/input/input[checkbox]).\n *\n * @usage\n * ```html\n * <ion-checkbox ng-model=\"isChecked\">Checkbox Label</ion-checkbox>\n * ```\n */\n\nIonicModule\n.directive('ionCheckbox', ['$ionicConfig', function($ionicConfig) {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<label class=\"item item-checkbox\">' +\n        '<div class=\"checkbox checkbox-input-hidden disable-pointer-events\">' +\n          '<input type=\"checkbox\">' +\n          '<i class=\"checkbox-icon\"></i>' +\n        '</div>' +\n        '<div class=\"item-content disable-pointer-events\" ng-transclude></div>' +\n      '</label>',\n    compile: function(element, attr) {\n      var input = element.find('input');\n      forEach({\n        'name': attr.name,\n        'ng-value': attr.ngValue,\n        'ng-model': attr.ngModel,\n        'ng-checked': attr.ngChecked,\n        'ng-disabled': attr.ngDisabled,\n        'ng-true-value': attr.ngTrueValue,\n        'ng-false-value': attr.ngFalseValue,\n        'ng-change': attr.ngChange,\n        'ng-required': attr.ngRequired,\n        'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n          input.attr(name, value);\n        }\n      });\n      var checkboxWrapper = element[0].querySelector('.checkbox');\n      checkboxWrapper.classList.add('checkbox-' + $ionicConfig.form.checkbox());\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @restrict A\n * @name collectionRepeat\n * @module ionic\n * @codepen 7ec1ec58f2489ab8f359fa1a0fe89c15\n * @description\n * `collection-repeat` allows an app to show huge lists of items much more performantly than\n * `ng-repeat`.\n *\n * It renders into the DOM only as many items as are currently visible.\n *\n * This means that on a phone screen that can fit eight items, only the eight items matching\n * the current scroll position will be rendered.\n *\n * **The Basics**:\n *\n * - The data given to collection-repeat must be an array.\n * - If the `item-height` and `item-width` attributes are not supplied, it will be assumed that\n *   every item in the list has the same dimensions as the first item.\n * - Don't use angular one-time binding (`::`) with collection-repeat. The scope of each item is\n *   assigned new data and re-digested as you scroll. Bindings need to update, and one-time bindings\n *   won't.\n *\n * **Performance Tips**:\n *\n * - The iOS webview has a performance bottleneck when switching out `<img src>` attributes.\n *   To increase performance of images on iOS, cache your images in advance and,\n *   if possible, lower the number of unique images. We're working on [a solution](https://github.com/driftyco/ionic/issues/3194).\n *\n * @usage\n * #### Basic Item List ([codepen](http://codepen.io/ionic/pen/0c2c35a34a8b18ad4d793fef0b081693))\n * ```html\n * <ion-content>\n *   <ion-item collection-repeat=\"item in items\">\n *     {% raw %}{{item}}{% endraw %}\n *   </ion-item>\n * </ion-content>\n * ```\n *\n * #### Grid of Images ([codepen](http://codepen.io/ionic/pen/5515d4efd9d66f780e96787387f41664))\n * ```html\n * <ion-content>\n *   <img collection-repeat=\"photo in photos\"\n *     item-width=\"33%\"\n *     item-height=\"200px\"\n *     ng-src=\"{% raw %}{{photo.url}}{% endraw %}\">\n * </ion-content>\n * ```\n *\n * #### Horizontal Scroller, Dynamic Item Width ([codepen](http://codepen.io/ionic/pen/67cc56b349124a349acb57a0740e030e))\n * ```html\n * <ion-content>\n *   <h2>Available Kittens:</h2>\n *   <ion-scroll direction=\"x\" class=\"available-scroller\">\n *     <div class=\"photo\" collection-repeat=\"photo in main.photos\"\n *        item-height=\"250\" item-width=\"photo.width + 30\">\n *        <img ng-src=\"{{photo.src}}\">\n *     </div>\n *   </ion-scroll>\n * </ion-content>\n * ```\n *\n * @param {expression} collection-repeat The expression indicating how to enumerate a collection,\n *   of the format  `variable in expression` – where variable is the user defined loop variable\n *   and `expression` is a scope expression giving the collection to enumerate.\n *   For example: `album in artist.albums` or `album in artist.albums | orderBy:'name'`.\n * @param {expression=} item-width The width of the repeated element. The expression must return\n *   a number (pixels) or a percentage. Defaults to the width of the first item in the list.\n *   (previously named collection-item-width)\n * @param {expression=} item-height The height of the repeated element. The expression must return\n *   a number (pixels) or a percentage. Defaults to the height of the first item in the list.\n *   (previously named collection-item-height)\n * @param {number=} item-render-buffer The number of items to load before and after the visible\n *   items in the list. Default 3. Tip: set this higher if you have lots of images to preload, but\n *   don't set it too high or you'll see performance loss.\n * @param {boolean=} force-refresh-images Force images to refresh as you scroll. This fixes a problem\n *   where, when an element is interchanged as scrolling, its image will still have the old src\n *   while the new src loads. Setting this to true comes with a small performance loss.\n */\n\nIonicModule\n.directive('collectionRepeat', CollectionRepeatDirective)\n.factory('$ionicCollectionManager', RepeatManagerFactory);\n\nvar ONE_PX_TRANSPARENT_IMG_SRC = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\nvar WIDTH_HEIGHT_REGEX = /height:.*?px;\\s*width:.*?px/;\nvar DEFAULT_RENDER_BUFFER = 3;\n\nCollectionRepeatDirective.$inject = ['$ionicCollectionManager', '$parse', '$window', '$$rAF', '$rootScope', '$timeout'];\nfunction CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$rAF, $rootScope, $timeout) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    transclude: 'element',\n    $$tlb: true,\n    require: '^^$ionicScroll',\n    link: postLink\n  };\n\n  function postLink(scope, element, attr, scrollCtrl, transclude) {\n    var scrollView = scrollCtrl.scrollView;\n    var node = element[0];\n    var containerNode = angular.element('<div class=\"collection-repeat-container\">')[0];\n    node.parentNode.replaceChild(containerNode, node);\n\n    if (scrollView.options.scrollingX && scrollView.options.scrollingY) {\n      throw new Error(\"collection-repeat expected a parent x or y scrollView, not \" +\n                      \"an xy scrollView.\");\n    }\n\n    var repeatExpr = attr.collectionRepeat;\n    var match = repeatExpr.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n    if (!match) {\n      throw new Error(\"collection-repeat expected expression in form of '_item_ in \" +\n                      \"_collection_[ track by _id_]' but got '\" + attr.collectionRepeat + \"'.\");\n    }\n    var keyExpr = match[1];\n    var listExpr = match[2];\n    var listGetter = $parse(listExpr);\n    var heightData = {};\n    var widthData = {};\n    var computedStyleDimensions = {};\n    var data = [];\n    var repeatManager;\n\n    // attr.collectionBufferSize is deprecated\n    var renderBufferExpr = attr.itemRenderBuffer || attr.collectionBufferSize;\n    var renderBuffer = angular.isDefined(renderBufferExpr) ?\n      parseInt(renderBufferExpr) :\n      DEFAULT_RENDER_BUFFER;\n\n    // attr.collectionItemHeight is deprecated\n    var heightExpr = attr.itemHeight || attr.collectionItemHeight;\n    // attr.collectionItemWidth is deprecated\n    var widthExpr = attr.itemWidth || attr.collectionItemWidth;\n\n    var afterItemsContainer = initAfterItemsContainer();\n\n    var changeValidator = makeChangeValidator();\n    initDimensions();\n\n    // Dimensions are refreshed on resize or data change.\n    scrollCtrl.$element.on('scroll-resize', refreshDimensions);\n\n    angular.element($window).on('resize', onResize);\n    var unlistenToExposeAside = $rootScope.$on('$ionicExposeAside', ionic.animationFrameThrottle(function() {\n      scrollCtrl.scrollView.resize();\n      onResize();\n    }));\n    $timeout(refreshDimensions, 0, false);\n\n    function onResize() {\n      if (changeValidator.resizeRequiresRefresh(scrollView.__clientWidth, scrollView.__clientHeight)) {\n        refreshDimensions();\n      }\n    }\n\n    scope.$watchCollection(listGetter, function(newValue) {\n      data = newValue || (newValue = []);\n      if (!angular.isArray(newValue)) {\n        throw new Error(\"collection-repeat expected an array for '\" + listExpr + \"', \" +\n          \"but got a \" + typeof value);\n      }\n      // Wait for this digest to end before refreshing everything.\n      scope.$$postDigest(function() {\n        getRepeatManager().setData(data);\n        if (changeValidator.dataChangeRequiresRefresh(data)) refreshDimensions();\n      });\n    });\n\n    scope.$on('$destroy', function() {\n      angular.element($window).off('resize', onResize);\n      unlistenToExposeAside();\n      scrollCtrl.$element && scrollCtrl.$element.off('scroll-resize', refreshDimensions);\n\n      computedStyleNode && computedStyleNode.parentNode &&\n        computedStyleNode.parentNode.removeChild(computedStyleNode);\n      computedStyleScope && computedStyleScope.$destroy();\n      computedStyleScope = computedStyleNode = null;\n\n      repeatManager && repeatManager.destroy();\n      repeatManager = null;\n    });\n\n    function makeChangeValidator() {\n      var self;\n      return (self = {\n        dataLength: 0,\n        width: 0,\n        height: 0,\n        // A resize triggers a refresh only if we have data, the scrollView has size,\n        // and the size has changed.\n        resizeRequiresRefresh: function(newWidth, newHeight) {\n          var requiresRefresh = self.dataLength && newWidth && newHeight &&\n            (newWidth !== self.width || newHeight !== self.height);\n\n          self.width = newWidth;\n          self.height = newHeight;\n\n          return !!requiresRefresh;\n        },\n        // A change in data only triggers a refresh if the data has length, or if the data's\n        // length is less than before.\n        dataChangeRequiresRefresh: function(newData) {\n          var requiresRefresh = newData.length > 0 || newData.length < self.dataLength;\n\n          self.dataLength = newData.length;\n\n          return !!requiresRefresh;\n        }\n      });\n    }\n\n    function getRepeatManager() {\n      return repeatManager || (repeatManager = new $ionicCollectionManager({\n        afterItemsNode: afterItemsContainer[0],\n        containerNode: containerNode,\n        heightData: heightData,\n        widthData: widthData,\n        forceRefreshImages: !!(isDefined(attr.forceRefreshImages) && attr.forceRefreshImages !== 'false'),\n        keyExpression: keyExpr,\n        renderBuffer: renderBuffer,\n        scope: scope,\n        scrollView: scrollCtrl.scrollView,\n        transclude: transclude\n      }));\n    }\n\n    function initAfterItemsContainer() {\n      var container = angular.element(\n        scrollView.__content.querySelector('.collection-repeat-after-container')\n      );\n      // Put everything in the view after the repeater into a container.\n      if (!container.length) {\n        var elementIsAfterRepeater = false;\n        var afterNodes = [].filter.call(scrollView.__content.childNodes, function(node) {\n          if (ionic.DomUtil.contains(node, containerNode)) {\n            elementIsAfterRepeater = true;\n            return false;\n          }\n          return elementIsAfterRepeater;\n        });\n        container = angular.element('<span class=\"collection-repeat-after-container\">');\n        if (scrollView.options.scrollingX) {\n          container.addClass('horizontal');\n        }\n        container.append(afterNodes);\n        scrollView.__content.appendChild(container[0]);\n      }\n      return container;\n    }\n\n    function initDimensions() {\n      //Height and width have four 'modes':\n      //1) Computed Mode\n      //  - Nothing is supplied, so we getComputedStyle() on one element in the list and use\n      //    that width and height value for the width and height of every item. This is re-computed\n      //    every resize.\n      //2) Constant Mode, Static Integer\n      //  - The user provides a constant number for width or height, in pixels. We parse it,\n      //    store it on the `value` field, and it never changes\n      //3) Constant Mode, Percent\n      //  - The user provides a percent string for width or height. The getter for percent is\n      //    stored on the `getValue()` field, and is re-evaluated once every resize. The result\n      //    is stored on the `value` field.\n      //4) Dynamic Mode\n      //  - The user provides a dynamic expression for the width or height.  This is re-evaluated\n      //    for every item, stored on the `.getValue()` field.\n      if (heightExpr) {\n        parseDimensionAttr(heightExpr, heightData);\n      } else {\n        heightData.computed = true;\n      }\n      if (widthExpr) {\n        parseDimensionAttr(widthExpr, widthData);\n      } else {\n        widthData.computed = true;\n      }\n    }\n\n    function refreshDimensions() {\n      var hasData = data.length > 0;\n\n      if (hasData && (heightData.computed || widthData.computed)) {\n        computeStyleDimensions();\n      }\n\n      if (hasData && heightData.computed) {\n        heightData.value = computedStyleDimensions.height;\n        if (!heightData.value) {\n          throw new Error('collection-repeat tried to compute the height of repeated elements \"' +\n            repeatExpr + '\", but was unable to. Please provide the \"item-height\" attribute. ' +\n            'http://ionicframework.com/docs/api/directive/collectionRepeat/');\n        }\n      } else if (!heightData.dynamic && heightData.getValue) {\n        // If it's a constant with a getter (eg percent), we just refresh .value after resize\n        heightData.value = heightData.getValue();\n      }\n\n      if (hasData && widthData.computed) {\n        widthData.value = computedStyleDimensions.width;\n        if (!widthData.value) {\n          throw new Error('collection-repeat tried to compute the width of repeated elements \"' +\n            repeatExpr + '\", but was unable to. Please provide the \"item-width\" attribute. ' +\n            'http://ionicframework.com/docs/api/directive/collectionRepeat/');\n        }\n      } else if (!widthData.dynamic && widthData.getValue) {\n        // If it's a constant with a getter (eg percent), we just refresh .value after resize\n        widthData.value = widthData.getValue();\n      }\n      // Dynamic dimensions aren't updated on resize. Since they're already dynamic anyway,\n      // .getValue() will be used.\n\n      getRepeatManager().refreshLayout();\n    }\n\n    function parseDimensionAttr(attrValue, dimensionData) {\n      if (!attrValue) return;\n\n      var parsedValue;\n      // Try to just parse the plain attr value\n      try {\n        parsedValue = $parse(attrValue);\n      } catch (e) {\n        // If the parse fails and the value has `px` or `%` in it, surround the attr in\n        // quotes, to attempt to let the user provide a simple `attr=\"100%\"` or `attr=\"100px\"`\n        if (attrValue.trim().match(/\\d+(px|%)$/)) {\n          attrValue = '\"' + attrValue + '\"';\n        }\n        parsedValue = $parse(attrValue);\n      }\n\n      var constantAttrValue = attrValue.replace(/(\\'|\\\"|px|%)/g, '').trim();\n      var isConstant = constantAttrValue.length && !/([a-zA-Z]|\\$|:|\\?)/.test(constantAttrValue);\n      dimensionData.attrValue = attrValue;\n\n      // If it's a constant, it's either a percent or just a constant pixel number.\n      if (isConstant) {\n        var intValue = parseInt(parsedValue());\n\n        // For percents, store the percent getter on .getValue()\n        if (attrValue.indexOf('%') > -1) {\n          var decimalValue = intValue / 100;\n          dimensionData.getValue = dimensionData === heightData ?\n            function() { return Math.floor(decimalValue * scrollView.__clientHeight); } :\n            function() { return Math.floor(decimalValue * scrollView.__clientWidth); };\n        } else {\n          // For static constants, just store the static constant.\n          dimensionData.value = intValue;\n        }\n\n      } else {\n        dimensionData.dynamic = true;\n        dimensionData.getValue = dimensionData === heightData ?\n          function heightGetter(scope, locals) {\n            var result = parsedValue(scope, locals);\n            if (result.charAt && result.charAt(result.length - 1) === '%') {\n              return Math.floor(parseInt(result) / 100 * scrollView.__clientHeight);\n            }\n            return parseInt(result);\n          } :\n          function widthGetter(scope, locals) {\n            var result = parsedValue(scope, locals);\n            if (result.charAt && result.charAt(result.length - 1) === '%') {\n              return Math.floor(parseInt(result) / 100 * scrollView.__clientWidth);\n            }\n            return parseInt(result);\n          };\n      }\n    }\n\n    var computedStyleNode;\n    var computedStyleScope;\n    function computeStyleDimensions() {\n      if (!computedStyleNode) {\n        transclude(computedStyleScope = scope.$new(), function(clone) {\n          clone[0].removeAttribute('collection-repeat'); // remove absolute position styling\n          computedStyleNode = clone[0];\n        });\n      }\n\n      computedStyleScope[keyExpr] = (listGetter(scope) || [])[0];\n      if (!$rootScope.$$phase) computedStyleScope.$digest();\n      containerNode.appendChild(computedStyleNode);\n\n      var style = $window.getComputedStyle(computedStyleNode);\n      computedStyleDimensions.width = parseInt(style.width);\n      computedStyleDimensions.height = parseInt(style.height);\n\n      containerNode.removeChild(computedStyleNode);\n    }\n\n  }\n\n}\n\nRepeatManagerFactory.$inject = ['$rootScope', '$window', '$$rAF'];\nfunction RepeatManagerFactory($rootScope, $window, $$rAF) {\n  var EMPTY_DIMENSION = { primaryPos: 0, secondaryPos: 0, primarySize: 0, secondarySize: 0, rowPrimarySize: 0 };\n\n  return function RepeatController(options) {\n    var afterItemsNode = options.afterItemsNode;\n    var containerNode = options.containerNode;\n    var forceRefreshImages = options.forceRefreshImages;\n    var heightData = options.heightData;\n    var widthData = options.widthData;\n    var keyExpression = options.keyExpression;\n    var renderBuffer = options.renderBuffer;\n    var scope = options.scope;\n    var scrollView = options.scrollView;\n    var transclude = options.transclude;\n\n    var data = [];\n\n    var getterLocals = {};\n    var heightFn = heightData.getValue || function() { return heightData.value; };\n    var heightGetter = function(index, value) {\n      getterLocals[keyExpression] = value;\n      getterLocals.$index = index;\n      return heightFn(scope, getterLocals);\n    };\n\n    var widthFn = widthData.getValue || function() { return widthData.value; };\n    var widthGetter = function(index, value) {\n      getterLocals[keyExpression] = value;\n      getterLocals.$index = index;\n      return widthFn(scope, getterLocals);\n    };\n\n    var isVertical = !!scrollView.options.scrollingY;\n\n    // We say it's a grid view if we're either dynamic or not 100% width\n    var isGridView = isVertical ?\n      (widthData.dynamic || widthData.value !== scrollView.__clientWidth) :\n      (heightData.dynamic || heightData.value !== scrollView.__clientHeight);\n\n    var isStaticView = !heightData.dynamic && !widthData.dynamic;\n\n    var PRIMARY = 'PRIMARY';\n    var SECONDARY = 'SECONDARY';\n    var TRANSLATE_TEMPLATE_STR = isVertical ?\n      'translate3d(SECONDARYpx,PRIMARYpx,0)' :\n      'translate3d(PRIMARYpx,SECONDARYpx,0)';\n    var WIDTH_HEIGHT_TEMPLATE_STR = isVertical ?\n      'height: PRIMARYpx; width: SECONDARYpx;' :\n      'height: SECONDARYpx; width: PRIMARYpx;';\n\n    var estimatedHeight;\n    var estimatedWidth;\n\n    var repeaterBeforeSize = 0;\n    var repeaterAfterSize = 0;\n\n    var renderStartIndex = -1;\n    var renderEndIndex = -1;\n    var renderAfterBoundary = -1;\n    var renderBeforeBoundary = -1;\n\n    var itemsPool = [];\n    var itemsLeaving = [];\n    var itemsEntering = [];\n    var itemsShownMap = {};\n    var nextItemId = 0;\n\n    var scrollViewSetDimensions = isVertical ?\n      function() { scrollView.setDimensions(null, null, null, view.getContentSize(), true); } :\n      function() { scrollView.setDimensions(null, null, view.getContentSize(), null, true); };\n\n    // view is a mix of list/grid methods + static/dynamic methods.\n    // See bottom for implementations. Available methods:\n    //\n    // getEstimatedPrimaryPos(i), getEstimatedSecondaryPos(i), getEstimatedIndex(scrollTop),\n    // calculateDimensions(toIndex), getDimensions(index),\n    // updateRenderRange(scrollTop, scrollValueEnd), onRefreshLayout(), onRefreshData()\n    var view = isVertical ? new VerticalViewType() : new HorizontalViewType();\n    (isGridView ? GridViewType : ListViewType).call(view);\n    (isStaticView ? StaticViewType : DynamicViewType).call(view);\n\n    var contentSizeStr = isVertical ? 'getContentHeight' : 'getContentWidth';\n    var originalGetContentSize = scrollView.options[contentSizeStr];\n    scrollView.options[contentSizeStr] = angular.bind(view, view.getContentSize);\n\n    scrollView.__$callback = scrollView.__callback;\n    scrollView.__callback = function(transformLeft, transformTop, zoom, wasResize) {\n      var scrollValue = view.getScrollValue();\n      if (renderStartIndex === -1 ||\n          scrollValue + view.scrollPrimarySize > renderAfterBoundary ||\n          scrollValue < renderBeforeBoundary) {\n        render();\n      }\n      scrollView.__$callback(transformLeft, transformTop, zoom, wasResize);\n    };\n\n    var isLayoutReady = false;\n    var isDataReady = false;\n    this.refreshLayout = function() {\n      if (data.length) {\n        estimatedHeight = heightGetter(0, data[0]);\n        estimatedWidth = widthGetter(0, data[0]);\n      } else {\n        // If we don't have any data in our array, just guess.\n        estimatedHeight = 100;\n        estimatedWidth = 100;\n      }\n\n      // Get the size of every element AFTER the repeater. We have to get the margin before and\n      // after the first/last element to fix a browser bug with getComputedStyle() not counting\n      // the first/last child's margins into height.\n      var style = getComputedStyle(afterItemsNode) || {};\n      var firstStyle = afterItemsNode.firstElementChild && getComputedStyle(afterItemsNode.firstElementChild) || {};\n      var lastStyle = afterItemsNode.lastElementChild && getComputedStyle(afterItemsNode.lastElementChild) || {};\n      repeaterAfterSize = (parseInt(style[isVertical ? 'height' : 'width']) || 0) +\n        (firstStyle && parseInt(firstStyle[isVertical ? 'marginTop' : 'marginLeft']) || 0) +\n        (lastStyle && parseInt(lastStyle[isVertical ? 'marginBottom' : 'marginRight']) || 0);\n\n      // Get the offsetTop of the repeater.\n      repeaterBeforeSize = 0;\n      var current = containerNode;\n      do {\n        repeaterBeforeSize += current[isVertical ? 'offsetTop' : 'offsetLeft'];\n      } while ( ionic.DomUtil.contains(scrollView.__content, current = current.offsetParent) );\n\n      var containerPrevNode = containerNode.previousElementSibling;\n      var beforeStyle = containerPrevNode ? $window.getComputedStyle(containerPrevNode) : {};\n      var beforeMargin = parseInt(beforeStyle[isVertical ? 'marginBottom' : 'marginRight'] || 0);\n\n      // Because we position the collection container with position: relative, it doesn't take\n      // into account where to position itself relative to the previous element's marginBottom.\n      // To compensate, we translate the container up by the previous element's margin.\n      containerNode.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n        .replace(PRIMARY, -beforeMargin)\n        .replace(SECONDARY, 0);\n      repeaterBeforeSize -= beforeMargin;\n\n      if (!scrollView.__clientHeight || !scrollView.__clientWidth) {\n        scrollView.__clientWidth = scrollView.__container.clientWidth;\n        scrollView.__clientHeight = scrollView.__container.clientHeight;\n      }\n\n      (view.onRefreshLayout || angular.noop)();\n      view.refreshDirection();\n      scrollViewSetDimensions();\n\n      // Create the pool of items for reuse, setting the size to (estimatedItemsOnScreen) * 2,\n      // plus the size of the renderBuffer.\n      if (!isLayoutReady) {\n        var poolSize = Math.max(20, renderBuffer * 3);\n        for (var i = 0; i < poolSize; i++) {\n          itemsPool.push(new RepeatItem());\n        }\n      }\n\n      isLayoutReady = true;\n      if (isLayoutReady && isDataReady) {\n        // If the resize or latest data change caused the scrollValue to\n        // now be out of bounds, resize the scrollView.\n        if (scrollView.__scrollLeft > scrollView.__maxScrollLeft ||\n            scrollView.__scrollTop > scrollView.__maxScrollTop) {\n          scrollView.resize();\n        }\n        forceRerender(true);\n      }\n    };\n\n    this.setData = function(newData) {\n      data = newData;\n      (view.onRefreshData || angular.noop)();\n      isDataReady = true;\n    };\n\n    this.destroy = function() {\n      render.destroyed = true;\n\n      itemsPool.forEach(function(item) {\n        item.scope.$destroy();\n        item.scope = item.element = item.node = item.images = null;\n      });\n      itemsPool.length = itemsEntering.length = itemsLeaving.length = 0;\n      itemsShownMap = {};\n\n      //Restore the scrollView's normal behavior and resize it to normal size.\n      scrollView.options[contentSizeStr] = originalGetContentSize;\n      scrollView.__callback = scrollView.__$callback;\n      scrollView.resize();\n\n      (view.onDestroy || angular.noop)();\n    };\n\n    function forceRerender() {\n      return render(true);\n    }\n    function render(forceRerender) {\n      if (render.destroyed) return;\n      var i;\n      var ii;\n      var item;\n      var dim;\n      var scope;\n      var scrollValue = view.getScrollValue();\n      var scrollValueEnd = scrollValue + view.scrollPrimarySize;\n\n      view.updateRenderRange(scrollValue, scrollValueEnd);\n\n      renderStartIndex = Math.max(0, renderStartIndex - renderBuffer);\n      renderEndIndex = Math.min(data.length - 1, renderEndIndex + renderBuffer);\n\n      for (i in itemsShownMap) {\n        if (i < renderStartIndex || i > renderEndIndex) {\n          item = itemsShownMap[i];\n          delete itemsShownMap[i];\n          itemsLeaving.push(item);\n          item.isShown = false;\n        }\n      }\n\n      // Render indicies that aren't shown yet\n      //\n      // NOTE(ajoslin): this may sound crazy, but calling any other functions during this render\n      // loop will often push the render time over the edge from less than one frame to over\n      // one frame, causing visible jank.\n      // DON'T call any other functions inside this loop unless it's vital.\n      for (i = renderStartIndex; i <= renderEndIndex; i++) {\n        // We only go forward with render if the index is in data, the item isn't already shown,\n        // or forceRerender is on.\n        if (i >= data.length || (itemsShownMap[i] && !forceRerender)) continue;\n\n        item = itemsShownMap[i] || (itemsShownMap[i] = itemsLeaving.length ? itemsLeaving.pop() :\n                                    itemsPool.length ? itemsPool.shift() :\n                                    new RepeatItem());\n        itemsEntering.push(item);\n        item.isShown = true;\n\n        scope = item.scope;\n        scope.$index = i;\n        scope[keyExpression] = data[i];\n        scope.$first = (i === 0);\n        scope.$last = (i === (data.length - 1));\n        scope.$middle = !(scope.$first || scope.$last);\n        scope.$odd = !(scope.$even = (i & 1) === 0);\n\n        if (scope.$$disconnected) ionic.Utils.reconnectScope(item.scope);\n\n        dim = view.getDimensions(i);\n        if (item.secondaryPos !== dim.secondaryPos || item.primaryPos !== dim.primaryPos) {\n          item.node.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n            .replace(PRIMARY, (item.primaryPos = dim.primaryPos))\n            .replace(SECONDARY, (item.secondaryPos = dim.secondaryPos));\n        }\n        if (item.secondarySize !== dim.secondarySize || item.primarySize !== dim.primarySize) {\n          item.node.style.cssText = item.node.style.cssText\n            .replace(WIDTH_HEIGHT_REGEX, WIDTH_HEIGHT_TEMPLATE_STR\n              //TODO fix item.primarySize + 1 hack\n              .replace(PRIMARY, (item.primarySize = dim.primarySize) + 1)\n              .replace(SECONDARY, (item.secondarySize = dim.secondarySize))\n            );\n        }\n\n      }\n\n      // If we reach the end of the list, render the afterItemsNode - this contains all the\n      // elements the developer placed after the collection-repeat\n      if (renderEndIndex === data.length - 1) {\n        dim = view.getDimensions(data.length - 1) || EMPTY_DIMENSION;\n        afterItemsNode.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n          .replace(PRIMARY, dim.primaryPos + dim.primarySize)\n          .replace(SECONDARY, 0);\n      }\n\n      while (itemsLeaving.length) {\n        item = itemsLeaving.pop();\n        item.scope.$broadcast('$collectionRepeatLeave');\n        ionic.Utils.disconnectScope(item.scope);\n        itemsPool.push(item);\n        item.node.style[ionic.CSS.TRANSFORM] = 'translate3d(-9999px,-9999px,0)';\n        item.primaryPos = item.secondaryPos = null;\n      }\n\n      if (forceRefreshImages) {\n        for (i = 0, ii = itemsEntering.length; i < ii && (item = itemsEntering[i]); i++) {\n          if (!item.images) continue;\n          for (var j = 0, jj = item.images.length, img; j < jj && (img = item.images[j]); j++) {\n            var src = img.src;\n            img.src = ONE_PX_TRANSPARENT_IMG_SRC;\n            img.src = src;\n          }\n        }\n      }\n      if (forceRerender) {\n        var rootScopePhase = $rootScope.$$phase;\n        while (itemsEntering.length) {\n          item = itemsEntering.pop();\n          if (!rootScopePhase) item.scope.$digest();\n        }\n      } else {\n        digestEnteringItems();\n      }\n    }\n\n    function digestEnteringItems() {\n      var item;\n      if (digestEnteringItems.running) return;\n      digestEnteringItems.running = true;\n\n      $$rAF(function process() {\n        var rootScopePhase = $rootScope.$$phase;\n        while (itemsEntering.length) {\n          item = itemsEntering.pop();\n          if (item.isShown) {\n            if (!rootScopePhase) item.scope.$digest();\n          }\n        }\n        digestEnteringItems.running = false;\n      });\n    }\n\n    function RepeatItem() {\n      var self = this;\n      this.scope = scope.$new();\n      this.id = 'item' + (nextItemId++);\n      transclude(this.scope, function(clone) {\n        self.element = clone;\n        self.element.data('$$collectionRepeatItem', self);\n        // TODO destroy\n        self.node = clone[0];\n        // Batch style setting to lower repaints\n        self.node.style[ionic.CSS.TRANSFORM] = 'translate3d(-9999px,-9999px,0)';\n        self.node.style.cssText += ' height: 0px; width: 0px;';\n        ionic.Utils.disconnectScope(self.scope);\n        containerNode.appendChild(self.node);\n        self.images = clone[0].getElementsByTagName('img');\n      });\n    }\n\n    function VerticalViewType() {\n      this.getItemPrimarySize = heightGetter;\n      this.getItemSecondarySize = widthGetter;\n\n      this.getScrollValue = function() {\n        return Math.max(0, Math.min(scrollView.__scrollTop - repeaterBeforeSize,\n          scrollView.__maxScrollTop - repeaterBeforeSize - repeaterAfterSize));\n      };\n\n      this.refreshDirection = function() {\n        this.scrollPrimarySize = scrollView.__clientHeight;\n        this.scrollSecondarySize = scrollView.__clientWidth;\n\n        this.estimatedPrimarySize = estimatedHeight;\n        this.estimatedSecondarySize = estimatedWidth;\n        this.estimatedItemsAcross = isGridView &&\n          Math.floor(scrollView.__clientWidth / estimatedWidth) ||\n          1;\n      };\n    }\n    function HorizontalViewType() {\n      this.getItemPrimarySize = widthGetter;\n      this.getItemSecondarySize = heightGetter;\n\n      this.getScrollValue = function() {\n        return Math.max(0, Math.min(scrollView.__scrollLeft - repeaterBeforeSize,\n          scrollView.__maxScrollLeft - repeaterBeforeSize - repeaterAfterSize));\n      };\n\n      this.refreshDirection = function() {\n        this.scrollPrimarySize = scrollView.__clientWidth;\n        this.scrollSecondarySize = scrollView.__clientHeight;\n\n        this.estimatedPrimarySize = estimatedWidth;\n        this.estimatedSecondarySize = estimatedHeight;\n        this.estimatedItemsAcross = isGridView &&\n          Math.floor(scrollView.__clientHeight / estimatedHeight) ||\n          1;\n      };\n    }\n\n    function GridViewType() {\n      this.getEstimatedSecondaryPos = function(index) {\n        return (index % this.estimatedItemsAcross) * this.estimatedSecondarySize;\n      };\n      this.getEstimatedPrimaryPos = function(index) {\n        return Math.floor(index / this.estimatedItemsAcross) * this.estimatedPrimarySize;\n      };\n      this.getEstimatedIndex = function(scrollValue) {\n        return Math.floor(scrollValue / this.estimatedPrimarySize) *\n          this.estimatedItemsAcross;\n      };\n    }\n\n    function ListViewType() {\n      this.getEstimatedSecondaryPos = function() {\n        return 0;\n      };\n      this.getEstimatedPrimaryPos = function(index) {\n        return index * this.estimatedPrimarySize;\n      };\n      this.getEstimatedIndex = function(scrollValue) {\n        return Math.floor((scrollValue) / this.estimatedPrimarySize);\n      };\n    }\n\n    function StaticViewType() {\n      this.getContentSize = function() {\n        return this.getEstimatedPrimaryPos(data.length - 1) + this.estimatedPrimarySize +\n          repeaterBeforeSize + repeaterAfterSize;\n      };\n      // static view always returns the same object for getDimensions, to avoid memory allocation\n      // while scrolling. This could be dangerous if this was a public function, but it's not.\n      // Only we use it.\n      var dim = {};\n      this.getDimensions = function(index) {\n        dim.primaryPos = this.getEstimatedPrimaryPos(index);\n        dim.secondaryPos = this.getEstimatedSecondaryPos(index);\n        dim.primarySize = this.estimatedPrimarySize;\n        dim.secondarySize = this.estimatedSecondarySize;\n        return dim;\n      };\n      this.updateRenderRange = function(scrollValue, scrollValueEnd) {\n        renderStartIndex = Math.max(0, this.getEstimatedIndex(scrollValue));\n\n        // Make sure the renderEndIndex takes into account all the items on the row\n        renderEndIndex = Math.min(data.length - 1,\n          this.getEstimatedIndex(scrollValueEnd) + this.estimatedItemsAcross - 1);\n\n        renderBeforeBoundary = Math.max(0,\n          this.getEstimatedPrimaryPos(renderStartIndex));\n        renderAfterBoundary = this.getEstimatedPrimaryPos(renderEndIndex) +\n          this.estimatedPrimarySize;\n      };\n    }\n\n    function DynamicViewType() {\n      var self = this;\n      var debouncedScrollViewSetDimensions = ionic.debounce(scrollViewSetDimensions, 25, true);\n      var calculateDimensions = isGridView ? calculateDimensionsGrid : calculateDimensionsList;\n      var dimensionsIndex;\n      var dimensions = [];\n\n\n      // Get the dimensions at index. {width, height, left, top}.\n      // We start with no dimensions calculated, then any time dimensions are asked for at an\n      // index we calculate dimensions up to there.\n      function calculateDimensionsList(toIndex) {\n        var i, prevDimension, dim;\n        for (i = Math.max(0, dimensionsIndex); i <= toIndex && (dim = dimensions[i]); i++) {\n          prevDimension = dimensions[i - 1] || EMPTY_DIMENSION;\n          dim.primarySize = self.getItemPrimarySize(i, data[i]);\n          dim.secondarySize = self.scrollSecondarySize;\n          dim.primaryPos = prevDimension.primaryPos + prevDimension.primarySize;\n          dim.secondaryPos = 0;\n        }\n      }\n      function calculateDimensionsGrid(toIndex) {\n        var i, prevDimension, dim;\n        for (i = Math.max(dimensionsIndex, 0); i <= toIndex && (dim = dimensions[i]); i++) {\n          prevDimension = dimensions[i - 1] || EMPTY_DIMENSION;\n          dim.secondarySize = Math.min(\n            self.getItemSecondarySize(i, data[i]),\n            self.scrollSecondarySize\n          );\n          dim.secondaryPos = prevDimension.secondaryPos + prevDimension.secondarySize;\n\n          if (i === 0 || dim.secondaryPos + dim.secondarySize > self.scrollSecondarySize) {\n            dim.secondaryPos = 0;\n            dim.primarySize = self.getItemPrimarySize(i, data[i]);\n            dim.primaryPos = prevDimension.primaryPos + prevDimension.rowPrimarySize;\n\n            dim.rowStartIndex = i;\n            dim.rowPrimarySize = dim.primarySize;\n          } else {\n            dim.primarySize = self.getItemPrimarySize(i, data[i]);\n            dim.primaryPos = prevDimension.primaryPos;\n            dim.rowStartIndex = prevDimension.rowStartIndex;\n\n            dimensions[dim.rowStartIndex].rowPrimarySize = dim.rowPrimarySize = Math.max(\n              dimensions[dim.rowStartIndex].rowPrimarySize,\n              dim.primarySize\n            );\n            dim.rowPrimarySize = Math.max(dim.primarySize, dim.rowPrimarySize);\n          }\n        }\n      }\n\n      this.getContentSize = function() {\n        var dim = dimensions[dimensionsIndex] || EMPTY_DIMENSION;\n        return ((dim.primaryPos + dim.primarySize) || 0) +\n          this.getEstimatedPrimaryPos(data.length - dimensionsIndex - 1) +\n          repeaterBeforeSize + repeaterAfterSize;\n      };\n      this.onDestroy = function() {\n        dimensions.length = 0;\n      };\n\n      this.onRefreshData = function() {\n        var i;\n        var ii;\n        // Make sure dimensions has as many items as data.length.\n        // This is to be sure we don't have to allocate objects while scrolling.\n        for (i = dimensions.length, ii = data.length; i < ii; i++) {\n          dimensions.push({});\n        }\n        dimensionsIndex = -1;\n      };\n      this.onRefreshLayout = function() {\n        dimensionsIndex = -1;\n      };\n      this.getDimensions = function(index) {\n        index = Math.min(index, data.length - 1);\n\n        if (dimensionsIndex < index) {\n          // Once we start asking for dimensions near the end of the list, go ahead and calculate\n          // everything. This is to make sure when the user gets to the end of the list, the\n          // scroll height of the list is 100% accurate (not estimated anymore).\n          if (index > data.length * 0.9) {\n            calculateDimensions(data.length - 1);\n            dimensionsIndex = data.length - 1;\n            scrollViewSetDimensions();\n          } else {\n            calculateDimensions(index);\n            dimensionsIndex = index;\n            debouncedScrollViewSetDimensions();\n          }\n\n        }\n        return dimensions[index];\n      };\n\n      var oldRenderStartIndex = -1;\n      var oldScrollValue = -1;\n      this.updateRenderRange = function(scrollValue, scrollValueEnd) {\n        var i;\n        var len;\n        var dim;\n\n        // Calculate more dimensions than we estimate we'll need, to be sure.\n        this.getDimensions( this.getEstimatedIndex(scrollValueEnd) * 2 );\n\n        // -- Calculate renderStartIndex\n        // base case: start at 0\n        if (oldRenderStartIndex === -1 || scrollValue === 0) {\n          i = 0;\n        // scrolling down\n        } else if (scrollValue >= oldScrollValue) {\n          for (i = oldRenderStartIndex, len = data.length; i < len; i++) {\n            if ((dim = this.getDimensions(i)) && dim.primaryPos + dim.rowPrimarySize >= scrollValue) {\n              break;\n            }\n          }\n        // scrolling up\n        } else {\n          for (i = oldRenderStartIndex; i >= 0; i--) {\n            if ((dim = this.getDimensions(i)) && dim.primaryPos <= scrollValue) {\n              // when grid view, make sure the render starts at the beginning of a row.\n              i = isGridView ? dim.rowStartIndex : i;\n              break;\n            }\n          }\n        }\n\n        renderStartIndex = Math.min(Math.max(0, i), data.length - 1);\n        renderBeforeBoundary = renderStartIndex !== -1 ? this.getDimensions(renderStartIndex).primaryPos : -1;\n\n        // -- Calculate renderEndIndex\n        var lastRowDim;\n        for (i = renderStartIndex + 1, len = data.length; i < len; i++) {\n          if ((dim = this.getDimensions(i)) && dim.primaryPos + dim.rowPrimarySize > scrollValueEnd) {\n\n            // Go all the way to the end of the row if we're in a grid\n            if (isGridView) {\n              lastRowDim = dim;\n              while (i < len - 1 &&\n                    (dim = this.getDimensions(i + 1)).primaryPos === lastRowDim.primaryPos) {\n                i++;\n              }\n            }\n            break;\n          }\n        }\n\n        renderEndIndex = Math.min(i, data.length - 1);\n        renderAfterBoundary = renderEndIndex !== -1 ?\n          ((dim = this.getDimensions(renderEndIndex)).primaryPos + (dim.rowPrimarySize || dim.primarySize)) :\n          -1;\n\n        oldScrollValue = scrollValue;\n        oldRenderStartIndex = renderStartIndex;\n      };\n    }\n\n\n  };\n\n}\n\n/**\n * @ngdoc directive\n * @name ionContent\n * @module ionic\n * @delegate ionic.service:$ionicScrollDelegate\n * @restrict E\n *\n * @description\n * The ionContent directive provides an easy to use content area that can be configured\n * to use Ionic's custom Scroll View, or the built in overflow scrolling of the browser.\n *\n * While we recommend using the custom Scroll features in Ionic in most cases, sometimes\n * (for performance reasons) only the browser's native overflow scrolling will suffice,\n * and so we've made it easy to toggle between the Ionic scroll implementation and\n * overflow scrolling.\n *\n * You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher}\n * directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll}\n * directive.\n *\n * If there is any dynamic content inside the ion-content, be sure to call `.resize()` with {@link ionic.service:$ionicScrollDelegate}\n * after the content has been added.\n *\n * Be aware that this directive gets its own child scope. If you do not understand why this\n * is important, you can read [https://docs.angularjs.org/guide/scope](https://docs.angularjs.org/guide/scope).\n *\n * @param {string=} delegate-handle The handle used to identify this scrollView\n * with {@link ionic.service:$ionicScrollDelegate}.\n * @param {string=} direction Which way to scroll. 'x' or 'y' or 'xy'. Default 'y'.\n * @param {boolean=} locking Whether to lock scrolling in one direction at a time. Useful to set to false when zoomed in or scrolling in two directions. Default true.\n * @param {boolean=} padding Whether to add padding to the content.\n * of the content.  Defaults to true on iOS, false on Android.\n * @param {boolean=} scroll Whether to allow scrolling of content.  Defaults to true.\n * @param {boolean=} overflow-scroll Whether to use overflow-scrolling instead of\n * Ionic scroll. See {@link ionic.provider:$ionicConfigProvider} to set this as the global default.\n * @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default true.\n * @param {boolean=} scrollbar-y Whether to show the vertical scrollbar. Default true.\n * @param {string=} start-x Initial horizontal scroll position. Default 0.\n * @param {string=} start-y Initial vertical scroll position. Default 0.\n * @param {expression=} on-scroll Expression to evaluate when the content is scrolled.\n * @param {expression=} on-scroll-complete Expression to evaluate when a scroll action completes. Has access to 'scrollLeft' and 'scrollTop' locals.\n * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges\n * of the content.  Defaults to true on iOS, false on Android.\n * @param {number=} scroll-event-interval Number of milliseconds between each firing of the 'on-scroll' expression. Default 10.\n */\nIonicModule\n.directive('ionContent', [\n  '$timeout',\n  '$controller',\n  '$ionicBind',\n  '$ionicConfig',\nfunction($timeout, $controller, $ionicBind, $ionicConfig) {\n  return {\n    restrict: 'E',\n    require: '^?ionNavView',\n    scope: true,\n    priority: 800,\n    compile: function(element, attr) {\n      var innerElement;\n      var scrollCtrl;\n\n      element.addClass('scroll-content ionic-scroll');\n\n      if (attr.scroll != 'false') {\n        //We cannot use normal transclude here because it breaks element.data()\n        //inheritance on compile\n        innerElement = jqLite('<div class=\"scroll\"></div>');\n        innerElement.append(element.contents());\n        element.append(innerElement);\n      } else {\n        element.addClass('scroll-content-false');\n      }\n\n      var nativeScrolling = attr.overflowScroll === \"true\" || !$ionicConfig.scrolling.jsScrolling();\n\n      // collection-repeat requires JS scrolling\n      if (nativeScrolling) {\n        nativeScrolling = !element[0].querySelector('[collection-repeat]');\n      }\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr) {\n        var parentScope = $scope.$parent;\n        $scope.$watch(function() {\n          return (parentScope.$hasHeader ? ' has-header' : '') +\n            (parentScope.$hasSubheader ? ' has-subheader' : '') +\n            (parentScope.$hasFooter ? ' has-footer' : '') +\n            (parentScope.$hasSubfooter ? ' has-subfooter' : '') +\n            (parentScope.$hasTabs ? ' has-tabs' : '') +\n            (parentScope.$hasTabsTop ? ' has-tabs-top' : '');\n        }, function(className, oldClassName) {\n          $element.removeClass(oldClassName);\n          $element.addClass(className);\n        });\n\n        //Only this ionContent should use these variables from parent scopes\n        $scope.$hasHeader = $scope.$hasSubheader =\n          $scope.$hasFooter = $scope.$hasSubfooter =\n          $scope.$hasTabs = $scope.$hasTabsTop =\n          false;\n        $ionicBind($scope, $attr, {\n          $onScroll: '&onScroll',\n          $onScrollComplete: '&onScrollComplete',\n          hasBouncing: '@',\n          padding: '@',\n          direction: '@',\n          scrollbarX: '@',\n          scrollbarY: '@',\n          startX: '@',\n          startY: '@',\n          scrollEventInterval: '@'\n        });\n        $scope.direction = $scope.direction || 'y';\n\n        if (isDefined($attr.padding)) {\n          $scope.$watch($attr.padding, function(newVal) {\n              (innerElement || $element).toggleClass('padding', !!newVal);\n          });\n        }\n\n        if ($attr.scroll === \"false\") {\n          //do nothing\n        } else {\n          var scrollViewOptions = {};\n\n          // determined in compile phase above\n          if (nativeScrolling) {\n            // use native scrolling\n            $element.addClass('overflow-scroll');\n\n            scrollViewOptions = {\n              el: $element[0],\n              delegateHandle: attr.delegateHandle,\n              startX: $scope.$eval($scope.startX) || 0,\n              startY: $scope.$eval($scope.startY) || 0,\n              nativeScrolling: true\n            };\n\n          } else {\n            // Use JS scrolling\n            scrollViewOptions = {\n              el: $element[0],\n              delegateHandle: attr.delegateHandle,\n              locking: (attr.locking || 'true') === 'true',\n              bouncing: $scope.$eval($scope.hasBouncing),\n              startX: $scope.$eval($scope.startX) || 0,\n              startY: $scope.$eval($scope.startY) || 0,\n              scrollbarX: $scope.$eval($scope.scrollbarX) !== false,\n              scrollbarY: $scope.$eval($scope.scrollbarY) !== false,\n              scrollingX: $scope.direction.indexOf('x') >= 0,\n              scrollingY: $scope.direction.indexOf('y') >= 0,\n              scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 10,\n              scrollingComplete: onScrollComplete\n            };\n          }\n\n          // init scroll controller with appropriate options\n          scrollCtrl = $controller('$ionicScroll', {\n            $scope: $scope,\n            scrollViewOptions: scrollViewOptions\n          });\n\n          $scope.$on('$destroy', function() {\n            if (scrollViewOptions) {\n              scrollViewOptions.scrollingComplete = noop;\n              delete scrollViewOptions.el;\n            }\n            innerElement = null;\n            $element = null;\n            attr.$$element = null;\n          });\n        }\n\n        function onScrollComplete() {\n          $scope.$onScrollComplete({\n            scrollTop: scrollCtrl.scrollView.__scrollTop,\n            scrollLeft: scrollCtrl.scrollView.__scrollLeft\n          });\n        }\n\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name exposeAsideWhen\n * @module ionic\n * @restrict A\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * It is common for a tablet application to hide a menu when in portrait mode, but to show the\n * same menu on the left side when the tablet is in landscape mode. The `exposeAsideWhen` attribute\n * directive can be used to accomplish a similar interface.\n *\n * By default, side menus are hidden underneath its side menu content, and can be opened by either\n * swiping the content left or right, or toggling a button to show the side menu. However, by adding the\n * `exposeAsideWhen` attribute directive to an {@link ionic.directive:ionSideMenu} element directive,\n * a side menu can be given instructions on \"when\" the menu should be exposed (always viewable). For\n * example, the `expose-aside-when=\"large\"` attribute will keep the side menu hidden when the viewport's\n * width is less than `768px`, but when the viewport's width is `768px` or greater, the menu will then\n * always be shown and can no longer be opened or closed like it could when it was hidden for smaller\n * viewports.\n *\n * Using `large` as the attribute's value is a shortcut value to `(min-width:768px)` since it is\n * the most common use-case. However, for added flexibility, any valid media query could be added\n * as the value, such as `(min-width:600px)` or even multiple queries such as\n * `(min-width:750px) and (max-width:1200px)`.\n\n * @usage\n * ```html\n * <ion-side-menus>\n *   <!-- Center content -->\n *   <ion-side-menu-content>\n *   </ion-side-menu-content>\n *\n *   <!-- Left menu -->\n *   <ion-side-menu expose-aside-when=\"large\">\n *   </ion-side-menu>\n * </ion-side-menus>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n */\nIonicModule.directive('exposeAsideWhen', ['$window', function($window) {\n  return {\n    restrict: 'A',\n    require: '^ionSideMenus',\n    link: function($scope, $element, $attr, sideMenuCtrl) {\n\n      function checkAsideExpose() {\n        var mq = $attr.exposeAsideWhen == 'large' ? '(min-width:768px)' : $attr.exposeAsideWhen;\n        sideMenuCtrl.exposeAside($window.matchMedia(mq).matches);\n        sideMenuCtrl.activeAsideResizing(false);\n      }\n\n      function onResize() {\n        sideMenuCtrl.activeAsideResizing(true);\n        debouncedCheck();\n      }\n\n      var debouncedCheck = ionic.debounce(function() {\n        $scope.$apply(checkAsideExpose);\n      }, 300, false);\n\n      $scope.$evalAsync(checkAsideExpose);\n\n      ionic.on('resize', onResize, $window);\n\n      $scope.$on('$destroy', function() {\n        ionic.off('resize', onResize, $window);\n      });\n\n    }\n  };\n}]);\n\n\nvar GESTURE_DIRECTIVES = 'onHold onTap onDoubleTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' ');\n\nGESTURE_DIRECTIVES.forEach(function(name) {\n  IonicModule.directive(name, gestureDirective(name));\n});\n\n\n/**\n * @ngdoc directive\n * @name onHold\n * @module ionic\n * @restrict A\n *\n * @description\n * Touch stays at the same location for 500ms. Similar to long touch events available for AngularJS and jQuery.\n *\n * @usage\n * ```html\n * <button on-hold=\"onHold()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onTap\n * @module ionic\n * @restrict A\n *\n * @description\n * Quick touch at a location. If the duration of the touch goes\n * longer than 250ms it is no longer a tap gesture.\n *\n * @usage\n * ```html\n * <button on-tap=\"onTap()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDoubleTap\n * @module ionic\n * @restrict A\n *\n * @description\n * Double tap touch at a location.\n *\n * @usage\n * ```html\n * <button on-double-tap=\"onDoubleTap()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onTouch\n * @module ionic\n * @restrict A\n *\n * @description\n * Called immediately when the user first begins a touch. This\n * gesture does not wait for a touchend/mouseup.\n *\n * @usage\n * ```html\n * <button on-touch=\"onTouch()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onRelease\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the user ends a touch.\n *\n * @usage\n * ```html\n * <button on-release=\"onRelease()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDrag\n * @module ionic\n * @restrict A\n *\n * @description\n * Move with one touch around on the page. Blocking the scrolling when\n * moving left and right is a good practice. When all the drag events are\n * blocking you disable scrolling on that area.\n *\n * @usage\n * ```html\n * <button on-drag=\"onDrag()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragUp\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged up.\n *\n * @usage\n * ```html\n * <button on-drag-up=\"onDragUp()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragRight\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged to the right.\n *\n * @usage\n * ```html\n * <button on-drag-right=\"onDragRight()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragDown\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged down.\n *\n * @usage\n * ```html\n * <button on-drag-down=\"onDragDown()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragLeft\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged to the left.\n *\n * @usage\n * ```html\n * <button on-drag-left=\"onDragLeft()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipe\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity in any direction.\n *\n * @usage\n * ```html\n * <button on-swipe=\"onSwipe()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeUp\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving up.\n *\n * @usage\n * ```html\n * <button on-swipe-up=\"onSwipeUp()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeRight\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving to the right.\n *\n * @usage\n * ```html\n * <button on-swipe-right=\"onSwipeRight()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeDown\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving down.\n *\n * @usage\n * ```html\n * <button on-swipe-down=\"onSwipeDown()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeLeft\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving to the left.\n *\n * @usage\n * ```html\n * <button on-swipe-left=\"onSwipeLeft()\" class=\"button\">Test</button>\n * ```\n */\n\n\nfunction gestureDirective(directiveName) {\n  return ['$ionicGesture', '$parse', function($ionicGesture, $parse) {\n    var eventType = directiveName.substr(2).toLowerCase();\n\n    return function(scope, element, attr) {\n      var fn = $parse( attr[directiveName] );\n\n      var listener = function(ev) {\n        scope.$apply(function() {\n          fn(scope, {\n            $event: ev\n          });\n        });\n      };\n\n      var gesture = $ionicGesture.on(eventType, listener, element);\n\n      scope.$on('$destroy', function() {\n        $ionicGesture.off(gesture, eventType, listener);\n      });\n    };\n  }];\n}\n\n\nIonicModule\n.directive('ionHeaderBar', tapScrollToTopDirective())\n\n/**\n * @ngdoc directive\n * @name ionHeaderBar\n * @module ionic\n * @restrict E\n *\n * @description\n * Adds a fixed header bar above some content.\n *\n * Can also be a subheader (lower down) if the 'bar-subheader' class is applied.\n * See [the header CSS docs](/docs/components/#subheader).\n *\n * @param {string=} align-title How to align the title. By default the title\n * will be aligned the same as how the platform aligns its titles (iOS centers\n * titles, Android aligns them left).\n * Available: 'left', 'right', or 'center'.  Defaults to the same as the platform.\n * @param {boolean=} no-tap-scroll By default, the header bar will scroll the\n * content to the top when tapped.  Set no-tap-scroll to true to disable this\n * behavior.\n * Available: true or false.  Defaults to false.\n *\n * @usage\n * ```html\n * <ion-header-bar align-title=\"left\" class=\"bar-positive\">\n *   <div class=\"buttons\">\n *     <button class=\"button\" ng-click=\"doSomething()\">Left Button</button>\n *   </div>\n *   <h1 class=\"title\">Title!</h1>\n *   <div class=\"buttons\">\n *     <button class=\"button\">Right Button</button>\n *   </div>\n * </ion-header-bar>\n * <ion-content>\n *   Some content!\n * </ion-content>\n * ```\n */\n.directive('ionHeaderBar', headerFooterBarDirective(true))\n\n/**\n * @ngdoc directive\n * @name ionFooterBar\n * @module ionic\n * @restrict E\n *\n * @description\n * Adds a fixed footer bar below some content.\n *\n * Can also be a subfooter (higher up) if the 'bar-subfooter' class is applied.\n * See [the footer CSS docs](/docs/components/#footer).\n *\n * Note: If you use ionFooterBar in combination with ng-if, the surrounding content\n * will not align correctly.  This will be fixed soon.\n *\n * @param {string=} align-title Where to align the title.\n * Available: 'left', 'right', or 'center'.  Defaults to 'center'.\n *\n * @usage\n * ```html\n * <ion-content>\n *   Some content!\n * </ion-content>\n * <ion-footer-bar align-title=\"left\" class=\"bar-assertive\">\n *   <div class=\"buttons\">\n *     <button class=\"button\">Left Button</button>\n *   </div>\n *   <h1 class=\"title\">Title!</h1>\n *   <div class=\"buttons\" ng-click=\"doSomething()\">\n *     <button class=\"button\">Right Button</button>\n *   </div>\n * </ion-footer-bar>\n * ```\n */\n.directive('ionFooterBar', headerFooterBarDirective(false));\n\nfunction tapScrollToTopDirective() {\n  return ['$ionicScrollDelegate', function($ionicScrollDelegate) {\n    return {\n      restrict: 'E',\n      link: function($scope, $element, $attr) {\n        if ($attr.noTapScroll == 'true') {\n          return;\n        }\n        ionic.on('tap', onTap, $element[0]);\n        $scope.$on('$destroy', function() {\n          ionic.off('tap', onTap, $element[0]);\n        });\n\n        function onTap(e) {\n          var depth = 3;\n          var current = e.target;\n          //Don't scroll to top in certain cases\n          while (depth-- && current) {\n            if (current.classList.contains('button') ||\n                current.tagName.match(/input|textarea|select/i) ||\n                current.isContentEditable) {\n              return;\n            }\n            current = current.parentNode;\n          }\n          var touch = e.gesture && e.gesture.touches[0] || e.detail.touches[0];\n          var bounds = $element[0].getBoundingClientRect();\n          if (ionic.DomUtil.rectContains(\n            touch.pageX, touch.pageY,\n            bounds.left, bounds.top - 20,\n            bounds.left + bounds.width, bounds.top + bounds.height\n          )) {\n            $ionicScrollDelegate.scrollTop(true);\n          }\n        }\n      }\n    };\n  }];\n}\n\nfunction headerFooterBarDirective(isHeader) {\n  return ['$document', '$timeout', function($document, $timeout) {\n    return {\n      restrict: 'E',\n      controller: '$ionicHeaderBar',\n      compile: function(tElement) {\n        tElement.addClass(isHeader ? 'bar bar-header' : 'bar bar-footer');\n        // top style tabs? if so, remove bottom border for seamless display\n        $timeout(function() {\n          if (isHeader && $document[0].getElementsByClassName('tabs-top').length) tElement.addClass('has-tabs-top');\n        });\n\n        return { pre: prelink };\n        function prelink($scope, $element, $attr, ctrl) {\n          if (isHeader) {\n            $scope.$watch(function() { return $element[0].className; }, function(value) {\n              var isShown = value.indexOf('ng-hide') === -1;\n              var isSubheader = value.indexOf('bar-subheader') !== -1;\n              $scope.$hasHeader = isShown && !isSubheader;\n              $scope.$hasSubheader = isShown && isSubheader;\n              $scope.$emit('$ionicSubheader', $scope.$hasSubheader);\n            });\n            $scope.$on('$destroy', function() {\n              delete $scope.$hasHeader;\n              delete $scope.$hasSubheader;\n            });\n            ctrl.align();\n            $scope.$on('$ionicHeader.align', function() {\n              ionic.requestAnimationFrame(function() {\n                ctrl.align();\n              });\n            });\n\n          } else {\n            $scope.$watch(function() { return $element[0].className; }, function(value) {\n              var isShown = value.indexOf('ng-hide') === -1;\n              var isSubfooter = value.indexOf('bar-subfooter') !== -1;\n              $scope.$hasFooter = isShown && !isSubfooter;\n              $scope.$hasSubfooter = isShown && isSubfooter;\n            });\n            $scope.$on('$destroy', function() {\n              delete $scope.$hasFooter;\n              delete $scope.$hasSubfooter;\n            });\n            $scope.$watch('$hasTabs', function(val) {\n              $element.toggleClass('has-tabs', !!val);\n            });\n          }\n        }\n      }\n    };\n  }];\n}\n\n/**\n * @ngdoc directive\n * @name ionInfiniteScroll\n * @module ionic\n * @parent ionic.directive:ionContent, ionic.directive:ionScroll\n * @restrict E\n *\n * @description\n * The ionInfiniteScroll directive allows you to call a function whenever\n * the user gets to the bottom of the page or near the bottom of the page.\n *\n * The expression you pass in for `on-infinite` is called when the user scrolls\n * greater than `distance` away from the bottom of the content.  Once `on-infinite`\n * is done loading new data, it should broadcast the `scroll.infiniteScrollComplete`\n * event from your controller (see below example).\n *\n * @param {expression} on-infinite What to call when the scroller reaches the\n * bottom.\n * @param {string=} distance The distance from the bottom that the scroll must\n * reach to trigger the on-infinite expression. Default: 1%.\n * @param {string=} spinner The {@link ionic.directive:ionSpinner} to show while loading. The SVG\n * {@link ionic.directive:ionSpinner} is now the default, replacing rotating font icons.\n * @param {string=} icon The icon to show while loading. Default: 'ion-load-d'.  This is depreicated\n * in favor of the SVG {@link ionic.directive:ionSpinner}.\n * @param {boolean=} immediate-check Whether to check the infinite scroll bounds immediately on load.\n *\n * @usage\n * ```html\n * <ion-content ng-controller=\"MyController\">\n *   <ion-list>\n *   ....\n *   ....\n *   </ion-list>\n *\n *   <ion-infinite-scroll\n *     on-infinite=\"loadMore()\"\n *     distance=\"1%\">\n *   </ion-infinite-scroll>\n * </ion-content>\n * ```\n * ```js\n * function MyController($scope, $http) {\n *   $scope.items = [];\n *   $scope.loadMore = function() {\n *     $http.get('/more-items').success(function(items) {\n *       useItems(items);\n *       $scope.$broadcast('scroll.infiniteScrollComplete');\n *     });\n *   };\n *\n *   $scope.$on('$stateChangeSuccess', function() {\n *     $scope.loadMore();\n *   });\n * }\n * ```\n *\n * An easy to way to stop infinite scroll once there is no more data to load\n * is to use angular's `ng-if` directive:\n *\n * ```html\n * <ion-infinite-scroll\n *   ng-if=\"moreDataCanBeLoaded()\"\n *   icon=\"ion-loading-c\"\n *   on-infinite=\"loadMoreData()\">\n * </ion-infinite-scroll>\n * ```\n */\nIonicModule\n.directive('ionInfiniteScroll', ['$timeout', function($timeout) {\n  return {\n    restrict: 'E',\n    require: ['?^$ionicScroll', 'ionInfiniteScroll'],\n    template: function($element, $attrs) {\n      if ($attrs.icon) return '<i class=\"icon {{icon()}} icon-refreshing {{scrollingType}}\"></i>';\n      return '<ion-spinner icon=\"{{spinner()}}\"></ion-spinner>';\n    },\n    scope: true,\n    controller: '$ionInfiniteScroll',\n    link: function($scope, $element, $attrs, ctrls) {\n      var infiniteScrollCtrl = ctrls[1];\n      var scrollCtrl = infiniteScrollCtrl.scrollCtrl = ctrls[0];\n      var jsScrolling = infiniteScrollCtrl.jsScrolling = !scrollCtrl.isNative();\n\n      // if this view is not beneath a scrollCtrl, it can't be injected, proceed w/ native scrolling\n      if (jsScrolling) {\n        infiniteScrollCtrl.scrollView = scrollCtrl.scrollView;\n        $scope.scrollingType = 'js-scrolling';\n        //bind to JS scroll events\n        scrollCtrl.$element.on('scroll', infiniteScrollCtrl.checkBounds);\n      } else {\n        // grabbing the scrollable element, to determine dimensions, and current scroll pos\n        var scrollEl = ionic.DomUtil.getParentOrSelfWithClass($element[0].parentNode, 'overflow-scroll');\n        infiniteScrollCtrl.scrollEl = scrollEl;\n        // if there's no scroll controller, and no overflow scroll div, infinite scroll wont work\n        if (!scrollEl) {\n          throw 'Infinite scroll must be used inside a scrollable div';\n        }\n        //bind to native scroll events\n        infiniteScrollCtrl.scrollEl.addEventListener('scroll', infiniteScrollCtrl.checkBounds);\n      }\n\n      // Optionally check bounds on start after scrollView is fully rendered\n      var doImmediateCheck = isDefined($attrs.immediateCheck) ? $scope.$eval($attrs.immediateCheck) : true;\n      if (doImmediateCheck) {\n        $timeout(function() { infiniteScrollCtrl.checkBounds(); });\n      }\n    }\n  };\n}]);\n\n/**\n* @ngdoc directive\n* @name ionItem\n* @parent ionic.directive:ionList\n* @module ionic\n* @restrict E\n* Creates a list-item that can easily be swiped,\n* deleted, reordered, edited, and more.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* Can be assigned any item class name. See the\n* [list CSS documentation](/docs/components/#list).\n*\n* @usage\n*\n* ```html\n* <ion-list>\n*   <ion-item>Hello!</ion-item>\n*   <ion-item href=\"#/detail\">\n*     Link to detail page\n*   </ion-item>\n* </ion-list>\n* ```\n*/\nIonicModule\n.directive('ionItem', ['$$rAF', function($$rAF) {\n  return {\n    restrict: 'E',\n    controller: ['$scope', '$element', function($scope, $element) {\n      this.$scope = $scope;\n      this.$element = $element;\n    }],\n    scope: true,\n    compile: function($element, $attrs) {\n      var isAnchor = isDefined($attrs.href) ||\n                     isDefined($attrs.ngHref) ||\n                     isDefined($attrs.uiSref);\n      var isComplexItem = isAnchor ||\n        //Lame way of testing, but we have to know at compile what to do with the element\n        /ion-(delete|option|reorder)-button/i.test($element.html());\n\n      if (isComplexItem) {\n        var innerElement = jqLite(isAnchor ? '<a></a>' : '<div></div>');\n        innerElement.addClass('item-content');\n\n        if (isDefined($attrs.href) || isDefined($attrs.ngHref)) {\n          innerElement.attr('ng-href', '{{$href()}}');\n          if (isDefined($attrs.target)) {\n            innerElement.attr('target', '{{$target()}}');\n          }\n        }\n\n        innerElement.append($element.contents());\n\n        $element.addClass('item item-complex')\n                .append(innerElement);\n      } else {\n        $element.addClass('item');\n      }\n\n      return function link($scope, $element, $attrs) {\n        $scope.$href = function() {\n          return $attrs.href || $attrs.ngHref;\n        };\n        $scope.$target = function() {\n          return $attrs.target;\n        };\n\n        var content = $element[0].querySelector('.item-content');\n        if (content) {\n          $scope.$on('$collectionRepeatLeave', function() {\n            if (content && content.$$ionicOptionsOpen) {\n              content.style[ionic.CSS.TRANSFORM] = '';\n              content.style[ionic.CSS.TRANSITION] = 'none';\n              $$rAF(function() {\n                content.style[ionic.CSS.TRANSITION] = '';\n              });\n              content.$$ionicOptionsOpen = false;\n            }\n          });\n        }\n      };\n\n    }\n  };\n}]);\n\nvar ITEM_TPL_DELETE_BUTTON =\n  '<div class=\"item-left-edit item-delete enable-pointer-events\">' +\n  '</div>';\n/**\n* @ngdoc directive\n* @name ionDeleteButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates a delete button inside a list item, that is visible when the\n* {@link ionic.directive:ionList ionList parent's} `show-delete` evaluates to true or\n* `$ionicListDelegate.showDelete(true)` is called.\n*\n* Takes any ionicon as a class.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* @usage\n*\n* ```html\n* <ion-list show-delete=\"shouldShowDelete\">\n*   <ion-item>\n*     <ion-delete-button class=\"ion-minus-circled\"></ion-delete-button>\n*     Hello, list item!\n*   </ion-item>\n* </ion-list>\n* <ion-toggle ng-model=\"shouldShowDelete\">\n*   Show Delete?\n* </ion-toggle>\n* ```\n*/\nIonicModule\n.directive('ionDeleteButton', function() {\n\n  function stopPropagation(ev) {\n    ev.stopPropagation();\n  }\n\n  return {\n    restrict: 'E',\n    require: ['^^ionItem', '^?ionList'],\n    //Run before anything else, so we can move it before other directives process\n    //its location (eg ngIf relies on the location of the directive in the dom)\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      //Add the classes we need during the compile phase, so that they stay\n      //even if something else like ngIf removes the element and re-addss it\n      $attr.$set('class', ($attr['class'] || '') + ' button icon button-icon', true);\n      return function($scope, $element, $attr, ctrls) {\n        var itemCtrl = ctrls[0];\n        var listCtrl = ctrls[1];\n        var container = jqLite(ITEM_TPL_DELETE_BUTTON);\n        container.append($element);\n        itemCtrl.$element.append(container).addClass('item-left-editable');\n\n        //Don't bubble click up to main .item\n        $element.on('click', stopPropagation);\n\n        init();\n        $scope.$on('$ionic.reconnectScope', init);\n        function init() {\n          listCtrl = listCtrl || $element.controller('ionList');\n          if (listCtrl && listCtrl.showDelete()) {\n            container.addClass('visible active');\n          }\n        }\n      };\n    }\n  };\n});\n\n\nIonicModule\n.directive('itemFloatingLabel', function() {\n  return {\n    restrict: 'C',\n    link: function(scope, element) {\n      var el = element[0];\n      var input = el.querySelector('input, textarea');\n      var inputLabel = el.querySelector('.input-label');\n\n      if (!input || !inputLabel) return;\n\n      var onInput = function() {\n        if (input.value) {\n          inputLabel.classList.add('has-input');\n        } else {\n          inputLabel.classList.remove('has-input');\n        }\n      };\n\n      input.addEventListener('input', onInput);\n\n      var ngModelCtrl = jqLite(input).controller('ngModel');\n      if (ngModelCtrl) {\n        ngModelCtrl.$render = function() {\n          input.value = ngModelCtrl.$viewValue || '';\n          onInput();\n        };\n      }\n\n      scope.$on('$destroy', function() {\n        input.removeEventListener('input', onInput);\n      });\n    }\n  };\n});\n\nvar ITEM_TPL_OPTION_BUTTONS =\n  '<div class=\"item-options invisible\">' +\n  '</div>';\n/**\n* @ngdoc directive\n* @name ionOptionButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates an option button inside a list item, that is visible when the item is swiped\n* to the left by the user.  Swiped open option buttons can be hidden with\n* {@link ionic.service:$ionicListDelegate#closeOptionButtons $ionicListDelegate#closeOptionButtons}.\n*\n* Can be assigned any button class.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* @usage\n*\n* ```html\n* <ion-list>\n*   <ion-item>\n*     I love kittens!\n*     <ion-option-button class=\"button-positive\">Share</ion-option-button>\n*     <ion-option-button class=\"button-assertive\">Edit</ion-option-button>\n*   </ion-item>\n* </ion-list>\n* ```\n*/\nIonicModule.directive('ionOptionButton', [function() {\n  function stopPropagation(e) {\n    e.stopPropagation();\n  }\n  return {\n    restrict: 'E',\n    require: '^ionItem',\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      $attr.$set('class', ($attr['class'] || '') + ' button', true);\n      return function($scope, $element, $attr, itemCtrl) {\n        if (!itemCtrl.optionsContainer) {\n          itemCtrl.optionsContainer = jqLite(ITEM_TPL_OPTION_BUTTONS);\n          itemCtrl.$element.append(itemCtrl.optionsContainer);\n        }\n        itemCtrl.optionsContainer.append($element);\n\n        itemCtrl.$element.addClass('item-right-editable');\n\n        //Don't bubble click up to main .item\n        $element.on('click', stopPropagation);\n      };\n    }\n  };\n}]);\n\nvar ITEM_TPL_REORDER_BUTTON =\n  '<div data-prevent-scroll=\"true\" class=\"item-right-edit item-reorder enable-pointer-events\">' +\n  '</div>';\n\n/**\n* @ngdoc directive\n* @name ionReorderButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates a reorder button inside a list item, that is visible when the\n* {@link ionic.directive:ionList ionList parent's} `show-reorder` evaluates to true or\n* `$ionicListDelegate.showReorder(true)` is called.\n*\n* Can be dragged to reorder items in the list. Takes any ionicon class.\n*\n* Note: Reordering works best when used with `ng-repeat`.  Be sure that all `ion-item` children of an `ion-list` are part of the same `ng-repeat` expression.\n*\n* When an item reorder is complete, the expression given in the `on-reorder` attribute is called. The `on-reorder` expression is given two locals that can be used: `$fromIndex` and `$toIndex`.  See below for an example.\n*\n* Look at {@link ionic.directive:ionList} for more examples.\n*\n* @usage\n*\n* ```html\n* <ion-list ng-controller=\"MyCtrl\" show-reorder=\"true\">\n*   <ion-item ng-repeat=\"item in items\">\n*     Item {{item}}\n*     <ion-reorder-button class=\"ion-navicon\"\n*                         on-reorder=\"moveItem(item, $fromIndex, $toIndex)\">\n*     </ion-reorder-button>\n*   </ion-item>\n* </ion-list>\n* ```\n* ```js\n* function MyCtrl($scope) {\n*   $scope.items = [1, 2, 3, 4];\n*   $scope.moveItem = function(item, fromIndex, toIndex) {\n*     //Move the item in the array\n*     $scope.items.splice(fromIndex, 1);\n*     $scope.items.splice(toIndex, 0, item);\n*   };\n* }\n* ```\n*\n* @param {expression=} on-reorder Expression to call when an item is reordered.\n* Parameters given: $fromIndex, $toIndex.\n*/\nIonicModule\n.directive('ionReorderButton', ['$parse', function($parse) {\n  return {\n    restrict: 'E',\n    require: ['^ionItem', '^?ionList'],\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      $attr.$set('class', ($attr['class'] || '') + ' button icon button-icon', true);\n      $element[0].setAttribute('data-prevent-scroll', true);\n      return function($scope, $element, $attr, ctrls) {\n        var itemCtrl = ctrls[0];\n        var listCtrl = ctrls[1];\n        var onReorderFn = $parse($attr.onReorder);\n\n        $scope.$onReorder = function(oldIndex, newIndex) {\n          onReorderFn($scope, {\n            $fromIndex: oldIndex,\n            $toIndex: newIndex\n          });\n        };\n\n        // prevent clicks from bubbling up to the item\n        if (!$attr.ngClick && !$attr.onClick && !$attr.onclick) {\n          $element[0].onclick = function(e) {\n            e.stopPropagation();\n            return false;\n          };\n        }\n\n        var container = jqLite(ITEM_TPL_REORDER_BUTTON);\n        container.append($element);\n        itemCtrl.$element.append(container).addClass('item-right-editable');\n\n        if (listCtrl && listCtrl.showReorder()) {\n          container.addClass('visible active');\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name keyboardAttach\n * @module ionic\n * @restrict A\n *\n * @description\n * keyboard-attach is an attribute directive which will cause an element to float above\n * the keyboard when the keyboard shows. Currently only supports the\n * [ion-footer-bar]({{ page.versionHref }}/api/directive/ionFooterBar/) directive.\n *\n * ### Notes\n * - This directive requires the\n * [Ionic Keyboard Plugin](https://github.com/driftyco/ionic-plugins-keyboard).\n * - On Android not in fullscreen mode, i.e. you have\n *   `<preference name=\"Fullscreen\" value=\"false\" />` or no preference in your `config.xml` file,\n *   this directive is unnecessary since it is the default behavior.\n * - On iOS, if there is an input in your footer, you will need to set\n *   `cordova.plugins.Keyboard.disableScroll(true)`.\n *\n * @usage\n *\n * ```html\n *  <ion-footer-bar align-title=\"left\" keyboard-attach class=\"bar-assertive\">\n *    <h1 class=\"title\">Title!</h1>\n *  </ion-footer-bar>\n * ```\n */\n\nIonicModule\n.directive('keyboardAttach', function() {\n  return function(scope, element) {\n    ionic.on('native.keyboardshow', onShow, window);\n    ionic.on('native.keyboardhide', onHide, window);\n\n    //deprecated\n    ionic.on('native.showkeyboard', onShow, window);\n    ionic.on('native.hidekeyboard', onHide, window);\n\n\n    var scrollCtrl;\n\n    function onShow(e) {\n      if (ionic.Platform.isAndroid() && !ionic.Platform.isFullScreen) {\n        return;\n      }\n\n      //for testing\n      var keyboardHeight = e.keyboardHeight || e.detail.keyboardHeight;\n      element.css('bottom', keyboardHeight + \"px\");\n      scrollCtrl = element.controller('$ionicScroll');\n      if (scrollCtrl) {\n        scrollCtrl.scrollView.__container.style.bottom = keyboardHeight + keyboardAttachGetClientHeight(element[0]) + \"px\";\n      }\n    }\n\n    function onHide() {\n      if (ionic.Platform.isAndroid() && !ionic.Platform.isFullScreen) {\n        return;\n      }\n\n      element.css('bottom', '');\n      if (scrollCtrl) {\n        scrollCtrl.scrollView.__container.style.bottom = '';\n      }\n    }\n\n    scope.$on('$destroy', function() {\n      ionic.off('native.keyboardshow', onShow, window);\n      ionic.off('native.keyboardhide', onHide, window);\n\n      //deprecated\n      ionic.off('native.showkeyboard', onShow, window);\n      ionic.off('native.hidekeyboard', onHide, window);\n    });\n  };\n});\n\nfunction keyboardAttachGetClientHeight(element) {\n  return element.clientHeight;\n}\n\n/**\n* @ngdoc directive\n* @name ionList\n* @module ionic\n* @delegate ionic.service:$ionicListDelegate\n* @codepen JsHjf\n* @restrict E\n* @description\n* The List is a widely used interface element in almost any mobile app, and can include\n* content ranging from basic text all the way to buttons, toggles, icons, and thumbnails.\n*\n* Both the list, which contains items, and the list items themselves can be any HTML\n* element. The containing element requires the `list` class and each list item requires\n* the `item` class.\n*\n* However, using the ionList and ionItem directives make it easy to support various\n* interaction modes such as swipe to edit, drag to reorder, and removing items.\n*\n* Related: {@link ionic.directive:ionItem}, {@link ionic.directive:ionOptionButton}\n* {@link ionic.directive:ionReorderButton}, {@link ionic.directive:ionDeleteButton}, [`list CSS documentation`](/docs/components/#list).\n*\n* @usage\n*\n* Basic Usage:\n*\n* ```html\n* <ion-list>\n*   <ion-item ng-repeat=\"item in items\">\n*     {% raw %}Hello, {{item}}!{% endraw %}\n*   </ion-item>\n* </ion-list>\n* ```\n*\n* Advanced Usage: Thumbnails, Delete buttons, Reordering, Swiping\n*\n* ```html\n* <ion-list ng-controller=\"MyCtrl\"\n*           show-delete=\"shouldShowDelete\"\n*           show-reorder=\"shouldShowReorder\"\n*           can-swipe=\"listCanSwipe\">\n*   <ion-item ng-repeat=\"item in items\"\n*             class=\"item-thumbnail-left\">\n*\n*     {% raw %}<img ng-src=\"{{item.img}}\">\n*     <h2>{{item.title}}</h2>\n*     <p>{{item.description}}</p>{% endraw %}\n*     <ion-option-button class=\"button-positive\"\n*                        ng-click=\"share(item)\">\n*       Share\n*     </ion-option-button>\n*     <ion-option-button class=\"button-info\"\n*                        ng-click=\"edit(item)\">\n*       Edit\n*     </ion-option-button>\n*     <ion-delete-button class=\"ion-minus-circled\"\n*                        ng-click=\"items.splice($index, 1)\">\n*     </ion-delete-button>\n*     <ion-reorder-button class=\"ion-navicon\"\n*                         on-reorder=\"reorderItem(item, $fromIndex, $toIndex)\">\n*     </ion-reorder-button>\n*\n*   </ion-item>\n* </ion-list>\n* ```\n*\n*```javascript\n* app.controller('MyCtrl', function($scope) {\n*  $scope.shouldShowDelete = false;\n*  $scope.shouldShowReorder = false;\n*  $scope.listCanSwipe = true\n* });\n*```\n*\n* @param {string=} delegate-handle The handle used to identify this list with\n* {@link ionic.service:$ionicListDelegate}.\n* @param type {string=} The type of list to use (list-inset or card)\n* @param show-delete {boolean=} Whether the delete buttons for the items in the list are\n* currently shown or hidden.\n* @param show-reorder {boolean=} Whether the reorder buttons for the items in the list are\n* currently shown or hidden.\n* @param can-swipe {boolean=} Whether the items in the list are allowed to be swiped to reveal\n* option buttons. Default: true.\n*/\nIonicModule\n.directive('ionList', [\n  '$timeout',\nfunction($timeout) {\n  return {\n    restrict: 'E',\n    require: ['ionList', '^?$ionicScroll'],\n    controller: '$ionicList',\n    compile: function($element, $attr) {\n      var listEl = jqLite('<div class=\"list\">')\n        .append($element.contents())\n        .addClass($attr.type);\n\n      $element.append(listEl);\n\n      return function($scope, $element, $attrs, ctrls) {\n        var listCtrl = ctrls[0];\n        var scrollCtrl = ctrls[1];\n\n        // Wait for child elements to render...\n        $timeout(init);\n\n        function init() {\n          var listView = listCtrl.listView = new ionic.views.ListView({\n            el: $element[0],\n            listEl: $element.children()[0],\n            scrollEl: scrollCtrl && scrollCtrl.element,\n            scrollView: scrollCtrl && scrollCtrl.scrollView,\n            onReorder: function(el, oldIndex, newIndex) {\n              var itemScope = jqLite(el).scope();\n              if (itemScope && itemScope.$onReorder) {\n                // Make sure onReorder is called in apply cycle,\n                // but also make sure it has no conflicts by doing\n                // $evalAsync\n                $timeout(function() {\n                  itemScope.$onReorder(oldIndex, newIndex);\n                });\n              }\n            },\n            canSwipe: function() {\n              return listCtrl.canSwipeItems();\n            }\n          });\n\n          $scope.$on('$destroy', function() {\n            if (listView) {\n              listView.deregister && listView.deregister();\n              listView = null;\n            }\n          });\n\n          if (isDefined($attr.canSwipe)) {\n            $scope.$watch('!!(' + $attr.canSwipe + ')', function(value) {\n              listCtrl.canSwipeItems(value);\n            });\n          }\n          if (isDefined($attr.showDelete)) {\n            $scope.$watch('!!(' + $attr.showDelete + ')', function(value) {\n              listCtrl.showDelete(value);\n            });\n          }\n          if (isDefined($attr.showReorder)) {\n            $scope.$watch('!!(' + $attr.showReorder + ')', function(value) {\n              listCtrl.showReorder(value);\n            });\n          }\n\n          $scope.$watch(function() {\n            return listCtrl.showDelete();\n          }, function(isShown, wasShown) {\n            //Only use isShown=false if it was already shown\n            if (!isShown && !wasShown) { return; }\n\n            if (isShown) listCtrl.closeOptionButtons();\n            listCtrl.canSwipeItems(!isShown);\n\n            $element.children().toggleClass('list-left-editing', isShown);\n            $element.toggleClass('disable-pointer-events', isShown);\n\n            var deleteButton = jqLite($element[0].getElementsByClassName('item-delete'));\n            setButtonShown(deleteButton, listCtrl.showDelete);\n          });\n\n          $scope.$watch(function() {\n            return listCtrl.showReorder();\n          }, function(isShown, wasShown) {\n            //Only use isShown=false if it was already shown\n            if (!isShown && !wasShown) { return; }\n\n            if (isShown) listCtrl.closeOptionButtons();\n            listCtrl.canSwipeItems(!isShown);\n\n            $element.children().toggleClass('list-right-editing', isShown);\n            $element.toggleClass('disable-pointer-events', isShown);\n\n            var reorderButton = jqLite($element[0].getElementsByClassName('item-reorder'));\n            setButtonShown(reorderButton, listCtrl.showReorder);\n          });\n\n          function setButtonShown(el, shown) {\n            shown() && el.addClass('visible') || el.removeClass('active');\n            ionic.requestAnimationFrame(function() {\n              shown() && el.addClass('active') || el.removeClass('visible');\n            });\n          }\n        }\n\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name menuClose\n * @module ionic\n * @restrict AC\n *\n * @description\n * `menu-close` is an attribute directive that closes a currently opened side menu.\n * Note that by default, navigation transitions will not animate between views when\n * the menu is open. Additionally, this directive will reset the entering view's\n * history stack, making the new page the root of the history stack. This is done\n * to replicate the user experience seen in most side menu implementations, which is\n * to not show the back button at the root of the stack and show only the\n * menu button. We recommend that you also use the `enable-menu-with-back-views=\"false\"`\n * {@link ionic.directive:ionSideMenus} attribute when using the menuClose directive.\n *\n * @usage\n * Below is an example of a link within a side menu. Tapping this link would\n * automatically close the currently opened menu.\n *\n * ```html\n * <a menu-close href=\"#/home\" class=\"item\">Home</a>\n * ```\n */\nIonicModule\n.directive('menuClose', ['$ionicHistory', function($ionicHistory) {\n  return {\n    restrict: 'AC',\n    link: function($scope, $element) {\n      $element.bind('click', function() {\n        var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n        if (sideMenuCtrl) {\n          $ionicHistory.nextViewOptions({\n            historyRoot: true,\n            disableAnimate: true,\n            expire: 300\n          });\n          sideMenuCtrl.close();\n        }\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name menuToggle\n * @module ionic\n * @restrict AC\n *\n * @description\n * Toggle a side menu on the given side.\n *\n * @usage\n * Below is an example of a link within a nav bar. Tapping this button\n * would open the given side menu, and tapping it again would close it.\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-buttons side=\"left\">\n *    <button menu-toggle=\"left\" class=\"button button-icon icon ion-navicon\"></button>\n *   </ion-nav-buttons>\n * </ion-nav-bar>\n * ```\n *\n * ### Button Hidden On Child Views\n * By default, the menu toggle button will only appear on a root\n * level side-menu page. Navigating in to child views will hide the menu-\n * toggle button. They can be made visible on child pages by setting the\n * enable-menu-with-back-views attribute of the {@link ionic.directive:ionSideMenus}\n * directive to true.\n *\n * ```html\n * <ion-side-menus enable-menu-with-back-views=\"true\">\n * ```\n */\nIonicModule\n.directive('menuToggle', function() {\n  return {\n    restrict: 'AC',\n    link: function($scope, $element, $attr) {\n      $scope.$on('$ionicView.beforeEnter', function(ev, viewData) {\n        if (viewData.enableBack) {\n          var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n          if (!sideMenuCtrl.enableMenuWithBackViews()) {\n            $element.addClass('hide');\n          }\n        } else {\n          $element.removeClass('hide');\n        }\n      });\n\n      $element.bind('click', function() {\n        var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n        sideMenuCtrl && sideMenuCtrl.toggle($attr.menuToggle);\n      });\n    }\n  };\n});\n\n/*\n * We don't document the ionModal directive, we instead document\n * the $ionicModal service\n */\nIonicModule\n.directive('ionModal', [function() {\n  return {\n    restrict: 'E',\n    transclude: true,\n    replace: true,\n    controller: [function() {}],\n    template: '<div class=\"modal-backdrop\">' +\n                '<div class=\"modal-backdrop-bg\"></div>' +\n                '<div class=\"modal-wrapper\" ng-transclude></div>' +\n              '</div>'\n  };\n}]);\n\nIonicModule\n.directive('ionModalView', function() {\n  return {\n    restrict: 'E',\n    compile: function(element) {\n      element.addClass('modal');\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionNavBackButton\n * @module ionic\n * @restrict E\n * @parent ionNavBar\n * @description\n * Creates a back button inside an {@link ionic.directive:ionNavBar}.\n *\n * The back button will appear when the user is able to go back in the current navigation stack. By\n * default, the markup of the back button is automatically built using platform-appropriate defaults\n * (iOS back button icon on iOS and Android icon on Android).\n *\n * Additionally, the button is automatically set to `$ionicGoBack()` on click/tap. By default, the\n * app will navigate back one view when the back button is clicked.  More advanced behavior is also\n * possible, as outlined below.\n *\n * @usage\n *\n * Recommended markup for default settings:\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-back-button>\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n *\n * With custom inner markup, and automatically adds a default click action:\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-back-button class=\"button-clear\">\n *     <i class=\"ion-arrow-left-c\"></i> Back\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n *\n * With custom inner markup and custom click action, using {@link ionic.service:$ionicHistory}:\n *\n * ```html\n * <ion-nav-bar ng-controller=\"MyCtrl\">\n *   <ion-nav-back-button class=\"button-clear\"\n *     ng-click=\"myGoBack()\">\n *     <i class=\"ion-arrow-left-c\"></i> Back\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicHistory) {\n *   $scope.myGoBack = function() {\n *     $ionicHistory.goBack();\n *   };\n * }\n * ```\n */\nIonicModule\n.directive('ionNavBackButton', ['$ionicConfig', '$document', function($ionicConfig, $document) {\n  return {\n    restrict: 'E',\n    require: '^ionNavBar',\n    compile: function(tElement, tAttrs) {\n\n      // clone the back button, but as a <div>\n      var buttonEle = $document[0].createElement('button');\n      for (var n in tAttrs.$attr) {\n        buttonEle.setAttribute(tAttrs.$attr[n], tAttrs[n]);\n      }\n\n      if (!tAttrs.ngClick) {\n        buttonEle.setAttribute('ng-click', '$ionicGoBack()');\n      }\n\n      buttonEle.className = 'button back-button hide buttons ' + (tElement.attr('class') || '');\n      buttonEle.innerHTML = tElement.html() || '';\n\n      var childNode;\n      var hasIcon = hasIconClass(tElement[0]);\n      var hasInnerText;\n      var hasButtonText;\n      var hasPreviousTitle;\n\n      for (var x = 0; x < tElement[0].childNodes.length; x++) {\n        childNode = tElement[0].childNodes[x];\n        if (childNode.nodeType === 1) {\n          if (hasIconClass(childNode)) {\n            hasIcon = true;\n          } else if (childNode.classList.contains('default-title')) {\n            hasButtonText = true;\n          } else if (childNode.classList.contains('previous-title')) {\n            hasPreviousTitle = true;\n          }\n        } else if (!hasInnerText && childNode.nodeType === 3) {\n          hasInnerText = !!childNode.nodeValue.trim();\n        }\n      }\n\n      function hasIconClass(ele) {\n        return /ion-|icon/.test(ele.className);\n      }\n\n      var defaultIcon = $ionicConfig.backButton.icon();\n      if (!hasIcon && defaultIcon && defaultIcon !== 'none') {\n        buttonEle.innerHTML = '<i class=\"icon ' + defaultIcon + '\"></i> ' + buttonEle.innerHTML;\n        buttonEle.className += ' button-clear';\n      }\n\n      if (!hasInnerText) {\n        var buttonTextEle = $document[0].createElement('span');\n        buttonTextEle.className = 'back-text';\n\n        if (!hasButtonText && $ionicConfig.backButton.text()) {\n          buttonTextEle.innerHTML += '<span class=\"default-title\">' + $ionicConfig.backButton.text() + '</span>';\n        }\n        if (!hasPreviousTitle && $ionicConfig.backButton.previousTitleText()) {\n          buttonTextEle.innerHTML += '<span class=\"previous-title\"></span>';\n        }\n        buttonEle.appendChild(buttonTextEle);\n\n      }\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attr, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n          navBarCtrl.navElement('backButton', buttonEle.outerHTML);\n          buttonEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionNavBar\n * @module ionic\n * @delegate ionic.service:$ionicNavBarDelegate\n * @restrict E\n *\n * @description\n * If we have an {@link ionic.directive:ionNavView} directive, we can also create an\n * `<ion-nav-bar>`, which will create a topbar that updates as the application state changes.\n *\n * We can add a back button by putting an {@link ionic.directive:ionNavBackButton} inside.\n *\n * We can add buttons depending on the currently visible view using\n * {@link ionic.directive:ionNavButtons}.\n *\n * Note that the ion-nav-bar element will only work correctly if your content has an\n * ionView around it.\n *\n * @usage\n *\n * ```html\n * <body ng-app=\"starter\">\n *   <!-- The nav bar that will be updated as we navigate -->\n *   <ion-nav-bar class=\"bar-positive\">\n *   </ion-nav-bar>\n *\n *   <!-- where the initial view template will be rendered -->\n *   <ion-nav-view>\n *     <ion-view>\n *       <ion-content>Hello!</ion-content>\n *     </ion-view>\n *   </ion-nav-view>\n * </body>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify this navBar\n * with {@link ionic.service:$ionicNavBarDelegate}.\n * @param align-title {string=} Where to align the title of the navbar.\n * Available: 'left', 'right', 'center'. Defaults to 'center'.\n * @param {boolean=} no-tap-scroll By default, the navbar will scroll the content\n * to the top when tapped.  Set no-tap-scroll to true to disable this behavior.\n *\n * </table><br/>\n */\nIonicModule\n.directive('ionNavBar', function() {\n  return {\n    restrict: 'E',\n    controller: '$ionicNavBar',\n    scope: true,\n    link: function($scope, $element, $attr, ctrl) {\n      ctrl.init();\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionNavButtons\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n * Use nav buttons to set the buttons on your {@link ionic.directive:ionNavBar}\n * from within an {@link ionic.directive:ionView}. This gives each\n * view template the ability to specify which buttons should show in the nav bar,\n * overriding any default buttons already placed in the nav bar.\n *\n * Any buttons you declare will be positioned on the navbar's corresponding side. Primary\n * buttons generally map to the left side of the header, and secondary buttons are\n * generally on the right side. However, their exact locations are platform-specific.\n * For example, in iOS, the primary buttons are on the far left of the header, and\n * secondary buttons are on the far right, with the header title centered between them.\n * For Android, however, both groups of buttons are on the far right of the header,\n * with the header title aligned left.\n *\n * We recommend always using `primary` and `secondary`, so the buttons correctly map\n * to the side familiar to users of each platform. However, in cases where buttons should\n * always be on an exact side, both `left` and `right` sides are still available. For\n * example, a toggle button for a left side menu should be on the left side; in this case,\n * we'd recommend using `side=\"left\"`, so it's always on the left, no matter the platform.\n *\n * ***Note*** that `ion-nav-buttons` must be immediate descendants of the `ion-view` or\n * `ion-nav-bar` element (basically, don't wrap it in another div).\n *\n * @usage\n * ```html\n * <ion-nav-bar>\n * </ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view>\n *     <ion-nav-buttons side=\"primary\">\n *       <button class=\"button\" ng-click=\"doSomething()\">\n *         I'm a button on the primary of the navbar!\n *       </button>\n *     </ion-nav-buttons>\n *     <ion-content>\n *       Some super content here!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n * @param {string} side The side to place the buttons in the\n * {@link ionic.directive:ionNavBar}. Available sides: `primary`, `secondary`, `left`, and `right`.\n */\nIonicModule\n.directive('ionNavButtons', ['$document', function($document) {\n  return {\n    require: '^ionNavBar',\n    restrict: 'E',\n    compile: function(tElement, tAttrs) {\n      var side = 'left';\n\n      if (/^primary|secondary|right$/i.test(tAttrs.side || '')) {\n        side = tAttrs.side.toLowerCase();\n      }\n\n      var spanEle = $document[0].createElement('span');\n      spanEle.className = side + '-buttons';\n      spanEle.innerHTML = tElement.html();\n\n      var navElementType = side + 'Buttons';\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attrs, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n\n          var parentViewCtrl = $element.parent().data('$ionViewController');\n          if (parentViewCtrl) {\n            // if the parent is an ion-view, then these are ion-nav-buttons for JUST this ion-view\n            parentViewCtrl.navElement(navElementType, spanEle.outerHTML);\n\n          } else {\n            // these are buttons for all views that do not have their own ion-nav-buttons\n            navBarCtrl.navElement(navElementType, spanEle.outerHTML);\n          }\n\n          spanEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name navDirection\n * @module ionic\n * @restrict A\n *\n * @description\n * The direction which the nav view transition should animate. Available options\n * are: `forward`, `back`, `enter`, `exit`, `swap`.\n *\n * @usage\n *\n * ```html\n * <a nav-direction=\"forward\" href=\"#/home\">Home</a>\n * ```\n */\nIonicModule\n.directive('navDirection', ['$ionicViewSwitcher', function($ionicViewSwitcher) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    link: function($scope, $element, $attr) {\n      $element.bind('click', function() {\n        $ionicViewSwitcher.nextDirection($attr.navDirection);\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionNavTitle\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n *\n * The nav title directive replaces an {@link ionic.directive:ionNavBar} title text with\n * custom HTML from within an {@link ionic.directive:ionView} template. This gives each\n * view the ability to specify its own custom title element, such as an image or any HTML,\n * rather than being text-only. Alternatively, text-only titles can be updated using the\n * `view-title` {@link ionic.directive:ionView} attribute.\n *\n * Note that `ion-nav-title` must be an immediate descendant of the `ion-view` or\n * `ion-nav-bar` element (basically don't wrap it in another div).\n *\n * @usage\n * ```html\n * <ion-nav-bar>\n * </ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view>\n *     <ion-nav-title>\n *       <img src=\"logo.svg\">\n *     </ion-nav-title>\n *     <ion-content>\n *       Some super content here!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n */\nIonicModule\n.directive('ionNavTitle', ['$document', function($document) {\n  return {\n    require: '^ionNavBar',\n    restrict: 'E',\n    compile: function(tElement, tAttrs) {\n      var navElementType = 'title';\n      var spanEle = $document[0].createElement('span');\n      for (var n in tAttrs.$attr) {\n        spanEle.setAttribute(tAttrs.$attr[n], tAttrs[n]);\n      }\n      spanEle.classList.add('nav-bar-title');\n      spanEle.innerHTML = tElement.html();\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attrs, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n\n          var parentViewCtrl = $element.parent().data('$ionViewController');\n          if (parentViewCtrl) {\n            // if the parent is an ion-view, then these are ion-nav-buttons for JUST this ion-view\n            parentViewCtrl.navElement(navElementType, spanEle.outerHTML);\n\n          } else {\n            // these are buttons for all views that do not have their own ion-nav-buttons\n            navBarCtrl.navElement(navElementType, spanEle.outerHTML);\n          }\n\n          spanEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name navTransition\n * @module ionic\n * @restrict A\n *\n * @description\n * The transition type which the nav view transition should use when it animates.\n * Current, options are `ios`, `android`, and `none`. More options coming soon.\n *\n * @usage\n *\n * ```html\n * <a nav-transition=\"none\" href=\"#/home\">Home</a>\n * ```\n */\nIonicModule\n.directive('navTransition', ['$ionicViewSwitcher', function($ionicViewSwitcher) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    link: function($scope, $element, $attr) {\n      $element.bind('click', function() {\n        $ionicViewSwitcher.nextTransition($attr.navTransition);\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionNavView\n * @module ionic\n * @restrict E\n * @codepen odqCz\n *\n * @description\n * As a user navigates throughout your app, Ionic is able to keep track of their\n * navigation history. By knowing their history, transitions between views\n * correctly enter and exit using the platform's transition style. An additional\n * benefit to Ionic's navigation system is its ability to manage multiple\n * histories. For example, each tab can have it's own navigation history stack.\n *\n * Ionic uses the AngularUI Router module so app interfaces can be organized\n * into various \"states\". Like Angular's core $route service, URLs can be used\n * to control the views. However, the AngularUI Router provides a more powerful\n * state manager in that states are bound to named, nested, and parallel views,\n * allowing more than one template to be rendered on the same page.\n * Additionally, each state is not required to be bound to a URL, and data can\n * be pushed to each state which allows much flexibility.\n *\n * The ionNavView directive is used to render templates in your application. Each template\n * is part of a state. States are usually mapped to a url, and are defined programatically\n * using angular-ui-router (see [their docs](https://github.com/angular-ui/ui-router/wiki),\n * and remember to replace ui-view with ion-nav-view in examples).\n *\n * @usage\n * In this example, we will create a navigation view that contains our different states for the app.\n *\n * To do this, in our markup we use ionNavView top level directive. To display a header bar we use\n * the {@link ionic.directive:ionNavBar} directive that updates as we navigate through the\n * navigation stack.\n *\n * Next, we need to setup our states that will be rendered.\n *\n * ```js\n * var app = angular.module('myApp', ['ionic']);\n * app.config(function($stateProvider) {\n *   $stateProvider\n *   .state('index', {\n *     url: '/',\n *     templateUrl: 'home.html'\n *   })\n *   .state('music', {\n *     url: '/music',\n *     templateUrl: 'music.html'\n *   });\n * });\n * ```\n * Then on app start, $stateProvider will look at the url, see it matches the index state,\n * and then try to load home.html into the `<ion-nav-view>`.\n *\n * Pages are loaded by the URLs given. One simple way to create templates in Angular is to put\n * them directly into your HTML file and use the `<script type=\"text/ng-template\">` syntax.\n * So here is one way to put home.html into our app:\n *\n * ```html\n * <script id=\"home\" type=\"text/ng-template\">\n *   <!-- The title of the ion-view will be shown on the navbar -->\n *   <ion-view view-title=\"Home\">\n *     <ion-content ng-controller=\"HomeCtrl\">\n *       <!-- The content of the page -->\n *       <a href=\"#/music\">Go to music page!</a>\n *     </ion-content>\n *   </ion-view>\n * </script>\n * ```\n *\n * This is good to do because the template will be cached for very fast loading, instead of\n * having to fetch them from the network.\n *\n * ## Caching\n *\n * By default, views are cached to improve performance. When a view is navigated away from, its\n * element is left in the DOM, and its scope is disconnected from the `$watch` cycle. When\n * navigating to a view that is already cached, its scope is then reconnected, and the existing\n * element that was left in the DOM becomes the active view. This also allows for the scroll\n * position of previous views to be maintained.\n *\n * Caching can be disabled and enabled in multiple ways. By default, Ionic will cache a maximum of\n * 10 views, and not only can this be configured, but apps can also explicitly state which views\n * should and should not be cached.\n *\n * Note that because we are caching these views, *we aren’t destroying scopes*. Instead, scopes\n * are being disconnected from the watch cycle. Because scopes are not being destroyed and\n * recreated, controllers are not loading again on a subsequent viewing. If the app/controller\n * needs to know when a view has entered or has left, then view events emitted from the\n * {@link ionic.directive:ionView} scope, such as `$ionicView.enter`, may be useful.\n *\n * By default, when navigating back in the history, the \"forward\" views are removed from the cache.\n * If you navigate forward to the same view again, it'll create a new DOM element and controller\n * instance. Basically, any forward views are reset each time. This can be configured using the\n * {@link ionic.provider:$ionicConfigProvider}:\n *\n * ```js\n * $ionicConfigProvider.views.forwardCache(true);\n * ```\n *\n * #### Disable cache globally\n *\n * The {@link ionic.provider:$ionicConfigProvider} can be used to set the maximum allowable views\n * which can be cached, but this can also be use to disable all caching by setting it to 0.\n *\n * ```js\n * $ionicConfigProvider.views.maxCache(0);\n * ```\n *\n * #### Disable cache within state provider\n *\n * ```js\n * $stateProvider.state('myState', {\n *    cache: false,\n *    url : '/myUrl',\n *    templateUrl : 'my-template.html'\n * })\n * ```\n *\n * #### Disable cache with an attribute\n *\n * ```html\n * <ion-view cache-view=\"false\" view-title=\"My Title!\">\n *   ...\n * </ion-view>\n * ```\n *\n *\n * ## AngularUI Router\n *\n * Please visit [AngularUI Router's docs](https://github.com/angular-ui/ui-router/wiki) for\n * more info. Below is a great video by the AngularUI Router team that may help to explain\n * how it all works:\n *\n * <iframe width=\"560\" height=\"315\" src=\"//www.youtube.com/embed/dqJRoh8MnBo\"\n * frameborder=\"0\" allowfullscreen></iframe>\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states. For more\n * information, see ui-router's\n * [ui-view documentation](http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-view).\n */\nIonicModule\n.directive('ionNavView', [\n  '$state',\n  '$ionicConfig',\nfunction($state, $ionicConfig) {\n  // IONIC's fork of Angular UI Router, v0.2.10\n  // the navView handles registering views in the history and how to transition between them\n  return {\n    restrict: 'E',\n    terminal: true,\n    priority: 2000,\n    transclude: true,\n    controller: '$ionicNavView',\n    compile: function(tElement, tAttrs, transclude) {\n\n      // a nav view element is a container for numerous views\n      tElement.addClass('view-container');\n      ionic.DomUtil.cachedAttr(tElement, 'nav-view-transition', $ionicConfig.views.transition());\n\n      return function($scope, $element, $attr, navViewCtrl) {\n        var latestLocals;\n\n        // Put in the compiled initial view\n        transclude($scope, function(clone) {\n          $element.append(clone);\n        });\n\n        var viewData = navViewCtrl.init();\n\n        // listen for $stateChangeSuccess\n        $scope.$on('$stateChangeSuccess', function() {\n          updateView(false);\n        });\n        $scope.$on('$viewContentLoading', function() {\n          updateView(false);\n        });\n\n        // initial load, ready go\n        updateView(true);\n\n\n        function updateView(firstTime) {\n          // get the current local according to the $state\n          var viewLocals = $state.$current && $state.$current.locals[viewData.name];\n\n          // do not update THIS nav-view if its is not the container for the given state\n          // if the viewLocals are the same as THIS latestLocals, then nothing to do\n          if (!viewLocals || (!firstTime && viewLocals === latestLocals)) return;\n\n          // update the latestLocals\n          latestLocals = viewLocals;\n          viewData.state = viewLocals.$$state;\n\n          // register, update and transition to the new view\n          navViewCtrl.register(viewLocals);\n        }\n\n      };\n    }\n  };\n}]);\n\nIonicModule\n\n.config(['$provide', function($provide) {\n  $provide.decorator('ngClickDirective', ['$delegate', function($delegate) {\n    // drop the default ngClick directive\n    $delegate.shift();\n    return $delegate;\n  }]);\n}])\n\n/**\n * @private\n */\n.factory('$ionicNgClick', ['$parse', function($parse) {\n  return function(scope, element, clickExpr) {\n    var clickHandler = angular.isFunction(clickExpr) ?\n      clickExpr :\n      $parse(clickExpr);\n\n    element.on('click', function(event) {\n      scope.$apply(function() {\n        clickHandler(scope, {$event: (event)});\n      });\n    });\n\n    // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click\n    // something else nearby.\n    element.onclick = noop;\n  };\n}])\n\n.directive('ngClick', ['$ionicNgClick', function($ionicNgClick) {\n  return function(scope, element, attr) {\n    $ionicNgClick(scope, element, attr.ngClick);\n  };\n}])\n\n.directive('ionStopEvent', function() {\n  return {\n    restrict: 'A',\n    link: function(scope, element, attr) {\n      element.bind(attr.ionStopEvent, eventStopPropagation);\n    }\n  };\n});\nfunction eventStopPropagation(e) {\n  e.stopPropagation();\n}\n\n\n/**\n * @ngdoc directive\n * @name ionPane\n * @module ionic\n * @restrict E\n *\n * @description A simple container that fits content, with no side effects.  Adds the 'pane' class to the element.\n */\nIonicModule\n.directive('ionPane', function() {\n  return {\n    restrict: 'E',\n    link: function(scope, element) {\n      element.addClass('pane');\n    }\n  };\n});\n\n/*\n * We don't document the ionPopover directive, we instead document\n * the $ionicPopover service\n */\nIonicModule\n.directive('ionPopover', [function() {\n  return {\n    restrict: 'E',\n    transclude: true,\n    replace: true,\n    controller: [function() {}],\n    template: '<div class=\"popover-backdrop\">' +\n                '<div class=\"popover-wrapper\" ng-transclude></div>' +\n              '</div>'\n  };\n}]);\n\nIonicModule\n.directive('ionPopoverView', function() {\n  return {\n    restrict: 'E',\n    compile: function(element) {\n      element.append(jqLite('<div class=\"popover-arrow\">'));\n      element.addClass('popover');\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionRadio\n * @module ionic\n * @restrict E\n * @codepen saoBG\n * @description\n * The radio directive is no different than the HTML radio input, except it's styled differently.\n *\n * Radio behaves like any [AngularJS radio](http://docs.angularjs.org/api/ng/input/input[radio]).\n *\n * @usage\n * ```html\n * <ion-radio ng-model=\"choice\" ng-value=\"'A'\">Choose A</ion-radio>\n * <ion-radio ng-model=\"choice\" ng-value=\"'B'\">Choose B</ion-radio>\n * <ion-radio ng-model=\"choice\" ng-value=\"'C'\">Choose C</ion-radio>\n * ```\n *\n * @param {string=} name The name of the radio input.\n * @param {expression=} value The value of the radio input.\n * @param {boolean=} disabled The state of the radio input.\n * @param {string=} icon The icon to use when the radio input is selected.\n * @param {expression=} ng-value Angular equivalent of the value attribute.\n * @param {expression=} ng-model The angular model for the radio input.\n * @param {boolean=} ng-disabled Angular equivalent of the disabled attribute.\n * @param {expression=} ng-change Triggers given expression when radio input's model changes\n */\nIonicModule\n.directive('ionRadio', function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<label class=\"item item-radio\">' +\n        '<input type=\"radio\" name=\"radio-group\">' +\n        '<div class=\"item-content disable-pointer-events\" ng-transclude></div>' +\n        '<i class=\"radio-icon disable-pointer-events icon ion-checkmark\"></i>' +\n      '</label>',\n\n    compile: function(element, attr) {\n      if (attr.icon) {\n        element.children().eq(2).removeClass('ion-checkmark').addClass(attr.icon);\n      }\n\n      var input = element.find('input');\n      forEach({\n          'name': attr.name,\n          'value': attr.value,\n          'disabled': attr.disabled,\n          'ng-value': attr.ngValue,\n          'ng-model': attr.ngModel,\n          'ng-disabled': attr.ngDisabled,\n          'ng-change': attr.ngChange,\n          'ng-required': attr.ngRequired,\n          'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n            input.attr(name, value);\n          }\n      });\n\n      return function(scope, element, attr) {\n        scope.getValue = function() {\n          return scope.ngValue || attr.value;\n        };\n      };\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionRefresher\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionContent, ionic.directive:ionScroll\n * @description\n * Allows you to add pull-to-refresh to a scrollView.\n *\n * Place it as the first child of your {@link ionic.directive:ionContent} or\n * {@link ionic.directive:ionScroll} element.\n *\n * When refreshing is complete, $broadcast the 'scroll.refreshComplete' event\n * from your controller.\n *\n * @usage\n *\n * ```html\n * <ion-content ng-controller=\"MyController\">\n *   <ion-refresher\n *     pulling-text=\"Pull to refresh...\"\n *     on-refresh=\"doRefresh()\">\n *   </ion-refresher>\n *   <ion-list>\n *     <ion-item ng-repeat=\"item in items\"></ion-item>\n *   </ion-list>\n * </ion-content>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $http) {\n *   $scope.items = [1,2,3];\n *   $scope.doRefresh = function() {\n *     $http.get('/new-items')\n *      .success(function(newItems) {\n *        $scope.items = newItems;\n *      })\n *      .finally(function() {\n *        // Stop the ion-refresher from spinning\n *        $scope.$broadcast('scroll.refreshComplete');\n *      });\n *   };\n * });\n * ```\n *\n * @param {expression=} on-refresh Called when the user pulls down enough and lets go\n * of the refresher.\n * @param {expression=} on-pulling Called when the user starts to pull down\n * on the refresher.\n * @param {string=} pulling-text The text to display while the user is pulling down.\n * @param {string=} pulling-icon The icon to display while the user is pulling down.\n * Default: 'ion-android-arrow-down'.\n * @param {string=} spinner The {@link ionic.directive:ionSpinner} icon to display\n * after user lets go of the refresher. The SVG {@link ionic.directive:ionSpinner}\n * is now the default, replacing rotating font icons. Set to `none` to disable both the\n * spinner and the icon.\n * @param {string=} refreshing-icon The font icon to display after user lets go of the\n * refresher. This is depreicated in favor of the SVG {@link ionic.directive:ionSpinner}.\n * @param {boolean=} disable-pulling-rotation Disables the rotation animation of the pulling\n * icon when it reaches its activated threshold. To be used with a custom `pulling-icon`.\n *\n */\nIonicModule\n.directive('ionRefresher', [function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: ['?^$ionicScroll', 'ionRefresher'],\n    controller: '$ionicRefresher',\n    template:\n    '<div class=\"scroll-refresher invisible\" collection-repeat-ignore>' +\n      '<div class=\"ionic-refresher-content\" ' +\n      'ng-class=\"{\\'ionic-refresher-with-text\\': pullingText || refreshingText}\">' +\n        '<div class=\"icon-pulling\" ng-class=\"{\\'pulling-rotation-disabled\\':disablePullingRotation}\">' +\n          '<i class=\"icon {{pullingIcon}}\"></i>' +\n        '</div>' +\n        '<div class=\"text-pulling\" ng-bind-html=\"pullingText\"></div>' +\n        '<div class=\"icon-refreshing\">' +\n          '<ion-spinner ng-if=\"showSpinner\" icon=\"{{spinner}}\"></ion-spinner>' +\n          '<i ng-if=\"showIcon\" class=\"icon {{refreshingIcon}}\"></i>' +\n        '</div>' +\n        '<div class=\"text-refreshing\" ng-bind-html=\"refreshingText\"></div>' +\n      '</div>' +\n    '</div>',\n    link: function($scope, $element, $attrs, ctrls) {\n\n      // JS Scrolling uses the scroll controller\n      var scrollCtrl = ctrls[0],\n          refresherCtrl = ctrls[1];\n      if (!scrollCtrl || scrollCtrl.isNative()) {\n        // Kick off native scrolling\n        refresherCtrl.init();\n      } else {\n        $element[0].classList.add('js-scrolling');\n        scrollCtrl._setRefresher(\n          $scope,\n          $element[0],\n          refresherCtrl.getRefresherDomMethods()\n        );\n\n        $scope.$on('scroll.refreshComplete', function() {\n          $scope.$evalAsync(function() {\n            scrollCtrl.scrollView.finishPullToRefresh();\n          });\n        });\n      }\n\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionScroll\n * @module ionic\n * @delegate ionic.service:$ionicScrollDelegate\n * @codepen mwFuh\n * @restrict E\n *\n * @description\n * Creates a scrollable container for all content inside.\n *\n * @usage\n *\n * Basic usage:\n *\n * ```html\n * <ion-scroll zooming=\"true\" direction=\"xy\" style=\"width: 500px; height: 500px\">\n *   <div style=\"width: 5000px; height: 5000px; background: url('https://upload.wikimedia.org/wikipedia/commons/a/ad/Europe_geological_map-en.jpg') repeat\"></div>\n *  </ion-scroll>\n * ```\n *\n * Note that it's important to set the height of the scroll box as well as the height of the inner\n * content to enable scrolling. This makes it possible to have full control over scrollable areas.\n *\n * If you'd just like to have a center content scrolling area, use {@link ionic.directive:ionContent} instead.\n *\n * @param {string=} delegate-handle The handle used to identify this scrollView\n * with {@link ionic.service:$ionicScrollDelegate}.\n * @param {string=} direction Which way to scroll. 'x' or 'y' or 'xy'. Default 'y'.\n * @param {boolean=} locking Whether to lock scrolling in one direction at a time. Useful to set to false when zoomed in or scrolling in two directions. Default true.\n * @param {boolean=} paging Whether to scroll with paging.\n * @param {expression=} on-refresh Called on pull-to-refresh, triggered by an {@link ionic.directive:ionRefresher}.\n * @param {expression=} on-scroll Called whenever the user scrolls.\n * @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default true.\n * @param {boolean=} scrollbar-y Whether to show the vertical scrollbar. Default true.\n * @param {boolean=} zooming Whether to support pinch-to-zoom\n * @param {integer=} min-zoom The smallest zoom amount allowed (default is 0.5)\n * @param {integer=} max-zoom The largest zoom amount allowed (default is 3)\n * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges\n * of the content.  Defaults to true on iOS, false on Android.\n */\nIonicModule\n.directive('ionScroll', [\n  '$timeout',\n  '$controller',\n  '$ionicBind',\nfunction($timeout, $controller, $ionicBind) {\n  return {\n    restrict: 'E',\n    scope: true,\n    controller: function() {},\n    compile: function(element) {\n      element.addClass('scroll-view ionic-scroll');\n\n      //We cannot transclude here because it breaks element.data() inheritance on compile\n      var innerElement = jqLite('<div class=\"scroll\"></div>');\n      innerElement.append(element.contents());\n      element.append(innerElement);\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr) {\n        $ionicBind($scope, $attr, {\n          direction: '@',\n          paging: '@',\n          $onScroll: '&onScroll',\n          scroll: '@',\n          scrollbarX: '@',\n          scrollbarY: '@',\n          zooming: '@',\n          minZoom: '@',\n          maxZoom: '@'\n        });\n        $scope.direction = $scope.direction || 'y';\n\n        if (isDefined($attr.padding)) {\n          $scope.$watch($attr.padding, function(newVal) {\n            innerElement.toggleClass('padding', !!newVal);\n          });\n        }\n        if ($scope.$eval($scope.paging) === true) {\n          innerElement.addClass('scroll-paging');\n        }\n\n        if (!$scope.direction) { $scope.direction = 'y'; }\n        var isPaging = $scope.$eval($scope.paging) === true;\n\n        var scrollViewOptions = {\n          el: $element[0],\n          delegateHandle: $attr.delegateHandle,\n          locking: ($attr.locking || 'true') === 'true',\n          bouncing: $scope.$eval($attr.hasBouncing),\n          paging: isPaging,\n          scrollbarX: $scope.$eval($scope.scrollbarX) !== false,\n          scrollbarY: $scope.$eval($scope.scrollbarY) !== false,\n          scrollingX: $scope.direction.indexOf('x') >= 0,\n          scrollingY: $scope.direction.indexOf('y') >= 0,\n          zooming: $scope.$eval($scope.zooming) === true,\n          maxZoom: $scope.$eval($scope.maxZoom) || 3,\n          minZoom: $scope.$eval($scope.minZoom) || 0.5,\n          preventDefault: true\n        };\n        if (isPaging) {\n          scrollViewOptions.speedMultiplier = 0.8;\n          scrollViewOptions.bouncing = false;\n        }\n\n        $controller('$ionicScroll', {\n          $scope: $scope,\n          scrollViewOptions: scrollViewOptions\n        });\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionSideMenu\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * A container for a side menu, sibling to an {@link ionic.directive:ionSideMenuContent} directive.\n *\n * @usage\n * ```html\n * <ion-side-menu\n *   side=\"left\"\n *   width=\"myWidthValue + 20\"\n *   is-enabled=\"shouldLeftSideMenuBeEnabled()\">\n * </ion-side-menu>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n *\n * @param {string} side Which side the side menu is currently on.  Allowed values: 'left' or 'right'.\n * @param {boolean=} is-enabled Whether this side menu is enabled.\n * @param {number=} width How many pixels wide the side menu should be.  Defaults to 275.\n */\nIonicModule\n.directive('ionSideMenu', function() {\n  return {\n    restrict: 'E',\n    require: '^ionSideMenus',\n    scope: true,\n    compile: function(element, attr) {\n      angular.isUndefined(attr.isEnabled) && attr.$set('isEnabled', 'true');\n      angular.isUndefined(attr.width) && attr.$set('width', '275');\n\n      element.addClass('menu menu-' + attr.side);\n\n      return function($scope, $element, $attr, sideMenuCtrl) {\n        $scope.side = $attr.side || 'left';\n\n        var sideMenu = sideMenuCtrl[$scope.side] = new ionic.views.SideMenu({\n          width: attr.width,\n          el: $element[0],\n          isEnabled: true\n        });\n\n        $scope.$watch($attr.width, function(val) {\n          var numberVal = +val;\n          if (numberVal && numberVal == val) {\n            sideMenu.setWidth(+val);\n          }\n        });\n        $scope.$watch($attr.isEnabled, function(val) {\n          sideMenu.setIsEnabled(!!val);\n        });\n      };\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionSideMenuContent\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * A container for the main visible content, sibling to one or more\n * {@link ionic.directive:ionSideMenu} directives.\n *\n * @usage\n * ```html\n * <ion-side-menu-content\n *   edge-drag-threshold=\"true\"\n *   drag-content=\"true\">\n * </ion-side-menu-content>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n *\n * @param {boolean=} drag-content Whether the content can be dragged. Default true.\n * @param {boolean|number=} edge-drag-threshold Whether the content drag can only start if it is below a certain threshold distance from the edge of the screen.  Default false. Accepts three types of values:\n   *  - If a non-zero number is given, that many pixels is used as the maximum allowed distance from the edge that starts dragging the side menu.\n   *  - If true is given, the default number of pixels (25) is used as the maximum allowed distance.\n   *  - If false or 0 is given, the edge drag threshold is disabled, and dragging from anywhere on the content is allowed.\n *\n */\nIonicModule\n.directive('ionSideMenuContent', [\n  '$timeout',\n  '$ionicGesture',\n  '$window',\nfunction($timeout, $ionicGesture, $window) {\n\n  return {\n    restrict: 'EA', //DEPRECATED 'A'\n    require: '^ionSideMenus',\n    scope: true,\n    compile: function(element, attr) {\n      element.addClass('menu-content pane');\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr, sideMenuCtrl) {\n        var startCoord = null;\n        var primaryScrollAxis = null;\n\n        if (isDefined(attr.dragContent)) {\n          $scope.$watch(attr.dragContent, function(value) {\n            sideMenuCtrl.canDragContent(value);\n          });\n        } else {\n          sideMenuCtrl.canDragContent(true);\n        }\n\n        if (isDefined(attr.edgeDragThreshold)) {\n          $scope.$watch(attr.edgeDragThreshold, function(value) {\n            sideMenuCtrl.edgeDragThreshold(value);\n          });\n        }\n\n        // Listen for taps on the content to close the menu\n        function onContentTap(gestureEvt) {\n          if (sideMenuCtrl.getOpenAmount() !== 0) {\n            sideMenuCtrl.close();\n            gestureEvt.gesture.srcEvent.preventDefault();\n            startCoord = null;\n            primaryScrollAxis = null;\n          } else if (!startCoord) {\n            startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n          }\n        }\n\n        function onDragX(e) {\n          if (!sideMenuCtrl.isDraggableTarget(e)) return;\n\n          if (getPrimaryScrollAxis(e) == 'x') {\n            sideMenuCtrl._handleDrag(e);\n            e.gesture.srcEvent.preventDefault();\n          }\n        }\n\n        function onDragY(e) {\n          if (getPrimaryScrollAxis(e) == 'x') {\n            e.gesture.srcEvent.preventDefault();\n          }\n        }\n\n        function onDragRelease(e) {\n          sideMenuCtrl._endDrag(e);\n          startCoord = null;\n          primaryScrollAxis = null;\n        }\n\n        function getPrimaryScrollAxis(gestureEvt) {\n          // gets whether the user is primarily scrolling on the X or Y\n          // If a majority of the drag has been on the Y since the start of\n          // the drag, but the X has moved a little bit, it's still a Y drag\n\n          if (primaryScrollAxis) {\n            // we already figured out which way they're scrolling\n            return primaryScrollAxis;\n          }\n\n          if (gestureEvt && gestureEvt.gesture) {\n\n            if (!startCoord) {\n              // get the starting point\n              startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n\n            } else {\n              // we already have a starting point, figure out which direction they're going\n              var endCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n\n              var xDistance = Math.abs(endCoord.x - startCoord.x);\n              var yDistance = Math.abs(endCoord.y - startCoord.y);\n\n              var scrollAxis = (xDistance < yDistance ? 'y' : 'x');\n\n              if (Math.max(xDistance, yDistance) > 30) {\n                // ok, we pretty much know which way they're going\n                // let's lock it in\n                primaryScrollAxis = scrollAxis;\n              }\n\n              return scrollAxis;\n            }\n          }\n          return 'y';\n        }\n\n        var content = {\n          element: element[0],\n          onDrag: function() {},\n          endDrag: function() {},\n          getTranslateX: function() {\n            return $scope.sideMenuContentTranslateX || 0;\n          },\n          setTranslateX: ionic.animationFrameThrottle(function(amount) {\n            var xTransform = content.offsetX + amount;\n            $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(' + xTransform + 'px,0,0)';\n            $timeout(function() {\n              $scope.sideMenuContentTranslateX = amount;\n            });\n          }),\n          setMarginLeft: ionic.animationFrameThrottle(function(amount) {\n            if (amount) {\n              amount = parseInt(amount, 10);\n              $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(' + amount + 'px,0,0)';\n              $element[0].style.width = ($window.innerWidth - amount) + 'px';\n              content.offsetX = amount;\n            } else {\n              $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(0,0,0)';\n              $element[0].style.width = '';\n              content.offsetX = 0;\n            }\n          }),\n          setMarginRight: ionic.animationFrameThrottle(function(amount) {\n            if (amount) {\n              amount = parseInt(amount, 10);\n              $element[0].style.width = ($window.innerWidth - amount) + 'px';\n              content.offsetX = amount;\n            } else {\n              $element[0].style.width = '';\n              content.offsetX = 0;\n            }\n            // reset incase left gets grabby\n            $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(0,0,0)';\n          }),\n          enableAnimation: function() {\n            $scope.animationEnabled = true;\n            $element[0].classList.add('menu-animated');\n          },\n          disableAnimation: function() {\n            $scope.animationEnabled = false;\n            $element[0].classList.remove('menu-animated');\n          },\n          offsetX: 0\n        };\n\n        sideMenuCtrl.setContent(content);\n\n        // add gesture handlers\n        var gestureOpts = { stop_browser_behavior: false };\n        if (ionic.DomUtil.getParentOrSelfWithClass($element[0], 'overflow-scroll')) {\n          gestureOpts.prevent_default_directions = ['left', 'right'];\n        }\n        var contentTapGesture = $ionicGesture.on('tap', onContentTap, $element, gestureOpts);\n        var dragRightGesture = $ionicGesture.on('dragright', onDragX, $element, gestureOpts);\n        var dragLeftGesture = $ionicGesture.on('dragleft', onDragX, $element, gestureOpts);\n        var dragUpGesture = $ionicGesture.on('dragup', onDragY, $element, gestureOpts);\n        var dragDownGesture = $ionicGesture.on('dragdown', onDragY, $element, gestureOpts);\n        var releaseGesture = $ionicGesture.on('release', onDragRelease, $element, gestureOpts);\n\n        // Cleanup\n        $scope.$on('$destroy', function() {\n          if (content) {\n            content.element = null;\n            content = null;\n          }\n          $ionicGesture.off(dragLeftGesture, 'dragleft', onDragX);\n          $ionicGesture.off(dragRightGesture, 'dragright', onDragX);\n          $ionicGesture.off(dragUpGesture, 'dragup', onDragY);\n          $ionicGesture.off(dragDownGesture, 'dragdown', onDragY);\n          $ionicGesture.off(releaseGesture, 'release', onDragRelease);\n          $ionicGesture.off(contentTapGesture, 'tap', onContentTap);\n        });\n      }\n    }\n  };\n}]);\n\nIonicModule\n\n/**\n * @ngdoc directive\n * @name ionSideMenus\n * @module ionic\n * @delegate ionic.service:$ionicSideMenuDelegate\n * @restrict E\n *\n * @description\n * A container element for side menu(s) and the main content. Allows the left and/or right side menu\n * to be toggled by dragging the main content area side to side.\n *\n * To automatically close an opened menu, you can add the {@link ionic.directive:menuClose} attribute\n * directive. The `menu-close` attribute is usually added to links and buttons within\n * `ion-side-menu-content`, so that when the element is clicked, the opened side menu will\n * automatically close.\n *\n * \"Burger Icon\" toggles can be added to the header with the {@link ionic.directive:menuToggle}\n * attribute directive. Clicking the toggle will open and close the side menu like the `menu-close`\n * directive. The side menu will automatically hide on child pages, but can be overridden with the\n * enable-menu-with-back-views attribute mentioned below.\n *\n * By default, side menus are hidden underneath their side menu content and can be opened by swiping\n * the content left or right or by toggling a button to show the side menu. Additionally, by adding the\n * {@link ionic.directive:exposeAsideWhen} attribute directive to an\n * {@link ionic.directive:ionSideMenu} element directive, a side menu can be given instructions about\n * \"when\" the menu should be exposed (always viewable).\n *\n * ![Side Menu](http://ionicframework.com.s3.amazonaws.com/docs/controllers/sidemenu.gif)\n *\n * For more information on side menus, check out:\n *\n * - {@link ionic.directive:ionSideMenuContent}\n * - {@link ionic.directive:ionSideMenu}\n * - {@link ionic.directive:menuToggle}\n * - {@link ionic.directive:menuClose}\n * - {@link ionic.directive:exposeAsideWhen}\n *\n * @usage\n * To use side menus, add an `<ion-side-menus>` parent element. This will encompass all pages that have a\n * side menu, and have at least 2 child elements: 1 `<ion-side-menu-content>` for the center content,\n * and one or more `<ion-side-menu>` directives for each side menu(left/right) that you wish to place.\n *\n * ```html\n * <ion-side-menus>\n *   <!-- Center content -->\n *   <ion-side-menu-content ng-controller=\"ContentController\">\n *   </ion-side-menu-content>\n *\n *   <!-- Left menu -->\n *   <ion-side-menu side=\"left\">\n *   </ion-side-menu>\n *\n *   <!-- Right menu -->\n *   <ion-side-menu side=\"right\">\n *   </ion-side-menu>\n *\n *   <ion-side-menu-content>\n *   <!-- Main content, usually <ion-nav-view> -->\n *   </ion-side-menu-content>\n * </ion-side-menus>\n * ```\n * ```js\n * function ContentController($scope, $ionicSideMenuDelegate) {\n *   $scope.toggleLeft = function() {\n *     $ionicSideMenuDelegate.toggleLeft();\n *   };\n * }\n * ```\n *\n * @param {bool=} enable-menu-with-back-views Determines whether the side menu is enabled when the\n * back button is showing. When set to `false`, any {@link ionic.directive:menuToggle} will be hidden,\n * and the user cannot swipe to open the menu. When going back to the root page of the side menu (the\n * page without a back button visible), then any menuToggle buttons will show again, and menus will be\n * enabled again.\n * @param {string=} delegate-handle The handle used to identify this side menu\n * with {@link ionic.service:$ionicSideMenuDelegate}.\n *\n */\n.directive('ionSideMenus', ['$ionicBody', function($ionicBody) {\n  return {\n    restrict: 'ECA',\n    controller: '$ionicSideMenus',\n    compile: function(element, attr) {\n      attr.$set('class', (attr['class'] || '') + ' view');\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attrs, ctrl) {\n\n        ctrl.enableMenuWithBackViews($scope.$eval($attrs.enableMenuWithBackViews));\n\n        $scope.$on('$ionicExposeAside', function(evt, isAsideExposed) {\n          if (!$scope.$exposeAside) $scope.$exposeAside = {};\n          $scope.$exposeAside.active = isAsideExposed;\n          $ionicBody.enableClass(isAsideExposed, 'aside-open');\n        });\n\n        $scope.$on('$ionicView.beforeEnter', function(ev, d) {\n          if (d.historyId) {\n            $scope.$activeHistoryId = d.historyId;\n          }\n        });\n\n        $scope.$on('$destroy', function() {\n          $ionicBody.removeClass('menu-open', 'aside-open');\n        });\n\n      }\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionSlideBox\n * @module ionic\n * @delegate ionic.service:$ionicSlideBoxDelegate\n * @restrict E\n * @description\n * The Slide Box is a multi-page container where each page can be swiped or dragged between:\n *\n * ![SlideBox](http://ionicframework.com.s3.amazonaws.com/docs/controllers/slideBox.gif)\n *\n * @usage\n * ```html\n * <ion-slide-box on-slide-changed=\"slideHasChanged($index)\">\n *   <ion-slide>\n *     <div class=\"box blue\"><h1>BLUE</h1></div>\n *   </ion-slide>\n *   <ion-slide>\n *     <div class=\"box yellow\"><h1>YELLOW</h1></div>\n *   </ion-slide>\n *   <ion-slide>\n *     <div class=\"box pink\"><h1>PINK</h1></div>\n *   </ion-slide>\n * </ion-slide-box>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify this slideBox\n * with {@link ionic.service:$ionicSlideBoxDelegate}.\n * @param {boolean=} does-continue Whether the slide box should loop.\n * @param {boolean=} auto-play Whether the slide box should automatically slide. Default true if does-continue is true.\n * @param {number=} slide-interval How many milliseconds to wait to change slides (if does-continue is true). Defaults to 4000.\n * @param {boolean=} show-pager Whether a pager should be shown for this slide box. Accepts expressions via `show-pager=\"{{shouldShow()}}\"`. Defaults to true.\n * @param {expression=} pager-click Expression to call when a pager is clicked (if show-pager is true). Is passed the 'index' variable.\n * @param {expression=} on-slide-changed Expression called whenever the slide is changed.  Is passed an '$index' variable.\n * @param {expression=} active-slide Model to bind the current slide to.\n */\nIonicModule\n.directive('ionSlideBox', [\n  '$timeout',\n  '$compile',\n  '$ionicSlideBoxDelegate',\n  '$ionicHistory',\n  '$ionicScrollDelegate',\nfunction($timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScrollDelegate) {\n  return {\n    restrict: 'E',\n    replace: true,\n    transclude: true,\n    scope: {\n      autoPlay: '=',\n      doesContinue: '@',\n      slideInterval: '@',\n      showPager: '@',\n      pagerClick: '&',\n      disableScroll: '@',\n      onSlideChanged: '&',\n      activeSlide: '=?'\n    },\n    controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {\n      var _this = this;\n\n      var continuous = $scope.$eval($scope.doesContinue) === true;\n      var shouldAutoPlay = isDefined($attrs.autoPlay) ? !!$scope.autoPlay : false;\n      var slideInterval = shouldAutoPlay ? $scope.$eval($scope.slideInterval) || 4000 : 0;\n\n      var slider = new ionic.views.Slider({\n        el: $element[0],\n        auto: slideInterval,\n        continuous: continuous,\n        startSlide: $scope.activeSlide,\n        slidesChanged: function() {\n          $scope.currentSlide = slider.currentIndex();\n\n          // Try to trigger a digest\n          $timeout(function() {});\n        },\n        callback: function(slideIndex) {\n          $scope.currentSlide = slideIndex;\n          $scope.onSlideChanged({ index: $scope.currentSlide, $index: $scope.currentSlide});\n          $scope.$parent.$broadcast('slideBox.slideChanged', slideIndex);\n          $scope.activeSlide = slideIndex;\n          // Try to trigger a digest\n          $timeout(function() {});\n        },\n        onDrag: function() {\n          freezeAllScrolls(true);\n        },\n        onDragEnd: function() {\n          freezeAllScrolls(false);\n        }\n      });\n\n      function freezeAllScrolls(shouldFreeze) {\n        if (shouldFreeze && !_this.isScrollFreeze) {\n          $ionicScrollDelegate.freezeAllScrolls(shouldFreeze);\n\n        } else if (!shouldFreeze && _this.isScrollFreeze) {\n          $ionicScrollDelegate.freezeAllScrolls(false);\n        }\n        _this.isScrollFreeze = shouldFreeze;\n      }\n\n      slider.enableSlide($scope.$eval($attrs.disableScroll) !== true);\n\n      $scope.$watch('activeSlide', function(nv) {\n        if (isDefined(nv)) {\n          slider.slide(nv);\n        }\n      });\n\n      $scope.$on('slideBox.nextSlide', function() {\n        slider.next();\n      });\n\n      $scope.$on('slideBox.prevSlide', function() {\n        slider.prev();\n      });\n\n      $scope.$on('slideBox.setSlide', function(e, index) {\n        slider.slide(index);\n      });\n\n      //Exposed for testing\n      this.__slider = slider;\n\n      var deregisterInstance = $ionicSlideBoxDelegate._registerInstance(\n        slider, $attrs.delegateHandle, function() {\n          return $ionicHistory.isActiveScope($scope);\n        }\n      );\n      $scope.$on('$destroy', function() {\n        deregisterInstance();\n        slider.kill();\n      });\n\n      this.slidesCount = function() {\n        return slider.slidesCount();\n      };\n\n      this.onPagerClick = function(index) {\n        void 0;\n        $scope.pagerClick({index: index});\n      };\n\n      $timeout(function() {\n        slider.load();\n      });\n    }],\n    template: '<div class=\"slider\">' +\n      '<div class=\"slider-slides\" ng-transclude>' +\n      '</div>' +\n    '</div>',\n\n    link: function($scope, $element, $attr) {\n      // if showPager is undefined, show the pager\n      if (!isDefined($attr.showPager)) {\n        $scope.showPager = true;\n        getPager().toggleClass('hide', !true);\n      }\n\n      $attr.$observe('showPager', function(show) {\n        show = $scope.$eval(show);\n        getPager().toggleClass('hide', !show);\n      });\n\n      var pager;\n      function getPager() {\n        if (!pager) {\n          var childScope = $scope.$new();\n          pager = jqLite('<ion-pager></ion-pager>');\n          $element.append(pager);\n          pager = $compile(pager)(childScope);\n        }\n        return pager;\n      }\n    }\n  };\n}])\n.directive('ionSlide', function() {\n  return {\n    restrict: 'E',\n    require: '^ionSlideBox',\n    compile: function(element) {\n      element.addClass('slider-slide');\n    }\n  };\n})\n\n.directive('ionPager', function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '^ionSlideBox',\n    template: '<div class=\"slider-pager\"><span class=\"slider-pager-page\" ng-repeat=\"slide in numSlides() track by $index\" ng-class=\"{active: $index == currentSlide}\" ng-click=\"pagerClick($index)\"><i class=\"icon ion-record\"></i></span></div>',\n    link: function($scope, $element, $attr, slideBox) {\n      var selectPage = function(index) {\n        var children = $element[0].children;\n        var length = children.length;\n        for (var i = 0; i < length; i++) {\n          if (i == index) {\n            children[i].classList.add('active');\n          } else {\n            children[i].classList.remove('active');\n          }\n        }\n      };\n\n      $scope.pagerClick = function(index) {\n        slideBox.onPagerClick(index);\n      };\n\n      $scope.numSlides = function() {\n        return new Array(slideBox.slidesCount());\n      };\n\n      $scope.$watch('currentSlide', function(v) {\n        selectPage(v);\n      });\n    }\n  };\n\n});\n\n/**\n* @ngdoc directive\n* @name ionSpinner\n* @module ionic\n* @restrict E\n *\n * @description\n * The `ionSpinner` directive provides a variety of animated spinners.\n * Spinners enables you to give your users feedback that the app is\n * processing/thinking/waiting/chillin' out, or whatever you'd like it to indicate.\n * By default, the {@link ionic.directive:ionRefresher} feature uses this spinner, rather\n * than rotating font icons (previously included in [ionicons](http://ionicons.com/)).\n * While font icons are great for simple or stationary graphics, they're not suited to\n * provide great animations, which is why Ionic uses SVG instead.\n *\n * Ionic offers ten spinners out of the box, and by default, it will use the appropriate spinner\n * for the platform on which it's running. Under the hood, the `ionSpinner` directive dynamically\n * builds the required SVG element, which allows Ionic to provide all ten of the animated SVGs\n * within 3KB.\n *\n * <style>\n * .spinner-table {\n *   max-width: 280px;\n * }\n * .spinner-table tbody > tr > th, .spinner-table tbody > tr > td {\n *   vertical-align: middle;\n *   width: 42px;\n *   height: 42px;\n * }\n * .spinner {\n *   stroke: #444;\n *   fill: #444; }\n *   .spinner svg {\n *     width: 28px;\n *     height: 28px; }\n *   .spinner.spinner-inverse {\n *     stroke: #fff;\n *     fill: #fff; }\n *\n * .spinner-android {\n *   stroke: #4b8bf4; }\n *\n * .spinner-ios, .spinner-ios-small {\n *   stroke: #69717d; }\n *\n * .spinner-spiral .stop1 {\n *   stop-color: #fff;\n *   stop-opacity: 0; }\n * .spinner-spiral.spinner-inverse .stop1 {\n *   stop-color: #000; }\n * .spinner-spiral.spinner-inverse .stop2 {\n *   stop-color: #fff; }\n * </style>\n *\n * <script src=\"http://code.ionicframework.com/nightly/js/ionic.bundle.min.js\"></script>\n * <table class=\"table spinner-table\" ng-app=\"ionic\">\n *  <tr>\n *    <th>\n *      <code>android</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"android\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ios</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ios\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ios-small</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ios-small\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>bubbles</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"bubbles\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>circles</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"circles\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>crescent</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"crescent\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>dots</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"dots\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>lines</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"lines\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ripple</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ripple\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>spiral</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"spiral\"></ion-spinner>\n *    </td>\n *  </tr>\n * </table>\n *\n * Each spinner uses SVG with SMIL animations, however, the Android spinner also uses JavaScript\n * so it also works on Android 4.0-4.3. Additionally, each spinner can be styled with CSS,\n * and scaled to any size.\n *\n *\n * @usage\n * The following code would use the default spinner for the platform it's running from. If it's neither\n * iOS or Android, it'll default to use `ios`.\n *\n * ```html\n * <ion-spinner></ion-spinner>\n * ```\n *\n * By setting the `icon` attribute, you can specify which spinner to use, no matter what\n * the platform is.\n *\n * ```html\n * <ion-spinner icon=\"spiral\"></ion-spinner>\n * ```\n *\n * ## Spinner Colors\n * Like with most of Ionic's other components, spinners can also be styled using\n * Ionic's standard color naming convention. For example:\n *\n * ```html\n * <ion-spinner class=\"spinner-energized\"></ion-spinner>\n * ```\n *\n *\n * ## Styling SVG with CSS\n * One cool thing about SVG is its ability to be styled with CSS! Some of the properties\n * have different names, for example, SVG uses the term `stroke` instead of `border`, and\n * `fill` instead of `background-color`.\n *\n * ```css\n * .spinner svg {\n *   width: 28px;\n *   height: 28px;\n *   stroke: #444;\n *   fill: #444;\n * }\n * ```\n *\n*/\nIonicModule\n.directive('ionSpinner', function() {\n  return {\n    restrict: 'E',\n    controller: '$ionicSpinner',\n    link: function($scope, $element, $attrs, ctrl) {\n      var spinnerName = ctrl.init();\n      $element.addClass('spinner spinner-' + spinnerName);\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionTab\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionTabs\n *\n * @description\n * Contains a tab's content.  The content only exists while the given tab is selected.\n *\n * Each ionTab has its own view history.\n *\n * @usage\n * ```html\n * <ion-tab\n *   title=\"Tab!\"\n *   icon=\"my-icon\"\n *   href=\"#/tab/tab-link\"\n *   on-select=\"onTabSelected()\"\n *   on-deselect=\"onTabDeselected()\">\n * </ion-tab>\n * ```\n * For a complete, working tab bar example, see the {@link ionic.directive:ionTabs} documentation.\n *\n * @param {string} title The title of the tab.\n * @param {string=} href The link that this tab will navigate to when tapped.\n * @param {string=} icon The icon of the tab. If given, this will become the default for icon-on and icon-off.\n * @param {string=} icon-on The icon of the tab while it is selected.\n * @param {string=} icon-off The icon of the tab while it is not selected.\n * @param {expression=} badge The badge to put on this tab (usually a number).\n * @param {expression=} badge-style The style of badge to put on this tab (eg: badge-positive).\n * @param {expression=} on-select Called when this tab is selected.\n * @param {expression=} on-deselect Called when this tab is deselected.\n * @param {expression=} ng-click By default, the tab will be selected on click. If ngClick is set, it will not.  You can explicitly switch tabs using {@link ionic.service:$ionicTabsDelegate#select $ionicTabsDelegate.select()}.\n * @param {expression=} hidden Whether the tab is to be hidden or not.\n * @param {expression=} disabled Whether the tab is to be disabled or not.\n */\nIonicModule\n.directive('ionTab', [\n  '$compile',\n  '$ionicConfig',\n  '$ionicBind',\n  '$ionicViewSwitcher',\nfunction($compile, $ionicConfig, $ionicBind, $ionicViewSwitcher) {\n\n  //Returns ' key=\"value\"' if value exists\n  function attrStr(k, v) {\n    return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n  }\n  return {\n    restrict: 'E',\n    require: ['^ionTabs', 'ionTab'],\n    controller: '$ionicTab',\n    scope: true,\n    compile: function(element, attr) {\n\n      //We create the tabNavTemplate in the compile phase so that the\n      //attributes we pass down won't be interpolated yet - we want\n      //to pass down the 'raw' versions of the attributes\n      var tabNavTemplate = '<ion-tab-nav' +\n        attrStr('ng-click', attr.ngClick) +\n        attrStr('title', attr.title) +\n        attrStr('icon', attr.icon) +\n        attrStr('icon-on', attr.iconOn) +\n        attrStr('icon-off', attr.iconOff) +\n        attrStr('badge', attr.badge) +\n        attrStr('badge-style', attr.badgeStyle) +\n        attrStr('hidden', attr.hidden) +\n        attrStr('disabled', attr.disabled) +\n        attrStr('class', attr['class']) +\n        '></ion-tab-nav>';\n\n      //Remove the contents of the element so we can compile them later, if tab is selected\n      var tabContentEle = document.createElement('div');\n      for (var x = 0; x < element[0].children.length; x++) {\n        tabContentEle.appendChild(element[0].children[x].cloneNode(true));\n      }\n      var childElementCount = tabContentEle.childElementCount;\n      element.empty();\n\n      var navViewName, isNavView;\n      if (childElementCount) {\n        if (tabContentEle.children[0].tagName === 'ION-NAV-VIEW') {\n          // get the name if it's a nav-view\n          navViewName = tabContentEle.children[0].getAttribute('name');\n          tabContentEle.children[0].classList.add('view-container');\n          isNavView = true;\n        }\n        if (childElementCount === 1) {\n          // make the 1 child element the primary tab content container\n          tabContentEle = tabContentEle.children[0];\n        }\n        if (!isNavView) tabContentEle.classList.add('pane');\n        tabContentEle.classList.add('tab-content');\n      }\n\n      return function link($scope, $element, $attr, ctrls) {\n        var childScope;\n        var childElement;\n        var tabsCtrl = ctrls[0];\n        var tabCtrl = ctrls[1];\n        var isTabContentAttached = false;\n        $scope.$tabSelected = false;\n\n        $ionicBind($scope, $attr, {\n          onSelect: '&',\n          onDeselect: '&',\n          title: '@',\n          uiSref: '@',\n          href: '@'\n        });\n\n        tabsCtrl.add($scope);\n        $scope.$on('$destroy', function() {\n          if (!$scope.$tabsDestroy) {\n            // if the containing ionTabs directive is being destroyed\n            // then don't bother going through the controllers remove\n            // method, since remove will reset the active tab as each tab\n            // is being destroyed, causing unnecessary view loads and transitions\n            tabsCtrl.remove($scope);\n          }\n          tabNavElement.isolateScope().$destroy();\n          tabNavElement.remove();\n          tabNavElement = tabContentEle = childElement = null;\n        });\n\n        //Remove title attribute so browser-tooltip does not apear\n        $element[0].removeAttribute('title');\n\n        if (navViewName) {\n          tabCtrl.navViewName = $scope.navViewName = navViewName;\n        }\n        $scope.$on('$stateChangeSuccess', selectIfMatchesState);\n        selectIfMatchesState();\n        function selectIfMatchesState() {\n          if (tabCtrl.tabMatchesState()) {\n            tabsCtrl.select($scope, false);\n          }\n        }\n\n        var tabNavElement = jqLite(tabNavTemplate);\n        tabNavElement.data('$ionTabsController', tabsCtrl);\n        tabNavElement.data('$ionTabController', tabCtrl);\n        tabsCtrl.$tabsElement.append($compile(tabNavElement)($scope));\n\n\n        function tabSelected(isSelected) {\n          if (isSelected && childElementCount) {\n            // this tab is being selected\n\n            // check if the tab is already in the DOM\n            // only do this if the tab has child elements\n            if (!isTabContentAttached) {\n              // tab should be selected and is NOT in the DOM\n              // create a new scope and append it\n              childScope = $scope.$new();\n              childElement = jqLite(tabContentEle);\n              $ionicViewSwitcher.viewEleIsActive(childElement, true);\n              tabsCtrl.$element.append(childElement);\n              $compile(childElement)(childScope);\n              isTabContentAttached = true;\n            }\n\n            // remove the hide class so the tabs content shows up\n            $ionicViewSwitcher.viewEleIsActive(childElement, true);\n\n          } else if (isTabContentAttached && childElement) {\n            // this tab should NOT be selected, and it is already in the DOM\n\n            if ($ionicConfig.views.maxCache() > 0) {\n              // keep the tabs in the DOM, only css hide it\n              $ionicViewSwitcher.viewEleIsActive(childElement, false);\n\n            } else {\n              // do not keep tabs in the DOM\n              destroyTab();\n            }\n\n          }\n        }\n\n        function destroyTab() {\n          childScope && childScope.$destroy();\n          isTabContentAttached && childElement && childElement.remove();\n          tabContentEle.innerHTML = '';\n          isTabContentAttached = childScope = childElement = null;\n        }\n\n        $scope.$watch('$tabSelected', tabSelected);\n\n        $scope.$on('$ionicView.afterEnter', function() {\n          $ionicViewSwitcher.viewEleIsActive(childElement, $scope.$tabSelected);\n        });\n\n        $scope.$on('$ionicView.clearCache', function() {\n          if (!$scope.$tabSelected) {\n            destroyTab();\n          }\n        });\n\n      };\n    }\n  };\n}]);\n\nIonicModule\n.directive('ionTabNav', [function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: ['^ionTabs', '^ionTab'],\n    template:\n    '<a ng-class=\"{\\'tab-item-active\\': isTabActive(), \\'has-badge\\':badge, \\'tab-hidden\\':isHidden()}\" ' +\n      ' ng-disabled=\"disabled()\" class=\"tab-item\">' +\n      '<span class=\"badge {{badgeStyle}}\" ng-if=\"badge\">{{badge}}</span>' +\n      '<i class=\"icon {{getIconOn()}}\" ng-if=\"getIconOn() && isTabActive()\"></i>' +\n      '<i class=\"icon {{getIconOff()}}\" ng-if=\"getIconOff() && !isTabActive()\"></i>' +\n      '<span class=\"tab-title\" ng-bind-html=\"title\"></span>' +\n    '</a>',\n    scope: {\n      title: '@',\n      icon: '@',\n      iconOn: '@',\n      iconOff: '@',\n      badge: '=',\n      hidden: '@',\n      disabled: '&',\n      badgeStyle: '@',\n      'class': '@'\n    },\n    link: function($scope, $element, $attrs, ctrls) {\n      var tabsCtrl = ctrls[0],\n        tabCtrl = ctrls[1];\n\n      //Remove title attribute so browser-tooltip does not apear\n      $element[0].removeAttribute('title');\n\n      $scope.selectTab = function(e) {\n        e.preventDefault();\n        tabsCtrl.select(tabCtrl.$scope, true);\n      };\n      if (!$attrs.ngClick) {\n        $element.on('click', function(event) {\n          $scope.$apply(function() {\n            $scope.selectTab(event);\n          });\n        });\n      }\n\n      $scope.isHidden = function() {\n        if ($attrs.hidden === 'true' || $attrs.hidden === true) return true;\n        return false;\n      };\n\n      $scope.getIconOn = function() {\n        return $scope.iconOn || $scope.icon;\n      };\n      $scope.getIconOff = function() {\n        return $scope.iconOff || $scope.icon;\n      };\n\n      $scope.isTabActive = function() {\n        return tabsCtrl.selectedTab() === tabCtrl.$scope;\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionTabs\n * @module ionic\n * @delegate ionic.service:$ionicTabsDelegate\n * @restrict E\n * @codepen odqCz\n *\n * @description\n * Powers a multi-tabbed interface with a Tab Bar and a set of \"pages\" that can be tabbed\n * through.\n *\n * Assign any [tabs class](/docs/components#tabs) to the element to define\n * its look and feel.\n *\n * For iOS, tabs will appear at the bottom of the screen. For Android, tabs will be at the top\n * of the screen, below the nav-bar. This follows each OS's design specification, but can be\n * configured with the {@link ionic.provider:$ionicConfigProvider}.\n *\n * See the {@link ionic.directive:ionTab} directive's documentation for more details on\n * individual tabs.\n *\n * Note: do not place ion-tabs inside of an ion-content element; it has been known to cause a\n * certain CSS bug.\n *\n * @usage\n * ```html\n * <ion-tabs class=\"tabs-positive tabs-icon-only\">\n *\n *   <ion-tab title=\"Home\" icon-on=\"ion-ios-filing\" icon-off=\"ion-ios-filing-outline\">\n *     <!-- Tab 1 content -->\n *   </ion-tab>\n *\n *   <ion-tab title=\"About\" icon-on=\"ion-ios-clock\" icon-off=\"ion-ios-clock-outline\">\n *     <!-- Tab 2 content -->\n *   </ion-tab>\n *\n *   <ion-tab title=\"Settings\" icon-on=\"ion-ios-gear\" icon-off=\"ion-ios-gear-outline\">\n *     <!-- Tab 3 content -->\n *   </ion-tab>\n *\n * </ion-tabs>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify these tabs\n * with {@link ionic.service:$ionicTabsDelegate}.\n */\n\nIonicModule\n.directive('ionTabs', [\n  '$ionicTabsDelegate',\n  '$ionicConfig',\nfunction($ionicTabsDelegate, $ionicConfig) {\n  return {\n    restrict: 'E',\n    scope: true,\n    controller: '$ionicTabs',\n    compile: function(tElement) {\n      //We cannot use regular transclude here because it breaks element.data()\n      //inheritance on compile\n      var innerElement = jqLite('<div class=\"tab-nav tabs\">');\n      innerElement.append(tElement.contents());\n\n      tElement.append(innerElement)\n              .addClass('tabs-' + $ionicConfig.tabs.position() + ' tabs-' + $ionicConfig.tabs.style());\n\n      return { pre: prelink, post: postLink };\n      function prelink($scope, $element, $attr, tabsCtrl) {\n        var deregisterInstance = $ionicTabsDelegate._registerInstance(\n          tabsCtrl, $attr.delegateHandle, tabsCtrl.hasActiveScope\n        );\n\n        tabsCtrl.$scope = $scope;\n        tabsCtrl.$element = $element;\n        tabsCtrl.$tabsElement = jqLite($element[0].querySelector('.tabs'));\n\n        $scope.$watch(function() { return $element[0].className; }, function(value) {\n          var isTabsTop = value.indexOf('tabs-top') !== -1;\n          var isHidden = value.indexOf('tabs-item-hide') !== -1;\n          $scope.$hasTabs = !isTabsTop && !isHidden;\n          $scope.$hasTabsTop = isTabsTop && !isHidden;\n          $scope.$emit('$ionicTabs.top', $scope.$hasTabsTop);\n        });\n\n        function emitLifecycleEvent(ev, data) {\n          ev.stopPropagation();\n          var previousSelectedTab = tabsCtrl.previousSelectedTab();\n          if (previousSelectedTab) {\n            previousSelectedTab.$broadcast(ev.name.replace('NavView', 'Tabs'), data);\n          }\n        }\n\n        $scope.$on('$ionicNavView.beforeLeave', emitLifecycleEvent);\n        $scope.$on('$ionicNavView.afterLeave', emitLifecycleEvent);\n        $scope.$on('$ionicNavView.leave', emitLifecycleEvent);\n\n        $scope.$on('$destroy', function() {\n          // variable to inform child tabs that they're all being blown away\n          // used so that while destorying an individual tab, each one\n          // doesn't select the next tab as the active one, which causes unnecessary\n          // loading of tab views when each will eventually all go away anyway\n          $scope.$tabsDestroy = true;\n          deregisterInstance();\n          tabsCtrl.$tabsElement = tabsCtrl.$element = tabsCtrl.$scope = innerElement = null;\n          delete $scope.$hasTabs;\n          delete $scope.$hasTabsTop;\n        });\n      }\n\n      function postLink($scope, $element, $attr, tabsCtrl) {\n        if (!tabsCtrl.selectedTab()) {\n          // all the tabs have been added\n          // but one hasn't been selected yet\n          tabsCtrl.select(0);\n        }\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionToggle\n * @module ionic\n * @codepen tfAzj\n * @restrict E\n *\n * @description\n * A toggle is an animated switch which binds a given model to a boolean.\n *\n * Allows dragging of the switch's nub.\n *\n * The toggle behaves like any [AngularJS checkbox](http://docs.angularjs.org/api/ng/input/input[checkbox]) otherwise.\n *\n * @param toggle-class {string=} Sets the CSS class on the inner `label.toggle` element created by the directive.\n *\n * @usage\n * Below is an example of a toggle directive which is wired up to the `airplaneMode` model\n * and has the `toggle-calm` CSS class assigned to the inner element.\n *\n * ```html\n * <ion-toggle ng-model=\"airplaneMode\" toggle-class=\"toggle-calm\">Airplane Mode</ion-toggle>\n * ```\n */\nIonicModule\n.directive('ionToggle', [\n  '$timeout',\n  '$ionicConfig',\nfunction($timeout, $ionicConfig) {\n\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<div class=\"item item-toggle\">' +\n        '<div ng-transclude></div>' +\n        '<label class=\"toggle\">' +\n          '<input type=\"checkbox\">' +\n          '<div class=\"track\">' +\n            '<div class=\"handle\"></div>' +\n          '</div>' +\n        '</label>' +\n      '</div>',\n\n    compile: function(element, attr) {\n      var input = element.find('input');\n      forEach({\n        'name': attr.name,\n        'ng-value': attr.ngValue,\n        'ng-model': attr.ngModel,\n        'ng-checked': attr.ngChecked,\n        'ng-disabled': attr.ngDisabled,\n        'ng-true-value': attr.ngTrueValue,\n        'ng-false-value': attr.ngFalseValue,\n        'ng-change': attr.ngChange,\n        'ng-required': attr.ngRequired,\n        'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n          input.attr(name, value);\n        }\n      });\n\n      if (attr.toggleClass) {\n        element[0].getElementsByTagName('label')[0].classList.add(attr.toggleClass);\n      }\n\n      element.addClass('toggle-' + $ionicConfig.form.toggle());\n\n      return function($scope, $element) {\n        var el = $element[0].getElementsByTagName('label')[0];\n        var checkbox = el.children[0];\n        var track = el.children[1];\n        var handle = track.children[0];\n\n        var ngModelController = jqLite(checkbox).controller('ngModel');\n\n        $scope.toggle = new ionic.views.Toggle({\n          el: el,\n          track: track,\n          checkbox: checkbox,\n          handle: handle,\n          onChange: function() {\n            if (ngModelController) {\n              ngModelController.$setViewValue(checkbox.checked);\n              $scope.$apply();\n            }\n          }\n        });\n\n        $scope.$on('$destroy', function() {\n          $scope.toggle.destroy();\n        });\n      };\n    }\n\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionView\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n * A container for view content and any navigational and header bar information. When a view\n * enters and exits its parent {@link ionic.directive:ionNavView}, the view also emits view\n * information, such as its title, whether the back button should be displayed or not, whether the\n * corresponding {@link ionic.directive:ionNavBar} should be displayed or not, which transition the view\n * should use to animate, and which direction to animate.\n *\n * *Views are cached to improve performance.* When a view is navigated away from, its element is\n * left in the DOM, and its scope is disconnected from the `$watch` cycle. When navigating to a\n * view that is already cached, its scope is reconnected, and the existing element, which was\n * left in the DOM, becomes active again. This can be disabled, or the maximum number of cached\n * views changed in {@link ionic.provider:$ionicConfigProvider}, in the view's `$state` configuration, or\n * as an attribute on the view itself (see below).\n *\n * @usage\n * Below is an example where our page will load with a {@link ionic.directive:ionNavBar} containing\n * \"My Page\" as the title.\n *\n * ```html\n * <ion-nav-bar></ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view view-title=\"My Page\">\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n * ## View LifeCycle and Events\n *\n * Views can be cached, which means ***controllers normally only load once***, which may\n * affect your controller logic. To know when a view has entered or left, events\n * have been added that are emitted from the view's scope. These events also\n * contain data about the view, such as the title and whether the back button should\n * show. Also contained is transition data, such as the transition type and\n * direction that will be or was used.\n *\n * <table class=\"table\">\n *  <tr>\n *   <td><code>$ionicView.loaded</code></td>\n *   <td>The view has loaded. This event only happens once per\n * view being created and added to the DOM. If a view leaves but is cached,\n * then this event will not fire again on a subsequent viewing. The loaded event\n * is good place to put your setup code for the view; however, it is not the\n * recommended event to listen to when a view becomes active.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.enter</code></td>\n *   <td>The view has fully entered and is now the active view.\n * This event will fire, whether it was the first load or a cached view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.leave</code></td>\n *   <td>The view has finished leaving and is no longer the\n * active view. This event will fire, whether it is cached or destroyed.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.beforeEnter</code></td>\n *   <td>The view is about to enter and become the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.beforeLeave</code></td>\n *   <td>The view is about to leave and no longer be the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.afterEnter</code></td>\n *   <td>The view has fully entered and is now the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.afterLeave</code></td>\n *   <td>The view has finished leaving and is no longer the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.unloaded</code></td>\n *   <td>The view's controller has been destroyed and its element has been\n * removed from the DOM.</td>\n *  </tr>\n * </table>\n *\n * ## Caching\n *\n * Caching can be disabled and enabled in multiple ways. By default, Ionic will\n * cache a maximum of 10 views. You can optionally choose to disable caching at\n * either an individual view basis, or by global configuration. Please see the\n * _Caching_ section in {@link ionic.directive:ionNavView} for more info.\n *\n * @param {string=} view-title A text-only title to display on the parent {@link ionic.directive:ionNavBar}.\n * For an HTML title, such as an image, see {@link ionic.directive:ionNavTitle} instead.\n * @param {boolean=} cache-view If this view should be allowed to be cached or not.\n * Please see the _Caching_ section in {@link ionic.directive:ionNavView} for\n * more info. Default `true`\n * @param {boolean=} can-swipe-back If this view should be allowed to use the swipe to go back gesture or not.\n * This does not enable the swipe to go back feature if it is not available for the platform it's running\n * from, or there isn't a previous view. Default `true`\n * @param {boolean=} hide-back-button Whether to hide the back button on the parent\n * {@link ionic.directive:ionNavBar} by default.\n * @param {boolean=} hide-nav-bar Whether to hide the parent\n * {@link ionic.directive:ionNavBar} by default.\n */\nIonicModule\n.directive('ionView', function() {\n  return {\n    restrict: 'EA',\n    priority: 1000,\n    controller: '$ionicView',\n    compile: function(tElement) {\n      tElement.addClass('pane');\n      tElement[0].removeAttribute('title');\n      return function link($scope, $element, $attrs, viewCtrl) {\n        viewCtrl.init();\n      };\n    }\n  };\n});\n\n})();"
  },
  {
    "path": "www/lib/ionic/js/ionic.bundle.js",
    "content": "/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/*!\n * Copyright 2014 Drifty Co.\n * http://drifty.com/\n *\n * Ionic, v1.0.0\n * A powerful HTML5 mobile app framework.\n * http://ionicframework.com/\n *\n * By @maxlynch, @benjsperry, @adamdbradley <3\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n\n(function() {\n\n// Create global ionic obj and its namespaces\n// build processes may have already created an ionic obj\nwindow.ionic = window.ionic || {};\nwindow.ionic.views = {};\nwindow.ionic.version = '1.0.0';\n\n(function (ionic) {\n\n  ionic.DelegateService = function(methodNames) {\n\n    if (methodNames.indexOf('$getByHandle') > -1) {\n      throw new Error(\"Method '$getByHandle' is implicitly added to each delegate service. Do not list it as a method.\");\n    }\n\n    function trueFn() { return true; }\n\n    return ['$log', function($log) {\n\n      /*\n       * Creates a new object that will have all the methodNames given,\n       * and call them on the given the controller instance matching given\n       * handle.\n       * The reason we don't just let $getByHandle return the controller instance\n       * itself is that the controller instance might not exist yet.\n       *\n       * We want people to be able to do\n       * `var instance = $ionicScrollDelegate.$getByHandle('foo')` on controller\n       * instantiation, but on controller instantiation a child directive\n       * may not have been compiled yet!\n       *\n       * So this is our way of solving this problem: we create an object\n       * that will only try to fetch the controller with given handle\n       * once the methods are actually called.\n       */\n      function DelegateInstance(instances, handle) {\n        this._instances = instances;\n        this.handle = handle;\n      }\n      methodNames.forEach(function(methodName) {\n        DelegateInstance.prototype[methodName] = instanceMethodCaller(methodName);\n      });\n\n\n      /**\n       * The delegate service (eg $ionicNavBarDelegate) is just an instance\n       * with a non-defined handle, a couple extra methods for registering\n       * and narrowing down to a specific handle.\n       */\n      function DelegateService() {\n        this._instances = [];\n      }\n      DelegateService.prototype = DelegateInstance.prototype;\n      DelegateService.prototype._registerInstance = function(instance, handle, filterFn) {\n        var instances = this._instances;\n        instance.$$delegateHandle = handle;\n        instance.$$filterFn = filterFn || trueFn;\n        instances.push(instance);\n\n        return function deregister() {\n          var index = instances.indexOf(instance);\n          if (index !== -1) {\n            instances.splice(index, 1);\n          }\n        };\n      };\n      DelegateService.prototype.$getByHandle = function(handle) {\n        return new DelegateInstance(this._instances, handle);\n      };\n\n      return new DelegateService();\n\n      function instanceMethodCaller(methodName) {\n        return function caller() {\n          var handle = this.handle;\n          var args = arguments;\n          var foundInstancesCount = 0;\n          var returnValue;\n\n          this._instances.forEach(function(instance) {\n            if ((!handle || handle == instance.$$delegateHandle) && instance.$$filterFn(instance)) {\n              foundInstancesCount++;\n              var ret = instance[methodName].apply(instance, args);\n              //Only return the value from the first call\n              if (foundInstancesCount === 1) {\n                returnValue = ret;\n              }\n            }\n          });\n\n          if (!foundInstancesCount && handle) {\n            return $log.warn(\n              'Delegate for handle \"' + handle + '\" could not find a ' +\n              'corresponding element with delegate-handle=\"' + handle + '\"! ' +\n              methodName + '() was not called!\\n' +\n              'Possible cause: If you are calling ' + methodName + '() immediately, and ' +\n              'your element with delegate-handle=\"' + handle + '\" is a child of your ' +\n              'controller, then your element may not be compiled yet. Put a $timeout ' +\n              'around your call to ' + methodName + '() and try again.'\n            );\n          }\n          return returnValue;\n        };\n      }\n\n    }];\n  };\n\n})(window.ionic);\n\n(function(window, document, ionic) {\n\n  var readyCallbacks = [];\n  var isDomReady = document.readyState === 'complete' || document.readyState === 'interactive';\n\n  function domReady() {\n    isDomReady = true;\n    for (var x = 0; x < readyCallbacks.length; x++) {\n      ionic.requestAnimationFrame(readyCallbacks[x]);\n    }\n    readyCallbacks = [];\n    document.removeEventListener('DOMContentLoaded', domReady);\n  }\n  if (!isDomReady) {\n    document.addEventListener('DOMContentLoaded', domReady);\n  }\n\n\n  // From the man himself, Mr. Paul Irish.\n  // The requestAnimationFrame polyfill\n  // Put it on window just to preserve its context\n  // without having to use .call\n  window._rAF = (function() {\n    return window.requestAnimationFrame ||\n           window.webkitRequestAnimationFrame ||\n           window.mozRequestAnimationFrame ||\n           function(callback) {\n             window.setTimeout(callback, 16);\n           };\n  })();\n\n  var cancelAnimationFrame = window.cancelAnimationFrame ||\n    window.webkitCancelAnimationFrame ||\n    window.mozCancelAnimationFrame ||\n    window.webkitCancelRequestAnimationFrame;\n\n  /**\n  * @ngdoc utility\n  * @name ionic.DomUtil\n  * @module ionic\n  */\n  ionic.DomUtil = {\n    //Call with proper context\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#requestAnimationFrame\n     * @alias ionic.requestAnimationFrame\n     * @description Calls [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame), or a polyfill if not available.\n     * @param {function} callback The function to call when the next frame\n     * happens.\n     */\n    requestAnimationFrame: function(cb) {\n      return window._rAF(cb);\n    },\n\n    cancelAnimationFrame: function(requestId) {\n      cancelAnimationFrame(requestId);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#animationFrameThrottle\n     * @alias ionic.animationFrameThrottle\n     * @description\n     * When given a callback, if that callback is called 100 times between\n     * animation frames, adding Throttle will make it only run the last of\n     * the 100 calls.\n     *\n     * @param {function} callback a function which will be throttled to\n     * requestAnimationFrame\n     * @returns {function} A function which will then call the passed in callback.\n     * The passed in callback will receive the context the returned function is\n     * called with.\n     */\n    animationFrameThrottle: function(cb) {\n      var args, isQueued, context;\n      return function() {\n        args = arguments;\n        context = this;\n        if (!isQueued) {\n          isQueued = true;\n          ionic.requestAnimationFrame(function() {\n            cb.apply(context, args);\n            isQueued = false;\n          });\n        }\n      };\n    },\n\n    contains: function(parentNode, otherNode) {\n      var current = otherNode;\n      while (current) {\n        if (current === parentNode) return true;\n        current = current.parentNode;\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getPositionInParent\n     * @description\n     * Find an element's scroll offset within its container.\n     * @param {DOMElement} element The element to find the offset of.\n     * @returns {object} A position object with the following properties:\n     *   - `{number}` `left` The left offset of the element.\n     *   - `{number}` `top` The top offset of the element.\n     */\n    getPositionInParent: function(el) {\n      return {\n        left: el.offsetLeft,\n        top: el.offsetTop\n      };\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#ready\n     * @description\n     * Call a function when the DOM is ready, or if it is already ready\n     * call the function immediately.\n     * @param {function} callback The function to be called.\n     */\n    ready: function(cb) {\n      if (isDomReady) {\n        ionic.requestAnimationFrame(cb);\n      } else {\n        readyCallbacks.push(cb);\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getTextBounds\n     * @description\n     * Get a rect representing the bounds of the given textNode.\n     * @param {DOMElement} textNode The textNode to find the bounds of.\n     * @returns {object} An object representing the bounds of the node. Properties:\n     *   - `{number}` `left` The left position of the textNode.\n     *   - `{number}` `right` The right position of the textNode.\n     *   - `{number}` `top` The top position of the textNode.\n     *   - `{number}` `bottom` The bottom position of the textNode.\n     *   - `{number}` `width` The width of the textNode.\n     *   - `{number}` `height` The height of the textNode.\n     */\n    getTextBounds: function(textNode) {\n      if (document.createRange) {\n        var range = document.createRange();\n        range.selectNodeContents(textNode);\n        if (range.getBoundingClientRect) {\n          var rect = range.getBoundingClientRect();\n          if (rect) {\n            var sx = window.scrollX;\n            var sy = window.scrollY;\n\n            return {\n              top: rect.top + sy,\n              left: rect.left + sx,\n              right: rect.left + sx + rect.width,\n              bottom: rect.top + sy + rect.height,\n              width: rect.width,\n              height: rect.height\n            };\n          }\n        }\n      }\n      return null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getChildIndex\n     * @description\n     * Get the first index of a child node within the given element of the\n     * specified type.\n     * @param {DOMElement} element The element to find the index of.\n     * @param {string} type The nodeName to match children of element against.\n     * @returns {number} The index, or -1, of a child with nodeName matching type.\n     */\n    getChildIndex: function(element, type) {\n      if (type) {\n        var ch = element.parentNode.children;\n        var c;\n        for (var i = 0, k = 0, j = ch.length; i < j; i++) {\n          c = ch[i];\n          if (c.nodeName && c.nodeName.toLowerCase() == type) {\n            if (c == element) {\n              return k;\n            }\n            k++;\n          }\n        }\n      }\n      return Array.prototype.slice.call(element.parentNode.children).indexOf(element);\n    },\n\n    /**\n     * @private\n     */\n    swapNodes: function(src, dest) {\n      dest.parentNode.insertBefore(src, dest);\n    },\n\n    elementIsDescendant: function(el, parent, stopAt) {\n      var current = el;\n      do {\n        if (current === parent) return true;\n        current = current.parentNode;\n      } while (current && current !== stopAt);\n      return false;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getParentWithClass\n     * @param {DOMElement} element\n     * @param {string} className\n     * @returns {DOMElement} The closest parent of element matching the\n     * className, or null.\n     */\n    getParentWithClass: function(e, className, depth) {\n      depth = depth || 10;\n      while (e.parentNode && depth--) {\n        if (e.parentNode.classList && e.parentNode.classList.contains(className)) {\n          return e.parentNode;\n        }\n        e = e.parentNode;\n      }\n      return null;\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getParentOrSelfWithClass\n     * @param {DOMElement} element\n     * @param {string} className\n     * @returns {DOMElement} The closest parent or self matching the\n     * className, or null.\n     */\n    getParentOrSelfWithClass: function(e, className, depth) {\n      depth = depth || 10;\n      while (e && depth--) {\n        if (e.classList && e.classList.contains(className)) {\n          return e;\n        }\n        e = e.parentNode;\n      }\n      return null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#rectContains\n     * @param {number} x\n     * @param {number} y\n     * @param {number} x1\n     * @param {number} y1\n     * @param {number} x2\n     * @param {number} y2\n     * @returns {boolean} Whether {x,y} fits within the rectangle defined by\n     * {x1,y1,x2,y2}.\n     */\n    rectContains: function(x, y, x1, y1, x2, y2) {\n      if (x < x1 || x > x2) return false;\n      if (y < y1 || y > y2) return false;\n      return true;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#blurAll\n     * @description\n     * Blurs any currently focused input element\n     * @returns {DOMElement} The element blurred or null\n     */\n    blurAll: function() {\n      if (document.activeElement && document.activeElement != document.body) {\n        document.activeElement.blur();\n        return document.activeElement;\n      }\n      return null;\n    },\n\n    cachedAttr: function(ele, key, value) {\n      ele = ele && ele.length && ele[0] || ele;\n      if (ele && ele.setAttribute) {\n        var dataKey = '$attr-' + key;\n        if (arguments.length > 2) {\n          if (ele[dataKey] !== value) {\n            ele.setAttribute(key, value);\n            ele[dataKey] = value;\n          }\n        } else if (typeof ele[dataKey] == 'undefined') {\n          ele[dataKey] = ele.getAttribute(key);\n        }\n        return ele[dataKey];\n      }\n    },\n\n    cachedStyles: function(ele, styles) {\n      ele = ele && ele.length && ele[0] || ele;\n      if (ele && ele.style) {\n        for (var prop in styles) {\n          if (ele['$style-' + prop] !== styles[prop]) {\n            ele.style[prop] = ele['$style-' + prop] = styles[prop];\n          }\n        }\n      }\n    }\n\n  };\n\n  //Shortcuts\n  ionic.requestAnimationFrame = ionic.DomUtil.requestAnimationFrame;\n  ionic.cancelAnimationFrame = ionic.DomUtil.cancelAnimationFrame;\n  ionic.animationFrameThrottle = ionic.DomUtil.animationFrameThrottle;\n\n})(window, document, ionic);\n\n/**\n * ion-events.js\n *\n * Author: Max Lynch <max@drifty.com>\n *\n * Framework events handles various mobile browser events, and\n * detects special events like tap/swipe/etc. and emits them\n * as custom events that can be used in an app.\n *\n * Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys!\n */\n\n(function(ionic) {\n\n  // Custom event polyfill\n  ionic.CustomEvent = (function() {\n    if( typeof window.CustomEvent === 'function' ) return CustomEvent;\n\n    var customEvent = function(event, params) {\n      var evt;\n      params = params || {\n        bubbles: false,\n        cancelable: false,\n        detail: undefined\n      };\n      try {\n        evt = document.createEvent(\"CustomEvent\");\n        evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n      } catch (error) {\n        // fallback for browsers that don't support createEvent('CustomEvent')\n        evt = document.createEvent(\"Event\");\n        for (var param in params) {\n          evt[param] = params[param];\n        }\n        evt.initEvent(event, params.bubbles, params.cancelable);\n      }\n      return evt;\n    };\n    customEvent.prototype = window.Event.prototype;\n    return customEvent;\n  })();\n\n\n  /**\n   * @ngdoc utility\n   * @name ionic.EventController\n   * @module ionic\n   */\n  ionic.EventController = {\n    VIRTUALIZED_EVENTS: ['tap', 'swipe', 'swiperight', 'swipeleft', 'drag', 'hold', 'release'],\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#trigger\n     * @alias ionic.trigger\n     * @param {string} eventType The event to trigger.\n     * @param {object} data The data for the event. Hint: pass in\n     * `{target: targetElement}`\n     * @param {boolean=} bubbles Whether the event should bubble up the DOM.\n     * @param {boolean=} cancelable Whether the event should be cancelable.\n     */\n    // Trigger a new event\n    trigger: function(eventType, data, bubbles, cancelable) {\n      var event = new ionic.CustomEvent(eventType, {\n        detail: data,\n        bubbles: !!bubbles,\n        cancelable: !!cancelable\n      });\n\n      // Make sure to trigger the event on the given target, or dispatch it from\n      // the window if we don't have an event target\n      data && data.target && data.target.dispatchEvent && data.target.dispatchEvent(event) || window.dispatchEvent(event);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#on\n     * @alias ionic.on\n     * @description Listen to an event on an element.\n     * @param {string} type The event to listen for.\n     * @param {function} callback The listener to be called.\n     * @param {DOMElement} element The element to listen for the event on.\n     */\n    on: function(type, callback, element) {\n      var e = element || window;\n\n      // Bind a gesture if it's a virtual event\n      for(var i = 0, j = this.VIRTUALIZED_EVENTS.length; i < j; i++) {\n        if(type == this.VIRTUALIZED_EVENTS[i]) {\n          var gesture = new ionic.Gesture(element);\n          gesture.on(type, callback);\n          return gesture;\n        }\n      }\n\n      // Otherwise bind a normal event\n      e.addEventListener(type, callback);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#off\n     * @alias ionic.off\n     * @description Remove an event listener.\n     * @param {string} type\n     * @param {function} callback\n     * @param {DOMElement} element\n     */\n    off: function(type, callback, element) {\n      element.removeEventListener(type, callback);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#onGesture\n     * @alias ionic.onGesture\n     * @description Add an event listener for a gesture on an element.\n     *\n     * Available eventTypes (from [hammer.js](http://eightmedia.github.io/hammer.js/)):\n     *\n     * `hold`, `tap`, `doubletap`, `drag`, `dragstart`, `dragend`, `dragup`, `dragdown`, <br/>\n     * `dragleft`, `dragright`, `swipe`, `swipeup`, `swipedown`, `swipeleft`, `swiperight`, <br/>\n     * `transform`, `transformstart`, `transformend`, `rotate`, `pinch`, `pinchin`, `pinchout`, </br>\n     * `touch`, `release`\n     *\n     * @param {string} eventType The gesture event to listen for.\n     * @param {function(e)} callback The function to call when the gesture\n     * happens.\n     * @param {DOMElement} element The angular element to listen for the event on.\n     * @param {object} options object.\n     * @returns {ionic.Gesture} The gesture object (use this to remove the gesture later on).\n     */\n    onGesture: function(type, callback, element, options) {\n      var gesture = new ionic.Gesture(element, options);\n      gesture.on(type, callback);\n      return gesture;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#offGesture\n     * @alias ionic.offGesture\n     * @description Remove an event listener for a gesture created on an element.\n     * @param {ionic.Gesture} gesture The gesture that should be removed.\n     * @param {string} eventType The gesture event to remove the listener for.\n     * @param {function(e)} callback The listener to remove.\n\n     */\n    offGesture: function(gesture, type, callback) {\n      gesture && gesture.off(type, callback);\n    },\n\n    handlePopState: function() {}\n  };\n\n\n  // Map some convenient top-level functions for event handling\n  ionic.on = function() { ionic.EventController.on.apply(ionic.EventController, arguments); };\n  ionic.off = function() { ionic.EventController.off.apply(ionic.EventController, arguments); };\n  ionic.trigger = ionic.EventController.trigger;//function() { ionic.EventController.trigger.apply(ionic.EventController.trigger, arguments); };\n  ionic.onGesture = function() { return ionic.EventController.onGesture.apply(ionic.EventController.onGesture, arguments); };\n  ionic.offGesture = function() { return ionic.EventController.offGesture.apply(ionic.EventController.offGesture, arguments); };\n\n})(window.ionic);\n\n/* eslint camelcase:0 */\n/**\n  * Simple gesture controllers with some common gestures that emit\n  * gesture events.\n  *\n  * Ported from github.com/EightMedia/hammer.js Gestures - thanks!\n  */\n(function(ionic) {\n\n  /**\n   * ionic.Gestures\n   * use this to create instances\n   * @param   {HTMLElement}   element\n   * @param   {Object}        options\n   * @returns {ionic.Gestures.Instance}\n   * @constructor\n   */\n  ionic.Gesture = function(element, options) {\n    return new ionic.Gestures.Instance(element, options || {});\n  };\n\n  ionic.Gestures = {};\n\n  // default settings\n  ionic.Gestures.defaults = {\n    // add css to the element to prevent the browser from doing\n    // its native behavior. this doesnt prevent the scrolling,\n    // but cancels the contextmenu, tap highlighting etc\n    // set to false to disable this\n    stop_browser_behavior: 'disable-user-behavior'\n  };\n\n  // detect touchevents\n  ionic.Gestures.HAS_POINTEREVENTS = window.navigator.pointerEnabled || window.navigator.msPointerEnabled;\n  ionic.Gestures.HAS_TOUCHEVENTS = ('ontouchstart' in window);\n\n  // dont use mouseevents on mobile devices\n  ionic.Gestures.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android|silk/i;\n  ionic.Gestures.NO_MOUSEEVENTS = ionic.Gestures.HAS_TOUCHEVENTS && window.navigator.userAgent.match(ionic.Gestures.MOBILE_REGEX);\n\n  // eventtypes per touchevent (start, move, end)\n  // are filled by ionic.Gestures.event.determineEventTypes on setup\n  ionic.Gestures.EVENT_TYPES = {};\n\n  // direction defines\n  ionic.Gestures.DIRECTION_DOWN = 'down';\n  ionic.Gestures.DIRECTION_LEFT = 'left';\n  ionic.Gestures.DIRECTION_UP = 'up';\n  ionic.Gestures.DIRECTION_RIGHT = 'right';\n\n  // pointer type\n  ionic.Gestures.POINTER_MOUSE = 'mouse';\n  ionic.Gestures.POINTER_TOUCH = 'touch';\n  ionic.Gestures.POINTER_PEN = 'pen';\n\n  // touch event defines\n  ionic.Gestures.EVENT_START = 'start';\n  ionic.Gestures.EVENT_MOVE = 'move';\n  ionic.Gestures.EVENT_END = 'end';\n\n  // hammer document where the base events are added at\n  ionic.Gestures.DOCUMENT = window.document;\n\n  // plugins namespace\n  ionic.Gestures.plugins = {};\n\n  // if the window events are set...\n  ionic.Gestures.READY = false;\n\n  /**\n   * setup events to detect gestures on the document\n   */\n  function setup() {\n    if(ionic.Gestures.READY) {\n      return;\n    }\n\n    // find what eventtypes we add listeners to\n    ionic.Gestures.event.determineEventTypes();\n\n    // Register all gestures inside ionic.Gestures.gestures\n    for(var name in ionic.Gestures.gestures) {\n      if(ionic.Gestures.gestures.hasOwnProperty(name)) {\n        ionic.Gestures.detection.register(ionic.Gestures.gestures[name]);\n      }\n    }\n\n    // Add touch events on the document\n    ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_MOVE, ionic.Gestures.detection.detect);\n    ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_END, ionic.Gestures.detection.detect);\n\n    // ionic.Gestures is ready...!\n    ionic.Gestures.READY = true;\n  }\n\n  /**\n   * create new hammer instance\n   * all methods should return the instance itself, so it is chainable.\n   * @param   {HTMLElement}       element\n   * @param   {Object}            [options={}]\n   * @returns {ionic.Gestures.Instance}\n   * @name Gesture.Instance\n   * @constructor\n   */\n  ionic.Gestures.Instance = function(element, options) {\n    var self = this;\n\n    // A null element was passed into the instance, which means\n    // whatever lookup was done to find this element failed to find it\n    // so we can't listen for events on it.\n    if(element === null) {\n      void 0;\n      return this;\n    }\n\n    // setup ionic.GesturesJS window events and register all gestures\n    // this also sets up the default options\n    setup();\n\n    this.element = element;\n\n    // start/stop detection option\n    this.enabled = true;\n\n    // merge options\n    this.options = ionic.Gestures.utils.extend(\n        ionic.Gestures.utils.extend({}, ionic.Gestures.defaults),\n        options || {});\n\n    // add some css to the element to prevent the browser from doing its native behavoir\n    if(this.options.stop_browser_behavior) {\n      ionic.Gestures.utils.stopDefaultBrowserBehavior(this.element, this.options.stop_browser_behavior);\n    }\n\n    // start detection on touchstart\n    ionic.Gestures.event.onTouch(element, ionic.Gestures.EVENT_START, function(ev) {\n      if(self.enabled) {\n        ionic.Gestures.detection.startDetect(self, ev);\n      }\n    });\n\n    // return instance\n    return this;\n  };\n\n\n  ionic.Gestures.Instance.prototype = {\n    /**\n     * bind events to the instance\n     * @param   {String}      gesture\n     * @param   {Function}    handler\n     * @returns {ionic.Gestures.Instance}\n     */\n    on: function onEvent(gesture, handler){\n      var gestures = gesture.split(' ');\n      for(var t = 0; t < gestures.length; t++) {\n        this.element.addEventListener(gestures[t], handler, false);\n      }\n      return this;\n    },\n\n\n    /**\n     * unbind events to the instance\n     * @param   {String}      gesture\n     * @param   {Function}    handler\n     * @returns {ionic.Gestures.Instance}\n     */\n    off: function offEvent(gesture, handler){\n      var gestures = gesture.split(' ');\n      for(var t = 0; t < gestures.length; t++) {\n        this.element.removeEventListener(gestures[t], handler, false);\n      }\n      return this;\n    },\n\n\n    /**\n     * trigger gesture event\n     * @param   {String}      gesture\n     * @param   {Object}      eventData\n     * @returns {ionic.Gestures.Instance}\n     */\n    trigger: function triggerEvent(gesture, eventData){\n      // create DOM event\n      var event = ionic.Gestures.DOCUMENT.createEvent('Event');\n      event.initEvent(gesture, true, true);\n      event.gesture = eventData;\n\n      // trigger on the target if it is in the instance element,\n      // this is for event delegation tricks\n      var element = this.element;\n      if(ionic.Gestures.utils.hasParent(eventData.target, element)) {\n        element = eventData.target;\n      }\n\n      element.dispatchEvent(event);\n      return this;\n    },\n\n\n    /**\n     * enable of disable hammer.js detection\n     * @param   {Boolean}   state\n     * @returns {ionic.Gestures.Instance}\n     */\n    enable: function enable(state) {\n      this.enabled = state;\n      return this;\n    }\n  };\n\n  /**\n   * this holds the last move event,\n   * used to fix empty touchend issue\n   * see the onTouch event for an explanation\n   * type {Object}\n   */\n  var last_move_event = null;\n\n\n  /**\n   * when the mouse is hold down, this is true\n   * type {Boolean}\n   */\n  var enable_detect = false;\n\n\n  /**\n   * when touch events have been fired, this is true\n   * type {Boolean}\n   */\n  var touch_triggered = false;\n\n\n  ionic.Gestures.event = {\n    /**\n     * simple addEventListener\n     * @param   {HTMLElement}   element\n     * @param   {String}        type\n     * @param   {Function}      handler\n     */\n    bindDom: function(element, type, handler) {\n      var types = type.split(' ');\n      for(var t = 0; t < types.length; t++) {\n        element.addEventListener(types[t], handler, false);\n      }\n    },\n\n\n    /**\n     * touch events with mouse fallback\n     * @param   {HTMLElement}   element\n     * @param   {String}        eventType        like ionic.Gestures.EVENT_MOVE\n     * @param   {Function}      handler\n     */\n    onTouch: function onTouch(element, eventType, handler) {\n      var self = this;\n\n      this.bindDom(element, ionic.Gestures.EVENT_TYPES[eventType], function bindDomOnTouch(ev) {\n        var sourceEventType = ev.type.toLowerCase();\n\n        // onmouseup, but when touchend has been fired we do nothing.\n        // this is for touchdevices which also fire a mouseup on touchend\n        if(sourceEventType.match(/mouse/) && touch_triggered) {\n          return;\n        }\n\n        // mousebutton must be down or a touch event\n        else if( sourceEventType.match(/touch/) ||   // touch events are always on screen\n          sourceEventType.match(/pointerdown/) || // pointerevents touch\n          (sourceEventType.match(/mouse/) && ev.which === 1)   // mouse is pressed\n          ){\n            enable_detect = true;\n          }\n\n        // mouse isn't pressed\n        else if(sourceEventType.match(/mouse/) && ev.which !== 1) {\n          enable_detect = false;\n        }\n\n\n        // we are in a touch event, set the touch triggered bool to true,\n        // this for the conflicts that may occur on ios and android\n        if(sourceEventType.match(/touch|pointer/)) {\n          touch_triggered = true;\n        }\n\n        // count the total touches on the screen\n        var count_touches = 0;\n\n        // when touch has been triggered in this detection session\n        // and we are now handling a mouse event, we stop that to prevent conflicts\n        if(enable_detect) {\n          // update pointerevent\n          if(ionic.Gestures.HAS_POINTEREVENTS && eventType != ionic.Gestures.EVENT_END) {\n            count_touches = ionic.Gestures.PointerEvent.updatePointer(eventType, ev);\n          }\n          // touch\n          else if(sourceEventType.match(/touch/)) {\n            count_touches = ev.touches.length;\n          }\n          // mouse\n          else if(!touch_triggered) {\n            count_touches = sourceEventType.match(/up/) ? 0 : 1;\n          }\n\n          // if we are in a end event, but when we remove one touch and\n          // we still have enough, set eventType to move\n          if(count_touches > 0 && eventType == ionic.Gestures.EVENT_END) {\n            eventType = ionic.Gestures.EVENT_MOVE;\n          }\n          // no touches, force the end event\n          else if(!count_touches) {\n            eventType = ionic.Gestures.EVENT_END;\n          }\n\n          // store the last move event\n          if(count_touches || last_move_event === null) {\n            last_move_event = ev;\n          }\n\n          // trigger the handler\n          handler.call(ionic.Gestures.detection, self.collectEventData(element, eventType, self.getTouchList(last_move_event, eventType), ev));\n\n          // remove pointerevent from list\n          if(ionic.Gestures.HAS_POINTEREVENTS && eventType == ionic.Gestures.EVENT_END) {\n            count_touches = ionic.Gestures.PointerEvent.updatePointer(eventType, ev);\n          }\n        }\n\n        //debug(sourceEventType +\" \"+ eventType);\n\n        // on the end we reset everything\n        if(!count_touches) {\n          last_move_event = null;\n          enable_detect = false;\n          touch_triggered = false;\n          ionic.Gestures.PointerEvent.reset();\n        }\n      });\n    },\n\n\n    /**\n     * we have different events for each device/browser\n     * determine what we need and set them in the ionic.Gestures.EVENT_TYPES constant\n     */\n    determineEventTypes: function determineEventTypes() {\n      // determine the eventtype we want to set\n      var types;\n\n      // pointerEvents magic\n      if(ionic.Gestures.HAS_POINTEREVENTS) {\n        types = ionic.Gestures.PointerEvent.getEvents();\n      }\n      // on Android, iOS, blackberry, windows mobile we dont want any mouseevents\n      else if(ionic.Gestures.NO_MOUSEEVENTS) {\n        types = [\n          'touchstart',\n          'touchmove',\n          'touchend touchcancel'];\n      }\n      // for non pointer events browsers and mixed browsers,\n      // like chrome on windows8 touch laptop\n      else {\n        types = [\n          'touchstart mousedown',\n          'touchmove mousemove',\n          'touchend touchcancel mouseup'];\n      }\n\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_START] = types[0];\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_MOVE] = types[1];\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_END] = types[2];\n    },\n\n\n    /**\n     * create touchlist depending on the event\n     * @param   {Object}    ev\n     * @param   {String}    eventType   used by the fakemultitouch plugin\n     */\n    getTouchList: function getTouchList(ev/*, eventType*/) {\n      // get the fake pointerEvent touchlist\n      if(ionic.Gestures.HAS_POINTEREVENTS) {\n        return ionic.Gestures.PointerEvent.getTouchList();\n      }\n      // get the touchlist\n      else if(ev.touches) {\n        return ev.touches;\n      }\n      // make fake touchlist from mouse position\n      else {\n        ev.identifier = 1;\n        return [ev];\n      }\n    },\n\n\n    /**\n     * collect event data for ionic.Gestures js\n     * @param   {HTMLElement}   element\n     * @param   {String}        eventType        like ionic.Gestures.EVENT_MOVE\n     * @param   {Object}        eventData\n     */\n    collectEventData: function collectEventData(element, eventType, touches, ev) {\n\n      // find out pointerType\n      var pointerType = ionic.Gestures.POINTER_TOUCH;\n      if(ev.type.match(/mouse/) || ionic.Gestures.PointerEvent.matchType(ionic.Gestures.POINTER_MOUSE, ev)) {\n        pointerType = ionic.Gestures.POINTER_MOUSE;\n      }\n\n      return {\n        center: ionic.Gestures.utils.getCenter(touches),\n        timeStamp: new Date().getTime(),\n        target: ev.target,\n        touches: touches,\n        eventType: eventType,\n        pointerType: pointerType,\n        srcEvent: ev,\n\n        /**\n         * prevent the browser default actions\n         * mostly used to disable scrolling of the browser\n         */\n        preventDefault: function() {\n          if(this.srcEvent.preventManipulation) {\n            this.srcEvent.preventManipulation();\n          }\n\n          if(this.srcEvent.preventDefault) {\n            // this.srcEvent.preventDefault();\n          }\n        },\n\n        /**\n         * stop bubbling the event up to its parents\n         */\n        stopPropagation: function() {\n          this.srcEvent.stopPropagation();\n        },\n\n        /**\n         * immediately stop gesture detection\n         * might be useful after a swipe was detected\n         * @return {*}\n         */\n        stopDetect: function() {\n          return ionic.Gestures.detection.stopDetect();\n        }\n      };\n    }\n  };\n\n  ionic.Gestures.PointerEvent = {\n    /**\n     * holds all pointers\n     * type {Object}\n     */\n    pointers: {},\n\n    /**\n     * get a list of pointers\n     * @returns {Array}     touchlist\n     */\n    getTouchList: function() {\n      var self = this;\n      var touchlist = [];\n\n      // we can use forEach since pointerEvents only is in IE10\n      Object.keys(self.pointers).sort().forEach(function(id) {\n        touchlist.push(self.pointers[id]);\n      });\n      return touchlist;\n    },\n\n    /**\n     * update the position of a pointer\n     * @param   {String}   type             ionic.Gestures.EVENT_END\n     * @param   {Object}   pointerEvent\n     */\n    updatePointer: function(type, pointerEvent) {\n      if(type == ionic.Gestures.EVENT_END) {\n        this.pointers = {};\n      }\n      else {\n        pointerEvent.identifier = pointerEvent.pointerId;\n        this.pointers[pointerEvent.pointerId] = pointerEvent;\n      }\n\n      return Object.keys(this.pointers).length;\n    },\n\n    /**\n     * check if ev matches pointertype\n     * @param   {String}        pointerType     ionic.Gestures.POINTER_MOUSE\n     * @param   {PointerEvent}  ev\n     */\n    matchType: function(pointerType, ev) {\n      if(!ev.pointerType) {\n        return false;\n      }\n\n      var types = {};\n      types[ionic.Gestures.POINTER_MOUSE] = (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE || ev.pointerType == ionic.Gestures.POINTER_MOUSE);\n      types[ionic.Gestures.POINTER_TOUCH] = (ev.pointerType == ev.MSPOINTER_TYPE_TOUCH || ev.pointerType == ionic.Gestures.POINTER_TOUCH);\n      types[ionic.Gestures.POINTER_PEN] = (ev.pointerType == ev.MSPOINTER_TYPE_PEN || ev.pointerType == ionic.Gestures.POINTER_PEN);\n      return types[pointerType];\n    },\n\n\n    /**\n     * get events\n     */\n    getEvents: function() {\n      return [\n        'pointerdown MSPointerDown',\n      'pointermove MSPointerMove',\n      'pointerup pointercancel MSPointerUp MSPointerCancel'\n        ];\n    },\n\n    /**\n     * reset the list\n     */\n    reset: function() {\n      this.pointers = {};\n    }\n  };\n\n\n  ionic.Gestures.utils = {\n    /**\n     * extend method,\n     * also used for cloning when dest is an empty object\n     * @param   {Object}    dest\n     * @param   {Object}    src\n     * @param\t{Boolean}\tmerge\t\tdo a merge\n     * @returns {Object}    dest\n     */\n    extend: function extend(dest, src, merge) {\n      for (var key in src) {\n        if(dest[key] !== undefined && merge) {\n          continue;\n        }\n        dest[key] = src[key];\n      }\n      return dest;\n    },\n\n\n    /**\n     * find if a node is in the given parent\n     * used for event delegation tricks\n     * @param   {HTMLElement}   node\n     * @param   {HTMLElement}   parent\n     * @returns {boolean}       has_parent\n     */\n    hasParent: function(node, parent) {\n      while(node){\n        if(node == parent) {\n          return true;\n        }\n        node = node.parentNode;\n      }\n      return false;\n    },\n\n\n    /**\n     * get the center of all the touches\n     * @param   {Array}     touches\n     * @returns {Object}    center\n     */\n    getCenter: function getCenter(touches) {\n      var valuesX = [], valuesY = [];\n\n      for(var t = 0, len = touches.length; t < len; t++) {\n        valuesX.push(touches[t].pageX);\n        valuesY.push(touches[t].pageY);\n      }\n\n      return {\n        pageX: ((Math.min.apply(Math, valuesX) + Math.max.apply(Math, valuesX)) / 2),\n          pageY: ((Math.min.apply(Math, valuesY) + Math.max.apply(Math, valuesY)) / 2)\n      };\n    },\n\n\n    /**\n     * calculate the velocity between two points\n     * @param   {Number}    delta_time\n     * @param   {Number}    delta_x\n     * @param   {Number}    delta_y\n     * @returns {Object}    velocity\n     */\n    getVelocity: function getVelocity(delta_time, delta_x, delta_y) {\n      return {\n        x: Math.abs(delta_x / delta_time) || 0,\n        y: Math.abs(delta_y / delta_time) || 0\n      };\n    },\n\n\n    /**\n     * calculate the angle between two coordinates\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {Number}    angle\n     */\n    getAngle: function getAngle(touch1, touch2) {\n      var y = touch2.pageY - touch1.pageY,\n      x = touch2.pageX - touch1.pageX;\n      return Math.atan2(y, x) * 180 / Math.PI;\n    },\n\n\n    /**\n     * angle to direction define\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {String}    direction constant, like ionic.Gestures.DIRECTION_LEFT\n     */\n    getDirection: function getDirection(touch1, touch2) {\n      var x = Math.abs(touch1.pageX - touch2.pageX),\n      y = Math.abs(touch1.pageY - touch2.pageY);\n\n      if(x >= y) {\n        return touch1.pageX - touch2.pageX > 0 ? ionic.Gestures.DIRECTION_LEFT : ionic.Gestures.DIRECTION_RIGHT;\n      }\n      else {\n        return touch1.pageY - touch2.pageY > 0 ? ionic.Gestures.DIRECTION_UP : ionic.Gestures.DIRECTION_DOWN;\n      }\n    },\n\n\n    /**\n     * calculate the distance between two touches\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {Number}    distance\n     */\n    getDistance: function getDistance(touch1, touch2) {\n      var x = touch2.pageX - touch1.pageX,\n      y = touch2.pageY - touch1.pageY;\n      return Math.sqrt((x * x) + (y * y));\n    },\n\n\n    /**\n     * calculate the scale factor between two touchLists (fingers)\n     * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n     * @param   {Array}     start\n     * @param   {Array}     end\n     * @returns {Number}    scale\n     */\n    getScale: function getScale(start, end) {\n      // need two fingers...\n      if(start.length >= 2 && end.length >= 2) {\n        return this.getDistance(end[0], end[1]) /\n          this.getDistance(start[0], start[1]);\n      }\n      return 1;\n    },\n\n\n    /**\n     * calculate the rotation degrees between two touchLists (fingers)\n     * @param   {Array}     start\n     * @param   {Array}     end\n     * @returns {Number}    rotation\n     */\n    getRotation: function getRotation(start, end) {\n      // need two fingers\n      if(start.length >= 2 && end.length >= 2) {\n        return this.getAngle(end[1], end[0]) -\n          this.getAngle(start[1], start[0]);\n      }\n      return 0;\n    },\n\n\n    /**\n     * boolean if the direction is vertical\n     * @param    {String}    direction\n     * @returns  {Boolean}   is_vertical\n     */\n    isVertical: function isVertical(direction) {\n      return (direction == ionic.Gestures.DIRECTION_UP || direction == ionic.Gestures.DIRECTION_DOWN);\n    },\n\n\n    /**\n     * stop browser default behavior with css class\n     * @param   {HtmlElement}   element\n     * @param   {Object}        css_class\n     */\n    stopDefaultBrowserBehavior: function stopDefaultBrowserBehavior(element, css_class) {\n      // changed from making many style changes to just adding a preset classname\n      // less DOM manipulations, less code, and easier to control in the CSS side of things\n      // hammer.js doesn't come with CSS, but ionic does, which is why we prefer this method\n      if(element && element.classList) {\n        element.classList.add(css_class);\n        element.onselectstart = function() {\n          return false;\n        };\n      }\n    }\n  };\n\n\n  ionic.Gestures.detection = {\n    // contains all registred ionic.Gestures.gestures in the correct order\n    gestures: [],\n\n    // data of the current ionic.Gestures.gesture detection session\n    current: null,\n\n    // the previous ionic.Gestures.gesture session data\n    // is a full clone of the previous gesture.current object\n    previous: null,\n\n    // when this becomes true, no gestures are fired\n    stopped: false,\n\n\n    /**\n     * start ionic.Gestures.gesture detection\n     * @param   {ionic.Gestures.Instance}   inst\n     * @param   {Object}            eventData\n     */\n    startDetect: function startDetect(inst, eventData) {\n      // already busy with a ionic.Gestures.gesture detection on an element\n      if(this.current) {\n        return;\n      }\n\n      this.stopped = false;\n\n      this.current = {\n        inst: inst, // reference to ionic.GesturesInstance we're working for\n        startEvent: ionic.Gestures.utils.extend({}, eventData), // start eventData for distances, timing etc\n        lastEvent: false, // last eventData\n        name: '' // current gesture we're in/detected, can be 'tap', 'hold' etc\n      };\n\n      this.detect(eventData);\n    },\n\n\n    /**\n     * ionic.Gestures.gesture detection\n     * @param   {Object}    eventData\n     */\n    detect: function detect(eventData) {\n      if(!this.current || this.stopped) {\n        return null;\n      }\n\n      // extend event data with calculations about scale, distance etc\n      eventData = this.extendEventData(eventData);\n\n      // instance options\n      var inst_options = this.current.inst.options;\n\n      // call ionic.Gestures.gesture handlers\n      for(var g = 0, len = this.gestures.length; g < len; g++) {\n        var gesture = this.gestures[g];\n\n        // only when the instance options have enabled this gesture\n        if(!this.stopped && inst_options[gesture.name] !== false) {\n          // if a handler returns false, we stop with the detection\n          if(gesture.handler.call(gesture, eventData, this.current.inst) === false) {\n            this.stopDetect();\n            break;\n          }\n        }\n      }\n\n      // store as previous event event\n      if(this.current) {\n        this.current.lastEvent = eventData;\n      }\n\n      // endevent, but not the last touch, so dont stop\n      if(eventData.eventType == ionic.Gestures.EVENT_END && !eventData.touches.length - 1) {\n        this.stopDetect();\n      }\n\n      return eventData;\n    },\n\n\n    /**\n     * clear the ionic.Gestures.gesture vars\n     * this is called on endDetect, but can also be used when a final ionic.Gestures.gesture has been detected\n     * to stop other ionic.Gestures.gestures from being fired\n     */\n    stopDetect: function stopDetect() {\n      // clone current data to the store as the previous gesture\n      // used for the double tap gesture, since this is an other gesture detect session\n      this.previous = ionic.Gestures.utils.extend({}, this.current);\n\n      // reset the current\n      this.current = null;\n\n      // stopped!\n      this.stopped = true;\n    },\n\n\n    /**\n     * extend eventData for ionic.Gestures.gestures\n     * @param   {Object}   ev\n     * @returns {Object}   ev\n     */\n    extendEventData: function extendEventData(ev) {\n      var startEv = this.current.startEvent;\n\n      // if the touches change, set the new touches over the startEvent touches\n      // this because touchevents don't have all the touches on touchstart, or the\n      // user must place his fingers at the EXACT same time on the screen, which is not realistic\n      // but, sometimes it happens that both fingers are touching at the EXACT same time\n      if(startEv && (ev.touches.length != startEv.touches.length || ev.touches === startEv.touches)) {\n        // extend 1 level deep to get the touchlist with the touch objects\n        startEv.touches = [];\n        for(var i = 0, len = ev.touches.length; i < len; i++) {\n          startEv.touches.push(ionic.Gestures.utils.extend({}, ev.touches[i]));\n        }\n      }\n\n      var delta_time = ev.timeStamp - startEv.timeStamp,\n          delta_x = ev.center.pageX - startEv.center.pageX,\n          delta_y = ev.center.pageY - startEv.center.pageY,\n          velocity = ionic.Gestures.utils.getVelocity(delta_time, delta_x, delta_y);\n\n      ionic.Gestures.utils.extend(ev, {\n        deltaTime: delta_time,\n        deltaX: delta_x,\n        deltaY: delta_y,\n\n        velocityX: velocity.x,\n        velocityY: velocity.y,\n\n        distance: ionic.Gestures.utils.getDistance(startEv.center, ev.center),\n        angle: ionic.Gestures.utils.getAngle(startEv.center, ev.center),\n        direction: ionic.Gestures.utils.getDirection(startEv.center, ev.center),\n\n        scale: ionic.Gestures.utils.getScale(startEv.touches, ev.touches),\n        rotation: ionic.Gestures.utils.getRotation(startEv.touches, ev.touches),\n\n        startEvent: startEv\n      });\n\n      return ev;\n    },\n\n\n    /**\n     * register new gesture\n     * @param   {Object}    gesture object, see gestures.js for documentation\n     * @returns {Array}     gestures\n     */\n    register: function register(gesture) {\n      // add an enable gesture options if there is no given\n      var options = gesture.defaults || {};\n      if(options[gesture.name] === undefined) {\n        options[gesture.name] = true;\n      }\n\n      // extend ionic.Gestures default options with the ionic.Gestures.gesture options\n      ionic.Gestures.utils.extend(ionic.Gestures.defaults, options, true);\n\n      // set its index\n      gesture.index = gesture.index || 1000;\n\n      // add ionic.Gestures.gesture to the list\n      this.gestures.push(gesture);\n\n      // sort the list by index\n      this.gestures.sort(function(a, b) {\n        if (a.index < b.index) {\n          return -1;\n        }\n        if (a.index > b.index) {\n          return 1;\n        }\n        return 0;\n      });\n\n      return this.gestures;\n    }\n  };\n\n\n  ionic.Gestures.gestures = ionic.Gestures.gestures || {};\n\n  /**\n   * Custom gestures\n   * ==============================\n   *\n   * Gesture object\n   * --------------------\n   * The object structure of a gesture:\n   *\n   * { name: 'mygesture',\n   *   index: 1337,\n   *   defaults: {\n   *     mygesture_option: true\n   *   }\n   *   handler: function(type, ev, inst) {\n   *     // trigger gesture event\n   *     inst.trigger(this.name, ev);\n   *   }\n   * }\n\n   * @param   {String}    name\n   * this should be the name of the gesture, lowercase\n   * it is also being used to disable/enable the gesture per instance config.\n   *\n   * @param   {Number}    [index=1000]\n   * the index of the gesture, where it is going to be in the stack of gestures detection\n   * like when you build an gesture that depends on the drag gesture, it is a good\n   * idea to place it after the index of the drag gesture.\n   *\n   * @param   {Object}    [defaults={}]\n   * the default settings of the gesture. these are added to the instance settings,\n   * and can be overruled per instance. you can also add the name of the gesture,\n   * but this is also added by default (and set to true).\n   *\n   * @param   {Function}  handler\n   * this handles the gesture detection of your custom gesture and receives the\n   * following arguments:\n   *\n   *      @param  {Object}    eventData\n   *      event data containing the following properties:\n   *          timeStamp   {Number}        time the event occurred\n   *          target      {HTMLElement}   target element\n   *          touches     {Array}         touches (fingers, pointers, mouse) on the screen\n   *          pointerType {String}        kind of pointer that was used. matches ionic.Gestures.POINTER_MOUSE|TOUCH\n   *          center      {Object}        center position of the touches. contains pageX and pageY\n   *          deltaTime   {Number}        the total time of the touches in the screen\n   *          deltaX      {Number}        the delta on x axis we haved moved\n   *          deltaY      {Number}        the delta on y axis we haved moved\n   *          velocityX   {Number}        the velocity on the x\n   *          velocityY   {Number}        the velocity on y\n   *          angle       {Number}        the angle we are moving\n   *          direction   {String}        the direction we are moving. matches ionic.Gestures.DIRECTION_UP|DOWN|LEFT|RIGHT\n   *          distance    {Number}        the distance we haved moved\n   *          scale       {Number}        scaling of the touches, needs 2 touches\n   *          rotation    {Number}        rotation of the touches, needs 2 touches *\n   *          eventType   {String}        matches ionic.Gestures.EVENT_START|MOVE|END\n   *          srcEvent    {Object}        the source event, like TouchStart or MouseDown *\n   *          startEvent  {Object}        contains the same properties as above,\n   *                                      but from the first touch. this is used to calculate\n   *                                      distances, deltaTime, scaling etc\n   *\n   *      @param  {ionic.Gestures.Instance}    inst\n   *      the instance we are doing the detection for. you can get the options from\n   *      the inst.options object and trigger the gesture event by calling inst.trigger\n   *\n   *\n   * Handle gestures\n   * --------------------\n   * inside the handler you can get/set ionic.Gestures.detectionic.current. This is the current\n   * detection sessionic. It has the following properties\n   *      @param  {String}    name\n   *      contains the name of the gesture we have detected. it has not a real function,\n   *      only to check in other gestures if something is detected.\n   *      like in the drag gesture we set it to 'drag' and in the swipe gesture we can\n   *      check if the current gesture is 'drag' by accessing ionic.Gestures.detectionic.current.name\n   *\n   *      readonly\n   *      @param  {ionic.Gestures.Instance}    inst\n   *      the instance we do the detection for\n   *\n   *      readonly\n   *      @param  {Object}    startEvent\n   *      contains the properties of the first gesture detection in this sessionic.\n   *      Used for calculations about timing, distance, etc.\n   *\n   *      readonly\n   *      @param  {Object}    lastEvent\n   *      contains all the properties of the last gesture detect in this sessionic.\n   *\n   * after the gesture detection session has been completed (user has released the screen)\n   * the ionic.Gestures.detectionic.current object is copied into ionic.Gestures.detectionic.previous,\n   * this is usefull for gestures like doubletap, where you need to know if the\n   * previous gesture was a tap\n   *\n   * options that have been set by the instance can be received by calling inst.options\n   *\n   * You can trigger a gesture event by calling inst.trigger(\"mygesture\", event).\n   * The first param is the name of your gesture, the second the event argument\n   *\n   *\n   * Register gestures\n   * --------------------\n   * When an gesture is added to the ionic.Gestures.gestures object, it is auto registered\n   * at the setup of the first ionic.Gestures instance. You can also call ionic.Gestures.detectionic.register\n   * manually and pass your gesture object as a param\n   *\n   */\n\n  /**\n   * Hold\n   * Touch stays at the same place for x time\n   * events  hold\n   */\n  ionic.Gestures.gestures.Hold = {\n    name: 'hold',\n    index: 10,\n    defaults: {\n      hold_timeout: 500,\n      hold_threshold: 1\n    },\n    timer: null,\n    handler: function holdGesture(ev, inst) {\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          // clear any running timers\n          clearTimeout(this.timer);\n\n          // set the gesture so we can check in the timeout if it still is\n          ionic.Gestures.detection.current.name = this.name;\n\n          // set timer and if after the timeout it still is hold,\n          // we trigger the hold event\n          this.timer = setTimeout(function() {\n            if(ionic.Gestures.detection.current.name == 'hold') {\n              ionic.tap.cancelClick();\n              inst.trigger('hold', ev);\n            }\n          }, inst.options.hold_timeout);\n          break;\n\n          // when you move or end we clear the timer\n        case ionic.Gestures.EVENT_MOVE:\n          if(ev.distance > inst.options.hold_threshold) {\n            clearTimeout(this.timer);\n          }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          clearTimeout(this.timer);\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Tap/DoubleTap\n   * Quick touch at a place or double at the same place\n   * events  tap, doubletap\n   */\n  ionic.Gestures.gestures.Tap = {\n    name: 'tap',\n    index: 100,\n    defaults: {\n      tap_max_touchtime: 250,\n      tap_max_distance: 10,\n      tap_always: true,\n      doubletap_distance: 20,\n      doubletap_interval: 300\n    },\n    handler: function tapGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END && ev.srcEvent.type != 'touchcancel') {\n        // previous gesture, for the double tap since these are two different gesture detections\n        var prev = ionic.Gestures.detection.previous,\n        did_doubletap = false;\n\n        // when the touchtime is higher then the max touch time\n        // or when the moving distance is too much\n        if(ev.deltaTime > inst.options.tap_max_touchtime ||\n            ev.distance > inst.options.tap_max_distance) {\n              return;\n            }\n\n        // check if double tap\n        if(prev && prev.name == 'tap' &&\n            (ev.timeStamp - prev.lastEvent.timeStamp) < inst.options.doubletap_interval &&\n            ev.distance < inst.options.doubletap_distance) {\n              inst.trigger('doubletap', ev);\n              did_doubletap = true;\n            }\n\n        // do a single tap\n        if(!did_doubletap || inst.options.tap_always) {\n          ionic.Gestures.detection.current.name = 'tap';\n          inst.trigger('tap', ev);\n        }\n      }\n    }\n  };\n\n\n  /**\n   * Swipe\n   * triggers swipe events when the end velocity is above the threshold\n   * events  swipe, swipeleft, swiperight, swipeup, swipedown\n   */\n  ionic.Gestures.gestures.Swipe = {\n    name: 'swipe',\n    index: 40,\n    defaults: {\n      // set 0 for unlimited, but this can conflict with transform\n      swipe_max_touches: 1,\n      swipe_velocity: 0.4\n    },\n    handler: function swipeGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END) {\n        // max touches\n        if(inst.options.swipe_max_touches > 0 &&\n            ev.touches.length > inst.options.swipe_max_touches) {\n              return;\n            }\n\n        // when the distance we moved is too small we skip this gesture\n        // or we can be already in dragging\n        if(ev.velocityX > inst.options.swipe_velocity ||\n            ev.velocityY > inst.options.swipe_velocity) {\n              // trigger swipe events\n              inst.trigger(this.name, ev);\n              inst.trigger(this.name + ev.direction, ev);\n            }\n      }\n    }\n  };\n\n\n  /**\n   * Drag\n   * Move with x fingers (default 1) around on the page. Blocking the scrolling when\n   * moving left and right is a good practice. When all the drag events are blocking\n   * you disable scrolling on that area.\n   * events  drag, drapleft, dragright, dragup, dragdown\n   */\n  ionic.Gestures.gestures.Drag = {\n    name: 'drag',\n    index: 50,\n    defaults: {\n      drag_min_distance: 10,\n      // Set correct_for_drag_min_distance to true to make the starting point of the drag\n      // be calculated from where the drag was triggered, not from where the touch started.\n      // Useful to avoid a jerk-starting drag, which can make fine-adjustments\n      // through dragging difficult, and be visually unappealing.\n      correct_for_drag_min_distance: true,\n      // set 0 for unlimited, but this can conflict with transform\n      drag_max_touches: 1,\n      // prevent default browser behavior when dragging occurs\n      // be careful with it, it makes the element a blocking element\n      // when you are using the drag gesture, it is a good practice to set this true\n      drag_block_horizontal: true,\n      drag_block_vertical: true,\n      // drag_lock_to_axis keeps the drag gesture on the axis that it started on,\n      // It disallows vertical directions if the initial direction was horizontal, and vice versa.\n      drag_lock_to_axis: false,\n      // drag lock only kicks in when distance > drag_lock_min_distance\n      // This way, locking occurs only when the distance has become large enough to reliably determine the direction\n      drag_lock_min_distance: 25,\n      // prevent default if the gesture is going the given direction\n      prevent_default_directions: []\n    },\n    triggered: false,\n    handler: function dragGesture(ev, inst) {\n      if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {\n        this.preventedFirstMove = false;\n\n      } else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {\n        if (inst.options.prevent_default_directions.indexOf(ev.direction) != -1) {\n          ev.srcEvent.preventDefault();\n        }\n        this.preventedFirstMove = true;\n      }\n\n      // current gesture isnt drag, but dragged is true\n      // this means an other gesture is busy. now call dragend\n      if(ionic.Gestures.detection.current.name != this.name && this.triggered) {\n        inst.trigger(this.name + 'end', ev);\n        this.triggered = false;\n        return;\n      }\n\n      // max touches\n      if(inst.options.drag_max_touches > 0 &&\n          ev.touches.length > inst.options.drag_max_touches) {\n            return;\n          }\n\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          this.triggered = false;\n          break;\n\n        case ionic.Gestures.EVENT_MOVE:\n          // when the distance we moved is too small we skip this gesture\n          // or we can be already in dragging\n          if(ev.distance < inst.options.drag_min_distance &&\n              ionic.Gestures.detection.current.name != this.name) {\n                return;\n              }\n\n          // we are dragging!\n          if(ionic.Gestures.detection.current.name != this.name) {\n            ionic.Gestures.detection.current.name = this.name;\n            if (inst.options.correct_for_drag_min_distance) {\n              // When a drag is triggered, set the event center to drag_min_distance pixels from the original event center.\n              // Without this correction, the dragged distance would jumpstart at drag_min_distance pixels instead of at 0.\n              // It might be useful to save the original start point somewhere\n              var factor = Math.abs(inst.options.drag_min_distance / ev.distance);\n              ionic.Gestures.detection.current.startEvent.center.pageX += ev.deltaX * factor;\n              ionic.Gestures.detection.current.startEvent.center.pageY += ev.deltaY * factor;\n\n              // recalculate event data using new start point\n              ev = ionic.Gestures.detection.extendEventData(ev);\n            }\n          }\n\n          // lock drag to axis?\n          if(ionic.Gestures.detection.current.lastEvent.drag_locked_to_axis || (inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance <= ev.distance)) {\n            ev.drag_locked_to_axis = true;\n          }\n          var last_direction = ionic.Gestures.detection.current.lastEvent.direction;\n          if(ev.drag_locked_to_axis && last_direction !== ev.direction) {\n            // keep direction on the axis that the drag gesture started on\n            if(ionic.Gestures.utils.isVertical(last_direction)) {\n              ev.direction = (ev.deltaY < 0) ? ionic.Gestures.DIRECTION_UP : ionic.Gestures.DIRECTION_DOWN;\n            }\n            else {\n              ev.direction = (ev.deltaX < 0) ? ionic.Gestures.DIRECTION_LEFT : ionic.Gestures.DIRECTION_RIGHT;\n            }\n          }\n\n          // first time, trigger dragstart event\n          if(!this.triggered) {\n            inst.trigger(this.name + 'start', ev);\n            this.triggered = true;\n          }\n\n          // trigger normal event\n          inst.trigger(this.name, ev);\n\n          // direction event, like dragdown\n          inst.trigger(this.name + ev.direction, ev);\n\n          // block the browser events\n          if( (inst.options.drag_block_vertical && ionic.Gestures.utils.isVertical(ev.direction)) ||\n              (inst.options.drag_block_horizontal && !ionic.Gestures.utils.isVertical(ev.direction))) {\n                ev.preventDefault();\n              }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          // trigger dragend\n          if(this.triggered) {\n            inst.trigger(this.name + 'end', ev);\n          }\n\n          this.triggered = false;\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Transform\n   * User want to scale or rotate with 2 fingers\n   * events  transform, pinch, pinchin, pinchout, rotate\n   */\n  ionic.Gestures.gestures.Transform = {\n    name: 'transform',\n    index: 45,\n    defaults: {\n      // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1\n      transform_min_scale: 0.01,\n      // rotation in degrees\n      transform_min_rotation: 1,\n      // prevent default browser behavior when two touches are on the screen\n      // but it makes the element a blocking element\n      // when you are using the transform gesture, it is a good practice to set this true\n      transform_always_block: false\n    },\n    triggered: false,\n    handler: function transformGesture(ev, inst) {\n      // current gesture isnt drag, but dragged is true\n      // this means an other gesture is busy. now call dragend\n      if(ionic.Gestures.detection.current.name != this.name && this.triggered) {\n        inst.trigger(this.name + 'end', ev);\n        this.triggered = false;\n        return;\n      }\n\n      // atleast multitouch\n      if(ev.touches.length < 2) {\n        return;\n      }\n\n      // prevent default when two fingers are on the screen\n      if(inst.options.transform_always_block) {\n        ev.preventDefault();\n      }\n\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          this.triggered = false;\n          break;\n\n        case ionic.Gestures.EVENT_MOVE:\n          var scale_threshold = Math.abs(1 - ev.scale);\n          var rotation_threshold = Math.abs(ev.rotation);\n\n          // when the distance we moved is too small we skip this gesture\n          // or we can be already in dragging\n          if(scale_threshold < inst.options.transform_min_scale &&\n              rotation_threshold < inst.options.transform_min_rotation) {\n                return;\n              }\n\n          // we are transforming!\n          ionic.Gestures.detection.current.name = this.name;\n\n          // first time, trigger dragstart event\n          if(!this.triggered) {\n            inst.trigger(this.name + 'start', ev);\n            this.triggered = true;\n          }\n\n          inst.trigger(this.name, ev); // basic transform event\n\n          // trigger rotate event\n          if(rotation_threshold > inst.options.transform_min_rotation) {\n            inst.trigger('rotate', ev);\n          }\n\n          // trigger pinch event\n          if(scale_threshold > inst.options.transform_min_scale) {\n            inst.trigger('pinch', ev);\n            inst.trigger('pinch' + ((ev.scale < 1) ? 'in' : 'out'), ev);\n          }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          // trigger dragend\n          if(this.triggered) {\n            inst.trigger(this.name + 'end', ev);\n          }\n\n          this.triggered = false;\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Touch\n   * Called as first, tells the user has touched the screen\n   * events  touch\n   */\n  ionic.Gestures.gestures.Touch = {\n    name: 'touch',\n    index: -Infinity,\n    defaults: {\n      // call preventDefault at touchstart, and makes the element blocking by\n      // disabling the scrolling of the page, but it improves gestures like\n      // transforming and dragging.\n      // be careful with using this, it can be very annoying for users to be stuck\n      // on the page\n      prevent_default: false,\n\n      // disable mouse events, so only touch (or pen!) input triggers events\n      prevent_mouseevents: false\n    },\n    handler: function touchGesture(ev, inst) {\n      if(inst.options.prevent_mouseevents && ev.pointerType == ionic.Gestures.POINTER_MOUSE) {\n        ev.stopDetect();\n        return;\n      }\n\n      if(inst.options.prevent_default) {\n        ev.preventDefault();\n      }\n\n      if(ev.eventType == ionic.Gestures.EVENT_START) {\n        inst.trigger(this.name, ev);\n      }\n    }\n  };\n\n\n  /**\n   * Release\n   * Called as last, tells the user has released the screen\n   * events  release\n   */\n  ionic.Gestures.gestures.Release = {\n    name: 'release',\n    index: Infinity,\n    handler: function releaseGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END) {\n        inst.trigger(this.name, ev);\n      }\n    }\n  };\n})(window.ionic);\n\n(function(window, document, ionic) {\n\n  function getParameterByName(name) {\n    name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n    var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n    results = regex.exec(location.search);\n    return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n  }\n\n  var IOS = 'ios';\n  var ANDROID = 'android';\n  var WINDOWS_PHONE = 'windowsphone';\n  var requestAnimationFrame = ionic.requestAnimationFrame;\n\n  /**\n   * @ngdoc utility\n   * @name ionic.Platform\n   * @module ionic\n   * @description\n   * A set of utility methods that can be used to retrieve the device ready state and\n   * various other information such as what kind of platform the app is currently installed on.\n   *\n   * @usage\n   * ```js\n   * angular.module('PlatformApp', ['ionic'])\n   * .controller('PlatformCtrl', function($scope) {\n   *\n   *   ionic.Platform.ready(function(){\n   *     // will execute when device is ready, or immediately if the device is already ready.\n   *   });\n   *\n   *   var deviceInformation = ionic.Platform.device();\n   *\n   *   var isWebView = ionic.Platform.isWebView();\n   *   var isIPad = ionic.Platform.isIPad();\n   *   var isIOS = ionic.Platform.isIOS();\n   *   var isAndroid = ionic.Platform.isAndroid();\n   *   var isWindowsPhone = ionic.Platform.isWindowsPhone();\n   *\n   *   var currentPlatform = ionic.Platform.platform();\n   *   var currentPlatformVersion = ionic.Platform.version();\n   *\n   *   ionic.Platform.exitApp(); // stops the app\n   * });\n   * ```\n   */\n  var self = ionic.Platform = {\n\n    // Put navigator on platform so it can be mocked and set\n    // the browser does not allow window.navigator to be set\n    navigator: window.navigator,\n\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#isReady\n     * @returns {boolean} Whether the device is ready.\n     */\n    isReady: false,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#isFullScreen\n     * @returns {boolean} Whether the device is fullscreen.\n     */\n    isFullScreen: false,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#platforms\n     * @returns {Array(string)} An array of all platforms found.\n     */\n    platforms: null,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#grade\n     * @returns {string} What grade the current platform is.\n     */\n    grade: null,\n    ua: navigator.userAgent,\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#ready\n     * @description\n     * Trigger a callback once the device is ready, or immediately\n     * if the device is already ready. This method can be run from\n     * anywhere and does not need to be wrapped by any additonal methods.\n     * When the app is within a WebView (Cordova), it'll fire\n     * the callback once the device is ready. If the app is within\n     * a web browser, it'll fire the callback after `window.load`.\n     * Please remember that Cordova features (Camera, FileSystem, etc) still\n     * will not work in a web browser.\n     * @param {function} callback The function to call.\n     */\n    ready: function(cb) {\n      // run through tasks to complete now that the device is ready\n      if (self.isReady) {\n        cb();\n      } else {\n        // the platform isn't ready yet, add it to this array\n        // which will be called once the platform is ready\n        readyCallbacks.push(cb);\n      }\n    },\n\n    /**\n     * @private\n     */\n    detect: function() {\n      self._checkPlatforms();\n\n      requestAnimationFrame(function() {\n        // only add to the body class if we got platform info\n        for (var i = 0; i < self.platforms.length; i++) {\n          document.body.classList.add('platform-' + self.platforms[i]);\n        }\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#setGrade\n     * @description Set the grade of the device: 'a', 'b', or 'c'. 'a' is the best\n     * (most css features enabled), 'c' is the worst.  By default, sets the grade\n     * depending on the current device.\n     * @param {string} grade The new grade to set.\n     */\n    setGrade: function(grade) {\n      var oldGrade = self.grade;\n      self.grade = grade;\n      requestAnimationFrame(function() {\n        if (oldGrade) {\n          document.body.classList.remove('grade-' + oldGrade);\n        }\n        document.body.classList.add('grade-' + grade);\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#device\n     * @description Return the current device (given by cordova).\n     * @returns {object} The device object.\n     */\n    device: function() {\n      return window.device || {};\n    },\n\n    _checkPlatforms: function() {\n      self.platforms = [];\n      var grade = 'a';\n\n      if (self.isWebView()) {\n        self.platforms.push('webview');\n        if (!(!window.cordova && !window.PhoneGap && !window.phonegap)) {\n          self.platforms.push('cordova');\n        } else if (window.forge) {\n          self.platforms.push('trigger');\n        }\n      } else {\n        self.platforms.push('browser');\n      }\n      if (self.isIPad()) self.platforms.push('ipad');\n\n      var platform = self.platform();\n      if (platform) {\n        self.platforms.push(platform);\n\n        var version = self.version();\n        if (version) {\n          var v = version.toString();\n          if (v.indexOf('.') > 0) {\n            v = v.replace('.', '_');\n          } else {\n            v += '_0';\n          }\n          self.platforms.push(platform + v.split('_')[0]);\n          self.platforms.push(platform + v);\n\n          if (self.isAndroid() && version < 4.4) {\n            grade = (version < 4 ? 'c' : 'b');\n          } else if (self.isWindowsPhone()) {\n            grade = 'b';\n          }\n        }\n      }\n\n      self.setGrade(grade);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isWebView\n     * @returns {boolean} Check if we are running within a WebView (such as Cordova).\n     */\n    isWebView: function() {\n      return !(!window.cordova && !window.PhoneGap && !window.phonegap && !window.forge);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isIPad\n     * @returns {boolean} Whether we are running on iPad.\n     */\n    isIPad: function() {\n      if (/iPad/i.test(self.navigator.platform)) {\n        return true;\n      }\n      return /iPad/i.test(self.ua);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isIOS\n     * @returns {boolean} Whether we are running on iOS.\n     */\n    isIOS: function() {\n      return self.is(IOS);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isAndroid\n     * @returns {boolean} Whether we are running on Android.\n     */\n    isAndroid: function() {\n      return self.is(ANDROID);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isWindowsPhone\n     * @returns {boolean} Whether we are running on Windows Phone.\n     */\n    isWindowsPhone: function() {\n      return self.is(WINDOWS_PHONE);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#platform\n     * @returns {string} The name of the current platform.\n     */\n    platform: function() {\n      // singleton to get the platform name\n      if (platformName === null) self.setPlatform(self.device().platform);\n      return platformName;\n    },\n\n    /**\n     * @private\n     */\n    setPlatform: function(n) {\n      if (typeof n != 'undefined' && n !== null && n.length) {\n        platformName = n.toLowerCase();\n      } else if (getParameterByName('ionicplatform')) {\n        platformName = getParameterByName('ionicplatform');\n      } else if (self.ua.indexOf('Android') > 0) {\n        platformName = ANDROID;\n      } else if (/iPhone|iPad|iPod/.test(self.ua)) {\n        platformName = IOS;\n      } else if (self.ua.indexOf('Windows Phone') > -1) {\n        platformName = WINDOWS_PHONE;\n      } else {\n        platformName = self.navigator.platform && navigator.platform.toLowerCase().split(' ')[0] || '';\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#version\n     * @returns {number} The version of the current device platform.\n     */\n    version: function() {\n      // singleton to get the platform version\n      if (platformVersion === null) self.setVersion(self.device().version);\n      return platformVersion;\n    },\n\n    /**\n     * @private\n     */\n    setVersion: function(v) {\n      if (typeof v != 'undefined' && v !== null) {\n        v = v.split('.');\n        v = parseFloat(v[0] + '.' + (v.length > 1 ? v[1] : 0));\n        if (!isNaN(v)) {\n          platformVersion = v;\n          return;\n        }\n      }\n\n      platformVersion = 0;\n\n      // fallback to user-agent checking\n      var pName = self.platform();\n      var versionMatch = {\n        'android': /Android (\\d+).(\\d+)?/,\n        'ios': /OS (\\d+)_(\\d+)?/,\n        'windowsphone': /Windows Phone (\\d+).(\\d+)?/\n      };\n      if (versionMatch[pName]) {\n        v = self.ua.match(versionMatch[pName]);\n        if (v && v.length > 2) {\n          platformVersion = parseFloat(v[1] + '.' + v[2]);\n        }\n      }\n    },\n\n    // Check if the platform is the one detected by cordova\n    is: function(type) {\n      type = type.toLowerCase();\n      // check if it has an array of platforms\n      if (self.platforms) {\n        for (var x = 0; x < self.platforms.length; x++) {\n          if (self.platforms[x] === type) return true;\n        }\n      }\n      // exact match\n      var pName = self.platform();\n      if (pName) {\n        return pName === type.toLowerCase();\n      }\n\n      // A quick hack for to check userAgent\n      return self.ua.toLowerCase().indexOf(type) >= 0;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#exitApp\n     * @description Exit the app.\n     */\n    exitApp: function() {\n      self.ready(function() {\n        navigator.app && navigator.app.exitApp && navigator.app.exitApp();\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#showStatusBar\n     * @description Shows or hides the device status bar (in Cordova). Requires `cordova plugin add org.apache.cordova.statusbar`\n     * @param {boolean} shouldShow Whether or not to show the status bar.\n     */\n    showStatusBar: function(val) {\n      // Only useful when run within cordova\n      self._showStatusBar = val;\n      self.ready(function() {\n        // run this only when or if the platform (cordova) is ready\n        requestAnimationFrame(function() {\n          if (self._showStatusBar) {\n            // they do not want it to be full screen\n            window.StatusBar && window.StatusBar.show();\n            document.body.classList.remove('status-bar-hide');\n          } else {\n            // it should be full screen\n            window.StatusBar && window.StatusBar.hide();\n            document.body.classList.add('status-bar-hide');\n          }\n        });\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#fullScreen\n     * @description\n     * Sets whether the app is fullscreen or not (in Cordova).\n     * @param {boolean=} showFullScreen Whether or not to set the app to fullscreen. Defaults to true. Requires `cordova plugin add org.apache.cordova.statusbar`\n     * @param {boolean=} showStatusBar Whether or not to show the device's status bar. Defaults to false.\n     */\n    fullScreen: function(showFullScreen, showStatusBar) {\n      // showFullScreen: default is true if no param provided\n      self.isFullScreen = (showFullScreen !== false);\n\n      // add/remove the fullscreen classname to the body\n      ionic.DomUtil.ready(function() {\n        // run this only when or if the DOM is ready\n        requestAnimationFrame(function() {\n          if (self.isFullScreen) {\n            document.body.classList.add('fullscreen');\n          } else {\n            document.body.classList.remove('fullscreen');\n          }\n        });\n        // showStatusBar: default is false if no param provided\n        self.showStatusBar((showStatusBar === true));\n      });\n    }\n\n  };\n\n  var platformName = null, // just the name, like iOS or Android\n  platformVersion = null, // a float of the major and minor, like 7.1\n  readyCallbacks = [],\n  windowLoadListenderAttached;\n\n  // setup listeners to know when the device is ready to go\n  function onWindowLoad() {\n    if (self.isWebView()) {\n      // the window and scripts are fully loaded, and a cordova/phonegap\n      // object exists then let's listen for the deviceready\n      document.addEventListener(\"deviceready\", onPlatformReady, false);\n    } else {\n      // the window and scripts are fully loaded, but the window object doesn't have the\n      // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n      onPlatformReady();\n    }\n    if (windowLoadListenderAttached) {\n      window.removeEventListener(\"load\", onWindowLoad, false);\n    }\n  }\n  if (document.readyState === 'complete') {\n    onWindowLoad();\n  } else {\n    windowLoadListenderAttached = true;\n    window.addEventListener(\"load\", onWindowLoad, false);\n  }\n\n  function onPlatformReady() {\n    // the device is all set to go, init our own stuff then fire off our event\n    self.isReady = true;\n    self.detect();\n    for (var x = 0; x < readyCallbacks.length; x++) {\n      // fire off all the callbacks that were added before the platform was ready\n      readyCallbacks[x]();\n    }\n    readyCallbacks = [];\n    ionic.trigger('platformready', { target: document });\n\n    requestAnimationFrame(function() {\n      document.body.classList.add('platform-ready');\n    });\n  }\n\n})(this, document, ionic);\n\n(function(document, ionic) {\n  'use strict';\n\n  // Ionic CSS polyfills\n  ionic.CSS = {};\n\n  (function() {\n\n    // transform\n    var i, keys = ['webkitTransform', 'transform', '-webkit-transform', 'webkit-transform',\n                   '-moz-transform', 'moz-transform', 'MozTransform', 'mozTransform', 'msTransform'];\n\n    for (i = 0; i < keys.length; i++) {\n      if (document.documentElement.style[keys[i]] !== undefined) {\n        ionic.CSS.TRANSFORM = keys[i];\n        break;\n      }\n    }\n\n    // transition\n    keys = ['webkitTransition', 'mozTransition', 'msTransition', 'transition'];\n    for (i = 0; i < keys.length; i++) {\n      if (document.documentElement.style[keys[i]] !== undefined) {\n        ionic.CSS.TRANSITION = keys[i];\n        break;\n      }\n    }\n\n    // The only prefix we care about is webkit for transitions.\n    var isWebkit = ionic.CSS.TRANSITION.indexOf('webkit') > -1;\n\n    // transition duration\n    ionic.CSS.TRANSITION_DURATION = (isWebkit ? '-webkit-' : '') + 'transition-duration';\n\n    // To be sure transitionend works everywhere, include *both* the webkit and non-webkit events\n    ionic.CSS.TRANSITIONEND = (isWebkit ? 'webkitTransitionEnd ' : '') + 'transitionend';\n  })();\n\n  // classList polyfill for them older Androids\n  // https://gist.github.com/devongovett/1381839\n  if (!(\"classList\" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {\n    Object.defineProperty(HTMLElement.prototype, 'classList', {\n      get: function() {\n        var self = this;\n        function update(fn) {\n          return function() {\n            var x, classes = self.className.split(/\\s+/);\n\n            for (x = 0; x < arguments.length; x++) {\n              fn(classes, classes.indexOf(arguments[x]), arguments[x]);\n            }\n\n            self.className = classes.join(\" \");\n          };\n        }\n\n        return {\n          add: update(function(classes, index, value) {\n            ~index || classes.push(value);\n          }),\n\n          remove: update(function(classes, index) {\n            ~index && classes.splice(index, 1);\n          }),\n\n          toggle: update(function(classes, index, value) {\n            ~index ? classes.splice(index, 1) : classes.push(value);\n          }),\n\n          contains: function(value) {\n            return !!~self.className.split(/\\s+/).indexOf(value);\n          },\n\n          item: function(i) {\n            return self.className.split(/\\s+/)[i] || null;\n          }\n        };\n\n      }\n    });\n  }\n\n})(document, ionic);\n\n\n/**\n * @ngdoc page\n * @name tap\n * @module ionic\n * @description\n * On touch devices such as a phone or tablet, some browsers implement a 300ms delay between\n * the time the user stops touching the display and the moment the browser executes the\n * click. This delay was initially introduced so the browser can know whether the user wants to\n * double-tap to zoom in on the webpage.  Basically, the browser waits roughly 300ms to see if\n * the user is double-tapping, or just tapping on the display once.\n *\n * Out of the box, Ionic automatically removes the 300ms delay in order to make Ionic apps\n * feel more \"native\" like. Resultingly, other solutions such as\n * [fastclick](https://github.com/ftlabs/fastclick) and Angular's\n * [ngTouch](https://docs.angularjs.org/api/ngTouch) should not be included, to avoid conflicts.\n *\n * Some browsers already remove the delay with certain settings, such as the CSS property\n * `touch-events: none` or with specific meta tag viewport values. However, each of these\n * browsers still handle clicks differently, such as when to fire off or cancel the event\n * (like scrolling when the target is a button, or holding a button down).\n * For browsers that already remove the 300ms delay, consider Ionic's tap system as a way to\n * normalize how clicks are handled across the various devices so there's an expected response\n * no matter what the device, platform or version. Additionally, Ionic will prevent\n * ghostclicks which even browsers that remove the delay still experience.\n *\n * In some cases, third-party libraries may also be working with touch events which can interfere\n * with the tap system. For example, mapping libraries like Google or Leaflet Maps often implement\n * a touch detection system which conflicts with Ionic's tap system.\n *\n * ### Disabling the tap system\n *\n * To disable the tap for an element and all of its children elements,\n * add the attribute `data-tap-disabled=\"true\"`.\n *\n * ```html\n * <div data-tap-disabled=\"true\">\n *     <div id=\"google-map\"></div>\n * </div>\n * ```\n *\n * ### Additional Notes:\n *\n * - Ionic tap  works with Ionic's JavaScript scrolling\n * - Elements can come and go from the DOM and Ionic tap doesn't keep adding and removing\n *   listeners\n * - No \"tap delay\" after the first \"tap\" (you can tap as fast as you want, they all click)\n * - Minimal events listeners, only being added to document\n * - Correct focus in/out on each input type (select, textearea, range) on each platform/device\n * - Shows and hides virtual keyboard correctly for each platform/device\n * - Works with labels surrounding inputs\n * - Does not fire off a click if the user moves the pointer too far\n * - Adds and removes an 'activated' css class\n * - Multiple [unit tests](https://github.com/driftyco/ionic/blob/master/test/unit/utils/tap.unit.js) for each scenario\n *\n */\n/*\n\n IONIC TAP\n ---------------\n - Both touch and mouse events are added to the document.body on DOM ready\n - If a touch event happens, it does not use mouse event listeners\n - On touchend, if the distance between start and end was small, trigger a click\n - In the triggered click event, add a 'isIonicTap' property\n - The triggered click receives the same x,y coordinates as as the end event\n - On document.body click listener (with useCapture=true), only allow clicks with 'isIonicTap'\n - Triggering clicks with mouse events work the same as touch, except with mousedown/mouseup\n - Tapping inputs is disabled during scrolling\n*/\n\nvar tapDoc; // the element which the listeners are on (document.body)\nvar tapActiveEle; // the element which is active (probably has focus)\nvar tapEnabledTouchEvents;\nvar tapMouseResetTimer;\nvar tapPointerMoved;\nvar tapPointerStart;\nvar tapTouchFocusedInput;\nvar tapLastTouchTarget;\nvar tapTouchMoveListener = 'touchmove';\n\n// how much the coordinates can be off between start/end, but still a click\nvar TAP_RELEASE_TOLERANCE = 12; // default tolerance\nvar TAP_RELEASE_BUTTON_TOLERANCE = 50; // button elements should have a larger tolerance\n\nvar tapEventListeners = {\n  'click': tapClickGateKeeper,\n\n  'mousedown': tapMouseDown,\n  'mouseup': tapMouseUp,\n  'mousemove': tapMouseMove,\n\n  'touchstart': tapTouchStart,\n  'touchend': tapTouchEnd,\n  'touchcancel': tapTouchCancel,\n  'touchmove': tapTouchMove,\n\n  'pointerdown': tapTouchStart,\n  'pointerup': tapTouchEnd,\n  'pointercancel': tapTouchCancel,\n  'pointermove': tapTouchMove,\n\n  'MSPointerDown': tapTouchStart,\n  'MSPointerUp': tapTouchEnd,\n  'MSPointerCancel': tapTouchCancel,\n  'MSPointerMove': tapTouchMove,\n\n  'focusin': tapFocusIn,\n  'focusout': tapFocusOut\n};\n\nionic.tap = {\n\n  register: function(ele) {\n    tapDoc = ele;\n\n    tapEventListener('click', true, true);\n    tapEventListener('mouseup');\n    tapEventListener('mousedown');\n\n    if (window.navigator.pointerEnabled) {\n      tapEventListener('pointerdown');\n      tapEventListener('pointerup');\n      tapEventListener('pointcancel');\n      tapTouchMoveListener = 'pointermove';\n\n    } else if (window.navigator.msPointerEnabled) {\n      tapEventListener('MSPointerDown');\n      tapEventListener('MSPointerUp');\n      tapEventListener('MSPointerCancel');\n      tapTouchMoveListener = 'MSPointerMove';\n\n    } else {\n      tapEventListener('touchstart');\n      tapEventListener('touchend');\n      tapEventListener('touchcancel');\n    }\n\n    tapEventListener('focusin');\n    tapEventListener('focusout');\n\n    return function() {\n      for (var type in tapEventListeners) {\n        tapEventListener(type, false);\n      }\n      tapDoc = null;\n      tapActiveEle = null;\n      tapEnabledTouchEvents = false;\n      tapPointerMoved = false;\n      tapPointerStart = null;\n    };\n  },\n\n  ignoreScrollStart: function(e) {\n    return (e.defaultPrevented) ||  // defaultPrevented has been assigned by another component handling the event\n           (/^(file|range)$/i).test(e.target.type) ||\n           (e.target.dataset ? e.target.dataset.preventScroll : e.target.getAttribute('data-prevent-scroll')) == 'true' || // manually set within an elements attributes\n           (!!(/^(object|embed)$/i).test(e.target.tagName)) ||  // flash/movie/object touches should not try to scroll\n           ionic.tap.isElementTapDisabled(e.target); // check if this element, or an ancestor, has `data-tap-disabled` attribute\n  },\n\n  isTextInput: function(ele) {\n    return !!ele &&\n           (ele.tagName == 'TEXTAREA' ||\n            ele.contentEditable === 'true' ||\n            (ele.tagName == 'INPUT' && !(/^(radio|checkbox|range|file|submit|reset|color|image|button)$/i).test(ele.type)));\n  },\n\n  isDateInput: function(ele) {\n    return !!ele &&\n            (ele.tagName == 'INPUT' && (/^(date|time|datetime-local|month|week)$/i).test(ele.type));\n  },\n\n  isKeyboardElement: function(ele) {\n    if ( !ionic.Platform.isIOS() || ionic.Platform.isIPad() ) {\n      return ionic.tap.isTextInput(ele) && !ionic.tap.isDateInput(ele);\n    } else {\n      return ionic.tap.isTextInput(ele) || ( !!ele && ele.tagName == \"SELECT\");\n    }\n  },\n\n  isLabelWithTextInput: function(ele) {\n    var container = tapContainingElement(ele, false);\n\n    return !!container &&\n           ionic.tap.isTextInput(tapTargetElement(container));\n  },\n\n  containsOrIsTextInput: function(ele) {\n    return ionic.tap.isTextInput(ele) || ionic.tap.isLabelWithTextInput(ele);\n  },\n\n  cloneFocusedInput: function(container) {\n    if (ionic.tap.hasCheckedClone) return;\n    ionic.tap.hasCheckedClone = true;\n\n    ionic.requestAnimationFrame(function() {\n      var focusInput = container.querySelector(':focus');\n      if (ionic.tap.isTextInput(focusInput)) {\n        var clonedInput = focusInput.cloneNode(true);\n\n        clonedInput.value = focusInput.value;\n        clonedInput.classList.add('cloned-text-input');\n        clonedInput.readOnly = true;\n        if (focusInput.isContentEditable) {\n          clonedInput.contentEditable = focusInput.contentEditable;\n          clonedInput.innerHTML = focusInput.innerHTML;\n        }\n        focusInput.parentElement.insertBefore(clonedInput, focusInput);\n        focusInput.classList.add('previous-input-focus');\n\n        clonedInput.scrollTop = focusInput.scrollTop;\n      }\n    });\n  },\n\n  hasCheckedClone: false,\n\n  removeClonedInputs: function(container) {\n    ionic.tap.hasCheckedClone = false;\n\n    ionic.requestAnimationFrame(function() {\n      var clonedInputs = container.querySelectorAll('.cloned-text-input');\n      var previousInputFocus = container.querySelectorAll('.previous-input-focus');\n      var x;\n\n      for (x = 0; x < clonedInputs.length; x++) {\n        clonedInputs[x].parentElement.removeChild(clonedInputs[x]);\n      }\n\n      for (x = 0; x < previousInputFocus.length; x++) {\n        previousInputFocus[x].classList.remove('previous-input-focus');\n        previousInputFocus[x].style.top = '';\n        if ( ionic.keyboard.isOpen && !ionic.keyboard.isClosing ) previousInputFocus[x].focus();\n      }\n    });\n  },\n\n  requiresNativeClick: function(ele) {\n    if (!ele || ele.disabled || (/^(file|range)$/i).test(ele.type) || (/^(object|video)$/i).test(ele.tagName) || ionic.tap.isLabelContainingFileInput(ele)) {\n      return true;\n    }\n    return ionic.tap.isElementTapDisabled(ele);\n  },\n\n  isLabelContainingFileInput: function(ele) {\n    var lbl = tapContainingElement(ele);\n    if (lbl.tagName !== 'LABEL') return false;\n    var fileInput = lbl.querySelector('input[type=file]');\n    if (fileInput && fileInput.disabled === false) return true;\n    return false;\n  },\n\n  isElementTapDisabled: function(ele) {\n    if (ele && ele.nodeType === 1) {\n      var element = ele;\n      while (element) {\n        if ((element.dataset ? element.dataset.tapDisabled : element.getAttribute('data-tap-disabled')) == 'true') {\n          return true;\n        }\n        element = element.parentElement;\n      }\n    }\n    return false;\n  },\n\n  setTolerance: function(releaseTolerance, releaseButtonTolerance) {\n    TAP_RELEASE_TOLERANCE = releaseTolerance;\n    TAP_RELEASE_BUTTON_TOLERANCE = releaseButtonTolerance;\n  },\n\n  cancelClick: function() {\n    // used to cancel any simulated clicks which may happen on a touchend/mouseup\n    // gestures uses this method within its tap and hold events\n    tapPointerMoved = true;\n  },\n\n  pointerCoord: function(event) {\n    // This method can get coordinates for both a mouse click\n    // or a touch depending on the given event\n    var c = { x: 0, y: 0 };\n    if (event) {\n      var touches = event.touches && event.touches.length ? event.touches : [event];\n      var e = (event.changedTouches && event.changedTouches[0]) || touches[0];\n      if (e) {\n        c.x = e.clientX || e.pageX || 0;\n        c.y = e.clientY || e.pageY || 0;\n      }\n    }\n    return c;\n  }\n\n};\n\nfunction tapEventListener(type, enable, useCapture) {\n  if (enable !== false) {\n    tapDoc.addEventListener(type, tapEventListeners[type], useCapture);\n  } else {\n    tapDoc.removeEventListener(type, tapEventListeners[type]);\n  }\n}\n\nfunction tapClick(e) {\n  // simulate a normal click by running the element's click method then focus on it\n  var container = tapContainingElement(e.target);\n  var ele = tapTargetElement(container);\n\n  if (ionic.tap.requiresNativeClick(ele) || tapPointerMoved) return false;\n\n  var c = ionic.tap.pointerCoord(e);\n\n  //console.log('tapClick', e.type, ele.tagName, '('+c.x+','+c.y+')');\n  triggerMouseEvent('click', ele, c.x, c.y);\n\n  // if it's an input, focus in on the target, otherwise blur\n  tapHandleFocus(ele);\n}\n\nfunction triggerMouseEvent(type, ele, x, y) {\n  // using initMouseEvent instead of MouseEvent for our Android friends\n  var clickEvent = document.createEvent(\"MouseEvents\");\n  clickEvent.initMouseEvent(type, true, true, window, 1, 0, 0, x, y, false, false, false, false, 0, null);\n  clickEvent.isIonicTap = true;\n  ele.dispatchEvent(clickEvent);\n}\n\nfunction tapClickGateKeeper(e) {\n  //console.log('click ' + Date.now() + ' isIonicTap: ' + (e.isIonicTap ? true : false));\n  if (e.target.type == 'submit' && e.detail === 0) {\n    // do not prevent click if it came from an \"Enter\" or \"Go\" keypress submit\n    return null;\n  }\n\n  // do not allow through any click events that were not created by ionic.tap\n  if ((ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) ||\n      (!e.isIonicTap && !ionic.tap.requiresNativeClick(e.target))) {\n    //console.log('clickPrevent', e.target.tagName);\n    e.stopPropagation();\n\n    if (!ionic.tap.isLabelWithTextInput(e.target)) {\n      // labels clicks from native should not preventDefault othersize keyboard will not show on input focus\n      e.preventDefault();\n    }\n    return false;\n  }\n}\n\n// MOUSE\nfunction tapMouseDown(e) {\n  //console.log('mousedown ' + Date.now());\n  if (e.isIonicTap || tapIgnoreEvent(e)) return null;\n\n  if (tapEnabledTouchEvents) {\n    void 0;\n    e.stopPropagation();\n\n    if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName)) {\n      // If you preventDefault on a text input then you cannot move its text caret/cursor.\n      // Allow through only the text input default. However, without preventDefault on an\n      // input the 300ms delay can change focus on inputs after the keyboard shows up.\n      // The focusin event handles the chance of focus changing after the keyboard shows.\n      e.preventDefault();\n    }\n\n    return false;\n  }\n\n  tapPointerMoved = false;\n  tapPointerStart = ionic.tap.pointerCoord(e);\n\n  tapEventListener('mousemove');\n  ionic.activator.start(e);\n}\n\nfunction tapMouseUp(e) {\n  //console.log(\"mouseup \" + Date.now());\n  if (tapEnabledTouchEvents) {\n    e.stopPropagation();\n    e.preventDefault();\n    return false;\n  }\n\n  if (tapIgnoreEvent(e) || (/^(select|option)$/i).test(e.target.tagName)) return false;\n\n  if (!tapHasPointerMoved(e)) {\n    tapClick(e);\n  }\n  tapEventListener('mousemove', false);\n  ionic.activator.end();\n  tapPointerMoved = false;\n}\n\nfunction tapMouseMove(e) {\n  if (tapHasPointerMoved(e)) {\n    tapEventListener('mousemove', false);\n    ionic.activator.end();\n    tapPointerMoved = true;\n    return false;\n  }\n}\n\n\n// TOUCH\nfunction tapTouchStart(e) {\n  //console.log(\"touchstart \" + Date.now());\n  if (tapIgnoreEvent(e)) return;\n\n  tapPointerMoved = false;\n\n  tapEnableTouchEvents();\n  tapPointerStart = ionic.tap.pointerCoord(e);\n\n  tapEventListener(tapTouchMoveListener);\n  ionic.activator.start(e);\n\n  if (ionic.Platform.isIOS() && ionic.tap.isLabelWithTextInput(e.target)) {\n    // if the tapped element is a label, which has a child input\n    // then preventDefault so iOS doesn't ugly auto scroll to the input\n    // but do not prevent default on Android or else you cannot move the text caret\n    // and do not prevent default on Android or else no virtual keyboard shows up\n\n    var textInput = tapTargetElement(tapContainingElement(e.target));\n    if (textInput !== tapActiveEle) {\n      // don't preventDefault on an already focused input or else iOS's text caret isn't usable\n      e.preventDefault();\n    }\n  }\n}\n\nfunction tapTouchEnd(e) {\n  //console.log('touchend ' + Date.now());\n  if (tapIgnoreEvent(e)) return;\n\n  tapEnableTouchEvents();\n  if (!tapHasPointerMoved(e)) {\n    tapClick(e);\n\n    if ((/^(select|option)$/i).test(e.target.tagName)) {\n      e.preventDefault();\n    }\n  }\n\n  tapLastTouchTarget = e.target;\n  tapTouchCancel();\n}\n\nfunction tapTouchMove(e) {\n  if (tapHasPointerMoved(e)) {\n    tapPointerMoved = true;\n    tapEventListener(tapTouchMoveListener, false);\n    ionic.activator.end();\n    return false;\n  }\n}\n\nfunction tapTouchCancel() {\n  tapEventListener(tapTouchMoveListener, false);\n  ionic.activator.end();\n  tapPointerMoved = false;\n}\n\nfunction tapEnableTouchEvents() {\n  tapEnabledTouchEvents = true;\n  clearTimeout(tapMouseResetTimer);\n  tapMouseResetTimer = setTimeout(function() {\n    tapEnabledTouchEvents = false;\n  }, 600);\n}\n\nfunction tapIgnoreEvent(e) {\n  if (e.isTapHandled) return true;\n  e.isTapHandled = true;\n\n  if (ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) {\n    e.preventDefault();\n    return true;\n  }\n}\n\nfunction tapHandleFocus(ele) {\n  tapTouchFocusedInput = null;\n\n  var triggerFocusIn = false;\n\n  if (ele.tagName == 'SELECT') {\n    // trick to force Android options to show up\n    triggerMouseEvent('mousedown', ele, 0, 0);\n    ele.focus && ele.focus();\n    triggerFocusIn = true;\n\n  } else if (tapActiveElement() === ele) {\n    // already is the active element and has focus\n    triggerFocusIn = true;\n\n  } else if ((/^(input|textarea)$/i).test(ele.tagName) || ele.isContentEditable) {\n    triggerFocusIn = true;\n    ele.focus && ele.focus();\n    ele.value = ele.value;\n    if (tapEnabledTouchEvents) {\n      tapTouchFocusedInput = ele;\n    }\n\n  } else {\n    tapFocusOutActive();\n  }\n\n  if (triggerFocusIn) {\n    tapActiveElement(ele);\n    ionic.trigger('ionic.focusin', {\n      target: ele\n    }, true);\n  }\n}\n\nfunction tapFocusOutActive() {\n  var ele = tapActiveElement();\n  if (ele && ((/^(input|textarea|select)$/i).test(ele.tagName) || ele.isContentEditable)) {\n    void 0;\n    ele.blur();\n  }\n  tapActiveElement(null);\n}\n\nfunction tapFocusIn(e) {\n  //console.log('focusin ' + Date.now());\n  // Because a text input doesn't preventDefault (so the caret still works) there's a chance\n  // that its mousedown event 300ms later will change the focus to another element after\n  // the keyboard shows up.\n\n  if (tapEnabledTouchEvents &&\n      ionic.tap.isTextInput(tapActiveElement()) &&\n      ionic.tap.isTextInput(tapTouchFocusedInput) &&\n      tapTouchFocusedInput !== e.target) {\n\n    // 1) The pointer is from touch events\n    // 2) There is an active element which is a text input\n    // 3) A text input was just set to be focused on by a touch event\n    // 4) A new focus has been set, however the target isn't the one the touch event wanted\n    void 0;\n    tapTouchFocusedInput.focus();\n    tapTouchFocusedInput = null;\n  }\n  ionic.scroll.isScrolling = false;\n}\n\nfunction tapFocusOut() {\n  //console.log(\"focusout\");\n  tapActiveElement(null);\n}\n\nfunction tapActiveElement(ele) {\n  if (arguments.length) {\n    tapActiveEle = ele;\n  }\n  return tapActiveEle || document.activeElement;\n}\n\nfunction tapHasPointerMoved(endEvent) {\n  if (!endEvent || endEvent.target.nodeType !== 1 || !tapPointerStart || (tapPointerStart.x === 0 && tapPointerStart.y === 0)) {\n    return false;\n  }\n  var endCoordinates = ionic.tap.pointerCoord(endEvent);\n\n  var hasClassList = !!(endEvent.target.classList && endEvent.target.classList.contains &&\n    typeof endEvent.target.classList.contains === 'function');\n  var releaseTolerance = hasClassList && endEvent.target.classList.contains('button') ?\n    TAP_RELEASE_BUTTON_TOLERANCE :\n    TAP_RELEASE_TOLERANCE;\n\n  return Math.abs(tapPointerStart.x - endCoordinates.x) > releaseTolerance ||\n         Math.abs(tapPointerStart.y - endCoordinates.y) > releaseTolerance;\n}\n\nfunction tapContainingElement(ele, allowSelf) {\n  var climbEle = ele;\n  for (var x = 0; x < 6; x++) {\n    if (!climbEle) break;\n    if (climbEle.tagName === 'LABEL') return climbEle;\n    climbEle = climbEle.parentElement;\n  }\n  if (allowSelf !== false) return ele;\n}\n\nfunction tapTargetElement(ele) {\n  if (ele && ele.tagName === 'LABEL') {\n    if (ele.control) return ele.control;\n\n    // older devices do not support the \"control\" property\n    if (ele.querySelector) {\n      var control = ele.querySelector('input,textarea,select');\n      if (control) return control;\n    }\n  }\n  return ele;\n}\n\nionic.DomUtil.ready(function() {\n  var ng = typeof angular !== 'undefined' ? angular : null;\n  //do nothing for e2e tests\n  if (!ng || (ng && !ng.scenario)) {\n    ionic.tap.register(document);\n  }\n});\n\n(function(document, ionic) {\n  'use strict';\n\n  var queueElements = {};   // elements that should get an active state in XX milliseconds\n  var activeElements = {};  // elements that are currently active\n  var keyId = 0;            // a counter for unique keys for the above ojects\n  var ACTIVATED_CLASS = 'activated';\n\n  ionic.activator = {\n\n    start: function(e) {\n      var hitX = ionic.tap.pointerCoord(e).x;\n      if (hitX > 0 && hitX < 30) {\n        return;\n      }\n\n      // when an element is touched/clicked, it climbs up a few\n      // parents to see if it is an .item or .button element\n      ionic.requestAnimationFrame(function() {\n        if ((ionic.scroll && ionic.scroll.isScrolling) || ionic.tap.requiresNativeClick(e.target)) return;\n        var ele = e.target;\n        var eleToActivate;\n\n        for (var x = 0; x < 6; x++) {\n          if (!ele || ele.nodeType !== 1) break;\n          if (eleToActivate && ele.classList && ele.classList.contains('item')) {\n            eleToActivate = ele;\n            break;\n          }\n          if (ele.tagName == 'A' || ele.tagName == 'BUTTON' || ele.hasAttribute('ng-click')) {\n            eleToActivate = ele;\n            break;\n          }\n          if (ele.classList.contains('button')) {\n            eleToActivate = ele;\n            break;\n          }\n          // no sense climbing past these\n          if (ele.tagName == 'ION-CONTENT' || (ele.classList && ele.classList.contains('pane')) || ele.tagName == 'BODY') {\n            break;\n          }\n          ele = ele.parentElement;\n        }\n\n        if (eleToActivate) {\n          // queue that this element should be set to active\n          queueElements[keyId] = eleToActivate;\n\n          // on the next frame, set the queued elements to active\n          ionic.requestAnimationFrame(activateElements);\n\n          keyId = (keyId > 29 ? 0 : keyId + 1);\n        }\n\n      });\n    },\n\n    end: function() {\n      // clear out any active/queued elements after XX milliseconds\n      setTimeout(clear, 200);\n    }\n\n  };\n\n  function clear() {\n    // clear out any elements that are queued to be set to active\n    queueElements = {};\n\n    // in the next frame, remove the active class from all active elements\n    ionic.requestAnimationFrame(deactivateElements);\n  }\n\n  function activateElements() {\n    // activate all elements in the queue\n    for (var key in queueElements) {\n      if (queueElements[key]) {\n        queueElements[key].classList.add(ACTIVATED_CLASS);\n        activeElements[key] = queueElements[key];\n      }\n    }\n    queueElements = {};\n  }\n\n  function deactivateElements() {\n    if (ionic.transition && ionic.transition.isActive) {\n      setTimeout(deactivateElements, 400);\n      return;\n    }\n\n    for (var key in activeElements) {\n      if (activeElements[key]) {\n        activeElements[key].classList.remove(ACTIVATED_CLASS);\n        delete activeElements[key];\n      }\n    }\n  }\n\n})(document, ionic);\n\n(function(ionic) {\n  /* for nextUid function below */\n  var nextId = 0;\n\n  /**\n   * Various utilities used throughout Ionic\n   *\n   * Some of these are adopted from underscore.js and backbone.js, both also MIT licensed.\n   */\n  ionic.Utils = {\n\n    arrayMove: function(arr, oldIndex, newIndex) {\n      if (newIndex >= arr.length) {\n        var k = newIndex - arr.length;\n        while ((k--) + 1) {\n          arr.push(undefined);\n        }\n      }\n      arr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]);\n      return arr;\n    },\n\n    /**\n     * Return a function that will be called with the given context\n     */\n    proxy: function(func, context) {\n      var args = Array.prototype.slice.call(arguments, 2);\n      return function() {\n        return func.apply(context, args.concat(Array.prototype.slice.call(arguments)));\n      };\n    },\n\n    /**\n     * Only call a function once in the given interval.\n     *\n     * @param func {Function} the function to call\n     * @param wait {int} how long to wait before/after to allow function calls\n     * @param immediate {boolean} whether to call immediately or after the wait interval\n     */\n     debounce: function(func, wait, immediate) {\n      var timeout, args, context, timestamp, result;\n      return function() {\n        context = this;\n        args = arguments;\n        timestamp = new Date();\n        var later = function() {\n          var last = (new Date()) - timestamp;\n          if (last < wait) {\n            timeout = setTimeout(later, wait - last);\n          } else {\n            timeout = null;\n            if (!immediate) result = func.apply(context, args);\n          }\n        };\n        var callNow = immediate && !timeout;\n        if (!timeout) {\n          timeout = setTimeout(later, wait);\n        }\n        if (callNow) result = func.apply(context, args);\n        return result;\n      };\n    },\n\n    /**\n     * Throttle the given fun, only allowing it to be\n     * called at most every `wait` ms.\n     */\n    throttle: function(func, wait, options) {\n      var context, args, result;\n      var timeout = null;\n      var previous = 0;\n      options || (options = {});\n      var later = function() {\n        previous = options.leading === false ? 0 : Date.now();\n        timeout = null;\n        result = func.apply(context, args);\n      };\n      return function() {\n        var now = Date.now();\n        if (!previous && options.leading === false) previous = now;\n        var remaining = wait - (now - previous);\n        context = this;\n        args = arguments;\n        if (remaining <= 0) {\n          clearTimeout(timeout);\n          timeout = null;\n          previous = now;\n          result = func.apply(context, args);\n        } else if (!timeout && options.trailing !== false) {\n          timeout = setTimeout(later, remaining);\n        }\n        return result;\n      };\n    },\n     // Borrowed from Backbone.js's extend\n     // Helper function to correctly set up the prototype chain, for subclasses.\n     // Similar to `goog.inherits`, but uses a hash of prototype properties and\n     // class properties to be extended.\n    inherit: function(protoProps, staticProps) {\n      var parent = this;\n      var child;\n\n      // The constructor function for the new subclass is either defined by you\n      // (the \"constructor\" property in your `extend` definition), or defaulted\n      // by us to simply call the parent's constructor.\n      if (protoProps && protoProps.hasOwnProperty('constructor')) {\n        child = protoProps.constructor;\n      } else {\n        child = function() { return parent.apply(this, arguments); };\n      }\n\n      // Add static properties to the constructor function, if supplied.\n      ionic.extend(child, parent, staticProps);\n\n      // Set the prototype chain to inherit from `parent`, without calling\n      // `parent`'s constructor function.\n      var Surrogate = function() { this.constructor = child; };\n      Surrogate.prototype = parent.prototype;\n      child.prototype = new Surrogate();\n\n      // Add prototype properties (instance properties) to the subclass,\n      // if supplied.\n      if (protoProps) ionic.extend(child.prototype, protoProps);\n\n      // Set a convenience property in case the parent's prototype is needed\n      // later.\n      child.__super__ = parent.prototype;\n\n      return child;\n    },\n\n    // Extend adapted from Underscore.js\n    extend: function(obj) {\n       var args = Array.prototype.slice.call(arguments, 1);\n       for (var i = 0; i < args.length; i++) {\n         var source = args[i];\n         if (source) {\n           for (var prop in source) {\n             obj[prop] = source[prop];\n           }\n         }\n       }\n       return obj;\n    },\n\n    nextUid: function() {\n      return 'ion' + (nextId++);\n    },\n\n    disconnectScope: function disconnectScope(scope) {\n      if (!scope) return;\n\n      if (scope.$root === scope) {\n        return; // we can't disconnect the root node;\n      }\n      var parent = scope.$parent;\n      scope.$$disconnected = true;\n      scope.$broadcast('$ionic.disconnectScope', scope);\n\n      // See Scope.$destroy\n      if (parent.$$childHead === scope) {\n        parent.$$childHead = scope.$$nextSibling;\n      }\n      if (parent.$$childTail === scope) {\n        parent.$$childTail = scope.$$prevSibling;\n      }\n      if (scope.$$prevSibling) {\n        scope.$$prevSibling.$$nextSibling = scope.$$nextSibling;\n      }\n      if (scope.$$nextSibling) {\n        scope.$$nextSibling.$$prevSibling = scope.$$prevSibling;\n      }\n      scope.$$nextSibling = scope.$$prevSibling = null;\n    },\n\n    reconnectScope: function reconnectScope(scope) {\n      if (!scope) return;\n\n      if (scope.$root === scope) {\n        return; // we can't disconnect the root node;\n      }\n      if (!scope.$$disconnected) {\n        return;\n      }\n      var parent = scope.$parent;\n      scope.$$disconnected = false;\n      scope.$broadcast('$ionic.reconnectScope', scope);\n      // See Scope.$new for this logic...\n      scope.$$prevSibling = parent.$$childTail;\n      if (parent.$$childHead) {\n        parent.$$childTail.$$nextSibling = scope;\n        parent.$$childTail = scope;\n      } else {\n        parent.$$childHead = parent.$$childTail = scope;\n      }\n    },\n\n    isScopeDisconnected: function(scope) {\n      var climbScope = scope;\n      while (climbScope) {\n        if (climbScope.$$disconnected) return true;\n        climbScope = climbScope.$parent;\n      }\n      return false;\n    }\n  };\n\n  // Bind a few of the most useful functions to the ionic scope\n  ionic.inherit = ionic.Utils.inherit;\n  ionic.extend = ionic.Utils.extend;\n  ionic.throttle = ionic.Utils.throttle;\n  ionic.proxy = ionic.Utils.proxy;\n  ionic.debounce = ionic.Utils.debounce;\n\n})(window.ionic);\n\n/**\n * @ngdoc page\n * @name keyboard\n * @module ionic\n * @description\n * On both Android and iOS, Ionic will attempt to prevent the keyboard from\n * obscuring inputs and focusable elements when it appears by scrolling them\n * into view.  In order for this to work, any focusable elements must be within\n * a [Scroll View](http://ionicframework.com/docs/api/directive/ionScroll/)\n * or a directive such as [Content](http://ionicframework.com/docs/api/directive/ionContent/)\n * that has a Scroll View.\n *\n * It will also attempt to prevent the native overflow scrolling on focus,\n * which can cause layout issues such as pushing headers up and out of view.\n *\n * The keyboard fixes work best in conjunction with the\n * [Ionic Keyboard Plugin](https://github.com/driftyco/ionic-plugins-keyboard),\n * although it will perform reasonably well without.  However, if you are using\n * Cordova there is no reason not to use the plugin.\n *\n * ### Hide when keyboard shows\n *\n * To hide an element when the keyboard is open, add the class `hide-on-keyboard-open`.\n *\n * ```html\n * <div class=\"hide-on-keyboard-open\">\n *   <div id=\"google-map\"></div>\n * </div>\n * ```\n * ----------\n *\n * ### Plugin Usage\n * Information on using the plugin can be found at\n * [https://github.com/driftyco/ionic-plugins-keyboard](https://github.com/driftyco/ionic-plugins-keyboard).\n *\n * ----------\n *\n * ### Android Notes\n * - If your app is running in fullscreen, i.e. you have\n *   `<preference name=\"Fullscreen\" value=\"true\" />` in your `config.xml` file\n *   you will need to set `ionic.Platform.isFullScreen = true` manually.\n *\n * - You can configure the behavior of the web view when the keyboard shows by setting\n *   [android:windowSoftInputMode](http://developer.android.com/reference/android/R.attr.html#windowSoftInputMode)\n *   to either `adjustPan`, `adjustResize` or `adjustNothing` in your app's\n *   activity in `AndroidManifest.xml`. `adjustResize` is the recommended setting\n *   for Ionic, but if for some reason you do use `adjustPan` you will need to\n *   set `ionic.Platform.isFullScreen = true`.\n *\n *   ```xml\n *   <activity android:windowSoftInputMode=\"adjustResize\">\n *\n *   ```\n *\n * ### iOS Notes\n * - If the content of your app (including the header) is being pushed up and\n *   out of view on input focus, try setting `cordova.plugins.Keyboard.disableScroll(true)`.\n *   This does **not** disable scrolling in the Ionic scroll view, rather it\n *   disables the native overflow scrolling that happens automatically as a\n *   result of focusing on inputs below the keyboard.\n *\n */\n\n/**\n * The current viewport height.\n */\nvar keyboardCurrentViewportHeight = 0;\n\n/**\n * The viewport height when in portrait orientation.\n */\nvar keyboardPortraitViewportHeight = 0;\n\n/**\n * The viewport height when in landscape orientation.\n */\nvar keyboardLandscapeViewportHeight = 0;\n\n/**\n * The currently focused input.\n */\nvar keyboardActiveElement;\n\n/**\n * The scroll view containing the currently focused input.\n */\nvar scrollView;\n\n/**\n * Timer for the setInterval that polls window.innerHeight to determine whether\n * the layout has updated for the keyboard showing/hiding.\n */\nvar waitForResizeTimer;\n\n/**\n * Sometimes when switching inputs or orientations, focusout will fire before\n * focusin, so this timer is for the small setTimeout to determine if we should\n * really focusout/hide the keyboard.\n */\nvar keyboardFocusOutTimer;\n\n/**\n * on Android, orientationchange will fire before the keyboard plugin notifies\n * the browser that the keyboard will show/is showing, so this flag indicates\n * to nativeShow that there was an orientationChange and we should update\n * the viewport height with an accurate keyboard height value\n */\nvar wasOrientationChange = false;\n\n/**\n * CSS class added to the body indicating the keyboard is open.\n */\nvar KEYBOARD_OPEN_CSS = 'keyboard-open';\n\n/**\n * CSS class that indicates a scroll container.\n */\nvar SCROLL_CONTAINER_CSS = 'scroll-content';\n\n/**\n * Debounced keyboardFocusIn function\n */\nvar debouncedKeyboardFocusIn = ionic.debounce(keyboardFocusIn, 200, true);\n\n/**\n * Debounced keyboardNativeShow function\n */\nvar debouncedKeyboardNativeShow = ionic.debounce(keyboardNativeShow, 100, true);\n\n/**\n * Ionic keyboard namespace.\n * @namespace keyboard\n */\nionic.keyboard = {\n\n  /**\n   * Whether the keyboard is open or not.\n   */\n  isOpen: false,\n\n  /**\n   * Whether the keyboard is closing or not.\n   */\n  isClosing: false,\n\n  /**\n   * Whether the keyboard is opening or not.\n   */\n  isOpening: false,\n\n  /**\n   * The height of the keyboard in pixels, as reported by the keyboard plugin.\n   * If the plugin is not available, calculated as the difference in\n   * window.innerHeight after the keyboard has shown.\n   */\n  height: 0,\n\n  /**\n   * Whether the device is in landscape orientation or not.\n   */\n  isLandscape: false,\n\n  /**\n   * Whether the keyboard event listeners have been added or not\n   */\n  isInitialized: false,\n\n  /**\n   * Hide the keyboard, if it is open.\n   */\n  hide: function() {\n    if (keyboardHasPlugin()) {\n      cordova.plugins.Keyboard.close();\n    }\n    keyboardActiveElement && keyboardActiveElement.blur();\n  },\n\n  /**\n   * An alias for cordova.plugins.Keyboard.show(). If the keyboard plugin\n   * is installed, show the keyboard.\n   */\n  show: function() {\n    if (keyboardHasPlugin()) {\n      cordova.plugins.Keyboard.show();\n    }\n  },\n\n  /**\n   * Remove all keyboard related event listeners, effectively disabling Ionic's\n   * keyboard adjustments.\n   */\n  disable: function() {\n    if (keyboardHasPlugin()) {\n      window.removeEventListener('native.keyboardshow', debouncedKeyboardNativeShow );\n      window.removeEventListener('native.keyboardhide', keyboardFocusOut);\n    } else {\n      document.body.removeEventListener('focusout', keyboardFocusOut);\n    }\n\n    document.body.removeEventListener('ionic.focusin', debouncedKeyboardFocusIn);\n    document.body.removeEventListener('focusin', debouncedKeyboardFocusIn);\n\n    window.removeEventListener('orientationchange', keyboardOrientationChange);\n\n    if ( window.navigator.msPointerEnabled ) {\n      document.removeEventListener(\"MSPointerDown\", keyboardInit);\n    } else {\n      document.removeEventListener('touchstart', keyboardInit);\n    }\n    ionic.keyboard.isInitialized = false;\n  },\n\n  /**\n   * Alias for keyboardInit, initialize all keyboard related event listeners.\n   */\n  enable: function() {\n    keyboardInit();\n  }\n};\n\n// Initialize the viewport height (after ionic.keyboard.height has been\n// defined).\nkeyboardCurrentViewportHeight = getViewportHeight();\n\n\n                             /* Event handlers */\n/* ------------------------------------------------------------------------- */\n\n/**\n * Event handler for first touch event, initializes all event listeners\n * for keyboard related events. Also aliased by ionic.keyboard.enable.\n */\nfunction keyboardInit() {\n\n  if (ionic.keyboard.isInitialized) return;\n\n  if (keyboardHasPlugin()) {\n    window.addEventListener('native.keyboardshow', debouncedKeyboardNativeShow);\n    window.addEventListener('native.keyboardhide', keyboardFocusOut);\n  } else {\n    document.body.addEventListener('focusout', keyboardFocusOut);\n  }\n\n  document.body.addEventListener('ionic.focusin', debouncedKeyboardFocusIn);\n  document.body.addEventListener('focusin', debouncedKeyboardFocusIn);\n\n  if (window.navigator.msPointerEnabled) {\n    document.removeEventListener(\"MSPointerDown\", keyboardInit);\n  } else {\n    document.removeEventListener('touchstart', keyboardInit);\n  }\n\n  ionic.keyboard.isInitialized = true;\n}\n\n/**\n * Event handler for 'native.keyboardshow' event, sets keyboard.height to the\n * reported height and keyboard.isOpening to true. Then calls\n * keyboardWaitForResize with keyboardShow or keyboardUpdateViewportHeight as\n * the callback depending on whether the event was triggered by a focusin or\n * an orientationchange.\n */\nfunction keyboardNativeShow(e) {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardNativeShow fired at: \" + Date.now());\n  //console.log(\"keyboardNativeshow window.innerHeight: \" + window.innerHeight);\n\n  if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n    ionic.keyboard.isOpening = true;\n    ionic.keyboard.isClosing = false;\n  }\n\n  ionic.keyboard.height = e.keyboardHeight;\n  //console.log('nativeshow keyboard height:' + e.keyboardHeight);\n\n  if (wasOrientationChange) {\n    keyboardWaitForResize(keyboardUpdateViewportHeight, true);\n  } else {\n    keyboardWaitForResize(keyboardShow, true);\n  }\n}\n\n/**\n * Event handler for 'focusin' and 'ionic.focusin' events. Initializes\n * keyboard state (keyboardActiveElement and keyboard.isOpening) for the\n * appropriate adjustments once the window has resized.  If not using the\n * keyboard plugin, calls keyboardWaitForResize with keyboardShow as the\n * callback or keyboardShow right away if the keyboard is already open.  If\n * using the keyboard plugin does nothing and lets keyboardNativeShow handle\n * adjustments with a more accurate keyboard height.\n */\nfunction keyboardFocusIn(e) {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardFocusIn from: \" + e.type + \" at: \" + Date.now());\n\n  if (!e.target ||\n      e.target.readOnly ||\n      !ionic.tap.isKeyboardElement(e.target) ||\n      !(scrollView = inputScrollView(e.target))) {\n    keyboardActiveElement = null;\n    return;\n  }\n\n  keyboardActiveElement = e.target;\n\n  // if using JS scrolling, undo the effects of native overflow scroll so the\n  // scroll view is positioned correctly\n  document.body.scrollTop = 0;\n  scrollView.scrollTop = 0;\n  ionic.requestAnimationFrame(function(){\n    document.body.scrollTop = 0;\n    scrollView.scrollTop = 0;\n  });\n\n  if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n    ionic.keyboard.isOpening = true;\n    ionic.keyboard.isClosing = false;\n  }\n\n  // attempt to prevent browser from natively scrolling input into view while\n  // we are trying to do the same (while we are scrolling) if the user taps the\n  // keyboard\n  document.addEventListener('keydown', keyboardOnKeyDown, false);\n\n  // any showing part of the document that isn't within the scroll the user\n  // could touchmove and cause some ugly changes to the app, so disable\n  // any touchmove events while the keyboard is open using e.preventDefault()\n  if (window.navigator.msPointerEnabled) {\n    document.addEventListener(\"MSPointerMove\", keyboardPreventDefault, false);\n  } else {\n    document.addEventListener('touchmove', keyboardPreventDefault, false);\n  }\n\n  // if we aren't using the plugin and the keyboard isn't open yet, wait for the\n  // window to resize so we can get an accurate estimate of the keyboard size,\n  // otherwise we do nothing and let nativeShow call keyboardShow once we have\n  // an exact keyboard height\n  // if the keyboard is already open, go ahead and scroll the input into view\n  // if necessary\n  if (!ionic.keyboard.isOpen && !keyboardHasPlugin()) {\n    keyboardWaitForResize(keyboardShow, true);\n\n  } else if (ionic.keyboard.isOpen) {\n    keyboardShow();\n  }\n}\n\n/**\n * Event handler for 'focusout' events. Sets keyboard.isClosing to true and\n * calls keyboardWaitForResize with keyboardHide as the callback after a small\n * timeout.\n */\nfunction keyboardFocusOut() {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardFocusOut fired at: \" + Date.now());\n  //console.log(\"keyboardFocusOut event type: \" + e.type);\n\n  if (ionic.keyboard.isOpen || ionic.keyboard.isOpening) {\n    ionic.keyboard.isClosing = true;\n    ionic.keyboard.isOpening = false;\n  }\n\n  // Call keyboardHide with a slight delay because sometimes on focus or\n  // orientation change focusin is called immediately after, so we give it time\n  // to cancel keyboardHide\n  keyboardFocusOutTimer = setTimeout(function() {\n    ionic.requestAnimationFrame(function() {\n      // focusOut during or right after an orientationchange, so we didn't get\n      // a chance to update the viewport height yet, do it and keyboardHide\n      //console.log(\"focusOut, wasOrientationChange: \" + wasOrientationChange);\n      if (wasOrientationChange) {\n        keyboardWaitForResize(function(){\n          keyboardUpdateViewportHeight();\n          keyboardHide();\n        }, false);\n      } else {\n        keyboardWaitForResize(keyboardHide, false);\n      }\n    });\n  }, 50);\n}\n\n/**\n * Event handler for 'orientationchange' events. If using the keyboard plugin\n * and the keyboard is open on Android, sets wasOrientationChange to true so\n * nativeShow can update the viewport height with an accurate keyboard height.\n * If the keyboard isn't open or keyboard plugin isn't being used,\n * waits for the window to resize before updating the viewport height.\n *\n * On iOS, where orientationchange fires after the keyboard has already shown,\n * updates the viewport immediately, regardless of if the keyboard is already\n * open.\n */\nfunction keyboardOrientationChange() {\n  //console.log(\"orientationchange fired at: \" + Date.now());\n  //console.log(\"orientation was: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n  // toggle orientation\n  ionic.keyboard.isLandscape = !ionic.keyboard.isLandscape;\n  // //console.log(\"now orientation is: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n  // no need to wait for resizing on iOS, and orientationchange always fires\n  // after the keyboard has opened, so it doesn't matter if it's open or not\n  if (ionic.Platform.isIOS()) {\n    keyboardUpdateViewportHeight();\n  }\n\n  // On Android, if the keyboard isn't open or we aren't using the keyboard\n  // plugin, update the viewport height once everything has resized. If the\n  // keyboard is open and we are using the keyboard plugin do nothing and let\n  // nativeShow handle it using an accurate keyboard height.\n  if ( ionic.Platform.isAndroid()) {\n    if (!ionic.keyboard.isOpen || !keyboardHasPlugin()) {\n      keyboardWaitForResize(keyboardUpdateViewportHeight, false);\n    } else {\n      wasOrientationChange = true;\n    }\n  }\n}\n\n/**\n * Event handler for 'keydown' event. Tries to prevent browser from natively\n * scrolling an input into view when a user taps the keyboard while we are\n * scrolling the input into view ourselves with JS.\n */\nfunction keyboardOnKeyDown(e) {\n  if (ionic.scroll.isScrolling) {\n    keyboardPreventDefault(e);\n  }\n}\n\n/**\n * Event for 'touchmove' or 'MSPointerMove'. Prevents native scrolling on\n * elements outside the scroll view while the keyboard is open.\n */\nfunction keyboardPreventDefault(e) {\n  if (e.target.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n  }\n}\n\n                              /* Private API */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Polls window.innerHeight until it has updated to an expected value (or\n * sufficient time has passed) before calling the specified callback function.\n * Only necessary for non-fullscreen Android which sometimes reports multiple\n * window.innerHeight values during interim layouts while it is resizing.\n *\n * On iOS, the window.innerHeight will already be updated, but we use the 50ms\n * delay as essentially a timeout so that scroll view adjustments happen after\n * the keyboard has shown so there isn't a white flash from us resizing too\n * quickly.\n *\n * @param {Function} callback the function to call once the window has resized\n * @param {boolean} isOpening whether the resize is from the keyboard opening\n * or not\n */\nfunction keyboardWaitForResize(callback, isOpening) {\n  clearInterval(waitForResizeTimer);\n  var count = 0;\n  var maxCount;\n  var initialHeight = getViewportHeight();\n  var viewportHeight = initialHeight;\n\n  //console.log(\"waitForResize initial viewport height: \" + viewportHeight);\n  //var start = Date.now();\n  //console.log(\"start: \" + start);\n\n  // want to fail relatively quickly on modern android devices, since it's much\n  // more likely we just have a bad keyboard height\n  if (ionic.Platform.isAndroid() && ionic.Platform.version() < 4.4) {\n    maxCount = 30;\n  } else if (ionic.Platform.isAndroid()) {\n    maxCount = 10;\n  } else {\n    maxCount = 1;\n  }\n\n  // poll timer\n  waitForResizeTimer = setInterval(function(){\n    viewportHeight = getViewportHeight();\n\n    // height hasn't updated yet, try again in 50ms\n    // if not using plugin, wait for maxCount to ensure we have waited long enough\n    // to get an accurate keyboard height\n    if (++count < maxCount &&\n        ((!isPortraitViewportHeight(viewportHeight) &&\n         !isLandscapeViewportHeight(viewportHeight)) ||\n         !ionic.keyboard.height)) {\n      return;\n    }\n\n    // infer the keyboard height from the resize if not using the keyboard plugin\n    if (!keyboardHasPlugin()) {\n      ionic.keyboard.height = Math.abs(initialHeight - window.innerHeight);\n    }\n\n    // set to true if we were waiting for the keyboard to open\n    ionic.keyboard.isOpen = isOpening;\n\n    clearInterval(waitForResizeTimer);\n    //var end = Date.now();\n    //console.log(\"waitForResize count: \" + count);\n    //console.log(\"end: \" + end);\n    //console.log(\"difference: \" + ( end - start ) + \"ms\");\n\n    //console.log(\"callback: \" + callback.name);\n    callback();\n\n  }, 50);\n\n  return maxCount; //for tests\n}\n\n/**\n * On keyboard close sets keyboard state to closed, resets the scroll view,\n * removes CSS from body indicating keyboard was open, removes any event\n * listeners for when the keyboard is open and on Android blurs the active\n * element (which in some cases will still have focus even if the keyboard\n * is closed and can cause it to reappear on subsequent taps).\n */\nfunction keyboardHide() {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardHide\");\n\n  ionic.keyboard.isOpen = false;\n  ionic.keyboard.isClosing = false;\n\n  if (keyboardActiveElement) {\n    ionic.trigger('resetScrollView', {\n      target: keyboardActiveElement\n    }, true);\n  }\n\n  ionic.requestAnimationFrame(function(){\n    document.body.classList.remove(KEYBOARD_OPEN_CSS);\n  });\n\n  // the keyboard is gone now, remove the touchmove that disables native scroll\n  if (window.navigator.msPointerEnabled) {\n    document.removeEventListener(\"MSPointerMove\", keyboardPreventDefault);\n  } else {\n    document.removeEventListener('touchmove', keyboardPreventDefault);\n  }\n  document.removeEventListener('keydown', keyboardOnKeyDown);\n\n  if (ionic.Platform.isAndroid()) {\n    // on android closing the keyboard with the back/dismiss button won't remove\n    // focus and keyboard can re-appear on subsequent taps (like scrolling)\n    if (keyboardHasPlugin()) cordova.plugins.Keyboard.close();\n    keyboardActiveElement && keyboardActiveElement.blur();\n  }\n\n  keyboardActiveElement = null;\n}\n\n/**\n * On keyboard open sets keyboard state to open, adds CSS to the body\n * indicating the keyboard is open and tells the scroll view to resize and\n * the currently focused input into view if necessary.\n */\nfunction keyboardShow() {\n\n  ionic.keyboard.isOpen = true;\n  ionic.keyboard.isOpening = false;\n\n  var details = {\n    keyboardHeight: keyboardGetHeight(),\n    viewportHeight: keyboardCurrentViewportHeight\n  };\n\n  if (keyboardActiveElement) {\n    details.target = keyboardActiveElement;\n\n    var elementBounds = keyboardActiveElement.getBoundingClientRect();\n\n    details.elementTop = Math.round(elementBounds.top);\n    details.elementBottom = Math.round(elementBounds.bottom);\n\n    details.windowHeight = details.viewportHeight - details.keyboardHeight;\n    //console.log(\"keyboardShow viewportHeight: \" + details.viewportHeight +\n    //\", windowHeight: \" + details.windowHeight +\n    //\", keyboardHeight: \" + details.keyboardHeight);\n\n    // figure out if the element is under the keyboard\n    details.isElementUnderKeyboard = (details.elementBottom > details.windowHeight);\n    //console.log(\"isUnderKeyboard: \" + details.isElementUnderKeyboard);\n    //console.log(\"elementBottom: \" + details.elementBottom);\n\n    // send event so the scroll view adjusts\n    ionic.trigger('scrollChildIntoView', details, true);\n  }\n\n  setTimeout(function(){\n    document.body.classList.add(KEYBOARD_OPEN_CSS);\n  }, 400);\n\n  return details; //for testing\n}\n\n/* eslint no-unused-vars:0 */\nfunction keyboardGetHeight() {\n  // check if we already have a keyboard height from the plugin or resize calculations\n  if (ionic.keyboard.height) {\n    return ionic.keyboard.height;\n  }\n\n  if (ionic.Platform.isAndroid()) {\n    // should be using the plugin, no way to know how big the keyboard is, so guess\n    if ( ionic.Platform.isFullScreen ) {\n      return 275;\n    }\n    // otherwise just calculate it\n    var contentHeight = window.innerHeight;\n    if (contentHeight < keyboardCurrentViewportHeight) {\n      return keyboardCurrentViewportHeight - contentHeight;\n    } else {\n      return 0;\n    }\n  }\n\n  // fallback for when it's the webview without the plugin\n  // or for just the standard web browser\n  // TODO: have these be based on device\n  if (ionic.Platform.isIOS()) {\n    if (ionic.keyboard.isLandscape) {\n      return 206;\n    }\n\n    if (!ionic.Platform.isWebView()) {\n      return 216;\n    }\n\n    return 260;\n  }\n\n  // safe guess\n  return 275;\n}\n\nfunction isPortraitViewportHeight(viewportHeight) {\n  return !!(!ionic.keyboard.isLandscape &&\n         keyboardPortraitViewportHeight &&\n         (Math.abs(keyboardPortraitViewportHeight - viewportHeight) < 2));\n}\n\nfunction isLandscapeViewportHeight(viewportHeight) {\n  return !!(ionic.keyboard.isLandscape &&\n         keyboardLandscapeViewportHeight &&\n         (Math.abs(keyboardLandscapeViewportHeight - viewportHeight) < 2));\n}\n\nfunction keyboardUpdateViewportHeight() {\n  wasOrientationChange = false;\n  keyboardCurrentViewportHeight = getViewportHeight();\n\n  if (ionic.keyboard.isLandscape && !keyboardLandscapeViewportHeight) {\n    //console.log(\"saved landscape: \" + keyboardCurrentViewportHeight);\n    keyboardLandscapeViewportHeight = keyboardCurrentViewportHeight;\n\n  } else if (!ionic.keyboard.isLandscape && !keyboardPortraitViewportHeight) {\n    //console.log(\"saved portrait: \" + keyboardCurrentViewportHeight);\n    keyboardPortraitViewportHeight = keyboardCurrentViewportHeight;\n  }\n\n  if (keyboardActiveElement) {\n    ionic.trigger('resetScrollView', {\n      target: keyboardActiveElement\n    }, true);\n  }\n\n  if (ionic.keyboard.isOpen && ionic.tap.isTextInput(keyboardActiveElement)) {\n    keyboardShow();\n  }\n}\n\nfunction keyboardInitViewportHeight() {\n  var viewportHeight = getViewportHeight();\n  //console.log(\"Keyboard init VP: \" + viewportHeight + \" \" + window.innerWidth);\n  // can't just use window.innerHeight in case the keyboard is opened immediately\n  if ((viewportHeight / window.innerWidth) < 1) {\n    ionic.keyboard.isLandscape = true;\n  }\n  //console.log(\"ionic.keyboard.isLandscape is: \" + ionic.keyboard.isLandscape);\n\n  // initialize or update the current viewport height values\n  keyboardCurrentViewportHeight = viewportHeight;\n  if (ionic.keyboard.isLandscape && !keyboardLandscapeViewportHeight) {\n    keyboardLandscapeViewportHeight = keyboardCurrentViewportHeight;\n  } else if (!ionic.keyboard.isLandscape && !keyboardPortraitViewportHeight) {\n    keyboardPortraitViewportHeight = keyboardCurrentViewportHeight;\n  }\n}\n\nfunction getViewportHeight() {\n  var windowHeight = window.innerHeight;\n  //console.log('window.innerHeight is: ' + windowHeight);\n  //console.log('kb height is: ' + ionic.keyboard.height);\n  //console.log('kb isOpen: ' + ionic.keyboard.isOpen);\n\n  //TODO: add iPad undocked/split kb once kb plugin supports it\n  // the keyboard overlays the window on Android fullscreen\n  if (!(ionic.Platform.isAndroid() && ionic.Platform.isFullScreen) &&\n      (ionic.keyboard.isOpen || ionic.keyboard.isOpening) &&\n      !ionic.keyboard.isClosing) {\n\n     return windowHeight + keyboardGetHeight();\n  }\n  return windowHeight;\n}\n\nfunction inputScrollView(ele) {\n  while(ele) {\n    if (ele.classList.contains(SCROLL_CONTAINER_CSS)) {\n      return ele;\n    }\n    ele = ele.parentElement;\n  }\n  return null;\n}\n\nfunction keyboardHasPlugin() {\n  return !!(window.cordova && cordova.plugins && cordova.plugins.Keyboard);\n}\n\nionic.Platform.ready(function() {\n  keyboardInitViewportHeight();\n\n  window.addEventListener('orientationchange', keyboardOrientationChange);\n\n  // if orientation changes while app is in background, update on resuming\n  /*\n  if ( ionic.Platform.isWebView() ) {\n    document.addEventListener('resume', keyboardInitViewportHeight);\n\n    if (ionic.Platform.isAndroid()) {\n      //TODO: onbackpressed to detect keyboard close without focusout or plugin\n    }\n  }\n  */\n\n  // if orientation changes while app is in background, update on resuming\n/*  if ( ionic.Platform.isWebView() ) {\n    document.addEventListener('pause', function() {\n      window.removeEventListener('orientationchange', keyboardOrientationChange);\n    })\n    document.addEventListener('resume', function() {\n      keyboardInitViewportHeight();\n      window.addEventListener('orientationchange', keyboardOrientationChange)\n    });\n  }*/\n\n  // Android sometimes reports bad innerHeight on window.load\n  // try it again in a lil bit to play it safe\n  setTimeout(keyboardInitViewportHeight, 999);\n\n  // only initialize the adjustments for the virtual keyboard\n  // if a touchstart event happens\n  if (window.navigator.msPointerEnabled) {\n    document.addEventListener(\"MSPointerDown\", keyboardInit, false);\n  } else {\n    document.addEventListener('touchstart', keyboardInit, false);\n  }\n});\n\n\n\nvar viewportTag;\nvar viewportProperties = {};\n\nionic.viewport = {\n  orientation: function() {\n    // 0 = Portrait\n    // 90 = Landscape\n    // not using window.orientation because each device has a different implementation\n    return (window.innerWidth > window.innerHeight ? 90 : 0);\n  }\n};\n\nfunction viewportLoadTag() {\n  var x;\n\n  for (x = 0; x < document.head.children.length; x++) {\n    if (document.head.children[x].name == 'viewport') {\n      viewportTag = document.head.children[x];\n      break;\n    }\n  }\n\n  if (viewportTag) {\n    var props = viewportTag.content.toLowerCase().replace(/\\s+/g, '').split(',');\n    var keyValue;\n    for (x = 0; x < props.length; x++) {\n      if (props[x]) {\n        keyValue = props[x].split('=');\n        viewportProperties[ keyValue[0] ] = (keyValue.length > 1 ? keyValue[1] : '_');\n      }\n    }\n    viewportUpdate();\n  }\n}\n\nfunction viewportUpdate() {\n  // unit tests in viewport.unit.js\n\n  var initWidth = viewportProperties.width;\n  var initHeight = viewportProperties.height;\n  var p = ionic.Platform;\n  var version = p.version();\n  var DEVICE_WIDTH = 'device-width';\n  var DEVICE_HEIGHT = 'device-height';\n  var orientation = ionic.viewport.orientation();\n\n  // Most times we're removing the height and adding the width\n  // So this is the default to start with, then modify per platform/version/oreintation\n  delete viewportProperties.height;\n  viewportProperties.width = DEVICE_WIDTH;\n\n  if (p.isIPad()) {\n    // iPad\n\n    if (version > 7) {\n      // iPad >= 7.1\n      // https://issues.apache.org/jira/browse/CB-4323\n      delete viewportProperties.width;\n\n    } else {\n      // iPad <= 7.0\n\n      if (p.isWebView()) {\n        // iPad <= 7.0 WebView\n\n        if (orientation == 90) {\n          // iPad <= 7.0 WebView Landscape\n          viewportProperties.height = '0';\n\n        } else if (version == 7) {\n          // iPad <= 7.0 WebView Portait\n          viewportProperties.height = DEVICE_HEIGHT;\n        }\n      } else {\n        // iPad <= 6.1 Browser\n        if (version < 7) {\n          viewportProperties.height = '0';\n        }\n      }\n    }\n\n  } else if (p.isIOS()) {\n    // iPhone\n\n    if (p.isWebView()) {\n      // iPhone WebView\n\n      if (version > 7) {\n        // iPhone >= 7.1 WebView\n        delete viewportProperties.width;\n\n      } else if (version < 7) {\n        // iPhone <= 6.1 WebView\n        // if height was set it needs to get removed with this hack for <= 6.1\n        if (initHeight) viewportProperties.height = '0';\n\n      } else if (version == 7) {\n        //iPhone == 7.0 WebView\n        viewportProperties.height = DEVICE_HEIGHT;\n      }\n\n    } else {\n      // iPhone Browser\n\n      if (version < 7) {\n        // iPhone <= 6.1 Browser\n        // if height was set it needs to get removed with this hack for <= 6.1\n        if (initHeight) viewportProperties.height = '0';\n      }\n    }\n\n  }\n\n  // only update the viewport tag if there was a change\n  if (initWidth !== viewportProperties.width || initHeight !== viewportProperties.height) {\n    viewportTagUpdate();\n  }\n}\n\nfunction viewportTagUpdate() {\n  var key, props = [];\n  for (key in viewportProperties) {\n    if (viewportProperties[key]) {\n      props.push(key + (viewportProperties[key] == '_' ? '' : '=' + viewportProperties[key]));\n    }\n  }\n\n  viewportTag.content = props.join(', ');\n}\n\nionic.Platform.ready(function() {\n  viewportLoadTag();\n\n  window.addEventListener(\"orientationchange\", function() {\n    setTimeout(viewportUpdate, 1000);\n  }, false);\n});\n\n(function(ionic) {\n'use strict';\n  ionic.views.View = function() {\n    this.initialize.apply(this, arguments);\n  };\n\n  ionic.views.View.inherit = ionic.inherit;\n\n  ionic.extend(ionic.views.View.prototype, {\n    initialize: function() {}\n  });\n\n})(window.ionic);\n\n/*\n * Scroller\n * http://github.com/zynga/scroller\n *\n * Copyright 2011, Zynga Inc.\n * Licensed under the MIT License.\n * https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt\n *\n * Based on the work of: Unify Project (unify-project.org)\n * http://unify-project.org\n * Copyright 2011, Deutsche Telekom AG\n * License: MIT + Apache (V2)\n */\n\n/* jshint eqnull: true */\n\n/**\n * Generic animation class with support for dropped frames both optional easing and duration.\n *\n * Optional duration is useful when the lifetime is defined by another condition than time\n * e.g. speed of an animating object, etc.\n *\n * Dropped frame logic allows to keep using the same updater logic independent from the actual\n * rendering. This eases a lot of cases where it might be pretty complex to break down a state\n * based on the pure time difference.\n */\nvar zyngaCore = { effect: {} };\n(function(global) {\n  var time = Date.now || function() {\n    return +new Date();\n  };\n  var desiredFrames = 60;\n  var millisecondsPerSecond = 1000;\n  var running = {};\n  var counter = 1;\n\n  zyngaCore.effect.Animate = {\n\n    /**\n     * A requestAnimationFrame wrapper / polyfill.\n     *\n     * @param callback {Function} The callback to be invoked before the next repaint.\n     * @param root {HTMLElement} The root element for the repaint\n     */\n    requestAnimationFrame: (function() {\n\n      // Check for request animation Frame support\n      var requestFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame;\n      var isNative = !!requestFrame;\n\n      if (requestFrame && !/requestAnimationFrame\\(\\)\\s*\\{\\s*\\[native code\\]\\s*\\}/i.test(requestFrame.toString())) {\n        isNative = false;\n      }\n\n      if (isNative) {\n        return function(callback, root) {\n          requestFrame(callback, root);\n        };\n      }\n\n      var TARGET_FPS = 60;\n      var requests = {};\n      var requestCount = 0;\n      var rafHandle = 1;\n      var intervalHandle = null;\n      var lastActive = +new Date();\n\n      return function(callback) {\n        var callbackHandle = rafHandle++;\n\n        // Store callback\n        requests[callbackHandle] = callback;\n        requestCount++;\n\n        // Create timeout at first request\n        if (intervalHandle === null) {\n\n          intervalHandle = setInterval(function() {\n\n            var time = +new Date();\n            var currentRequests = requests;\n\n            // Reset data structure before executing callbacks\n            requests = {};\n            requestCount = 0;\n\n            for(var key in currentRequests) {\n              if (currentRequests.hasOwnProperty(key)) {\n                currentRequests[key](time);\n                lastActive = time;\n              }\n            }\n\n            // Disable the timeout when nothing happens for a certain\n            // period of time\n            if (time - lastActive > 2500) {\n              clearInterval(intervalHandle);\n              intervalHandle = null;\n            }\n\n          }, 1000 / TARGET_FPS);\n        }\n\n        return callbackHandle;\n      };\n\n    })(),\n\n\n    /**\n     * Stops the given animation.\n     *\n     * @param id {Integer} Unique animation ID\n     * @return {Boolean} Whether the animation was stopped (aka, was running before)\n     */\n    stop: function(id) {\n      var cleared = running[id] != null;\n      if (cleared) {\n        running[id] = null;\n      }\n\n      return cleared;\n    },\n\n\n    /**\n     * Whether the given animation is still running.\n     *\n     * @param id {Integer} Unique animation ID\n     * @return {Boolean} Whether the animation is still running\n     */\n    isRunning: function(id) {\n      return running[id] != null;\n    },\n\n\n    /**\n     * Start the animation.\n     *\n     * @param stepCallback {Function} Pointer to function which is executed on every step.\n     *   Signature of the method should be `function(percent, now, virtual) { return continueWithAnimation; }`\n     * @param verifyCallback {Function} Executed before every animation step.\n     *   Signature of the method should be `function() { return continueWithAnimation; }`\n     * @param completedCallback {Function}\n     *   Signature of the method should be `function(droppedFrames, finishedAnimation) {}`\n     * @param duration {Integer} Milliseconds to run the animation\n     * @param easingMethod {Function} Pointer to easing function\n     *   Signature of the method should be `function(percent) { return modifiedValue; }`\n     * @param root {Element} Render root, when available. Used for internal\n     *   usage of requestAnimationFrame.\n     * @return {Integer} Identifier of animation. Can be used to stop it any time.\n     */\n    start: function(stepCallback, verifyCallback, completedCallback, duration, easingMethod, root) {\n\n      var start = time();\n      var lastFrame = start;\n      var percent = 0;\n      var dropCounter = 0;\n      var id = counter++;\n\n      if (!root) {\n        root = document.body;\n      }\n\n      // Compacting running db automatically every few new animations\n      if (id % 20 === 0) {\n        var newRunning = {};\n        for (var usedId in running) {\n          newRunning[usedId] = true;\n        }\n        running = newRunning;\n      }\n\n      // This is the internal step method which is called every few milliseconds\n      var step = function(virtual) {\n\n        // Normalize virtual value\n        var render = virtual !== true;\n\n        // Get current time\n        var now = time();\n\n        // Verification is executed before next animation step\n        if (!running[id] || (verifyCallback && !verifyCallback(id))) {\n\n          running[id] = null;\n          completedCallback && completedCallback(desiredFrames - (dropCounter / ((now - start) / millisecondsPerSecond)), id, false);\n          return;\n\n        }\n\n        // For the current rendering to apply let's update omitted steps in memory.\n        // This is important to bring internal state variables up-to-date with progress in time.\n        if (render) {\n\n          var droppedFrames = Math.round((now - lastFrame) / (millisecondsPerSecond / desiredFrames)) - 1;\n          for (var j = 0; j < Math.min(droppedFrames, 4); j++) {\n            step(true);\n            dropCounter++;\n          }\n\n        }\n\n        // Compute percent value\n        if (duration) {\n          percent = (now - start) / duration;\n          if (percent > 1) {\n            percent = 1;\n          }\n        }\n\n        // Execute step callback, then...\n        var value = easingMethod ? easingMethod(percent) : percent;\n        if ((stepCallback(value, now, render) === false || percent === 1) && render) {\n          running[id] = null;\n          completedCallback && completedCallback(desiredFrames - (dropCounter / ((now - start) / millisecondsPerSecond)), id, percent === 1 || duration == null);\n        } else if (render) {\n          lastFrame = now;\n          zyngaCore.effect.Animate.requestAnimationFrame(step, root);\n        }\n      };\n\n      // Mark as running\n      running[id] = true;\n\n      // Init first step\n      zyngaCore.effect.Animate.requestAnimationFrame(step, root);\n\n      // Return unique animation ID\n      return id;\n    }\n  };\n})(this);\n\n/*\n * Scroller\n * http://github.com/zynga/scroller\n *\n * Copyright 2011, Zynga Inc.\n * Licensed under the MIT License.\n * https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt\n *\n * Based on the work of: Unify Project (unify-project.org)\n * http://unify-project.org\n * Copyright 2011, Deutsche Telekom AG\n * License: MIT + Apache (V2)\n */\n\n(function(ionic) {\n  var NOOP = function(){};\n\n  // Easing Equations (c) 2003 Robert Penner, all rights reserved.\n  // Open source under the BSD License.\n\n  /**\n   * @param pos {Number} position between 0 (start of effect) and 1 (end of effect)\n  **/\n  var easeOutCubic = function(pos) {\n    return (Math.pow((pos - 1), 3) + 1);\n  };\n\n  /**\n   * @param pos {Number} position between 0 (start of effect) and 1 (end of effect)\n  **/\n  var easeInOutCubic = function(pos) {\n    if ((pos /= 0.5) < 1) {\n      return 0.5 * Math.pow(pos, 3);\n    }\n\n    return 0.5 * (Math.pow((pos - 2), 3) + 2);\n  };\n\n\n/**\n * ionic.views.Scroll\n * A powerful scroll view with support for bouncing, pull to refresh, and paging.\n * @param   {Object}        options options for the scroll view\n * @class A scroll view system\n * @memberof ionic.views\n */\nionic.views.Scroll = ionic.views.View.inherit({\n  initialize: function(options) {\n    var self = this;\n\n    self.__container = options.el;\n    self.__content = options.el.firstElementChild;\n\n    //Remove any scrollTop attached to these elements; they are virtual scroll now\n    //This also stops on-load-scroll-to-window.location.hash that the browser does\n    setTimeout(function() {\n      if (self.__container && self.__content) {\n        self.__container.scrollTop = 0;\n        self.__content.scrollTop = 0;\n      }\n    });\n\n    self.options = {\n\n      /** Disable scrolling on x-axis by default */\n      scrollingX: false,\n      scrollbarX: true,\n\n      /** Enable scrolling on y-axis */\n      scrollingY: true,\n      scrollbarY: true,\n\n      startX: 0,\n      startY: 0,\n\n      /** The amount to dampen mousewheel events */\n      wheelDampen: 6,\n\n      /** The minimum size the scrollbars scale to while scrolling */\n      minScrollbarSizeX: 5,\n      minScrollbarSizeY: 5,\n\n      /** Scrollbar fading after scrolling */\n      scrollbarsFade: true,\n      scrollbarFadeDelay: 300,\n      /** The initial fade delay when the pane is resized or initialized */\n      scrollbarResizeFadeDelay: 1000,\n\n      /** Enable animations for deceleration, snap back, zooming and scrolling */\n      animating: true,\n\n      /** duration for animations triggered by scrollTo/zoomTo */\n      animationDuration: 250,\n\n      /** The velocity required to make the scroll view \"slide\" after touchend */\n      decelVelocityThreshold: 4,\n\n      /** The velocity required to make the scroll view \"slide\" after touchend when using paging */\n      decelVelocityThresholdPaging: 4,\n\n      /** Enable bouncing (content can be slowly moved outside and jumps back after releasing) */\n      bouncing: true,\n\n      /** Enable locking to the main axis if user moves only slightly on one of them at start */\n      locking: true,\n\n      /** Enable pagination mode (switching between full page content panes) */\n      paging: false,\n\n      /** Enable snapping of content to a configured pixel grid */\n      snapping: false,\n\n      /** Enable zooming of content via API, fingers and mouse wheel */\n      zooming: false,\n\n      /** Minimum zoom level */\n      minZoom: 0.5,\n\n      /** Maximum zoom level */\n      maxZoom: 3,\n\n      /** Multiply or decrease scrolling speed **/\n      speedMultiplier: 1,\n\n      deceleration: 0.97,\n\n      /** Whether to prevent default on a scroll operation to capture drag events **/\n      preventDefault: false,\n\n      /** Callback that is fired on the later of touch end or deceleration end,\n        provided that another scrolling action has not begun. Used to know\n        when to fade out a scrollbar. */\n      scrollingComplete: NOOP,\n\n      /** This configures the amount of change applied to deceleration when reaching boundaries  **/\n      penetrationDeceleration: 0.03,\n\n      /** This configures the amount of change applied to acceleration when reaching boundaries  **/\n      penetrationAcceleration: 0.08,\n\n      // The ms interval for triggering scroll events\n      scrollEventInterval: 10,\n\n      freeze: false,\n\n      getContentWidth: function() {\n        return Math.max(self.__content.scrollWidth, self.__content.offsetWidth);\n      },\n      getContentHeight: function() {\n        return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));\n      }\n    };\n\n    for (var key in options) {\n      self.options[key] = options[key];\n    }\n\n    self.hintResize = ionic.debounce(function() {\n      self.resize();\n    }, 1000, true);\n\n    self.onScroll = function() {\n\n      if (!ionic.scroll.isScrolling) {\n        setTimeout(self.setScrollStart, 50);\n      } else {\n        clearTimeout(self.scrollTimer);\n        self.scrollTimer = setTimeout(self.setScrollStop, 80);\n      }\n\n    };\n\n    self.freeze = function(shouldFreeze) {\n      if (arguments.length) {\n        self.options.freeze = shouldFreeze;\n      }\n      return self.options.freeze;\n    };\n\n    self.setScrollStart = function() {\n      ionic.scroll.isScrolling = Math.abs(ionic.scroll.lastTop - self.__scrollTop) > 1;\n      clearTimeout(self.scrollTimer);\n      self.scrollTimer = setTimeout(self.setScrollStop, 80);\n    };\n\n    self.setScrollStop = function() {\n      ionic.scroll.isScrolling = false;\n      ionic.scroll.lastTop = self.__scrollTop;\n    };\n\n    self.triggerScrollEvent = ionic.throttle(function() {\n      self.onScroll();\n      ionic.trigger('scroll', {\n        scrollTop: self.__scrollTop,\n        scrollLeft: self.__scrollLeft,\n        target: self.__container\n      });\n    }, self.options.scrollEventInterval);\n\n    self.triggerScrollEndEvent = function() {\n      ionic.trigger('scrollend', {\n        scrollTop: self.__scrollTop,\n        scrollLeft: self.__scrollLeft,\n        target: self.__container\n      });\n    };\n\n    self.__scrollLeft = self.options.startX;\n    self.__scrollTop = self.options.startY;\n\n    // Get the render update function, initialize event handlers,\n    // and calculate the size of the scroll container\n    self.__callback = self.getRenderFn();\n    self.__initEventHandlers();\n    self.__createScrollbars();\n\n  },\n\n  run: function() {\n    this.resize();\n\n    // Fade them out\n    this.__fadeScrollbars('out', this.options.scrollbarResizeFadeDelay);\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: STATUS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Whether only a single finger is used in touch handling */\n  __isSingleTouch: false,\n\n  /** Whether a touch event sequence is in progress */\n  __isTracking: false,\n\n  /** Whether a deceleration animation went to completion. */\n  __didDecelerationComplete: false,\n\n  /**\n   * Whether a gesture zoom/rotate event is in progress. Activates when\n   * a gesturestart event happens. This has higher priority than dragging.\n   */\n  __isGesturing: false,\n\n  /**\n   * Whether the user has moved by such a distance that we have enabled\n   * dragging mode. Hint: It's only enabled after some pixels of movement to\n   * not interrupt with clicks etc.\n   */\n  __isDragging: false,\n\n  /**\n   * Not touching and dragging anymore, and smoothly animating the\n   * touch sequence using deceleration.\n   */\n  __isDecelerating: false,\n\n  /**\n   * Smoothly animating the currently configured change\n   */\n  __isAnimating: false,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: DIMENSIONS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Available outer left position (from document perspective) */\n  __clientLeft: 0,\n\n  /** Available outer top position (from document perspective) */\n  __clientTop: 0,\n\n  /** Available outer width */\n  __clientWidth: 0,\n\n  /** Available outer height */\n  __clientHeight: 0,\n\n  /** Outer width of content */\n  __contentWidth: 0,\n\n  /** Outer height of content */\n  __contentHeight: 0,\n\n  /** Snapping width for content */\n  __snapWidth: 100,\n\n  /** Snapping height for content */\n  __snapHeight: 100,\n\n  /** Height to assign to refresh area */\n  __refreshHeight: null,\n\n  /** Whether the refresh process is enabled when the event is released now */\n  __refreshActive: false,\n\n  /** Callback to execute on activation. This is for signalling the user about a refresh is about to happen when he release */\n  __refreshActivate: null,\n\n  /** Callback to execute on deactivation. This is for signalling the user about the refresh being cancelled */\n  __refreshDeactivate: null,\n\n  /** Callback to execute to start the actual refresh. Call {@link #refreshFinish} when done */\n  __refreshStart: null,\n\n  /** Zoom level */\n  __zoomLevel: 1,\n\n  /** Scroll position on x-axis */\n  __scrollLeft: 0,\n\n  /** Scroll position on y-axis */\n  __scrollTop: 0,\n\n  /** Maximum allowed scroll position on x-axis */\n  __maxScrollLeft: 0,\n\n  /** Maximum allowed scroll position on y-axis */\n  __maxScrollTop: 0,\n\n  /* Scheduled left position (final position when animating) */\n  __scheduledLeft: 0,\n\n  /* Scheduled top position (final position when animating) */\n  __scheduledTop: 0,\n\n  /* Scheduled zoom level (final scale when animating) */\n  __scheduledZoom: 0,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: LAST POSITIONS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Left position of finger at start */\n  __lastTouchLeft: null,\n\n  /** Top position of finger at start */\n  __lastTouchTop: null,\n\n  /** Timestamp of last move of finger. Used to limit tracking range for deceleration speed. */\n  __lastTouchMove: null,\n\n  /** List of positions, uses three indexes for each state: left, top, timestamp */\n  __positions: null,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: DECELERATION SUPPORT\n  ---------------------------------------------------------------------------\n  */\n\n  /** Minimum left scroll position during deceleration */\n  __minDecelerationScrollLeft: null,\n\n  /** Minimum top scroll position during deceleration */\n  __minDecelerationScrollTop: null,\n\n  /** Maximum left scroll position during deceleration */\n  __maxDecelerationScrollLeft: null,\n\n  /** Maximum top scroll position during deceleration */\n  __maxDecelerationScrollTop: null,\n\n  /** Current factor to modify horizontal scroll position with on every step */\n  __decelerationVelocityX: null,\n\n  /** Current factor to modify vertical scroll position with on every step */\n  __decelerationVelocityY: null,\n\n\n  /** the browser-specific property to use for transforms */\n  __transformProperty: null,\n  __perspectiveProperty: null,\n\n  /** scrollbar indicators */\n  __indicatorX: null,\n  __indicatorY: null,\n\n  /** Timeout for scrollbar fading */\n  __scrollbarFadeTimeout: null,\n\n  /** whether we've tried to wait for size already */\n  __didWaitForSize: null,\n  __sizerTimeout: null,\n\n  __initEventHandlers: function() {\n    var self = this;\n\n    // Event Handler\n    var container = self.__container;\n\n    // save height when scroll view is shrunk so we don't need to reflow\n    var scrollViewOffsetHeight;\n\n    /**\n     * Shrink the scroll view when the keyboard is up if necessary and if the\n     * focused input is below the bottom of the shrunk scroll view, scroll it\n     * into view.\n     */\n    self.scrollChildIntoView = function(e) {\n      //console.log(\"scrollChildIntoView at: \" + Date.now());\n\n      // D\n      var scrollBottomOffsetToTop = container.getBoundingClientRect().bottom;\n      // D - A\n      scrollViewOffsetHeight = container.offsetHeight;\n      var alreadyShrunk = self.isShrunkForKeyboard;\n\n      var isModal = container.parentNode.classList.contains('modal');\n      // 680px is when the media query for 60% modal width kicks in\n      var isInsetModal = isModal && window.innerWidth >= 680;\n\n     /*\n      *  _______\n      * |---A---| <- top of scroll view\n      * |       |\n      * |---B---| <- keyboard\n      * |   C   | <- input\n      * |---D---| <- initial bottom of scroll view\n      * |___E___| <- bottom of viewport\n      *\n      *  All commented calculations relative to the top of the viewport (ie E\n      *  is the viewport height, not 0)\n      */\n      if (!alreadyShrunk) {\n        // shrink scrollview so we can actually scroll if the input is hidden\n        // if it isn't shrink so we can scroll to inputs under the keyboard\n        // inset modals won't shrink on Android on their own when the keyboard appears\n        if ( ionic.Platform.isIOS() || ionic.Platform.isFullScreen || isInsetModal ) {\n          // if there are things below the scroll view account for them and\n          // subtract them from the keyboard height when resizing\n          // E - D                         E                         D\n          var scrollBottomOffsetToBottom = e.detail.viewportHeight - scrollBottomOffsetToTop;\n\n          // 0 or D - B if D > B           E - B                     E - D\n          var keyboardOffset = Math.max(0, e.detail.keyboardHeight - scrollBottomOffsetToBottom);\n\n          ionic.requestAnimationFrame(function(){\n            // D - A or B - A if D > B       D - A             max(0, D - B)\n            scrollViewOffsetHeight = scrollViewOffsetHeight - keyboardOffset;\n            container.style.height = scrollViewOffsetHeight + \"px\";\n            container.style.overflow = \"visible\";\n\n            //update scroll view\n            self.resize();\n          });\n        }\n\n        self.isShrunkForKeyboard = true;\n      }\n\n      /*\n       *  _______\n       * |---A---| <- top of scroll view\n       * |   *   | <- where we want to scroll to\n       * |--B-D--| <- keyboard, bottom of scroll view\n       * |   C   | <- input\n       * |       |\n       * |___E___| <- bottom of viewport\n       *\n       *  All commented calculations relative to the top of the viewport (ie E\n       *  is the viewport height, not 0)\n       */\n      // if the element is positioned under the keyboard scroll it into view\n      if (e.detail.isElementUnderKeyboard) {\n\n        ionic.requestAnimationFrame(function(){\n          container.scrollTop = 0;\n          // update D if we shrunk\n          if (self.isShrunkForKeyboard && !alreadyShrunk) {\n            scrollBottomOffsetToTop = container.getBoundingClientRect().bottom;\n          }\n\n          // middle of the scrollview, this is where we want to scroll to\n          // (D - A) / 2\n          var scrollMidpointOffset = scrollViewOffsetHeight * 0.5;\n          //console.log(\"container.offsetHeight: \" + scrollViewOffsetHeight);\n\n          // middle of the input we want to scroll into view\n          // C\n          var inputMidpoint = ((e.detail.elementBottom + e.detail.elementTop) / 2);\n\n          // distance from middle of input to the bottom of the scroll view\n          // C - D                                C               D\n          var inputMidpointOffsetToScrollBottom = inputMidpoint - scrollBottomOffsetToTop;\n\n          //C - D + (D - A)/2          C - D                     (D - A)/ 2\n          var scrollTop = inputMidpointOffsetToScrollBottom + scrollMidpointOffset;\n\n          if ( scrollTop > 0) {\n            if (ionic.Platform.isIOS()) ionic.tap.cloneFocusedInput(container, self);\n            self.scrollBy(0, scrollTop, true);\n            self.onScroll();\n          }\n        });\n      }\n\n      // Only the first scrollView parent of the element that broadcasted this event\n      // (the active element that needs to be shown) should receive this event\n      e.stopPropagation();\n    };\n\n    self.resetScrollView = function() {\n      //return scrollview to original height once keyboard has hidden\n      if ( self.isShrunkForKeyboard ) {\n        self.isShrunkForKeyboard = false;\n        container.style.height = \"\";\n        container.style.overflow = \"\";\n      }\n      self.resize();\n    };\n\n    //Broadcasted when keyboard is shown on some platforms.\n    //See js/utils/keyboard.js\n    container.addEventListener('scrollChildIntoView', self.scrollChildIntoView);\n\n    // Listen on document because container may not have had the last\n    // keyboardActiveElement, for example after closing a modal with a focused\n    // input and returning to a previously resized scroll view in an ion-content.\n    // Since we can only resize scroll views that are currently visible, just resize\n    // the current scroll view when the keyboard is closed.\n    document.addEventListener('resetScrollView', self.resetScrollView);\n\n    function getEventTouches(e) {\n      return e.touches && e.touches.length ? e.touches : [{\n        pageX: e.pageX,\n        pageY: e.pageY\n      }];\n    }\n\n    self.touchStart = function(e) {\n      self.startCoordinates = ionic.tap.pointerCoord(e);\n\n      if ( ionic.tap.ignoreScrollStart(e) ) {\n        return;\n      }\n\n      self.__isDown = true;\n\n      if ( ionic.tap.containsOrIsTextInput(e.target) || e.target.tagName === 'SELECT' ) {\n        // do not start if the target is a text input\n        // if there is a touchmove on this input, then we can start the scroll\n        self.__hasStarted = false;\n        return;\n      }\n\n      self.__isSelectable = true;\n      self.__enableScrollY = true;\n      self.__hasStarted = true;\n      self.doTouchStart(getEventTouches(e), e.timeStamp);\n      e.preventDefault();\n    };\n\n    self.touchMove = function(e) {\n      if (self.options.freeze || !self.__isDown ||\n        (!self.__isDown && e.defaultPrevented) ||\n        (e.target.tagName === 'TEXTAREA' && e.target.parentElement.querySelector(':focus')) ) {\n        return;\n      }\n\n      if ( !self.__hasStarted && ( ionic.tap.containsOrIsTextInput(e.target) || e.target.tagName === 'SELECT' ) ) {\n        // the target is a text input and scroll has started\n        // since the text input doesn't start on touchStart, do it here\n        self.__hasStarted = true;\n        self.doTouchStart(getEventTouches(e), e.timeStamp);\n        e.preventDefault();\n        return;\n      }\n\n      if (self.startCoordinates) {\n        // we have start coordinates, so get this touch move's current coordinates\n        var currentCoordinates = ionic.tap.pointerCoord(e);\n\n        if ( self.__isSelectable &&\n            ionic.tap.isTextInput(e.target) &&\n            Math.abs(self.startCoordinates.x - currentCoordinates.x) > 20 ) {\n          // user slid the text input's caret on its x axis, disable any future y scrolling\n          self.__enableScrollY = false;\n          self.__isSelectable = true;\n        }\n\n        if ( self.__enableScrollY && Math.abs(self.startCoordinates.y - currentCoordinates.y) > 10 ) {\n          // user scrolled the entire view on the y axis\n          // disabled being able to select text on an input\n          // hide the input which has focus, and show a cloned one that doesn't have focus\n          self.__isSelectable = false;\n          ionic.tap.cloneFocusedInput(container, self);\n        }\n      }\n\n      self.doTouchMove(getEventTouches(e), e.timeStamp, e.scale);\n      self.__isDown = true;\n    };\n\n    self.touchMoveBubble = function(e) {\n      if(self.__isDown && self.options.preventDefault) {\n        e.preventDefault();\n      }\n    };\n\n    self.touchEnd = function(e) {\n      if (!self.__isDown) return;\n\n      self.doTouchEnd(e, e.timeStamp);\n      self.__isDown = false;\n      self.__hasStarted = false;\n      self.__isSelectable = true;\n      self.__enableScrollY = true;\n\n      if ( !self.__isDragging && !self.__isDecelerating && !self.__isAnimating ) {\n        ionic.tap.removeClonedInputs(container, self);\n      }\n    };\n\n    self.mouseWheel = ionic.animationFrameThrottle(function(e) {\n      var scrollParent = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'ionic-scroll');\n      if (!self.options.freeze && scrollParent === self.__container) {\n\n        self.hintResize();\n        self.scrollBy(\n          (e.wheelDeltaX || e.deltaX || 0) / self.options.wheelDampen,\n          (-e.wheelDeltaY || e.deltaY || 0) / self.options.wheelDampen\n        );\n\n        self.__fadeScrollbars('in');\n        clearTimeout(self.__wheelHideBarTimeout);\n        self.__wheelHideBarTimeout = setTimeout(function() {\n          self.__fadeScrollbars('out');\n        }, 100);\n      }\n    });\n\n    if ('ontouchstart' in window) {\n      // Touch Events\n      container.addEventListener(\"touchstart\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"touchmove\", self.touchMoveBubble, false);\n      document.addEventListener(\"touchmove\", self.touchMove, false);\n      document.addEventListener(\"touchend\", self.touchEnd, false);\n      document.addEventListener(\"touchcancel\", self.touchEnd, false);\n\n    } else if (window.navigator.pointerEnabled) {\n      // Pointer Events\n      container.addEventListener(\"pointerdown\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"pointermove\", self.touchMoveBubble, false);\n      document.addEventListener(\"pointermove\", self.touchMove, false);\n      document.addEventListener(\"pointerup\", self.touchEnd, false);\n      document.addEventListener(\"pointercancel\", self.touchEnd, false);\n      document.addEventListener(\"wheel\", self.mouseWheel, false);\n\n    } else if (window.navigator.msPointerEnabled) {\n      // IE10, WP8 (Pointer Events)\n      container.addEventListener(\"MSPointerDown\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"MSPointerMove\", self.touchMoveBubble, false);\n      document.addEventListener(\"MSPointerMove\", self.touchMove, false);\n      document.addEventListener(\"MSPointerUp\", self.touchEnd, false);\n      document.addEventListener(\"MSPointerCancel\", self.touchEnd, false);\n      document.addEventListener(\"wheel\", self.mouseWheel, false);\n\n    } else {\n      // Mouse Events\n      var mousedown = false;\n\n      self.mouseDown = function(e) {\n        if ( ionic.tap.ignoreScrollStart(e) || e.target.tagName === 'SELECT' ) {\n          return;\n        }\n        self.doTouchStart(getEventTouches(e), e.timeStamp);\n\n        if ( !ionic.tap.isTextInput(e.target) ) {\n          e.preventDefault();\n        }\n        mousedown = true;\n      };\n\n      self.mouseMove = function(e) {\n        if (self.options.freeze || !mousedown || (!mousedown && e.defaultPrevented)) {\n          return;\n        }\n\n        self.doTouchMove(getEventTouches(e), e.timeStamp);\n\n        mousedown = true;\n      };\n\n      self.mouseMoveBubble = function(e) {\n        if (mousedown && self.options.preventDefault) {\n          e.preventDefault();\n        }\n      };\n\n      self.mouseUp = function(e) {\n        if (!mousedown) {\n          return;\n        }\n\n        self.doTouchEnd(e, e.timeStamp);\n\n        mousedown = false;\n      };\n\n      container.addEventListener(\"mousedown\", self.mouseDown, false);\n      if(self.options.preventDefault) container.addEventListener(\"mousemove\", self.mouseMoveBubble, false);\n      document.addEventListener(\"mousemove\", self.mouseMove, false);\n      document.addEventListener(\"mouseup\", self.mouseUp, false);\n      document.addEventListener('mousewheel', self.mouseWheel, false);\n      document.addEventListener('wheel', self.mouseWheel, false);\n    }\n  },\n\n  __cleanup: function() {\n    var self = this;\n    var container = self.__container;\n\n    container.removeEventListener('touchstart', self.touchStart);\n    container.removeEventListener('touchmove', self.touchMoveBubble);\n    document.removeEventListener('touchmove', self.touchMove);\n    document.removeEventListener('touchend', self.touchEnd);\n    document.removeEventListener('touchcancel', self.touchCancel);\n\n    container.removeEventListener(\"pointerdown\", self.touchStart);\n    container.removeEventListener(\"pointermove\", self.touchMoveBubble);\n    document.removeEventListener(\"pointermove\", self.touchMove);\n    document.removeEventListener(\"pointerup\", self.touchEnd);\n    document.removeEventListener(\"pointercancel\", self.touchEnd);\n\n    container.removeEventListener(\"MSPointerDown\", self.touchStart);\n    container.removeEventListener(\"MSPointerMove\", self.touchMoveBubble);\n    document.removeEventListener(\"MSPointerMove\", self.touchMove);\n    document.removeEventListener(\"MSPointerUp\", self.touchEnd);\n    document.removeEventListener(\"MSPointerCancel\", self.touchEnd);\n\n    container.removeEventListener(\"mousedown\", self.mouseDown);\n    container.removeEventListener(\"mousemove\", self.mouseMoveBubble);\n    document.removeEventListener(\"mousemove\", self.mouseMove);\n    document.removeEventListener(\"mouseup\", self.mouseUp);\n    document.removeEventListener('mousewheel', self.mouseWheel);\n    document.removeEventListener('wheel', self.mouseWheel);\n\n    container.removeEventListener('scrollChildIntoView', self.scrollChildIntoView);\n    document.removeEventListener('resetScrollView', self.resetScrollView);\n\n    ionic.tap.removeClonedInputs(container, self);\n\n    delete self.__container;\n    delete self.__content;\n    delete self.__indicatorX;\n    delete self.__indicatorY;\n    delete self.options.el;\n\n    self.__callback = self.scrollChildIntoView = self.resetScrollView = NOOP;\n\n    self.mouseMove = self.mouseDown = self.mouseUp = self.mouseWheel =\n      self.touchStart = self.touchMove = self.touchEnd = self.touchCancel = NOOP;\n\n    self.resize = self.scrollTo = self.zoomTo =\n      self.__scrollingComplete = NOOP;\n    container = null;\n  },\n\n  /** Create a scroll bar div with the given direction **/\n  __createScrollbar: function(direction) {\n    var bar = document.createElement('div'),\n      indicator = document.createElement('div');\n\n    indicator.className = 'scroll-bar-indicator scroll-bar-fade-out';\n\n    if (direction == 'h') {\n      bar.className = 'scroll-bar scroll-bar-h';\n    } else {\n      bar.className = 'scroll-bar scroll-bar-v';\n    }\n\n    bar.appendChild(indicator);\n    return bar;\n  },\n\n  __createScrollbars: function() {\n    var self = this;\n    var indicatorX, indicatorY;\n\n    if (self.options.scrollingX) {\n      indicatorX = {\n        el: self.__createScrollbar('h'),\n        sizeRatio: 1\n      };\n      indicatorX.indicator = indicatorX.el.children[0];\n\n      if (self.options.scrollbarX) {\n        self.__container.appendChild(indicatorX.el);\n      }\n      self.__indicatorX = indicatorX;\n    }\n\n    if (self.options.scrollingY) {\n      indicatorY = {\n        el: self.__createScrollbar('v'),\n        sizeRatio: 1\n      };\n      indicatorY.indicator = indicatorY.el.children[0];\n\n      if (self.options.scrollbarY) {\n        self.__container.appendChild(indicatorY.el);\n      }\n      self.__indicatorY = indicatorY;\n    }\n  },\n\n  __resizeScrollbars: function() {\n    var self = this;\n\n    // Update horiz bar\n    if (self.__indicatorX) {\n      var width = Math.max(Math.round(self.__clientWidth * self.__clientWidth / (self.__contentWidth)), 20);\n      if (width > self.__contentWidth) {\n        width = 0;\n      }\n      if (width !== self.__indicatorX.size) {\n        ionic.requestAnimationFrame(function(){\n          self.__indicatorX.indicator.style.width = width + 'px';\n        });\n      }\n      self.__indicatorX.size = width;\n      self.__indicatorX.minScale = self.options.minScrollbarSizeX / width;\n      self.__indicatorX.maxPos = self.__clientWidth - width;\n      self.__indicatorX.sizeRatio = self.__maxScrollLeft ? self.__indicatorX.maxPos / self.__maxScrollLeft : 1;\n    }\n\n    // Update vert bar\n    if (self.__indicatorY) {\n      var height = Math.max(Math.round(self.__clientHeight * self.__clientHeight / (self.__contentHeight)), 20);\n      if (height > self.__contentHeight) {\n        height = 0;\n      }\n      if (height !== self.__indicatorY.size) {\n        ionic.requestAnimationFrame(function(){\n          self.__indicatorY && (self.__indicatorY.indicator.style.height = height + 'px');\n        });\n      }\n      self.__indicatorY.size = height;\n      self.__indicatorY.minScale = self.options.minScrollbarSizeY / height;\n      self.__indicatorY.maxPos = self.__clientHeight - height;\n      self.__indicatorY.sizeRatio = self.__maxScrollTop ? self.__indicatorY.maxPos / self.__maxScrollTop : 1;\n    }\n  },\n\n  /**\n   * Move and scale the scrollbars as the page scrolls.\n   */\n  __repositionScrollbars: function() {\n    var self = this,\n        heightScale, widthScale,\n        widthDiff, heightDiff,\n        x, y,\n        xstop = 0, ystop = 0;\n\n    if (self.__indicatorX) {\n      // Handle the X scrollbar\n\n      // Don't go all the way to the right if we have a vertical scrollbar as well\n      if (self.__indicatorY) xstop = 10;\n\n      x = Math.round(self.__indicatorX.sizeRatio * self.__scrollLeft) || 0;\n\n      // The the difference between the last content X position, and our overscrolled one\n      widthDiff = self.__scrollLeft - (self.__maxScrollLeft - xstop);\n\n      if (self.__scrollLeft < 0) {\n\n        widthScale = Math.max(self.__indicatorX.minScale,\n            (self.__indicatorX.size - Math.abs(self.__scrollLeft)) / self.__indicatorX.size);\n\n        // Stay at left\n        x = 0;\n\n        // Make sure scale is transformed from the left/center origin point\n        self.__indicatorX.indicator.style[self.__transformOriginProperty] = 'left center';\n      } else if (widthDiff > 0) {\n\n        widthScale = Math.max(self.__indicatorX.minScale,\n            (self.__indicatorX.size - widthDiff) / self.__indicatorX.size);\n\n        // Stay at the furthest x for the scrollable viewport\n        x = self.__indicatorX.maxPos - xstop;\n\n        // Make sure scale is transformed from the right/center origin point\n        self.__indicatorX.indicator.style[self.__transformOriginProperty] = 'right center';\n\n      } else {\n\n        // Normal motion\n        x = Math.min(self.__maxScrollLeft, Math.max(0, x));\n        widthScale = 1;\n\n      }\n\n      var translate3dX = 'translate3d(' + x + 'px, 0, 0) scaleX(' + widthScale + ')';\n      if (self.__indicatorX.transformProp !== translate3dX) {\n        self.__indicatorX.indicator.style[self.__transformProperty] = translate3dX;\n        self.__indicatorX.transformProp = translate3dX;\n      }\n    }\n\n    if (self.__indicatorY) {\n\n      y = Math.round(self.__indicatorY.sizeRatio * self.__scrollTop) || 0;\n\n      // Don't go all the way to the right if we have a vertical scrollbar as well\n      if (self.__indicatorX) ystop = 10;\n\n      heightDiff = self.__scrollTop - (self.__maxScrollTop - ystop);\n\n      if (self.__scrollTop < 0) {\n\n        heightScale = Math.max(self.__indicatorY.minScale, (self.__indicatorY.size - Math.abs(self.__scrollTop)) / self.__indicatorY.size);\n\n        // Stay at top\n        y = 0;\n\n        // Make sure scale is transformed from the center/top origin point\n        if (self.__indicatorY.originProp !== 'center top') {\n          self.__indicatorY.indicator.style[self.__transformOriginProperty] = 'center top';\n          self.__indicatorY.originProp = 'center top';\n        }\n\n      } else if (heightDiff > 0) {\n\n        heightScale = Math.max(self.__indicatorY.minScale, (self.__indicatorY.size - heightDiff) / self.__indicatorY.size);\n\n        // Stay at bottom of scrollable viewport\n        y = self.__indicatorY.maxPos - ystop;\n\n        // Make sure scale is transformed from the center/bottom origin point\n        if (self.__indicatorY.originProp !== 'center bottom') {\n          self.__indicatorY.indicator.style[self.__transformOriginProperty] = 'center bottom';\n          self.__indicatorY.originProp = 'center bottom';\n        }\n\n      } else {\n\n        // Normal motion\n        y = Math.min(self.__maxScrollTop, Math.max(0, y));\n        heightScale = 1;\n\n      }\n\n      var translate3dY = 'translate3d(0,' + y + 'px, 0) scaleY(' + heightScale + ')';\n      if (self.__indicatorY.transformProp !== translate3dY) {\n        self.__indicatorY.indicator.style[self.__transformProperty] = translate3dY;\n        self.__indicatorY.transformProp = translate3dY;\n      }\n    }\n  },\n\n  __fadeScrollbars: function(direction, delay) {\n    var self = this;\n\n    if (!self.options.scrollbarsFade) {\n      return;\n    }\n\n    var className = 'scroll-bar-fade-out';\n\n    if (self.options.scrollbarsFade === true) {\n      clearTimeout(self.__scrollbarFadeTimeout);\n\n      if (direction == 'in') {\n        if (self.__indicatorX) { self.__indicatorX.indicator.classList.remove(className); }\n        if (self.__indicatorY) { self.__indicatorY.indicator.classList.remove(className); }\n      } else {\n        self.__scrollbarFadeTimeout = setTimeout(function() {\n          if (self.__indicatorX) { self.__indicatorX.indicator.classList.add(className); }\n          if (self.__indicatorY) { self.__indicatorY.indicator.classList.add(className); }\n        }, delay || self.options.scrollbarFadeDelay);\n      }\n    }\n  },\n\n  __scrollingComplete: function() {\n    this.options.scrollingComplete();\n    ionic.tap.removeClonedInputs(this.__container, this);\n    this.__fadeScrollbars('out');\n  },\n\n  resize: function(continueScrolling) {\n    var self = this;\n    if (!self.__container || !self.options) return;\n\n    // Update Scroller dimensions for changed content\n    // Add padding to bottom of content\n    self.setDimensions(\n      self.__container.clientWidth,\n      self.__container.clientHeight,\n      self.options.getContentWidth(),\n      self.options.getContentHeight(),\n      continueScrolling\n    );\n  },\n  /*\n  ---------------------------------------------------------------------------\n    PUBLIC API\n  ---------------------------------------------------------------------------\n  */\n\n  getRenderFn: function() {\n    var self = this;\n\n    var content = self.__content;\n\n    var docStyle = document.documentElement.style;\n\n    var engine;\n    if ('MozAppearance' in docStyle) {\n      engine = 'gecko';\n    } else if ('WebkitAppearance' in docStyle) {\n      engine = 'webkit';\n    } else if (typeof navigator.cpuClass === 'string') {\n      engine = 'trident';\n    }\n\n    var vendorPrefix = {\n      trident: 'ms',\n      gecko: 'Moz',\n      webkit: 'Webkit',\n      presto: 'O'\n    }[engine];\n\n    var helperElem = document.createElement(\"div\");\n    var undef;\n\n    var perspectiveProperty = vendorPrefix + \"Perspective\";\n    var transformProperty = vendorPrefix + \"Transform\";\n    var transformOriginProperty = vendorPrefix + 'TransformOrigin';\n\n    self.__perspectiveProperty = transformProperty;\n    self.__transformProperty = transformProperty;\n    self.__transformOriginProperty = transformOriginProperty;\n\n    if (helperElem.style[perspectiveProperty] !== undef) {\n\n      return function(left, top, zoom, wasResize) {\n        var translate3d = 'translate3d(' + (-left) + 'px,' + (-top) + 'px,0) scale(' + zoom + ')';\n        if (translate3d !== self.contentTransform) {\n          content.style[transformProperty] = translate3d;\n          self.contentTransform = translate3d;\n        }\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    } else if (helperElem.style[transformProperty] !== undef) {\n\n      return function(left, top, zoom, wasResize) {\n        content.style[transformProperty] = 'translate(' + (-left) + 'px,' + (-top) + 'px) scale(' + zoom + ')';\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    } else {\n\n      return function(left, top, zoom, wasResize) {\n        content.style.marginLeft = left ? (-left / zoom) + 'px' : '';\n        content.style.marginTop = top ? (-top / zoom) + 'px' : '';\n        content.style.zoom = zoom || '';\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    }\n  },\n\n\n  /**\n   * Configures the dimensions of the client (outer) and content (inner) elements.\n   * Requires the available space for the outer element and the outer size of the inner element.\n   * All values which are falsy (null or zero etc.) are ignored and the old value is kept.\n   *\n   * @param clientWidth {Integer} Inner width of outer element\n   * @param clientHeight {Integer} Inner height of outer element\n   * @param contentWidth {Integer} Outer width of inner element\n   * @param contentHeight {Integer} Outer height of inner element\n   */\n  setDimensions: function(clientWidth, clientHeight, contentWidth, contentHeight, continueScrolling) {\n    var self = this;\n\n    if (!clientWidth && !clientHeight && !contentWidth && !contentHeight) {\n      // this scrollview isn't rendered, don't bother\n      return;\n    }\n\n    // Only update values which are defined\n    if (clientWidth === +clientWidth) {\n      self.__clientWidth = clientWidth;\n    }\n\n    if (clientHeight === +clientHeight) {\n      self.__clientHeight = clientHeight;\n    }\n\n    if (contentWidth === +contentWidth) {\n      self.__contentWidth = contentWidth;\n    }\n\n    if (contentHeight === +contentHeight) {\n      self.__contentHeight = contentHeight;\n    }\n\n    // Refresh maximums\n    self.__computeScrollMax();\n    self.__resizeScrollbars();\n\n    // Refresh scroll position\n    if (!continueScrolling) {\n      self.scrollTo(self.__scrollLeft, self.__scrollTop, true, null, true);\n    }\n\n  },\n\n\n  /**\n   * Sets the client coordinates in relation to the document.\n   *\n   * @param left {Integer} Left position of outer element\n   * @param top {Integer} Top position of outer element\n   */\n  setPosition: function(left, top) {\n    this.__clientLeft = left || 0;\n    this.__clientTop = top || 0;\n  },\n\n\n  /**\n   * Configures the snapping (when snapping is active)\n   *\n   * @param width {Integer} Snapping width\n   * @param height {Integer} Snapping height\n   */\n  setSnapSize: function(width, height) {\n    this.__snapWidth = width;\n    this.__snapHeight = height;\n  },\n\n\n  /**\n   * Activates pull-to-refresh. A special zone on the top of the list to start a list refresh whenever\n   * the user event is released during visibility of this zone. This was introduced by some apps on iOS like\n   * the official Twitter client.\n   *\n   * @param height {Integer} Height of pull-to-refresh zone on top of rendered list\n   * @param activateCallback {Function} Callback to execute on activation. This is for signalling the user about a refresh is about to happen when he release.\n   * @param deactivateCallback {Function} Callback to execute on deactivation. This is for signalling the user about the refresh being cancelled.\n   * @param startCallback {Function} Callback to execute to start the real async refresh action. Call {@link #finishPullToRefresh} after finish of refresh.\n   * @param showCallback {Function} Callback to execute when the refresher should be shown. This is for showing the refresher during a negative scrollTop.\n   * @param hideCallback {Function} Callback to execute when the refresher should be hidden. This is for hiding the refresher when it's behind the nav bar.\n   * @param tailCallback {Function} Callback to execute just before the refresher returns to it's original state. This is for zooming out the refresher.\n   * @param pullProgressCallback Callback to state the progress while pulling to refresh\n   */\n  activatePullToRefresh: function(height, refresherMethods) {\n    var self = this;\n\n    self.__refreshHeight = height;\n    self.__refreshActivate = function() { ionic.requestAnimationFrame(refresherMethods.activate); };\n    self.__refreshDeactivate = function() { ionic.requestAnimationFrame(refresherMethods.deactivate); };\n    self.__refreshStart = function() { ionic.requestAnimationFrame(refresherMethods.start); };\n    self.__refreshShow = function() { ionic.requestAnimationFrame(refresherMethods.show); };\n    self.__refreshHide = function() { ionic.requestAnimationFrame(refresherMethods.hide); };\n    self.__refreshTail = function() { ionic.requestAnimationFrame(refresherMethods.tail); };\n    self.__refreshTailTime = 100;\n    self.__minSpinTime = 600;\n  },\n\n\n  /**\n   * Starts pull-to-refresh manually.\n   */\n  triggerPullToRefresh: function() {\n    // Use publish instead of scrollTo to allow scrolling to out of boundary position\n    // We don't need to normalize scrollLeft, zoomLevel, etc. here because we only y-scrolling when pull-to-refresh is enabled\n    this.__publish(this.__scrollLeft, -this.__refreshHeight, this.__zoomLevel, true);\n\n    var d = new Date();\n    this.refreshStartTime = d.getTime();\n\n    if (this.__refreshStart) {\n      this.__refreshStart();\n    }\n  },\n\n\n  /**\n   * Signalizes that pull-to-refresh is finished.\n   */\n  finishPullToRefresh: function() {\n    var self = this;\n    // delay to make sure the spinner has a chance to spin for a split second before it's dismissed\n    var d = new Date();\n    var delay = 0;\n    if (self.refreshStartTime + self.__minSpinTime > d.getTime()) {\n      delay = self.refreshStartTime + self.__minSpinTime - d.getTime();\n    }\n    setTimeout(function() {\n      if (self.__refreshTail) {\n        self.__refreshTail();\n      }\n      setTimeout(function() {\n        self.__refreshActive = false;\n        if (self.__refreshDeactivate) {\n          self.__refreshDeactivate();\n        }\n        if (self.__refreshHide) {\n          self.__refreshHide();\n        }\n\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, true);\n      }, self.__refreshTailTime);\n    }, delay);\n  },\n\n\n  /**\n   * Returns the scroll position and zooming values\n   *\n   * @return {Map} `left` and `top` scroll position and `zoom` level\n   */\n  getValues: function() {\n    return {\n      left: this.__scrollLeft,\n      top: this.__scrollTop,\n      zoom: this.__zoomLevel\n    };\n  },\n\n\n  /**\n   * Returns the maximum scroll values\n   *\n   * @return {Map} `left` and `top` maximum scroll values\n   */\n  getScrollMax: function() {\n    return {\n      left: this.__maxScrollLeft,\n      top: this.__maxScrollTop\n    };\n  },\n\n\n  /**\n   * Zooms to the given level. Supports optional animation. Zooms\n   * the center when no coordinates are given.\n   *\n   * @param level {Number} Level to zoom to\n   * @param animate {Boolean} Whether to use animation\n   * @param originLeft {Number} Zoom in at given left coordinate\n   * @param originTop {Number} Zoom in at given top coordinate\n   */\n  zoomTo: function(level, animate, originLeft, originTop) {\n    var self = this;\n\n    if (!self.options.zooming) {\n      throw new Error(\"Zooming is not enabled!\");\n    }\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n    }\n\n    var oldLevel = self.__zoomLevel;\n\n    // Normalize input origin to center of viewport if not defined\n    if (originLeft == null) {\n      originLeft = self.__clientWidth / 2;\n    }\n\n    if (originTop == null) {\n      originTop = self.__clientHeight / 2;\n    }\n\n    // Limit level according to configuration\n    level = Math.max(Math.min(level, self.options.maxZoom), self.options.minZoom);\n\n    // Recompute maximum values while temporary tweaking maximum scroll ranges\n    self.__computeScrollMax(level);\n\n    // Recompute left and top coordinates based on new zoom level\n    var left = ((originLeft + self.__scrollLeft) * level / oldLevel) - originLeft;\n    var top = ((originTop + self.__scrollTop) * level / oldLevel) - originTop;\n\n    // Limit x-axis\n    if (left > self.__maxScrollLeft) {\n      left = self.__maxScrollLeft;\n    } else if (left < 0) {\n      left = 0;\n    }\n\n    // Limit y-axis\n    if (top > self.__maxScrollTop) {\n      top = self.__maxScrollTop;\n    } else if (top < 0) {\n      top = 0;\n    }\n\n    // Push values out\n    self.__publish(left, top, level, animate);\n\n  },\n\n\n  /**\n   * Zooms the content by the given factor.\n   *\n   * @param factor {Number} Zoom by given factor\n   * @param animate {Boolean} Whether to use animation\n   * @param originLeft {Number} Zoom in at given left coordinate\n   * @param originTop {Number} Zoom in at given top coordinate\n   */\n  zoomBy: function(factor, animate, originLeft, originTop) {\n    this.zoomTo(this.__zoomLevel * factor, animate, originLeft, originTop);\n  },\n\n\n  /**\n   * Scrolls to the given position. Respect limitations and snapping automatically.\n   *\n   * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n   * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n   * @param animate {Boolean} Whether the scrolling should happen using an animation\n   * @param zoom {Number} Zoom level to go to\n   */\n  scrollTo: function(left, top, animate, zoom, wasResize) {\n    var self = this;\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n    }\n\n    // Correct coordinates based on new zoom level\n    if (zoom != null && zoom !== self.__zoomLevel) {\n\n      if (!self.options.zooming) {\n        throw new Error(\"Zooming is not enabled!\");\n      }\n\n      left *= zoom;\n      top *= zoom;\n\n      // Recompute maximum values while temporary tweaking maximum scroll ranges\n      self.__computeScrollMax(zoom);\n\n    } else {\n\n      // Keep zoom when not defined\n      zoom = self.__zoomLevel;\n\n    }\n\n    if (!self.options.scrollingX) {\n\n      left = self.__scrollLeft;\n\n    } else {\n\n      if (self.options.paging) {\n        left = Math.round(left / self.__clientWidth) * self.__clientWidth;\n      } else if (self.options.snapping) {\n        left = Math.round(left / self.__snapWidth) * self.__snapWidth;\n      }\n\n    }\n\n    if (!self.options.scrollingY) {\n\n      top = self.__scrollTop;\n\n    } else {\n\n      if (self.options.paging) {\n        top = Math.round(top / self.__clientHeight) * self.__clientHeight;\n      } else if (self.options.snapping) {\n        top = Math.round(top / self.__snapHeight) * self.__snapHeight;\n      }\n\n    }\n\n    // Limit for allowed ranges\n    left = Math.max(Math.min(self.__maxScrollLeft, left), 0);\n    top = Math.max(Math.min(self.__maxScrollTop, top), 0);\n\n    // Don't animate when no change detected, still call publish to make sure\n    // that rendered position is really in-sync with internal data\n    if (left === self.__scrollLeft && top === self.__scrollTop) {\n      animate = false;\n    }\n\n    // Publish new values\n    self.__publish(left, top, zoom, animate, wasResize);\n\n  },\n\n\n  /**\n   * Scroll by the given offset\n   *\n   * @param left {Number} Scroll x-axis by given offset\n   * @param top {Number} Scroll y-axis by given offset\n   * @param animate {Boolean} Whether to animate the given change\n   */\n  scrollBy: function(left, top, animate) {\n    var self = this;\n\n    var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;\n    var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;\n\n    self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    EVENT CALLBACKS\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Mouse wheel handler for zooming support\n   */\n  doMouseZoom: function(wheelDelta, timeStamp, pageX, pageY) {\n    var change = wheelDelta > 0 ? 0.97 : 1.03;\n    return this.zoomTo(this.__zoomLevel * change, false, pageX - this.__clientLeft, pageY - this.__clientTop);\n  },\n\n  /**\n   * Touch start handler for scrolling support\n   */\n  doTouchStart: function(touches, timeStamp) {\n    var self = this;\n\n    // remember if the deceleration was just stopped\n    self.__decStopped = !!(self.__isDecelerating || self.__isAnimating);\n\n    self.hintResize();\n\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    // Reset interruptedAnimation flag\n    self.__interruptedAnimation = true;\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n      self.__interruptedAnimation = true;\n    }\n\n    // Stop animation\n    if (self.__isAnimating) {\n      zyngaCore.effect.Animate.stop(self.__isAnimating);\n      self.__isAnimating = false;\n      self.__interruptedAnimation = true;\n    }\n\n    // Use center point when dealing with two fingers\n    var currentTouchLeft, currentTouchTop;\n    var isSingleTouch = touches.length === 1;\n    if (isSingleTouch) {\n      currentTouchLeft = touches[0].pageX;\n      currentTouchTop = touches[0].pageY;\n    } else {\n      currentTouchLeft = Math.abs(touches[0].pageX + touches[1].pageX) / 2;\n      currentTouchTop = Math.abs(touches[0].pageY + touches[1].pageY) / 2;\n    }\n\n    // Store initial positions\n    self.__initialTouchLeft = currentTouchLeft;\n    self.__initialTouchTop = currentTouchTop;\n\n    // Store initial touchList for scale calculation\n    self.__initialTouches = touches;\n\n    // Store current zoom level\n    self.__zoomLevelStart = self.__zoomLevel;\n\n    // Store initial touch positions\n    self.__lastTouchLeft = currentTouchLeft;\n    self.__lastTouchTop = currentTouchTop;\n\n    // Store initial move time stamp\n    self.__lastTouchMove = timeStamp;\n\n    // Reset initial scale\n    self.__lastScale = 1;\n\n    // Reset locking flags\n    self.__enableScrollX = !isSingleTouch && self.options.scrollingX;\n    self.__enableScrollY = !isSingleTouch && self.options.scrollingY;\n\n    // Reset tracking flag\n    self.__isTracking = true;\n\n    // Reset deceleration complete flag\n    self.__didDecelerationComplete = false;\n\n    // Dragging starts directly with two fingers, otherwise lazy with an offset\n    self.__isDragging = !isSingleTouch;\n\n    // Some features are disabled in multi touch scenarios\n    self.__isSingleTouch = isSingleTouch;\n\n    // Clearing data structure\n    self.__positions = [];\n\n  },\n\n\n  /**\n   * Touch move handler for scrolling support\n   */\n  doTouchMove: function(touches, timeStamp, scale) {\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    var self = this;\n\n    // Ignore event when tracking is not enabled (event might be outside of element)\n    if (!self.__isTracking) {\n      return;\n    }\n\n    var currentTouchLeft, currentTouchTop;\n\n    // Compute move based around of center of fingers\n    if (touches.length === 2) {\n      currentTouchLeft = Math.abs(touches[0].pageX + touches[1].pageX) / 2;\n      currentTouchTop = Math.abs(touches[0].pageY + touches[1].pageY) / 2;\n\n      // Calculate scale when not present and only when touches are used\n      if (!scale && self.options.zooming) {\n        scale = self.__getScale(self.__initialTouches, touches);\n      }\n    } else {\n      currentTouchLeft = touches[0].pageX;\n      currentTouchTop = touches[0].pageY;\n    }\n\n    var positions = self.__positions;\n\n    // Are we already is dragging mode?\n    if (self.__isDragging) {\n        self.__decStopped = false;\n\n      // Compute move distance\n      var moveX = currentTouchLeft - self.__lastTouchLeft;\n      var moveY = currentTouchTop - self.__lastTouchTop;\n\n      // Read previous scroll position and zooming\n      var scrollLeft = self.__scrollLeft;\n      var scrollTop = self.__scrollTop;\n      var level = self.__zoomLevel;\n\n      // Work with scaling\n      if (scale != null && self.options.zooming) {\n\n        var oldLevel = level;\n\n        // Recompute level based on previous scale and new scale\n        level = level / self.__lastScale * scale;\n\n        // Limit level according to configuration\n        level = Math.max(Math.min(level, self.options.maxZoom), self.options.minZoom);\n\n        // Only do further compution when change happened\n        if (oldLevel !== level) {\n\n          // Compute relative event position to container\n          var currentTouchLeftRel = currentTouchLeft - self.__clientLeft;\n          var currentTouchTopRel = currentTouchTop - self.__clientTop;\n\n          // Recompute left and top coordinates based on new zoom level\n          scrollLeft = ((currentTouchLeftRel + scrollLeft) * level / oldLevel) - currentTouchLeftRel;\n          scrollTop = ((currentTouchTopRel + scrollTop) * level / oldLevel) - currentTouchTopRel;\n\n          // Recompute max scroll values\n          self.__computeScrollMax(level);\n\n        }\n      }\n\n      if (self.__enableScrollX) {\n\n        scrollLeft -= moveX * self.options.speedMultiplier;\n        var maxScrollLeft = self.__maxScrollLeft;\n\n        if (scrollLeft > maxScrollLeft || scrollLeft < 0) {\n\n          // Slow down on the edges\n          if (self.options.bouncing) {\n\n            scrollLeft += (moveX / 2 * self.options.speedMultiplier);\n\n          } else if (scrollLeft > maxScrollLeft) {\n\n            scrollLeft = maxScrollLeft;\n\n          } else {\n\n            scrollLeft = 0;\n\n          }\n        }\n      }\n\n      // Compute new vertical scroll position\n      if (self.__enableScrollY) {\n\n        scrollTop -= moveY * self.options.speedMultiplier;\n        var maxScrollTop = self.__maxScrollTop;\n\n        if (scrollTop > maxScrollTop || scrollTop < 0) {\n\n          // Slow down on the edges\n          if (self.options.bouncing || (self.__refreshHeight && scrollTop < 0)) {\n\n            scrollTop += (moveY / 2 * self.options.speedMultiplier);\n\n            // Support pull-to-refresh (only when only y is scrollable)\n            if (!self.__enableScrollX && self.__refreshHeight != null) {\n\n              // hide the refresher when it's behind the header bar in case of header transparency\n              if (scrollTop < 0) {\n                self.__refreshHidden = false;\n                self.__refreshShow();\n              } else {\n                self.__refreshHide();\n                self.__refreshHidden = true;\n              }\n\n              if (!self.__refreshActive && scrollTop <= -self.__refreshHeight) {\n\n                self.__refreshActive = true;\n                if (self.__refreshActivate) {\n                  self.__refreshActivate();\n                }\n\n              } else if (self.__refreshActive && scrollTop > -self.__refreshHeight) {\n\n                self.__refreshActive = false;\n                if (self.__refreshDeactivate) {\n                  self.__refreshDeactivate();\n                }\n\n              }\n            }\n\n          } else if (scrollTop > maxScrollTop) {\n\n            scrollTop = maxScrollTop;\n\n          } else {\n\n            scrollTop = 0;\n\n          }\n        } else if (self.__refreshHeight && !self.__refreshHidden) {\n          // if a positive scroll value and the refresher is still not hidden, hide it\n          self.__refreshHide();\n          self.__refreshHidden = true;\n        }\n      }\n\n      // Keep list from growing infinitely (holding min 10, max 20 measure points)\n      if (positions.length > 60) {\n        positions.splice(0, 30);\n      }\n\n      // Track scroll movement for decleration\n      positions.push(scrollLeft, scrollTop, timeStamp);\n\n      // Sync scroll position\n      self.__publish(scrollLeft, scrollTop, level);\n\n    // Otherwise figure out whether we are switching into dragging mode now.\n    } else {\n\n      var minimumTrackingForScroll = self.options.locking ? 3 : 0;\n      var minimumTrackingForDrag = 5;\n\n      var distanceX = Math.abs(currentTouchLeft - self.__initialTouchLeft);\n      var distanceY = Math.abs(currentTouchTop - self.__initialTouchTop);\n\n      self.__enableScrollX = self.options.scrollingX && distanceX >= minimumTrackingForScroll;\n      self.__enableScrollY = self.options.scrollingY && distanceY >= minimumTrackingForScroll;\n\n      positions.push(self.__scrollLeft, self.__scrollTop, timeStamp);\n\n      self.__isDragging = (self.__enableScrollX || self.__enableScrollY) && (distanceX >= minimumTrackingForDrag || distanceY >= minimumTrackingForDrag);\n      if (self.__isDragging) {\n        self.__interruptedAnimation = false;\n        self.__fadeScrollbars('in');\n      }\n\n    }\n\n    // Update last touch positions and time stamp for next event\n    self.__lastTouchLeft = currentTouchLeft;\n    self.__lastTouchTop = currentTouchTop;\n    self.__lastTouchMove = timeStamp;\n    self.__lastScale = scale;\n\n  },\n\n\n  /**\n   * Touch end handler for scrolling support\n   */\n  doTouchEnd: function(e, timeStamp) {\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    var self = this;\n\n    // Ignore event when tracking is not enabled (no touchstart event on element)\n    // This is required as this listener ('touchmove') sits on the document and not on the element itself.\n    if (!self.__isTracking) {\n      return;\n    }\n\n    // Not touching anymore (when two finger hit the screen there are two touch end events)\n    self.__isTracking = false;\n\n    // Be sure to reset the dragging flag now. Here we also detect whether\n    // the finger has moved fast enough to switch into a deceleration animation.\n    if (self.__isDragging) {\n\n      // Reset dragging flag\n      self.__isDragging = false;\n\n      // Start deceleration\n      // Verify that the last move detected was in some relevant time frame\n      if (self.__isSingleTouch && self.options.animating && (timeStamp - self.__lastTouchMove) <= 100) {\n\n        // Then figure out what the scroll position was about 100ms ago\n        var positions = self.__positions;\n        var endPos = positions.length - 1;\n        var startPos = endPos;\n\n        // Move pointer to position measured 100ms ago\n        for (var i = endPos; i > 0 && positions[i] > (self.__lastTouchMove - 100); i -= 3) {\n          startPos = i;\n        }\n\n        // If start and stop position is identical in a 100ms timeframe,\n        // we cannot compute any useful deceleration.\n        if (startPos !== endPos) {\n\n          // Compute relative movement between these two points\n          var timeOffset = positions[endPos] - positions[startPos];\n          var movedLeft = self.__scrollLeft - positions[startPos - 2];\n          var movedTop = self.__scrollTop - positions[startPos - 1];\n\n          // Based on 50ms compute the movement to apply for each render step\n          self.__decelerationVelocityX = movedLeft / timeOffset * (1000 / 60);\n          self.__decelerationVelocityY = movedTop / timeOffset * (1000 / 60);\n\n          // How much velocity is required to start the deceleration\n          var minVelocityToStartDeceleration = self.options.paging || self.options.snapping ? self.options.decelVelocityThresholdPaging : self.options.decelVelocityThreshold;\n\n          // Verify that we have enough velocity to start deceleration\n          if (Math.abs(self.__decelerationVelocityX) > minVelocityToStartDeceleration || Math.abs(self.__decelerationVelocityY) > minVelocityToStartDeceleration) {\n\n            // Deactivate pull-to-refresh when decelerating\n            if (!self.__refreshActive) {\n              self.__startDeceleration(timeStamp);\n            }\n          }\n        } else {\n          self.__scrollingComplete();\n        }\n      } else if ((timeStamp - self.__lastTouchMove) > 100) {\n        self.__scrollingComplete();\n      }\n\n    } else if (self.__decStopped) {\n      // the deceleration was stopped\n      // user flicked the scroll fast, and stop dragging, then did a touchstart to stop the srolling\n      // tell the touchend event code to do nothing, we don't want to actually send a click\n      e.isTapHandled = true;\n      self.__decStopped = false;\n    }\n\n    // If this was a slower move it is per default non decelerated, but this\n    // still means that we want snap back to the bounds which is done here.\n    // This is placed outside the condition above to improve edge case stability\n    // e.g. touchend fired without enabled dragging. This should normally do not\n    // have modified the scroll positions or even showed the scrollbars though.\n    if (!self.__isDecelerating) {\n\n      if (self.__refreshActive && self.__refreshStart) {\n\n        // Use publish instead of scrollTo to allow scrolling to out of boundary position\n        // We don't need to normalize scrollLeft, zoomLevel, etc. here because we only y-scrolling when pull-to-refresh is enabled\n        self.__publish(self.__scrollLeft, -self.__refreshHeight, self.__zoomLevel, true);\n\n        var d = new Date();\n        self.refreshStartTime = d.getTime();\n\n        if (self.__refreshStart) {\n          self.__refreshStart();\n        }\n        // for iOS-ey style scrolling\n        if (!ionic.Platform.isAndroid())self.__startDeceleration();\n      } else {\n\n        if (self.__interruptedAnimation || self.__isDragging) {\n          self.__scrollingComplete();\n        }\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, true, self.__zoomLevel);\n\n        // Directly signalize deactivation (nothing todo on refresh?)\n        if (self.__refreshActive) {\n\n          self.__refreshActive = false;\n          if (self.__refreshDeactivate) {\n            self.__refreshDeactivate();\n          }\n\n        }\n      }\n    }\n\n    // Fully cleanup list\n    self.__positions.length = 0;\n\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    PRIVATE API\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Applies the scroll position to the content element\n   *\n   * @param left {Number} Left scroll position\n   * @param top {Number} Top scroll position\n   * @param animate {Boolean} Whether animation should be used to move to the new coordinates\n   */\n  __publish: function(left, top, zoom, animate, wasResize) {\n\n    var self = this;\n\n    // Remember whether we had an animation, then we try to continue based on the current \"drive\" of the animation\n    var wasAnimating = self.__isAnimating;\n    if (wasAnimating) {\n      zyngaCore.effect.Animate.stop(wasAnimating);\n      self.__isAnimating = false;\n    }\n\n    if (animate && self.options.animating) {\n\n      // Keep scheduled positions for scrollBy/zoomBy functionality\n      self.__scheduledLeft = left;\n      self.__scheduledTop = top;\n      self.__scheduledZoom = zoom;\n\n      var oldLeft = self.__scrollLeft;\n      var oldTop = self.__scrollTop;\n      var oldZoom = self.__zoomLevel;\n\n      var diffLeft = left - oldLeft;\n      var diffTop = top - oldTop;\n      var diffZoom = zoom - oldZoom;\n\n      var step = function(percent, now, render) {\n\n        if (render) {\n\n          self.__scrollLeft = oldLeft + (diffLeft * percent);\n          self.__scrollTop = oldTop + (diffTop * percent);\n          self.__zoomLevel = oldZoom + (diffZoom * percent);\n\n          // Push values out\n          if (self.__callback) {\n            self.__callback(self.__scrollLeft, self.__scrollTop, self.__zoomLevel, wasResize);\n          }\n\n        }\n      };\n\n      var verify = function(id) {\n        return self.__isAnimating === id;\n      };\n\n      var completed = function(renderedFramesPerSecond, animationId, wasFinished) {\n        if (animationId === self.__isAnimating) {\n          self.__isAnimating = false;\n        }\n        if (self.__didDecelerationComplete || wasFinished) {\n          self.__scrollingComplete();\n        }\n\n        if (self.options.zooming) {\n          self.__computeScrollMax();\n        }\n      };\n\n      // When continuing based on previous animation we choose an ease-out animation instead of ease-in-out\n      self.__isAnimating = zyngaCore.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);\n\n    } else {\n\n      self.__scheduledLeft = self.__scrollLeft = left;\n      self.__scheduledTop = self.__scrollTop = top;\n      self.__scheduledZoom = self.__zoomLevel = zoom;\n\n      // Push values out\n      if (self.__callback) {\n        self.__callback(left, top, zoom, wasResize);\n      }\n\n      // Fix max scroll ranges\n      if (self.options.zooming) {\n        self.__computeScrollMax();\n      }\n    }\n  },\n\n\n  /**\n   * Recomputes scroll minimum values based on client dimensions and content dimensions.\n   */\n  __computeScrollMax: function(zoomLevel) {\n    var self = this;\n\n    if (zoomLevel == null) {\n      zoomLevel = self.__zoomLevel;\n    }\n\n    self.__maxScrollLeft = Math.max((self.__contentWidth * zoomLevel) - self.__clientWidth, 0);\n    self.__maxScrollTop = Math.max((self.__contentHeight * zoomLevel) - self.__clientHeight, 0);\n\n    if (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {\n      self.__didWaitForSize = true;\n      self.__waitForSize();\n    }\n  },\n\n\n  /**\n   * If the scroll view isn't sized correctly on start, wait until we have at least some size\n   */\n  __waitForSize: function() {\n    var self = this;\n\n    clearTimeout(self.__sizerTimeout);\n\n    var sizer = function() {\n      self.resize(true);\n    };\n\n    sizer();\n    self.__sizerTimeout = setTimeout(sizer, 500);\n  },\n\n  /*\n  ---------------------------------------------------------------------------\n    ANIMATION (DECELERATION) SUPPORT\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Called when a touch sequence end and the speed of the finger was high enough\n   * to switch into deceleration mode.\n   */\n  __startDeceleration: function() {\n    var self = this;\n\n    if (self.options.paging) {\n\n      var scrollLeft = Math.max(Math.min(self.__scrollLeft, self.__maxScrollLeft), 0);\n      var scrollTop = Math.max(Math.min(self.__scrollTop, self.__maxScrollTop), 0);\n      var clientWidth = self.__clientWidth;\n      var clientHeight = self.__clientHeight;\n\n      // We limit deceleration not to the min/max values of the allowed range, but to the size of the visible client area.\n      // Each page should have exactly the size of the client area.\n      self.__minDecelerationScrollLeft = Math.floor(scrollLeft / clientWidth) * clientWidth;\n      self.__minDecelerationScrollTop = Math.floor(scrollTop / clientHeight) * clientHeight;\n      self.__maxDecelerationScrollLeft = Math.ceil(scrollLeft / clientWidth) * clientWidth;\n      self.__maxDecelerationScrollTop = Math.ceil(scrollTop / clientHeight) * clientHeight;\n\n    } else {\n\n      self.__minDecelerationScrollLeft = 0;\n      self.__minDecelerationScrollTop = 0;\n      self.__maxDecelerationScrollLeft = self.__maxScrollLeft;\n      self.__maxDecelerationScrollTop = self.__maxScrollTop;\n      if (self.__refreshActive) self.__minDecelerationScrollTop = self.__refreshHeight * -1;\n    }\n\n    // Wrap class method\n    var step = function(percent, now, render) {\n      self.__stepThroughDeceleration(render);\n    };\n\n    // How much velocity is required to keep the deceleration running\n    self.__minVelocityToKeepDecelerating = self.options.snapping ? 4 : 0.1;\n\n    // Detect whether it's still worth to continue animating steps\n    // If we are already slow enough to not being user perceivable anymore, we stop the whole process here.\n    var verify = function() {\n      var shouldContinue = Math.abs(self.__decelerationVelocityX) >= self.__minVelocityToKeepDecelerating ||\n        Math.abs(self.__decelerationVelocityY) >= self.__minVelocityToKeepDecelerating;\n      if (!shouldContinue) {\n        self.__didDecelerationComplete = true;\n\n        //Make sure the scroll values are within the boundaries after a bounce,\n        //not below 0 or above maximum\n        if (self.options.bouncing && !self.__refreshActive) {\n          self.scrollTo(\n            Math.min( Math.max(self.__scrollLeft, 0), self.__maxScrollLeft ),\n            Math.min( Math.max(self.__scrollTop, 0), self.__maxScrollTop ),\n            self.__refreshActive\n          );\n        }\n      }\n      return shouldContinue;\n    };\n\n    var completed = function() {\n      self.__isDecelerating = false;\n      if (self.__didDecelerationComplete) {\n        self.__scrollingComplete();\n      }\n\n      // Animate to grid when snapping is active, otherwise just fix out-of-boundary positions\n      if (self.options.paging) {\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, self.options.snapping);\n      }\n    };\n\n    // Start animation and switch on flag\n    self.__isDecelerating = zyngaCore.effect.Animate.start(step, verify, completed);\n\n  },\n\n\n  /**\n   * Called on every step of the animation\n   *\n   * @param inMemory {Boolean} Whether to not render the current step, but keep it in memory only. Used internally only!\n   */\n  __stepThroughDeceleration: function(render) {\n    var self = this;\n\n\n    //\n    // COMPUTE NEXT SCROLL POSITION\n    //\n\n    // Add deceleration to scroll position\n    var scrollLeft = self.__scrollLeft + self.__decelerationVelocityX;// * self.options.deceleration);\n    var scrollTop = self.__scrollTop + self.__decelerationVelocityY;// * self.options.deceleration);\n\n\n    //\n    // HARD LIMIT SCROLL POSITION FOR NON BOUNCING MODE\n    //\n\n    if (!self.options.bouncing) {\n\n      var scrollLeftFixed = Math.max(Math.min(self.__maxDecelerationScrollLeft, scrollLeft), self.__minDecelerationScrollLeft);\n      if (scrollLeftFixed !== scrollLeft) {\n        scrollLeft = scrollLeftFixed;\n        self.__decelerationVelocityX = 0;\n      }\n\n      var scrollTopFixed = Math.max(Math.min(self.__maxDecelerationScrollTop, scrollTop), self.__minDecelerationScrollTop);\n      if (scrollTopFixed !== scrollTop) {\n        scrollTop = scrollTopFixed;\n        self.__decelerationVelocityY = 0;\n      }\n\n    }\n\n\n    //\n    // UPDATE SCROLL POSITION\n    //\n\n    if (render) {\n\n      self.__publish(scrollLeft, scrollTop, self.__zoomLevel);\n\n    } else {\n\n      self.__scrollLeft = scrollLeft;\n      self.__scrollTop = scrollTop;\n\n    }\n\n\n    //\n    // SLOW DOWN\n    //\n\n    // Slow down velocity on every iteration\n    if (!self.options.paging) {\n\n      // This is the factor applied to every iteration of the animation\n      // to slow down the process. This should emulate natural behavior where\n      // objects slow down when the initiator of the movement is removed\n      var frictionFactor = self.options.deceleration;\n\n      self.__decelerationVelocityX *= frictionFactor;\n      self.__decelerationVelocityY *= frictionFactor;\n\n    }\n\n\n    //\n    // BOUNCING SUPPORT\n    //\n\n    if (self.options.bouncing) {\n\n      var scrollOutsideX = 0;\n      var scrollOutsideY = 0;\n\n      // This configures the amount of change applied to deceleration/acceleration when reaching boundaries\n      var penetrationDeceleration = self.options.penetrationDeceleration;\n      var penetrationAcceleration = self.options.penetrationAcceleration;\n\n      // Check limits\n      if (scrollLeft < self.__minDecelerationScrollLeft) {\n        scrollOutsideX = self.__minDecelerationScrollLeft - scrollLeft;\n      } else if (scrollLeft > self.__maxDecelerationScrollLeft) {\n        scrollOutsideX = self.__maxDecelerationScrollLeft - scrollLeft;\n      }\n\n      if (scrollTop < self.__minDecelerationScrollTop) {\n        scrollOutsideY = self.__minDecelerationScrollTop - scrollTop;\n      } else if (scrollTop > self.__maxDecelerationScrollTop) {\n        scrollOutsideY = self.__maxDecelerationScrollTop - scrollTop;\n      }\n\n      // Slow down until slow enough, then flip back to snap position\n      if (scrollOutsideX !== 0) {\n        var isHeadingOutwardsX = scrollOutsideX * self.__decelerationVelocityX <= self.__minDecelerationScrollLeft;\n        if (isHeadingOutwardsX) {\n          self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;\n        }\n        var isStoppedX = Math.abs(self.__decelerationVelocityX) <= self.__minVelocityToKeepDecelerating;\n        //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds\n        if (!isHeadingOutwardsX || isStoppedX) {\n          self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;\n        }\n      }\n\n      if (scrollOutsideY !== 0) {\n        var isHeadingOutwardsY = scrollOutsideY * self.__decelerationVelocityY <= self.__minDecelerationScrollTop;\n        if (isHeadingOutwardsY) {\n          self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;\n        }\n        var isStoppedY = Math.abs(self.__decelerationVelocityY) <= self.__minVelocityToKeepDecelerating;\n        //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds\n        if (!isHeadingOutwardsY || isStoppedY) {\n          self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;\n        }\n      }\n    }\n  },\n\n\n  /**\n   * calculate the distance between two touches\n   * @param   {Touch}     touch1\n   * @param   {Touch}     touch2\n   * @returns {Number}    distance\n   */\n  __getDistance: function getDistance(touch1, touch2) {\n    var x = touch2.pageX - touch1.pageX,\n    y = touch2.pageY - touch1.pageY;\n    return Math.sqrt((x * x) + (y * y));\n  },\n\n\n  /**\n   * calculate the scale factor between two touchLists (fingers)\n   * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n   * @param   {Array}     start\n   * @param   {Array}     end\n   * @returns {Number}    scale\n   */\n  __getScale: function getScale(start, end) {\n    // need two fingers...\n    if (start.length >= 2 && end.length >= 2) {\n      return this.__getDistance(end[0], end[1]) /\n        this.__getDistance(start[0], start[1]);\n    }\n    return 1;\n  }\n});\n\nionic.scroll = {\n  isScrolling: false,\n  lastTop: 0\n};\n\n})(ionic);\n\n(function(ionic) {\n  var NOOP = function() {};\n  var depreciated = function(name) {\n    void 0;\n  };\n  ionic.views.ScrollNative = ionic.views.View.inherit({\n\n    initialize: function(options) {\n      var self = this;\n      self.__container = self.el = options.el;\n      self.__content = options.el.firstElementChild;\n      self.isNative = true;\n\n      self.__scrollTop = self.el.scrollTop;\n      self.__scrollLeft = self.el.scrollLeft;\n      self.__clientHeight = self.__content.clientHeight;\n      self.__clientWidth = self.__content.clientWidth;\n      self.__maxScrollTop = Math.max((self.__contentHeight) - self.__clientHeight, 0);\n      self.__maxScrollLeft = Math.max((self.__contentWidth) - self.__clientWidth, 0);\n\n      self.options = {\n\n        freeze: false,\n\n        getContentWidth: function() {\n          return Math.max(self.__content.scrollWidth, self.__content.offsetWidth);\n        },\n\n        getContentHeight: function() {\n          return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));\n        }\n\n      };\n\n      for (var key in options) {\n        self.options[key] = options[key];\n      }\n\n      /**\n       * Sets isScrolling to true, and automatically deactivates if not called again in 80ms.\n       */\n      self.onScroll = function() {\n        if (!ionic.scroll.isScrolling) {\n          ionic.scroll.isScrolling = true;\n        }\n\n        clearTimeout(self.scrollTimer);\n        self.scrollTimer = setTimeout(function() {\n          ionic.scroll.isScrolling = false;\n        }, 80);\n      };\n\n      self.freeze = NOOP;\n\n      self.__initEventHandlers();\n    },\n\n    /**  Methods not used in native scrolling */\n    __callback: function() { depreciated('__callback'); },\n    zoomTo: function() { depreciated('zoomTo'); },\n    zoomBy: function() { depreciated('zoomBy'); },\n    activatePullToRefresh: function() { depreciated('activatePullToRefresh'); },\n\n    /**\n     * Returns the scroll position and zooming values\n     *\n     * @return {Map} `left` and `top` scroll position and `zoom` level\n     */\n    resize: function(continueScrolling) {\n      var self = this;\n      if (!self.__container || !self.options) return;\n\n      // Update Scroller dimensions for changed content\n      // Add padding to bottom of content\n      self.setDimensions(\n        self.__container.clientWidth,\n        self.__container.clientHeight,\n        self.options.getContentWidth(),\n        self.options.getContentHeight(),\n        continueScrolling\n      );\n    },\n\n    /**\n     * Initialize the scrollview\n     * In native scrolling, this only means we need to gather size information\n     */\n    run: function() {\n      this.resize();\n    },\n\n    /**\n     * Returns the scroll position and zooming values\n     *\n     * @return {Map} `left` and `top` scroll position and `zoom` level\n     */\n    getValues: function() {\n      var self = this;\n      self.update();\n      return {\n        left: self.__scrollLeft,\n        top: self.__scrollTop,\n        zoom: 1\n      };\n    },\n\n    /**\n     * Updates the __scrollLeft and __scrollTop values to el's current value\n     */\n    update: function() {\n      var self = this;\n      self.__scrollLeft = self.el.scrollLeft;\n      self.__scrollTop = self.el.scrollTop;\n    },\n\n    /**\n     * Configures the dimensions of the client (outer) and content (inner) elements.\n     * Requires the available space for the outer element and the outer size of the inner element.\n     * All values which are falsy (null or zero etc.) are ignored and the old value is kept.\n     *\n     * @param clientWidth {Integer} Inner width of outer element\n     * @param clientHeight {Integer} Inner height of outer element\n     * @param contentWidth {Integer} Outer width of inner element\n     * @param contentHeight {Integer} Outer height of inner element\n     */\n    setDimensions: function(clientWidth, clientHeight, contentWidth, contentHeight) {\n      var self = this;\n\n      if (!clientWidth && !clientHeight && !contentWidth && !contentHeight) {\n        // this scrollview isn't rendered, don't bother\n        return;\n      }\n\n      // Only update values which are defined\n      if (clientWidth === +clientWidth) {\n        self.__clientWidth = clientWidth;\n      }\n\n      if (clientHeight === +clientHeight) {\n        self.__clientHeight = clientHeight;\n      }\n\n      if (contentWidth === +contentWidth) {\n        self.__contentWidth = contentWidth;\n      }\n\n      if (contentHeight === +contentHeight) {\n        self.__contentHeight = contentHeight;\n      }\n\n      // Refresh maximums\n      self.__computeScrollMax();\n    },\n\n    /**\n     * Returns the maximum scroll values\n     *\n     * @return {Map} `left` and `top` maximum scroll values\n     */\n    getScrollMax: function() {\n      return {\n        left: this.__maxScrollLeft,\n        top: this.__maxScrollTop\n      };\n    },\n\n    /**\n     * Scrolls by the given amount in px.\n     *\n     * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n     * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n     * @param animate {Boolean} Whether the scrolling should happen using an animation\n     */\n\n    scrollBy: function(left, top, animate) {\n      var self = this;\n\n      // update scroll vars before refferencing them\n      self.update();\n\n      var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;\n      var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;\n\n      self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);\n    },\n\n    /**\n     * Scrolls to the given position in px.\n     *\n     * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n     * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n     * @param animate {Boolean} Whether the scrolling should happen using an animation\n     */\n    scrollTo: function(left, top, animate) {\n      var self = this;\n      if (!animate) {\n        self.el.scrollTop = top;\n        self.el.scrollLeft = left;\n        self.resize();\n        return;\n      }\n      animateScroll(top, left);\n\n      function animateScroll(Y, X) {\n        // scroll animation loop w/ easing\n        // credit https://gist.github.com/dezinezync/5487119\n        var start = Date.now(),\n          duration = 1000, //milliseconds\n          fromY = self.el.scrollTop,\n          fromX = self.el.scrollLeft;\n\n        if (fromY === Y && fromX === X) {\n          self.resize();\n          return; /* Prevent scrolling to the Y point if already there */\n        }\n\n        // decelerating to zero velocity\n        function easeOutCubic(t) {\n          return (--t) * t * t + 1;\n        }\n\n        // scroll loop\n        function animateScrollStep() {\n          var currentTime = Date.now(),\n            time = Math.min(1, ((currentTime - start) / duration)),\n          // where .5 would be 50% of time on a linear scale easedT gives a\n          // fraction based on the easing method\n            easedT = easeOutCubic(time);\n\n          if (fromY != Y) {\n            self.el.scrollTop = parseInt((easedT * (Y - fromY)) + fromY, 10);\n          }\n          if (fromX != X) {\n            self.el.scrollLeft = parseInt((easedT * (X - fromX)) + fromX, 10);\n          }\n\n          if (time < 1) {\n            ionic.requestAnimationFrame(animateScrollStep);\n\n          } else {\n            // done\n            self.resize();\n          }\n        }\n\n        // start scroll loop\n        ionic.requestAnimationFrame(animateScrollStep);\n      }\n    },\n\n\n\n    /*\n     ---------------------------------------------------------------------------\n     PRIVATE API\n     ---------------------------------------------------------------------------\n     */\n\n    /**\n     * If the scroll view isn't sized correctly on start, wait until we have at least some size\n     */\n    __waitForSize: function() {\n      var self = this;\n\n      clearTimeout(self.__sizerTimeout);\n\n      var sizer = function() {\n        self.resize(true);\n      };\n\n      sizer();\n      self.__sizerTimeout = setTimeout(sizer, 500);\n    },\n\n\n    /**\n     * Recomputes scroll minimum values based on client dimensions and content dimensions.\n     */\n    __computeScrollMax: function() {\n      var self = this;\n\n      self.__maxScrollLeft = Math.max((self.__contentWidth) - self.__clientWidth, 0);\n      self.__maxScrollTop = Math.max((self.__contentHeight) - self.__clientHeight, 0);\n\n      if (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {\n        self.__didWaitForSize = true;\n        self.__waitForSize();\n      }\n    },\n\n    __initEventHandlers: function() {\n      var self = this;\n\n      // Event Handler\n      var container = self.__container;\n\n      // should be unnecessary in native scrolling, but keep in case bugs show up\n      self.scrollChildIntoView = NOOP;\n\n      self.resetScrollView = function() {\n        //return scrollview to original height once keyboard has hidden\n        if (self.isScrolledIntoView) {\n          self.isScrolledIntoView = false;\n          container.style.height = \"\";\n          container.style.overflow = \"\";\n          self.resize();\n          ionic.scroll.isScrolling = false;\n        }\n      };\n\n      container.addEventListener('resetScrollView', self.resetScrollView);\n      container.addEventListener('scroll', self.onScroll);\n\n      //Broadcasted when keyboard is shown on some platforms.\n      //See js/utils/keyboard.js\n      container.addEventListener('scrollChildIntoView', self.scrollChildIntoView);\n      container.addEventListener('resetScrollView', self.resetScrollView);\n    },\n\n    __cleanup: function() {\n      var self = this;\n      var container = self.__container;\n\n      container.removeEventListener('resetScrollView', self.resetScrollView);\n      container.removeEventListener('scroll', self.onScroll);\n\n      container.removeEventListener('scrollChildIntoView', self.scrollChildIntoView);\n      container.removeEventListener('resetScrollView', self.resetScrollView);\n\n      ionic.tap.removeClonedInputs(container, self);\n\n      delete self.__container;\n      delete self.__content;\n      delete self.__indicatorX;\n      delete self.__indicatorY;\n      delete self.options.el;\n\n      self.resize = self.scrollTo = self.onScroll = self.resetScrollView = NOOP;\n      container = null;\n    }\n  });\n\n})(ionic);\n\n\n(function(ionic) {\n'use strict';\n\n  var ITEM_CLASS = 'item';\n  var ITEM_CONTENT_CLASS = 'item-content';\n  var ITEM_SLIDING_CLASS = 'item-sliding';\n  var ITEM_OPTIONS_CLASS = 'item-options';\n  var ITEM_PLACEHOLDER_CLASS = 'item-placeholder';\n  var ITEM_REORDERING_CLASS = 'item-reordering';\n  var ITEM_REORDER_BTN_CLASS = 'item-reorder';\n\n  var DragOp = function() {};\n  DragOp.prototype = {\n    start: function(){},\n    drag: function(){},\n    end: function(){},\n    isSameItem: function() {\n      return false;\n    }\n  };\n\n  var SlideDrag = function(opts) {\n    this.dragThresholdX = opts.dragThresholdX || 10;\n    this.el = opts.el;\n    this.item = opts.item;\n    this.canSwipe = opts.canSwipe;\n  };\n\n  SlideDrag.prototype = new DragOp();\n\n  SlideDrag.prototype.start = function(e) {\n    var content, buttons, offsetX, buttonsWidth;\n\n    if (!this.canSwipe()) {\n      return;\n    }\n\n    if (e.target.classList.contains(ITEM_CONTENT_CLASS)) {\n      content = e.target;\n    } else if (e.target.classList.contains(ITEM_CLASS)) {\n      content = e.target.querySelector('.' + ITEM_CONTENT_CLASS);\n    } else {\n      content = ionic.DomUtil.getParentWithClass(e.target, ITEM_CONTENT_CLASS);\n    }\n\n    // If we don't have a content area as one of our children (or ourselves), skip\n    if (!content) {\n      return;\n    }\n\n    // Make sure we aren't animating as we slide\n    content.classList.remove(ITEM_SLIDING_CLASS);\n\n    // Grab the starting X point for the item (for example, so we can tell whether it is open or closed to start)\n    offsetX = parseFloat(content.style[ionic.CSS.TRANSFORM].replace('translate3d(', '').split(',')[0]) || 0;\n\n    // Grab the buttons\n    buttons = content.parentNode.querySelector('.' + ITEM_OPTIONS_CLASS);\n    if (!buttons) {\n      return;\n    }\n    buttons.classList.remove('invisible');\n\n    buttonsWidth = buttons.offsetWidth;\n\n    this._currentDrag = {\n      buttons: buttons,\n      buttonsWidth: buttonsWidth,\n      content: content,\n      startOffsetX: offsetX\n    };\n  };\n\n  /**\n   * Check if this is the same item that was previously dragged.\n   */\n  SlideDrag.prototype.isSameItem = function(op) {\n    if (op._lastDrag && this._currentDrag) {\n      return this._currentDrag.content == op._lastDrag.content;\n    }\n    return false;\n  };\n\n  SlideDrag.prototype.clean = function(isInstant) {\n    var lastDrag = this._lastDrag;\n\n    if (!lastDrag || !lastDrag.content) return;\n\n    lastDrag.content.style[ionic.CSS.TRANSITION] = '';\n    lastDrag.content.style[ionic.CSS.TRANSFORM] = '';\n    if (isInstant) {\n      lastDrag.content.style[ionic.CSS.TRANSITION] = 'none';\n      makeInvisible();\n      ionic.requestAnimationFrame(function() {\n        lastDrag.content.style[ionic.CSS.TRANSITION] = '';\n      });\n    } else {\n      ionic.requestAnimationFrame(function() {\n        setTimeout(makeInvisible, 250);\n      });\n    }\n    function makeInvisible() {\n      lastDrag.buttons && lastDrag.buttons.classList.add('invisible');\n    }\n  };\n\n  SlideDrag.prototype.drag = ionic.animationFrameThrottle(function(e) {\n    var buttonsWidth;\n\n    // We really aren't dragging\n    if (!this._currentDrag) {\n      return;\n    }\n\n    // Check if we should start dragging. Check if we've dragged past the threshold,\n    // or we are starting from the open state.\n    if (!this._isDragging &&\n        ((Math.abs(e.gesture.deltaX) > this.dragThresholdX) ||\n        (Math.abs(this._currentDrag.startOffsetX) > 0))) {\n      this._isDragging = true;\n    }\n\n    if (this._isDragging) {\n      buttonsWidth = this._currentDrag.buttonsWidth;\n\n      // Grab the new X point, capping it at zero\n      var newX = Math.min(0, this._currentDrag.startOffsetX + e.gesture.deltaX);\n\n      // If the new X position is past the buttons, we need to slow down the drag (rubber band style)\n      if (newX < -buttonsWidth) {\n        // Calculate the new X position, capped at the top of the buttons\n        newX = Math.min(-buttonsWidth, -buttonsWidth + (((e.gesture.deltaX + buttonsWidth) * 0.4)));\n      }\n\n      this._currentDrag.content.$$ionicOptionsOpen = newX !== 0;\n\n      this._currentDrag.content.style[ionic.CSS.TRANSFORM] = 'translate3d(' + newX + 'px, 0, 0)';\n      this._currentDrag.content.style[ionic.CSS.TRANSITION] = 'none';\n    }\n  });\n\n  SlideDrag.prototype.end = function(e, doneCallback) {\n    var self = this;\n\n    // There is no drag, just end immediately\n    if (!self._currentDrag) {\n      doneCallback && doneCallback();\n      return;\n    }\n\n    // If we are currently dragging, we want to snap back into place\n    // The final resting point X will be the width of the exposed buttons\n    var restingPoint = -self._currentDrag.buttonsWidth;\n\n    // Check if the drag didn't clear the buttons mid-point\n    // and we aren't moving fast enough to swipe open\n    if (e.gesture.deltaX > -(self._currentDrag.buttonsWidth / 2)) {\n\n      // If we are going left but too slow, or going right, go back to resting\n      if (e.gesture.direction == \"left\" && Math.abs(e.gesture.velocityX) < 0.3) {\n        restingPoint = 0;\n\n      } else if (e.gesture.direction == \"right\") {\n        restingPoint = 0;\n      }\n\n    }\n\n    ionic.requestAnimationFrame(function() {\n      if (restingPoint === 0) {\n        self._currentDrag.content.style[ionic.CSS.TRANSFORM] = '';\n        var buttons = self._currentDrag.buttons;\n        setTimeout(function() {\n          buttons && buttons.classList.add('invisible');\n        }, 250);\n      } else {\n        self._currentDrag.content.style[ionic.CSS.TRANSFORM] = 'translate3d(' + restingPoint + 'px,0,0)';\n      }\n      self._currentDrag.content.style[ionic.CSS.TRANSITION] = '';\n\n\n      // Kill the current drag\n      if (!self._lastDrag) {\n        self._lastDrag = {};\n      }\n      ionic.extend(self._lastDrag, self._currentDrag);\n      if (self._currentDrag) {\n        self._currentDrag.buttons = null;\n        self._currentDrag.content = null;\n      }\n      self._currentDrag = null;\n\n      // We are done, notify caller\n      doneCallback && doneCallback();\n    });\n  };\n\n  var ReorderDrag = function(opts) {\n    var self = this;\n\n    self.dragThresholdY = opts.dragThresholdY || 0;\n    self.onReorder = opts.onReorder;\n    self.listEl = opts.listEl;\n    self.el = self.item = opts.el;\n    self.scrollEl = opts.scrollEl;\n    self.scrollView = opts.scrollView;\n    // Get the True Top of the list el http://www.quirksmode.org/js/findpos.html\n    self.listElTrueTop = 0;\n    if (self.listEl.offsetParent) {\n      var obj = self.listEl;\n      do {\n        self.listElTrueTop += obj.offsetTop;\n        obj = obj.offsetParent;\n      } while (obj);\n    }\n  };\n\n  ReorderDrag.prototype = new DragOp();\n\n  ReorderDrag.prototype._moveElement = function(e) {\n    var y = e.gesture.center.pageY +\n      this.scrollView.getValues().top -\n      (this._currentDrag.elementHeight / 2) -\n      this.listElTrueTop;\n    this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, ' + y + 'px, 0)';\n  };\n\n  ReorderDrag.prototype.deregister = function() {\n    this.listEl = this.el = this.scrollEl = this.scrollView = null;\n  };\n\n  ReorderDrag.prototype.start = function(e) {\n\n    var startIndex = ionic.DomUtil.getChildIndex(this.el, this.el.nodeName.toLowerCase());\n    var elementHeight = this.el.scrollHeight;\n    var placeholder = this.el.cloneNode(true);\n\n    placeholder.classList.add(ITEM_PLACEHOLDER_CLASS);\n\n    this.el.parentNode.insertBefore(placeholder, this.el);\n    this.el.classList.add(ITEM_REORDERING_CLASS);\n\n    this._currentDrag = {\n      elementHeight: elementHeight,\n      startIndex: startIndex,\n      placeholder: placeholder,\n      scrollHeight: scroll,\n      list: placeholder.parentNode\n    };\n\n    this._moveElement(e);\n  };\n\n  ReorderDrag.prototype.drag = ionic.animationFrameThrottle(function(e) {\n    // We really aren't dragging\n    var self = this;\n    if (!this._currentDrag) {\n      return;\n    }\n\n    var scrollY = 0;\n    var pageY = e.gesture.center.pageY;\n    var offset = this.listElTrueTop;\n\n    //If we have a scrollView, check scroll boundaries for dragged element and scroll if necessary\n    if (this.scrollView) {\n\n      var container = this.scrollView.__container;\n      scrollY = this.scrollView.getValues().top;\n\n      var containerTop = container.offsetTop;\n      var pixelsPastTop = containerTop - pageY + this._currentDrag.elementHeight / 2;\n      var pixelsPastBottom = pageY + this._currentDrag.elementHeight / 2 - containerTop - container.offsetHeight;\n\n      if (e.gesture.deltaY < 0 && pixelsPastTop > 0 && scrollY > 0) {\n        this.scrollView.scrollBy(null, -pixelsPastTop);\n        //Trigger another drag so the scrolling keeps going\n        ionic.requestAnimationFrame(function() {\n          self.drag(e);\n        });\n      }\n      if (e.gesture.deltaY > 0 && pixelsPastBottom > 0) {\n        if (scrollY < this.scrollView.getScrollMax().top) {\n          this.scrollView.scrollBy(null, pixelsPastBottom);\n          //Trigger another drag so the scrolling keeps going\n          ionic.requestAnimationFrame(function() {\n            self.drag(e);\n          });\n        }\n      }\n    }\n\n    // Check if we should start dragging. Check if we've dragged past the threshold,\n    // or we are starting from the open state.\n    if (!this._isDragging && Math.abs(e.gesture.deltaY) > this.dragThresholdY) {\n      this._isDragging = true;\n    }\n\n    if (this._isDragging) {\n      this._moveElement(e);\n\n      this._currentDrag.currentY = scrollY + pageY - offset;\n\n      // this._reorderItems();\n    }\n  });\n\n  // When an item is dragged, we need to reorder any items for sorting purposes\n  ReorderDrag.prototype._getReorderIndex = function() {\n    var self = this;\n\n    var siblings = Array.prototype.slice.call(self._currentDrag.placeholder.parentNode.children)\n      .filter(function(el) {\n        return el.nodeName === self.el.nodeName && el !== self.el;\n      });\n\n    var dragOffsetTop = self._currentDrag.currentY;\n    var el;\n    for (var i = 0, len = siblings.length; i < len; i++) {\n      el = siblings[i];\n      if (i === len - 1) {\n        if (dragOffsetTop > el.offsetTop) {\n          return i;\n        }\n      } else if (i === 0) {\n        if (dragOffsetTop < el.offsetTop + el.offsetHeight) {\n          return i;\n        }\n      } else if (dragOffsetTop > el.offsetTop - el.offsetHeight / 2 &&\n                 dragOffsetTop < el.offsetTop + el.offsetHeight) {\n        return i;\n      }\n    }\n    return self._currentDrag.startIndex;\n  };\n\n  ReorderDrag.prototype.end = function(e, doneCallback) {\n    if (!this._currentDrag) {\n      doneCallback && doneCallback();\n      return;\n    }\n\n    var placeholder = this._currentDrag.placeholder;\n    var finalIndex = this._getReorderIndex();\n\n    // Reposition the element\n    this.el.classList.remove(ITEM_REORDERING_CLASS);\n    this.el.style[ionic.CSS.TRANSFORM] = '';\n\n    placeholder.parentNode.insertBefore(this.el, placeholder);\n    placeholder.parentNode.removeChild(placeholder);\n\n    this.onReorder && this.onReorder(this.el, this._currentDrag.startIndex, finalIndex);\n\n    this._currentDrag = {\n      placeholder: null,\n      content: null\n    };\n    this._currentDrag = null;\n    doneCallback && doneCallback();\n  };\n\n\n\n  /**\n   * The ListView handles a list of items. It will process drag animations, edit mode,\n   * and other operations that are common on mobile lists or table views.\n   */\n  ionic.views.ListView = ionic.views.View.inherit({\n    initialize: function(opts) {\n      var self = this;\n\n      opts = ionic.extend({\n        onReorder: function() {},\n        virtualRemoveThreshold: -200,\n        virtualAddThreshold: 200,\n        canSwipe: function() {\n          return true;\n        }\n      }, opts);\n\n      ionic.extend(self, opts);\n\n      if (!self.itemHeight && self.listEl) {\n        self.itemHeight = self.listEl.children[0] && parseInt(self.listEl.children[0].style.height, 10);\n      }\n\n      self.onRefresh = opts.onRefresh || function() {};\n      self.onRefreshOpening = opts.onRefreshOpening || function() {};\n      self.onRefreshHolding = opts.onRefreshHolding || function() {};\n\n      var gestureOpts = {};\n      // don't prevent native scrolling\n      if (ionic.DomUtil.getParentOrSelfWithClass(self.el, 'overflow-scroll')) {\n        gestureOpts.prevent_default_directions = ['left', 'right'];\n      }\n\n      window.ionic.onGesture('release', function(e) {\n        self._handleEndDrag(e);\n      }, self.el, gestureOpts);\n\n      window.ionic.onGesture('drag', function(e) {\n        self._handleDrag(e);\n      }, self.el, gestureOpts);\n      // Start the drag states\n      self._initDrag();\n    },\n\n    /**\n     * Be sure to cleanup references.\n     */\n    deregister: function() {\n      this.el = this.listEl = this.scrollEl = this.scrollView = null;\n\n      // ensure no scrolls have been left frozen\n      if (this.isScrollFreeze) {\n        self.scrollView.freeze(false);\n      }\n    },\n\n    /**\n     * Called to tell the list to stop refreshing. This is useful\n     * if you are refreshing the list and are done with refreshing.\n     */\n    stopRefreshing: function() {\n      var refresher = this.el.querySelector('.list-refresher');\n      refresher.style.height = '0';\n    },\n\n    /**\n     * If we scrolled and have virtual mode enabled, compute the window\n     * of active elements in order to figure out the viewport to render.\n     */\n    didScroll: function(e) {\n      var self = this;\n\n      if (self.isVirtual) {\n        var itemHeight = self.itemHeight;\n\n        // Grab the total height of the list\n        var scrollHeight = e.target.scrollHeight;\n\n        // Get the viewport height\n        var viewportHeight = self.el.parentNode.offsetHeight;\n\n        // High water is the pixel position of the first element to include (everything before\n        // that will be removed)\n        var highWater = Math.max(0, e.scrollTop + self.virtualRemoveThreshold);\n\n        // Low water is the pixel position of the last element to include (everything after\n        // that will be removed)\n        var lowWater = Math.min(scrollHeight, Math.abs(e.scrollTop) + viewportHeight + self.virtualAddThreshold);\n\n        // Get the first and last elements in the list based on how many can fit\n        // between the pixel range of lowWater and highWater\n        var first = parseInt(Math.abs(highWater / itemHeight), 10);\n        var last = parseInt(Math.abs(lowWater / itemHeight), 10);\n\n        // Get the items we need to remove\n        self._virtualItemsToRemove = Array.prototype.slice.call(self.listEl.children, 0, first);\n\n        self.renderViewport && self.renderViewport(highWater, lowWater, first, last);\n      }\n    },\n\n    didStopScrolling: function() {\n      if (this.isVirtual) {\n        for (var i = 0; i < this._virtualItemsToRemove.length; i++) {\n          //el.parentNode.removeChild(el);\n          this.didHideItem && this.didHideItem(i);\n        }\n        // Once scrolling stops, check if we need to remove old items\n\n      }\n    },\n\n    /**\n     * Clear any active drag effects on the list.\n     */\n    clearDragEffects: function(isInstant) {\n      if (this._lastDragOp) {\n        this._lastDragOp.clean && this._lastDragOp.clean(isInstant);\n        this._lastDragOp.deregister && this._lastDragOp.deregister();\n        this._lastDragOp = null;\n      }\n    },\n\n    _initDrag: function() {\n      // Store the last one\n      if (this._lastDragOp) {\n        this._lastDragOp.deregister && this._lastDragOp.deregister();\n      }\n      this._lastDragOp = this._dragOp;\n\n      this._dragOp = null;\n    },\n\n    // Return the list item from the given target\n    _getItem: function(target) {\n      while (target) {\n        if (target.classList && target.classList.contains(ITEM_CLASS)) {\n          return target;\n        }\n        target = target.parentNode;\n      }\n      return null;\n    },\n\n\n    _startDrag: function(e) {\n      var self = this;\n\n      self._isDragging = false;\n\n      var lastDragOp = self._lastDragOp;\n      var item;\n\n      // If we have an open SlideDrag and we're scrolling the list. Clear it.\n      if (self._didDragUpOrDown && lastDragOp instanceof SlideDrag) {\n          lastDragOp.clean && lastDragOp.clean();\n      }\n\n      // Check if this is a reorder drag\n      if (ionic.DomUtil.getParentOrSelfWithClass(e.target, ITEM_REORDER_BTN_CLASS) && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {\n        item = self._getItem(e.target);\n\n        if (item) {\n          self._dragOp = new ReorderDrag({\n            listEl: self.el,\n            el: item,\n            scrollEl: self.scrollEl,\n            scrollView: self.scrollView,\n            onReorder: function(el, start, end) {\n              self.onReorder && self.onReorder(el, start, end);\n            }\n          });\n          self._dragOp.start(e);\n          e.preventDefault();\n        }\n      }\n\n      // Or check if this is a swipe to the side drag\n      else if (!self._didDragUpOrDown && (e.gesture.direction == 'left' || e.gesture.direction == 'right') && Math.abs(e.gesture.deltaX) > 5) {\n\n        // Make sure this is an item with buttons\n        item = self._getItem(e.target);\n        if (item && item.querySelector('.item-options')) {\n          self._dragOp = new SlideDrag({\n            el: self.el,\n            item: item,\n            canSwipe: self.canSwipe\n          });\n          self._dragOp.start(e);\n          e.preventDefault();\n          self.isScrollFreeze = self.scrollView.freeze(true);\n        }\n      }\n\n      // If we had a last drag operation and this is a new one on a different item, clean that last one\n      if (lastDragOp && self._dragOp && !self._dragOp.isSameItem(lastDragOp) && e.defaultPrevented) {\n        lastDragOp.clean && lastDragOp.clean();\n      }\n    },\n\n\n    _handleEndDrag: function(e) {\n      var self = this;\n\n      if (self.scrollView) {\n        self.isScrollFreeze = self.scrollView.freeze(false);\n      }\n\n      self._didDragUpOrDown = false;\n\n      if (!self._dragOp) {\n        return;\n      }\n\n      self._dragOp.end(e, function() {\n        self._initDrag();\n      });\n    },\n\n    /**\n     * Process the drag event to move the item to the left or right.\n     */\n    _handleDrag: function(e) {\n      var self = this;\n\n      if (Math.abs(e.gesture.deltaY) > 5) {\n        self._didDragUpOrDown = true;\n      }\n\n      // If we get a drag event, make sure we aren't in another drag, then check if we should\n      // start one\n      if (!self.isDragging && !self._dragOp) {\n        self._startDrag(e);\n      }\n\n      // No drag still, pass it up\n      if (!self._dragOp) {\n        return;\n      }\n\n      e.gesture.srcEvent.preventDefault();\n      self._dragOp.drag(e);\n    }\n\n  });\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  ionic.views.Modal = ionic.views.View.inherit({\n    initialize: function(opts) {\n      opts = ionic.extend({\n        focusFirstInput: false,\n        unfocusOnHide: true,\n        focusFirstDelay: 600,\n        backdropClickToClose: true,\n        hardwareBackButtonClose: true,\n      }, opts);\n\n      ionic.extend(this, opts);\n\n      this.el = opts.el;\n    },\n    show: function() {\n      var self = this;\n\n      if(self.focusFirstInput) {\n        // Let any animations run first\n        window.setTimeout(function() {\n          var input = self.el.querySelector('input, textarea');\n          input && input.focus && input.focus();\n        }, self.focusFirstDelay);\n      }\n    },\n    hide: function() {\n      // Unfocus all elements\n      if(this.unfocusOnHide) {\n        var inputs = this.el.querySelectorAll('input, textarea');\n        // Let any animations run first\n        window.setTimeout(function() {\n          for(var i = 0; i < inputs.length; i++) {\n            inputs[i].blur && inputs[i].blur();\n          }\n        });\n      }\n    }\n  });\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  /**\n   * The side menu view handles one of the side menu's in a Side Menu Controller\n   * configuration.\n   * It takes a DOM reference to that side menu element.\n   */\n  ionic.views.SideMenu = ionic.views.View.inherit({\n    initialize: function(opts) {\n      this.el = opts.el;\n      this.isEnabled = (typeof opts.isEnabled === 'undefined') ? true : opts.isEnabled;\n      this.setWidth(opts.width);\n    },\n    getFullWidth: function() {\n      return this.width;\n    },\n    setWidth: function(width) {\n      this.width = width;\n      this.el.style.width = width + 'px';\n    },\n    setIsEnabled: function(isEnabled) {\n      this.isEnabled = isEnabled;\n    },\n    bringUp: function() {\n      if(this.el.style.zIndex !== '0') {\n        this.el.style.zIndex = '0';\n      }\n    },\n    pushDown: function() {\n      if(this.el.style.zIndex !== '-1') {\n        this.el.style.zIndex = '-1';\n      }\n    }\n  });\n\n  ionic.views.SideMenuContent = ionic.views.View.inherit({\n    initialize: function(opts) {\n      ionic.extend(this, {\n        animationClass: 'menu-animated',\n        onDrag: function() {},\n        onEndDrag: function() {}\n      }, opts);\n\n      ionic.onGesture('drag', ionic.proxy(this._onDrag, this), this.el);\n      ionic.onGesture('release', ionic.proxy(this._onEndDrag, this), this.el);\n    },\n    _onDrag: function(e) {\n      this.onDrag && this.onDrag(e);\n    },\n    _onEndDrag: function(e) {\n      this.onEndDrag && this.onEndDrag(e);\n    },\n    disableAnimation: function() {\n      this.el.classList.remove(this.animationClass);\n    },\n    enableAnimation: function() {\n      this.el.classList.add(this.animationClass);\n    },\n    getTranslateX: function() {\n      return parseFloat(this.el.style[ionic.CSS.TRANSFORM].replace('translate3d(', '').split(',')[0]);\n    },\n    setTranslateX: ionic.animationFrameThrottle(function(x) {\n      this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(' + x + 'px, 0, 0)';\n    })\n  });\n\n})(ionic);\n\n/*\n * Adapted from Swipe.js 2.0\n *\n * Brad Birdsall\n * Copyright 2013, MIT License\n *\n*/\n\n(function(ionic) {\n'use strict';\n\nionic.views.Slider = ionic.views.View.inherit({\n  initialize: function (options) {\n    var slider = this;\n\n    // utilities\n    var noop = function() {}; // simple no operation function\n    var offloadFn = function(fn) { setTimeout(fn || noop, 0); }; // offload a functions execution\n\n    // check browser capabilities\n    var browser = {\n      addEventListener: !!window.addEventListener,\n      touch: ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,\n      transitions: (function(temp) {\n        var props = ['transitionProperty', 'WebkitTransition', 'MozTransition', 'OTransition', 'msTransition'];\n        for ( var i in props ) if (temp.style[ props[i] ] !== undefined) return true;\n        return false;\n      })(document.createElement('swipe'))\n    };\n\n\n    var container = options.el;\n\n    // quit if no root element\n    if (!container) return;\n    var element = container.children[0];\n    var slides, slidePos, width, length;\n    options = options || {};\n    var index = parseInt(options.startSlide, 10) || 0;\n    var speed = options.speed || 300;\n    options.continuous = options.continuous !== undefined ? options.continuous : true;\n\n    function setup() {\n\n      // do not setup if the container has no width\n      if (!container.offsetWidth) {\n        return;\n      }\n\n      // cache slides\n      slides = element.children;\n      length = slides.length;\n\n      // set continuous to false if only one slide\n      if (slides.length < 2) options.continuous = false;\n\n      //special case if two slides\n      if (browser.transitions && options.continuous && slides.length < 3) {\n        element.appendChild(slides[0].cloneNode(true));\n        element.appendChild(element.children[1].cloneNode(true));\n        slides = element.children;\n      }\n\n      // create an array to store current positions of each slide\n      slidePos = new Array(slides.length);\n\n      // determine width of each slide\n      width = container.offsetWidth || container.getBoundingClientRect().width;\n\n      element.style.width = (slides.length * width) + 'px';\n\n      // stack elements\n      var pos = slides.length;\n      while(pos--) {\n\n        var slide = slides[pos];\n\n        slide.style.width = width + 'px';\n        slide.setAttribute('data-index', pos);\n\n        if (browser.transitions) {\n          slide.style.left = (pos * -width) + 'px';\n          move(pos, index > pos ? -width : (index < pos ? width : 0), 0);\n        }\n\n      }\n\n      // reposition elements before and after index\n      if (options.continuous && browser.transitions) {\n        move(circle(index - 1), -width, 0);\n        move(circle(index + 1), width, 0);\n      }\n\n      if (!browser.transitions) element.style.left = (index * -width) + 'px';\n\n      container.style.visibility = 'visible';\n\n      options.slidesChanged && options.slidesChanged();\n    }\n\n    function prev(slideSpeed) {\n\n      if (options.continuous) slide(index - 1, slideSpeed);\n      else if (index) slide(index - 1, slideSpeed);\n\n    }\n\n    function next(slideSpeed) {\n\n      if (options.continuous) slide(index + 1, slideSpeed);\n      else if (index < slides.length - 1) slide(index + 1, slideSpeed);\n\n    }\n\n    function circle(index) {\n\n      // a simple positive modulo using slides.length\n      return (slides.length + (index % slides.length)) % slides.length;\n\n    }\n\n    function slide(to, slideSpeed) {\n\n      // do nothing if already on requested slide\n      if (index == to) return;\n\n      if (browser.transitions) {\n\n        var direction = Math.abs(index - to) / (index - to); // 1: backward, -1: forward\n\n        // get the actual position of the slide\n        if (options.continuous) {\n          var naturalDirection = direction;\n          direction = -slidePos[circle(to)] / width;\n\n          // if going forward but to < index, use to = slides.length + to\n          // if going backward but to > index, use to = -slides.length + to\n          if (direction !== naturalDirection) to = -direction * slides.length + to;\n\n        }\n\n        var diff = Math.abs(index - to) - 1;\n\n        // move all the slides between index and to in the right direction\n        while (diff--) move( circle((to > index ? to : index) - diff - 1), width * direction, 0);\n\n        to = circle(to);\n\n        move(index, width * direction, slideSpeed || speed);\n        move(to, 0, slideSpeed || speed);\n\n        if (options.continuous) move(circle(to - direction), -(width * direction), 0); // we need to get the next in place\n\n      } else {\n\n        to = circle(to);\n        animate(index * -width, to * -width, slideSpeed || speed);\n        //no fallback for a circular continuous if the browser does not accept transitions\n      }\n\n      index = to;\n      offloadFn(options.callback && options.callback(index, slides[index]));\n    }\n\n    function move(index, dist, speed) {\n\n      translate(index, dist, speed);\n      slidePos[index] = dist;\n\n    }\n\n    function translate(index, dist, speed) {\n\n      var slide = slides[index];\n      var style = slide && slide.style;\n\n      if (!style) return;\n\n      style.webkitTransitionDuration =\n      style.MozTransitionDuration =\n      style.msTransitionDuration =\n      style.OTransitionDuration =\n      style.transitionDuration = speed + 'ms';\n\n      style.webkitTransform = 'translate(' + dist + 'px,0)' + 'translateZ(0)';\n      style.msTransform =\n      style.MozTransform =\n      style.OTransform = 'translateX(' + dist + 'px)';\n\n    }\n\n    function animate(from, to, speed) {\n\n      // if not an animation, just reposition\n      if (!speed) {\n\n        element.style.left = to + 'px';\n        return;\n\n      }\n\n      var start = +new Date();\n\n      var timer = setInterval(function() {\n\n        var timeElap = +new Date() - start;\n\n        if (timeElap > speed) {\n\n          element.style.left = to + 'px';\n\n          if (delay) begin();\n\n          options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);\n\n          clearInterval(timer);\n          return;\n\n        }\n\n        element.style.left = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';\n\n      }, 4);\n\n    }\n\n    // setup auto slideshow\n    var delay = options.auto || 0;\n    var interval;\n\n    function begin() {\n\n      interval = setTimeout(next, delay);\n\n    }\n\n    function stop() {\n\n      delay = options.auto || 0;\n      clearTimeout(interval);\n\n    }\n\n\n    // setup initial vars\n    var start = {};\n    var delta = {};\n    var isScrolling;\n\n    // setup event capturing\n    var events = {\n\n      handleEvent: function(event) {\n        if(event.type == 'mousedown' || event.type == 'mouseup' || event.type == 'mousemove') {\n          event.touches = [{\n            pageX: event.pageX,\n            pageY: event.pageY\n          }];\n        }\n\n        switch (event.type) {\n          case 'mousedown': this.start(event); break;\n          case 'touchstart': this.start(event); break;\n          case 'touchmove': this.touchmove(event); break;\n          case 'mousemove': this.touchmove(event); break;\n          case 'touchend': offloadFn(this.end(event)); break;\n          case 'mouseup': offloadFn(this.end(event)); break;\n          case 'webkitTransitionEnd':\n          case 'msTransitionEnd':\n          case 'oTransitionEnd':\n          case 'otransitionend':\n          case 'transitionend': offloadFn(this.transitionEnd(event)); break;\n          case 'resize': offloadFn(setup); break;\n        }\n\n        if (options.stopPropagation) event.stopPropagation();\n\n      },\n      start: function(event) {\n\n        var touches = event.touches[0];\n\n        // measure start values\n        start = {\n\n          // get initial touch coords\n          x: touches.pageX,\n          y: touches.pageY,\n\n          // store time to determine touch duration\n          time: +new Date()\n\n        };\n\n        // used for testing first move event\n        isScrolling = undefined;\n\n        // reset delta and end measurements\n        delta = {};\n\n        // attach touchmove and touchend listeners\n        if(browser.touch) {\n          element.addEventListener('touchmove', this, false);\n          element.addEventListener('touchend', this, false);\n        } else {\n          element.addEventListener('mousemove', this, false);\n          element.addEventListener('mouseup', this, false);\n          document.addEventListener('mouseup', this, false);\n        }\n      },\n      touchmove: function(event) {\n\n        // ensure swiping with one touch and not pinching\n        // ensure sliding is enabled\n        if (event.touches.length > 1 ||\n            event.scale && event.scale !== 1 ||\n            slider.slideIsDisabled) {\n          return;\n        }\n\n        if (options.disableScroll) event.preventDefault();\n\n        var touches = event.touches[0];\n\n        // measure change in x and y\n        delta = {\n          x: touches.pageX - start.x,\n          y: touches.pageY - start.y\n        };\n\n        // determine if scrolling test has run - one time test\n        if ( typeof isScrolling == 'undefined') {\n          isScrolling = !!( isScrolling || Math.abs(delta.x) < Math.abs(delta.y) );\n        }\n\n        // if user is not trying to scroll vertically\n        if (!isScrolling) {\n\n          // prevent native scrolling\n          event.preventDefault();\n\n          // stop slideshow\n          stop();\n\n          // increase resistance if first or last slide\n          if (options.continuous) { // we don't add resistance at the end\n\n            translate(circle(index - 1), delta.x + slidePos[circle(index - 1)], 0);\n            translate(index, delta.x + slidePos[index], 0);\n            translate(circle(index + 1), delta.x + slidePos[circle(index + 1)], 0);\n\n          } else {\n\n            delta.x =\n              delta.x /\n                ( (!index && delta.x > 0 ||         // if first slide and sliding left\n                  index == slides.length - 1 &&     // or if last slide and sliding right\n                  delta.x < 0                       // and if sliding at all\n                ) ?\n                ( Math.abs(delta.x) / width + 1 )      // determine resistance level\n                : 1 );                                 // no resistance if false\n\n            // translate 1:1\n            translate(index - 1, delta.x + slidePos[index - 1], 0);\n            translate(index, delta.x + slidePos[index], 0);\n            translate(index + 1, delta.x + slidePos[index + 1], 0);\n          }\n\n          options.onDrag && options.onDrag();\n        }\n\n      },\n      end: function() {\n\n        // measure duration\n        var duration = +new Date() - start.time;\n\n        // determine if slide attempt triggers next/prev slide\n        var isValidSlide =\n              Number(duration) < 250 &&         // if slide duration is less than 250ms\n              Math.abs(delta.x) > 20 ||         // and if slide amt is greater than 20px\n              Math.abs(delta.x) > width / 2;      // or if slide amt is greater than half the width\n\n        // determine if slide attempt is past start and end\n        var isPastBounds = (!index && delta.x > 0) ||      // if first slide and slide amt is greater than 0\n              (index == slides.length - 1 && delta.x < 0); // or if last slide and slide amt is less than 0\n\n        if (options.continuous) isPastBounds = false;\n\n        // determine direction of swipe (true:right, false:left)\n        var direction = delta.x < 0;\n\n        // if not scrolling vertically\n        if (!isScrolling) {\n\n          if (isValidSlide && !isPastBounds) {\n\n            if (direction) {\n\n              if (options.continuous) { // we need to get the next in this direction in place\n\n                move(circle(index - 1), -width, 0);\n                move(circle(index + 2), width, 0);\n\n              } else {\n                move(index - 1, -width, 0);\n              }\n\n              move(index, slidePos[index] - width, speed);\n              move(circle(index + 1), slidePos[circle(index + 1)] - width, speed);\n              index = circle(index + 1);\n\n            } else {\n              if (options.continuous) { // we need to get the next in this direction in place\n\n                move(circle(index + 1), width, 0);\n                move(circle(index - 2), -width, 0);\n\n              } else {\n                move(index + 1, width, 0);\n              }\n\n              move(index, slidePos[index] + width, speed);\n              move(circle(index - 1), slidePos[circle(index - 1)] + width, speed);\n              index = circle(index - 1);\n\n            }\n\n            options.callback && options.callback(index, slides[index]);\n\n          } else {\n\n            if (options.continuous) {\n\n              move(circle(index - 1), -width, speed);\n              move(index, 0, speed);\n              move(circle(index + 1), width, speed);\n\n            } else {\n\n              move(index - 1, -width, speed);\n              move(index, 0, speed);\n              move(index + 1, width, speed);\n            }\n\n          }\n\n        }\n\n        // kill touchmove and touchend event listeners until touchstart called again\n        if(browser.touch) {\n          element.removeEventListener('touchmove', events, false);\n          element.removeEventListener('touchend', events, false);\n        } else {\n          element.removeEventListener('mousemove', events, false);\n          element.removeEventListener('mouseup', events, false);\n          document.removeEventListener('mouseup', events, false);\n        }\n\n        options.onDragEnd && options.onDragEnd();\n      },\n      transitionEnd: function(event) {\n\n        if (parseInt(event.target.getAttribute('data-index'), 10) == index) {\n\n          if (delay) begin();\n\n          options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);\n\n        }\n\n      }\n\n    };\n\n    // Public API\n    this.update = function() {\n      setTimeout(setup);\n    };\n    this.setup = function() {\n      setup();\n    };\n\n    this.loop = function(value) {\n      if (arguments.length) options.continuous = !!value;\n      return options.continuous;\n    };\n\n    this.enableSlide = function(shouldEnable) {\n      if (arguments.length) {\n        this.slideIsDisabled = !shouldEnable;\n      }\n      return !this.slideIsDisabled;\n    };\n\n    this.slide = this.select = function(to, speed) {\n      // cancel slideshow\n      stop();\n\n      slide(to, speed);\n    };\n\n    this.prev = this.previous = function() {\n      // cancel slideshow\n      stop();\n\n      prev();\n    };\n\n    this.next = function() {\n      // cancel slideshow\n      stop();\n\n      next();\n    };\n\n    this.stop = function() {\n      // cancel slideshow\n      stop();\n    };\n\n    this.start = function() {\n      begin();\n    };\n\n    this.autoPlay = function(newDelay) {\n      if (!delay || delay < 0) {\n        stop();\n      } else {\n        delay = newDelay;\n        begin();\n      }\n    };\n\n    this.currentIndex = this.selected = function() {\n      // return current index position\n      return index;\n    };\n\n    this.slidesCount = this.count = function() {\n      // return total number of slides\n      return length;\n    };\n\n    this.kill = function() {\n      // cancel slideshow\n      stop();\n\n      // reset element\n      element.style.width = '';\n      element.style.left = '';\n\n      // reset slides so no refs are held on to\n      slides && (slides = []);\n\n      // removed event listeners\n      if (browser.addEventListener) {\n\n        // remove current event listeners\n        element.removeEventListener('touchstart', events, false);\n        element.removeEventListener('webkitTransitionEnd', events, false);\n        element.removeEventListener('msTransitionEnd', events, false);\n        element.removeEventListener('oTransitionEnd', events, false);\n        element.removeEventListener('otransitionend', events, false);\n        element.removeEventListener('transitionend', events, false);\n        window.removeEventListener('resize', events, false);\n\n      }\n      else {\n\n        window.onresize = null;\n\n      }\n    };\n\n    this.load = function() {\n      // trigger setup\n      setup();\n\n      // start auto slideshow if applicable\n      if (delay) begin();\n\n\n      // add event listeners\n      if (browser.addEventListener) {\n\n        // set touchstart event on element\n        if (browser.touch) {\n          element.addEventListener('touchstart', events, false);\n        } else {\n          element.addEventListener('mousedown', events, false);\n        }\n\n        if (browser.transitions) {\n          element.addEventListener('webkitTransitionEnd', events, false);\n          element.addEventListener('msTransitionEnd', events, false);\n          element.addEventListener('oTransitionEnd', events, false);\n          element.addEventListener('otransitionend', events, false);\n          element.addEventListener('transitionend', events, false);\n        }\n\n        // set resize event on window\n        window.addEventListener('resize', events, false);\n\n      } else {\n\n        window.onresize = function () { setup(); }; // to play nice with old IE\n\n      }\n    };\n\n  }\n});\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  ionic.views.Toggle = ionic.views.View.inherit({\n    initialize: function(opts) {\n      var self = this;\n\n      this.el = opts.el;\n      this.checkbox = opts.checkbox;\n      this.track = opts.track;\n      this.handle = opts.handle;\n      this.openPercent = -1;\n      this.onChange = opts.onChange || function() {};\n\n      this.triggerThreshold = opts.triggerThreshold || 20;\n\n      this.dragStartHandler = function(e) {\n        self.dragStart(e);\n      };\n      this.dragHandler = function(e) {\n        self.drag(e);\n      };\n      this.holdHandler = function(e) {\n        self.hold(e);\n      };\n      this.releaseHandler = function(e) {\n        self.release(e);\n      };\n\n      this.dragStartGesture = ionic.onGesture('dragstart', this.dragStartHandler, this.el);\n      this.dragGesture = ionic.onGesture('drag', this.dragHandler, this.el);\n      this.dragHoldGesture = ionic.onGesture('hold', this.holdHandler, this.el);\n      this.dragReleaseGesture = ionic.onGesture('release', this.releaseHandler, this.el);\n    },\n\n    destroy: function() {\n      ionic.offGesture(this.dragStartGesture, 'dragstart', this.dragStartGesture);\n      ionic.offGesture(this.dragGesture, 'drag', this.dragGesture);\n      ionic.offGesture(this.dragHoldGesture, 'hold', this.holdHandler);\n      ionic.offGesture(this.dragReleaseGesture, 'release', this.releaseHandler);\n    },\n\n    tap: function() {\n      if(this.el.getAttribute('disabled') !== 'disabled') {\n        this.val( !this.checkbox.checked );\n      }\n    },\n\n    dragStart: function(e) {\n      if(this.checkbox.disabled) return;\n\n      this._dragInfo = {\n        width: this.el.offsetWidth,\n        left: this.el.offsetLeft,\n        right: this.el.offsetLeft + this.el.offsetWidth,\n        triggerX: this.el.offsetWidth / 2,\n        initialState: this.checkbox.checked\n      };\n\n      // Stop any parent dragging\n      e.gesture.srcEvent.preventDefault();\n\n      // Trigger hold styles\n      this.hold(e);\n    },\n\n    drag: function(e) {\n      var self = this;\n      if(!this._dragInfo) { return; }\n\n      // Stop any parent dragging\n      e.gesture.srcEvent.preventDefault();\n\n      ionic.requestAnimationFrame(function () {\n        if (!self._dragInfo) { return; }\n\n        var px = e.gesture.touches[0].pageX - self._dragInfo.left;\n        var mx = self._dragInfo.width - self.triggerThreshold;\n\n        // The initial state was on, so \"tend towards\" on\n        if(self._dragInfo.initialState) {\n          if(px < self.triggerThreshold) {\n            self.setOpenPercent(0);\n          } else if(px > self._dragInfo.triggerX) {\n            self.setOpenPercent(100);\n          }\n        } else {\n          // The initial state was off, so \"tend towards\" off\n          if(px < self._dragInfo.triggerX) {\n            self.setOpenPercent(0);\n          } else if(px > mx) {\n            self.setOpenPercent(100);\n          }\n        }\n      });\n    },\n\n    endDrag: function() {\n      this._dragInfo = null;\n    },\n\n    hold: function() {\n      this.el.classList.add('dragging');\n    },\n    release: function(e) {\n      this.el.classList.remove('dragging');\n      this.endDrag(e);\n    },\n\n\n    setOpenPercent: function(openPercent) {\n      // only make a change if the new open percent has changed\n      if(this.openPercent < 0 || (openPercent < (this.openPercent - 3) || openPercent > (this.openPercent + 3) ) ) {\n        this.openPercent = openPercent;\n\n        if(openPercent === 0) {\n          this.val(false);\n        } else if(openPercent === 100) {\n          this.val(true);\n        } else {\n          var openPixel = Math.round( (openPercent / 100) * this.track.offsetWidth - (this.handle.offsetWidth) );\n          openPixel = (openPixel < 1 ? 0 : openPixel);\n          this.handle.style[ionic.CSS.TRANSFORM] = 'translate3d(' + openPixel + 'px,0,0)';\n        }\n      }\n    },\n\n    val: function(value) {\n      if(value === true || value === false) {\n        if(this.handle.style[ionic.CSS.TRANSFORM] !== \"\") {\n          this.handle.style[ionic.CSS.TRANSFORM] = \"\";\n        }\n        this.checkbox.checked = value;\n        this.openPercent = (value ? 100 : 0);\n        this.onChange && this.onChange();\n      }\n      return this.checkbox.checked;\n    }\n\n  });\n\n})(ionic);\n\n})();\n/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, document, undefined) {'use strict';\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one.  The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n *   error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n  ErrorConstructor = ErrorConstructor || Error;\n  return function() {\n    var code = arguments[0],\n      prefix = '[' + (module ? module + ':' : '') + code + '] ',\n      template = arguments[1],\n      templateArgs = arguments,\n\n      message, i;\n\n    message = prefix + template.replace(/\\{\\d+\\}/g, function(match) {\n      var index = +match.slice(1, -1), arg;\n\n      if (index + 2 < templateArgs.length) {\n        return toDebugString(templateArgs[index + 2]);\n      }\n      return match;\n    });\n\n    message = message + '\\nhttp://errors.angularjs.org/1.3.13/' +\n      (module ? module + '/' : '') + code;\n    for (i = 2; i < arguments.length; i++) {\n      message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +\n        encodeURIComponent(toDebugString(arguments[i]));\n    }\n    return new ErrorConstructor(message);\n  };\n}\n\n/* We need to tell jshint what variables are being exported */\n/* global angular: true,\n  msie: true,\n  jqLite: true,\n  jQuery: true,\n  slice: true,\n  splice: true,\n  push: true,\n  toString: true,\n  ngMinErr: true,\n  angularModule: true,\n  uid: true,\n  REGEX_STRING_REGEXP: true,\n  VALIDITY_STATE_PROPERTY: true,\n\n  lowercase: true,\n  uppercase: true,\n  manualLowercase: true,\n  manualUppercase: true,\n  nodeName_: true,\n  isArrayLike: true,\n  forEach: true,\n  sortedKeys: true,\n  forEachSorted: true,\n  reverseParams: true,\n  nextUid: true,\n  setHashKey: true,\n  extend: true,\n  int: true,\n  inherit: true,\n  noop: true,\n  identity: true,\n  valueFn: true,\n  isUndefined: true,\n  isDefined: true,\n  isObject: true,\n  isString: true,\n  isNumber: true,\n  isDate: true,\n  isArray: true,\n  isFunction: true,\n  isRegExp: true,\n  isWindow: true,\n  isScope: true,\n  isFile: true,\n  isFormData: true,\n  isBlob: true,\n  isBoolean: true,\n  isPromiseLike: true,\n  trim: true,\n  escapeForRegexp: true,\n  isElement: true,\n  makeMap: true,\n  includes: true,\n  arrayRemove: true,\n  copy: true,\n  shallowCopy: true,\n  equals: true,\n  csp: true,\n  concat: true,\n  sliceArgs: true,\n  bind: true,\n  toJsonReplacer: true,\n  toJson: true,\n  fromJson: true,\n  startingTag: true,\n  tryDecodeURIComponent: true,\n  parseKeyValue: true,\n  toKeyValue: true,\n  encodeUriSegment: true,\n  encodeUriQuery: true,\n  angularInit: true,\n  bootstrap: true,\n  getTestability: true,\n  snake_case: true,\n  bindJQuery: true,\n  assertArg: true,\n  assertArgFn: true,\n  assertNotHasOwnProperty: true,\n  getter: true,\n  getBlockNodes: true,\n  hasOwnProperty: true,\n  createMap: true,\n\n  NODE_TYPE_ELEMENT: true,\n  NODE_TYPE_TEXT: true,\n  NODE_TYPE_COMMENT: true,\n  NODE_TYPE_DOCUMENT: true,\n  NODE_TYPE_DOCUMENT_FRAGMENT: true,\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n * <div doc-module-components=\"ng\"></div>\n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\n/**\n * @ngdoc function\n * @name angular.lowercase\n * @module ng\n * @kind function\n *\n * @description Converts the specified string to lowercase.\n * @param {string} string String to be converted to lowercase.\n * @returns {string} Lowercased string.\n */\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * @ngdoc function\n * @name angular.uppercase\n * @module ng\n * @kind function\n *\n * @description Converts the specified string to uppercase.\n * @param {string} string String to be converted to uppercase.\n * @returns {string} Uppercased string.\n */\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar manualLowercase = function(s) {\n  /* jshint bitwise: false */\n  return isString(s)\n      ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n      : s;\n};\nvar manualUppercase = function(s) {\n  /* jshint bitwise: false */\n  return isString(s)\n      ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n      : s;\n};\n\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives.\nif ('i' !== 'I'.toLowerCase()) {\n  lowercase = manualLowercase;\n  uppercase = manualUppercase;\n}\n\n\nvar\n    msie,             // holds major version number for IE, or NaN if UA is not IE.\n    jqLite,           // delay binding since jQuery could be loaded after us.\n    jQuery,           // delay binding\n    slice             = [].slice,\n    splice            = [].splice,\n    push              = [].push,\n    toString          = Object.prototype.toString,\n    ngMinErr          = minErr('ng'),\n\n    /** @name angular */\n    angular           = window.angular || (window.angular = {}),\n    angularModule,\n    uid               = 0;\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n *                   String ...)\n */\nfunction isArrayLike(obj) {\n  if (obj == null || isWindow(obj)) {\n    return false;\n  }\n\n  var length = obj.length;\n\n  if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n    return true;\n  }\n\n  return isString(obj) || isArray(obj) || length === 0 ||\n         typeof length === 'number' && length > 0 && (length - 1) in obj;\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n   ```js\n     var values = {name: 'misko', gender: 'male'};\n     var log = [];\n     angular.forEach(values, function(value, key) {\n       this.push(key + ': ' + value);\n     }, log);\n     expect(log).toEqual(['name: misko', 'gender: male']);\n   ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n  var key, length;\n  if (obj) {\n    if (isFunction(obj)) {\n      for (key in obj) {\n        // Need to check if hasOwnProperty exists,\n        // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n        if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    } else if (isArray(obj) || isArrayLike(obj)) {\n      var isPrimitive = typeof obj !== 'object';\n      for (key = 0, length = obj.length; key < length; key++) {\n        if (isPrimitive || key in obj) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    } else if (obj.forEach && obj.forEach !== forEach) {\n        obj.forEach(iterator, context, obj);\n    } else {\n      for (key in obj) {\n        if (obj.hasOwnProperty(key)) {\n          iterator.call(context, obj[key], key, obj);\n        }\n      }\n    }\n  }\n  return obj;\n}\n\nfunction sortedKeys(obj) {\n  return Object.keys(obj).sort();\n}\n\nfunction forEachSorted(obj, iterator, context) {\n  var keys = sortedKeys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    iterator.call(context, obj[keys[i]], keys[i]);\n  }\n  return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n  return function(value, key) { iteratorFn(key, value); };\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n  return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n  if (h) {\n    obj.$$hashKey = h;\n  } else {\n    delete obj.$$hashKey;\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy).\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n  var h = dst.$$hashKey;\n\n  for (var i = 1, ii = arguments.length; i < ii; i++) {\n    var obj = arguments[i];\n    if (obj) {\n      var keys = Object.keys(obj);\n      for (var j = 0, jj = keys.length; j < jj; j++) {\n        var key = keys[j];\n        dst[key] = obj[key];\n      }\n    }\n  }\n\n  setHashKey(dst, h);\n  return dst;\n}\n\nfunction int(str) {\n  return parseInt(str, 10);\n}\n\n\nfunction inherit(parent, extra) {\n  return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n   ```js\n     function foo(callback) {\n       var result = calculateResult();\n       (callback || angular.noop)(result);\n     }\n   ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n   ```js\n     function transformer(transformationFn, value) {\n       return (transformationFn || angular.identity)(value);\n     };\n   ```\n  * @param {*} value to be returned.\n  * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function() {return value;};}\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n  // http://jsperf.com/isobject4\n  return value !== null && typeof value === 'object';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n  return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n  return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n  return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n  return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n  return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n  return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n  return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n  return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n  return obj && isFunction(obj.then);\n}\n\n\nvar trim = function(value) {\n  return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n  return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n           replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a DOM element (or wrapped jQuery element).\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).\n */\nfunction isElement(node) {\n  return !!(node &&\n    (node.nodeName  // we are a direct element\n    || (node.prop && node.attr && node.find)));  // we have an on and find method part of jQuery API\n}\n\n/**\n * @param str 'key1,key2,...'\n * @returns {object} in the form of {key1:true, key2:true, ...}\n */\nfunction makeMap(str) {\n  var obj = {}, items = str.split(\",\"), i;\n  for (i = 0; i < items.length; i++)\n    obj[items[i]] = true;\n  return obj;\n}\n\n\nfunction nodeName_(element) {\n  return lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\nfunction includes(array, obj) {\n  return Array.prototype.indexOf.call(array, obj) != -1;\n}\n\nfunction arrayRemove(array, value) {\n  var index = array.indexOf(value);\n  if (index >= 0)\n    array.splice(index, 1);\n  return value;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n *   are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to 'destination' an exception will be thrown.\n *\n * @param {*} source The source that will be used to make a copy.\n *                   Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n *     provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n <example module=\"copyExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate class=\"simple-form\">\n Name: <input type=\"text\" ng-model=\"user.name\" /><br />\n E-mail: <input type=\"email\" ng-model=\"user.email\" /><br />\n Gender: <input type=\"radio\" ng-model=\"user.gender\" value=\"male\" />male\n <input type=\"radio\" ng-model=\"user.gender\" value=\"female\" />female<br />\n <button ng-click=\"reset()\">RESET</button>\n <button ng-click=\"update(user)\">SAVE</button>\n </form>\n <pre>form = {{user | json}}</pre>\n <pre>master = {{master | json}}</pre>\n </div>\n\n <script>\n  angular.module('copyExample', [])\n    .controller('ExampleController', ['$scope', function($scope) {\n      $scope.master= {};\n\n      $scope.update = function(user) {\n        // Example with 1 argument\n        $scope.master= angular.copy(user);\n      };\n\n      $scope.reset = function() {\n        // Example with 2 arguments\n        angular.copy($scope.master, $scope.user);\n      };\n\n      $scope.reset();\n    }]);\n </script>\n </file>\n </example>\n */\nfunction copy(source, destination, stackSource, stackDest) {\n  if (isWindow(source) || isScope(source)) {\n    throw ngMinErr('cpws',\n      \"Can't copy! Making copies of Window or Scope instances is not supported.\");\n  }\n\n  if (!destination) {\n    destination = source;\n    if (source) {\n      if (isArray(source)) {\n        destination = copy(source, [], stackSource, stackDest);\n      } else if (isDate(source)) {\n        destination = new Date(source.getTime());\n      } else if (isRegExp(source)) {\n        destination = new RegExp(source.source, source.toString().match(/[^\\/]*$/)[0]);\n        destination.lastIndex = source.lastIndex;\n      } else if (isObject(source)) {\n        var emptyObject = Object.create(Object.getPrototypeOf(source));\n        destination = copy(source, emptyObject, stackSource, stackDest);\n      }\n    }\n  } else {\n    if (source === destination) throw ngMinErr('cpi',\n      \"Can't copy! Source and destination are identical.\");\n\n    stackSource = stackSource || [];\n    stackDest = stackDest || [];\n\n    if (isObject(source)) {\n      var index = stackSource.indexOf(source);\n      if (index !== -1) return stackDest[index];\n\n      stackSource.push(source);\n      stackDest.push(destination);\n    }\n\n    var result;\n    if (isArray(source)) {\n      destination.length = 0;\n      for (var i = 0; i < source.length; i++) {\n        result = copy(source[i], null, stackSource, stackDest);\n        if (isObject(source[i])) {\n          stackSource.push(source[i]);\n          stackDest.push(result);\n        }\n        destination.push(result);\n      }\n    } else {\n      var h = destination.$$hashKey;\n      if (isArray(destination)) {\n        destination.length = 0;\n      } else {\n        forEach(destination, function(value, key) {\n          delete destination[key];\n        });\n      }\n      for (var key in source) {\n        if (source.hasOwnProperty(key)) {\n          result = copy(source[key], null, stackSource, stackDest);\n          if (isObject(source[key])) {\n            stackSource.push(source[key]);\n            stackDest.push(result);\n          }\n          destination[key] = result;\n        }\n      }\n      setHashKey(destination,h);\n    }\n\n  }\n  return destination;\n}\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n  if (isArray(src)) {\n    dst = dst || [];\n\n    for (var i = 0, ii = src.length; i < ii; i++) {\n      dst[i] = src[i];\n    }\n  } else if (isObject(src)) {\n    dst = dst || {};\n\n    for (var key in src) {\n      if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n        dst[key] = src[key];\n      }\n    }\n  }\n\n  return dst || src;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n *   comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n *   /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n *   representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n */\nfunction equals(o1, o2) {\n  if (o1 === o2) return true;\n  if (o1 === null || o2 === null) return false;\n  if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n  var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n  if (t1 == t2) {\n    if (t1 == 'object') {\n      if (isArray(o1)) {\n        if (!isArray(o2)) return false;\n        if ((length = o1.length) == o2.length) {\n          for (key = 0; key < length; key++) {\n            if (!equals(o1[key], o2[key])) return false;\n          }\n          return true;\n        }\n      } else if (isDate(o1)) {\n        if (!isDate(o2)) return false;\n        return equals(o1.getTime(), o2.getTime());\n      } else if (isRegExp(o1) && isRegExp(o2)) {\n        return o1.toString() == o2.toString();\n      } else {\n        if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false;\n        keySet = {};\n        for (key in o1) {\n          if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n          if (!equals(o1[key], o2[key])) return false;\n          keySet[key] = true;\n        }\n        for (key in o2) {\n          if (!keySet.hasOwnProperty(key) &&\n              key.charAt(0) !== '$' &&\n              o2[key] !== undefined &&\n              !isFunction(o2[key])) return false;\n        }\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\nvar csp = function() {\n  if (isDefined(csp.isActive_)) return csp.isActive_;\n\n  var active = !!(document.querySelector('[ng-csp]') ||\n                  document.querySelector('[data-ng-csp]'));\n\n  if (!active) {\n    try {\n      /* jshint -W031, -W054 */\n      new Function('');\n      /* jshint +W031, +W054 */\n    } catch (e) {\n      active = true;\n    }\n  }\n\n  return (csp.isActive_ = active);\n};\n\n\n\nfunction concat(array1, array2, index) {\n  return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n  return slice.call(args, startIndex || 0);\n}\n\n\n/* jshint -W101 */\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n/* jshint +W101 */\nfunction bind(self, fn) {\n  var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n  if (isFunction(fn) && !(fn instanceof RegExp)) {\n    return curryArgs.length\n      ? function() {\n          return arguments.length\n            ? fn.apply(self, concat(curryArgs, arguments, 0))\n            : fn.apply(self, curryArgs);\n        }\n      : function() {\n          return arguments.length\n            ? fn.apply(self, arguments)\n            : fn.call(self);\n        };\n  } else {\n    // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)\n    return fn;\n  }\n}\n\n\nfunction toJsonReplacer(key, value) {\n  var val = value;\n\n  if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n    val = undefined;\n  } else if (isWindow(value)) {\n    val = '$WINDOW';\n  } else if (value &&  document === value) {\n    val = '$DOCUMENT';\n  } else if (isScope(value)) {\n    val = '$SCOPE';\n  }\n\n  return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.\n * @param {boolean|number=} pretty If set to true, the JSON output will contain newlines and whitespace.\n *    If set to an integer, the JSON output will contain that many spaces per indentation (the default is 2).\n * @returns {string|undefined} JSON-ified string representing `obj`.\n */\nfunction toJson(obj, pretty) {\n  if (typeof obj === 'undefined') return undefined;\n  if (!isNumber(pretty)) {\n    pretty = pretty ? 2 : null;\n  }\n  return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n  return isString(json)\n      ? JSON.parse(json)\n      : json;\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n  element = jqLite(element).clone();\n  try {\n    // turns out IE does not let you set .html() on elements which\n    // are not allowed to have children. So we just ignore it.\n    element.empty();\n  } catch (e) {}\n  var elemHtml = jqLite('<div>').append(element).html();\n  try {\n    return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n        elemHtml.\n          match(/^(<[^>]+>)/)[1].\n          replace(/^<([\\w\\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });\n  } catch (e) {\n    return lowercase(elemHtml);\n  }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n  try {\n    return decodeURIComponent(value);\n  } catch (e) {\n    // Ignore any invalid uri component\n  }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.<string,boolean|Array>}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n  var obj = {}, key_value, key;\n  forEach((keyValue || \"\").split('&'), function(keyValue) {\n    if (keyValue) {\n      key_value = keyValue.replace(/\\+/g,'%20').split('=');\n      key = tryDecodeURIComponent(key_value[0]);\n      if (isDefined(key)) {\n        var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;\n        if (!hasOwnProperty.call(obj, key)) {\n          obj[key] = val;\n        } else if (isArray(obj[key])) {\n          obj[key].push(val);\n        } else {\n          obj[key] = [obj[key],val];\n        }\n      }\n    }\n  });\n  return obj;\n}\n\nfunction toKeyValue(obj) {\n  var parts = [];\n  forEach(obj, function(value, key) {\n    if (isArray(value)) {\n      forEach(value, function(arrayValue) {\n        parts.push(encodeUriQuery(key, true) +\n                   (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n      });\n    } else {\n    parts.push(encodeUriQuery(key, true) +\n               (value === true ? '' : '=' + encodeUriQuery(value, true)));\n    }\n  });\n  return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n *    segment       = *pchar\n *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n *    pct-encoded   = \"%\" HEXDIG HEXDIG\n *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n  return encodeUriQuery(val, true).\n             replace(/%26/gi, '&').\n             replace(/%3D/gi, '=').\n             replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n *    query       = *( pchar / \"/\" / \"?\" )\n *    pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n *    unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n *    pct-encoded   = \"%\" HEXDIG HEXDIG\n *    sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n *                     / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n  return encodeURIComponent(val).\n             replace(/%40/gi, '@').\n             replace(/%3A/gi, ':').\n             replace(/%24/g, '$').\n             replace(/%2C/gi, ',').\n             replace(/%3B/gi, ';').\n             replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n  var attr, i, ii = ngAttrPrefixes.length;\n  element = jqLite(element);\n  for (i = 0; i < ii; ++i) {\n    attr = ngAttrPrefixes[i] + ngAttr;\n    if (isString(attr = element.attr(attr))) {\n      return attr;\n    }\n  }\n  return null;\n}\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n *   {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n *   created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n *   do not use explicit function annotation (and are thus unsuitable for minification), as described\n *   in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n *   tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `<body>` or `<html>` tags.\n *\n * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application.  This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n <example module=\"ngAppDemo\">\n   <file name=\"index.html\">\n   <div ng-controller=\"ngAppDemoController\">\n     I can add: {{a}} + {{b}} =  {{ a+b }}\n   </div>\n   </file>\n   <file name=\"script.js\">\n   angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n     $scope.a = 1;\n     $scope.b = 2;\n   });\n   </file>\n </example>\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n <example ng-app-included=\"true\">\n   <file name=\"index.html\">\n   <div ng-app=\"ngAppStrictDemo\" ng-strict-di>\n       <div ng-controller=\"GoodController1\">\n           I can add: {{a}} + {{b}} =  {{ a+b }}\n\n           <p>This renders because the controller does not fail to\n              instantiate, by using explicit annotation style (see\n              script.js for details)\n           </p>\n       </div>\n\n       <div ng-controller=\"GoodController2\">\n           Name: <input ng-model=\"name\"><br />\n           Hello, {{name}}!\n\n           <p>This renders because the controller does not fail to\n              instantiate, by using explicit annotation style\n              (see script.js for details)\n           </p>\n       </div>\n\n       <div ng-controller=\"BadController\">\n           I can add: {{a}} + {{b}} =  {{ a+b }}\n\n           <p>The controller could not be instantiated, due to relying\n              on automatic function annotations (which are disabled in\n              strict mode). As such, the content of this section is not\n              interpolated, and there should be an error in your web console.\n           </p>\n       </div>\n   </div>\n   </file>\n   <file name=\"script.js\">\n   angular.module('ngAppStrictDemo', [])\n     // BadController will fail to instantiate, due to relying on automatic function annotation,\n     // rather than an explicit annotation\n     .controller('BadController', function($scope) {\n       $scope.a = 1;\n       $scope.b = 2;\n     })\n     // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n     // due to using explicit annotations using the array style and $inject property, respectively.\n     .controller('GoodController1', ['$scope', function($scope) {\n       $scope.a = 1;\n       $scope.b = 2;\n     }])\n     .controller('GoodController2', GoodController2);\n     function GoodController2($scope) {\n       $scope.name = \"World\";\n     }\n     GoodController2.$inject = ['$scope'];\n   </file>\n   <file name=\"style.css\">\n   div[ng-controller] {\n       margin-bottom: 1em;\n       -webkit-border-radius: 4px;\n       border-radius: 4px;\n       border: 1px solid;\n       padding: .5em;\n   }\n   div[ng-controller^=Good] {\n       border-color: #d6e9c6;\n       background-color: #dff0d8;\n       color: #3c763d;\n   }\n   div[ng-controller^=Bad] {\n       border-color: #ebccd1;\n       background-color: #f2dede;\n       color: #a94442;\n       margin-bottom: 0;\n   }\n   </file>\n </example>\n */\nfunction angularInit(element, bootstrap) {\n  var appElement,\n      module,\n      config = {};\n\n  // The element `element` has priority over any other element\n  forEach(ngAttrPrefixes, function(prefix) {\n    var name = prefix + 'app';\n\n    if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n      appElement = element;\n      module = element.getAttribute(name);\n    }\n  });\n  forEach(ngAttrPrefixes, function(prefix) {\n    var name = prefix + 'app';\n    var candidate;\n\n    if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n      appElement = candidate;\n      module = candidate.getAttribute(name);\n    }\n  });\n  if (appElement) {\n    config.strictDi = getNgAttribute(appElement, \"strict-di\") !== null;\n    bootstrap(appElement, module ? [module] : [], config);\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * See: {@link guide/bootstrap Bootstrap}\n *\n * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n * ```html\n * <!doctype html>\n * <html>\n * <body>\n * <div ng-controller=\"WelcomeController\">\n *   {{greeting}}\n * </div>\n *\n * <script src=\"angular.js\"></script>\n * <script>\n *   var app = angular.module('demo', [])\n *   .controller('WelcomeController', function($scope) {\n *       $scope.greeting = 'Welcome!';\n *   });\n *   angular.bootstrap(document, ['demo']);\n * </script>\n * </body>\n * </html>\n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.\n *     Each item in the array should be the name of a predefined module or a (DI annotated)\n *     function that will be invoked by the injector as a `config` block.\n *     See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n *     following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n *   assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n  if (!isObject(config)) config = {};\n  var defaultConfig = {\n    strictDi: false\n  };\n  config = extend(defaultConfig, config);\n  var doBootstrap = function() {\n    element = jqLite(element);\n\n    if (element.injector()) {\n      var tag = (element[0] === document) ? 'document' : startingTag(element);\n      //Encode angle brackets to prevent input from being sanitized to empty string #8683\n      throw ngMinErr(\n          'btstrpd',\n          \"App Already Bootstrapped with this Element '{0}'\",\n          tag.replace(/</,'&lt;').replace(/>/,'&gt;'));\n    }\n\n    modules = modules || [];\n    modules.unshift(['$provide', function($provide) {\n      $provide.value('$rootElement', element);\n    }]);\n\n    if (config.debugInfoEnabled) {\n      // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n      modules.push(['$compileProvider', function($compileProvider) {\n        $compileProvider.debugInfoEnabled(true);\n      }]);\n    }\n\n    modules.unshift('ng');\n    var injector = createInjector(modules, config.strictDi);\n    injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n       function bootstrapApply(scope, element, compile, injector) {\n        scope.$apply(function() {\n          element.data('$injector', injector);\n          compile(element)(scope);\n        });\n      }]\n    );\n    return injector;\n  };\n\n  var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n  var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n  if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n    config.debugInfoEnabled = true;\n    window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n  }\n\n  if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n    return doBootstrap();\n  }\n\n  window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n  angular.resumeBootstrap = function(extraModules) {\n    forEach(extraModules, function(module) {\n      modules.push(module);\n    });\n    return doBootstrap();\n  };\n\n  if (isFunction(angular.resumeDeferredBootstrap)) {\n    angular.resumeDeferredBootstrap();\n  }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n  window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n  window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n  var injector = angular.element(rootElement).injector();\n  if (!injector) {\n    throw ngMinErr('test',\n      'no injector found for element argument to getTestability');\n  }\n  return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n  separator = separator || '_';\n  return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n    return (pos ? separator : '') + letter.toLowerCase();\n  });\n}\n\nvar bindJQueryFired = false;\nvar skipDestroyOnNextJQueryCleanData;\nfunction bindJQuery() {\n  var originalCleanData;\n\n  if (bindJQueryFired) {\n    return;\n  }\n\n  // bind to jQuery if present;\n  jQuery = window.jQuery;\n  // Use jQuery if it exists with proper functionality, otherwise default to us.\n  // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n  // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n  // versions. It will not work for sure with jQuery <1.7, though.\n  if (jQuery && jQuery.fn.on) {\n    jqLite = jQuery;\n    extend(jQuery.fn, {\n      scope: JQLitePrototype.scope,\n      isolateScope: JQLitePrototype.isolateScope,\n      controller: JQLitePrototype.controller,\n      injector: JQLitePrototype.injector,\n      inheritedData: JQLitePrototype.inheritedData\n    });\n\n    // All nodes removed from the DOM via various jQuery APIs like .remove()\n    // are passed through jQuery.cleanData. Monkey-patch this method to fire\n    // the $destroy event on all removed nodes.\n    originalCleanData = jQuery.cleanData;\n    jQuery.cleanData = function(elems) {\n      var events;\n      if (!skipDestroyOnNextJQueryCleanData) {\n        for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n          events = jQuery._data(elem, \"events\");\n          if (events && events.$destroy) {\n            jQuery(elem).triggerHandler('$destroy');\n          }\n        }\n      } else {\n        skipDestroyOnNextJQueryCleanData = false;\n      }\n      originalCleanData(elems);\n    };\n  } else {\n    jqLite = JQLite;\n  }\n\n  angular.element = jqLite;\n\n  // Prevent double-proxying.\n  bindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n  if (!arg) {\n    throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n  }\n  return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n  if (acceptArrayAnnotation && isArray(arg)) {\n      arg = arg[arg.length - 1];\n  }\n\n  assertArg(isFunction(arg), name, 'not a function, got ' +\n      (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n  return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param  {String} name    the name to test\n * @param  {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n  if (name === 'hasOwnProperty') {\n    throw ngMinErr('badname', \"hasOwnProperty is not a valid {0} name\", context);\n  }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n  if (!path) return obj;\n  var keys = path.split('.');\n  var key;\n  var lastInstance = obj;\n  var len = keys.length;\n\n  for (var i = 0; i < len; i++) {\n    key = keys[i];\n    if (obj) {\n      obj = (lastInstance = obj)[key];\n    }\n  }\n  if (!bindFnToScope && isFunction(obj)) {\n    return bind(lastInstance, obj);\n  }\n  return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {jqLite} jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n  // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original\n  //             collection, otherwise update the original collection.\n  var node = nodes[0];\n  var endNode = nodes[nodes.length - 1];\n  var blockNodes = [node];\n\n  do {\n    node = node.nextSibling;\n    if (!node) break;\n    blockNodes.push(node);\n  } while (node !== endNode);\n\n  return jqLite(blockNodes);\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n  return Object.create(null);\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n  var $injectorMinErr = minErr('$injector');\n  var ngMinErr = minErr('ng');\n\n  function ensure(obj, name, factory) {\n    return obj[name] || (obj[name] = factory());\n  }\n\n  var angular = ensure(window, 'angular', Object);\n\n  // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n  angular.$$minErr = angular.$$minErr || minErr;\n\n  return ensure(angular, 'module', function() {\n    /** @type {Object.<string, angular.Module>} */\n    var modules = {};\n\n    /**\n     * @ngdoc function\n     * @name angular.module\n     * @module ng\n     * @description\n     *\n     * The `angular.module` is a global place for creating, registering and retrieving Angular\n     * modules.\n     * All modules (angular core or 3rd party) that should be available to an application must be\n     * registered using this mechanism.\n     *\n     * When passed two or more arguments, a new module is created.  If passed only one argument, an\n     * existing module (the name passed as the first argument to `module`) is retrieved.\n     *\n     *\n     * # Module\n     *\n     * A module is a collection of services, directives, controllers, filters, and configuration information.\n     * `angular.module` is used to configure the {@link auto.$injector $injector}.\n     *\n     * ```js\n     * // Create a new module\n     * var myModule = angular.module('myModule', []);\n     *\n     * // register a new service\n     * myModule.value('appName', 'MyCoolApp');\n     *\n     * // configure existing services inside initialization blocks.\n     * myModule.config(['$locationProvider', function($locationProvider) {\n     *   // Configure existing providers\n     *   $locationProvider.hashPrefix('!');\n     * }]);\n     * ```\n     *\n     * Then you can create an injector and load your modules like this:\n     *\n     * ```js\n     * var injector = angular.injector(['ng', 'myModule'])\n     * ```\n     *\n     * However it's more likely that you'll just use\n     * {@link ng.directive:ngApp ngApp} or\n     * {@link angular.bootstrap} to simplify this process for you.\n     *\n     * @param {!string} name The name of the module to create or retrieve.\n     * @param {!Array.<string>=} requires If specified then new module is being created. If\n     *        unspecified then the module is being retrieved for further configuration.\n     * @param {Function=} configFn Optional configuration function for the module. Same as\n     *        {@link angular.Module#config Module#config()}.\n     * @returns {module} new module with the {@link angular.Module} api.\n     */\n    return function module(name, requires, configFn) {\n      var assertNotHasOwnProperty = function(name, context) {\n        if (name === 'hasOwnProperty') {\n          throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n        }\n      };\n\n      assertNotHasOwnProperty(name, 'module');\n      if (requires && modules.hasOwnProperty(name)) {\n        modules[name] = null;\n      }\n      return ensure(modules, name, function() {\n        if (!requires) {\n          throw $injectorMinErr('nomod', \"Module '{0}' is not available! You either misspelled \" +\n             \"the module name or forgot to load it. If registering a module ensure that you \" +\n             \"specify the dependencies as the second argument.\", name);\n        }\n\n        /** @type {!Array.<Array.<*>>} */\n        var invokeQueue = [];\n\n        /** @type {!Array.<Function>} */\n        var configBlocks = [];\n\n        /** @type {!Array.<Function>} */\n        var runBlocks = [];\n\n        var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n        /** @type {angular.Module} */\n        var moduleInstance = {\n          // Private state\n          _invokeQueue: invokeQueue,\n          _configBlocks: configBlocks,\n          _runBlocks: runBlocks,\n\n          /**\n           * @ngdoc property\n           * @name angular.Module#requires\n           * @module ng\n           *\n           * @description\n           * Holds the list of modules which the injector will load before the current module is\n           * loaded.\n           */\n          requires: requires,\n\n          /**\n           * @ngdoc property\n           * @name angular.Module#name\n           * @module ng\n           *\n           * @description\n           * Name of the module.\n           */\n          name: name,\n\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#provider\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} providerType Construction function for creating new instance of the\n           *                                service.\n           * @description\n           * See {@link auto.$provide#provider $provide.provider()}.\n           */\n          provider: invokeLater('$provide', 'provider'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#factory\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} providerFunction Function for creating new instance of the service.\n           * @description\n           * See {@link auto.$provide#factory $provide.factory()}.\n           */\n          factory: invokeLater('$provide', 'factory'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#service\n           * @module ng\n           * @param {string} name service name\n           * @param {Function} constructor A constructor function that will be instantiated.\n           * @description\n           * See {@link auto.$provide#service $provide.service()}.\n           */\n          service: invokeLater('$provide', 'service'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#value\n           * @module ng\n           * @param {string} name service name\n           * @param {*} object Service instance object.\n           * @description\n           * See {@link auto.$provide#value $provide.value()}.\n           */\n          value: invokeLater('$provide', 'value'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#constant\n           * @module ng\n           * @param {string} name constant name\n           * @param {*} object Constant value.\n           * @description\n           * Because the constant are fixed, they get applied before other provide methods.\n           * See {@link auto.$provide#constant $provide.constant()}.\n           */\n          constant: invokeLater('$provide', 'constant', 'unshift'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#animation\n           * @module ng\n           * @param {string} name animation name\n           * @param {Function} animationFactory Factory function for creating new instance of an\n           *                                    animation.\n           * @description\n           *\n           * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n           *\n           *\n           * Defines an animation hook that can be later used with\n           * {@link ngAnimate.$animate $animate} service and directives that use this service.\n           *\n           * ```js\n           * module.animation('.animation-name', function($inject1, $inject2) {\n           *   return {\n           *     eventName : function(element, done) {\n           *       //code to run the animation\n           *       //once complete, then run done()\n           *       return function cancellationFunction(element) {\n           *         //code to cancel the animation\n           *       }\n           *     }\n           *   }\n           * })\n           * ```\n           *\n           * See {@link ng.$animateProvider#register $animateProvider.register()} and\n           * {@link ngAnimate ngAnimate module} for more information.\n           */\n          animation: invokeLater('$animateProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#filter\n           * @module ng\n           * @param {string} name Filter name.\n           * @param {Function} filterFactory Factory function for creating new instance of filter.\n           * @description\n           * See {@link ng.$filterProvider#register $filterProvider.register()}.\n           */\n          filter: invokeLater('$filterProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#controller\n           * @module ng\n           * @param {string|Object} name Controller name, or an object map of controllers where the\n           *    keys are the names and the values are the constructors.\n           * @param {Function} constructor Controller constructor function.\n           * @description\n           * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n           */\n          controller: invokeLater('$controllerProvider', 'register'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#directive\n           * @module ng\n           * @param {string|Object} name Directive name, or an object map of directives where the\n           *    keys are the names and the values are the factories.\n           * @param {Function} directiveFactory Factory function for creating new instance of\n           * directives.\n           * @description\n           * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n           */\n          directive: invokeLater('$compileProvider', 'directive'),\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#config\n           * @module ng\n           * @param {Function} configFn Execute this function on module load. Useful for service\n           *    configuration.\n           * @description\n           * Use this method to register work which needs to be performed on module loading.\n           * For more about how to configure services, see\n           * {@link providers#provider-recipe Provider Recipe}.\n           */\n          config: config,\n\n          /**\n           * @ngdoc method\n           * @name angular.Module#run\n           * @module ng\n           * @param {Function} initializationFn Execute this function after injector creation.\n           *    Useful for application initialization.\n           * @description\n           * Use this method to register work which should be performed when the injector is done\n           * loading all modules.\n           */\n          run: function(block) {\n            runBlocks.push(block);\n            return this;\n          }\n        };\n\n        if (configFn) {\n          config(configFn);\n        }\n\n        return moduleInstance;\n\n        /**\n         * @param {string} provider\n         * @param {string} method\n         * @param {String=} insertMethod\n         * @returns {angular.Module}\n         */\n        function invokeLater(provider, method, insertMethod, queue) {\n          if (!queue) queue = invokeQueue;\n          return function() {\n            queue[insertMethod || 'push']([provider, method, arguments]);\n            return moduleInstance;\n          };\n        }\n      });\n    };\n  });\n\n}\n\n/* global: toDebugString: true */\n\nfunction serializeObject(obj) {\n  var seen = [];\n\n  return JSON.stringify(obj, function(key, val) {\n    val = toJsonReplacer(key, val);\n    if (isObject(val)) {\n\n      if (seen.indexOf(val) >= 0) return '<<already seen>>';\n\n      seen.push(val);\n    }\n    return val;\n  });\n}\n\nfunction toDebugString(obj) {\n  if (typeof obj === 'function') {\n    return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n  } else if (typeof obj === 'undefined') {\n    return 'undefined';\n  } else if (typeof obj !== 'string') {\n    return serializeObject(obj);\n  }\n  return obj;\n}\n\n/* global angularModule: true,\n  version: true,\n\n  $LocaleProvider,\n  $CompileProvider,\n\n  htmlAnchorDirective,\n  inputDirective,\n  inputDirective,\n  formDirective,\n  scriptDirective,\n  selectDirective,\n  styleDirective,\n  optionDirective,\n  ngBindDirective,\n  ngBindHtmlDirective,\n  ngBindTemplateDirective,\n  ngClassDirective,\n  ngClassEvenDirective,\n  ngClassOddDirective,\n  ngCspDirective,\n  ngCloakDirective,\n  ngControllerDirective,\n  ngFormDirective,\n  ngHideDirective,\n  ngIfDirective,\n  ngIncludeDirective,\n  ngIncludeFillContentDirective,\n  ngInitDirective,\n  ngNonBindableDirective,\n  ngPluralizeDirective,\n  ngRepeatDirective,\n  ngShowDirective,\n  ngStyleDirective,\n  ngSwitchDirective,\n  ngSwitchWhenDirective,\n  ngSwitchDefaultDirective,\n  ngOptionsDirective,\n  ngTranscludeDirective,\n  ngModelDirective,\n  ngListDirective,\n  ngChangeDirective,\n  patternDirective,\n  patternDirective,\n  requiredDirective,\n  requiredDirective,\n  minlengthDirective,\n  minlengthDirective,\n  maxlengthDirective,\n  maxlengthDirective,\n  ngValueDirective,\n  ngModelOptionsDirective,\n  ngAttributeAliasDirectives,\n  ngEventDirectives,\n\n  $AnchorScrollProvider,\n  $AnimateProvider,\n  $BrowserProvider,\n  $CacheFactoryProvider,\n  $ControllerProvider,\n  $DocumentProvider,\n  $ExceptionHandlerProvider,\n  $FilterProvider,\n  $InterpolateProvider,\n  $IntervalProvider,\n  $HttpProvider,\n  $HttpBackendProvider,\n  $LocationProvider,\n  $LogProvider,\n  $ParseProvider,\n  $RootScopeProvider,\n  $QProvider,\n  $$QProvider,\n  $$SanitizeUriProvider,\n  $SceProvider,\n  $SceDelegateProvider,\n  $SnifferProvider,\n  $TemplateCacheProvider,\n  $TemplateRequestProvider,\n  $$TestabilityProvider,\n  $TimeoutProvider,\n  $$RAFProvider,\n  $$AsyncCallbackProvider,\n  $WindowProvider,\n  $$jqLiteProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version. This object has the\n * following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n  full: '1.3.13',    // all of these placeholder strings will be replaced by grunt's\n  major: 1,    // package task\n  minor: 3,\n  dot: 13,\n  codeName: 'meticulous-riffleshuffle'\n};\n\n\nfunction publishExternalAPI(angular) {\n  extend(angular, {\n    'bootstrap': bootstrap,\n    'copy': copy,\n    'extend': extend,\n    'equals': equals,\n    'element': jqLite,\n    'forEach': forEach,\n    'injector': createInjector,\n    'noop': noop,\n    'bind': bind,\n    'toJson': toJson,\n    'fromJson': fromJson,\n    'identity': identity,\n    'isUndefined': isUndefined,\n    'isDefined': isDefined,\n    'isString': isString,\n    'isFunction': isFunction,\n    'isObject': isObject,\n    'isNumber': isNumber,\n    'isElement': isElement,\n    'isArray': isArray,\n    'version': version,\n    'isDate': isDate,\n    'lowercase': lowercase,\n    'uppercase': uppercase,\n    'callbacks': {counter: 0},\n    'getTestability': getTestability,\n    '$$minErr': minErr,\n    '$$csp': csp,\n    'reloadWithDebugInfo': reloadWithDebugInfo\n  });\n\n  angularModule = setupModuleLoader(window);\n  try {\n    angularModule('ngLocale');\n  } catch (e) {\n    angularModule('ngLocale', []).provider('$locale', $LocaleProvider);\n  }\n\n  angularModule('ng', ['ngLocale'], ['$provide',\n    function ngModule($provide) {\n      // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n      $provide.provider({\n        $$sanitizeUri: $$SanitizeUriProvider\n      });\n      $provide.provider('$compile', $CompileProvider).\n        directive({\n            a: htmlAnchorDirective,\n            input: inputDirective,\n            textarea: inputDirective,\n            form: formDirective,\n            script: scriptDirective,\n            select: selectDirective,\n            style: styleDirective,\n            option: optionDirective,\n            ngBind: ngBindDirective,\n            ngBindHtml: ngBindHtmlDirective,\n            ngBindTemplate: ngBindTemplateDirective,\n            ngClass: ngClassDirective,\n            ngClassEven: ngClassEvenDirective,\n            ngClassOdd: ngClassOddDirective,\n            ngCloak: ngCloakDirective,\n            ngController: ngControllerDirective,\n            ngForm: ngFormDirective,\n            ngHide: ngHideDirective,\n            ngIf: ngIfDirective,\n            ngInclude: ngIncludeDirective,\n            ngInit: ngInitDirective,\n            ngNonBindable: ngNonBindableDirective,\n            ngPluralize: ngPluralizeDirective,\n            ngRepeat: ngRepeatDirective,\n            ngShow: ngShowDirective,\n            ngStyle: ngStyleDirective,\n            ngSwitch: ngSwitchDirective,\n            ngSwitchWhen: ngSwitchWhenDirective,\n            ngSwitchDefault: ngSwitchDefaultDirective,\n            ngOptions: ngOptionsDirective,\n            ngTransclude: ngTranscludeDirective,\n            ngModel: ngModelDirective,\n            ngList: ngListDirective,\n            ngChange: ngChangeDirective,\n            pattern: patternDirective,\n            ngPattern: patternDirective,\n            required: requiredDirective,\n            ngRequired: requiredDirective,\n            minlength: minlengthDirective,\n            ngMinlength: minlengthDirective,\n            maxlength: maxlengthDirective,\n            ngMaxlength: maxlengthDirective,\n            ngValue: ngValueDirective,\n            ngModelOptions: ngModelOptionsDirective\n        }).\n        directive({\n          ngInclude: ngIncludeFillContentDirective\n        }).\n        directive(ngAttributeAliasDirectives).\n        directive(ngEventDirectives);\n      $provide.provider({\n        $anchorScroll: $AnchorScrollProvider,\n        $animate: $AnimateProvider,\n        $browser: $BrowserProvider,\n        $cacheFactory: $CacheFactoryProvider,\n        $controller: $ControllerProvider,\n        $document: $DocumentProvider,\n        $exceptionHandler: $ExceptionHandlerProvider,\n        $filter: $FilterProvider,\n        $interpolate: $InterpolateProvider,\n        $interval: $IntervalProvider,\n        $http: $HttpProvider,\n        $httpBackend: $HttpBackendProvider,\n        $location: $LocationProvider,\n        $log: $LogProvider,\n        $parse: $ParseProvider,\n        $rootScope: $RootScopeProvider,\n        $q: $QProvider,\n        $$q: $$QProvider,\n        $sce: $SceProvider,\n        $sceDelegate: $SceDelegateProvider,\n        $sniffer: $SnifferProvider,\n        $templateCache: $TemplateCacheProvider,\n        $templateRequest: $TemplateRequestProvider,\n        $$testability: $$TestabilityProvider,\n        $timeout: $TimeoutProvider,\n        $window: $WindowProvider,\n        $$rAF: $$RAFProvider,\n        $$asyncCallback: $$AsyncCallbackProvider,\n        $$jqLite: $$jqLiteProvider\n      });\n    }\n  ]);\n}\n\n/* global JQLitePrototype: true,\n  addEventListenerFn: true,\n  removeEventListenerFn: true,\n  BOOLEAN_ATTR: true,\n  ALIASED_ATTR: true,\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to Angular's built-in subset of jQuery, called \"jQuery lite\" or \"jqLite.\"\n *\n * <div class=\"alert alert-success\">jqLite is a tiny, API-compatible subset of jQuery that allows\n * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most\n * commonly needed functionality with the goal of having a very small footprint.</div>\n *\n * To use jQuery, simply load it before `DOMContentLoaded` event fired.\n *\n * <div class=\"alert\">**Note:** all element references in Angular are always wrapped with jQuery or\n * jqLite; they are never raw DOM references.</div>\n *\n * ## Angular's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/)\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/)\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/)\n * - [`removeClass()`](http://api.jquery.com/removeClass/)\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/)\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.\n * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * ## jQuery/jqLite Extras\n * Angular also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n *    on all DOM nodes being removed.  This can be used to clean up any 3rd party bindings to the DOM\n *    element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n *   retrieves controller associated with the `ngController` directive. If `name` is provided as\n *   camelCase directive name, then the controller for this directive will be retrieved (e.g.\n *   `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n *   element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n *   be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n *   current element. This getter should be used only on elements that contain a directive which starts a new isolate\n *   scope. Calling `scope()` on this element always returns the original non-isolate scope.\n *   Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n *   parent element is reached.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n    jqId = 1,\n    addEventListenerFn = function(element, type, fn) {\n      element.addEventListener(type, fn, false);\n    },\n    removeEventListenerFn = function(element, type, fn) {\n      element.removeEventListener(type, fn, false);\n    };\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n  //jQuery always returns an object on cache miss\n  return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\nvar MOUSE_EVENT_MAP= { mouseleave: \"mouseout\", mouseenter: \"mouseover\"};\nvar jqLiteMinErr = minErr('jqLite');\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 */\nfunction camelCase(name) {\n  return name.\n    replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n      return offset ? letter.toUpperCase() : letter;\n    }).\n    replace(MOZ_HACK_REGEXP, 'Moz$1');\n}\n\nvar SINGLE_TAG_REGEXP = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi;\n\nvar wrapMap = {\n  'option': [1, '<select multiple=\"multiple\">', '</select>'],\n\n  'thead': [1, '<table>', '</table>'],\n  'col': [2, '<table><colgroup>', '</colgroup></table>'],\n  'tr': [2, '<table><tbody>', '</tbody></table>'],\n  'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],\n  '_default': [0, \"\", \"\"]\n};\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction jqLiteIsTextNode(html) {\n  return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n  // The window object can accept data but has no nodeType\n  // Otherwise we are only interested in elements (1) and documents (9)\n  var nodeType = node.nodeType;\n  return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteBuildFragment(html, context) {\n  var tmp, tag, wrap,\n      fragment = context.createDocumentFragment(),\n      nodes = [], i;\n\n  if (jqLiteIsTextNode(html)) {\n    // Convert non-html into a text node\n    nodes.push(context.createTextNode(html));\n  } else {\n    // Convert html into DOM nodes\n    tmp = tmp || fragment.appendChild(context.createElement(\"div\"));\n    tag = (TAG_NAME_REGEXP.exec(html) || [\"\", \"\"])[1].toLowerCase();\n    wrap = wrapMap[tag] || wrapMap._default;\n    tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, \"<$1></$2>\") + wrap[2];\n\n    // Descend through wrappers to the right content\n    i = wrap[0];\n    while (i--) {\n      tmp = tmp.lastChild;\n    }\n\n    nodes = concat(nodes, tmp.childNodes);\n\n    tmp = fragment.firstChild;\n    tmp.textContent = \"\";\n  }\n\n  // Remove wrapper from fragment\n  fragment.textContent = \"\";\n  fragment.innerHTML = \"\"; // Clear inner HTML\n  forEach(nodes, function(node) {\n    fragment.appendChild(node);\n  });\n\n  return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n  context = context || document;\n  var parsed;\n\n  if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n    return [context.createElement(parsed[1])];\n  }\n\n  if ((parsed = jqLiteBuildFragment(html, context))) {\n    return parsed.childNodes;\n  }\n\n  return [];\n}\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n  if (element instanceof JQLite) {\n    return element;\n  }\n\n  var argIsString;\n\n  if (isString(element)) {\n    element = trim(element);\n    argIsString = true;\n  }\n  if (!(this instanceof JQLite)) {\n    if (argIsString && element.charAt(0) != '<') {\n      throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n    }\n    return new JQLite(element);\n  }\n\n  if (argIsString) {\n    jqLiteAddNodes(this, jqLiteParseHTML(element));\n  } else {\n    jqLiteAddNodes(this, element);\n  }\n}\n\nfunction jqLiteClone(element) {\n  return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n  if (!onlyDescendants) jqLiteRemoveData(element);\n\n  if (element.querySelectorAll) {\n    var descendants = element.querySelectorAll('*');\n    for (var i = 0, l = descendants.length; i < l; i++) {\n      jqLiteRemoveData(descendants[i]);\n    }\n  }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n  if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n  var expandoStore = jqLiteExpandoStore(element);\n  var events = expandoStore && expandoStore.events;\n  var handle = expandoStore && expandoStore.handle;\n\n  if (!handle) return; //no listeners registered\n\n  if (!type) {\n    for (type in events) {\n      if (type !== '$destroy') {\n        removeEventListenerFn(element, type, handle);\n      }\n      delete events[type];\n    }\n  } else {\n    forEach(type.split(' '), function(type) {\n      if (isDefined(fn)) {\n        var listenerFns = events[type];\n        arrayRemove(listenerFns || [], fn);\n        if (listenerFns && listenerFns.length > 0) {\n          return;\n        }\n      }\n\n      removeEventListenerFn(element, type, handle);\n      delete events[type];\n    });\n  }\n}\n\nfunction jqLiteRemoveData(element, name) {\n  var expandoId = element.ng339;\n  var expandoStore = expandoId && jqCache[expandoId];\n\n  if (expandoStore) {\n    if (name) {\n      delete expandoStore.data[name];\n      return;\n    }\n\n    if (expandoStore.handle) {\n      if (expandoStore.events.$destroy) {\n        expandoStore.handle({}, '$destroy');\n      }\n      jqLiteOff(element);\n    }\n    delete jqCache[expandoId];\n    element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n  }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n  var expandoId = element.ng339,\n      expandoStore = expandoId && jqCache[expandoId];\n\n  if (createIfNecessary && !expandoStore) {\n    element.ng339 = expandoId = jqNextId();\n    expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n  }\n\n  return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n  if (jqLiteAcceptsData(element)) {\n\n    var isSimpleSetter = isDefined(value);\n    var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n    var massGetter = !key;\n    var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n    var data = expandoStore && expandoStore.data;\n\n    if (isSimpleSetter) { // data('key', value)\n      data[key] = value;\n    } else {\n      if (massGetter) {  // data()\n        return data;\n      } else {\n        if (isSimpleGetter) { // data('key')\n          // don't force creation of expandoStore if it doesn't exist yet\n          return data && data[key];\n        } else { // mass-setter: data({key1: val1, key2: val2})\n          extend(data, key);\n        }\n      }\n    }\n  }\n}\n\nfunction jqLiteHasClass(element, selector) {\n  if (!element.getAttribute) return false;\n  return ((\" \" + (element.getAttribute('class') || '') + \" \").replace(/[\\n\\t]/g, \" \").\n      indexOf(\" \" + selector + \" \") > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n  if (cssClasses && element.setAttribute) {\n    forEach(cssClasses.split(' '), function(cssClass) {\n      element.setAttribute('class', trim(\n          (\" \" + (element.getAttribute('class') || '') + \" \")\n          .replace(/[\\n\\t]/g, \" \")\n          .replace(\" \" + trim(cssClass) + \" \", \" \"))\n      );\n    });\n  }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n  if (cssClasses && element.setAttribute) {\n    var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n                            .replace(/[\\n\\t]/g, \" \");\n\n    forEach(cssClasses.split(' '), function(cssClass) {\n      cssClass = trim(cssClass);\n      if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n        existingClasses += cssClass + ' ';\n      }\n    });\n\n    element.setAttribute('class', trim(existingClasses));\n  }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n  // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n  if (elements) {\n\n    // if a Node (the most common case)\n    if (elements.nodeType) {\n      root[root.length++] = elements;\n    } else {\n      var length = elements.length;\n\n      // if an Array or NodeList and not a Window\n      if (typeof length === 'number' && elements.window !== elements) {\n        if (length) {\n          for (var i = 0; i < length; i++) {\n            root[root.length++] = elements[i];\n          }\n        }\n      } else {\n        root[root.length++] = elements;\n      }\n    }\n  }\n}\n\n\nfunction jqLiteController(element, name) {\n  return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n  // if element is the document object work with the html element instead\n  // this makes $(document).scope() possible\n  if (element.nodeType == NODE_TYPE_DOCUMENT) {\n    element = element.documentElement;\n  }\n  var names = isArray(name) ? name : [name];\n\n  while (element) {\n    for (var i = 0, ii = names.length; i < ii; i++) {\n      if ((value = jqLite.data(element, names[i])) !== undefined) return value;\n    }\n\n    // If dealing with a document fragment node with a host element, and no parent, use the host\n    // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n    // to lookup parent controllers.\n    element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n  }\n}\n\nfunction jqLiteEmpty(element) {\n  jqLiteDealoc(element, true);\n  while (element.firstChild) {\n    element.removeChild(element.firstChild);\n  }\n}\n\nfunction jqLiteRemove(element, keepData) {\n  if (!keepData) jqLiteDealoc(element);\n  var parent = element.parentNode;\n  if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n  win = win || window;\n  if (win.document.readyState === 'complete') {\n    // Force the action to be run async for consistent behaviour\n    // from the action's point of view\n    // i.e. it will definitely not be in a $apply\n    win.setTimeout(action);\n  } else {\n    // No need to unbind this handler as load is only ever called once\n    jqLite(win).on('load', action);\n  }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n  ready: function(fn) {\n    var fired = false;\n\n    function trigger() {\n      if (fired) return;\n      fired = true;\n      fn();\n    }\n\n    // check if document is already loaded\n    if (document.readyState === 'complete') {\n      setTimeout(trigger);\n    } else {\n      this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9\n      // we can not use jqLite since we are not done loading and jQuery could be loaded later.\n      // jshint -W064\n      JQLite(window).on('load', trigger); // fallback to window.onload for others\n      // jshint +W064\n    }\n  },\n  toString: function() {\n    var value = [];\n    forEach(this, function(e) { value.push('' + e);});\n    return '[' + value.join(', ') + ']';\n  },\n\n  eq: function(index) {\n      return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n  },\n\n  length: 0,\n  push: push,\n  sort: [].sort,\n  splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n  BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n  BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n  'ngMinlength': 'minlength',\n  'ngMaxlength': 'maxlength',\n  'ngMin': 'min',\n  'ngMax': 'max',\n  'ngPattern': 'pattern'\n};\n\nfunction getBooleanAttrName(element, name) {\n  // check dom last since we will most likely fail on name\n  var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n  // booleanAttr is here twice to minimize DOM access\n  return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(element, name) {\n  var nodeName = element.nodeName;\n  return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];\n}\n\nforEach({\n  data: jqLiteData,\n  removeData: jqLiteRemoveData\n}, function(fn, name) {\n  JQLite[name] = fn;\n});\n\nforEach({\n  data: jqLiteData,\n  inheritedData: jqLiteInheritedData,\n\n  scope: function(element) {\n    // Can't use jqLiteData here directly so we stay compatible with jQuery!\n    return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n  },\n\n  isolateScope: function(element) {\n    // Can't use jqLiteData here directly so we stay compatible with jQuery!\n    return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n  },\n\n  controller: jqLiteController,\n\n  injector: function(element) {\n    return jqLiteInheritedData(element, '$injector');\n  },\n\n  removeAttr: function(element, name) {\n    element.removeAttribute(name);\n  },\n\n  hasClass: jqLiteHasClass,\n\n  css: function(element, name, value) {\n    name = camelCase(name);\n\n    if (isDefined(value)) {\n      element.style[name] = value;\n    } else {\n      return element.style[name];\n    }\n  },\n\n  attr: function(element, name, value) {\n    var lowercasedName = lowercase(name);\n    if (BOOLEAN_ATTR[lowercasedName]) {\n      if (isDefined(value)) {\n        if (!!value) {\n          element[name] = true;\n          element.setAttribute(name, lowercasedName);\n        } else {\n          element[name] = false;\n          element.removeAttribute(lowercasedName);\n        }\n      } else {\n        return (element[name] ||\n                 (element.attributes.getNamedItem(name) || noop).specified)\n               ? lowercasedName\n               : undefined;\n      }\n    } else if (isDefined(value)) {\n      element.setAttribute(name, value);\n    } else if (element.getAttribute) {\n      // the extra argument \"2\" is to get the right thing for a.href in IE, see jQuery code\n      // some elements (e.g. Document) don't have get attribute, so return undefined\n      var ret = element.getAttribute(name, 2);\n      // normalize non-existing attributes to undefined (as jQuery)\n      return ret === null ? undefined : ret;\n    }\n  },\n\n  prop: function(element, name, value) {\n    if (isDefined(value)) {\n      element[name] = value;\n    } else {\n      return element[name];\n    }\n  },\n\n  text: (function() {\n    getText.$dv = '';\n    return getText;\n\n    function getText(element, value) {\n      if (isUndefined(value)) {\n        var nodeType = element.nodeType;\n        return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n      }\n      element.textContent = value;\n    }\n  })(),\n\n  val: function(element, value) {\n    if (isUndefined(value)) {\n      if (element.multiple && nodeName_(element) === 'select') {\n        var result = [];\n        forEach(element.options, function(option) {\n          if (option.selected) {\n            result.push(option.value || option.text);\n          }\n        });\n        return result.length === 0 ? null : result;\n      }\n      return element.value;\n    }\n    element.value = value;\n  },\n\n  html: function(element, value) {\n    if (isUndefined(value)) {\n      return element.innerHTML;\n    }\n    jqLiteDealoc(element, true);\n    element.innerHTML = value;\n  },\n\n  empty: jqLiteEmpty\n}, function(fn, name) {\n  /**\n   * Properties: writes return selection, reads return first value\n   */\n  JQLite.prototype[name] = function(arg1, arg2) {\n    var i, key;\n    var nodeCount = this.length;\n\n    // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n    // in a way that survives minification.\n    // jqLiteEmpty takes no arguments but is a setter.\n    if (fn !== jqLiteEmpty &&\n        (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) {\n      if (isObject(arg1)) {\n\n        // we are a write, but the object properties are the key/values\n        for (i = 0; i < nodeCount; i++) {\n          if (fn === jqLiteData) {\n            // data() takes the whole object in jQuery\n            fn(this[i], arg1);\n          } else {\n            for (key in arg1) {\n              fn(this[i], key, arg1[key]);\n            }\n          }\n        }\n        // return self for chaining\n        return this;\n      } else {\n        // we are a read, so read the first child.\n        // TODO: do we still need this?\n        var value = fn.$dv;\n        // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n        var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount;\n        for (var j = 0; j < jj; j++) {\n          var nodeValue = fn(this[j], arg1, arg2);\n          value = value ? value + nodeValue : nodeValue;\n        }\n        return value;\n      }\n    } else {\n      // we are a write, so apply to all children\n      for (i = 0; i < nodeCount; i++) {\n        fn(this[i], arg1, arg2);\n      }\n      // return self for chaining\n      return this;\n    }\n  };\n});\n\nfunction createEventHandler(element, events) {\n  var eventHandler = function(event, type) {\n    // jQuery specific api\n    event.isDefaultPrevented = function() {\n      return event.defaultPrevented;\n    };\n\n    var eventFns = events[type || event.type];\n    var eventFnsLength = eventFns ? eventFns.length : 0;\n\n    if (!eventFnsLength) return;\n\n    if (isUndefined(event.immediatePropagationStopped)) {\n      var originalStopImmediatePropagation = event.stopImmediatePropagation;\n      event.stopImmediatePropagation = function() {\n        event.immediatePropagationStopped = true;\n\n        if (event.stopPropagation) {\n          event.stopPropagation();\n        }\n\n        if (originalStopImmediatePropagation) {\n          originalStopImmediatePropagation.call(event);\n        }\n      };\n    }\n\n    event.isImmediatePropagationStopped = function() {\n      return event.immediatePropagationStopped === true;\n    };\n\n    // Copy event handlers in case event handlers array is modified during execution.\n    if ((eventFnsLength > 1)) {\n      eventFns = shallowCopy(eventFns);\n    }\n\n    for (var i = 0; i < eventFnsLength; i++) {\n      if (!event.isImmediatePropagationStopped()) {\n        eventFns[i].call(element, event);\n      }\n    }\n  };\n\n  // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n  //       events on `element`\n  eventHandler.elem = element;\n  return eventHandler;\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n  removeData: jqLiteRemoveData,\n\n  on: function jqLiteOn(element, type, fn, unsupported) {\n    if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n    // Do not add event handlers to non-elements because they will not be cleaned up.\n    if (!jqLiteAcceptsData(element)) {\n      return;\n    }\n\n    var expandoStore = jqLiteExpandoStore(element, true);\n    var events = expandoStore.events;\n    var handle = expandoStore.handle;\n\n    if (!handle) {\n      handle = expandoStore.handle = createEventHandler(element, events);\n    }\n\n    // http://jsperf.com/string-indexof-vs-split\n    var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n    var i = types.length;\n\n    while (i--) {\n      type = types[i];\n      var eventFns = events[type];\n\n      if (!eventFns) {\n        events[type] = [];\n\n        if (type === 'mouseenter' || type === 'mouseleave') {\n          // Refer to jQuery's implementation of mouseenter & mouseleave\n          // Read about mouseenter and mouseleave:\n          // http://www.quirksmode.org/js/events_mouse.html#link8\n\n          jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) {\n            var target = this, related = event.relatedTarget;\n            // For mousenter/leave call the handler if related is outside the target.\n            // NB: No relatedTarget if the mouse left/entered the browser window\n            if (!related || (related !== target && !target.contains(related))) {\n              handle(event, type);\n            }\n          });\n\n        } else {\n          if (type !== '$destroy') {\n            addEventListenerFn(element, type, handle);\n          }\n        }\n        eventFns = events[type];\n      }\n      eventFns.push(fn);\n    }\n  },\n\n  off: jqLiteOff,\n\n  one: function(element, type, fn) {\n    element = jqLite(element);\n\n    //add the listener twice so that when it is called\n    //you can remove the original function and still be\n    //able to call element.off(ev, fn) normally\n    element.on(type, function onFn() {\n      element.off(type, fn);\n      element.off(type, onFn);\n    });\n    element.on(type, fn);\n  },\n\n  replaceWith: function(element, replaceNode) {\n    var index, parent = element.parentNode;\n    jqLiteDealoc(element);\n    forEach(new JQLite(replaceNode), function(node) {\n      if (index) {\n        parent.insertBefore(node, index.nextSibling);\n      } else {\n        parent.replaceChild(node, element);\n      }\n      index = node;\n    });\n  },\n\n  children: function(element) {\n    var children = [];\n    forEach(element.childNodes, function(element) {\n      if (element.nodeType === NODE_TYPE_ELEMENT)\n        children.push(element);\n    });\n    return children;\n  },\n\n  contents: function(element) {\n    return element.contentDocument || element.childNodes || [];\n  },\n\n  append: function(element, node) {\n    var nodeType = element.nodeType;\n    if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n    node = new JQLite(node);\n\n    for (var i = 0, ii = node.length; i < ii; i++) {\n      var child = node[i];\n      element.appendChild(child);\n    }\n  },\n\n  prepend: function(element, node) {\n    if (element.nodeType === NODE_TYPE_ELEMENT) {\n      var index = element.firstChild;\n      forEach(new JQLite(node), function(child) {\n        element.insertBefore(child, index);\n      });\n    }\n  },\n\n  wrap: function(element, wrapNode) {\n    wrapNode = jqLite(wrapNode).eq(0).clone()[0];\n    var parent = element.parentNode;\n    if (parent) {\n      parent.replaceChild(wrapNode, element);\n    }\n    wrapNode.appendChild(element);\n  },\n\n  remove: jqLiteRemove,\n\n  detach: function(element) {\n    jqLiteRemove(element, true);\n  },\n\n  after: function(element, newElement) {\n    var index = element, parent = element.parentNode;\n    newElement = new JQLite(newElement);\n\n    for (var i = 0, ii = newElement.length; i < ii; i++) {\n      var node = newElement[i];\n      parent.insertBefore(node, index.nextSibling);\n      index = node;\n    }\n  },\n\n  addClass: jqLiteAddClass,\n  removeClass: jqLiteRemoveClass,\n\n  toggleClass: function(element, selector, condition) {\n    if (selector) {\n      forEach(selector.split(' '), function(className) {\n        var classCondition = condition;\n        if (isUndefined(classCondition)) {\n          classCondition = !jqLiteHasClass(element, className);\n        }\n        (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n      });\n    }\n  },\n\n  parent: function(element) {\n    var parent = element.parentNode;\n    return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n  },\n\n  next: function(element) {\n    return element.nextElementSibling;\n  },\n\n  find: function(element, selector) {\n    if (element.getElementsByTagName) {\n      return element.getElementsByTagName(selector);\n    } else {\n      return [];\n    }\n  },\n\n  clone: jqLiteClone,\n\n  triggerHandler: function(element, event, extraParameters) {\n\n    var dummyEvent, eventFnsCopy, handlerArgs;\n    var eventName = event.type || event;\n    var expandoStore = jqLiteExpandoStore(element);\n    var events = expandoStore && expandoStore.events;\n    var eventFns = events && events[eventName];\n\n    if (eventFns) {\n      // Create a dummy event to pass to the handlers\n      dummyEvent = {\n        preventDefault: function() { this.defaultPrevented = true; },\n        isDefaultPrevented: function() { return this.defaultPrevented === true; },\n        stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n        isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n        stopPropagation: noop,\n        type: eventName,\n        target: element\n      };\n\n      // If a custom event was provided then extend our dummy event with it\n      if (event.type) {\n        dummyEvent = extend(dummyEvent, event);\n      }\n\n      // Copy event handlers in case event handlers array is modified during execution.\n      eventFnsCopy = shallowCopy(eventFns);\n      handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n      forEach(eventFnsCopy, function(fn) {\n        if (!dummyEvent.isImmediatePropagationStopped()) {\n          fn.apply(element, handlerArgs);\n        }\n      });\n    }\n  }\n}, function(fn, name) {\n  /**\n   * chaining functions\n   */\n  JQLite.prototype[name] = function(arg1, arg2, arg3) {\n    var value;\n\n    for (var i = 0, ii = this.length; i < ii; i++) {\n      if (isUndefined(value)) {\n        value = fn(this[i], arg1, arg2, arg3);\n        if (isDefined(value)) {\n          // any function which returns a value needs to be wrapped\n          value = jqLite(value);\n        }\n      } else {\n        jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n      }\n    }\n    return isDefined(value) ? value : this;\n  };\n\n  // bind legacy bind/unbind to on/off\n  JQLite.prototype.bind = JQLite.prototype.on;\n  JQLite.prototype.unbind = JQLite.prototype.off;\n});\n\n\n// Provider for private $$jqLite service\nfunction $$jqLiteProvider() {\n  this.$get = function $$jqLite() {\n    return extend(JQLite, {\n      hasClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteHasClass(node, classes);\n      },\n      addClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteAddClass(node, classes);\n      },\n      removeClass: function(node, classes) {\n        if (node.attr) node = node[0];\n        return jqLiteRemoveClass(node, classes);\n      }\n    });\n  };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n *  string is string\n *  number is number as string\n *  object is either result of calling $$hashKey function on the object or uniquely generated id,\n *         that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n *         The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n  var key = obj && obj.$$hashKey;\n\n  if (key) {\n    if (typeof key === 'function') {\n      key = obj.$$hashKey();\n    }\n    return key;\n  }\n\n  var objType = typeof obj;\n  if (objType == 'function' || (objType == 'object' && obj !== null)) {\n    key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n  } else {\n    key = objType + ':' + obj;\n  }\n\n  return key;\n}\n\n/**\n * HashMap which can use objects as keys\n */\nfunction HashMap(array, isolatedUid) {\n  if (isolatedUid) {\n    var uid = 0;\n    this.nextUid = function() {\n      return ++uid;\n    };\n  }\n  forEach(array, this.put, this);\n}\nHashMap.prototype = {\n  /**\n   * Store key value pair\n   * @param key key to store can be any type\n   * @param value value to store can be any type\n   */\n  put: function(key, value) {\n    this[hashKey(key, this.nextUid)] = value;\n  },\n\n  /**\n   * @param key\n   * @returns {Object} the value for the key\n   */\n  get: function(key) {\n    return this[hashKey(key, this.nextUid)];\n  },\n\n  /**\n   * Remove the key/value pair\n   * @param key\n   */\n  remove: function(key) {\n    var value = this[key = hashKey(key, this.nextUid)];\n    delete this[key];\n    return value;\n  }\n};\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.<string|Function>} modules A list of module functions or their aliases. See\n *     {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n *     disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n *   // create an injector\n *   var $injector = angular.injector(['ng']);\n *\n *   // use the injector to kick off your application\n *   // use the type inference to auto inject arguments, or use implicit injection\n *   $injector.invoke(function($rootScope, $compile, $document) {\n *     $compile($document)($rootScope);\n *     $rootScope.$digest();\n *   });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running Angular app\n * from outside Angular. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('<div ng-controller=\"MyCtrl\">{{content.label}}</div>');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n *   var scope = angular.element($div).scope();\n *   $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar FN_ARGS = /^function\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction anonFn(fn) {\n  // For anonymous functions, showing at the very least the function signature can help in\n  // debugging.\n  var fnText = fn.toString().replace(STRIP_COMMENTS, ''),\n      args = fnText.match(FN_ARGS);\n  if (args) {\n    return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n  }\n  return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n  var $inject,\n      fnText,\n      argDecl,\n      last;\n\n  if (typeof fn === 'function') {\n    if (!($inject = fn.$inject)) {\n      $inject = [];\n      if (fn.length) {\n        if (strictDi) {\n          if (!isString(name) || !name) {\n            name = fn.name || anonFn(fn);\n          }\n          throw $injectorMinErr('strictdi',\n            '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n        }\n        fnText = fn.toString().replace(STRIP_COMMENTS, '');\n        argDecl = fnText.match(FN_ARGS);\n        forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n          arg.replace(FN_ARG, function(all, underscore, name) {\n            $inject.push(name);\n          });\n        });\n      }\n      fn.$inject = $inject;\n    }\n  } else if (isArray(fn)) {\n    last = fn.length - 1;\n    assertArgFn(fn[last], 'fn');\n    $inject = fn.slice(0, last);\n  } else {\n    assertArgFn(fn, 'fn', true);\n  }\n  return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n *   var $injector = angular.injector();\n *   expect($injector.get('$injector')).toBe($injector);\n *   expect($injector.invoke(function($injector) {\n *     return $injector;\n *   })).toBe($injector);\n * ```\n *\n * # Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n *   // inferred (only works if code not minified/obfuscated)\n *   $injector.invoke(function(serviceA){});\n *\n *   // annotated\n *   function explicit(serviceA) {};\n *   explicit.$inject = ['serviceA'];\n *   $injector.invoke(explicit);\n *\n *   // inline\n *   $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ## Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ## `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ## Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {!Function} fn The function to invoke. Function parameters are injected according to the\n *   {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n *                         object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * # Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n *   // Given\n *   function MyController($scope, $route) {\n *     // ...\n *   }\n *\n *   // Then\n *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * # The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n *   // Given\n *   var MyController = function(obfuscatedScope, obfuscatedRoute) {\n *     // ...\n *   }\n *   // Define function dependencies\n *   MyController['$inject'] = ['$scope', '$route'];\n *\n *   // Then\n *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * # The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n *   // We wish to write this (not minification / obfuscation safe)\n *   injector.invoke(function($compile, $rootScope) {\n *     // ...\n *   });\n *\n *   // We are forced to write break inlining\n *   var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n *     // ...\n *   };\n *   tmpFn.$inject = ['$compile', '$rootScope'];\n *   injector.invoke(tmpFn);\n *\n *   // To better support inline function the inline annotation is supported\n *   injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n *     // ...\n *   }]);\n *\n *   // Therefore\n *   expect(injector.annotate(\n *      ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n *    ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.<string>} The names of the services which the function requires.\n */\n\n\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An Angular **service** is a singleton object created by a **service factory**.  These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider.  The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the\n *     {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by\n *     providers and services.\n * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by\n *     services, not providers.\n * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,\n *     that will be wrapped in a **service provider** object, whose `$get` property will contain the\n *     given factory function.\n * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`\n *     that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n *      a new object using the given constructor function.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n                        'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n *   - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n *     {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n *   - `Constructor`: a new instance of the provider will be created using\n *     {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n *  // Define the eventTracker provider\n *  function EventTrackerProvider() {\n *    var trackingUrl = '/track';\n *\n *    // A provider method for configuring where the tracked events should been saved\n *    this.setTrackingUrl = function(url) {\n *      trackingUrl = url;\n *    };\n *\n *    // The service factory function\n *    this.$get = ['$http', function($http) {\n *      var trackedEvents = {};\n *      return {\n *        // Call this to track an event\n *        event: function(event) {\n *          var count = trackedEvents[event] || 0;\n *          count += 1;\n *          trackedEvents[event] = count;\n *          return count;\n *        },\n *        // Call this to save the tracked events to the trackingUrl\n *        save: function() {\n *          $http.post(trackingUrl, trackedEvents);\n *        }\n *      };\n *    }];\n *  }\n *\n *  describe('eventTracker', function() {\n *    var postSpy;\n *\n *    beforeEach(module(function($provide) {\n *      // Register the eventTracker provider\n *      $provide.provider('eventTracker', EventTrackerProvider);\n *    }));\n *\n *    beforeEach(module(function(eventTrackerProvider) {\n *      // Configure eventTracker provider\n *      eventTrackerProvider.setTrackingUrl('/custom-track');\n *    }));\n *\n *    it('tracks events', inject(function(eventTracker) {\n *      expect(eventTracker.event('login')).toEqual(1);\n *      expect(eventTracker.event('login')).toEqual(2);\n *    }));\n *\n *    it('saves to the tracking url', inject(function(eventTracker, $http) {\n *      postSpy = spyOn($http, 'post');\n *      eventTracker.event('login');\n *      eventTracker.save();\n *      expect(postSpy).toHaveBeenCalled();\n *      expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n *      expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n *      expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n *    }));\n *  });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand\n *                            for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n *   $provide.factory('ping', ['$http', function($http) {\n *     return function ping() {\n *       return $http.send('/ping');\n *     };\n *   }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n *   someModule.controller('Ctrl', ['ping', function(ping) {\n *     ping();\n *   }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is the service\n * constructor function that will be used to instantiate the service instance.\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function} constructor A class (constructor function) that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n *   var Ping = function($http) {\n *     this.$http = $http;\n *   };\n *\n *   Ping.$inject = ['$http'];\n *\n *   Ping.prototype.send = function() {\n *     return this.$http.get('/ping');\n *   };\n *   $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n *   someModule.controller('Ctrl', ['ping', function(ping) {\n *     ping.send();\n *   }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function.  This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an Angular\n * {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n *   $provide.value('ADMIN_USER', 'admin');\n *\n *   $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n *   $provide.value('halfOf', function(value) {\n *     return value / 2;\n *   });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service**, such as a string, a number, an array, an object or a function,\n * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n *   $provide.constant('SHARD_HEIGHT', 306);\n *\n *   $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n *   $provide.constant('double', function(value) {\n *     return value * 2;\n *   });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator\n * intercepts the creation of a service, allowing it to override or modify the behaviour of the\n * service. The object returned by the decorator may be the original service, or a new service\n * object which replaces or wraps and delegates to the original service.\n *\n * @param {string} name The name of the service to decorate.\n * @param {function()} decorator This function will be invoked when the service needs to be\n *    instantiated and should return the decorated service instance. The function is called using\n *    the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n *    Local injection arguments:\n *\n *    * `$delegate` - The original service instance, which can be monkey patched, configured,\n *      decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n *   $provide.decorator('$log', ['$delegate', function($delegate) {\n *     $delegate.warn = $delegate.error;\n *     return $delegate;\n *   }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n  strictDi = (strictDi === true);\n  var INSTANTIATING = {},\n      providerSuffix = 'Provider',\n      path = [],\n      loadedModules = new HashMap([], true),\n      providerCache = {\n        $provide: {\n            provider: supportObject(provider),\n            factory: supportObject(factory),\n            service: supportObject(service),\n            value: supportObject(value),\n            constant: supportObject(constant),\n            decorator: decorator\n          }\n      },\n      providerInjector = (providerCache.$injector =\n          createInternalInjector(providerCache, function(serviceName, caller) {\n            if (angular.isString(caller)) {\n              path.push(caller);\n            }\n            throw $injectorMinErr('unpr', \"Unknown provider: {0}\", path.join(' <- '));\n          })),\n      instanceCache = {},\n      instanceInjector = (instanceCache.$injector =\n          createInternalInjector(instanceCache, function(serviceName, caller) {\n            var provider = providerInjector.get(serviceName + providerSuffix, caller);\n            return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);\n          }));\n\n\n  forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });\n\n  return instanceInjector;\n\n  ////////////////////////////////////\n  // $provider\n  ////////////////////////////////////\n\n  function supportObject(delegate) {\n    return function(key, value) {\n      if (isObject(key)) {\n        forEach(key, reverseParams(delegate));\n      } else {\n        return delegate(key, value);\n      }\n    };\n  }\n\n  function provider(name, provider_) {\n    assertNotHasOwnProperty(name, 'service');\n    if (isFunction(provider_) || isArray(provider_)) {\n      provider_ = providerInjector.instantiate(provider_);\n    }\n    if (!provider_.$get) {\n      throw $injectorMinErr('pget', \"Provider '{0}' must define $get factory method.\", name);\n    }\n    return providerCache[name + providerSuffix] = provider_;\n  }\n\n  function enforceReturnValue(name, factory) {\n    return function enforcedReturnValue() {\n      var result = instanceInjector.invoke(factory, this);\n      if (isUndefined(result)) {\n        throw $injectorMinErr('undef', \"Provider '{0}' must return a value from $get factory method.\", name);\n      }\n      return result;\n    };\n  }\n\n  function factory(name, factoryFn, enforce) {\n    return provider(name, {\n      $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n    });\n  }\n\n  function service(name, constructor) {\n    return factory(name, ['$injector', function($injector) {\n      return $injector.instantiate(constructor);\n    }]);\n  }\n\n  function value(name, val) { return factory(name, valueFn(val), false); }\n\n  function constant(name, value) {\n    assertNotHasOwnProperty(name, 'constant');\n    providerCache[name] = value;\n    instanceCache[name] = value;\n  }\n\n  function decorator(serviceName, decorFn) {\n    var origProvider = providerInjector.get(serviceName + providerSuffix),\n        orig$get = origProvider.$get;\n\n    origProvider.$get = function() {\n      var origInstance = instanceInjector.invoke(orig$get, origProvider);\n      return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n    };\n  }\n\n  ////////////////////////////////////\n  // Module Loading\n  ////////////////////////////////////\n  function loadModules(modulesToLoad) {\n    var runBlocks = [], moduleFn;\n    forEach(modulesToLoad, function(module) {\n      if (loadedModules.get(module)) return;\n      loadedModules.put(module, true);\n\n      function runInvokeQueue(queue) {\n        var i, ii;\n        for (i = 0, ii = queue.length; i < ii; i++) {\n          var invokeArgs = queue[i],\n              provider = providerInjector.get(invokeArgs[0]);\n\n          provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n        }\n      }\n\n      try {\n        if (isString(module)) {\n          moduleFn = angularModule(module);\n          runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n          runInvokeQueue(moduleFn._invokeQueue);\n          runInvokeQueue(moduleFn._configBlocks);\n        } else if (isFunction(module)) {\n            runBlocks.push(providerInjector.invoke(module));\n        } else if (isArray(module)) {\n            runBlocks.push(providerInjector.invoke(module));\n        } else {\n          assertArgFn(module, 'module');\n        }\n      } catch (e) {\n        if (isArray(module)) {\n          module = module[module.length - 1];\n        }\n        if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {\n          // Safari & FF's stack traces don't contain error.message content\n          // unlike those of Chrome and IE\n          // So if stack doesn't contain message, we create a new string that contains both.\n          // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n          /* jshint -W022 */\n          e = e.message + '\\n' + e.stack;\n        }\n        throw $injectorMinErr('modulerr', \"Failed to instantiate module {0} due to:\\n{1}\",\n                  module, e.stack || e.message || e);\n      }\n    });\n    return runBlocks;\n  }\n\n  ////////////////////////////////////\n  // internal Injector\n  ////////////////////////////////////\n\n  function createInternalInjector(cache, factory) {\n\n    function getService(serviceName, caller) {\n      if (cache.hasOwnProperty(serviceName)) {\n        if (cache[serviceName] === INSTANTIATING) {\n          throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n                    serviceName + ' <- ' + path.join(' <- '));\n        }\n        return cache[serviceName];\n      } else {\n        try {\n          path.unshift(serviceName);\n          cache[serviceName] = INSTANTIATING;\n          return cache[serviceName] = factory(serviceName, caller);\n        } catch (err) {\n          if (cache[serviceName] === INSTANTIATING) {\n            delete cache[serviceName];\n          }\n          throw err;\n        } finally {\n          path.shift();\n        }\n      }\n    }\n\n    function invoke(fn, self, locals, serviceName) {\n      if (typeof locals === 'string') {\n        serviceName = locals;\n        locals = null;\n      }\n\n      var args = [],\n          $inject = createInjector.$$annotate(fn, strictDi, serviceName),\n          length, i,\n          key;\n\n      for (i = 0, length = $inject.length; i < length; i++) {\n        key = $inject[i];\n        if (typeof key !== 'string') {\n          throw $injectorMinErr('itkn',\n                  'Incorrect injection token! Expected service name as string, got {0}', key);\n        }\n        args.push(\n          locals && locals.hasOwnProperty(key)\n          ? locals[key]\n          : getService(key, serviceName)\n        );\n      }\n      if (isArray(fn)) {\n        fn = fn[length];\n      }\n\n      // http://jsperf.com/angularjs-invoke-apply-vs-switch\n      // #5388\n      return fn.apply(self, args);\n    }\n\n    function instantiate(Type, locals, serviceName) {\n      // Check if Type is annotated and use just the given function at n-1 as parameter\n      // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n      // Object creation: http://jsperf.com/create-constructor/2\n      var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null);\n      var returnedValue = invoke(Type, instance, locals, serviceName);\n\n      return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;\n    }\n\n    return {\n      invoke: invoke,\n      instantiate: instantiate,\n      get: getService,\n      annotate: createInjector.$$annotate,\n      has: function(name) {\n        return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n      }\n    };\n  }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n  var autoScrollingEnabled = true;\n\n  /**\n   * @ngdoc method\n   * @name $anchorScrollProvider#disableAutoScrolling\n   *\n   * @description\n   * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n   * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />\n   * Use this method to disable automatic scrolling.\n   *\n   * If automatic scrolling is disabled, one must explicitly call\n   * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n   * current hash.\n   */\n  this.disableAutoScrolling = function() {\n    autoScrollingEnabled = false;\n  };\n\n  /**\n   * @ngdoc service\n   * @name $anchorScroll\n   * @kind function\n   * @requires $window\n   * @requires $location\n   * @requires $rootScope\n   *\n   * @description\n   * When called, it checks the current value of {@link ng.$location#hash $location.hash()} and\n   * scrolls to the related element, according to the rules specified in the\n   * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).\n   *\n   * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n   * match any anchor whenever it changes. This can be disabled by calling\n   * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n   *\n   * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n   * vertical scroll-offset (either fixed or dynamic).\n   *\n   * @property {(number|function|jqLite)} yOffset\n   * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n   * positioned elements at the top of the page, such as navbars, headers etc.\n   *\n   * `yOffset` can be specified in various ways:\n   * - **number**: A fixed number of pixels to be used as offset.<br /><br />\n   * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n   *   a number representing the offset (in pixels).<br /><br />\n   * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n   *   the top of the page to the element's bottom will be used as offset.<br />\n   *   **Note**: The element will be taken into account only as long as its `position` is set to\n   *   `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n   *   their height and/or positioning according to the viewport's size.\n   *\n   * <br />\n   * <div class=\"alert alert-warning\">\n   * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n   * not some child element.\n   * </div>\n   *\n   * @example\n     <example module=\"anchorScrollExample\">\n       <file name=\"index.html\">\n         <div id=\"scrollArea\" ng-controller=\"ScrollController\">\n           <a ng-click=\"gotoBottom()\">Go to bottom</a>\n           <a id=\"bottom\"></a> You're at the bottom!\n         </div>\n       </file>\n       <file name=\"script.js\">\n         angular.module('anchorScrollExample', [])\n           .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n             function ($scope, $location, $anchorScroll) {\n               $scope.gotoBottom = function() {\n                 // set the location.hash to the id of\n                 // the element you wish to scroll to.\n                 $location.hash('bottom');\n\n                 // call $anchorScroll()\n                 $anchorScroll();\n               };\n             }]);\n       </file>\n       <file name=\"style.css\">\n         #scrollArea {\n           height: 280px;\n           overflow: auto;\n         }\n\n         #bottom {\n           display: block;\n           margin-top: 2000px;\n         }\n       </file>\n     </example>\n   *\n   * <hr />\n   * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n   * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n   *\n   * @example\n     <example module=\"anchorScrollOffsetExample\">\n       <file name=\"index.html\">\n         <div class=\"fixed-header\" ng-controller=\"headerCtrl\">\n           <a href=\"\" ng-click=\"gotoAnchor(x)\" ng-repeat=\"x in [1,2,3,4,5]\">\n             Go to anchor {{x}}\n           </a>\n         </div>\n         <div id=\"anchor{{x}}\" class=\"anchor\" ng-repeat=\"x in [1,2,3,4,5]\">\n           Anchor {{x}} of 5\n         </div>\n       </file>\n       <file name=\"script.js\">\n         angular.module('anchorScrollOffsetExample', [])\n           .run(['$anchorScroll', function($anchorScroll) {\n             $anchorScroll.yOffset = 50;   // always scroll by 50 extra pixels\n           }])\n           .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n             function ($anchorScroll, $location, $scope) {\n               $scope.gotoAnchor = function(x) {\n                 var newHash = 'anchor' + x;\n                 if ($location.hash() !== newHash) {\n                   // set the $location.hash to `newHash` and\n                   // $anchorScroll will automatically scroll to it\n                   $location.hash('anchor' + x);\n                 } else {\n                   // call $anchorScroll() explicitly,\n                   // since $location.hash hasn't changed\n                   $anchorScroll();\n                 }\n               };\n             }\n           ]);\n       </file>\n       <file name=\"style.css\">\n         body {\n           padding-top: 50px;\n         }\n\n         .anchor {\n           border: 2px dashed DarkOrchid;\n           padding: 10px 10px 200px 10px;\n         }\n\n         .fixed-header {\n           background-color: rgba(0, 0, 0, 0.2);\n           height: 50px;\n           position: fixed;\n           top: 0; left: 0; right: 0;\n         }\n\n         .fixed-header > a {\n           display: inline-block;\n           margin: 5px 15px;\n         }\n       </file>\n     </example>\n   */\n  this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n    var document = $window.document;\n\n    // Helper function to get first anchor from a NodeList\n    // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n    //  and working in all supported browsers.)\n    function getFirstAnchor(list) {\n      var result = null;\n      Array.prototype.some.call(list, function(element) {\n        if (nodeName_(element) === 'a') {\n          result = element;\n          return true;\n        }\n      });\n      return result;\n    }\n\n    function getYOffset() {\n\n      var offset = scroll.yOffset;\n\n      if (isFunction(offset)) {\n        offset = offset();\n      } else if (isElement(offset)) {\n        var elem = offset[0];\n        var style = $window.getComputedStyle(elem);\n        if (style.position !== 'fixed') {\n          offset = 0;\n        } else {\n          offset = elem.getBoundingClientRect().bottom;\n        }\n      } else if (!isNumber(offset)) {\n        offset = 0;\n      }\n\n      return offset;\n    }\n\n    function scrollTo(elem) {\n      if (elem) {\n        elem.scrollIntoView();\n\n        var offset = getYOffset();\n\n        if (offset) {\n          // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n          // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n          // top of the viewport.\n          //\n          // IF the number of pixels from the top of `elem` to the end of the page's content is less\n          // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n          // way down the page.\n          //\n          // This is often the case for elements near the bottom of the page.\n          //\n          // In such cases we do not need to scroll the whole `offset` up, just the difference between\n          // the top of the element and the offset, which is enough to align the top of `elem` at the\n          // desired position.\n          var elemTop = elem.getBoundingClientRect().top;\n          $window.scrollBy(0, elemTop - offset);\n        }\n      } else {\n        $window.scrollTo(0, 0);\n      }\n    }\n\n    function scroll() {\n      var hash = $location.hash(), elm;\n\n      // empty hash, scroll to the top of the page\n      if (!hash) scrollTo(null);\n\n      // element with given id\n      else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n      // first anchor with given name :-D\n      else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n      // no element and hash == 'top', scroll to the top of the page\n      else if (hash === 'top') scrollTo(null);\n    }\n\n    // does not scroll when user clicks on anchor link that is currently on\n    // (no url change, no $location.hash() change), browser native does scroll\n    if (autoScrollingEnabled) {\n      $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n        function autoScrollWatchAction(newVal, oldVal) {\n          // skip the initial scroll if $location.hash is empty\n          if (newVal === oldVal && newVal === '') return;\n\n          jqLiteDocumentLoaded(function() {\n            $rootScope.$evalAsync(scroll);\n          });\n        });\n    }\n\n    return scroll;\n  }];\n}\n\nvar $animateMinErr = minErr('$animate');\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM\n * updates and calls done() callbacks.\n *\n * In order to enable animations the ngAnimate module has to be loaded.\n *\n * To see the functional implementation check out src/ngAnimate/animate.js\n */\nvar $AnimateProvider = ['$provide', function($provide) {\n\n\n  this.$$selectors = {};\n\n\n  /**\n   * @ngdoc method\n   * @name $animateProvider#register\n   *\n   * @description\n   * Registers a new injectable animation factory function. The factory function produces the\n   * animation object which contains callback functions for each event that is expected to be\n   * animated.\n   *\n   *   * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction`\n   *   must be called once the element animation is complete. If a function is returned then the\n   *   animation service will use this function to cancel the animation whenever a cancel event is\n   *   triggered.\n   *\n   *\n   * ```js\n   *   return {\n     *     eventFn : function(element, done) {\n     *       //code to run the animation\n     *       //once complete, then run done()\n     *       return function cancellationFunction() {\n     *         //code to cancel the animation\n     *       }\n     *     }\n     *   }\n   * ```\n   *\n   * @param {string} name The name of the animation.\n   * @param {Function} factory The factory function that will be executed to return the animation\n   *                           object.\n   */\n  this.register = function(name, factory) {\n    var key = name + '-animation';\n    if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel',\n        \"Expecting class selector starting with '.' got '{0}'.\", name);\n    this.$$selectors[name.substr(1)] = key;\n    $provide.factory(key, factory);\n  };\n\n  /**\n   * @ngdoc method\n   * @name $animateProvider#classNameFilter\n   *\n   * @description\n   * Sets and/or returns the CSS class regular expression that is checked when performing\n   * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n   * therefore enable $animate to attempt to perform an animation on any element.\n   * When setting the classNameFilter value, animations will only be performed on elements\n   * that successfully match the filter expression. This in turn can boost performance\n   * for low-powered devices as well as applications containing a lot of structural operations.\n   * @param {RegExp=} expression The className expression which will be checked against all animations\n   * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n   */\n  this.classNameFilter = function(expression) {\n    if (arguments.length === 1) {\n      this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;\n    }\n    return this.$$classNameFilter;\n  };\n\n  this.$get = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) {\n\n    var currentDefer;\n\n    function runAnimationPostDigest(fn) {\n      var cancelFn, defer = $$q.defer();\n      defer.promise.$$cancelFn = function ngAnimateMaybeCancel() {\n        cancelFn && cancelFn();\n      };\n\n      $rootScope.$$postDigest(function ngAnimatePostDigest() {\n        cancelFn = fn(function ngAnimateNotifyComplete() {\n          defer.resolve();\n        });\n      });\n\n      return defer.promise;\n    }\n\n    function resolveElementClasses(element, classes) {\n      var toAdd = [], toRemove = [];\n\n      var hasClasses = createMap();\n      forEach((element.attr('class') || '').split(/\\s+/), function(className) {\n        hasClasses[className] = true;\n      });\n\n      forEach(classes, function(status, className) {\n        var hasClass = hasClasses[className];\n\n        // If the most recent class manipulation (via $animate) was to remove the class, and the\n        // element currently has the class, the class is scheduled for removal. Otherwise, if\n        // the most recent class manipulation (via $animate) was to add the class, and the\n        // element does not currently have the class, the class is scheduled to be added.\n        if (status === false && hasClass) {\n          toRemove.push(className);\n        } else if (status === true && !hasClass) {\n          toAdd.push(className);\n        }\n      });\n\n      return (toAdd.length + toRemove.length) > 0 &&\n        [toAdd.length ? toAdd : null, toRemove.length ? toRemove : null];\n    }\n\n    function cachedClassManipulation(cache, classes, op) {\n      for (var i=0, ii = classes.length; i < ii; ++i) {\n        var className = classes[i];\n        cache[className] = op;\n      }\n    }\n\n    function asyncPromise() {\n      // only serve one instance of a promise in order to save CPU cycles\n      if (!currentDefer) {\n        currentDefer = $$q.defer();\n        $$asyncCallback(function() {\n          currentDefer.resolve();\n          currentDefer = null;\n        });\n      }\n      return currentDefer.promise;\n    }\n\n    function applyStyles(element, options) {\n      if (angular.isObject(options)) {\n        var styles = extend(options.from || {}, options.to || {});\n        element.css(styles);\n      }\n    }\n\n    /**\n     *\n     * @ngdoc service\n     * @name $animate\n     * @description The $animate service provides rudimentary DOM manipulation functions to\n     * insert, remove and move elements within the DOM, as well as adding and removing classes.\n     * This service is the core service used by the ngAnimate $animator service which provides\n     * high-level animation hooks for CSS and JavaScript.\n     *\n     * $animate is available in the AngularJS core, however, the ngAnimate module must be included\n     * to enable full out animation support. Otherwise, $animate will only perform simple DOM\n     * manipulation operations.\n     *\n     * To learn more about enabling animation support, click here to visit the {@link ngAnimate\n     * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service\n     * page}.\n     */\n    return {\n      animate: function(element, from, to) {\n        applyStyles(element, { from: from, to: to });\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#enter\n       * @kind function\n       * @description Inserts the element into the DOM either after the `after` element or\n       * as the first child within the `parent` element. When the function is called a promise\n       * is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will be inserted into the DOM\n       * @param {DOMElement} parent the parent element which will append the element as\n       *   a child (if the after element is not present)\n       * @param {DOMElement} after the sibling element which will append the element\n       *   after itself\n       * @param {object=} options an optional collection of styles that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      enter: function(element, parent, after, options) {\n        applyStyles(element, options);\n        after ? after.after(element)\n              : parent.prepend(element);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#leave\n       * @kind function\n       * @description Removes the element from the DOM. When the function is called a promise\n       * is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will be removed from the DOM\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      leave: function(element, options) {\n        element.remove();\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#move\n       * @kind function\n       * @description Moves the position of the provided element within the DOM to be placed\n       * either after the `after` element or inside of the `parent` element. When the function\n       * is called a promise is returned that will be resolved at a later time.\n       *\n       * @param {DOMElement} element the element which will be moved around within the\n       *   DOM\n       * @param {DOMElement} parent the parent element where the element will be\n       *   inserted into (if the after element is not present)\n       * @param {DOMElement} after the sibling element where the element will be\n       *   positioned next to\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      move: function(element, parent, after, options) {\n        // Do not remove element before insert. Removing will cause data associated with the\n        // element to be dropped. Insert will implicitly do the remove.\n        return this.enter(element, parent, after, options);\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#addClass\n       * @kind function\n       * @description Adds the provided className CSS class value to the provided element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have the className value\n       *   added to it\n       * @param {string} className the CSS class which will be added to the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      addClass: function(element, className, options) {\n        return this.setClass(element, className, [], options);\n      },\n\n      $$addClassImmediately: function(element, className, options) {\n        element = jqLite(element);\n        className = !isString(className)\n                        ? (isArray(className) ? className.join(' ') : '')\n                        : className;\n        forEach(element, function(element) {\n          jqLiteAddClass(element, className);\n        });\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#removeClass\n       * @kind function\n       * @description Removes the provided className CSS class value from the provided element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have the className value\n       *   removed from it\n       * @param {string} className the CSS class which will be removed from the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      removeClass: function(element, className, options) {\n        return this.setClass(element, [], className, options);\n      },\n\n      $$removeClassImmediately: function(element, className, options) {\n        element = jqLite(element);\n        className = !isString(className)\n                        ? (isArray(className) ? className.join(' ') : '')\n                        : className;\n        forEach(element, function(element) {\n          jqLiteRemoveClass(element, className);\n        });\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      /**\n       *\n       * @ngdoc method\n       * @name $animate#setClass\n       * @kind function\n       * @description Adds and/or removes the given CSS classes to and from the element.\n       * When the function is called a promise is returned that will be resolved at a later time.\n       * @param {DOMElement} element the element which will have its CSS classes changed\n       *   removed from it\n       * @param {string} add the CSS classes which will be added to the element\n       * @param {string} remove the CSS class which will be removed from the element\n       * @param {object=} options an optional collection of options that will be applied to the element.\n       * @return {Promise} the animation callback promise\n       */\n      setClass: function(element, add, remove, options) {\n        var self = this;\n        var STORAGE_KEY = '$$animateClasses';\n        var createdCache = false;\n        element = jqLite(element);\n\n        var cache = element.data(STORAGE_KEY);\n        if (!cache) {\n          cache = {\n            classes: {},\n            options: options\n          };\n          createdCache = true;\n        } else if (options && cache.options) {\n          cache.options = angular.extend(cache.options || {}, options);\n        }\n\n        var classes = cache.classes;\n\n        add = isArray(add) ? add : add.split(' ');\n        remove = isArray(remove) ? remove : remove.split(' ');\n        cachedClassManipulation(classes, add, true);\n        cachedClassManipulation(classes, remove, false);\n\n        if (createdCache) {\n          cache.promise = runAnimationPostDigest(function(done) {\n            var cache = element.data(STORAGE_KEY);\n            element.removeData(STORAGE_KEY);\n\n            // in the event that the element is removed before postDigest\n            // is run then the cache will be undefined and there will be\n            // no need anymore to add or remove and of the element classes\n            if (cache) {\n              var classes = resolveElementClasses(element, cache.classes);\n              if (classes) {\n                self.$$setClassImmediately(element, classes[0], classes[1], cache.options);\n              }\n            }\n\n            done();\n          });\n          element.data(STORAGE_KEY, cache);\n        }\n\n        return cache.promise;\n      },\n\n      $$setClassImmediately: function(element, add, remove, options) {\n        add && this.$$addClassImmediately(element, add);\n        remove && this.$$removeClassImmediately(element, remove);\n        applyStyles(element, options);\n        return asyncPromise();\n      },\n\n      enabled: noop,\n      cancel: noop\n    };\n  }];\n}];\n\nfunction $$AsyncCallbackProvider() {\n  this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) {\n    return $$rAF.supported\n      ? function(fn) { return $$rAF(fn); }\n      : function(fn) {\n        return $timeout(fn, 0, false);\n      };\n  }];\n}\n\n/* global stripHash: true */\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer) {\n  var self = this,\n      rawDocument = document[0],\n      location = window.location,\n      history = window.history,\n      setTimeout = window.setTimeout,\n      clearTimeout = window.clearTimeout,\n      pendingDeferIds = {};\n\n  self.isMock = false;\n\n  var outstandingRequestCount = 0;\n  var outstandingRequestCallbacks = [];\n\n  // TODO(vojta): remove this temporary api\n  self.$$completeOutstandingRequest = completeOutstandingRequest;\n  self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };\n\n  /**\n   * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`\n   * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.\n   */\n  function completeOutstandingRequest(fn) {\n    try {\n      fn.apply(null, sliceArgs(arguments, 1));\n    } finally {\n      outstandingRequestCount--;\n      if (outstandingRequestCount === 0) {\n        while (outstandingRequestCallbacks.length) {\n          try {\n            outstandingRequestCallbacks.pop()();\n          } catch (e) {\n            $log.error(e);\n          }\n        }\n      }\n    }\n  }\n\n  function getHash(url) {\n    var index = url.indexOf('#');\n    return index === -1 ? '' : url.substr(index + 1);\n  }\n\n  /**\n   * @private\n   * Note: this method is used only by scenario runner\n   * TODO(vojta): prefix this method with $$ ?\n   * @param {function()} callback Function that will be called when no outstanding request\n   */\n  self.notifyWhenNoOutstandingRequests = function(callback) {\n    // force browser to execute all pollFns - this is needed so that cookies and other pollers fire\n    // at some deterministic time in respect to the test runner's actions. Leaving things up to the\n    // regular poller would result in flaky tests.\n    forEach(pollFns, function(pollFn) { pollFn(); });\n\n    if (outstandingRequestCount === 0) {\n      callback();\n    } else {\n      outstandingRequestCallbacks.push(callback);\n    }\n  };\n\n  //////////////////////////////////////////////////////////////\n  // Poll Watcher API\n  //////////////////////////////////////////////////////////////\n  var pollFns = [],\n      pollTimeout;\n\n  /**\n   * @name $browser#addPollFn\n   *\n   * @param {function()} fn Poll function to add\n   *\n   * @description\n   * Adds a function to the list of functions that poller periodically executes,\n   * and starts polling if not started yet.\n   *\n   * @returns {function()} the added function\n   */\n  self.addPollFn = function(fn) {\n    if (isUndefined(pollTimeout)) startPoller(100, setTimeout);\n    pollFns.push(fn);\n    return fn;\n  };\n\n  /**\n   * @param {number} interval How often should browser call poll functions (ms)\n   * @param {function()} setTimeout Reference to a real or fake `setTimeout` function.\n   *\n   * @description\n   * Configures the poller to run in the specified intervals, using the specified\n   * setTimeout fn and kicks it off.\n   */\n  function startPoller(interval, setTimeout) {\n    (function check() {\n      forEach(pollFns, function(pollFn) { pollFn(); });\n      pollTimeout = setTimeout(check, interval);\n    })();\n  }\n\n  //////////////////////////////////////////////////////////////\n  // URL API\n  //////////////////////////////////////////////////////////////\n\n  var cachedState, lastHistoryState,\n      lastBrowserUrl = location.href,\n      baseElement = document.find('base'),\n      reloadLocation = null;\n\n  cacheState();\n  lastHistoryState = cachedState;\n\n  /**\n   * @name $browser#url\n   *\n   * @description\n   * GETTER:\n   * Without any argument, this method just returns current value of location.href.\n   *\n   * SETTER:\n   * With at least one argument, this method sets url to new value.\n   * If html5 history api supported, pushState/replaceState is used, otherwise\n   * location.href/location.replace is used.\n   * Returns its own instance to allow chaining\n   *\n   * NOTE: this api is intended for use only by the $location service. Please use the\n   * {@link ng.$location $location service} to change url.\n   *\n   * @param {string} url New url (when used as setter)\n   * @param {boolean=} replace Should new url replace current history record?\n   * @param {object=} state object to use with pushState/replaceState\n   */\n  self.url = function(url, replace, state) {\n    // In modern browsers `history.state` is `null` by default; treating it separately\n    // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n    // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n    if (isUndefined(state)) {\n      state = null;\n    }\n\n    // Android Browser BFCache causes location, history reference to become stale.\n    if (location !== window.location) location = window.location;\n    if (history !== window.history) history = window.history;\n\n    // setter\n    if (url) {\n      var sameState = lastHistoryState === state;\n\n      // Don't change anything if previous and current URLs and states match. This also prevents\n      // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n      // See https://github.com/angular/angular.js/commit/ffb2701\n      if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n        return self;\n      }\n      var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n      lastBrowserUrl = url;\n      lastHistoryState = state;\n      // Don't use history API if only the hash changed\n      // due to a bug in IE10/IE11 which leads\n      // to not firing a `hashchange` nor `popstate` event\n      // in some cases (see #9143).\n      if ($sniffer.history && (!sameBase || !sameState)) {\n        history[replace ? 'replaceState' : 'pushState'](state, '', url);\n        cacheState();\n        // Do the assignment again so that those two variables are referentially identical.\n        lastHistoryState = cachedState;\n      } else {\n        if (!sameBase) {\n          reloadLocation = url;\n        }\n        if (replace) {\n          location.replace(url);\n        } else if (!sameBase) {\n          location.href = url;\n        } else {\n          location.hash = getHash(url);\n        }\n      }\n      return self;\n    // getter\n    } else {\n      // - reloadLocation is needed as browsers don't allow to read out\n      //   the new location.href if a reload happened.\n      // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n      return reloadLocation || location.href.replace(/%27/g,\"'\");\n    }\n  };\n\n  /**\n   * @name $browser#state\n   *\n   * @description\n   * This method is a getter.\n   *\n   * Return history.state or null if history.state is undefined.\n   *\n   * @returns {object} state\n   */\n  self.state = function() {\n    return cachedState;\n  };\n\n  var urlChangeListeners = [],\n      urlChangeInit = false;\n\n  function cacheStateAndFireUrlChange() {\n    cacheState();\n    fireUrlChange();\n  }\n\n  // This variable should be used *only* inside the cacheState function.\n  var lastCachedState = null;\n  function cacheState() {\n    // This should be the only place in $browser where `history.state` is read.\n    cachedState = window.history.state;\n    cachedState = isUndefined(cachedState) ? null : cachedState;\n\n    // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n    if (equals(cachedState, lastCachedState)) {\n      cachedState = lastCachedState;\n    }\n    lastCachedState = cachedState;\n  }\n\n  function fireUrlChange() {\n    if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {\n      return;\n    }\n\n    lastBrowserUrl = self.url();\n    lastHistoryState = cachedState;\n    forEach(urlChangeListeners, function(listener) {\n      listener(self.url(), cachedState);\n    });\n  }\n\n  /**\n   * @name $browser#onUrlChange\n   *\n   * @description\n   * Register callback function that will be called, when url changes.\n   *\n   * It's only called when the url is changed from outside of angular:\n   * - user types different url into address bar\n   * - user clicks on history (forward/back) button\n   * - user clicks on a link\n   *\n   * It's not called when url is changed by $browser.url() method\n   *\n   * The listener gets called with new url as parameter.\n   *\n   * NOTE: this api is intended for use only by the $location service. Please use the\n   * {@link ng.$location $location service} to monitor url changes in angular apps.\n   *\n   * @param {function(string)} listener Listener function to be called when url changes.\n   * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n   */\n  self.onUrlChange = function(callback) {\n    // TODO(vojta): refactor to use node's syntax for events\n    if (!urlChangeInit) {\n      // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)\n      // don't fire popstate when user change the address bar and don't fire hashchange when url\n      // changed by push/replaceState\n\n      // html5 history api - popstate event\n      if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n      // hashchange event\n      jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n      urlChangeInit = true;\n    }\n\n    urlChangeListeners.push(callback);\n    return callback;\n  };\n\n  /**\n   * Checks whether the url has changed outside of Angular.\n   * Needs to be exported to be able to check for changes that have been done in sync,\n   * as hashchange/popstate events fire in async.\n   */\n  self.$$checkUrlChange = fireUrlChange;\n\n  //////////////////////////////////////////////////////////////\n  // Misc API\n  //////////////////////////////////////////////////////////////\n\n  /**\n   * @name $browser#baseHref\n   *\n   * @description\n   * Returns current <base href>\n   * (always relative - without domain)\n   *\n   * @returns {string} The current base href\n   */\n  self.baseHref = function() {\n    var href = baseElement.attr('href');\n    return href ? href.replace(/^(https?\\:)?\\/\\/[^\\/]*/, '') : '';\n  };\n\n  //////////////////////////////////////////////////////////////\n  // Cookies API\n  //////////////////////////////////////////////////////////////\n  var lastCookies = {};\n  var lastCookieString = '';\n  var cookiePath = self.baseHref();\n\n  function safeDecodeURIComponent(str) {\n    try {\n      return decodeURIComponent(str);\n    } catch (e) {\n      return str;\n    }\n  }\n\n  /**\n   * @name $browser#cookies\n   *\n   * @param {string=} name Cookie name\n   * @param {string=} value Cookie value\n   *\n   * @description\n   * The cookies method provides a 'private' low level access to browser cookies.\n   * It is not meant to be used directly, use the $cookie service instead.\n   *\n   * The return values vary depending on the arguments that the method was called with as follows:\n   *\n   * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify\n   *   it\n   * - cookies(name, value) -> set name to value, if value is undefined delete the cookie\n   * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that\n   *   way)\n   *\n   * @returns {Object} Hash of all cookies (if called without any parameter)\n   */\n  self.cookies = function(name, value) {\n    var cookieLength, cookieArray, cookie, i, index;\n\n    if (name) {\n      if (value === undefined) {\n        rawDocument.cookie = encodeURIComponent(name) + \"=;path=\" + cookiePath +\n                                \";expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n      } else {\n        if (isString(value)) {\n          cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) +\n                                ';path=' + cookiePath).length + 1;\n\n          // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\n          // - 300 cookies\n          // - 20 cookies per unique domain\n          // - 4096 bytes per cookie\n          if (cookieLength > 4096) {\n            $log.warn(\"Cookie '\" + name +\n              \"' possibly not set or overflowed because it was too large (\" +\n              cookieLength + \" > 4096 bytes)!\");\n          }\n        }\n      }\n    } else {\n      if (rawDocument.cookie !== lastCookieString) {\n        lastCookieString = rawDocument.cookie;\n        cookieArray = lastCookieString.split(\"; \");\n        lastCookies = {};\n\n        for (i = 0; i < cookieArray.length; i++) {\n          cookie = cookieArray[i];\n          index = cookie.indexOf('=');\n          if (index > 0) { //ignore nameless cookies\n            name = safeDecodeURIComponent(cookie.substring(0, index));\n            // the first value that is seen for a cookie is the most\n            // specific one.  values for the same cookie name that\n            // follow are for less specific paths.\n            if (lastCookies[name] === undefined) {\n              lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n            }\n          }\n        }\n      }\n      return lastCookies;\n    }\n  };\n\n\n  /**\n   * @name $browser#defer\n   * @param {function()} fn A function, who's execution should be deferred.\n   * @param {number=} [delay=0] of milliseconds to defer the function execution.\n   * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n   *\n   * @description\n   * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n   *\n   * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n   * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n   * via `$browser.defer.flush()`.\n   *\n   */\n  self.defer = function(fn, delay) {\n    var timeoutId;\n    outstandingRequestCount++;\n    timeoutId = setTimeout(function() {\n      delete pendingDeferIds[timeoutId];\n      completeOutstandingRequest(fn);\n    }, delay || 0);\n    pendingDeferIds[timeoutId] = true;\n    return timeoutId;\n  };\n\n\n  /**\n   * @name $browser#defer.cancel\n   *\n   * @description\n   * Cancels a deferred task identified with `deferId`.\n   *\n   * @param {*} deferId Token returned by the `$browser.defer` function.\n   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n   *                    canceled.\n   */\n  self.defer.cancel = function(deferId) {\n    if (pendingDeferIds[deferId]) {\n      delete pendingDeferIds[deferId];\n      clearTimeout(deferId);\n      completeOutstandingRequest(noop);\n      return true;\n    }\n    return false;\n  };\n\n}\n\nfunction $BrowserProvider() {\n  this.$get = ['$window', '$log', '$sniffer', '$document',\n      function($window, $log, $sniffer, $document) {\n        return new Browser($window, $document, $log, $sniffer);\n      }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n *  var cache = $cacheFactory('cacheId');\n *  expect($cacheFactory.get('cacheId')).toBe(cache);\n *  expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n *  cache.put(\"key\", \"value\");\n *  cache.put(\"another key\", \"another value\");\n *\n *  // We've specified no options on creation\n *  expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n *   - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n *   it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n   <example module=\"cacheExampleApp\">\n     <file name=\"index.html\">\n       <div ng-controller=\"CacheController\">\n         <input ng-model=\"newCacheKey\" placeholder=\"Key\">\n         <input ng-model=\"newCacheValue\" placeholder=\"Value\">\n         <button ng-click=\"put(newCacheKey, newCacheValue)\">Cache</button>\n\n         <p ng-if=\"keys.length\">Cached Values</p>\n         <div ng-repeat=\"key in keys\">\n           <span ng-bind=\"key\"></span>\n           <span>: </span>\n           <b ng-bind=\"cache.get(key)\"></b>\n         </div>\n\n         <p>Cache Info</p>\n         <div ng-repeat=\"(key, value) in cache.info()\">\n           <span ng-bind=\"key\"></span>\n           <span>: </span>\n           <b ng-bind=\"value\"></b>\n         </div>\n       </div>\n     </file>\n     <file name=\"script.js\">\n       angular.module('cacheExampleApp', []).\n         controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n           $scope.keys = [];\n           $scope.cache = $cacheFactory('cacheId');\n           $scope.put = function(key, value) {\n             if ($scope.cache.get(key) === undefined) {\n               $scope.keys.push(key);\n             }\n             $scope.cache.put(key, value === undefined ? null : value);\n           };\n         }]);\n     </file>\n     <file name=\"style.css\">\n       p {\n         margin: 10px 0 3px;\n       }\n     </file>\n   </example>\n */\nfunction $CacheFactoryProvider() {\n\n  this.$get = function() {\n    var caches = {};\n\n    function cacheFactory(cacheId, options) {\n      if (cacheId in caches) {\n        throw minErr('$cacheFactory')('iid', \"CacheId '{0}' is already taken!\", cacheId);\n      }\n\n      var size = 0,\n          stats = extend({}, options, {id: cacheId}),\n          data = {},\n          capacity = (options && options.capacity) || Number.MAX_VALUE,\n          lruHash = {},\n          freshEnd = null,\n          staleEnd = null;\n\n      /**\n       * @ngdoc type\n       * @name $cacheFactory.Cache\n       *\n       * @description\n       * A cache object used to store and retrieve data, primarily used by\n       * {@link $http $http} and the {@link ng.directive:script script} directive to cache\n       * templates and other data.\n       *\n       * ```js\n       *  angular.module('superCache')\n       *    .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n       *      return $cacheFactory('super-cache');\n       *    }]);\n       * ```\n       *\n       * Example test:\n       *\n       * ```js\n       *  it('should behave like a cache', inject(function(superCache) {\n       *    superCache.put('key', 'value');\n       *    superCache.put('another key', 'another value');\n       *\n       *    expect(superCache.info()).toEqual({\n       *      id: 'super-cache',\n       *      size: 2\n       *    });\n       *\n       *    superCache.remove('another key');\n       *    expect(superCache.get('another key')).toBeUndefined();\n       *\n       *    superCache.removeAll();\n       *    expect(superCache.info()).toEqual({\n       *      id: 'super-cache',\n       *      size: 0\n       *    });\n       *  }));\n       * ```\n       */\n      return caches[cacheId] = {\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#put\n         * @kind function\n         *\n         * @description\n         * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n         * retrieved later, and incrementing the size of the cache if the key was not already\n         * present in the cache. If behaving like an LRU cache, it will also remove stale\n         * entries from the set.\n         *\n         * It will not insert undefined values into the cache.\n         *\n         * @param {string} key the key under which the cached data is stored.\n         * @param {*} value the value to store alongside the key. If it is undefined, the key\n         *    will not be stored.\n         * @returns {*} the value stored.\n         */\n        put: function(key, value) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n            refresh(lruEntry);\n          }\n\n          if (isUndefined(value)) return;\n          if (!(key in data)) size++;\n          data[key] = value;\n\n          if (size > capacity) {\n            this.remove(staleEnd.key);\n          }\n\n          return value;\n        },\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#get\n         * @kind function\n         *\n         * @description\n         * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n         *\n         * @param {string} key the key of the data to be retrieved\n         * @returns {*} the value stored.\n         */\n        get: function(key) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key];\n\n            if (!lruEntry) return;\n\n            refresh(lruEntry);\n          }\n\n          return data[key];\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#remove\n         * @kind function\n         *\n         * @description\n         * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n         *\n         * @param {string} key the key of the entry to be removed\n         */\n        remove: function(key) {\n          if (capacity < Number.MAX_VALUE) {\n            var lruEntry = lruHash[key];\n\n            if (!lruEntry) return;\n\n            if (lruEntry == freshEnd) freshEnd = lruEntry.p;\n            if (lruEntry == staleEnd) staleEnd = lruEntry.n;\n            link(lruEntry.n,lruEntry.p);\n\n            delete lruHash[key];\n          }\n\n          delete data[key];\n          size--;\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#removeAll\n         * @kind function\n         *\n         * @description\n         * Clears the cache object of any entries.\n         */\n        removeAll: function() {\n          data = {};\n          size = 0;\n          lruHash = {};\n          freshEnd = staleEnd = null;\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#destroy\n         * @kind function\n         *\n         * @description\n         * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n         * removing it from the {@link $cacheFactory $cacheFactory} set.\n         */\n        destroy: function() {\n          data = null;\n          stats = null;\n          lruHash = null;\n          delete caches[cacheId];\n        },\n\n\n        /**\n         * @ngdoc method\n         * @name $cacheFactory.Cache#info\n         * @kind function\n         *\n         * @description\n         * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n         *\n         * @returns {object} an object with the following properties:\n         *   <ul>\n         *     <li>**id**: the id of the cache instance</li>\n         *     <li>**size**: the number of entries kept in the cache instance</li>\n         *     <li>**...**: any additional properties from the options object when creating the\n         *       cache.</li>\n         *   </ul>\n         */\n        info: function() {\n          return extend({}, stats, {size: size});\n        }\n      };\n\n\n      /**\n       * makes the `entry` the freshEnd of the LRU linked list\n       */\n      function refresh(entry) {\n        if (entry != freshEnd) {\n          if (!staleEnd) {\n            staleEnd = entry;\n          } else if (staleEnd == entry) {\n            staleEnd = entry.n;\n          }\n\n          link(entry.n, entry.p);\n          link(entry, freshEnd);\n          freshEnd = entry;\n          freshEnd.n = null;\n        }\n      }\n\n\n      /**\n       * bidirectionally links two entries of the LRU linked list\n       */\n      function link(nextEntry, prevEntry) {\n        if (nextEntry != prevEntry) {\n          if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n          if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n        }\n      }\n    }\n\n\n  /**\n   * @ngdoc method\n   * @name $cacheFactory#info\n   *\n   * @description\n   * Get information about all the caches that have been created\n   *\n   * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n   */\n    cacheFactory.info = function() {\n      var info = {};\n      forEach(caches, function(cache, cacheId) {\n        info[cacheId] = cache.info();\n      });\n      return info;\n    };\n\n\n  /**\n   * @ngdoc method\n   * @name $cacheFactory#get\n   *\n   * @description\n   * Get access to a cache object by the `cacheId` used when it was created.\n   *\n   * @param {string} cacheId Name or id of a cache to access.\n   * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n   */\n    cacheFactory.get = function(cacheId) {\n      return caches[cacheId];\n    };\n\n\n    return cacheFactory;\n  };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n *\n * @description\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, or by consuming the\n * `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n *   <script type=\"text/ng-template\" id=\"templateId.html\">\n *     <p>This is the content of the template</p>\n *   </script>\n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,\n * element with ng-app attribute), otherwise the template will be ignored.\n *\n * Adding via the $templateCache service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n *   $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your HTML:\n * ```html\n * <div ng-include=\" 'templateId.html' \"></div>\n * ```\n *\n * or get it via Javascript:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n * See {@link ng.$cacheFactory $cacheFactory}.\n *\n */\nfunction $TemplateCacheProvider() {\n  this.$get = ['$cacheFactory', function($cacheFactory) {\n    return $cacheFactory('templates');\n  }];\n}\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" -  function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n * </div>\n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a \"Directive Definition Object\" (see below) that defines the directive properties,\n * or just the `postLink` function (all other properties will have the default values).\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n * </div>\n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n *   var myModule = angular.module(...);\n *\n *   myModule.directive('directiveName', function factory(injectables) {\n *     var directiveDefinitionObject = {\n *       priority: 0,\n *       template: '<div></div>', // or // function(tElement, tAttrs) { ... },\n *       // or\n *       // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },\n *       transclude: false,\n *       restrict: 'A',\n *       templateNamespace: 'html',\n *       scope: false,\n *       controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n *       controllerAs: 'stringAlias',\n *       require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n *       compile: function compile(tElement, tAttrs, transclude) {\n *         return {\n *           pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n *           post: function postLink(scope, iElement, iAttrs, controller) { ... }\n *         }\n *         // or\n *         // return function postLink( ... ) { ... }\n *       },\n *       // or\n *       // link: {\n *       //  pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n *       //  post: function postLink(scope, iElement, iAttrs, controller) { ... }\n *       // }\n *       // or\n *       // link: function postLink( ... ) { ... }\n *     };\n *     return directiveDefinitionObject;\n *   });\n * ```\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n * </div>\n *\n * Therefore the above can be simplified as:\n *\n * ```js\n *   var myModule = angular.module(...);\n *\n *   myModule.directive('directiveName', function factory(injectables) {\n *     var directiveDefinitionObject = {\n *       link: function postLink(scope, iElement, iAttrs) { ... }\n *     };\n *     return directiveDefinitionObject;\n *     // or\n *     // return function postLink(scope, iElement, iAttrs) { ... }\n *   });\n * ```\n *\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true, the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioural (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the\n * same element request a new scope, only one new scope is created. The new scope rule does not\n * apply for the root of the template since the root of the template always gets a new scope.\n *\n * **If set to `{}` (object hash),** then a new \"isolate\" scope is created. The 'isolate' scope differs from\n * normal scope in that it does not prototypically inherit from the parent scope. This is useful\n * when creating reusable components, which should not accidentally read or modify data in the\n * parent scope.\n *\n * The 'isolate' scope takes an object hash which defines a set of local scope properties\n * derived from the parent scope. These local properties are useful for aliasing values for\n * templates. Locals definition is a hash of local scope property to its source:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n *   always a string since DOM attributes are strings. If no `attr` name is specified  then the\n *   attribute name is assumed to be the same as the local name.\n *   Given `<widget my-attr=\"hello {{name}}\">` and widget definition\n *   of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect\n *   the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the\n *   `localName` property on the widget scope. The `name` is read from the parent scope (not\n *   component scope).\n *\n * * `=` or `=attr` - set up bi-directional binding between a local scope property and the\n *   parent scope property of name defined via the value of the `attr` attribute. If no `attr`\n *   name is specified then the attribute name is assumed to be the same as the local name.\n *   Given `<widget my-attr=\"parentModel\">` and widget definition of\n *   `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the\n *   value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected\n *   in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent\n *   scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You\n *   can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If\n *   you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use\n *   `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional).\n *\n * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.\n *   If no `attr` name is specified then the attribute name is assumed to be the same as the\n *   local name. Given `<widget my-attr=\"count = count + value\">` and widget definition of\n *   `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to\n *   a function wrapper for the `count = count + value` expression. Often it's desirable to\n *   pass data from the isolated scope via an expression to the parent scope, this can be\n *   done by passing a map of local variable names and values into the expression wrapper fn.\n *   For example, if the expression is `increment(amount)` then we can specify the amount value\n *   by calling the `localFn` as `localFn({amount: 22})`.\n *\n *\n * #### `bindToController`\n * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope. When the controller\n * is instantiated, the initial values of the isolate scope bindings are already available.\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and it is shared with other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n *   `function([scope], cloneLinkingFn, futureParentElement)`.\n *    * `scope`: optional argument to override the scope.\n *    * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.\n *    * `futureParentElement`:\n *        * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n *        * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n *        * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n *          and when the `cloneLinkinFn` is passed,\n *          as those elements need to created and cloned in a special way when they are defined outside their\n *          usual containers (e.g. like `<svg>`).\n *        * See also the `directive.templateNamespace` property.\n *\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the\n * injected argument will be an array in corresponding order. If no such directive can be\n * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n *   `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n *   `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Controller alias at the directive scope. An alias for the controller so it\n * can be referenced at the directive template. The directive needs to define a scope for this\n * configuration to be used. Useful in the case when directive is used as component.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): `<my-directive></my-directive>`\n * * `A` - Attribute (default): `<div my-directive=\"exp\"></div>`\n * * `C` - Class: `<div class=\"my-directive: exp;\"></div>`\n * * `M` - Comment: `<!-- directive: my-directive exp -->`\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n *   top-level elements such as `<svg>` or `<math>`.\n * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).\n * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n *   function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved.  In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url.  In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)\n * specify what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element or the entire element:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n *   element that defined at a lower priority than this directive. When used, the `template`\n *   property is ignored.\n *\n *\n * #### `compile`\n *\n * ```js\n *   function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n *   * `tElement` - template element - The element where the directive has been declared. It is\n *     safe to do template transformation on the element and child elements only.\n *\n *   * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n *     between all directive compile functions.\n *\n *   * `transclude` -  [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n * <div class=\"alert alert-warning\">\n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n * </div>\n\n * <div class=\"alert alert-warning\">\n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and a\n * stack overflow errors.\n *\n * This can be avoided by manually using $compile in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n * </div>\n *\n * <div class=\"alert alert-error\">\n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n *   e.g. does not know about the right outer scope. Please use the transclude function that is passed\n *   to the link function instead.\n * </div>\n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n *   `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n *   control when a linking function should be called during the linking phase. See info about\n *   pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n *   function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n *   * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n *     directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n *   * `iElement` - instance element - The element where the directive is to be used. It is safe to\n *     manipulate the children of the element only in `postLink` function since the children have\n *     already been linked.\n *\n *   * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n *     between all directive linking functions.\n *\n *   * `controller` - a controller instance - A controller instance if at least one directive on the\n *     element defines a controller. The controller is shared among all the directives, which allows\n *     the directives to use the controllers as a communication channel.\n *\n *   * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n *     This is the same as the `$transclude`\n *     parameter of directive controllers, see there for details.\n *     `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM element from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n * </div>\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n * <div class=\"alert alert-info\">\n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n * </div>\n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, to which the clone is bound.\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n * </div>\n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n *   element.append(clone);\n *   transcludedContent = clone;\n *   transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n * </div>\n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n * <div ng-app>\n *   <div isolate>\n *     <div transclusion>\n *     </div>\n *   </div>\n * </div>\n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n * ```\n * - $rootScope\n *   - isolate\n *     - transclusion\n * ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n * ```\n * - $rootScope\n *   - transclusion\n * - isolate\n * ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * accessing *Normalized attribute names:*\n * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'.\n * the attributes object allows for normalized access to\n *   the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n *   object which allows the directives to use the attributes object as inter directive\n *   communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n *   allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n *   that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n *   the only way to easily get the actual value because during the linking phase the interpolation\n *   hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n *   // get the attribute value\n *   console.log(attrs.ngModel);\n *\n *   // change the attribute\n *   attrs.$set('ngModel', 'new value');\n *\n *   // observe changes to interpolated attribute\n *   attrs.$observe('ngModel', function(value) {\n *     console.log('ngModel has changed value to ' + value);\n *   });\n * }\n * ```\n *\n * ## Example\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n * </div>\n *\n <example module=\"compileExample\">\n   <file name=\"index.html\">\n    <script>\n      angular.module('compileExample', [], function($compileProvider) {\n        // configure new 'compile' directive by passing a directive\n        // factory function. The factory function injects the '$compile'\n        $compileProvider.directive('compile', function($compile) {\n          // directive factory creates a link function\n          return function(scope, element, attrs) {\n            scope.$watch(\n              function(scope) {\n                 // watch the 'compile' expression for changes\n                return scope.$eval(attrs.compile);\n              },\n              function(value) {\n                // when the 'compile' expression changes\n                // assign it into the current DOM\n                element.html(value);\n\n                // compile the new DOM and link it to the current\n                // scope.\n                // NOTE: we only compile .childNodes so that\n                // we don't get into infinite loop compiling ourselves\n                $compile(element.contents())(scope);\n              }\n            );\n          };\n        });\n      })\n      .controller('GreeterController', ['$scope', function($scope) {\n        $scope.name = 'Angular';\n        $scope.html = 'Hello {{name}}';\n      }]);\n    </script>\n    <div ng-controller=\"GreeterController\">\n      <input ng-model=\"name\"> <br>\n      <textarea ng-model=\"html\"></textarea> <br>\n      <div compile=\"html\"></div>\n    </div>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n     it('should auto compile', function() {\n       var textarea = $('textarea');\n       var output = $('div[compile]');\n       // The initial state reads 'Hello Angular'.\n       expect(output.getText()).toBe('Hello Angular');\n       textarea.clear();\n       textarea.sendKeys('{{name}}!');\n       expect(output.getText()).toBe('Angular!');\n     });\n   </file>\n </example>\n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n * <div class=\"alert alert-error\">\n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n *   e.g. will not use the right outer scope. Please pass the transclude function as a\n *   `parentBoundTranscludeFn` to the link function instead.\n * </div>\n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n *                 root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n *  * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n *  `template` and call the `cloneAttachFn` function allowing the caller to attach the\n *  cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n *  called as: <br> `cloneAttachFn(clonedElement, scope)` where:\n *\n *      * `clonedElement` - is a clone of the original `element` passed into the compiler.\n *      * `scope` - is the current scope with which the linking function is working with.\n *\n *  * `options` - An optional object hash with linking options. If `options` is provided, then the following\n *  keys may be used to control linking behavior:\n *\n *      * `parentBoundTranscludeFn` - the transclude function made available to\n *        directives; if given, it will be passed through to the link functions of\n *        directives found in `element` during compilation.\n *      * `transcludeControllers` - an object hash with keys that map controller names\n *        to controller instances; if given, it will make the controllers\n *        available to directives.\n *      * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n *        the cloned elements; only needed for transcludes that are allowed to contain non html\n *        elements (e.g. SVG elements). See also the directive.controller property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to $digest which typically is done by\n * Angular automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n *   before you send them to the compiler and keep this reference around.\n *   ```js\n *     var element = $compile('<p>{{total}}</p>')(scope);\n *   ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n *   example would not point to the clone, but rather to the original template that was cloned. In\n *   this case, you can access the clone via the cloneAttachFn:\n *   ```js\n *     var templateElement = angular.element('<p>{{total}}</p>'),\n *         scope = ....;\n *\n *     var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n *       //attach the clone to DOM document at the right place\n *     });\n *\n *     //now we have reference to the cloned DOM via `clonedElement`\n *   ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.\n */\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n  var hasDirectives = {},\n      Suffix = 'Directive',\n      COMMENT_DIRECTIVE_REGEXP = /^\\s*directive\\:\\s*([\\w\\-]+)\\s+(.*)$/,\n      CLASS_DIRECTIVE_REGEXP = /(([\\w\\-]+)(?:\\:([^;]+))?;?)/,\n      ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n      REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n  // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n  // The assumption is that future DOM event attribute names will begin with\n  // 'on' and be composed of only English letters.\n  var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n\n  function parseIsolateBindings(scope, directiveName) {\n    var LOCAL_REGEXP = /^\\s*([@&]|=(\\*?))(\\??)\\s*(\\w*)\\s*$/;\n\n    var bindings = {};\n\n    forEach(scope, function(definition, scopeName) {\n      var match = definition.match(LOCAL_REGEXP);\n\n      if (!match) {\n        throw $compileMinErr('iscp',\n            \"Invalid isolate scope definition for directive '{0}'.\" +\n            \" Definition: {... {1}: '{2}' ...}\",\n            directiveName, scopeName, definition);\n      }\n\n      bindings[scopeName] = {\n        mode: match[1][0],\n        collection: match[2] === '*',\n        optional: match[3] === '?',\n        attrName: match[4] || scopeName\n      };\n    });\n\n    return bindings;\n  }\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#directive\n   * @kind function\n   *\n   * @description\n   * Register a new directive with the compiler.\n   *\n   * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which\n   *    will match as <code>ng-bind</code>), or an object map of directives where the keys are the\n   *    names and the values are the factories.\n   * @param {Function|Array} directiveFactory An injectable directive factory function. See\n   *    {@link guide/directive} for more info.\n   * @returns {ng.$compileProvider} Self for chaining.\n   */\n   this.directive = function registerDirective(name, directiveFactory) {\n    assertNotHasOwnProperty(name, 'directive');\n    if (isString(name)) {\n      assertArg(directiveFactory, 'directiveFactory');\n      if (!hasDirectives.hasOwnProperty(name)) {\n        hasDirectives[name] = [];\n        $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n          function($injector, $exceptionHandler) {\n            var directives = [];\n            forEach(hasDirectives[name], function(directiveFactory, index) {\n              try {\n                var directive = $injector.invoke(directiveFactory);\n                if (isFunction(directive)) {\n                  directive = { compile: valueFn(directive) };\n                } else if (!directive.compile && directive.link) {\n                  directive.compile = valueFn(directive.link);\n                }\n                directive.priority = directive.priority || 0;\n                directive.index = index;\n                directive.name = directive.name || name;\n                directive.require = directive.require || (directive.controller && directive.name);\n                directive.restrict = directive.restrict || 'EA';\n                if (isObject(directive.scope)) {\n                  directive.$$isolateBindings = parseIsolateBindings(directive.scope, directive.name);\n                }\n                directives.push(directive);\n              } catch (e) {\n                $exceptionHandler(e);\n              }\n            });\n            return directives;\n          }]);\n      }\n      hasDirectives[name].push(directiveFactory);\n    } else {\n      forEach(name, reverseParams(registerDirective));\n    }\n    return this;\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#aHrefSanitizationWhitelist\n   * @kind function\n   *\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during a[href] sanitization.\n   *\n   * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n   *\n   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.aHrefSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n      return this;\n    } else {\n      return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n    }\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $compileProvider#imgSrcSanitizationWhitelist\n   * @kind function\n   *\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during img[src] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.imgSrcSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);\n      return this;\n    } else {\n      return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name  $compileProvider#debugInfoEnabled\n   *\n   * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n   * current debugInfoEnabled state\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   *\n   * @kind function\n   *\n   * @description\n   * Call this method to enable/disable various debug runtime information in the compiler such as adding\n   * binding information and a reference to the current scope on to DOM elements.\n   * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n   * * `ng-binding` CSS class\n   * * `$binding` data property containing an array of the binding expressions\n   *\n   * You may want to disable this in production for a significant performance boost. See\n   * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n   *\n   * The default value is true.\n   */\n  var debugInfoEnabled = true;\n  this.debugInfoEnabled = function(enabled) {\n    if (isDefined(enabled)) {\n      debugInfoEnabled = enabled;\n      return this;\n    }\n    return debugInfoEnabled;\n  };\n\n  this.$get = [\n            '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n            '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',\n    function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,\n             $controller,   $rootScope,   $document,   $sce,   $animate,   $$sanitizeUri) {\n\n    var Attributes = function(element, attributesToCopy) {\n      if (attributesToCopy) {\n        var keys = Object.keys(attributesToCopy);\n        var i, l, key;\n\n        for (i = 0, l = keys.length; i < l; i++) {\n          key = keys[i];\n          this[key] = attributesToCopy[key];\n        }\n      } else {\n        this.$attr = {};\n      }\n\n      this.$$element = element;\n    };\n\n    Attributes.prototype = {\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$normalize\n       * @kind function\n       *\n       * @description\n       * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n       * `data-`) to its normalized, camelCase form.\n       *\n       * Also there is special case for Moz prefix starting with upper case letter.\n       *\n       * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n       *\n       * @param {string} name Name to normalize\n       */\n      $normalize: directiveNormalize,\n\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$addClass\n       * @kind function\n       *\n       * @description\n       * Adds the CSS class value specified by the classVal parameter to the element. If animations\n       * are enabled then an animation will be triggered for the class addition.\n       *\n       * @param {string} classVal The className value that will be added to the element\n       */\n      $addClass: function(classVal) {\n        if (classVal && classVal.length > 0) {\n          $animate.addClass(this.$$element, classVal);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$removeClass\n       * @kind function\n       *\n       * @description\n       * Removes the CSS class value specified by the classVal parameter from the element. If\n       * animations are enabled then an animation will be triggered for the class removal.\n       *\n       * @param {string} classVal The className value that will be removed from the element\n       */\n      $removeClass: function(classVal) {\n        if (classVal && classVal.length > 0) {\n          $animate.removeClass(this.$$element, classVal);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$updateClass\n       * @kind function\n       *\n       * @description\n       * Adds and removes the appropriate CSS class values to the element based on the difference\n       * between the new and old CSS class values (specified as newClasses and oldClasses).\n       *\n       * @param {string} newClasses The current CSS className value\n       * @param {string} oldClasses The former CSS className value\n       */\n      $updateClass: function(newClasses, oldClasses) {\n        var toAdd = tokenDifference(newClasses, oldClasses);\n        if (toAdd && toAdd.length) {\n          $animate.addClass(this.$$element, toAdd);\n        }\n\n        var toRemove = tokenDifference(oldClasses, newClasses);\n        if (toRemove && toRemove.length) {\n          $animate.removeClass(this.$$element, toRemove);\n        }\n      },\n\n      /**\n       * Set a normalized attribute on the element in a way such that all directives\n       * can share the attribute. This function properly handles boolean attributes.\n       * @param {string} key Normalized key. (ie ngAttribute)\n       * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n       * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n       *     Defaults to true.\n       * @param {string=} attrName Optional none normalized name. Defaults to key.\n       */\n      $set: function(key, value, writeAttr, attrName) {\n        // TODO: decide whether or not to throw an error if \"class\"\n        //is set through this function since it may cause $updateClass to\n        //become unstable.\n\n        var node = this.$$element[0],\n            booleanKey = getBooleanAttrName(node, key),\n            aliasedKey = getAliasedAttrName(node, key),\n            observer = key,\n            nodeName;\n\n        if (booleanKey) {\n          this.$$element.prop(key, value);\n          attrName = booleanKey;\n        } else if (aliasedKey) {\n          this[aliasedKey] = value;\n          observer = aliasedKey;\n        }\n\n        this[key] = value;\n\n        // translate normalized key to actual key\n        if (attrName) {\n          this.$attr[key] = attrName;\n        } else {\n          attrName = this.$attr[key];\n          if (!attrName) {\n            this.$attr[key] = attrName = snake_case(key, '-');\n          }\n        }\n\n        nodeName = nodeName_(this.$$element);\n\n        if ((nodeName === 'a' && key === 'href') ||\n            (nodeName === 'img' && key === 'src')) {\n          // sanitize a[href] and img[src] values\n          this[key] = value = $$sanitizeUri(value, key === 'src');\n        } else if (nodeName === 'img' && key === 'srcset') {\n          // sanitize img[srcset] values\n          var result = \"\";\n\n          // first check if there are spaces because it's not the same pattern\n          var trimmedSrcset = trim(value);\n          //                (   999x   ,|   999w   ,|   ,|,   )\n          var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n          var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n          // split srcset into tuple of uri and descriptor except for the last item\n          var rawUris = trimmedSrcset.split(pattern);\n\n          // for each tuples\n          var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n          for (var i = 0; i < nbrUrisWith2parts; i++) {\n            var innerIdx = i * 2;\n            // sanitize the uri\n            result += $$sanitizeUri(trim(rawUris[innerIdx]), true);\n            // add the descriptor\n            result += (\" \" + trim(rawUris[innerIdx + 1]));\n          }\n\n          // split the last item into uri and descriptor\n          var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n          // sanitize the last uri\n          result += $$sanitizeUri(trim(lastTuple[0]), true);\n\n          // and add the last descriptor if any\n          if (lastTuple.length === 2) {\n            result += (\" \" + trim(lastTuple[1]));\n          }\n          this[key] = value = result;\n        }\n\n        if (writeAttr !== false) {\n          if (value === null || value === undefined) {\n            this.$$element.removeAttr(attrName);\n          } else {\n            this.$$element.attr(attrName, value);\n          }\n        }\n\n        // fire observers\n        var $$observers = this.$$observers;\n        $$observers && forEach($$observers[observer], function(fn) {\n          try {\n            fn(value);\n          } catch (e) {\n            $exceptionHandler(e);\n          }\n        });\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $compile.directive.Attributes#$observe\n       * @kind function\n       *\n       * @description\n       * Observes an interpolated attribute.\n       *\n       * The observer function will be invoked once during the next `$digest` following\n       * compilation. The observer is then invoked whenever the interpolated value\n       * changes.\n       *\n       * @param {string} key Normalized key. (ie ngAttribute) .\n       * @param {function(interpolatedValue)} fn Function that will be called whenever\n                the interpolated value of the attribute changes.\n       *        See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info.\n       * @returns {function()} Returns a deregistration function for this observer.\n       */\n      $observe: function(key, fn) {\n        var attrs = this,\n            $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n            listeners = ($$observers[key] || ($$observers[key] = []));\n\n        listeners.push(fn);\n        $rootScope.$evalAsync(function() {\n          if (!listeners.$$inter && attrs.hasOwnProperty(key)) {\n            // no one registered attribute interpolation function, so lets call it manually\n            fn(attrs[key]);\n          }\n        });\n\n        return function() {\n          arrayRemove(listeners, fn);\n        };\n      }\n    };\n\n\n    function safeAddClass($element, className) {\n      try {\n        $element.addClass(className);\n      } catch (e) {\n        // ignore, since it means that we are trying to set class on\n        // SVG element, where class name is read-only.\n      }\n    }\n\n\n    var startSymbol = $interpolate.startSymbol(),\n        endSymbol = $interpolate.endSymbol(),\n        denormalizeTemplate = (startSymbol == '{{' || endSymbol  == '}}')\n            ? identity\n            : function denormalizeTemplate(template) {\n              return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n        },\n        NG_ATTR_BINDING = /^ngAttr[A-Z]/;\n\n    compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n      var bindings = $element.data('$binding') || [];\n\n      if (isArray(binding)) {\n        bindings = bindings.concat(binding);\n      } else {\n        bindings.push(binding);\n      }\n\n      $element.data('$binding', bindings);\n    } : noop;\n\n    compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n      safeAddClass($element, 'ng-binding');\n    } : noop;\n\n    compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n      var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n      $element.data(dataName, scope);\n    } : noop;\n\n    compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n      safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n    } : noop;\n\n    return compile;\n\n    //================================\n\n    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n                        previousCompileContext) {\n      if (!($compileNodes instanceof jqLite)) {\n        // jquery always rewraps, whereas we need to preserve the original selector so that we can\n        // modify it.\n        $compileNodes = jqLite($compileNodes);\n      }\n      // We can not compile top level text elements since text nodes can be merged and we will\n      // not be able to attach scope data to them, so we will wrap them in <span>\n      forEach($compileNodes, function(node, index) {\n        if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\\S+/) /* non-empty */ ) {\n          $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0];\n        }\n      });\n      var compositeLinkFn =\n              compileNodes($compileNodes, transcludeFn, $compileNodes,\n                           maxPriority, ignoreDirective, previousCompileContext);\n      compile.$$addScopeClass($compileNodes);\n      var namespace = null;\n      return function publicLinkFn(scope, cloneConnectFn, options) {\n        assertArg(scope, 'scope');\n\n        options = options || {};\n        var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n          transcludeControllers = options.transcludeControllers,\n          futureParentElement = options.futureParentElement;\n\n        // When `parentBoundTranscludeFn` is passed, it is a\n        // `controllersBoundTransclude` function (it was previously passed\n        // as `transclude` to directive.link) so we must unwrap it to get\n        // its `boundTranscludeFn`\n        if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n          parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n        }\n\n        if (!namespace) {\n          namespace = detectNamespaceForChildElements(futureParentElement);\n        }\n        var $linkNode;\n        if (namespace !== 'html') {\n          // When using a directive with replace:true and templateUrl the $compileNodes\n          // (or a child element inside of them)\n          // might change, so we need to recreate the namespace adapted compileNodes\n          // for call to the link function.\n          // Note: This will already clone the nodes...\n          $linkNode = jqLite(\n            wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())\n          );\n        } else if (cloneConnectFn) {\n          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n          // and sometimes changes the structure of the DOM.\n          $linkNode = JQLitePrototype.clone.call($compileNodes);\n        } else {\n          $linkNode = $compileNodes;\n        }\n\n        if (transcludeControllers) {\n          for (var controllerName in transcludeControllers) {\n            $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n          }\n        }\n\n        compile.$$addScopeInfo($linkNode, scope);\n\n        if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n        if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n        return $linkNode;\n      };\n    }\n\n    function detectNamespaceForChildElements(parentElement) {\n      // TODO: Make this detect MathML as well...\n      var node = parentElement && parentElement[0];\n      if (!node) {\n        return 'html';\n      } else {\n        return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html';\n      }\n    }\n\n    /**\n     * Compile function matches each node in nodeList against the directives. Once all directives\n     * for a particular node are collected their compile functions are executed. The compile\n     * functions return values - the linking functions - are combined into a composite linking\n     * function, which is the a linking function for the node.\n     *\n     * @param {NodeList} nodeList an array of nodes or NodeList to compile\n     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n     *        scope argument is auto-generated to the new child of the transcluded parent scope.\n     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n     *        the rootElement must be set the jqLite collection of the compile root. This is\n     *        needed so that the jqLite collection items can be replaced with widgets.\n     * @param {number=} maxPriority Max directive priority.\n     * @returns {Function} A composite linking function of all of the matched directives or null.\n     */\n    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n                            previousCompileContext) {\n      var linkFns = [],\n          attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n      for (var i = 0; i < nodeList.length; i++) {\n        attrs = new Attributes();\n\n        // we must always refer to nodeList[i] since the nodes can be replaced underneath us.\n        directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n                                        ignoreDirective);\n\n        nodeLinkFn = (directives.length)\n            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n                                      null, [], [], previousCompileContext)\n            : null;\n\n        if (nodeLinkFn && nodeLinkFn.scope) {\n          compile.$$addScopeClass(attrs.$$element);\n        }\n\n        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n                      !(childNodes = nodeList[i].childNodes) ||\n                      !childNodes.length)\n            ? null\n            : compileNodes(childNodes,\n                 nodeLinkFn ? (\n                  (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n                     && nodeLinkFn.transclude) : transcludeFn);\n\n        if (nodeLinkFn || childLinkFn) {\n          linkFns.push(i, nodeLinkFn, childLinkFn);\n          linkFnFound = true;\n          nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n        }\n\n        //use the previous context only for the first element in the virtual group\n        previousCompileContext = null;\n      }\n\n      // return a linking function if we have found anything, null otherwise\n      return linkFnFound ? compositeLinkFn : null;\n\n      function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n        var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n        var stableNodeList;\n\n\n        if (nodeLinkFnFound) {\n          // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n          // offsets don't get screwed up\n          var nodeListLength = nodeList.length;\n          stableNodeList = new Array(nodeListLength);\n\n          // create a sparse array by only copying the elements which have a linkFn\n          for (i = 0; i < linkFns.length; i+=3) {\n            idx = linkFns[i];\n            stableNodeList[idx] = nodeList[idx];\n          }\n        } else {\n          stableNodeList = nodeList;\n        }\n\n        for (i = 0, ii = linkFns.length; i < ii;) {\n          node = stableNodeList[linkFns[i++]];\n          nodeLinkFn = linkFns[i++];\n          childLinkFn = linkFns[i++];\n\n          if (nodeLinkFn) {\n            if (nodeLinkFn.scope) {\n              childScope = scope.$new();\n              compile.$$addScopeInfo(jqLite(node), childScope);\n            } else {\n              childScope = scope;\n            }\n\n            if (nodeLinkFn.transcludeOnThisElement) {\n              childBoundTranscludeFn = createBoundTranscludeFn(\n                  scope, nodeLinkFn.transclude, parentBoundTranscludeFn,\n                  nodeLinkFn.elementTranscludeOnThisElement);\n\n            } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n              childBoundTranscludeFn = parentBoundTranscludeFn;\n\n            } else if (!parentBoundTranscludeFn && transcludeFn) {\n              childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n            } else {\n              childBoundTranscludeFn = null;\n            }\n\n            nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n          } else if (childLinkFn) {\n            childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n          }\n        }\n      }\n    }\n\n    function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn, elementTransclusion) {\n\n      var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n        if (!transcludedScope) {\n          transcludedScope = scope.$new(false, containingScope);\n          transcludedScope.$$transcluded = true;\n        }\n\n        return transcludeFn(transcludedScope, cloneFn, {\n          parentBoundTranscludeFn: previousBoundTranscludeFn,\n          transcludeControllers: controllers,\n          futureParentElement: futureParentElement\n        });\n      };\n\n      return boundTranscludeFn;\n    }\n\n    /**\n     * Looks for directives on the given node and adds them to the directive collection which is\n     * sorted.\n     *\n     * @param node Node to search.\n     * @param directives An array to which the directives are added to. This array is sorted before\n     *        the function returns.\n     * @param attrs The shared attrs object which is used to populate the normalized attributes.\n     * @param {number=} maxPriority Max directive priority.\n     */\n    function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n      var nodeType = node.nodeType,\n          attrsMap = attrs.$attr,\n          match,\n          className;\n\n      switch (nodeType) {\n        case NODE_TYPE_ELEMENT: /* Element */\n          // use the node name: <directive>\n          addDirective(directives,\n              directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);\n\n          // iterate over the attributes\n          for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n                   j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n            var attrStartName = false;\n            var attrEndName = false;\n\n            attr = nAttrs[j];\n            name = attr.name;\n            value = trim(attr.value);\n\n            // support ngAttr attribute binding\n            ngAttrName = directiveNormalize(name);\n            if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {\n              name = name.replace(PREFIX_REGEXP, '')\n                .substr(8).replace(/_(.)/g, function(match, letter) {\n                  return letter.toUpperCase();\n                });\n            }\n\n            var directiveNName = ngAttrName.replace(/(Start|End)$/, '');\n            if (directiveIsMultiElement(directiveNName)) {\n              if (ngAttrName === directiveNName + 'Start') {\n                attrStartName = name;\n                attrEndName = name.substr(0, name.length - 5) + 'end';\n                name = name.substr(0, name.length - 6);\n              }\n            }\n\n            nName = directiveNormalize(name.toLowerCase());\n            attrsMap[nName] = name;\n            if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n                attrs[nName] = value;\n                if (getBooleanAttrName(node, nName)) {\n                  attrs[nName] = true; // presence means true\n                }\n            }\n            addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n            addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n                          attrEndName);\n          }\n\n          // use class as directive\n          className = node.className;\n          if (isObject(className)) {\n              // Maybe SVGAnimatedString\n              className = className.animVal;\n          }\n          if (isString(className) && className !== '') {\n            while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {\n              nName = directiveNormalize(match[2]);\n              if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n                attrs[nName] = trim(match[3]);\n              }\n              className = className.substr(match.index + match[0].length);\n            }\n          }\n          break;\n        case NODE_TYPE_TEXT: /* Text Node */\n          addTextInterpolateDirective(directives, node.nodeValue);\n          break;\n        case NODE_TYPE_COMMENT: /* Comment */\n          try {\n            match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n            if (match) {\n              nName = directiveNormalize(match[1]);\n              if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n                attrs[nName] = trim(match[2]);\n              }\n            }\n          } catch (e) {\n            // turns out that under some circumstances IE9 throws errors when one attempts to read\n            // comment's node value.\n            // Just ignore it and continue. (Can't seem to reproduce in test case.)\n          }\n          break;\n      }\n\n      directives.sort(byPriority);\n      return directives;\n    }\n\n    /**\n     * Given a node with an directive-start it collects all of the siblings until it finds\n     * directive-end.\n     * @param node\n     * @param attrStart\n     * @param attrEnd\n     * @returns {*}\n     */\n    function groupScan(node, attrStart, attrEnd) {\n      var nodes = [];\n      var depth = 0;\n      if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n        do {\n          if (!node) {\n            throw $compileMinErr('uterdir',\n                      \"Unterminated attribute, found '{0}' but no matching '{1}' found.\",\n                      attrStart, attrEnd);\n          }\n          if (node.nodeType == NODE_TYPE_ELEMENT) {\n            if (node.hasAttribute(attrStart)) depth++;\n            if (node.hasAttribute(attrEnd)) depth--;\n          }\n          nodes.push(node);\n          node = node.nextSibling;\n        } while (depth > 0);\n      } else {\n        nodes.push(node);\n      }\n\n      return jqLite(nodes);\n    }\n\n    /**\n     * Wrapper for linking function which converts normal linking function into a grouped\n     * linking function.\n     * @param linkFn\n     * @param attrStart\n     * @param attrEnd\n     * @returns {Function}\n     */\n    function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n      return function(scope, element, attrs, controllers, transcludeFn) {\n        element = groupScan(element[0], attrStart, attrEnd);\n        return linkFn(scope, element, attrs, controllers, transcludeFn);\n      };\n    }\n\n    /**\n     * Once the directives have been collected, their compile functions are executed. This method\n     * is responsible for inlining directive templates as well as terminating the application\n     * of the directives if the terminal directive has been reached.\n     *\n     * @param {Array} directives Array of collected directives to execute their compile function.\n     *        this needs to be pre-sorted by priority order.\n     * @param {Node} compileNode The raw DOM node to apply the compile functions to\n     * @param {Object} templateAttrs The shared attribute function\n     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n     *                                                  scope argument is auto-generated to the new\n     *                                                  child of the transcluded parent scope.\n     * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n     *                              argument has the root jqLite array so that we can replace nodes\n     *                              on it.\n     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n     *                                           compiling the transclusion.\n     * @param {Array.<Function>} preLinkFns\n     * @param {Array.<Function>} postLinkFns\n     * @param {Object} previousCompileContext Context used for previous compilation of the current\n     *                                        node\n     * @returns {Function} linkFn\n     */\n    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n                                   previousCompileContext) {\n      previousCompileContext = previousCompileContext || {};\n\n      var terminalPriority = -Number.MAX_VALUE,\n          newScopeDirective,\n          controllerDirectives = previousCompileContext.controllerDirectives,\n          controllers,\n          newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n          templateDirective = previousCompileContext.templateDirective,\n          nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n          hasTranscludeDirective = false,\n          hasTemplate = false,\n          hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n          $compileNode = templateAttrs.$$element = jqLite(compileNode),\n          directive,\n          directiveName,\n          $template,\n          replaceDirective = originalReplaceDirective,\n          childTranscludeFn = transcludeFn,\n          linkFn,\n          directiveValue;\n\n      // executes all directives on the current element\n      for (var i = 0, ii = directives.length; i < ii; i++) {\n        directive = directives[i];\n        var attrStart = directive.$$start;\n        var attrEnd = directive.$$end;\n\n        // collect multiblock sections\n        if (attrStart) {\n          $compileNode = groupScan(compileNode, attrStart, attrEnd);\n        }\n        $template = undefined;\n\n        if (terminalPriority > directive.priority) {\n          break; // prevent further processing of directives\n        }\n\n        if (directiveValue = directive.scope) {\n\n          // skip the check for directives with async templates, we'll check the derived sync\n          // directive when the template arrives\n          if (!directive.templateUrl) {\n            if (isObject(directiveValue)) {\n              // This directive is trying to add an isolated scope.\n              // Check that there is no scope of any kind already\n              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n                                directive, $compileNode);\n              newIsolateScopeDirective = directive;\n            } else {\n              // This directive is trying to add a child scope.\n              // Check that there is no isolated scope already\n              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n                                $compileNode);\n            }\n          }\n\n          newScopeDirective = newScopeDirective || directive;\n        }\n\n        directiveName = directive.name;\n\n        if (!directive.templateUrl && directive.controller) {\n          directiveValue = directive.controller;\n          controllerDirectives = controllerDirectives || {};\n          assertNoDuplicate(\"'\" + directiveName + \"' controller\",\n              controllerDirectives[directiveName], directive, $compileNode);\n          controllerDirectives[directiveName] = directive;\n        }\n\n        if (directiveValue = directive.transclude) {\n          hasTranscludeDirective = true;\n\n          // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n          // This option should only be used by directives that know how to safely handle element transclusion,\n          // where the transcluded nodes are added or replaced after linking.\n          if (!directive.$$tlb) {\n            assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n            nonTlbTranscludeDirective = directive;\n          }\n\n          if (directiveValue == 'element') {\n            hasElementTranscludeDirective = true;\n            terminalPriority = directive.priority;\n            $template = $compileNode;\n            $compileNode = templateAttrs.$$element =\n                jqLite(document.createComment(' ' + directiveName + ': ' +\n                                              templateAttrs[directiveName] + ' '));\n            compileNode = $compileNode[0];\n            replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n            childTranscludeFn = compile($template, transcludeFn, terminalPriority,\n                                        replaceDirective && replaceDirective.name, {\n                                          // Don't pass in:\n                                          // - controllerDirectives - otherwise we'll create duplicates controllers\n                                          // - newIsolateScopeDirective or templateDirective - combining templates with\n                                          //   element transclusion doesn't make sense.\n                                          //\n                                          // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n                                          // on the same element more than once.\n                                          nonTlbTranscludeDirective: nonTlbTranscludeDirective\n                                        });\n          } else {\n            $template = jqLite(jqLiteClone(compileNode)).contents();\n            $compileNode.empty(); // clear contents\n            childTranscludeFn = compile($template, transcludeFn);\n          }\n        }\n\n        if (directive.template) {\n          hasTemplate = true;\n          assertNoDuplicate('template', templateDirective, directive, $compileNode);\n          templateDirective = directive;\n\n          directiveValue = (isFunction(directive.template))\n              ? directive.template($compileNode, templateAttrs)\n              : directive.template;\n\n          directiveValue = denormalizeTemplate(directiveValue);\n\n          if (directive.replace) {\n            replaceDirective = directive;\n            if (jqLiteIsTextNode(directiveValue)) {\n              $template = [];\n            } else {\n              $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n            }\n            compileNode = $template[0];\n\n            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n              throw $compileMinErr('tplrt',\n                  \"Template for directive '{0}' must have exactly one root element. {1}\",\n                  directiveName, '');\n            }\n\n            replaceWith(jqCollection, $compileNode, compileNode);\n\n            var newTemplateAttrs = {$attr: {}};\n\n            // combine directives from the original node and from the template:\n            // - take the array of directives for this element\n            // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n            // - collect directives from the template and sort them by priority\n            // - combine directives as: processed + template + unprocessed\n            var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n            var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n            if (newIsolateScopeDirective) {\n              markDirectivesAsIsolate(templateDirectives);\n            }\n            directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n            mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n            ii = directives.length;\n          } else {\n            $compileNode.html(directiveValue);\n          }\n        }\n\n        if (directive.templateUrl) {\n          hasTemplate = true;\n          assertNoDuplicate('template', templateDirective, directive, $compileNode);\n          templateDirective = directive;\n\n          if (directive.replace) {\n            replaceDirective = directive;\n          }\n\n          nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n              templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n                controllerDirectives: controllerDirectives,\n                newIsolateScopeDirective: newIsolateScopeDirective,\n                templateDirective: templateDirective,\n                nonTlbTranscludeDirective: nonTlbTranscludeDirective\n              });\n          ii = directives.length;\n        } else if (directive.compile) {\n          try {\n            linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n            if (isFunction(linkFn)) {\n              addLinkFns(null, linkFn, attrStart, attrEnd);\n            } else if (linkFn) {\n              addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);\n            }\n          } catch (e) {\n            $exceptionHandler(e, startingTag($compileNode));\n          }\n        }\n\n        if (directive.terminal) {\n          nodeLinkFn.terminal = true;\n          terminalPriority = Math.max(terminalPriority, directive.priority);\n        }\n\n      }\n\n      nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n      nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n      nodeLinkFn.elementTranscludeOnThisElement = hasElementTranscludeDirective;\n      nodeLinkFn.templateOnThisElement = hasTemplate;\n      nodeLinkFn.transclude = childTranscludeFn;\n\n      previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n      // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n      return nodeLinkFn;\n\n      ////////////////////\n\n      function addLinkFns(pre, post, attrStart, attrEnd) {\n        if (pre) {\n          if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n          pre.require = directive.require;\n          pre.directiveName = directiveName;\n          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n            pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n          }\n          preLinkFns.push(pre);\n        }\n        if (post) {\n          if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n          post.require = directive.require;\n          post.directiveName = directiveName;\n          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n            post = cloneAndAnnotateFn(post, {isolateScope: true});\n          }\n          postLinkFns.push(post);\n        }\n      }\n\n\n      function getControllers(directiveName, require, $element, elementControllers) {\n        var value, retrievalMethod = 'data', optional = false;\n        var $searchElement = $element;\n        var match;\n        if (isString(require)) {\n          match = require.match(REQUIRE_PREFIX_REGEXP);\n          require = require.substring(match[0].length);\n\n          if (match[3]) {\n            if (match[1]) match[3] = null;\n            else match[1] = match[3];\n          }\n          if (match[1] === '^') {\n            retrievalMethod = 'inheritedData';\n          } else if (match[1] === '^^') {\n            retrievalMethod = 'inheritedData';\n            $searchElement = $element.parent();\n          }\n          if (match[2] === '?') {\n            optional = true;\n          }\n\n          value = null;\n\n          if (elementControllers && retrievalMethod === 'data') {\n            if (value = elementControllers[require]) {\n              value = value.instance;\n            }\n          }\n          value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');\n\n          if (!value && !optional) {\n            throw $compileMinErr('ctreq',\n                \"Controller '{0}', required by directive '{1}', can't be found!\",\n                require, directiveName);\n          }\n          return value || null;\n        } else if (isArray(require)) {\n          value = [];\n          forEach(require, function(require) {\n            value.push(getControllers(directiveName, require, $element, elementControllers));\n          });\n        }\n        return value;\n      }\n\n\n      function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n        var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element,\n            attrs;\n\n        if (compileNode === linkNode) {\n          attrs = templateAttrs;\n          $element = templateAttrs.$$element;\n        } else {\n          $element = jqLite(linkNode);\n          attrs = new Attributes($element, templateAttrs);\n        }\n\n        if (newIsolateScopeDirective) {\n          isolateScope = scope.$new(true);\n        }\n\n        if (boundTranscludeFn) {\n          // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n          // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n          transcludeFn = controllersBoundTransclude;\n          transcludeFn.$$boundTransclude = boundTranscludeFn;\n        }\n\n        if (controllerDirectives) {\n          // TODO: merge `controllers` and `elementControllers` into single object.\n          controllers = {};\n          elementControllers = {};\n          forEach(controllerDirectives, function(directive) {\n            var locals = {\n              $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n              $element: $element,\n              $attrs: attrs,\n              $transclude: transcludeFn\n            }, controllerInstance;\n\n            controller = directive.controller;\n            if (controller == '@') {\n              controller = attrs[directive.name];\n            }\n\n            controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n            // For directives with element transclusion the element is a comment,\n            // but jQuery .data doesn't support attaching data to comment nodes as it's hard to\n            // clean up (http://bugs.jquery.com/ticket/8335).\n            // Instead, we save the controllers for the element in a local hash and attach to .data\n            // later, once we have the actual element.\n            elementControllers[directive.name] = controllerInstance;\n            if (!hasElementTranscludeDirective) {\n              $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n            }\n\n            controllers[directive.name] = controllerInstance;\n          });\n        }\n\n        if (newIsolateScopeDirective) {\n          compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n              templateDirective === newIsolateScopeDirective.$$originalDirective)));\n          compile.$$addScopeClass($element, true);\n\n          var isolateScopeController = controllers && controllers[newIsolateScopeDirective.name];\n          var isolateBindingContext = isolateScope;\n          if (isolateScopeController && isolateScopeController.identifier &&\n              newIsolateScopeDirective.bindToController === true) {\n            isolateBindingContext = isolateScopeController.instance;\n          }\n\n          forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) {\n            var attrName = definition.attrName,\n                optional = definition.optional,\n                mode = definition.mode, // @, =, or &\n                lastValue,\n                parentGet, parentSet, compare;\n\n            switch (mode) {\n\n              case '@':\n                attrs.$observe(attrName, function(value) {\n                  isolateBindingContext[scopeName] = value;\n                });\n                attrs.$$observers[attrName].$$scope = scope;\n                if (attrs[attrName]) {\n                  // If the attribute has been provided then we trigger an interpolation to ensure\n                  // the value is there for use in the link fn\n                  isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);\n                }\n                break;\n\n              case '=':\n                if (optional && !attrs[attrName]) {\n                  return;\n                }\n                parentGet = $parse(attrs[attrName]);\n                if (parentGet.literal) {\n                  compare = equals;\n                } else {\n                  compare = function(a, b) { return a === b || (a !== a && b !== b); };\n                }\n                parentSet = parentGet.assign || function() {\n                  // reset the change, or we will throw this exception on every $digest\n                  lastValue = isolateBindingContext[scopeName] = parentGet(scope);\n                  throw $compileMinErr('nonassign',\n                      \"Expression '{0}' used with directive '{1}' is non-assignable!\",\n                      attrs[attrName], newIsolateScopeDirective.name);\n                };\n                lastValue = isolateBindingContext[scopeName] = parentGet(scope);\n                var parentValueWatch = function parentValueWatch(parentValue) {\n                  if (!compare(parentValue, isolateBindingContext[scopeName])) {\n                    // we are out of sync and need to copy\n                    if (!compare(parentValue, lastValue)) {\n                      // parent changed and it has precedence\n                      isolateBindingContext[scopeName] = parentValue;\n                    } else {\n                      // if the parent can be assigned then do so\n                      parentSet(scope, parentValue = isolateBindingContext[scopeName]);\n                    }\n                  }\n                  return lastValue = parentValue;\n                };\n                parentValueWatch.$stateful = true;\n                var unwatch;\n                if (definition.collection) {\n                  unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n                } else {\n                  unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n                }\n                isolateScope.$on('$destroy', unwatch);\n                break;\n\n              case '&':\n                parentGet = $parse(attrs[attrName]);\n                isolateBindingContext[scopeName] = function(locals) {\n                  return parentGet(scope, locals);\n                };\n                break;\n            }\n          });\n        }\n        if (controllers) {\n          forEach(controllers, function(controller) {\n            controller();\n          });\n          controllers = null;\n        }\n\n        // PRELINKING\n        for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n          linkFn = preLinkFns[i];\n          invokeLinkFn(linkFn,\n              linkFn.isolateScope ? isolateScope : scope,\n              $element,\n              attrs,\n              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n              transcludeFn\n          );\n        }\n\n        // RECURSION\n        // We only pass the isolate scope, if the isolate directive has a template,\n        // otherwise the child elements do not belong to the isolate directive.\n        var scopeToChild = scope;\n        if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n          scopeToChild = isolateScope;\n        }\n        childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n\n        // POSTLINKING\n        for (i = postLinkFns.length - 1; i >= 0; i--) {\n          linkFn = postLinkFns[i];\n          invokeLinkFn(linkFn,\n              linkFn.isolateScope ? isolateScope : scope,\n              $element,\n              attrs,\n              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n              transcludeFn\n          );\n        }\n\n        // This is the function that is injected as `$transclude`.\n        // Note: all arguments are optional!\n        function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {\n          var transcludeControllers;\n\n          // No scope passed in:\n          if (!isScope(scope)) {\n            futureParentElement = cloneAttachFn;\n            cloneAttachFn = scope;\n            scope = undefined;\n          }\n\n          if (hasElementTranscludeDirective) {\n            transcludeControllers = elementControllers;\n          }\n          if (!futureParentElement) {\n            futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n          }\n          return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n        }\n      }\n    }\n\n    function markDirectivesAsIsolate(directives) {\n      // mark all directives as needing isolate scope.\n      for (var j = 0, jj = directives.length; j < jj; j++) {\n        directives[j] = inherit(directives[j], {$$isolateScope: true});\n      }\n    }\n\n    /**\n     * looks up the directive and decorates it with exception handling and proper parameters. We\n     * call this the boundDirective.\n     *\n     * @param {string} name name of the directive to look up.\n     * @param {string} location The directive must be found in specific format.\n     *   String containing any of theses characters:\n     *\n     *   * `E`: element name\n     *   * `A': attribute\n     *   * `C`: class\n     *   * `M`: comment\n     * @returns {boolean} true if directive was added.\n     */\n    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n                          endAttrName) {\n      if (name === ignoreDirective) return null;\n      var match = null;\n      if (hasDirectives.hasOwnProperty(name)) {\n        for (var directive, directives = $injector.get(name + Suffix),\n            i = 0, ii = directives.length; i < ii; i++) {\n          try {\n            directive = directives[i];\n            if ((maxPriority === undefined || maxPriority > directive.priority) &&\n                 directive.restrict.indexOf(location) != -1) {\n              if (startAttrName) {\n                directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n              }\n              tDirectives.push(directive);\n              match = directive;\n            }\n          } catch (e) { $exceptionHandler(e); }\n        }\n      }\n      return match;\n    }\n\n\n    /**\n     * looks up the directive and returns true if it is a multi-element directive,\n     * and therefore requires DOM nodes between -start and -end markers to be grouped\n     * together.\n     *\n     * @param {string} name name of the directive to look up.\n     * @returns true if directive was registered as multi-element.\n     */\n    function directiveIsMultiElement(name) {\n      if (hasDirectives.hasOwnProperty(name)) {\n        for (var directive, directives = $injector.get(name + Suffix),\n            i = 0, ii = directives.length; i < ii; i++) {\n          directive = directives[i];\n          if (directive.multiElement) {\n            return true;\n          }\n        }\n      }\n      return false;\n    }\n\n    /**\n     * When the element is replaced with HTML template then the new attributes\n     * on the template need to be merged with the existing attributes in the DOM.\n     * The desired effect is to have both of the attributes present.\n     *\n     * @param {object} dst destination attributes (original DOM)\n     * @param {object} src source attributes (from the directive template)\n     */\n    function mergeTemplateAttributes(dst, src) {\n      var srcAttr = src.$attr,\n          dstAttr = dst.$attr,\n          $element = dst.$$element;\n\n      // reapply the old attributes to the new element\n      forEach(dst, function(value, key) {\n        if (key.charAt(0) != '$') {\n          if (src[key] && src[key] !== value) {\n            value += (key === 'style' ? ';' : ' ') + src[key];\n          }\n          dst.$set(key, value, true, srcAttr[key]);\n        }\n      });\n\n      // copy the new attributes on the old attrs object\n      forEach(src, function(value, key) {\n        if (key == 'class') {\n          safeAddClass($element, value);\n          dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;\n        } else if (key == 'style') {\n          $element.attr('style', $element.attr('style') + ';' + value);\n          dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;\n          // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n          // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n          // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n        } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {\n          dst[key] = value;\n          dstAttr[key] = srcAttr[key];\n        }\n      });\n    }\n\n\n    function compileTemplateUrl(directives, $compileNode, tAttrs,\n        $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n      var linkQueue = [],\n          afterTemplateNodeLinkFn,\n          afterTemplateChildLinkFn,\n          beforeTemplateCompileNode = $compileNode[0],\n          origAsyncDirective = directives.shift(),\n          derivedSyncDirective = inherit(origAsyncDirective, {\n            templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n          }),\n          templateUrl = (isFunction(origAsyncDirective.templateUrl))\n              ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n              : origAsyncDirective.templateUrl,\n          templateNamespace = origAsyncDirective.templateNamespace;\n\n      $compileNode.empty();\n\n      $templateRequest($sce.getTrustedResourceUrl(templateUrl))\n        .then(function(content) {\n          var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n          content = denormalizeTemplate(content);\n\n          if (origAsyncDirective.replace) {\n            if (jqLiteIsTextNode(content)) {\n              $template = [];\n            } else {\n              $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n            }\n            compileNode = $template[0];\n\n            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n              throw $compileMinErr('tplrt',\n                  \"Template for directive '{0}' must have exactly one root element. {1}\",\n                  origAsyncDirective.name, templateUrl);\n            }\n\n            tempTemplateAttrs = {$attr: {}};\n            replaceWith($rootElement, $compileNode, compileNode);\n            var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n            if (isObject(origAsyncDirective.scope)) {\n              markDirectivesAsIsolate(templateDirectives);\n            }\n            directives = templateDirectives.concat(directives);\n            mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n          } else {\n            compileNode = beforeTemplateCompileNode;\n            $compileNode.html(content);\n          }\n\n          directives.unshift(derivedSyncDirective);\n\n          afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n              previousCompileContext);\n          forEach($rootElement, function(node, i) {\n            if (node == compileNode) {\n              $rootElement[i] = $compileNode[0];\n            }\n          });\n          afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n          while (linkQueue.length) {\n            var scope = linkQueue.shift(),\n                beforeTemplateLinkNode = linkQueue.shift(),\n                linkRootElement = linkQueue.shift(),\n                boundTranscludeFn = linkQueue.shift(),\n                linkNode = $compileNode[0];\n\n            if (scope.$$destroyed) continue;\n\n            if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n              var oldClasses = beforeTemplateLinkNode.className;\n\n              if (!(previousCompileContext.hasElementTranscludeDirective &&\n                  origAsyncDirective.replace)) {\n                // it was cloned therefore we have to clone as well.\n                linkNode = jqLiteClone(compileNode);\n              }\n              replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n              // Copy in CSS classes from original node\n              safeAddClass(jqLite(linkNode), oldClasses);\n            }\n            if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n              childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n            } else {\n              childBoundTranscludeFn = boundTranscludeFn;\n            }\n            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n              childBoundTranscludeFn);\n          }\n          linkQueue = null;\n        });\n\n      return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n        var childBoundTranscludeFn = boundTranscludeFn;\n        if (scope.$$destroyed) return;\n        if (linkQueue) {\n          linkQueue.push(scope,\n                         node,\n                         rootElement,\n                         childBoundTranscludeFn);\n        } else {\n          if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n            childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n          }\n          afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n        }\n      };\n    }\n\n\n    /**\n     * Sorting function for bound directives.\n     */\n    function byPriority(a, b) {\n      var diff = b.priority - a.priority;\n      if (diff !== 0) return diff;\n      if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n      return a.index - b.index;\n    }\n\n\n    function assertNoDuplicate(what, previousDirective, directive, element) {\n      if (previousDirective) {\n        throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}',\n            previousDirective.name, directive.name, what, startingTag(element));\n      }\n    }\n\n\n    function addTextInterpolateDirective(directives, text) {\n      var interpolateFn = $interpolate(text, true);\n      if (interpolateFn) {\n        directives.push({\n          priority: 0,\n          compile: function textInterpolateCompileFn(templateNode) {\n            var templateNodeParent = templateNode.parent(),\n                hasCompileParent = !!templateNodeParent.length;\n\n            // When transcluding a template that has bindings in the root\n            // we don't have a parent and thus need to add the class during linking fn.\n            if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n            return function textInterpolateLinkFn(scope, node) {\n              var parent = node.parent();\n              if (!hasCompileParent) compile.$$addBindingClass(parent);\n              compile.$$addBindingInfo(parent, interpolateFn.expressions);\n              scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n                node[0].nodeValue = value;\n              });\n            };\n          }\n        });\n      }\n    }\n\n\n    function wrapTemplate(type, template) {\n      type = lowercase(type || 'html');\n      switch (type) {\n      case 'svg':\n      case 'math':\n        var wrapper = document.createElement('div');\n        wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';\n        return wrapper.childNodes[0].childNodes;\n      default:\n        return template;\n      }\n    }\n\n\n    function getTrustedContext(node, attrNormalizedName) {\n      if (attrNormalizedName == \"srcdoc\") {\n        return $sce.HTML;\n      }\n      var tag = nodeName_(node);\n      // maction[xlink:href] can source SVG.  It's not limited to <maction>.\n      if (attrNormalizedName == \"xlinkHref\" ||\n          (tag == \"form\" && attrNormalizedName == \"action\") ||\n          (tag != \"img\" && (attrNormalizedName == \"src\" ||\n                            attrNormalizedName == \"ngSrc\"))) {\n        return $sce.RESOURCE_URL;\n      }\n    }\n\n\n    function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {\n      var trustedContext = getTrustedContext(node, name);\n      allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;\n\n      var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);\n\n      // no interpolation found -> ignore\n      if (!interpolateFn) return;\n\n\n      if (name === \"multiple\" && nodeName_(node) === \"select\") {\n        throw $compileMinErr(\"selmulti\",\n            \"Binding to the 'multiple' attribute is not supported. Element: {0}\",\n            startingTag(node));\n      }\n\n      directives.push({\n        priority: 100,\n        compile: function() {\n            return {\n              pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n                var $$observers = (attr.$$observers || (attr.$$observers = {}));\n\n                if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n                  throw $compileMinErr('nodomevents',\n                      \"Interpolations for HTML DOM event attributes are disallowed.  Please use the \" +\n                          \"ng- versions (such as ng-click instead of onclick) instead.\");\n                }\n\n                // If the attribute has changed since last $interpolate()ed\n                var newValue = attr[name];\n                if (newValue !== value) {\n                  // we need to interpolate again since the attribute value has been updated\n                  // (e.g. by another directive's compile function)\n                  // ensure unset/empty values make interpolateFn falsy\n                  interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n                  value = newValue;\n                }\n\n                // if attribute was updated so that there is no interpolation going on we don't want to\n                // register any observers\n                if (!interpolateFn) return;\n\n                // initialize attr object so that it's ready in case we need the value for isolate\n                // scope initialization, otherwise the value would not be available from isolate\n                // directive's linking fn during linking phase\n                attr[name] = interpolateFn(scope);\n\n                ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n                (attr.$$observers && attr.$$observers[name].$$scope || scope).\n                  $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n                    //special case for class attribute addition + removal\n                    //so that class changes can tap into the animation\n                    //hooks provided by the $animate service. Be sure to\n                    //skip animations when the first digest occurs (when\n                    //both the new and the old values are the same) since\n                    //the CSS classes are the non-interpolated values\n                    if (name === 'class' && newValue != oldValue) {\n                      attr.$updateClass(newValue, oldValue);\n                    } else {\n                      attr.$set(name, newValue);\n                    }\n                  });\n              }\n            };\n          }\n      });\n    }\n\n\n    /**\n     * This is a special jqLite.replaceWith, which can replace items which\n     * have no parents, provided that the containing jqLite collection is provided.\n     *\n     * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n     *                               in the root of the tree.\n     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n     *                                  the shell, but replace its DOM node reference.\n     * @param {Node} newNode The new DOM node.\n     */\n    function replaceWith($rootElement, elementsToRemove, newNode) {\n      var firstElementToRemove = elementsToRemove[0],\n          removeCount = elementsToRemove.length,\n          parent = firstElementToRemove.parentNode,\n          i, ii;\n\n      if ($rootElement) {\n        for (i = 0, ii = $rootElement.length; i < ii; i++) {\n          if ($rootElement[i] == firstElementToRemove) {\n            $rootElement[i++] = newNode;\n            for (var j = i, j2 = j + removeCount - 1,\n                     jj = $rootElement.length;\n                 j < jj; j++, j2++) {\n              if (j2 < jj) {\n                $rootElement[j] = $rootElement[j2];\n              } else {\n                delete $rootElement[j];\n              }\n            }\n            $rootElement.length -= removeCount - 1;\n\n            // If the replaced element is also the jQuery .context then replace it\n            // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n            // http://api.jquery.com/context/\n            if ($rootElement.context === firstElementToRemove) {\n              $rootElement.context = newNode;\n            }\n            break;\n          }\n        }\n      }\n\n      if (parent) {\n        parent.replaceChild(newNode, firstElementToRemove);\n      }\n\n      // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it?\n      var fragment = document.createDocumentFragment();\n      fragment.appendChild(firstElementToRemove);\n\n      // Copy over user data (that includes Angular's $scope etc.). Don't copy private\n      // data here because there's no public interface in jQuery to do that and copying over\n      // event listeners (which is the main use of private data) wouldn't work anyway.\n      jqLite(newNode).data(jqLite(firstElementToRemove).data());\n\n      // Remove data of the replaced element. We cannot just call .remove()\n      // on the element it since that would deallocate scope that is needed\n      // for the new node. Instead, remove the data \"manually\".\n      if (!jQuery) {\n        delete jqLite.cache[firstElementToRemove[jqLite.expando]];\n      } else {\n        // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after\n        // the replaced element. The cleanData version monkey-patched by Angular would cause\n        // the scope to be trashed and we do need the very same scope to work with the new\n        // element. However, we cannot just cache the non-patched version and use it here as\n        // that would break if another library patches the method after Angular does (one\n        // example is jQuery UI). Instead, set a flag indicating scope destroying should be\n        // skipped this one time.\n        skipDestroyOnNextJQueryCleanData = true;\n        jQuery.cleanData([firstElementToRemove]);\n      }\n\n      for (var k = 1, kk = elementsToRemove.length; k < kk; k++) {\n        var element = elementsToRemove[k];\n        jqLite(element).remove(); // must do this way to clean up expando\n        fragment.appendChild(element);\n        delete elementsToRemove[k];\n      }\n\n      elementsToRemove[0] = newNode;\n      elementsToRemove.length = 1;\n    }\n\n\n    function cloneAndAnnotateFn(fn, annotation) {\n      return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n    }\n\n\n    function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n      try {\n        linkFn(scope, $element, attrs, controllers, transcludeFn);\n      } catch (e) {\n        $exceptionHandler(e, startingTag($element));\n      }\n    }\n  }];\n}\n\nvar PREFIX_REGEXP = /^((?:x|data)[\\:\\-_])/i;\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n  return camelCase(name.replace(PREFIX_REGEXP, ''));\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in Angular:\n *\n * ```\n *    <span ng:bind=\"a\" ng-bind=\"a\" data-ng-bind=\"a\" x-ng-bind=\"a\">\n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n *          reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n *          property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n  /* angular.Scope */ scope,\n  /* NodeList */ nodeList,\n  /* Element */ rootElement,\n  /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n  /* nodesetLinkingFn */ nodesetLinkingFn,\n  /* angular.Scope */ scope,\n  /* Node */ node,\n  /* Element */ rootElement,\n  /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n  var values = '',\n      tokens1 = str1.split(/\\s+/),\n      tokens2 = str2.split(/\\s+/);\n\n  outer:\n  for (var i = 0; i < tokens1.length; i++) {\n    var token = tokens1[i];\n    for (var j = 0; j < tokens2.length; j++) {\n      if (token == tokens2[j]) continue outer;\n    }\n    values += (values.length > 0 ? ' ' : '') + token;\n  }\n  return values;\n}\n\nfunction removeComments(jqNodes) {\n  jqNodes = jqLite(jqNodes);\n  var i = jqNodes.length;\n\n  if (i <= 1) {\n    return jqNodes;\n  }\n\n  while (i--) {\n    var node = jqNodes[i];\n    if (node.nodeType === NODE_TYPE_COMMENT) {\n      splice.call(jqNodes, i, 1);\n    }\n  }\n  return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @description\n * The {@link ng.$controller $controller service} is used by Angular to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n  var controllers = {},\n      globals = false,\n      CNTRL_REG = /^(\\S+)(\\s+as\\s+(\\w+))?$/;\n\n\n  /**\n   * @ngdoc method\n   * @name $controllerProvider#register\n   * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n   *    the names and the values are the constructors.\n   * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n   *    annotations in the array notation).\n   */\n  this.register = function(name, constructor) {\n    assertNotHasOwnProperty(name, 'controller');\n    if (isObject(name)) {\n      extend(controllers, name);\n    } else {\n      controllers[name] = constructor;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $controllerProvider#allowGlobals\n   * @description If called, allows `$controller` to find controller constructors on `window`\n   */\n  this.allowGlobals = function() {\n    globals = true;\n  };\n\n\n  this.$get = ['$injector', '$window', function($injector, $window) {\n\n    /**\n     * @ngdoc service\n     * @name $controller\n     * @requires $injector\n     *\n     * @param {Function|string} constructor If called with a function then it's considered to be the\n     *    controller constructor function. Otherwise it's considered to be a string which is used\n     *    to retrieve the controller constructor using the following steps:\n     *\n     *    * check if a controller with given name is registered via `$controllerProvider`\n     *    * check if evaluating the string on the current scope returns a constructor\n     *    * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n     *      `window` object (not recommended)\n     *\n     *    The string can use the `controller as property` syntax, where the controller instance is published\n     *    as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n     *    to work correctly.\n     *\n     * @param {Object} locals Injection locals for Controller.\n     * @return {Object} Instance of given controller.\n     *\n     * @description\n     * `$controller` service is responsible for instantiating controllers.\n     *\n     * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n     * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n     */\n    return function(expression, locals, later, ident) {\n      // PRIVATE API:\n      //   param `later` --- indicates that the controller's constructor is invoked at a later time.\n      //                     If true, $controller will allocate the object with the correct\n      //                     prototype chain, but will not invoke the controller until a returned\n      //                     callback is invoked.\n      //   param `ident` --- An optional label which overrides the label parsed from the controller\n      //                     expression, if any.\n      var instance, match, constructor, identifier;\n      later = later === true;\n      if (ident && isString(ident)) {\n        identifier = ident;\n      }\n\n      if (isString(expression)) {\n        match = expression.match(CNTRL_REG);\n        if (!match) {\n          throw $controllerMinErr('ctrlfmt',\n            \"Badly formed controller string '{0}'. \" +\n            \"Must match `__name__ as __id__` or `__name__`.\", expression);\n        }\n        constructor = match[1],\n        identifier = identifier || match[3];\n        expression = controllers.hasOwnProperty(constructor)\n            ? controllers[constructor]\n            : getter(locals.$scope, constructor, true) ||\n                (globals ? getter($window, constructor, true) : undefined);\n\n        assertArgFn(expression, constructor, true);\n      }\n\n      if (later) {\n        // Instantiate controller later:\n        // This machinery is used to create an instance of the object before calling the\n        // controller's constructor itself.\n        //\n        // This allows properties to be added to the controller before the constructor is\n        // invoked. Primarily, this is used for isolate scope bindings in $compile.\n        //\n        // This feature is not intended for use by applications, and is thus not documented\n        // publicly.\n        // Object creation: http://jsperf.com/create-constructor/2\n        var controllerPrototype = (isArray(expression) ?\n          expression[expression.length - 1] : expression).prototype;\n        instance = Object.create(controllerPrototype || null);\n\n        if (identifier) {\n          addIdentifier(locals, identifier, instance, constructor || expression.name);\n        }\n\n        return extend(function() {\n          $injector.invoke(expression, instance, locals, constructor);\n          return instance;\n        }, {\n          instance: instance,\n          identifier: identifier\n        });\n      }\n\n      instance = $injector.instantiate(expression, locals, constructor);\n\n      if (identifier) {\n        addIdentifier(locals, identifier, instance, constructor || expression.name);\n      }\n\n      return instance;\n    };\n\n    function addIdentifier(locals, identifier, instance, name) {\n      if (!(locals && isObject(locals.$scope))) {\n        throw minErr('$controller')('noscp',\n          \"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.\",\n          name, identifier);\n      }\n\n      locals.$scope[identifier] = instance;\n    }\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n   <example module=\"documentExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n         <p>$document title: <b ng-bind=\"title\"></b></p>\n         <p>window.document title: <b ng-bind=\"windowTitle\"></b></p>\n       </div>\n     </file>\n     <file name=\"script.js\">\n       angular.module('documentExample', [])\n         .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n           $scope.title = $document[0].title;\n           $scope.windowTitle = angular.element(window.document)[0].title;\n         }]);\n     </file>\n   </example>\n */\nfunction $DocumentProvider() {\n  this.$get = ['$window', function(window) {\n    return jqLite(window.document);\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n *\n * @description\n * Any uncaught exception in angular expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * ```js\n *   angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {\n *     return function(exception, cause) {\n *       exception.message += ' (caused by \"' + cause + '\")';\n *       throw exception;\n *     };\n *   });\n * ```\n *\n * This example will override the normal action of `$exceptionHandler`, to make angular\n * exceptions fail hard when they happen, instead of just logging to the console.\n *\n * <hr />\n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause optional information about the context in which\n *       the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n  this.$get = ['$log', function($log) {\n    return function(exception, cause) {\n      $log.error.apply($log, arguments);\n    };\n  }];\n}\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n  '[': /]$/,\n  '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\n\nfunction defaultHttpResponseTransform(data, headers) {\n  if (isString(data)) {\n    // Strip json vulnerability protection prefix and trim whitespace\n    var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n    if (tempData) {\n      var contentType = headers('Content-Type');\n      if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {\n        data = fromJson(tempData);\n      }\n    }\n  }\n\n  return data;\n}\n\nfunction isJsonLike(str) {\n    var jsonStart = str.match(JSON_START);\n    return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n  var parsed = createMap(), key, val, i;\n\n  if (!headers) return parsed;\n\n  forEach(headers.split('\\n'), function(line) {\n    i = line.indexOf(':');\n    key = lowercase(trim(line.substr(0, i)));\n    val = trim(line.substr(i + 1));\n\n    if (key) {\n      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n    }\n  });\n\n  return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n *   - if called with single an argument returns a single header value or null\n *   - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n  var headersObj = isObject(headers) ? headers : undefined;\n\n  return function(name) {\n    if (!headersObj) headersObj =  parseHeaders(headers);\n\n    if (name) {\n      var value = headersObj[lowercase(name)];\n      if (value === void 0) {\n        value = null;\n      }\n      return value;\n    }\n\n    return headersObj;\n  };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.<Function>)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n  if (isFunction(fns))\n    return fns(data, headers, status);\n\n  forEach(fns, function(fn) {\n    data = fn(data, headers, status);\n  });\n\n  return data;\n}\n\n\nfunction isSuccess(status) {\n  return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n * */\nfunction $HttpProvider() {\n  /**\n   * @ngdoc property\n   * @name $httpProvider#defaults\n   * @description\n   *\n   * Object containing default values for all {@link ng.$http $http} requests.\n   *\n   * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`}\n   * that will provide the cache for all requests who set their `cache` property to `true`.\n   * If you set the `default.cache = false` then only requests that specify their own custom\n   * cache object will be cached. See {@link $http#caching $http Caching} for more information.\n   *\n   * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n   * Defaults value is `'XSRF-TOKEN'`.\n   *\n   * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n   * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n   *\n   * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n   * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n   * setting default headers.\n   *     - **`defaults.headers.common`**\n   *     - **`defaults.headers.post`**\n   *     - **`defaults.headers.put`**\n   *     - **`defaults.headers.patch`**\n   *\n   **/\n  var defaults = this.defaults = {\n    // transform incoming response data\n    transformResponse: [defaultHttpResponseTransform],\n\n    // transform outgoing request data\n    transformRequest: [function(d) {\n      return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n    }],\n\n    // default headers\n    headers: {\n      common: {\n        'Accept': 'application/json, text/plain, */*'\n      },\n      post:   shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n      put:    shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n      patch:  shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n    },\n\n    xsrfCookieName: 'XSRF-TOKEN',\n    xsrfHeaderName: 'X-XSRF-TOKEN'\n  };\n\n  var useApplyAsync = false;\n  /**\n   * @ngdoc method\n   * @name $httpProvider#useApplyAsync\n   * @description\n   *\n   * Configure $http service to combine processing of multiple http responses received at around\n   * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n   * significant performance improvement for bigger applications that make many HTTP requests\n   * concurrently (common during application bootstrap).\n   *\n   * Defaults to false. If no value is specifed, returns the current configured value.\n   *\n   * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n   *    \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n   *    to load and share the same digest cycle.\n   *\n   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n   *    otherwise, returns the current configured value.\n   **/\n  this.useApplyAsync = function(value) {\n    if (isDefined(value)) {\n      useApplyAsync = !!value;\n      return this;\n    }\n    return useApplyAsync;\n  };\n\n  /**\n   * @ngdoc property\n   * @name $httpProvider#interceptors\n   * @description\n   *\n   * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n   * pre-processing of request or postprocessing of responses.\n   *\n   * These service factories are ordered by request, i.e. they are applied in the same order as the\n   * array, on request, but reverse order, on response.\n   *\n   * {@link ng.$http#interceptors Interceptors detailed info}\n   **/\n  var interceptorFactories = this.interceptors = [];\n\n  this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',\n      function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {\n\n    var defaultCache = $cacheFactory('$http');\n\n    /**\n     * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n     * The reversal is needed so that we can build up the interception chain around the\n     * server request.\n     */\n    var reversedInterceptors = [];\n\n    forEach(interceptorFactories, function(interceptorFactory) {\n      reversedInterceptors.unshift(isString(interceptorFactory)\n          ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n    });\n\n    /**\n     * @ngdoc service\n     * @kind function\n     * @name $http\n     * @requires ng.$httpBackend\n     * @requires $cacheFactory\n     * @requires $rootScope\n     * @requires $q\n     * @requires $injector\n     *\n     * @description\n     * The `$http` service is a core Angular service that facilitates communication with the remote\n     * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n     * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n     *\n     * For unit testing applications that use `$http` service, see\n     * {@link ngMock.$httpBackend $httpBackend mock}.\n     *\n     * For a higher level of abstraction, please check out the {@link ngResource.$resource\n     * $resource} service.\n     *\n     * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n     * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n     * it is important to familiarize yourself with these APIs and the guarantees they provide.\n     *\n     *\n     * ## General usage\n     * The `$http` service is a function which takes a single argument — a configuration object —\n     * that is used to generate an HTTP request and returns  a {@link ng.$q promise}\n     * with two $http specific methods: `success` and `error`.\n     *\n     * ```js\n     *   // Simple GET request example :\n     *   $http.get('/someUrl').\n     *     success(function(data, status, headers, config) {\n     *       // this callback will be called asynchronously\n     *       // when the response is available\n     *     }).\n     *     error(function(data, status, headers, config) {\n     *       // called asynchronously if an error occurs\n     *       // or server returns response with an error status.\n     *     });\n     * ```\n     *\n     * ```js\n     *   // Simple POST request example (passing data) :\n     *   $http.post('/someUrl', {msg:'hello word!'}).\n     *     success(function(data, status, headers, config) {\n     *       // this callback will be called asynchronously\n     *       // when the response is available\n     *     }).\n     *     error(function(data, status, headers, config) {\n     *       // called asynchronously if an error occurs\n     *       // or server returns response with an error status.\n     *     });\n     * ```\n     *\n     *\n     * Since the returned value of calling the $http function is a `promise`, you can also use\n     * the `then` method to register callbacks, and these callbacks will receive a single argument –\n     * an object representing the response. See the API signature and type info below for more\n     * details.\n     *\n     * A response status code between 200 and 299 is considered a success status and\n     * will result in the success callback being called. Note that if the response is a redirect,\n     * XMLHttpRequest will transparently follow it, meaning that the error callback will not be\n     * called for such responses.\n     *\n     * ## Writing Unit Tests that use $http\n     * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n     * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n     * request using trained responses.\n     *\n     * ```\n     * $httpBackend.expectGET(...);\n     * $http.get(...);\n     * $httpBackend.flush();\n     * ```\n     *\n     * ## Shortcut methods\n     *\n     * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n     * request data must be passed in for POST/PUT requests.\n     *\n     * ```js\n     *   $http.get('/someUrl').success(successCallback);\n     *   $http.post('/someUrl', data).success(successCallback);\n     * ```\n     *\n     * Complete list of shortcut methods:\n     *\n     * - {@link ng.$http#get $http.get}\n     * - {@link ng.$http#head $http.head}\n     * - {@link ng.$http#post $http.post}\n     * - {@link ng.$http#put $http.put}\n     * - {@link ng.$http#delete $http.delete}\n     * - {@link ng.$http#jsonp $http.jsonp}\n     * - {@link ng.$http#patch $http.patch}\n     *\n     *\n     * ## Setting HTTP Headers\n     *\n     * The $http service will automatically add certain HTTP headers to all requests. These defaults\n     * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n     * object, which currently contains this default configuration:\n     *\n     * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n     *   - `Accept: application/json, text/plain, * / *`\n     * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n     *   - `Content-Type: application/json`\n     * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n     *   - `Content-Type: application/json`\n     *\n     * To add or overwrite these defaults, simply add or remove a property from these configuration\n     * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n     * with the lowercased HTTP method name as the key, e.g.\n     * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.\n     *\n     * The defaults can also be set at runtime via the `$http.defaults` object in the same\n     * fashion. For example:\n     *\n     * ```\n     * module.run(function($http) {\n     *   $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'\n     * });\n     * ```\n     *\n     * In addition, you can supply a `headers` property in the config object passed when\n     * calling `$http(config)`, which overrides the defaults without changing them globally.\n     *\n     * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n     * Use the `headers` property, setting the desired header to `undefined`. For example:\n     *\n     * ```js\n     * var req = {\n     *  method: 'POST',\n     *  url: 'http://example.com',\n     *  headers: {\n     *    'Content-Type': undefined\n     *  },\n     *  data: { test: 'test' },\n     * }\n     *\n     * $http(req).success(function(){...}).error(function(){...});\n     * ```\n     *\n     * ## Transforming Requests and Responses\n     *\n     * Both requests and responses can be transformed using transformation functions: `transformRequest`\n     * and `transformResponse`. These properties can be a single function that returns\n     * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n     * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n     *\n     * ### Default Transformations\n     *\n     * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n     * `defaults.transformResponse` properties. If a request does not provide its own transformations\n     * then these will be applied.\n     *\n     * You can augment or replace the default transformations by modifying these properties by adding to or\n     * replacing the array.\n     *\n     * Angular provides the following default transformations:\n     *\n     * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):\n     *\n     * - If the `data` property of the request configuration object contains an object, serialize it\n     *   into JSON format.\n     *\n     * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):\n     *\n     *  - If XSRF prefix is detected, strip it (see Security Considerations section below).\n     *  - If JSON response is detected, deserialize it using a JSON parser.\n     *\n     *\n     * ### Overriding the Default Transformations Per Request\n     *\n     * If you wish override the request/response transformations only for a single request then provide\n     * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n     * into `$http`.\n     *\n     * Note that if you provide these properties on the config object the default transformations will be\n     * overwritten. If you wish to augment the default transformations then you must include them in your\n     * local transformation array.\n     *\n     * The following code demonstrates adding a new response transformation to be run after the default response\n     * transformations have been run.\n     *\n     * ```js\n     * function appendTransform(defaults, transform) {\n     *\n     *   // We can't guarantee that the default transformation is an array\n     *   defaults = angular.isArray(defaults) ? defaults : [defaults];\n     *\n     *   // Append the new transformation to the defaults\n     *   return defaults.concat(transform);\n     * }\n     *\n     * $http({\n     *   url: '...',\n     *   method: 'GET',\n     *   transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n     *     return doTransform(value);\n     *   })\n     * });\n     * ```\n     *\n     *\n     * ## Caching\n     *\n     * To enable caching, set the request configuration `cache` property to `true` (to use default\n     * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).\n     * When the cache is enabled, `$http` stores the response from the server in the specified\n     * cache. The next time the same request is made, the response is served from the cache without\n     * sending a request to the server.\n     *\n     * Note that even if the response is served from cache, delivery of the data is asynchronous in\n     * the same way that real requests are.\n     *\n     * If there are multiple GET requests for the same URL that should be cached using the same\n     * cache, but the cache is not populated yet, only one request to the server will be made and\n     * the remaining requests will be fulfilled using the response from the first request.\n     *\n     * You can change the default cache to a new object (built with\n     * {@link ng.$cacheFactory `$cacheFactory`}) by updating the\n     * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set\n     * their `cache` property to `true` will now use this cache object.\n     *\n     * If you set the default cache to `false` then only requests that specify their own custom\n     * cache object will be cached.\n     *\n     * ## Interceptors\n     *\n     * Before you start creating interceptors, be sure to understand the\n     * {@link ng.$q $q and deferred/promise APIs}.\n     *\n     * For purposes of global error handling, authentication, or any kind of synchronous or\n     * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n     * able to intercept requests before they are handed to the server and\n     * responses before they are handed over to the application code that\n     * initiated these requests. The interceptors leverage the {@link ng.$q\n     * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n     *\n     * The interceptors are service factories that are registered with the `$httpProvider` by\n     * adding them to the `$httpProvider.interceptors` array. The factory is called and\n     * injected with dependencies (if specified) and returns the interceptor.\n     *\n     * There are two kinds of interceptors (and two kinds of rejection interceptors):\n     *\n     *   * `request`: interceptors get called with a http `config` object. The function is free to\n     *     modify the `config` object or create a new one. The function needs to return the `config`\n     *     object directly, or a promise containing the `config` or a new `config` object.\n     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or\n     *     resolved with a rejection.\n     *   * `response`: interceptors get called with http `response` object. The function is free to\n     *     modify the `response` object or create a new one. The function needs to return the `response`\n     *     object directly, or as a promise containing the `response` or a new `response` object.\n     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or\n     *     resolved with a rejection.\n     *\n     *\n     * ```js\n     *   // register the interceptor as a service\n     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n     *     return {\n     *       // optional method\n     *       'request': function(config) {\n     *         // do something on success\n     *         return config;\n     *       },\n     *\n     *       // optional method\n     *      'requestError': function(rejection) {\n     *         // do something on error\n     *         if (canRecover(rejection)) {\n     *           return responseOrNewPromise\n     *         }\n     *         return $q.reject(rejection);\n     *       },\n     *\n     *\n     *\n     *       // optional method\n     *       'response': function(response) {\n     *         // do something on success\n     *         return response;\n     *       },\n     *\n     *       // optional method\n     *      'responseError': function(rejection) {\n     *         // do something on error\n     *         if (canRecover(rejection)) {\n     *           return responseOrNewPromise\n     *         }\n     *         return $q.reject(rejection);\n     *       }\n     *     };\n     *   });\n     *\n     *   $httpProvider.interceptors.push('myHttpInterceptor');\n     *\n     *\n     *   // alternatively, register the interceptor via an anonymous factory\n     *   $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n     *     return {\n     *      'request': function(config) {\n     *          // same as above\n     *       },\n     *\n     *       'response': function(response) {\n     *          // same as above\n     *       }\n     *     };\n     *   });\n     * ```\n     *\n     * ## Security Considerations\n     *\n     * When designing web applications, consider security threats from:\n     *\n     * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n     * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n     *\n     * Both server and the client must cooperate in order to eliminate these threats. Angular comes\n     * pre-configured with strategies that address these issues, but for this to work backend server\n     * cooperation is required.\n     *\n     * ### JSON Vulnerability Protection\n     *\n     * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n     * allows third party website to turn your JSON resource URL into\n     * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n     * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n     * Angular will automatically strip the prefix before processing it as JSON.\n     *\n     * For example if your server needs to return:\n     * ```js\n     * ['one','two']\n     * ```\n     *\n     * which is vulnerable to attack, your server can return:\n     * ```js\n     * )]}',\n     * ['one','two']\n     * ```\n     *\n     * Angular will strip the prefix, before processing the JSON.\n     *\n     *\n     * ### Cross Site Request Forgery (XSRF) Protection\n     *\n     * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which\n     * an unauthorized site can gain your user's private data. Angular provides a mechanism\n     * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie\n     * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only\n     * JavaScript that runs on your domain could read the cookie, your server can be assured that\n     * the XHR came from JavaScript running on your domain. The header will not be set for\n     * cross-domain requests.\n     *\n     * To take advantage of this, your server needs to set a token in a JavaScript readable session\n     * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n     * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure\n     * that only JavaScript running on your domain could have sent the request. The token must be\n     * unique for each user and must be verifiable by the server (to prevent the JavaScript from\n     * making up its own tokens). We recommend that the token is a digest of your site's\n     * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography&#41;)\n     * for added security.\n     *\n     * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName\n     * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,\n     * or the per-request config object.\n     *\n     *\n     * @param {object} config Object describing the request to be made and how it should be\n     *    processed. The object has following properties:\n     *\n     *    - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n     *    - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.\n     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned\n     *      to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be\n     *      JSONified.\n     *    - **data** – `{string|Object}` – Data to be sent as the request message data.\n     *    - **headers** – `{Object}` – Map of strings or functions which return strings representing\n     *      HTTP headers to send to the server. If the return value of a function is null, the\n     *      header will not be sent.\n     *    - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n     *    - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n     *    - **transformRequest** –\n     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n     *      transform function or an array of such functions. The transform function takes the http\n     *      request body and headers and returns its transformed (typically serialized) version.\n     *      See {@link ng.$http#overriding-the-default-transformations-per-request\n     *      Overriding the Default Transformations}\n     *    - **transformResponse** –\n     *      `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –\n     *      transform function or an array of such functions. The transform function takes the http\n     *      response body, headers and status and returns its transformed (typically deserialized) version.\n     *      See {@link ng.$http#overriding-the-default-transformations-per-request\n     *      Overriding the Default Transformations}\n     *    - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the\n     *      GET request, otherwise if a cache instance built with\n     *      {@link ng.$cacheFactory $cacheFactory}, this cache will be used for\n     *      caching.\n     *    - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n     *      that should abort the request when resolved.\n     *    - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n     *      XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n     *      for more information.\n     *    - **responseType** - `{string}` - see\n     *      [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).\n     *\n     * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the\n     *   standard `then` method and two http specific methods: `success` and `error`. The `then`\n     *   method takes two arguments a success and an error callback which will be called with a\n     *   response object. The `success` and `error` methods take a single argument - a function that\n     *   will be called when the request succeeds or fails respectively. The arguments passed into\n     *   these functions are destructured representation of the response object passed into the\n     *   `then` method. The response object has these properties:\n     *\n     *   - **data** – `{string|Object}` – The response body transformed with the transform\n     *     functions.\n     *   - **status** – `{number}` – HTTP status code of the response.\n     *   - **headers** – `{function([headerName])}` – Header getter function.\n     *   - **config** – `{Object}` – The configuration object that was used to generate the request.\n     *   - **statusText** – `{string}` – HTTP status text of the response.\n     *\n     * @property {Array.<Object>} pendingRequests Array of config objects for currently pending\n     *   requests. This is primarily meant to be used for debugging purposes.\n     *\n     *\n     * @example\n<example module=\"httpExample\">\n<file name=\"index.html\">\n  <div ng-controller=\"FetchController\">\n    <select ng-model=\"method\">\n      <option>GET</option>\n      <option>JSONP</option>\n    </select>\n    <input type=\"text\" ng-model=\"url\" size=\"80\"/>\n    <button id=\"fetchbtn\" ng-click=\"fetch()\">fetch</button><br>\n    <button id=\"samplegetbtn\" ng-click=\"updateModel('GET', 'http-hello.html')\">Sample GET</button>\n    <button id=\"samplejsonpbtn\"\n      ng-click=\"updateModel('JSONP',\n                    'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')\">\n      Sample JSONP\n    </button>\n    <button id=\"invalidjsonpbtn\"\n      ng-click=\"updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')\">\n        Invalid JSONP\n      </button>\n    <pre>http status code: {{status}}</pre>\n    <pre>http response data: {{data}}</pre>\n  </div>\n</file>\n<file name=\"script.js\">\n  angular.module('httpExample', [])\n    .controller('FetchController', ['$scope', '$http', '$templateCache',\n      function($scope, $http, $templateCache) {\n        $scope.method = 'GET';\n        $scope.url = 'http-hello.html';\n\n        $scope.fetch = function() {\n          $scope.code = null;\n          $scope.response = null;\n\n          $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n            success(function(data, status) {\n              $scope.status = status;\n              $scope.data = data;\n            }).\n            error(function(data, status) {\n              $scope.data = data || \"Request failed\";\n              $scope.status = status;\n          });\n        };\n\n        $scope.updateModel = function(method, url) {\n          $scope.method = method;\n          $scope.url = url;\n        };\n      }]);\n</file>\n<file name=\"http-hello.html\">\n  Hello, $http!\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n  var status = element(by.binding('status'));\n  var data = element(by.binding('data'));\n  var fetchBtn = element(by.id('fetchbtn'));\n  var sampleGetBtn = element(by.id('samplegetbtn'));\n  var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n  var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n  it('should make an xhr GET request', function() {\n    sampleGetBtn.click();\n    fetchBtn.click();\n    expect(status.getText()).toMatch('200');\n    expect(data.getText()).toMatch(/Hello, \\$http!/);\n  });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n//   sampleJsonpBtn.click();\n//   fetchBtn.click();\n//   expect(status.getText()).toMatch('200');\n//   expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n  it('should make JSONP request to invalid URL and invoke the error handler',\n      function() {\n    invalidJsonpBtn.click();\n    fetchBtn.click();\n    expect(status.getText()).toMatch('0');\n    expect(data.getText()).toMatch('Request failed');\n  });\n</file>\n</example>\n     */\n    function $http(requestConfig) {\n\n      if (!angular.isObject(requestConfig)) {\n        throw minErr('$http')('badreq', 'Http request configuration must be an object.  Received: {0}', requestConfig);\n      }\n\n      var config = extend({\n        method: 'get',\n        transformRequest: defaults.transformRequest,\n        transformResponse: defaults.transformResponse\n      }, requestConfig);\n\n      config.headers = mergeHeaders(requestConfig);\n      config.method = uppercase(config.method);\n\n      var serverRequest = function(config) {\n        var headers = config.headers;\n        var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n        // strip content-type if data is undefined\n        if (isUndefined(reqData)) {\n          forEach(headers, function(value, header) {\n            if (lowercase(header) === 'content-type') {\n                delete headers[header];\n            }\n          });\n        }\n\n        if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n          config.withCredentials = defaults.withCredentials;\n        }\n\n        // send request\n        return sendReq(config, reqData).then(transformResponse, transformResponse);\n      };\n\n      var chain = [serverRequest, undefined];\n      var promise = $q.when(config);\n\n      // apply interceptors\n      forEach(reversedInterceptors, function(interceptor) {\n        if (interceptor.request || interceptor.requestError) {\n          chain.unshift(interceptor.request, interceptor.requestError);\n        }\n        if (interceptor.response || interceptor.responseError) {\n          chain.push(interceptor.response, interceptor.responseError);\n        }\n      });\n\n      while (chain.length) {\n        var thenFn = chain.shift();\n        var rejectFn = chain.shift();\n\n        promise = promise.then(thenFn, rejectFn);\n      }\n\n      promise.success = function(fn) {\n        promise.then(function(response) {\n          fn(response.data, response.status, response.headers, config);\n        });\n        return promise;\n      };\n\n      promise.error = function(fn) {\n        promise.then(null, function(response) {\n          fn(response.data, response.status, response.headers, config);\n        });\n        return promise;\n      };\n\n      return promise;\n\n      function transformResponse(response) {\n        // make a copy since the response must be cacheable\n        var resp = extend({}, response);\n        if (!response.data) {\n          resp.data = response.data;\n        } else {\n          resp.data = transformData(response.data, response.headers, response.status, config.transformResponse);\n        }\n        return (isSuccess(response.status))\n          ? resp\n          : $q.reject(resp);\n      }\n\n      function executeHeaderFns(headers) {\n        var headerContent, processedHeaders = {};\n\n        forEach(headers, function(headerFn, header) {\n          if (isFunction(headerFn)) {\n            headerContent = headerFn();\n            if (headerContent != null) {\n              processedHeaders[header] = headerContent;\n            }\n          } else {\n            processedHeaders[header] = headerFn;\n          }\n        });\n\n        return processedHeaders;\n      }\n\n      function mergeHeaders(config) {\n        var defHeaders = defaults.headers,\n            reqHeaders = extend({}, config.headers),\n            defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n        defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n        // using for-in instead of forEach to avoid unecessary iteration after header has been found\n        defaultHeadersIteration:\n        for (defHeaderName in defHeaders) {\n          lowercaseDefHeaderName = lowercase(defHeaderName);\n\n          for (reqHeaderName in reqHeaders) {\n            if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n              continue defaultHeadersIteration;\n            }\n          }\n\n          reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n        }\n\n        // execute if header value is a function for merged headers\n        return executeHeaderFns(reqHeaders);\n      }\n    }\n\n    $http.pendingRequests = [];\n\n    /**\n     * @ngdoc method\n     * @name $http#get\n     *\n     * @description\n     * Shortcut method to perform `GET` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#delete\n     *\n     * @description\n     * Shortcut method to perform `DELETE` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#head\n     *\n     * @description\n     * Shortcut method to perform `HEAD` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#jsonp\n     *\n     * @description\n     * Shortcut method to perform `JSONP` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request.\n     *                     The name of the callback should be the string `JSON_CALLBACK`.\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n    createShortMethods('get', 'delete', 'head', 'jsonp');\n\n    /**\n     * @ngdoc method\n     * @name $http#post\n     *\n     * @description\n     * Shortcut method to perform `POST` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {*} data Request content\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n    /**\n     * @ngdoc method\n     * @name $http#put\n     *\n     * @description\n     * Shortcut method to perform `PUT` request.\n     *\n     * @param {string} url Relative or absolute URL specifying the destination of the request\n     * @param {*} data Request content\n     * @param {Object=} config Optional configuration object\n     * @returns {HttpPromise} Future object\n     */\n\n     /**\n      * @ngdoc method\n      * @name $http#patch\n      *\n      * @description\n      * Shortcut method to perform `PATCH` request.\n      *\n      * @param {string} url Relative or absolute URL specifying the destination of the request\n      * @param {*} data Request content\n      * @param {Object=} config Optional configuration object\n      * @returns {HttpPromise} Future object\n      */\n    createShortMethodsWithData('post', 'put', 'patch');\n\n        /**\n         * @ngdoc property\n         * @name $http#defaults\n         *\n         * @description\n         * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n         * default headers, withCredentials as well as request and response transformations.\n         *\n         * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n         */\n    $http.defaults = defaults;\n\n\n    return $http;\n\n\n    function createShortMethods(names) {\n      forEach(arguments, function(name) {\n        $http[name] = function(url, config) {\n          return $http(extend(config || {}, {\n            method: name,\n            url: url\n          }));\n        };\n      });\n    }\n\n\n    function createShortMethodsWithData(name) {\n      forEach(arguments, function(name) {\n        $http[name] = function(url, data, config) {\n          return $http(extend(config || {}, {\n            method: name,\n            url: url,\n            data: data\n          }));\n        };\n      });\n    }\n\n\n    /**\n     * Makes the request.\n     *\n     * !!! ACCESSES CLOSURE VARS:\n     * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n     */\n    function sendReq(config, reqData) {\n      var deferred = $q.defer(),\n          promise = deferred.promise,\n          cache,\n          cachedResp,\n          reqHeaders = config.headers,\n          url = buildUrl(config.url, config.params);\n\n      $http.pendingRequests.push(config);\n      promise.then(removePendingReq, removePendingReq);\n\n\n      if ((config.cache || defaults.cache) && config.cache !== false &&\n          (config.method === 'GET' || config.method === 'JSONP')) {\n        cache = isObject(config.cache) ? config.cache\n              : isObject(defaults.cache) ? defaults.cache\n              : defaultCache;\n      }\n\n      if (cache) {\n        cachedResp = cache.get(url);\n        if (isDefined(cachedResp)) {\n          if (isPromiseLike(cachedResp)) {\n            // cached request has already been sent, but there is no response yet\n            cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n          } else {\n            // serving from cache\n            if (isArray(cachedResp)) {\n              resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n            } else {\n              resolvePromise(cachedResp, 200, {}, 'OK');\n            }\n          }\n        } else {\n          // put the promise for the non-transformed response into cache as a placeholder\n          cache.put(url, promise);\n        }\n      }\n\n\n      // if we won't have the response in cache, set the xsrf headers and\n      // send the request to the backend\n      if (isUndefined(cachedResp)) {\n        var xsrfValue = urlIsSameOrigin(config.url)\n            ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]\n            : undefined;\n        if (xsrfValue) {\n          reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n        }\n\n        $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n            config.withCredentials, config.responseType);\n      }\n\n      return promise;\n\n\n      /**\n       * Callback registered to $httpBackend():\n       *  - caches the response if desired\n       *  - resolves the raw $http promise\n       *  - calls $apply\n       */\n      function done(status, response, headersString, statusText) {\n        if (cache) {\n          if (isSuccess(status)) {\n            cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n          } else {\n            // remove promise from the cache\n            cache.remove(url);\n          }\n        }\n\n        function resolveHttpPromise() {\n          resolvePromise(response, status, headersString, statusText);\n        }\n\n        if (useApplyAsync) {\n          $rootScope.$applyAsync(resolveHttpPromise);\n        } else {\n          resolveHttpPromise();\n          if (!$rootScope.$$phase) $rootScope.$apply();\n        }\n      }\n\n\n      /**\n       * Resolves the raw $http promise.\n       */\n      function resolvePromise(response, status, headers, statusText) {\n        // normalize internal statuses to 0\n        status = Math.max(status, 0);\n\n        (isSuccess(status) ? deferred.resolve : deferred.reject)({\n          data: response,\n          status: status,\n          headers: headersGetter(headers),\n          config: config,\n          statusText: statusText\n        });\n      }\n\n      function resolvePromiseWithResult(result) {\n        resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n      }\n\n      function removePendingReq() {\n        var idx = $http.pendingRequests.indexOf(config);\n        if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n      }\n    }\n\n\n    function buildUrl(url, params) {\n      if (!params) return url;\n      var parts = [];\n      forEachSorted(params, function(value, key) {\n        if (value === null || isUndefined(value)) return;\n        if (!isArray(value)) value = [value];\n\n        forEach(value, function(v) {\n          if (isObject(v)) {\n            if (isDate(v)) {\n              v = v.toISOString();\n            } else {\n              v = toJson(v);\n            }\n          }\n          parts.push(encodeUriQuery(key) + '=' +\n                     encodeUriQuery(v));\n        });\n      });\n      if (parts.length > 0) {\n        url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');\n      }\n      return url;\n    }\n  }];\n}\n\nfunction createXhr() {\n    return new window.XMLHttpRequest();\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $window\n * @requires $document\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n  this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {\n    return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]);\n  }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n  // TODO(vojta): fix the signature\n  return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {\n    $browser.$$incOutstandingRequestCount();\n    url = url || $browser.url();\n\n    if (lowercase(method) == 'jsonp') {\n      var callbackId = '_' + (callbacks.counter++).toString(36);\n      callbacks[callbackId] = function(data) {\n        callbacks[callbackId].data = data;\n        callbacks[callbackId].called = true;\n      };\n\n      var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),\n          callbackId, function(status, text) {\n        completeRequest(callback, status, callbacks[callbackId].data, \"\", text);\n        callbacks[callbackId] = noop;\n      });\n    } else {\n\n      var xhr = createXhr();\n\n      xhr.open(method, url, true);\n      forEach(headers, function(value, key) {\n        if (isDefined(value)) {\n            xhr.setRequestHeader(key, value);\n        }\n      });\n\n      xhr.onload = function requestLoaded() {\n        var statusText = xhr.statusText || '';\n\n        // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n        // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n        var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n        // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n        var status = xhr.status === 1223 ? 204 : xhr.status;\n\n        // fix status code when it is 0 (0 status is undocumented).\n        // Occurs when accessing file resources or on Android 4.1 stock browser\n        // while retrieving files from application cache.\n        if (status === 0) {\n          status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;\n        }\n\n        completeRequest(callback,\n            status,\n            response,\n            xhr.getAllResponseHeaders(),\n            statusText);\n      };\n\n      var requestError = function() {\n        // The response is always empty\n        // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n        completeRequest(callback, -1, null, null, '');\n      };\n\n      xhr.onerror = requestError;\n      xhr.onabort = requestError;\n\n      if (withCredentials) {\n        xhr.withCredentials = true;\n      }\n\n      if (responseType) {\n        try {\n          xhr.responseType = responseType;\n        } catch (e) {\n          // WebKit added support for the json responseType value on 09/03/2013\n          // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n          // known to throw when setting the value \"json\" as the response type. Other older\n          // browsers implementing the responseType\n          //\n          // The json response type can be ignored if not supported, because JSON payloads are\n          // parsed on the client-side regardless.\n          if (responseType !== 'json') {\n            throw e;\n          }\n        }\n      }\n\n      xhr.send(post || null);\n    }\n\n    if (timeout > 0) {\n      var timeoutId = $browserDefer(timeoutRequest, timeout);\n    } else if (isPromiseLike(timeout)) {\n      timeout.then(timeoutRequest);\n    }\n\n\n    function timeoutRequest() {\n      jsonpDone && jsonpDone();\n      xhr && xhr.abort();\n    }\n\n    function completeRequest(callback, status, response, headersString, statusText) {\n      // cancel timeout and subsequent timeout promise resolution\n      if (timeoutId !== undefined) {\n        $browserDefer.cancel(timeoutId);\n      }\n      jsonpDone = xhr = null;\n\n      callback(status, response, headersString, statusText);\n      $browser.$$completeOutstandingRequest(noop);\n    }\n  };\n\n  function jsonpReq(url, callbackId, done) {\n    // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:\n    // - fetches local scripts via XHR and evals them\n    // - adds and immediately removes script elements from the document\n    var script = rawDocument.createElement('script'), callback = null;\n    script.type = \"text/javascript\";\n    script.src = url;\n    script.async = true;\n\n    callback = function(event) {\n      removeEventListenerFn(script, \"load\", callback);\n      removeEventListenerFn(script, \"error\", callback);\n      rawDocument.body.removeChild(script);\n      script = null;\n      var status = -1;\n      var text = \"unknown\";\n\n      if (event) {\n        if (event.type === \"load\" && !callbacks[callbackId].called) {\n          event = { type: \"error\" };\n        }\n        text = event.type;\n        status = event.type === \"error\" ? 404 : 200;\n      }\n\n      if (done) {\n        done(status, text);\n      }\n    };\n\n    addEventListenerFn(script, \"load\", callback);\n    addEventListenerFn(script, \"error\", callback);\n    rawDocument.body.appendChild(script);\n    return callback;\n  }\n}\n\nvar $interpolateMinErr = minErr('$interpolate');\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n * @example\n<example module=\"customInterpolationApp\">\n<file name=\"index.html\">\n<script>\n  var customInterpolationApp = angular.module('customInterpolationApp', []);\n\n  customInterpolationApp.config(function($interpolateProvider) {\n    $interpolateProvider.startSymbol('//');\n    $interpolateProvider.endSymbol('//');\n  });\n\n\n  customInterpolationApp.controller('DemoController', function() {\n      this.label = \"This binding is brought you by // interpolation symbols.\";\n  });\n</script>\n<div ng-app=\"App\" ng-controller=\"DemoController as demo\">\n    //demo.label//\n</div>\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n  it('should interpolate binding with custom symbols', function() {\n    expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n  });\n</file>\n</example>\n */\nfunction $InterpolateProvider() {\n  var startSymbol = '{{';\n  var endSymbol = '}}';\n\n  /**\n   * @ngdoc method\n   * @name $interpolateProvider#startSymbol\n   * @description\n   * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n   *\n   * @param {string=} value new value to set the starting symbol to.\n   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n   */\n  this.startSymbol = function(value) {\n    if (value) {\n      startSymbol = value;\n      return this;\n    } else {\n      return startSymbol;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $interpolateProvider#endSymbol\n   * @description\n   * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n   *\n   * @param {string=} value new value to set the ending symbol to.\n   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n   */\n  this.endSymbol = function(value) {\n    if (value) {\n      endSymbol = value;\n      return this;\n    } else {\n      return endSymbol;\n    }\n  };\n\n\n  this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n    var startSymbolLength = startSymbol.length,\n        endSymbolLength = endSymbol.length,\n        escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n        escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n    function escape(ch) {\n      return '\\\\\\\\\\\\' + ch;\n    }\n\n    /**\n     * @ngdoc service\n     * @name $interpolate\n     * @kind function\n     *\n     * @requires $parse\n     * @requires $sce\n     *\n     * @description\n     *\n     * Compiles a string with markup into an interpolation function. This service is used by the\n     * HTML {@link ng.$compile $compile} service for data binding. See\n     * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n     * interpolation markup.\n     *\n     *\n     * ```js\n     *   var $interpolate = ...; // injected\n     *   var exp = $interpolate('Hello {{name | uppercase}}!');\n     *   expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!');\n     * ```\n     *\n     * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n     * `true`, the interpolation function will return `undefined` unless all embedded expressions\n     * evaluate to a value other than `undefined`.\n     *\n     * ```js\n     *   var $interpolate = ...; // injected\n     *   var context = {greeting: 'Hello', name: undefined };\n     *\n     *   // default \"forgiving\" mode\n     *   var exp = $interpolate('{{greeting}} {{name}}!');\n     *   expect(exp(context)).toEqual('Hello !');\n     *\n     *   // \"allOrNothing\" mode\n     *   exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n     *   expect(exp(context)).toBeUndefined();\n     *   context.name = 'Angular';\n     *   expect(exp(context)).toEqual('Hello Angular!');\n     * ```\n     *\n     * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n     *\n     * ####Escaped Interpolation\n     * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n     * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n     * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n     * or binding.\n     *\n     * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n     * degree, while also enabling code examples to work without relying on the\n     * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n     *\n     * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n     * replacing angle brackets (&lt;, &gt;) with &amp;lt; and &amp;gt; respectively, and replacing all\n     * interpolation start/end markers with their escaped counterparts.**\n     *\n     * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n     * output when the $interpolate service processes the text. So, for HTML elements interpolated\n     * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n     * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n     * this is typically useful only when user-data is used in rendering a template from the server, or\n     * when otherwise untrusted data is used by a directive.\n     *\n     * <example>\n     *  <file name=\"index.html\">\n     *    <div ng-init=\"username='A user'\">\n     *      <p ng-init=\"apptitle='Escaping demo'\">{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n     *        </p>\n     *      <p><strong>{{username}}</strong> attempts to inject code which will deface the\n     *        application, but fails to accomplish their task, because the server has correctly\n     *        escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n     *        characters.</p>\n     *      <p>Instead, the result of the attempted script injection is visible, and can be removed\n     *        from the database by an administrator.</p>\n     *    </div>\n     *  </file>\n     * </example>\n     *\n     * @param {string} text The text with markup to interpolate.\n     * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n     *    embedded expression in order to return an interpolation function. Strings with no\n     *    embedded expression will return null for the interpolation function.\n     * @param {string=} trustedContext when provided, the returned function passes the interpolated\n     *    result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n     *    trustedContext)} before returning it.  Refer to the {@link ng.$sce $sce} service that\n     *    provides Strict Contextual Escaping for details.\n     * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n     *    unless all embedded expressions evaluate to a value other than `undefined`.\n     * @returns {function(context)} an interpolation function which is used to compute the\n     *    interpolated string. The function has these parameters:\n     *\n     * - `context`: evaluation context for all expressions embedded in the interpolated text\n     */\n    function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n      allOrNothing = !!allOrNothing;\n      var startIndex,\n          endIndex,\n          index = 0,\n          expressions = [],\n          parseFns = [],\n          textLength = text.length,\n          exp,\n          concat = [],\n          expressionPositions = [];\n\n      while (index < textLength) {\n        if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&\n             ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {\n          if (index !== startIndex) {\n            concat.push(unescapeText(text.substring(index, startIndex)));\n          }\n          exp = text.substring(startIndex + startSymbolLength, endIndex);\n          expressions.push(exp);\n          parseFns.push($parse(exp, parseStringifyInterceptor));\n          index = endIndex + endSymbolLength;\n          expressionPositions.push(concat.length);\n          concat.push('');\n        } else {\n          // we did not find an interpolation, so we have to add the remainder to the separators array\n          if (index !== textLength) {\n            concat.push(unescapeText(text.substring(index)));\n          }\n          break;\n        }\n      }\n\n      // Concatenating expressions makes it hard to reason about whether some combination of\n      // concatenated values are unsafe to use and could easily lead to XSS.  By requiring that a\n      // single expression be used for iframe[src], object[src], etc., we ensure that the value\n      // that's used is assigned or constructed by some JS code somewhere that is more testable or\n      // make it obvious that you bound the value to some user controlled value.  This helps reduce\n      // the load when auditing for XSS issues.\n      if (trustedContext && concat.length > 1) {\n          throw $interpolateMinErr('noconcat',\n              \"Error while interpolating: {0}\\nStrict Contextual Escaping disallows \" +\n              \"interpolations that concatenate multiple expressions when a trusted value is \" +\n              \"required.  See http://docs.angularjs.org/api/ng.$sce\", text);\n      }\n\n      if (!mustHaveExpression || expressions.length) {\n        var compute = function(values) {\n          for (var i = 0, ii = expressions.length; i < ii; i++) {\n            if (allOrNothing && isUndefined(values[i])) return;\n            concat[expressionPositions[i]] = values[i];\n          }\n          return concat.join('');\n        };\n\n        var getValue = function(value) {\n          return trustedContext ?\n            $sce.getTrusted(trustedContext, value) :\n            $sce.valueOf(value);\n        };\n\n        var stringify = function(value) {\n          if (value == null) { // null || undefined\n            return '';\n          }\n          switch (typeof value) {\n            case 'string':\n              break;\n            case 'number':\n              value = '' + value;\n              break;\n            default:\n              value = toJson(value);\n          }\n\n          return value;\n        };\n\n        return extend(function interpolationFn(context) {\n            var i = 0;\n            var ii = expressions.length;\n            var values = new Array(ii);\n\n            try {\n              for (; i < ii; i++) {\n                values[i] = parseFns[i](context);\n              }\n\n              return compute(values);\n            } catch (err) {\n              var newErr = $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text,\n                  err.toString());\n              $exceptionHandler(newErr);\n            }\n\n          }, {\n          // all of these properties are undocumented for now\n          exp: text, //just for compatibility with regular watchers created via $watch\n          expressions: expressions,\n          $$watchDelegate: function(scope, listener, objectEquality) {\n            var lastValue;\n            return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {\n              var currValue = compute(values);\n              if (isFunction(listener)) {\n                listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n              }\n              lastValue = currValue;\n            }, objectEquality);\n          }\n        });\n      }\n\n      function unescapeText(text) {\n        return text.replace(escapedStartRegexp, startSymbol).\n          replace(escapedEndRegexp, endSymbol);\n      }\n\n      function parseStringifyInterceptor(value) {\n        try {\n          value = getValue(value);\n          return allOrNothing && !isDefined(value) ? value : stringify(value);\n        } catch (err) {\n          var newErr = $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text,\n            err.toString());\n          $exceptionHandler(newErr);\n        }\n      }\n    }\n\n\n    /**\n     * @ngdoc method\n     * @name $interpolate#startSymbol\n     * @description\n     * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n     *\n     * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n     * the symbol.\n     *\n     * @returns {string} start symbol.\n     */\n    $interpolate.startSymbol = function() {\n      return startSymbol;\n    };\n\n\n    /**\n     * @ngdoc method\n     * @name $interpolate#endSymbol\n     * @description\n     * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n     *\n     * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n     * the symbol.\n     *\n     * @returns {string} end symbol.\n     */\n    $interpolate.endSymbol = function() {\n      return endSymbol;\n    };\n\n    return $interpolate;\n  }];\n}\n\nfunction $IntervalProvider() {\n  this.$get = ['$rootScope', '$window', '$q', '$$q',\n       function($rootScope,   $window,   $q,   $$q) {\n    var intervals = {};\n\n\n     /**\n      * @ngdoc service\n      * @name $interval\n      *\n      * @description\n      * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n      * milliseconds.\n      *\n      * The return value of registering an interval function is a promise. This promise will be\n      * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n      * run indefinitely if `count` is not defined. The value of the notification will be the\n      * number of iterations that have run.\n      * To cancel an interval, call `$interval.cancel(promise)`.\n      *\n      * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n      * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n      * time.\n      *\n      * <div class=\"alert alert-warning\">\n      * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n      * with them.  In particular they are not automatically destroyed when a controller's scope or a\n      * directive's element are destroyed.\n      * You should take this into consideration and make sure to always cancel the interval at the\n      * appropriate moment.  See the example below for more details on how and when to do this.\n      * </div>\n      *\n      * @param {function()} fn A function that should be called repeatedly.\n      * @param {number} delay Number of milliseconds between each function call.\n      * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n      *   indefinitely.\n      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n      * @returns {promise} A promise which will be notified on each iteration.\n      *\n      * @example\n      * <example module=\"intervalExample\">\n      * <file name=\"index.html\">\n      *   <script>\n      *     angular.module('intervalExample', [])\n      *       .controller('ExampleController', ['$scope', '$interval',\n      *         function($scope, $interval) {\n      *           $scope.format = 'M/d/yy h:mm:ss a';\n      *           $scope.blood_1 = 100;\n      *           $scope.blood_2 = 120;\n      *\n      *           var stop;\n      *           $scope.fight = function() {\n      *             // Don't start a new fight if we are already fighting\n      *             if ( angular.isDefined(stop) ) return;\n      *\n      *             stop = $interval(function() {\n      *               if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {\n      *                 $scope.blood_1 = $scope.blood_1 - 3;\n      *                 $scope.blood_2 = $scope.blood_2 - 4;\n      *               } else {\n      *                 $scope.stopFight();\n      *               }\n      *             }, 100);\n      *           };\n      *\n      *           $scope.stopFight = function() {\n      *             if (angular.isDefined(stop)) {\n      *               $interval.cancel(stop);\n      *               stop = undefined;\n      *             }\n      *           };\n      *\n      *           $scope.resetFight = function() {\n      *             $scope.blood_1 = 100;\n      *             $scope.blood_2 = 120;\n      *           };\n      *\n      *           $scope.$on('$destroy', function() {\n      *             // Make sure that the interval is destroyed too\n      *             $scope.stopFight();\n      *           });\n      *         }])\n      *       // Register the 'myCurrentTime' directive factory method.\n      *       // We inject $interval and dateFilter service since the factory method is DI.\n      *       .directive('myCurrentTime', ['$interval', 'dateFilter',\n      *         function($interval, dateFilter) {\n      *           // return the directive link function. (compile function not needed)\n      *           return function(scope, element, attrs) {\n      *             var format,  // date format\n      *                 stopTime; // so that we can cancel the time updates\n      *\n      *             // used to update the UI\n      *             function updateTime() {\n      *               element.text(dateFilter(new Date(), format));\n      *             }\n      *\n      *             // watch the expression, and update the UI on change.\n      *             scope.$watch(attrs.myCurrentTime, function(value) {\n      *               format = value;\n      *               updateTime();\n      *             });\n      *\n      *             stopTime = $interval(updateTime, 1000);\n      *\n      *             // listen on DOM destroy (removal) event, and cancel the next UI update\n      *             // to prevent updating time after the DOM element was removed.\n      *             element.on('$destroy', function() {\n      *               $interval.cancel(stopTime);\n      *             });\n      *           }\n      *         }]);\n      *   </script>\n      *\n      *   <div>\n      *     <div ng-controller=\"ExampleController\">\n      *       Date format: <input ng-model=\"format\"> <hr/>\n      *       Current time is: <span my-current-time=\"format\"></span>\n      *       <hr/>\n      *       Blood 1 : <font color='red'>{{blood_1}}</font>\n      *       Blood 2 : <font color='red'>{{blood_2}}</font>\n      *       <button type=\"button\" data-ng-click=\"fight()\">Fight</button>\n      *       <button type=\"button\" data-ng-click=\"stopFight()\">StopFight</button>\n      *       <button type=\"button\" data-ng-click=\"resetFight()\">resetFight</button>\n      *     </div>\n      *   </div>\n      *\n      * </file>\n      * </example>\n      */\n    function interval(fn, delay, count, invokeApply) {\n      var setInterval = $window.setInterval,\n          clearInterval = $window.clearInterval,\n          iteration = 0,\n          skipApply = (isDefined(invokeApply) && !invokeApply),\n          deferred = (skipApply ? $$q : $q).defer(),\n          promise = deferred.promise;\n\n      count = isDefined(count) ? count : 0;\n\n      promise.then(null, null, fn);\n\n      promise.$$intervalId = setInterval(function tick() {\n        deferred.notify(iteration++);\n\n        if (count > 0 && iteration >= count) {\n          deferred.resolve(iteration);\n          clearInterval(promise.$$intervalId);\n          delete intervals[promise.$$intervalId];\n        }\n\n        if (!skipApply) $rootScope.$apply();\n\n      }, delay);\n\n      intervals[promise.$$intervalId] = deferred;\n\n      return promise;\n    }\n\n\n     /**\n      * @ngdoc method\n      * @name $interval#cancel\n      *\n      * @description\n      * Cancels a task associated with the `promise`.\n      *\n      * @param {promise} promise returned by the `$interval` function.\n      * @returns {boolean} Returns `true` if the task was successfully canceled.\n      */\n    interval.cancel = function(promise) {\n      if (promise && promise.$$intervalId in intervals) {\n        intervals[promise.$$intervalId].reject('canceled');\n        $window.clearInterval(promise.$$intervalId);\n        delete intervals[promise.$$intervalId];\n        return true;\n      }\n      return false;\n    };\n\n    return interval;\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various Angular components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\nfunction $LocaleProvider() {\n  this.$get = function() {\n    return {\n      id: 'en-us',\n\n      NUMBER_FORMATS: {\n        DECIMAL_SEP: '.',\n        GROUP_SEP: ',',\n        PATTERNS: [\n          { // Decimal Pattern\n            minInt: 1,\n            minFrac: 0,\n            maxFrac: 3,\n            posPre: '',\n            posSuf: '',\n            negPre: '-',\n            negSuf: '',\n            gSize: 3,\n            lgSize: 3\n          },{ //Currency Pattern\n            minInt: 1,\n            minFrac: 2,\n            maxFrac: 2,\n            posPre: '\\u00A4',\n            posSuf: '',\n            negPre: '(\\u00A4',\n            negSuf: ')',\n            gSize: 3,\n            lgSize: 3\n          }\n        ],\n        CURRENCY_SYM: '$'\n      },\n\n      DATETIME_FORMATS: {\n        MONTH:\n            'January,February,March,April,May,June,July,August,September,October,November,December'\n            .split(','),\n        SHORTMONTH:  'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n        DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n        SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),\n        AMPMS: ['AM','PM'],\n        medium: 'MMM d, y h:mm:ss a',\n        'short': 'M/d/yy h:mm a',\n        fullDate: 'EEEE, MMMM d, y',\n        longDate: 'MMMM d, y',\n        mediumDate: 'MMM d, y',\n        shortDate: 'M/d/yy',\n        mediumTime: 'h:mm:ss a',\n        shortTime: 'h:mm a'\n      },\n\n      pluralCat: function(num) {\n        if (num === 1) {\n          return 'one';\n        }\n        return 'other';\n      }\n    };\n  };\n}\n\nvar PATH_MATCH = /^([^\\?#]*)(\\?([^#]*))?(#(.*))?$/,\n    DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n  var segments = path.split('/'),\n      i = segments.length;\n\n  while (i--) {\n    segments[i] = encodeUriSegment(segments[i]);\n  }\n\n  return segments.join('/');\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n  var parsedUrl = urlResolve(absoluteUrl);\n\n  locationObj.$$protocol = parsedUrl.protocol;\n  locationObj.$$host = parsedUrl.hostname;\n  locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\n\nfunction parseAppUrl(relativeUrl, locationObj) {\n  var prefixed = (relativeUrl.charAt(0) !== '/');\n  if (prefixed) {\n    relativeUrl = '/' + relativeUrl;\n  }\n  var match = urlResolve(relativeUrl);\n  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?\n      match.pathname.substring(1) : match.pathname);\n  locationObj.$$search = parseKeyValue(match.search);\n  locationObj.$$hash = decodeURIComponent(match.hash);\n\n  // make sure path starts with '/';\n  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {\n    locationObj.$$path = '/' + locationObj.$$path;\n  }\n}\n\n\n/**\n *\n * @param {string} begin\n * @param {string} whole\n * @returns {string} returns text from whole after begin or undefined if it does not begin with\n *                   expected string.\n */\nfunction beginsWith(begin, whole) {\n  if (whole.indexOf(begin) === 0) {\n    return whole.substr(begin.length);\n  }\n}\n\n\nfunction stripHash(url) {\n  var index = url.indexOf('#');\n  return index == -1 ? url : url.substr(0, index);\n}\n\nfunction trimEmptyHash(url) {\n  return url.replace(/(#.+)|#$/, '$1');\n}\n\n\nfunction stripFile(url) {\n  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n  return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents an url\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} basePrefix url path prefix\n */\nfunction LocationHtml5Url(appBase, basePrefix) {\n  this.$$html5 = true;\n  basePrefix = basePrefix || '';\n  var appBaseNoFile = stripFile(appBase);\n  parseAbsoluteUrl(appBase, this);\n\n\n  /**\n   * Parse given html5 (regular) url string into properties\n   * @param {string} url HTML5 url\n   * @private\n   */\n  this.$$parse = function(url) {\n    var pathUrl = beginsWith(appBaseNoFile, url);\n    if (!isString(pathUrl)) {\n      throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n          appBaseNoFile);\n    }\n\n    parseAppUrl(pathUrl, this);\n\n    if (!this.$$path) {\n      this.$$path = '/';\n    }\n\n    this.$$compose();\n  };\n\n  /**\n   * Compose url and update `absUrl` property\n   * @private\n   */\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'\n  };\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (relHref && relHref[0] === '#') {\n      // special case for links to hash fragments:\n      // keep the old url and only replace the hash fragment\n      this.hash(relHref.slice(1));\n      return true;\n    }\n    var appUrl, prevAppUrl;\n    var rewrittenUrl;\n\n    if ((appUrl = beginsWith(appBase, url)) !== undefined) {\n      prevAppUrl = appUrl;\n      if ((appUrl = beginsWith(basePrefix, appUrl)) !== undefined) {\n        rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl);\n      } else {\n        rewrittenUrl = appBase + prevAppUrl;\n      }\n    } else if ((appUrl = beginsWith(appBaseNoFile, url)) !== undefined) {\n      rewrittenUrl = appBaseNoFile + appUrl;\n    } else if (appBaseNoFile == url + '/') {\n      rewrittenUrl = appBaseNoFile;\n    }\n    if (rewrittenUrl) {\n      this.$$parse(rewrittenUrl);\n    }\n    return !!rewrittenUrl;\n  };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, hashPrefix) {\n  var appBaseNoFile = stripFile(appBase);\n\n  parseAbsoluteUrl(appBase, this);\n\n\n  /**\n   * Parse given hashbang url into properties\n   * @param {string} url Hashbang url\n   * @private\n   */\n  this.$$parse = function(url) {\n    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);\n    var withoutHashUrl;\n\n    if (withoutBaseUrl.charAt(0) === '#') {\n\n      // The rest of the url starts with a hash so we have\n      // got either a hashbang path or a plain hash fragment\n      withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);\n      if (isUndefined(withoutHashUrl)) {\n        // There was no hashbang prefix so we just have a hash fragment\n        withoutHashUrl = withoutBaseUrl;\n      }\n\n    } else {\n      // There was no hashbang path nor hash fragment:\n      // If we are in HTML5 mode we use what is left as the path;\n      // Otherwise we ignore what is left\n      withoutHashUrl = this.$$html5 ? withoutBaseUrl : '';\n    }\n\n    parseAppUrl(withoutHashUrl, this);\n\n    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n    this.$$compose();\n\n    /*\n     * In Windows, on an anchor node on documents loaded from\n     * the filesystem, the browser will return a pathname\n     * prefixed with the drive name ('/C:/path') when a\n     * pathname without a drive is set:\n     *  * a.setAttribute('href', '/foo')\n     *   * a.pathname === '/C:/foo' //true\n     *\n     * Inside of Angular, we're always using pathnames that\n     * do not include drive names for routing.\n     */\n    function removeWindowsDriveName(path, url, base) {\n      /*\n      Matches paths for file protocol on windows,\n      such as /C:/foo/bar, and captures only /foo/bar.\n      */\n      var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n      var firstPathSegmentMatch;\n\n      //Get the relative path from the input URL.\n      if (url.indexOf(base) === 0) {\n        url = url.replace(base, '');\n      }\n\n      // The input URL intentionally contains a first path segment that ends with a colon.\n      if (windowsFilePathExp.exec(url)) {\n        return path;\n      }\n\n      firstPathSegmentMatch = windowsFilePathExp.exec(path);\n      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n    }\n  };\n\n  /**\n   * Compose hashbang url and update `absUrl` property\n   * @private\n   */\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');\n  };\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (stripHash(appBase) == stripHash(url)) {\n      this.$$parse(url);\n      return true;\n    }\n    return false;\n  };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, hashPrefix) {\n  this.$$html5 = true;\n  LocationHashbangUrl.apply(this, arguments);\n\n  var appBaseNoFile = stripFile(appBase);\n\n  this.$$parseLinkUrl = function(url, relHref) {\n    if (relHref && relHref[0] === '#') {\n      // special case for links to hash fragments:\n      // keep the old url and only replace the hash fragment\n      this.hash(relHref.slice(1));\n      return true;\n    }\n\n    var rewrittenUrl;\n    var appUrl;\n\n    if (appBase == stripHash(url)) {\n      rewrittenUrl = url;\n    } else if ((appUrl = beginsWith(appBaseNoFile, url))) {\n      rewrittenUrl = appBase + hashPrefix + appUrl;\n    } else if (appBaseNoFile === url + '/') {\n      rewrittenUrl = appBaseNoFile;\n    }\n    if (rewrittenUrl) {\n      this.$$parse(rewrittenUrl);\n    }\n    return !!rewrittenUrl;\n  };\n\n  this.$$compose = function() {\n    var search = toKeyValue(this.$$search),\n        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n    // include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#'\n    this.$$absUrl = appBase + hashPrefix + this.$$url;\n  };\n\n}\n\n\nvar locationPrototype = {\n\n  /**\n   * Are we in html5 mode?\n   * @private\n   */\n  $$html5: false,\n\n  /**\n   * Has any change been replacing?\n   * @private\n   */\n  $$replace: false,\n\n  /**\n   * @ngdoc method\n   * @name $location#absUrl\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return full url representation with all segments encoded according to rules specified in\n   * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var absUrl = $location.absUrl();\n   * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n   * ```\n   *\n   * @return {string} full url\n   */\n  absUrl: locationGetter('$$absUrl'),\n\n  /**\n   * @ngdoc method\n   * @name $location#url\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return url (e.g. `/path?a=b#hash`) when called without any parameter.\n   *\n   * Change path, search and hash, when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var url = $location.url();\n   * // => \"/some/path?foo=bar&baz=xoxo\"\n   * ```\n   *\n   * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)\n   * @return {string} url\n   */\n  url: function(url) {\n    if (isUndefined(url))\n      return this.$$url;\n\n    var match = PATH_MATCH.exec(url);\n    if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n    if (match[2] || match[1] || url === '') this.search(match[3] || '');\n    this.hash(match[5] || '');\n\n    return this;\n  },\n\n  /**\n   * @ngdoc method\n   * @name $location#protocol\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return protocol of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var protocol = $location.protocol();\n   * // => \"http\"\n   * ```\n   *\n   * @return {string} protocol of current url\n   */\n  protocol: locationGetter('$$protocol'),\n\n  /**\n   * @ngdoc method\n   * @name $location#host\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return host of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var host = $location.host();\n   * // => \"example.com\"\n   * ```\n   *\n   * @return {string} host of current url.\n   */\n  host: locationGetter('$$host'),\n\n  /**\n   * @ngdoc method\n   * @name $location#port\n   *\n   * @description\n   * This method is getter only.\n   *\n   * Return port of current url.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var port = $location.port();\n   * // => 80\n   * ```\n   *\n   * @return {Number} port\n   */\n  port: locationGetter('$$port'),\n\n  /**\n   * @ngdoc method\n   * @name $location#path\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return path of current url when called without any parameter.\n   *\n   * Change path when called with parameter and return `$location`.\n   *\n   * Note: Path should always begin with forward slash (/), this method will add the forward slash\n   * if it is missing.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var path = $location.path();\n   * // => \"/some/path\"\n   * ```\n   *\n   * @param {(string|number)=} path New path\n   * @return {string} path\n   */\n  path: locationGetterSetter('$$path', function(path) {\n    path = path !== null ? path.toString() : '';\n    return path.charAt(0) == '/' ? path : '/' + path;\n  }),\n\n  /**\n   * @ngdoc method\n   * @name $location#search\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return search part (as object) of current url when called without any parameter.\n   *\n   * Change search part when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n   * var searchObject = $location.search();\n   * // => {foo: 'bar', baz: 'xoxo'}\n   *\n   * // set foo to 'yipee'\n   * $location.search('foo', 'yipee');\n   * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n   * ```\n   *\n   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or\n   * hash object.\n   *\n   * When called with a single argument the method acts as a setter, setting the `search` component\n   * of `$location` to the specified value.\n   *\n   * If the argument is a hash object containing an array of values, these values will be encoded\n   * as duplicate search parameters in the url.\n   *\n   * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n   * will override only a single search property.\n   *\n   * If `paramValue` is an array, it will override the property of the `search` component of\n   * `$location` specified via the first argument.\n   *\n   * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n   *\n   * If `paramValue` is `true`, the property specified via the first argument will be added with no\n   * value nor trailing equal sign.\n   *\n   * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n   * one or more arguments returns `$location` object itself.\n   */\n  search: function(search, paramValue) {\n    switch (arguments.length) {\n      case 0:\n        return this.$$search;\n      case 1:\n        if (isString(search) || isNumber(search)) {\n          search = search.toString();\n          this.$$search = parseKeyValue(search);\n        } else if (isObject(search)) {\n          search = copy(search, {});\n          // remove object undefined or null properties\n          forEach(search, function(value, key) {\n            if (value == null) delete search[key];\n          });\n\n          this.$$search = search;\n        } else {\n          throw $locationMinErr('isrcharg',\n              'The first argument of the `$location#search()` call must be a string or an object.');\n        }\n        break;\n      default:\n        if (isUndefined(paramValue) || paramValue === null) {\n          delete this.$$search[search];\n        } else {\n          this.$$search[search] = paramValue;\n        }\n    }\n\n    this.$$compose();\n    return this;\n  },\n\n  /**\n   * @ngdoc method\n   * @name $location#hash\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return hash fragment when called without any parameter.\n   *\n   * Change hash fragment when called with parameter and return `$location`.\n   *\n   *\n   * ```js\n   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n   * var hash = $location.hash();\n   * // => \"hashValue\"\n   * ```\n   *\n   * @param {(string|number)=} hash New hash fragment\n   * @return {string} hash\n   */\n  hash: locationGetterSetter('$$hash', function(hash) {\n    return hash !== null ? hash.toString() : '';\n  }),\n\n  /**\n   * @ngdoc method\n   * @name $location#replace\n   *\n   * @description\n   * If called, all changes to $location during current `$digest` will be replacing current history\n   * record, instead of adding new one.\n   */\n  replace: function() {\n    this.$$replace = true;\n    return this;\n  }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n  Location.prototype = Object.create(locationPrototype);\n\n  /**\n   * @ngdoc method\n   * @name $location#state\n   *\n   * @description\n   * This method is getter / setter.\n   *\n   * Return the history state object when called without any parameter.\n   *\n   * Change the history state object when called with one parameter and return `$location`.\n   * The state object is later passed to `pushState` or `replaceState`.\n   *\n   * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n   * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n   * older browsers (like IE9 or Android < 4.0), don't use this method.\n   *\n   * @param {object=} state State object for pushState or replaceState\n   * @return {object} state\n   */\n  Location.prototype.state = function(state) {\n    if (!arguments.length)\n      return this.$$state;\n\n    if (Location !== LocationHtml5Url || !this.$$html5) {\n      throw $locationMinErr('nostate', 'History API state support is available only ' +\n        'in HTML5 mode and only in browsers supporting HTML5 History API');\n    }\n    // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n    // but we're changing the $$state reference to $browser.state() during the $digest\n    // so the modification window is narrow.\n    this.$$state = isUndefined(state) ? null : state;\n\n    return this;\n  };\n});\n\n\nfunction locationGetter(property) {\n  return function() {\n    return this[property];\n  };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n  return function(value) {\n    if (isUndefined(value))\n      return this[property];\n\n    this[property] = preprocess(value);\n    this.$$compose();\n\n    return this;\n  };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n *   - Watch and observe the URL.\n *   - Change the URL.\n * - Synchronizes the URL with the browser when the user\n *   - Changes the address bar.\n *   - Clicks the back or forward button (or clicks a History link).\n *   - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n  var hashPrefix = '',\n      html5Mode = {\n        enabled: false,\n        requireBase: true,\n        rewriteLinks: true\n      };\n\n  /**\n   * @ngdoc method\n   * @name $locationProvider#hashPrefix\n   * @description\n   * @param {string=} prefix Prefix for hash part (containing path and search)\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   */\n  this.hashPrefix = function(prefix) {\n    if (isDefined(prefix)) {\n      hashPrefix = prefix;\n      return this;\n    } else {\n      return hashPrefix;\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $locationProvider#html5Mode\n   * @description\n   * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n   *   If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n   *   properties:\n   *   - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n   *     change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n   *     support `pushState`.\n   *   - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n   *     whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are\n   *     true, and a base tag is not present, an error will be thrown when `$location` is injected.\n   *     See the {@link guide/$location $location guide for more information}\n   *   - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,\n   *     enables/disables url rewriting for relative links.\n   *\n   * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n   */\n  this.html5Mode = function(mode) {\n    if (isBoolean(mode)) {\n      html5Mode.enabled = mode;\n      return this;\n    } else if (isObject(mode)) {\n\n      if (isBoolean(mode.enabled)) {\n        html5Mode.enabled = mode.enabled;\n      }\n\n      if (isBoolean(mode.requireBase)) {\n        html5Mode.requireBase = mode.requireBase;\n      }\n\n      if (isBoolean(mode.rewriteLinks)) {\n        html5Mode.rewriteLinks = mode.rewriteLinks;\n      }\n\n      return this;\n    } else {\n      return html5Mode;\n    }\n  };\n\n  /**\n   * @ngdoc event\n   * @name $location#$locationChangeStart\n   * @eventType broadcast on root scope\n   * @description\n   * Broadcasted before a URL will change.\n   *\n   * This change can be prevented by calling\n   * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n   * details about event object. Upon successful change\n   * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n   *\n   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n   * the browser supports the HTML5 History API.\n   *\n   * @param {Object} angularEvent Synthetic event object.\n   * @param {string} newUrl New URL\n   * @param {string=} oldUrl URL that was before it was changed.\n   * @param {string=} newState New history state object\n   * @param {string=} oldState History state object that was before it was changed.\n   */\n\n  /**\n   * @ngdoc event\n   * @name $location#$locationChangeSuccess\n   * @eventType broadcast on root scope\n   * @description\n   * Broadcasted after a URL was changed.\n   *\n   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n   * the browser supports the HTML5 History API.\n   *\n   * @param {Object} angularEvent Synthetic event object.\n   * @param {string} newUrl New URL\n   * @param {string=} oldUrl URL that was before it was changed.\n   * @param {string=} newState New history state object\n   * @param {string=} oldState History state object that was before it was changed.\n   */\n\n  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n      function($rootScope, $browser, $sniffer, $rootElement, $window) {\n    var $location,\n        LocationMode,\n        baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n        initialUrl = $browser.url(),\n        appBase;\n\n    if (html5Mode.enabled) {\n      if (!baseHref && html5Mode.requireBase) {\n        throw $locationMinErr('nobase',\n          \"$location in HTML5 mode requires a <base> tag to be present!\");\n      }\n      appBase = serverBase(initialUrl) + (baseHref || '/');\n      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n    } else {\n      appBase = stripHash(initialUrl);\n      LocationMode = LocationHashbangUrl;\n    }\n    $location = new LocationMode(appBase, '#' + hashPrefix);\n    $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n    $location.$$state = $browser.state();\n\n    var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n    function setBrowserUrlWithFallback(url, replace, state) {\n      var oldUrl = $location.url();\n      var oldState = $location.$$state;\n      try {\n        $browser.url(url, replace, state);\n\n        // Make sure $location.state() returns referentially identical (not just deeply equal)\n        // state object; this makes possible quick checking if the state changed in the digest\n        // loop. Checking deep equality would be too expensive.\n        $location.$$state = $browser.state();\n      } catch (e) {\n        // Restore old values if pushState fails\n        $location.url(oldUrl);\n        $location.$$state = oldState;\n\n        throw e;\n      }\n    }\n\n    $rootElement.on('click', function(event) {\n      // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n      // currently we open nice url link and redirect then\n\n      if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;\n\n      var elm = jqLite(event.target);\n\n      // traverse the DOM up to find first A tag\n      while (nodeName_(elm[0]) !== 'a') {\n        // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n      }\n\n      var absHref = elm.prop('href');\n      // get the actual href attribute - see\n      // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n      var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n      if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n        // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n        // an animation.\n        absHref = urlResolve(absHref.animVal).href;\n      }\n\n      // Ignore when url is started with javascript: or mailto:\n      if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n      if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n        if ($location.$$parseLinkUrl(absHref, relHref)) {\n          // We do a preventDefault for all urls that are part of the angular application,\n          // in html5mode and also without, so that we are able to abort navigation without\n          // getting double entries in the location history.\n          event.preventDefault();\n          // update location manually\n          if ($location.absUrl() != $browser.url()) {\n            $rootScope.$apply();\n            // hack to work around FF6 bug 684208 when scenario runner clicks on links\n            $window.angular['ff-684208-preventDefault'] = true;\n          }\n        }\n      }\n    });\n\n\n    // rewrite hashbang url <> html5 url\n    if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {\n      $browser.url($location.absUrl(), true);\n    }\n\n    var initializing = true;\n\n    // update $location when $browser url changes\n    $browser.onUrlChange(function(newUrl, newState) {\n      $rootScope.$evalAsync(function() {\n        var oldUrl = $location.absUrl();\n        var oldState = $location.$$state;\n        var defaultPrevented;\n\n        $location.$$parse(newUrl);\n        $location.$$state = newState;\n\n        defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n            newState, oldState).defaultPrevented;\n\n        // if the location was changed by a `$locationChangeStart` handler then stop\n        // processing this location change\n        if ($location.absUrl() !== newUrl) return;\n\n        if (defaultPrevented) {\n          $location.$$parse(oldUrl);\n          $location.$$state = oldState;\n          setBrowserUrlWithFallback(oldUrl, false, oldState);\n        } else {\n          initializing = false;\n          afterLocationChange(oldUrl, oldState);\n        }\n      });\n      if (!$rootScope.$$phase) $rootScope.$digest();\n    });\n\n    // update browser\n    $rootScope.$watch(function $locationWatch() {\n      var oldUrl = trimEmptyHash($browser.url());\n      var newUrl = trimEmptyHash($location.absUrl());\n      var oldState = $browser.state();\n      var currentReplace = $location.$$replace;\n      var urlOrStateChanged = oldUrl !== newUrl ||\n        ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n      if (initializing || urlOrStateChanged) {\n        initializing = false;\n\n        $rootScope.$evalAsync(function() {\n          var newUrl = $location.absUrl();\n          var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n              $location.$$state, oldState).defaultPrevented;\n\n          // if the location was changed by a `$locationChangeStart` handler then stop\n          // processing this location change\n          if ($location.absUrl() !== newUrl) return;\n\n          if (defaultPrevented) {\n            $location.$$parse(oldUrl);\n            $location.$$state = oldState;\n          } else {\n            if (urlOrStateChanged) {\n              setBrowserUrlWithFallback(newUrl, currentReplace,\n                                        oldState === $location.$$state ? null : $location.$$state);\n            }\n            afterLocationChange(oldUrl, oldState);\n          }\n        });\n      }\n\n      $location.$$replace = false;\n\n      // we don't need to return anything because $evalAsync will make the digest loop dirty when\n      // there is a change\n    });\n\n    return $location;\n\n    function afterLocationChange(oldUrl, oldState) {\n      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n        $location.$$state, oldState);\n    }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n   <example module=\"logExample\">\n     <file name=\"script.js\">\n       angular.module('logExample', [])\n         .controller('LogController', ['$scope', '$log', function($scope, $log) {\n           $scope.$log = $log;\n           $scope.message = 'Hello World!';\n         }]);\n     </file>\n     <file name=\"index.html\">\n       <div ng-controller=\"LogController\">\n         <p>Reload this page with open console, enter text and hit the log button...</p>\n         Message:\n         <input type=\"text\" ng-model=\"message\"/>\n         <button ng-click=\"$log.log(message)\">log</button>\n         <button ng-click=\"$log.warn(message)\">warn</button>\n         <button ng-click=\"$log.info(message)\">info</button>\n         <button ng-click=\"$log.error(message)\">error</button>\n       </div>\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n  var debug = true,\n      self = this;\n\n  /**\n   * @ngdoc method\n   * @name $logProvider#debugEnabled\n   * @description\n   * @param {boolean=} flag enable or disable debug level messages\n   * @returns {*} current value if used as getter or itself (chaining) if used as setter\n   */\n  this.debugEnabled = function(flag) {\n    if (isDefined(flag)) {\n      debug = flag;\n    return this;\n    } else {\n      return debug;\n    }\n  };\n\n  this.$get = ['$window', function($window) {\n    return {\n      /**\n       * @ngdoc method\n       * @name $log#log\n       *\n       * @description\n       * Write a log message\n       */\n      log: consoleLog('log'),\n\n      /**\n       * @ngdoc method\n       * @name $log#info\n       *\n       * @description\n       * Write an information message\n       */\n      info: consoleLog('info'),\n\n      /**\n       * @ngdoc method\n       * @name $log#warn\n       *\n       * @description\n       * Write a warning message\n       */\n      warn: consoleLog('warn'),\n\n      /**\n       * @ngdoc method\n       * @name $log#error\n       *\n       * @description\n       * Write an error message\n       */\n      error: consoleLog('error'),\n\n      /**\n       * @ngdoc method\n       * @name $log#debug\n       *\n       * @description\n       * Write a debug message\n       */\n      debug: (function() {\n        var fn = consoleLog('debug');\n\n        return function() {\n          if (debug) {\n            fn.apply(self, arguments);\n          }\n        };\n      }())\n    };\n\n    function formatError(arg) {\n      if (arg instanceof Error) {\n        if (arg.stack) {\n          arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n              ? 'Error: ' + arg.message + '\\n' + arg.stack\n              : arg.stack;\n        } else if (arg.sourceURL) {\n          arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n        }\n      }\n      return arg;\n    }\n\n    function consoleLog(type) {\n      var console = $window.console || {},\n          logFn = console[type] || console.log || noop,\n          hasApply = false;\n\n      // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.\n      // The reason behind this is that console.log has type \"object\" in IE8...\n      try {\n        hasApply = !!logFn.apply;\n      } catch (e) {}\n\n      if (hasApply) {\n        return function() {\n          var args = [];\n          forEach(arguments, function(arg) {\n            args.push(formatError(arg));\n          });\n          return logFn.apply(console, args);\n        };\n      }\n\n      // we are IE which either doesn't have window.console => this is noop and we do nothing,\n      // or we are IE where console.log doesn't have apply so we log at least first 2 args\n      return function(arg1, arg2) {\n        logFn(arg1, arg2 == null ? '' : arg2);\n      };\n    }\n  }];\n}\n\nvar $parseMinErr = minErr('$parse');\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are generally considered safe because these expressions only have direct\n// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by\n// obtaining a reference to native JS functions such as the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n//   {}.toString.constructor('alert(\"evil JS code\")')\n//\n// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits\n// against the expression language, but not to prevent exploits that were enabled by exposing\n// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good\n// practice and therefore we are not even trying to protect against interaction with an object\n// explicitly exposed in this way.\n//\n// In general, it is not possible to access a Window object from an angular expression unless a\n// window or some DOM object that has a reference to window is published onto a Scope.\n// Similarly we prevent invocations of function known to be dangerous, as well as assignments to\n// native objects.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction ensureSafeMemberName(name, fullExpression) {\n  if (name === \"__defineGetter__\" || name === \"__defineSetter__\"\n      || name === \"__lookupGetter__\" || name === \"__lookupSetter__\"\n      || name === \"__proto__\") {\n    throw $parseMinErr('isecfld',\n        'Attempting to access a disallowed field in Angular expressions! '\n        + 'Expression: {0}', fullExpression);\n  }\n  return name;\n}\n\nfunction ensureSafeObject(obj, fullExpression) {\n  // nifty check if obj is Function that is fast and works across iframes and other contexts\n  if (obj) {\n    if (obj.constructor === obj) {\n      throw $parseMinErr('isecfn',\n          'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// isWindow(obj)\n        obj.window === obj) {\n      throw $parseMinErr('isecwindow',\n          'Referencing the Window in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// isElement(obj)\n        obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {\n      throw $parseMinErr('isecdom',\n          'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    } else if (// block Object so that we can't get hold of dangerous Object.* methods\n        obj === Object) {\n      throw $parseMinErr('isecobj',\n          'Referencing Object in Angular expressions is disallowed! Expression: {0}',\n          fullExpression);\n    }\n  }\n  return obj;\n}\n\nvar CALL = Function.prototype.call;\nvar APPLY = Function.prototype.apply;\nvar BIND = Function.prototype.bind;\n\nfunction ensureSafeFunction(obj, fullExpression) {\n  if (obj) {\n    if (obj.constructor === obj) {\n      throw $parseMinErr('isecfn',\n        'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n        fullExpression);\n    } else if (obj === CALL || obj === APPLY || obj === BIND) {\n      throw $parseMinErr('isecff',\n        'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',\n        fullExpression);\n    }\n  }\n}\n\n//Keyword constants\nvar CONSTANTS = createMap();\nforEach({\n  'null': function() { return null; },\n  'true': function() { return true; },\n  'false': function() { return false; },\n  'undefined': function() {}\n}, function(constantGetter, name) {\n  constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;\n  CONSTANTS[name] = constantGetter;\n});\n\n//Not quite a constant, but can be lex/parsed the same\nCONSTANTS['this'] = function(self) { return self; };\nCONSTANTS['this'].sharedGetter = true;\n\n\n//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter\nvar OPERATORS = extend(createMap(), {\n    '+':function(self, locals, a, b) {\n      a=a(self, locals); b=b(self, locals);\n      if (isDefined(a)) {\n        if (isDefined(b)) {\n          return a + b;\n        }\n        return a;\n      }\n      return isDefined(b) ? b : undefined;},\n    '-':function(self, locals, a, b) {\n          a=a(self, locals); b=b(self, locals);\n          return (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0);\n        },\n    '*':function(self, locals, a, b) {return a(self, locals) * b(self, locals);},\n    '/':function(self, locals, a, b) {return a(self, locals) / b(self, locals);},\n    '%':function(self, locals, a, b) {return a(self, locals) % b(self, locals);},\n    '===':function(self, locals, a, b) {return a(self, locals) === b(self, locals);},\n    '!==':function(self, locals, a, b) {return a(self, locals) !== b(self, locals);},\n    '==':function(self, locals, a, b) {return a(self, locals) == b(self, locals);},\n    '!=':function(self, locals, a, b) {return a(self, locals) != b(self, locals);},\n    '<':function(self, locals, a, b) {return a(self, locals) < b(self, locals);},\n    '>':function(self, locals, a, b) {return a(self, locals) > b(self, locals);},\n    '<=':function(self, locals, a, b) {return a(self, locals) <= b(self, locals);},\n    '>=':function(self, locals, a, b) {return a(self, locals) >= b(self, locals);},\n    '&&':function(self, locals, a, b) {return a(self, locals) && b(self, locals);},\n    '||':function(self, locals, a, b) {return a(self, locals) || b(self, locals);},\n    '!':function(self, locals, a) {return !a(self, locals);},\n\n    //Tokenized as operators but parsed as assignment/filters\n    '=':true,\n    '|':true\n});\nvar ESCAPE = {\"n\":\"\\n\", \"f\":\"\\f\", \"r\":\"\\r\", \"t\":\"\\t\", \"v\":\"\\v\", \"'\":\"'\", '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function(options) {\n  this.options = options;\n};\n\nLexer.prototype = {\n  constructor: Lexer,\n\n  lex: function(text) {\n    this.text = text;\n    this.index = 0;\n    this.tokens = [];\n\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      if (ch === '\"' || ch === \"'\") {\n        this.readString(ch);\n      } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n        this.readNumber();\n      } else if (this.isIdent(ch)) {\n        this.readIdent();\n      } else if (this.is(ch, '(){}[].,;:?')) {\n        this.tokens.push({index: this.index, text: ch});\n        this.index++;\n      } else if (this.isWhitespace(ch)) {\n        this.index++;\n      } else {\n        var ch2 = ch + this.peek();\n        var ch3 = ch2 + this.peek(2);\n        var op1 = OPERATORS[ch];\n        var op2 = OPERATORS[ch2];\n        var op3 = OPERATORS[ch3];\n        if (op1 || op2 || op3) {\n          var token = op3 ? ch3 : (op2 ? ch2 : ch);\n          this.tokens.push({index: this.index, text: token, operator: true});\n          this.index += token.length;\n        } else {\n          this.throwError('Unexpected next character ', this.index, this.index + 1);\n        }\n      }\n    }\n    return this.tokens;\n  },\n\n  is: function(ch, chars) {\n    return chars.indexOf(ch) !== -1;\n  },\n\n  peek: function(i) {\n    var num = i || 1;\n    return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n  },\n\n  isNumber: function(ch) {\n    return ('0' <= ch && ch <= '9') && typeof ch === \"string\";\n  },\n\n  isWhitespace: function(ch) {\n    // IE treats non-breaking space as \\u00A0\n    return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n            ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n  },\n\n  isIdent: function(ch) {\n    return ('a' <= ch && ch <= 'z' ||\n            'A' <= ch && ch <= 'Z' ||\n            '_' === ch || ch === '$');\n  },\n\n  isExpOperator: function(ch) {\n    return (ch === '-' || ch === '+' || this.isNumber(ch));\n  },\n\n  throwError: function(error, start, end) {\n    end = end || this.index;\n    var colStr = (isDefined(start)\n            ? 's ' + start +  '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n            : ' ' + end);\n    throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n        error, colStr, this.text);\n  },\n\n  readNumber: function() {\n    var number = '';\n    var start = this.index;\n    while (this.index < this.text.length) {\n      var ch = lowercase(this.text.charAt(this.index));\n      if (ch == '.' || this.isNumber(ch)) {\n        number += ch;\n      } else {\n        var peekCh = this.peek();\n        if (ch == 'e' && this.isExpOperator(peekCh)) {\n          number += ch;\n        } else if (this.isExpOperator(ch) &&\n            peekCh && this.isNumber(peekCh) &&\n            number.charAt(number.length - 1) == 'e') {\n          number += ch;\n        } else if (this.isExpOperator(ch) &&\n            (!peekCh || !this.isNumber(peekCh)) &&\n            number.charAt(number.length - 1) == 'e') {\n          this.throwError('Invalid exponent');\n        } else {\n          break;\n        }\n      }\n      this.index++;\n    }\n    this.tokens.push({\n      index: start,\n      text: number,\n      constant: true,\n      value: Number(number)\n    });\n  },\n\n  readIdent: function() {\n    var start = this.index;\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      if (!(this.isIdent(ch) || this.isNumber(ch))) {\n        break;\n      }\n      this.index++;\n    }\n    this.tokens.push({\n      index: start,\n      text: this.text.slice(start, this.index),\n      identifier: true\n    });\n  },\n\n  readString: function(quote) {\n    var start = this.index;\n    this.index++;\n    var string = '';\n    var rawString = quote;\n    var escape = false;\n    while (this.index < this.text.length) {\n      var ch = this.text.charAt(this.index);\n      rawString += ch;\n      if (escape) {\n        if (ch === 'u') {\n          var hex = this.text.substring(this.index + 1, this.index + 5);\n          if (!hex.match(/[\\da-f]{4}/i))\n            this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n          this.index += 4;\n          string += String.fromCharCode(parseInt(hex, 16));\n        } else {\n          var rep = ESCAPE[ch];\n          string = string + (rep || ch);\n        }\n        escape = false;\n      } else if (ch === '\\\\') {\n        escape = true;\n      } else if (ch === quote) {\n        this.index++;\n        this.tokens.push({\n          index: start,\n          text: rawString,\n          constant: true,\n          value: string\n        });\n        return;\n      } else {\n        string += ch;\n      }\n      this.index++;\n    }\n    this.throwError('Unterminated quote', start);\n  }\n};\n\n\nfunction isConstant(exp) {\n  return exp.constant;\n}\n\n/**\n * @constructor\n */\nvar Parser = function(lexer, $filter, options) {\n  this.lexer = lexer;\n  this.$filter = $filter;\n  this.options = options;\n};\n\nParser.ZERO = extend(function() {\n  return 0;\n}, {\n  sharedGetter: true,\n  constant: true\n});\n\nParser.prototype = {\n  constructor: Parser,\n\n  parse: function(text) {\n    this.text = text;\n    this.tokens = this.lexer.lex(text);\n\n    var value = this.statements();\n\n    if (this.tokens.length !== 0) {\n      this.throwError('is an unexpected token', this.tokens[0]);\n    }\n\n    value.literal = !!value.literal;\n    value.constant = !!value.constant;\n\n    return value;\n  },\n\n  primary: function() {\n    var primary;\n    if (this.expect('(')) {\n      primary = this.filterChain();\n      this.consume(')');\n    } else if (this.expect('[')) {\n      primary = this.arrayDeclaration();\n    } else if (this.expect('{')) {\n      primary = this.object();\n    } else if (this.peek().identifier && this.peek().text in CONSTANTS) {\n      primary = CONSTANTS[this.consume().text];\n    } else if (this.peek().identifier) {\n      primary = this.identifier();\n    } else if (this.peek().constant) {\n      primary = this.constant();\n    } else {\n      this.throwError('not a primary expression', this.peek());\n    }\n\n    var next, context;\n    while ((next = this.expect('(', '[', '.'))) {\n      if (next.text === '(') {\n        primary = this.functionCall(primary, context);\n        context = null;\n      } else if (next.text === '[') {\n        context = primary;\n        primary = this.objectIndex(primary);\n      } else if (next.text === '.') {\n        context = primary;\n        primary = this.fieldAccess(primary);\n      } else {\n        this.throwError('IMPOSSIBLE');\n      }\n    }\n    return primary;\n  },\n\n  throwError: function(msg, token) {\n    throw $parseMinErr('syntax',\n        'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n          token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n  },\n\n  peekToken: function() {\n    if (this.tokens.length === 0)\n      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n    return this.tokens[0];\n  },\n\n  peek: function(e1, e2, e3, e4) {\n    return this.peekAhead(0, e1, e2, e3, e4);\n  },\n  peekAhead: function(i, e1, e2, e3, e4) {\n    if (this.tokens.length > i) {\n      var token = this.tokens[i];\n      var t = token.text;\n      if (t === e1 || t === e2 || t === e3 || t === e4 ||\n          (!e1 && !e2 && !e3 && !e4)) {\n        return token;\n      }\n    }\n    return false;\n  },\n\n  expect: function(e1, e2, e3, e4) {\n    var token = this.peek(e1, e2, e3, e4);\n    if (token) {\n      this.tokens.shift();\n      return token;\n    }\n    return false;\n  },\n\n  consume: function(e1) {\n    if (this.tokens.length === 0) {\n      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n    }\n\n    var token = this.expect(e1);\n    if (!token) {\n      this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n    }\n    return token;\n  },\n\n  unaryFn: function(op, right) {\n    var fn = OPERATORS[op];\n    return extend(function $parseUnaryFn(self, locals) {\n      return fn(self, locals, right);\n    }, {\n      constant:right.constant,\n      inputs: [right]\n    });\n  },\n\n  binaryFn: function(left, op, right, isBranching) {\n    var fn = OPERATORS[op];\n    return extend(function $parseBinaryFn(self, locals) {\n      return fn(self, locals, left, right);\n    }, {\n      constant: left.constant && right.constant,\n      inputs: !isBranching && [left, right]\n    });\n  },\n\n  identifier: function() {\n    var id = this.consume().text;\n\n    //Continue reading each `.identifier` unless it is a method invocation\n    while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) {\n      id += this.consume().text + this.consume().text;\n    }\n\n    return getterFn(id, this.options, this.text);\n  },\n\n  constant: function() {\n    var value = this.consume().value;\n\n    return extend(function $parseConstant() {\n      return value;\n    }, {\n      constant: true,\n      literal: true\n    });\n  },\n\n  statements: function() {\n    var statements = [];\n    while (true) {\n      if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n        statements.push(this.filterChain());\n      if (!this.expect(';')) {\n        // optimize for the common case where there is only one statement.\n        // TODO(size): maybe we should not support multiple statements?\n        return (statements.length === 1)\n            ? statements[0]\n            : function $parseStatements(self, locals) {\n                var value;\n                for (var i = 0, ii = statements.length; i < ii; i++) {\n                  value = statements[i](self, locals);\n                }\n                return value;\n              };\n      }\n    }\n  },\n\n  filterChain: function() {\n    var left = this.expression();\n    var token;\n    while ((token = this.expect('|'))) {\n      left = this.filter(left);\n    }\n    return left;\n  },\n\n  filter: function(inputFn) {\n    var fn = this.$filter(this.consume().text);\n    var argsFn;\n    var args;\n\n    if (this.peek(':')) {\n      argsFn = [];\n      args = []; // we can safely reuse the array\n      while (this.expect(':')) {\n        argsFn.push(this.expression());\n      }\n    }\n\n    var inputs = [inputFn].concat(argsFn || []);\n\n    return extend(function $parseFilter(self, locals) {\n      var input = inputFn(self, locals);\n      if (args) {\n        args[0] = input;\n\n        var i = argsFn.length;\n        while (i--) {\n          args[i + 1] = argsFn[i](self, locals);\n        }\n\n        return fn.apply(undefined, args);\n      }\n\n      return fn(input);\n    }, {\n      constant: !fn.$stateful && inputs.every(isConstant),\n      inputs: !fn.$stateful && inputs\n    });\n  },\n\n  expression: function() {\n    return this.assignment();\n  },\n\n  assignment: function() {\n    var left = this.ternary();\n    var right;\n    var token;\n    if ((token = this.expect('='))) {\n      if (!left.assign) {\n        this.throwError('implies assignment but [' +\n            this.text.substring(0, token.index) + '] can not be assigned to', token);\n      }\n      right = this.ternary();\n      return extend(function $parseAssignment(scope, locals) {\n        return left.assign(scope, right(scope, locals), locals);\n      }, {\n        inputs: [left, right]\n      });\n    }\n    return left;\n  },\n\n  ternary: function() {\n    var left = this.logicalOR();\n    var middle;\n    var token;\n    if ((token = this.expect('?'))) {\n      middle = this.assignment();\n      if (this.consume(':')) {\n        var right = this.assignment();\n\n        return extend(function $parseTernary(self, locals) {\n          return left(self, locals) ? middle(self, locals) : right(self, locals);\n        }, {\n          constant: left.constant && middle.constant && right.constant\n        });\n      }\n    }\n\n    return left;\n  },\n\n  logicalOR: function() {\n    var left = this.logicalAND();\n    var token;\n    while ((token = this.expect('||'))) {\n      left = this.binaryFn(left, token.text, this.logicalAND(), true);\n    }\n    return left;\n  },\n\n  logicalAND: function() {\n    var left = this.equality();\n    var token;\n    while ((token = this.expect('&&'))) {\n      left = this.binaryFn(left, token.text, this.equality(), true);\n    }\n    return left;\n  },\n\n  equality: function() {\n    var left = this.relational();\n    var token;\n    while ((token = this.expect('==','!=','===','!=='))) {\n      left = this.binaryFn(left, token.text, this.relational());\n    }\n    return left;\n  },\n\n  relational: function() {\n    var left = this.additive();\n    var token;\n    while ((token = this.expect('<', '>', '<=', '>='))) {\n      left = this.binaryFn(left, token.text, this.additive());\n    }\n    return left;\n  },\n\n  additive: function() {\n    var left = this.multiplicative();\n    var token;\n    while ((token = this.expect('+','-'))) {\n      left = this.binaryFn(left, token.text, this.multiplicative());\n    }\n    return left;\n  },\n\n  multiplicative: function() {\n    var left = this.unary();\n    var token;\n    while ((token = this.expect('*','/','%'))) {\n      left = this.binaryFn(left, token.text, this.unary());\n    }\n    return left;\n  },\n\n  unary: function() {\n    var token;\n    if (this.expect('+')) {\n      return this.primary();\n    } else if ((token = this.expect('-'))) {\n      return this.binaryFn(Parser.ZERO, token.text, this.unary());\n    } else if ((token = this.expect('!'))) {\n      return this.unaryFn(token.text, this.unary());\n    } else {\n      return this.primary();\n    }\n  },\n\n  fieldAccess: function(object) {\n    var getter = this.identifier();\n\n    return extend(function $parseFieldAccess(scope, locals, self) {\n      var o = self || object(scope, locals);\n      return (o == null) ? undefined : getter(o);\n    }, {\n      assign: function(scope, value, locals) {\n        var o = object(scope, locals);\n        if (!o) object.assign(scope, o = {}, locals);\n        return getter.assign(o, value);\n      }\n    });\n  },\n\n  objectIndex: function(obj) {\n    var expression = this.text;\n\n    var indexFn = this.expression();\n    this.consume(']');\n\n    return extend(function $parseObjectIndex(self, locals) {\n      var o = obj(self, locals),\n          i = indexFn(self, locals),\n          v;\n\n      ensureSafeMemberName(i, expression);\n      if (!o) return undefined;\n      v = ensureSafeObject(o[i], expression);\n      return v;\n    }, {\n      assign: function(self, value, locals) {\n        var key = ensureSafeMemberName(indexFn(self, locals), expression);\n        // prevent overwriting of Function.constructor which would break ensureSafeObject check\n        var o = ensureSafeObject(obj(self, locals), expression);\n        if (!o) obj.assign(self, o = {}, locals);\n        return o[key] = value;\n      }\n    });\n  },\n\n  functionCall: function(fnGetter, contextGetter) {\n    var argsFn = [];\n    if (this.peekToken().text !== ')') {\n      do {\n        argsFn.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume(')');\n\n    var expressionText = this.text;\n    // we can safely reuse the array across invocations\n    var args = argsFn.length ? [] : null;\n\n    return function $parseFunctionCall(scope, locals) {\n      var context = contextGetter ? contextGetter(scope, locals) : isDefined(contextGetter) ? undefined : scope;\n      var fn = fnGetter(scope, locals, context) || noop;\n\n      if (args) {\n        var i = argsFn.length;\n        while (i--) {\n          args[i] = ensureSafeObject(argsFn[i](scope, locals), expressionText);\n        }\n      }\n\n      ensureSafeObject(context, expressionText);\n      ensureSafeFunction(fn, expressionText);\n\n      // IE doesn't have apply for some native functions\n      var v = fn.apply\n            ? fn.apply(context, args)\n            : fn(args[0], args[1], args[2], args[3], args[4]);\n\n      if (args) {\n        // Free-up the memory (arguments of the last function call).\n        args.length = 0;\n      }\n\n      return ensureSafeObject(v, expressionText);\n      };\n  },\n\n  // This is used with json array declaration\n  arrayDeclaration: function() {\n    var elementFns = [];\n    if (this.peekToken().text !== ']') {\n      do {\n        if (this.peek(']')) {\n          // Support trailing commas per ES5.1.\n          break;\n        }\n        elementFns.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume(']');\n\n    return extend(function $parseArrayLiteral(self, locals) {\n      var array = [];\n      for (var i = 0, ii = elementFns.length; i < ii; i++) {\n        array.push(elementFns[i](self, locals));\n      }\n      return array;\n    }, {\n      literal: true,\n      constant: elementFns.every(isConstant),\n      inputs: elementFns\n    });\n  },\n\n  object: function() {\n    var keys = [], valueFns = [];\n    if (this.peekToken().text !== '}') {\n      do {\n        if (this.peek('}')) {\n          // Support trailing commas per ES5.1.\n          break;\n        }\n        var token = this.consume();\n        if (token.constant) {\n          keys.push(token.value);\n        } else if (token.identifier) {\n          keys.push(token.text);\n        } else {\n          this.throwError(\"invalid key\", token);\n        }\n        this.consume(':');\n        valueFns.push(this.expression());\n      } while (this.expect(','));\n    }\n    this.consume('}');\n\n    return extend(function $parseObjectLiteral(self, locals) {\n      var object = {};\n      for (var i = 0, ii = valueFns.length; i < ii; i++) {\n        object[keys[i]] = valueFns[i](self, locals);\n      }\n      return object;\n    }, {\n      literal: true,\n      constant: valueFns.every(isConstant),\n      inputs: valueFns\n    });\n  }\n};\n\n\n//////////////////////////////////////////////////\n// Parser helper functions\n//////////////////////////////////////////////////\n\nfunction setter(obj, locals, path, setValue, fullExp) {\n  ensureSafeObject(obj, fullExp);\n  ensureSafeObject(locals, fullExp);\n\n  var element = path.split('.'), key;\n  for (var i = 0; element.length > 1; i++) {\n    key = ensureSafeMemberName(element.shift(), fullExp);\n    var propertyObj = (i === 0 && locals && locals[key]) || obj[key];\n    if (!propertyObj) {\n      propertyObj = {};\n      obj[key] = propertyObj;\n    }\n    obj = ensureSafeObject(propertyObj, fullExp);\n  }\n  key = ensureSafeMemberName(element.shift(), fullExp);\n  ensureSafeObject(obj[key], fullExp);\n  obj[key] = setValue;\n  return setValue;\n}\n\nvar getterFnCacheDefault = createMap();\nvar getterFnCacheExpensive = createMap();\n\nfunction isPossiblyDangerousMemberName(name) {\n  return name == 'constructor';\n}\n\n/**\n * Implementation of the \"Black Hole\" variant from:\n * - http://jsperf.com/angularjs-parse-getter/4\n * - http://jsperf.com/path-evaluation-simplified/7\n */\nfunction cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) {\n  ensureSafeMemberName(key0, fullExp);\n  ensureSafeMemberName(key1, fullExp);\n  ensureSafeMemberName(key2, fullExp);\n  ensureSafeMemberName(key3, fullExp);\n  ensureSafeMemberName(key4, fullExp);\n  var eso = function(o) {\n    return ensureSafeObject(o, fullExp);\n  };\n  var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n  var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n  var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n  var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n  var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n  return function cspSafeGetter(scope, locals) {\n    var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n    if (pathVal == null) return pathVal;\n    pathVal = eso0(pathVal[key0]);\n\n    if (!key1) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso1(pathVal[key1]);\n\n    if (!key2) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso2(pathVal[key2]);\n\n    if (!key3) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso3(pathVal[key3]);\n\n    if (!key4) return pathVal;\n    if (pathVal == null) return undefined;\n    pathVal = eso4(pathVal[key4]);\n\n    return pathVal;\n  };\n}\n\nfunction getterFnWithEnsureSafeObject(fn, fullExpression) {\n  return function(s, l) {\n    return fn(s, l, ensureSafeObject, fullExpression);\n  };\n}\n\nfunction getterFn(path, options, fullExp) {\n  var expensiveChecks = options.expensiveChecks;\n  var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault);\n  var fn = getterFnCache[path];\n  if (fn) return fn;\n\n\n  var pathKeys = path.split('.'),\n      pathKeysLength = pathKeys.length;\n\n  // http://jsperf.com/angularjs-parse-getter/6\n  if (options.csp) {\n    if (pathKeysLength < 6) {\n      fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, expensiveChecks);\n    } else {\n      fn = function cspSafeGetter(scope, locals) {\n        var i = 0, val;\n        do {\n          val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++],\n                                pathKeys[i++], fullExp, expensiveChecks)(scope, locals);\n\n          locals = undefined; // clear after first iteration\n          scope = val;\n        } while (i < pathKeysLength);\n        return val;\n      };\n    }\n  } else {\n    var code = '';\n    if (expensiveChecks) {\n      code += 's = eso(s, fe);\\nl = eso(l, fe);\\n';\n    }\n    var needsEnsureSafeObject = expensiveChecks;\n    forEach(pathKeys, function(key, index) {\n      ensureSafeMemberName(key, fullExp);\n      var lookupJs = (index\n                      // we simply dereference 's' on any .dot notation\n                      ? 's'\n                      // but if we are first then we check locals first, and if so read it first\n                      : '((l&&l.hasOwnProperty(\"' + key + '\"))?l:s)') + '.' + key;\n      if (expensiveChecks || isPossiblyDangerousMemberName(key)) {\n        lookupJs = 'eso(' + lookupJs + ', fe)';\n        needsEnsureSafeObject = true;\n      }\n      code += 'if(s == null) return undefined;\\n' +\n              's=' + lookupJs + ';\\n';\n    });\n    code += 'return s;';\n\n    /* jshint -W054 */\n    var evaledFnGetter = new Function('s', 'l', 'eso', 'fe', code); // s=scope, l=locals, eso=ensureSafeObject\n    /* jshint +W054 */\n    evaledFnGetter.toString = valueFn(code);\n    if (needsEnsureSafeObject) {\n      evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter, fullExp);\n    }\n    fn = evaledFnGetter;\n  }\n\n  fn.sharedGetter = true;\n  fn.assign = function(self, value, locals) {\n    return setter(self, locals, path, value, path);\n  };\n  getterFnCache[path] = fn;\n  return fn;\n}\n\nvar objectValueOf = Object.prototype.valueOf;\n\nfunction getValueOf(value) {\n  return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n *   var getter = $parse('user.name');\n *   var setter = getter.assign;\n *   var context = {user:{name:'angular'}};\n *   var locals = {user:{name:'local'}};\n *\n *   expect(getter(context)).toEqual('angular');\n *   setter(context, 'newValue');\n *   expect(context.user.name).toEqual('newValue');\n *   expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n *      are evaluated against (typically a scope object).\n *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n *      `context`.\n *\n *    The returned function also has the following properties:\n *      * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n *        literal.\n *      * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n *        constant literals.\n *      * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n *        set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n *  service.\n */\nfunction $ParseProvider() {\n  var cacheDefault = createMap();\n  var cacheExpensive = createMap();\n\n\n\n  this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {\n    var $parseOptions = {\n          csp: $sniffer.csp,\n          expensiveChecks: false\n        },\n        $parseOptionsExpensive = {\n          csp: $sniffer.csp,\n          expensiveChecks: true\n        };\n\n    function wrapSharedExpression(exp) {\n      var wrapped = exp;\n\n      if (exp.sharedGetter) {\n        wrapped = function $parseWrapper(self, locals) {\n          return exp(self, locals);\n        };\n        wrapped.literal = exp.literal;\n        wrapped.constant = exp.constant;\n        wrapped.assign = exp.assign;\n      }\n\n      return wrapped;\n    }\n\n    return function $parse(exp, interceptorFn, expensiveChecks) {\n      var parsedExpression, oneTime, cacheKey;\n\n      switch (typeof exp) {\n        case 'string':\n          cacheKey = exp = exp.trim();\n\n          var cache = (expensiveChecks ? cacheExpensive : cacheDefault);\n          parsedExpression = cache[cacheKey];\n\n          if (!parsedExpression) {\n            if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n              oneTime = true;\n              exp = exp.substring(2);\n            }\n\n            var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;\n            var lexer = new Lexer(parseOptions);\n            var parser = new Parser(lexer, $filter, parseOptions);\n            parsedExpression = parser.parse(exp);\n\n            if (parsedExpression.constant) {\n              parsedExpression.$$watchDelegate = constantWatchDelegate;\n            } else if (oneTime) {\n              //oneTime is not part of the exp passed to the Parser so we may have to\n              //wrap the parsedExpression before adding a $$watchDelegate\n              parsedExpression = wrapSharedExpression(parsedExpression);\n              parsedExpression.$$watchDelegate = parsedExpression.literal ?\n                oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;\n            } else if (parsedExpression.inputs) {\n              parsedExpression.$$watchDelegate = inputsWatchDelegate;\n            }\n\n            cache[cacheKey] = parsedExpression;\n          }\n          return addInterceptor(parsedExpression, interceptorFn);\n\n        case 'function':\n          return addInterceptor(exp, interceptorFn);\n\n        default:\n          return addInterceptor(noop, interceptorFn);\n      }\n    };\n\n    function collectExpressionInputs(inputs, list) {\n      for (var i = 0, ii = inputs.length; i < ii; i++) {\n        var input = inputs[i];\n        if (!input.constant) {\n          if (input.inputs) {\n            collectExpressionInputs(input.inputs, list);\n          } else if (list.indexOf(input) === -1) { // TODO(perf) can we do better?\n            list.push(input);\n          }\n        }\n      }\n\n      return list;\n    }\n\n    function expressionInputDirtyCheck(newValue, oldValueOfValue) {\n\n      if (newValue == null || oldValueOfValue == null) { // null/undefined\n        return newValue === oldValueOfValue;\n      }\n\n      if (typeof newValue === 'object') {\n\n        // attempt to convert the value to a primitive type\n        // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n        //             be cheaply dirty-checked\n        newValue = getValueOf(newValue);\n\n        if (typeof newValue === 'object') {\n          // objects/arrays are not supported - deep-watching them would be too expensive\n          return false;\n        }\n\n        // fall-through to the primitive equality check\n      }\n\n      //Primitive or NaN\n      return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n    }\n\n    function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var inputExpressions = parsedExpression.$$inputs ||\n                    (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, []));\n\n      var lastResult;\n\n      if (inputExpressions.length === 1) {\n        var oldInputValue = expressionInputDirtyCheck; // init to something unique so that equals check fails\n        inputExpressions = inputExpressions[0];\n        return scope.$watch(function expressionInputWatch(scope) {\n          var newInputValue = inputExpressions(scope);\n          if (!expressionInputDirtyCheck(newInputValue, oldInputValue)) {\n            lastResult = parsedExpression(scope);\n            oldInputValue = newInputValue && getValueOf(newInputValue);\n          }\n          return lastResult;\n        }, listener, objectEquality);\n      }\n\n      var oldInputValueOfValues = [];\n      for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n        oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n      }\n\n      return scope.$watch(function expressionInputsWatch(scope) {\n        var changed = false;\n\n        for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n          var newInputValue = inputExpressions[i](scope);\n          if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {\n            oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n          }\n        }\n\n        if (changed) {\n          lastResult = parsedExpression(scope);\n        }\n\n        return lastResult;\n      }, listener, objectEquality);\n    }\n\n    function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch, lastValue;\n      return unwatch = scope.$watch(function oneTimeWatch(scope) {\n        return parsedExpression(scope);\n      }, function oneTimeListener(value, old, scope) {\n        lastValue = value;\n        if (isFunction(listener)) {\n          listener.apply(this, arguments);\n        }\n        if (isDefined(value)) {\n          scope.$$postDigest(function() {\n            if (isDefined(lastValue)) {\n              unwatch();\n            }\n          });\n        }\n      }, objectEquality);\n    }\n\n    function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch, lastValue;\n      return unwatch = scope.$watch(function oneTimeWatch(scope) {\n        return parsedExpression(scope);\n      }, function oneTimeListener(value, old, scope) {\n        lastValue = value;\n        if (isFunction(listener)) {\n          listener.call(this, value, old, scope);\n        }\n        if (isAllDefined(value)) {\n          scope.$$postDigest(function() {\n            if (isAllDefined(lastValue)) unwatch();\n          });\n        }\n      }, objectEquality);\n\n      function isAllDefined(value) {\n        var allDefined = true;\n        forEach(value, function(val) {\n          if (!isDefined(val)) allDefined = false;\n        });\n        return allDefined;\n      }\n    }\n\n    function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n      var unwatch;\n      return unwatch = scope.$watch(function constantWatch(scope) {\n        return parsedExpression(scope);\n      }, function constantListener(value, old, scope) {\n        if (isFunction(listener)) {\n          listener.apply(this, arguments);\n        }\n        unwatch();\n      }, objectEquality);\n    }\n\n    function addInterceptor(parsedExpression, interceptorFn) {\n      if (!interceptorFn) return parsedExpression;\n      var watchDelegate = parsedExpression.$$watchDelegate;\n\n      var regularWatch =\n          watchDelegate !== oneTimeLiteralWatchDelegate &&\n          watchDelegate !== oneTimeWatchDelegate;\n\n      var fn = regularWatch ? function regularInterceptedExpression(scope, locals) {\n        var value = parsedExpression(scope, locals);\n        return interceptorFn(value, scope, locals);\n      } : function oneTimeInterceptedExpression(scope, locals) {\n        var value = parsedExpression(scope, locals);\n        var result = interceptorFn(value, scope, locals);\n        // we only return the interceptor's result if the\n        // initial value is defined (for bind-once)\n        return isDefined(value) ? result : value;\n      };\n\n      // Propagate $$watchDelegates other then inputsWatchDelegate\n      if (parsedExpression.$$watchDelegate &&\n          parsedExpression.$$watchDelegate !== inputsWatchDelegate) {\n        fn.$$watchDelegate = parsedExpression.$$watchDelegate;\n      } else if (!interceptorFn.$stateful) {\n        // If there is an interceptor, but no watchDelegate then treat the interceptor like\n        // we treat filters - it is assumed to be a pure function unless flagged with $stateful\n        fn.$$watchDelegate = inputsWatchDelegate;\n        fn.inputs = [parsedExpression];\n      }\n\n      return fn;\n    }\n  }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is an implementation of promises/deferred objects inspired by\n * [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 promises to some degree.\n *\n * # $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n *   // are available in the current lexical scope (they could have been injected or passed in).\n *\n *   function asyncGreet(name) {\n *     // perform some asynchronous operation, resolve or reject the promise when appropriate.\n *     return $q(function(resolve, reject) {\n *       setTimeout(function() {\n *         if (okToGreet(name)) {\n *           resolve('Hello, ' + name + '!');\n *         } else {\n *           reject('Greeting ' + name + ' is not allowed.');\n *         }\n *       }, 1000);\n *     });\n *   }\n *\n *   var promise = asyncGreet('Robin Hood');\n *   promise.then(function(greeting) {\n *     alert('Success: ' + greeting);\n *   }, function(reason) {\n *     alert('Failed: ' + reason);\n *   });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n *   // are available in the current lexical scope (they could have been injected or passed in).\n *\n *   function asyncGreet(name) {\n *     var deferred = $q.defer();\n *\n *     setTimeout(function() {\n *       deferred.notify('About to greet ' + name + '.');\n *\n *       if (okToGreet(name)) {\n *         deferred.resolve('Hello, ' + name + '!');\n *       } else {\n *         deferred.reject('Greeting ' + name + ' is not allowed.');\n *       }\n *     }, 1000);\n *\n *     return deferred.promise;\n *   }\n *\n *   var promise = asyncGreet('Robin Hood');\n *   promise.then(function(greeting) {\n *     alert('Success: ' + greeting);\n *   }, function(reason) {\n *     alert('Failed: ' + reason);\n *   }, function(update) {\n *     alert('Got notification: ' + update);\n *   });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * # The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n *   constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n *   resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n *   multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * # The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or\n *   will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n *   as soon as the result is available. The callbacks are called with a single argument: the result\n *   or rejection reason. Additionally, the notify callback may be called zero or more times to\n *   provide a progress indication, before the promise is resolved or rejected.\n *\n *   This method *returns a new promise* which is resolved or rejected via the return value of the\n *   `successCallback`, `errorCallback`. It also notifies via the return value of the\n *   `notifyCallback` method. The promise cannot be resolved or rejected from the notifyCallback\n *   method.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n *   but to do so without modifying the final value. This is useful to release resources or do some\n *   clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n *   specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n *   more information.\n *\n * # Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n *   promiseB = promiseA.then(function(result) {\n *     return result + 1;\n *   });\n *\n *   // promiseB will be resolved immediately after promiseA is resolved and its value\n *   // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * # Differences between Kris Kowal's Q and $q\n *\n *  There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n *   mechanism in angular, which means faster propagation of resolution or rejection into your\n *   models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n *   all the important functionality needed for common async tasks.\n *\n *  # Testing\n *\n *  ```js\n *    it('should simulate promise', inject(function($q, $rootScope) {\n *      var deferred = $q.defer();\n *      var promise = deferred.promise;\n *      var resolvedValue;\n *\n *      promise.then(function(value) { resolvedValue = value; });\n *      expect(resolvedValue).toBeUndefined();\n *\n *      // Simulate resolving of promise\n *      deferred.resolve(123);\n *      // Note that the 'then' function does not get called synchronously.\n *      // This is because we want the promise API to always be async, whether or not\n *      // it got called synchronously or asynchronously.\n *      expect(resolvedValue).toBeUndefined();\n *\n *      // Propagate promise resolution to 'then' functions using $apply().\n *      $rootScope.$apply();\n *      expect(resolvedValue).toEqual(123);\n *    }));\n *  ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n *   rejecting the newly created promise. The first parameter is a function which resolves the\n *   promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\nfunction $QProvider() {\n\n  this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n    return qFactory(function(callback) {\n      $rootScope.$evalAsync(callback);\n    }, $exceptionHandler);\n  }];\n}\n\nfunction $$QProvider() {\n  this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n    return qFactory(function(callback) {\n      $browser.defer(callback);\n    }, $exceptionHandler);\n  }];\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n *     debugging purposes.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler) {\n  var $qMinErr = minErr('$q', TypeError);\n  function callOnce(self, resolveFn, rejectFn) {\n    var called = false;\n    function wrap(fn) {\n      return function(value) {\n        if (called) return;\n        called = true;\n        fn.call(self, value);\n      };\n    }\n\n    return [wrap(resolveFn), wrap(rejectFn)];\n  }\n\n  /**\n   * @ngdoc method\n   * @name ng.$q#defer\n   * @kind function\n   *\n   * @description\n   * Creates a `Deferred` object which represents a task which will finish in the future.\n   *\n   * @returns {Deferred} Returns a new instance of deferred.\n   */\n  var defer = function() {\n    return new Deferred();\n  };\n\n  function Promise() {\n    this.$$state = { status: 0 };\n  }\n\n  Promise.prototype = {\n    then: function(onFulfilled, onRejected, progressBack) {\n      var result = new Deferred();\n\n      this.$$state.pending = this.$$state.pending || [];\n      this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n      if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n      return result.promise;\n    },\n\n    \"catch\": function(callback) {\n      return this.then(null, callback);\n    },\n\n    \"finally\": function(callback, progressBack) {\n      return this.then(function(value) {\n        return handleCallback(value, true, callback);\n      }, function(error) {\n        return handleCallback(error, false, callback);\n      }, progressBack);\n    }\n  };\n\n  //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native\n  function simpleBind(context, fn) {\n    return function(value) {\n      fn.call(context, value);\n    };\n  }\n\n  function processQueue(state) {\n    var fn, promise, pending;\n\n    pending = state.pending;\n    state.processScheduled = false;\n    state.pending = undefined;\n    for (var i = 0, ii = pending.length; i < ii; ++i) {\n      promise = pending[i][0];\n      fn = pending[i][state.status];\n      try {\n        if (isFunction(fn)) {\n          promise.resolve(fn(state.value));\n        } else if (state.status === 1) {\n          promise.resolve(state.value);\n        } else {\n          promise.reject(state.value);\n        }\n      } catch (e) {\n        promise.reject(e);\n        exceptionHandler(e);\n      }\n    }\n  }\n\n  function scheduleProcessQueue(state) {\n    if (state.processScheduled || !state.pending) return;\n    state.processScheduled = true;\n    nextTick(function() { processQueue(state); });\n  }\n\n  function Deferred() {\n    this.promise = new Promise();\n    //Necessary to support unbound execution :/\n    this.resolve = simpleBind(this, this.resolve);\n    this.reject = simpleBind(this, this.reject);\n    this.notify = simpleBind(this, this.notify);\n  }\n\n  Deferred.prototype = {\n    resolve: function(val) {\n      if (this.promise.$$state.status) return;\n      if (val === this.promise) {\n        this.$$reject($qMinErr(\n          'qcycle',\n          \"Expected promise to be resolved with value other than itself '{0}'\",\n          val));\n      } else {\n        this.$$resolve(val);\n      }\n\n    },\n\n    $$resolve: function(val) {\n      var then, fns;\n\n      fns = callOnce(this, this.$$resolve, this.$$reject);\n      try {\n        if ((isObject(val) || isFunction(val))) then = val && val.then;\n        if (isFunction(then)) {\n          this.promise.$$state.status = -1;\n          then.call(val, fns[0], fns[1], this.notify);\n        } else {\n          this.promise.$$state.value = val;\n          this.promise.$$state.status = 1;\n          scheduleProcessQueue(this.promise.$$state);\n        }\n      } catch (e) {\n        fns[1](e);\n        exceptionHandler(e);\n      }\n    },\n\n    reject: function(reason) {\n      if (this.promise.$$state.status) return;\n      this.$$reject(reason);\n    },\n\n    $$reject: function(reason) {\n      this.promise.$$state.value = reason;\n      this.promise.$$state.status = 2;\n      scheduleProcessQueue(this.promise.$$state);\n    },\n\n    notify: function(progress) {\n      var callbacks = this.promise.$$state.pending;\n\n      if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {\n        nextTick(function() {\n          var callback, result;\n          for (var i = 0, ii = callbacks.length; i < ii; i++) {\n            result = callbacks[i][0];\n            callback = callbacks[i][3];\n            try {\n              result.notify(isFunction(callback) ? callback(progress) : progress);\n            } catch (e) {\n              exceptionHandler(e);\n            }\n          }\n        });\n      }\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#reject\n   * @kind function\n   *\n   * @description\n   * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n   * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n   * a promise chain, you don't need to worry about it.\n   *\n   * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n   * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n   * a promise error callback and you want to forward the error to the promise derived from the\n   * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n   * `reject`.\n   *\n   * ```js\n   *   promiseB = promiseA.then(function(result) {\n   *     // success: do something and resolve promiseB\n   *     //          with the old or a new result\n   *     return result;\n   *   }, function(reason) {\n   *     // error: handle the error if possible and\n   *     //        resolve promiseB with newPromiseOrValue,\n   *     //        otherwise forward the rejection to promiseB\n   *     if (canHandle(reason)) {\n   *      // handle the error and recover\n   *      return newPromiseOrValue;\n   *     }\n   *     return $q.reject(reason);\n   *   });\n   * ```\n   *\n   * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n   * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n   */\n  var reject = function(reason) {\n    var result = new Deferred();\n    result.reject(reason);\n    return result.promise;\n  };\n\n  var makePromise = function makePromise(value, resolved) {\n    var result = new Deferred();\n    if (resolved) {\n      result.resolve(value);\n    } else {\n      result.reject(value);\n    }\n    return result.promise;\n  };\n\n  var handleCallback = function handleCallback(value, isResolved, callback) {\n    var callbackOutput = null;\n    try {\n      if (isFunction(callback)) callbackOutput = callback();\n    } catch (e) {\n      return makePromise(e, false);\n    }\n    if (isPromiseLike(callbackOutput)) {\n      return callbackOutput.then(function() {\n        return makePromise(value, isResolved);\n      }, function(error) {\n        return makePromise(error, false);\n      });\n    } else {\n      return makePromise(value, isResolved);\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#when\n   * @kind function\n   *\n   * @description\n   * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n   * This is useful when you are dealing with an object that might or might not be a promise, or if\n   * the promise comes from a source that can't be trusted.\n   *\n   * @param {*} value Value or a promise\n   * @returns {Promise} Returns a promise of the passed value or promise\n   */\n\n\n  var when = function(value, callback, errback, progressBack) {\n    var result = new Deferred();\n    result.resolve(value);\n    return result.promise.then(callback, errback, progressBack);\n  };\n\n  /**\n   * @ngdoc method\n   * @name $q#all\n   * @kind function\n   *\n   * @description\n   * Combines multiple promises into a single promise that is resolved when all of the input\n   * promises are resolved.\n   *\n   * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.\n   * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n   *   each value corresponding to the promise at the same index/key in the `promises` array/hash.\n   *   If any of the promises is resolved with a rejection, this resulting promise will be rejected\n   *   with the same rejection value.\n   */\n\n  function all(promises) {\n    var deferred = new Deferred(),\n        counter = 0,\n        results = isArray(promises) ? [] : {};\n\n    forEach(promises, function(promise, key) {\n      counter++;\n      when(promise).then(function(value) {\n        if (results.hasOwnProperty(key)) return;\n        results[key] = value;\n        if (!(--counter)) deferred.resolve(results);\n      }, function(reason) {\n        if (results.hasOwnProperty(key)) return;\n        deferred.reject(reason);\n      });\n    });\n\n    if (counter === 0) {\n      deferred.resolve(results);\n    }\n\n    return deferred.promise;\n  }\n\n  var $Q = function Q(resolver) {\n    if (!isFunction(resolver)) {\n      throw $qMinErr('norslvr', \"Expected resolverFn, got '{0}'\", resolver);\n    }\n\n    if (!(this instanceof Q)) {\n      // More useful when $Q is the Promise itself.\n      return new Q(resolver);\n    }\n\n    var deferred = new Deferred();\n\n    function resolveFn(value) {\n      deferred.resolve(value);\n    }\n\n    function rejectFn(reason) {\n      deferred.reject(reason);\n    }\n\n    resolver(resolveFn, rejectFn);\n\n    return deferred.promise;\n  };\n\n  $Q.defer = defer;\n  $Q.reject = reject;\n  $Q.when = when;\n  $Q.all = all;\n\n  return $Q;\n}\n\nfunction $$RAFProvider() { //rAF\n  this.$get = ['$window', '$timeout', function($window, $timeout) {\n    var requestAnimationFrame = $window.requestAnimationFrame ||\n                                $window.webkitRequestAnimationFrame;\n\n    var cancelAnimationFrame = $window.cancelAnimationFrame ||\n                               $window.webkitCancelAnimationFrame ||\n                               $window.webkitCancelRequestAnimationFrame;\n\n    var rafSupported = !!requestAnimationFrame;\n    var raf = rafSupported\n      ? function(fn) {\n          var id = requestAnimationFrame(fn);\n          return function() {\n            cancelAnimationFrame(id);\n          };\n        }\n      : function(fn) {\n          var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n          return function() {\n            $timeout.cancel(timer);\n          };\n        };\n\n    raf.supported = rafSupported;\n\n    return raf;\n  }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n *   - No closures, instead use prototypical inheritance for API\n *   - Internal state needs to be stored on scope directly, which means that private state is\n *     exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n *   - this means that in order to keep the same order of execution as addition we have to add\n *     items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n *   - Using an array would be slow since inserts in middle are expensive so we use linked list\n *\n * There are few watches then a lot of observers. This is why you don't want the observer to be\n * implemented in the same way as watch. Watch requires return of initialization function which\n * are expensive to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide an event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n  var TTL = 10;\n  var $rootScopeMinErr = minErr('$rootScope');\n  var lastDirtyWatch = null;\n  var applyAsyncId = null;\n\n  this.digestTtl = function(value) {\n    if (arguments.length) {\n      TTL = value;\n    }\n    return TTL;\n  };\n\n  this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',\n      function($injector, $exceptionHandler, $parse, $browser) {\n\n    /**\n     * @ngdoc type\n     * @name $rootScope.Scope\n     *\n     * @description\n     * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n     * {@link auto.$injector $injector}. Child scopes are created using the\n     * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n     * compiled HTML template is executed.)\n     *\n     * Here is a simple scope snippet to show how you can interact with the scope.\n     * ```html\n     * <file src=\"./test/ng/rootScopeSpec.js\" tag=\"docs1\" />\n     * ```\n     *\n     * # Inheritance\n     * A scope can inherit from a parent scope, as in this example:\n     * ```js\n         var parent = $rootScope;\n         var child = parent.$new();\n\n         parent.salutation = \"Hello\";\n         expect(child.salutation).toEqual('Hello');\n\n         child.salutation = \"Welcome\";\n         expect(child.salutation).toEqual('Welcome');\n         expect(parent.salutation).toEqual('Hello');\n     * ```\n     *\n     * When interacting with `Scope` in tests, additional helper methods are available on the\n     * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n     * details.\n     *\n     *\n     * @param {Object.<string, function()>=} providers Map of service factory which need to be\n     *                                       provided for the current scope. Defaults to {@link ng}.\n     * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should\n     *                              append/override services provided by `providers`. This is handy\n     *                              when unit-testing and having the need to override a default\n     *                              service.\n     * @returns {Object} Newly created scope.\n     *\n     */\n    function Scope() {\n      this.$id = nextUid();\n      this.$$phase = this.$parent = this.$$watchers =\n                     this.$$nextSibling = this.$$prevSibling =\n                     this.$$childHead = this.$$childTail = null;\n      this.$root = this;\n      this.$$destroyed = false;\n      this.$$listeners = {};\n      this.$$listenerCount = {};\n      this.$$isolateBindings = null;\n    }\n\n    /**\n     * @ngdoc property\n     * @name $rootScope.Scope#$id\n     *\n     * @description\n     * Unique scope ID (monotonically increasing) useful for debugging.\n     */\n\n     /**\n      * @ngdoc property\n      * @name $rootScope.Scope#$parent\n      *\n      * @description\n      * Reference to the parent scope.\n      */\n\n      /**\n       * @ngdoc property\n       * @name $rootScope.Scope#$root\n       *\n       * @description\n       * Reference to the root scope.\n       */\n\n    Scope.prototype = {\n      constructor: Scope,\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$new\n       * @kind function\n       *\n       * @description\n       * Creates a new child {@link ng.$rootScope.Scope scope}.\n       *\n       * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n       * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n       *\n       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n       * desired for the scope and its child scopes to be permanently detached from the parent and\n       * thus stop participating in model change detection and listener notification by invoking.\n       *\n       * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n       *         parent scope. The scope is isolated, as it can not see parent scope properties.\n       *         When creating widgets, it is useful for the widget to not accidentally read parent\n       *         state.\n       *\n       * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n       *                              of the newly created scope. Defaults to `this` scope if not provided.\n       *                              This is used when creating a transclude scope to correctly place it\n       *                              in the scope hierarchy while maintaining the correct prototypical\n       *                              inheritance.\n       *\n       * @returns {Object} The newly created child scope.\n       *\n       */\n      $new: function(isolate, parent) {\n        var child;\n\n        parent = parent || this;\n\n        if (isolate) {\n          child = new Scope();\n          child.$root = this.$root;\n        } else {\n          // Only create a child scope class if somebody asks for one,\n          // but cache it to allow the VM to optimize lookups.\n          if (!this.$$ChildScope) {\n            this.$$ChildScope = function ChildScope() {\n              this.$$watchers = this.$$nextSibling =\n                  this.$$childHead = this.$$childTail = null;\n              this.$$listeners = {};\n              this.$$listenerCount = {};\n              this.$id = nextUid();\n              this.$$ChildScope = null;\n            };\n            this.$$ChildScope.prototype = this;\n          }\n          child = new this.$$ChildScope();\n        }\n        child.$parent = parent;\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        // When the new scope is not isolated or we inherit from `this`, and\n        // the parent scope is destroyed, the property `$$destroyed` is inherited\n        // prototypically. In all other cases, this property needs to be set\n        // when the parent scope is destroyed.\n        // The listener needs to be added after the parent is set\n        if (isolate || parent != this) child.$on('$destroy', destroyChild);\n\n        return child;\n\n        function destroyChild() {\n          child.$$destroyed = true;\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watch\n       * @kind function\n       *\n       * @description\n       * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n       *\n       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n       *   $digest()} and should return the value that will be watched. (Since\n       *   {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the\n       *   `watchExpression` can execute multiple times per\n       *   {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)\n       * - The `listener` is called only when the value from the current `watchExpression` and the\n       *   previous call to `watchExpression` are not equal (with the exception of the initial run,\n       *   see below). Inequality is determined according to reference inequality,\n       *   [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n       *    via the `!==` Javascript operator, unless `objectEquality == true`\n       *   (see next point)\n       * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n       *   according to the {@link angular.equals} function. To save the value of the object for\n       *   later comparison, the {@link angular.copy} function is used. This therefore means that\n       *   watching complex objects will have adverse memory and performance implications.\n       * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n       *   This is achieved by rerunning the watchers until no changes are detected. The rerun\n       *   iteration limit is 10 to prevent an infinite loop deadlock.\n       *\n       *\n       * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n       * you can register a `watchExpression` function with no `listener`. (Since `watchExpression`\n       * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a\n       * change is detected, be prepared for multiple calls to your listener.)\n       *\n       * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n       * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n       * watcher. In rare cases, this is undesirable because the listener is called when the result\n       * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n       * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n       * listener was called due to initialization.\n       *\n       *\n       *\n       * # Example\n       * ```js\n           // let's assume that scope was dependency injected as the $rootScope\n           var scope = $rootScope;\n           scope.name = 'misko';\n           scope.counter = 0;\n\n           expect(scope.counter).toEqual(0);\n           scope.$watch('name', function(newValue, oldValue) {\n             scope.counter = scope.counter + 1;\n           });\n           expect(scope.counter).toEqual(0);\n\n           scope.$digest();\n           // the listener is always called during the first $digest loop after it was registered\n           expect(scope.counter).toEqual(1);\n\n           scope.$digest();\n           // but now it will not be called unless the value changes\n           expect(scope.counter).toEqual(1);\n\n           scope.name = 'adam';\n           scope.$digest();\n           expect(scope.counter).toEqual(2);\n\n\n\n           // Using a function as a watchExpression\n           var food;\n           scope.foodCounter = 0;\n           expect(scope.foodCounter).toEqual(0);\n           scope.$watch(\n             // This function returns the value being watched. It is called for each turn of the $digest loop\n             function() { return food; },\n             // This is the change listener, called when the value returned from the above function changes\n             function(newValue, oldValue) {\n               if ( newValue !== oldValue ) {\n                 // Only increment the counter if the value changed\n                 scope.foodCounter = scope.foodCounter + 1;\n               }\n             }\n           );\n           // No digest has been run so the counter will be zero\n           expect(scope.foodCounter).toEqual(0);\n\n           // Run the digest but since food has not changed count will still be zero\n           scope.$digest();\n           expect(scope.foodCounter).toEqual(0);\n\n           // Update food and run digest.  Now the counter will increment\n           food = 'cheeseburger';\n           scope.$digest();\n           expect(scope.foodCounter).toEqual(1);\n\n       * ```\n       *\n       *\n       *\n       * @param {(function()|string)} watchExpression Expression that is evaluated on each\n       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n       *    a call to the `listener`.\n       *\n       *    - `string`: Evaluated as {@link guide/expression expression}\n       *    - `function(scope)`: called with current `scope` as a parameter.\n       * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n       *    of `watchExpression` changes.\n       *\n       *    - `newVal` contains the current value of the `watchExpression`\n       *    - `oldVal` contains the previous value of the `watchExpression`\n       *    - `scope` refers to the current scope\n       * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of\n       *     comparing for reference equality.\n       * @returns {function()} Returns a deregistration function for this listener.\n       */\n      $watch: function(watchExp, listener, objectEquality) {\n        var get = $parse(watchExp);\n\n        if (get.$$watchDelegate) {\n          return get.$$watchDelegate(this, listener, objectEquality, get);\n        }\n        var scope = this,\n            array = scope.$$watchers,\n            watcher = {\n              fn: listener,\n              last: initWatchVal,\n              get: get,\n              exp: watchExp,\n              eq: !!objectEquality\n            };\n\n        lastDirtyWatch = null;\n\n        if (!isFunction(listener)) {\n          watcher.fn = noop;\n        }\n\n        if (!array) {\n          array = scope.$$watchers = [];\n        }\n        // we use unshift since we use a while loop in $digest for speed.\n        // the while loop reads in reverse order.\n        array.unshift(watcher);\n\n        return function deregisterWatch() {\n          arrayRemove(array, watcher);\n          lastDirtyWatch = null;\n        };\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watchGroup\n       * @kind function\n       *\n       * @description\n       * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n       * If any one expression in the collection changes the `listener` is executed.\n       *\n       * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every\n       *   call to $digest() to see if any items changes.\n       * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n       *\n       * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually\n       * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n       *\n       * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n       *    expression in `watchExpressions` changes\n       *    The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n       *    those of `watchExpression`\n       *    and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n       *    those of `watchExpression`\n       *    The `scope` refers to the current scope.\n       * @returns {function()} Returns a de-registration function for all listeners.\n       */\n      $watchGroup: function(watchExpressions, listener) {\n        var oldValues = new Array(watchExpressions.length);\n        var newValues = new Array(watchExpressions.length);\n        var deregisterFns = [];\n        var self = this;\n        var changeReactionScheduled = false;\n        var firstRun = true;\n\n        if (!watchExpressions.length) {\n          // No expressions means we call the listener ASAP\n          var shouldCall = true;\n          self.$evalAsync(function() {\n            if (shouldCall) listener(newValues, newValues, self);\n          });\n          return function deregisterWatchGroup() {\n            shouldCall = false;\n          };\n        }\n\n        if (watchExpressions.length === 1) {\n          // Special case size of one\n          return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n            newValues[0] = value;\n            oldValues[0] = oldValue;\n            listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n          });\n        }\n\n        forEach(watchExpressions, function(expr, i) {\n          var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {\n            newValues[i] = value;\n            oldValues[i] = oldValue;\n            if (!changeReactionScheduled) {\n              changeReactionScheduled = true;\n              self.$evalAsync(watchGroupAction);\n            }\n          });\n          deregisterFns.push(unwatchFn);\n        });\n\n        function watchGroupAction() {\n          changeReactionScheduled = false;\n\n          if (firstRun) {\n            firstRun = false;\n            listener(newValues, newValues, self);\n          } else {\n            listener(newValues, oldValues, self);\n          }\n        }\n\n        return function deregisterWatchGroup() {\n          while (deregisterFns.length) {\n            deregisterFns.shift()();\n          }\n        };\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$watchCollection\n       * @kind function\n       *\n       * @description\n       * Shallow watches the properties of an object and fires whenever any of the properties change\n       * (for arrays, this implies watching the array items; for object maps, this implies watching\n       * the properties). If a change is detected, the `listener` callback is fired.\n       *\n       * - The `obj` collection is observed via standard $watch operation and is examined on every\n       *   call to $digest() to see if any items have been added, removed, or moved.\n       * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n       *   adding, removing, and moving items belonging to an object or array.\n       *\n       *\n       * # Example\n       * ```js\n          $scope.names = ['igor', 'matias', 'misko', 'james'];\n          $scope.dataCount = 4;\n\n          $scope.$watchCollection('names', function(newNames, oldNames) {\n            $scope.dataCount = newNames.length;\n          });\n\n          expect($scope.dataCount).toEqual(4);\n          $scope.$digest();\n\n          //still at 4 ... no changes\n          expect($scope.dataCount).toEqual(4);\n\n          $scope.names.pop();\n          $scope.$digest();\n\n          //now there's been a change\n          expect($scope.dataCount).toEqual(3);\n       * ```\n       *\n       *\n       * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n       *    expression value should evaluate to an object or an array which is observed on each\n       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n       *    collection will trigger a call to the `listener`.\n       *\n       * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n       *    when a change is detected.\n       *    - The `newCollection` object is the newly modified data obtained from the `obj` expression\n       *    - The `oldCollection` object is a copy of the former collection data.\n       *      Due to performance considerations, the`oldCollection` value is computed only if the\n       *      `listener` function declares two or more arguments.\n       *    - The `scope` argument refers to the current scope.\n       *\n       * @returns {function()} Returns a de-registration function for this listener. When the\n       *    de-registration function is executed, the internal watch operation is terminated.\n       */\n      $watchCollection: function(obj, listener) {\n        $watchCollectionInterceptor.$stateful = true;\n\n        var self = this;\n        // the current value, updated on each dirty-check run\n        var newValue;\n        // a shallow copy of the newValue from the last dirty-check run,\n        // updated to match newValue during dirty-check run\n        var oldValue;\n        // a shallow copy of the newValue from when the last change happened\n        var veryOldValue;\n        // only track veryOldValue if the listener is asking for it\n        var trackVeryOldValue = (listener.length > 1);\n        var changeDetected = 0;\n        var changeDetector = $parse(obj, $watchCollectionInterceptor);\n        var internalArray = [];\n        var internalObject = {};\n        var initRun = true;\n        var oldLength = 0;\n\n        function $watchCollectionInterceptor(_value) {\n          newValue = _value;\n          var newLength, key, bothNaN, newItem, oldItem;\n\n          // If the new value is undefined, then return undefined as the watch may be a one-time watch\n          if (isUndefined(newValue)) return;\n\n          if (!isObject(newValue)) { // if primitive\n            if (oldValue !== newValue) {\n              oldValue = newValue;\n              changeDetected++;\n            }\n          } else if (isArrayLike(newValue)) {\n            if (oldValue !== internalArray) {\n              // we are transitioning from something which was not an array into array.\n              oldValue = internalArray;\n              oldLength = oldValue.length = 0;\n              changeDetected++;\n            }\n\n            newLength = newValue.length;\n\n            if (oldLength !== newLength) {\n              // if lengths do not match we need to trigger change notification\n              changeDetected++;\n              oldValue.length = oldLength = newLength;\n            }\n            // copy the items to oldValue and look for changes.\n            for (var i = 0; i < newLength; i++) {\n              oldItem = oldValue[i];\n              newItem = newValue[i];\n\n              bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n              if (!bothNaN && (oldItem !== newItem)) {\n                changeDetected++;\n                oldValue[i] = newItem;\n              }\n            }\n          } else {\n            if (oldValue !== internalObject) {\n              // we are transitioning from something which was not an object into object.\n              oldValue = internalObject = {};\n              oldLength = 0;\n              changeDetected++;\n            }\n            // copy the items to oldValue and look for changes.\n            newLength = 0;\n            for (key in newValue) {\n              if (newValue.hasOwnProperty(key)) {\n                newLength++;\n                newItem = newValue[key];\n                oldItem = oldValue[key];\n\n                if (key in oldValue) {\n                  bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n                  if (!bothNaN && (oldItem !== newItem)) {\n                    changeDetected++;\n                    oldValue[key] = newItem;\n                  }\n                } else {\n                  oldLength++;\n                  oldValue[key] = newItem;\n                  changeDetected++;\n                }\n              }\n            }\n            if (oldLength > newLength) {\n              // we used to have more keys, need to find them and destroy them.\n              changeDetected++;\n              for (key in oldValue) {\n                if (!newValue.hasOwnProperty(key)) {\n                  oldLength--;\n                  delete oldValue[key];\n                }\n              }\n            }\n          }\n          return changeDetected;\n        }\n\n        function $watchCollectionAction() {\n          if (initRun) {\n            initRun = false;\n            listener(newValue, newValue, self);\n          } else {\n            listener(newValue, veryOldValue, self);\n          }\n\n          // make a copy for the next time a collection is changed\n          if (trackVeryOldValue) {\n            if (!isObject(newValue)) {\n              //primitive\n              veryOldValue = newValue;\n            } else if (isArrayLike(newValue)) {\n              veryOldValue = new Array(newValue.length);\n              for (var i = 0; i < newValue.length; i++) {\n                veryOldValue[i] = newValue[i];\n              }\n            } else { // if object\n              veryOldValue = {};\n              for (var key in newValue) {\n                if (hasOwnProperty.call(newValue, key)) {\n                  veryOldValue[key] = newValue[key];\n                }\n              }\n            }\n          }\n        }\n\n        return this.$watch(changeDetector, $watchCollectionAction);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$digest\n       * @kind function\n       *\n       * @description\n       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n       * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n       * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n       * until no more listeners are firing. This means that it is possible to get into an infinite\n       * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n       * iterations exceeds 10.\n       *\n       * Usually, you don't call `$digest()` directly in\n       * {@link ng.directive:ngController controllers} or in\n       * {@link ng.$compileProvider#directive directives}.\n       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n       * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n       *\n       * If you want to be notified whenever `$digest()` is called,\n       * you can register a `watchExpression` function with\n       * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n       *\n       * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n       *\n       * # Example\n       * ```js\n           var scope = ...;\n           scope.name = 'misko';\n           scope.counter = 0;\n\n           expect(scope.counter).toEqual(0);\n           scope.$watch('name', function(newValue, oldValue) {\n             scope.counter = scope.counter + 1;\n           });\n           expect(scope.counter).toEqual(0);\n\n           scope.$digest();\n           // the listener is always called during the first $digest loop after it was registered\n           expect(scope.counter).toEqual(1);\n\n           scope.$digest();\n           // but now it will not be called unless the value changes\n           expect(scope.counter).toEqual(1);\n\n           scope.name = 'adam';\n           scope.$digest();\n           expect(scope.counter).toEqual(2);\n       * ```\n       *\n       */\n      $digest: function() {\n        var watch, value, last,\n            watchers,\n            length,\n            dirty, ttl = TTL,\n            next, current, target = this,\n            watchLog = [],\n            logIdx, logMsg, asyncTask;\n\n        beginPhase('$digest');\n        // Check for changes to browser url that happened in sync before the call to $digest\n        $browser.$$checkUrlChange();\n\n        if (this === $rootScope && applyAsyncId !== null) {\n          // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n          // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n          $browser.defer.cancel(applyAsyncId);\n          flushApplyAsync();\n        }\n\n        lastDirtyWatch = null;\n\n        do { // \"while dirty\" loop\n          dirty = false;\n          current = target;\n\n          while (asyncQueue.length) {\n            try {\n              asyncTask = asyncQueue.shift();\n              asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n            lastDirtyWatch = null;\n          }\n\n          traverseScopesLoop:\n          do { // \"traverse the scopes\" loop\n            if ((watchers = current.$$watchers)) {\n              // process our watches\n              length = watchers.length;\n              while (length--) {\n                try {\n                  watch = watchers[length];\n                  // Most common watches are on primitives, in which case we can short\n                  // circuit it with === operator, only when === fails do we use .equals\n                  if (watch) {\n                    if ((value = watch.get(current)) !== (last = watch.last) &&\n                        !(watch.eq\n                            ? equals(value, last)\n                            : (typeof value === 'number' && typeof last === 'number'\n                               && isNaN(value) && isNaN(last)))) {\n                      dirty = true;\n                      lastDirtyWatch = watch;\n                      watch.last = watch.eq ? copy(value, null) : value;\n                      watch.fn(value, ((last === initWatchVal) ? value : last), current);\n                      if (ttl < 5) {\n                        logIdx = 4 - ttl;\n                        if (!watchLog[logIdx]) watchLog[logIdx] = [];\n                        watchLog[logIdx].push({\n                          msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n                          newVal: value,\n                          oldVal: last\n                        });\n                      }\n                    } else if (watch === lastDirtyWatch) {\n                      // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n                      // have already been tested.\n                      dirty = false;\n                      break traverseScopesLoop;\n                    }\n                  }\n                } catch (e) {\n                  $exceptionHandler(e);\n                }\n              }\n            }\n\n            // Insanity Warning: scope depth-first traversal\n            // yes, this code is a bit crazy, but it works and we have tests to prove it!\n            // this piece should be kept in sync with the traversal in $broadcast\n            if (!(next = (current.$$childHead ||\n                (current !== target && current.$$nextSibling)))) {\n              while (current !== target && !(next = current.$$nextSibling)) {\n                current = current.$parent;\n              }\n            }\n          } while ((current = next));\n\n          // `break traverseScopesLoop;` takes us to here\n\n          if ((dirty || asyncQueue.length) && !(ttl--)) {\n            clearPhase();\n            throw $rootScopeMinErr('infdig',\n                '{0} $digest() iterations reached. Aborting!\\n' +\n                'Watchers fired in the last 5 iterations: {1}',\n                TTL, watchLog);\n          }\n\n        } while (dirty || asyncQueue.length);\n\n        clearPhase();\n\n        while (postDigestQueue.length) {\n          try {\n            postDigestQueue.shift()();\n          } catch (e) {\n            $exceptionHandler(e);\n          }\n        }\n      },\n\n\n      /**\n       * @ngdoc event\n       * @name $rootScope.Scope#$destroy\n       * @eventType broadcast on scope being destroyed\n       *\n       * @description\n       * Broadcasted when a scope and its children are being destroyed.\n       *\n       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n       * clean up DOM bindings before an element is removed from the DOM.\n       */\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$destroy\n       * @kind function\n       *\n       * @description\n       * Removes the current scope (and all of its children) from the parent scope. Removal implies\n       * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n       * propagate to the current scope and its children. Removal also implies that the current\n       * scope is eligible for garbage collection.\n       *\n       * The `$destroy()` is usually used by directives such as\n       * {@link ng.directive:ngRepeat ngRepeat} for managing the\n       * unrolling of the loop.\n       *\n       * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n       * Application code can register a `$destroy` event handler that will give it a chance to\n       * perform any necessary cleanup.\n       *\n       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n       * clean up DOM bindings before an element is removed from the DOM.\n       */\n      $destroy: function() {\n        // we can't destroy the root scope or a scope that has been already destroyed\n        if (this.$$destroyed) return;\n        var parent = this.$parent;\n\n        this.$broadcast('$destroy');\n        this.$$destroyed = true;\n        if (this === $rootScope) return;\n\n        for (var eventName in this.$$listenerCount) {\n          decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n        }\n\n        // sever all the references to parent scopes (after this cleanup, the current scope should\n        // not be retained by any of our references and should be eligible for garbage collection)\n        if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;\n        if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;\n        if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n        if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n        // Disable listeners, watchers and apply/digest methods\n        this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n        this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n        this.$$listeners = {};\n\n        // All of the code below is bogus code that works around V8's memory leak via optimized code\n        // and inline caches.\n        //\n        // see:\n        // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n        // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n        // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n        this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =\n            this.$$childTail = this.$root = this.$$watchers = null;\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$eval\n       * @kind function\n       *\n       * @description\n       * Executes the `expression` on the current scope and returns the result. Any exceptions in\n       * the expression are propagated (uncaught). This is useful when evaluating Angular\n       * expressions.\n       *\n       * # Example\n       * ```js\n           var scope = ng.$rootScope.Scope();\n           scope.a = 1;\n           scope.b = 2;\n\n           expect(scope.$eval('a+b')).toEqual(3);\n           expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n       * ```\n       *\n       * @param {(string|function())=} expression An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in  {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with the current `scope` parameter.\n       *\n       * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n       * @returns {*} The result of evaluating the expression.\n       */\n      $eval: function(expr, locals) {\n        return $parse(expr)(this, locals);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$evalAsync\n       * @kind function\n       *\n       * @description\n       * Executes the expression on the current scope at a later point in time.\n       *\n       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n       * that:\n       *\n       *   - it will execute after the function that scheduled the evaluation (preferably before DOM\n       *     rendering).\n       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n       *     `expression` execution.\n       *\n       * Any exceptions from the execution of the expression are forwarded to the\n       * {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n       * will be scheduled. However, it is encouraged to always call code that changes the model\n       * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n       *\n       * @param {(string|function())=} expression An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with the current `scope` parameter.\n       *\n       * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n       */\n      $evalAsync: function(expr, locals) {\n        // if we are outside of an $digest loop and this is the first time we are scheduling async\n        // task also schedule async auto-flush\n        if (!$rootScope.$$phase && !asyncQueue.length) {\n          $browser.defer(function() {\n            if (asyncQueue.length) {\n              $rootScope.$digest();\n            }\n          });\n        }\n\n        asyncQueue.push({scope: this, expression: expr, locals: locals});\n      },\n\n      $$postDigest: function(fn) {\n        postDigestQueue.push(fn);\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$apply\n       * @kind function\n       *\n       * @description\n       * `$apply()` is used to execute an expression in angular from outside of the angular\n       * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n       * Because we are calling into the angular framework we need to perform proper scope life\n       * cycle of {@link ng.$exceptionHandler exception handling},\n       * {@link ng.$rootScope.Scope#$digest executing watches}.\n       *\n       * ## Life cycle\n       *\n       * # Pseudo-Code of `$apply()`\n       * ```js\n           function $apply(expr) {\n             try {\n               return $eval(expr);\n             } catch (e) {\n               $exceptionHandler(e);\n             } finally {\n               $root.$digest();\n             }\n           }\n       * ```\n       *\n       *\n       * Scope's `$apply()` method transitions through the following stages:\n       *\n       * 1. The {@link guide/expression expression} is executed using the\n       *    {@link ng.$rootScope.Scope#$eval $eval()} method.\n       * 2. Any exceptions from the execution of the expression are forwarded to the\n       *    {@link ng.$exceptionHandler $exceptionHandler} service.\n       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n       *    expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n       *\n       *\n       * @param {(string|function())=} exp An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with current `scope` parameter.\n       *\n       * @returns {*} The result of evaluating the expression.\n       */\n      $apply: function(expr) {\n        try {\n          beginPhase('$apply');\n          return this.$eval(expr);\n        } catch (e) {\n          $exceptionHandler(e);\n        } finally {\n          clearPhase();\n          try {\n            $rootScope.$digest();\n          } catch (e) {\n            $exceptionHandler(e);\n            throw e;\n          }\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$applyAsync\n       * @kind function\n       *\n       * @description\n       * Schedule the invocation of $apply to occur at a later time. The actual time difference\n       * varies across browsers, but is typically around ~10 milliseconds.\n       *\n       * This can be used to queue up multiple expressions which need to be evaluated in the same\n       * digest.\n       *\n       * @param {(string|function())=} exp An angular expression to be executed.\n       *\n       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.\n       *    - `function(scope)`: execute the function with current `scope` parameter.\n       */\n      $applyAsync: function(expr) {\n        var scope = this;\n        expr && applyAsyncQueue.push($applyAsyncExpression);\n        scheduleApplyAsync();\n\n        function $applyAsyncExpression() {\n          scope.$eval(expr);\n        }\n      },\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$on\n       * @kind function\n       *\n       * @description\n       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n       * discussion of event life cycle.\n       *\n       * The event listener function format is: `function(event, args...)`. The `event` object\n       * passed into the listener has the following attributes:\n       *\n       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n       *     `$broadcast`-ed.\n       *   - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n       *     event propagates through the scope hierarchy, this property is set to null.\n       *   - `name` - `{string}`: name of the event.\n       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n       *     further event propagation (available only for events that were `$emit`-ed).\n       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n       *     to true.\n       *   - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n       *\n       * @param {string} name Event name to listen on.\n       * @param {function(event, ...args)} listener Function to call when the event is emitted.\n       * @returns {function()} Returns a deregistration function for this listener.\n       */\n      $on: function(name, listener) {\n        var namedListeners = this.$$listeners[name];\n        if (!namedListeners) {\n          this.$$listeners[name] = namedListeners = [];\n        }\n        namedListeners.push(listener);\n\n        var current = this;\n        do {\n          if (!current.$$listenerCount[name]) {\n            current.$$listenerCount[name] = 0;\n          }\n          current.$$listenerCount[name]++;\n        } while ((current = current.$parent));\n\n        var self = this;\n        return function() {\n          var indexOfListener = namedListeners.indexOf(listener);\n          if (indexOfListener !== -1) {\n            namedListeners[indexOfListener] = null;\n            decrementListenerCount(self, 1, name);\n          }\n        };\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$emit\n       * @kind function\n       *\n       * @description\n       * Dispatches an event `name` upwards through the scope hierarchy notifying the\n       * registered {@link ng.$rootScope.Scope#$on} listeners.\n       *\n       * The event life cycle starts at the scope on which `$emit` was called. All\n       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n       * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n       * registered listeners along the way. The event will stop propagating if one of the listeners\n       * cancels it.\n       *\n       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * @param {string} name Event name to emit.\n       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n       * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n       */\n      $emit: function(name, args) {\n        var empty = [],\n            namedListeners,\n            scope = this,\n            stopPropagation = false,\n            event = {\n              name: name,\n              targetScope: scope,\n              stopPropagation: function() {stopPropagation = true;},\n              preventDefault: function() {\n                event.defaultPrevented = true;\n              },\n              defaultPrevented: false\n            },\n            listenerArgs = concat([event], arguments, 1),\n            i, length;\n\n        do {\n          namedListeners = scope.$$listeners[name] || empty;\n          event.currentScope = scope;\n          for (i = 0, length = namedListeners.length; i < length; i++) {\n\n            // if listeners were deregistered, defragment the array\n            if (!namedListeners[i]) {\n              namedListeners.splice(i, 1);\n              i--;\n              length--;\n              continue;\n            }\n            try {\n              //allow all listeners attached to the current scope to run\n              namedListeners[i].apply(null, listenerArgs);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n          }\n          //if any listener on the current scope stops propagation, prevent bubbling\n          if (stopPropagation) {\n            event.currentScope = null;\n            return event;\n          }\n          //traverse upwards\n          scope = scope.$parent;\n        } while (scope);\n\n        event.currentScope = null;\n\n        return event;\n      },\n\n\n      /**\n       * @ngdoc method\n       * @name $rootScope.Scope#$broadcast\n       * @kind function\n       *\n       * @description\n       * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n       * registered {@link ng.$rootScope.Scope#$on} listeners.\n       *\n       * The event life cycle starts at the scope on which `$broadcast` was called. All\n       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n       * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n       * scope and calls all registered listeners along the way. The event cannot be canceled.\n       *\n       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n       *\n       * @param {string} name Event name to broadcast.\n       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n       * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n       */\n      $broadcast: function(name, args) {\n        var target = this,\n            current = target,\n            next = target,\n            event = {\n              name: name,\n              targetScope: target,\n              preventDefault: function() {\n                event.defaultPrevented = true;\n              },\n              defaultPrevented: false\n            };\n\n        if (!target.$$listenerCount[name]) return event;\n\n        var listenerArgs = concat([event], arguments, 1),\n            listeners, i, length;\n\n        //down while you can, then up and next sibling or up and next sibling until back at root\n        while ((current = next)) {\n          event.currentScope = current;\n          listeners = current.$$listeners[name] || [];\n          for (i = 0, length = listeners.length; i < length; i++) {\n            // if listeners were deregistered, defragment the array\n            if (!listeners[i]) {\n              listeners.splice(i, 1);\n              i--;\n              length--;\n              continue;\n            }\n\n            try {\n              listeners[i].apply(null, listenerArgs);\n            } catch (e) {\n              $exceptionHandler(e);\n            }\n          }\n\n          // Insanity Warning: scope depth-first traversal\n          // yes, this code is a bit crazy, but it works and we have tests to prove it!\n          // this piece should be kept in sync with the traversal in $digest\n          // (though it differs due to having the extra check for $$listenerCount)\n          if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n              (current !== target && current.$$nextSibling)))) {\n            while (current !== target && !(next = current.$$nextSibling)) {\n              current = current.$parent;\n            }\n          }\n        }\n\n        event.currentScope = null;\n        return event;\n      }\n    };\n\n    var $rootScope = new Scope();\n\n    //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n    var asyncQueue = $rootScope.$$asyncQueue = [];\n    var postDigestQueue = $rootScope.$$postDigestQueue = [];\n    var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n    return $rootScope;\n\n\n    function beginPhase(phase) {\n      if ($rootScope.$$phase) {\n        throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n      }\n\n      $rootScope.$$phase = phase;\n    }\n\n    function clearPhase() {\n      $rootScope.$$phase = null;\n    }\n\n\n    function decrementListenerCount(current, count, name) {\n      do {\n        current.$$listenerCount[name] -= count;\n\n        if (current.$$listenerCount[name] === 0) {\n          delete current.$$listenerCount[name];\n        }\n      } while ((current = current.$parent));\n    }\n\n    /**\n     * function used as an initial value for watchers.\n     * because it's unique we can easily tell it apart from other values\n     */\n    function initWatchVal() {}\n\n    function flushApplyAsync() {\n      while (applyAsyncQueue.length) {\n        try {\n          applyAsyncQueue.shift()();\n        } catch (e) {\n          $exceptionHandler(e);\n        }\n      }\n      applyAsyncId = null;\n    }\n\n    function scheduleApplyAsync() {\n      if (applyAsyncId === null) {\n        applyAsyncId = $browser.defer(function() {\n          $rootScope.$apply(flushApplyAsync);\n        });\n      }\n    }\n  }];\n}\n\n/**\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n  var aHrefSanitizationWhitelist = /^\\s*(https?|ftp|mailto|tel|file):/,\n    imgSrcSanitizationWhitelist = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n  /**\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during a[href] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.aHrefSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      aHrefSanitizationWhitelist = regexp;\n      return this;\n    }\n    return aHrefSanitizationWhitelist;\n  };\n\n\n  /**\n   * @description\n   * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n   * urls during img[src] sanitization.\n   *\n   * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n   *\n   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n   * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n   *\n   * @param {RegExp=} regexp New regexp to whitelist urls with.\n   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n   *    chaining otherwise.\n   */\n  this.imgSrcSanitizationWhitelist = function(regexp) {\n    if (isDefined(regexp)) {\n      imgSrcSanitizationWhitelist = regexp;\n      return this;\n    }\n    return imgSrcSanitizationWhitelist;\n  };\n\n  this.$get = function() {\n    return function sanitizeUri(uri, isImage) {\n      var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;\n      var normalizedVal;\n      normalizedVal = urlResolve(uri).href;\n      if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n        return 'unsafe:' + normalizedVal;\n      }\n      return uri;\n    };\n  };\n}\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n  HTML: 'html',\n  CSS: 'css',\n  URL: 'url',\n  // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a\n  // url.  (e.g. ng-include, script src, templateUrl)\n  RESOURCE_URL: 'resourceUrl',\n  JS: 'js'\n};\n\n// Helper functions follow.\n\nfunction adjustMatcher(matcher) {\n  if (matcher === 'self') {\n    return matcher;\n  } else if (isString(matcher)) {\n    // Strings match exactly except for 2 wildcards - '*' and '**'.\n    // '*' matches any character except those from the set ':/.?&'.\n    // '**' matches any character (like .* in a RegExp).\n    // More than 2 *'s raises an error as it's ill defined.\n    if (matcher.indexOf('***') > -1) {\n      throw $sceMinErr('iwcard',\n          'Illegal sequence *** in string matcher.  String: {0}', matcher);\n    }\n    matcher = escapeForRegexp(matcher).\n                  replace('\\\\*\\\\*', '.*').\n                  replace('\\\\*', '[^:/.?&;]*');\n    return new RegExp('^' + matcher + '$');\n  } else if (isRegExp(matcher)) {\n    // The only other type of matcher allowed is a Regexp.\n    // Match entire URL / disallow partial matches.\n    // Flags are reset (i.e. no global, ignoreCase or multiline)\n    return new RegExp('^' + matcher.source + '$');\n  } else {\n    throw $sceMinErr('imatcher',\n        'Matchers may only be \"self\", string patterns or RegExp objects');\n  }\n}\n\n\nfunction adjustMatchers(matchers) {\n  var adjustedMatchers = [];\n  if (isDefined(matchers)) {\n    forEach(matchers, function(matcher) {\n      adjustedMatchers.push(adjustMatcher(matcher));\n    });\n  }\n  return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS.  This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain.  While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as\n * templates.  Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate} service.  This allows one to get/set the whitelists and blacklists used to ensure\n * that the URLs used for sourcing Angular templates are safe.  Refer {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and\n * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n *\n * For the general details about this service in Angular, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**:  Consider the following case. <a name=\"example\"></a>\n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n *   `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n *  angular.module('myApp', []).config(function($sceDelegateProvider) {\n *    $sceDelegateProvider.resourceUrlWhitelist([\n *      // Allow same origin resource loads.\n *      'self',\n *      // Allow loading from our assets domain.  Notice the difference between * and **.\n *      'http://srv*.assets.example.com/**'\n *    ]);\n *\n *    // The blacklist overrides the whitelist so the open redirect here is blocked.\n *    $sceDelegateProvider.resourceUrlBlacklist([\n *      'http://myapp.example.com/clickThru**'\n *    ]);\n *  });\n * ```\n */\n\nfunction $SceDelegateProvider() {\n  this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n  // Resource URLs can also be trusted by policy.\n  var resourceUrlWhitelist = ['self'],\n      resourceUrlBlacklist = [];\n\n  /**\n   * @ngdoc method\n   * @name $sceDelegateProvider#resourceUrlWhitelist\n   * @kind function\n   *\n   * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value\n   *     provided.  This must be an array or null.  A snapshot of this array is used so further\n   *     changes to the array are ignored.\n   *\n   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n   *     allowed in this array.\n   *\n   *     Note: **an empty whitelist array will block all URLs**!\n   *\n   * @return {Array} the currently set whitelist array.\n   *\n   * The **default value** when no whitelist has been explicitly set is `['self']` allowing only\n   * same origin resource requests.\n   *\n   * @description\n   * Sets/Gets the whitelist of trusted resource URLs.\n   */\n  this.resourceUrlWhitelist = function(value) {\n    if (arguments.length) {\n      resourceUrlWhitelist = adjustMatchers(value);\n    }\n    return resourceUrlWhitelist;\n  };\n\n  /**\n   * @ngdoc method\n   * @name $sceDelegateProvider#resourceUrlBlacklist\n   * @kind function\n   *\n   * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value\n   *     provided.  This must be an array or null.  A snapshot of this array is used so further\n   *     changes to the array are ignored.\n   *\n   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n   *     allowed in this array.\n   *\n   *     The typical usage for the blacklist is to **block\n   *     [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n   *     these would otherwise be trusted but actually return content from the redirected domain.\n   *\n   *     Finally, **the blacklist overrides the whitelist** and has the final say.\n   *\n   * @return {Array} the currently set blacklist array.\n   *\n   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there\n   * is no blacklist.)\n   *\n   * @description\n   * Sets/Gets the blacklist of trusted resource URLs.\n   */\n\n  this.resourceUrlBlacklist = function(value) {\n    if (arguments.length) {\n      resourceUrlBlacklist = adjustMatchers(value);\n    }\n    return resourceUrlBlacklist;\n  };\n\n  this.$get = ['$injector', function($injector) {\n\n    var htmlSanitizer = function htmlSanitizer(html) {\n      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n    };\n\n    if ($injector.has('$sanitize')) {\n      htmlSanitizer = $injector.get('$sanitize');\n    }\n\n\n    function matchUrl(matcher, parsedUrl) {\n      if (matcher === 'self') {\n        return urlIsSameOrigin(parsedUrl);\n      } else {\n        // definitely a regex.  See adjustMatchers()\n        return !!matcher.exec(parsedUrl.href);\n      }\n    }\n\n    function isResourceUrlAllowedByPolicy(url) {\n      var parsedUrl = urlResolve(url.toString());\n      var i, n, allowed = false;\n      // Ensure that at least one item from the whitelist allows this url.\n      for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {\n        if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {\n          allowed = true;\n          break;\n        }\n      }\n      if (allowed) {\n        // Ensure that no item from the blacklist blocked this url.\n        for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {\n          if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {\n            allowed = false;\n            break;\n          }\n        }\n      }\n      return allowed;\n    }\n\n    function generateHolderType(Base) {\n      var holderType = function TrustedValueHolderType(trustedValue) {\n        this.$$unwrapTrustedValue = function() {\n          return trustedValue;\n        };\n      };\n      if (Base) {\n        holderType.prototype = new Base();\n      }\n      holderType.prototype.valueOf = function sceValueOf() {\n        return this.$$unwrapTrustedValue();\n      };\n      holderType.prototype.toString = function sceToString() {\n        return this.$$unwrapTrustedValue().toString();\n      };\n      return holderType;\n    }\n\n    var trustedValueHolderBase = generateHolderType(),\n        byType = {};\n\n    byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n    byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#trustAs\n     *\n     * @description\n     * Returns an object that is trusted by angular for use in specified strict\n     * contextual escaping contexts (such as ng-bind-html, ng-include, any src\n     * attribute interpolation, any dom event binding attribute interpolation\n     * such as for onclick,  etc.) that uses the provided value.\n     * See {@link ng.$sce $sce} for enabling strict contextual escaping.\n     *\n     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,\n     *   resourceUrl, html, js and css.\n     * @param {*} value The value that that should be considered trusted/safe.\n     * @returns {*} A value that can be used to stand in for the provided `value` in places\n     * where Angular expects a $sce.trustAs() return value.\n     */\n    function trustAs(type, trustedValue) {\n      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n      if (!Constructor) {\n        throw $sceMinErr('icontext',\n            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n            type, trustedValue);\n      }\n      if (trustedValue === null || trustedValue === undefined || trustedValue === '') {\n        return trustedValue;\n      }\n      // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting\n      // mutable objects, we ensure here that the value passed in is actually a string.\n      if (typeof trustedValue !== 'string') {\n        throw $sceMinErr('itype',\n            'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n            type);\n      }\n      return new Constructor(trustedValue);\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#valueOf\n     *\n     * @description\n     * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n     * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n     *\n     * If the passed parameter is not a value that had been returned by {@link\n     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.\n     *\n     * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n     *      call or anything else.\n     * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns\n     *     `value` unchanged.\n     */\n    function valueOf(maybeTrusted) {\n      if (maybeTrusted instanceof trustedValueHolderBase) {\n        return maybeTrusted.$$unwrapTrustedValue();\n      } else {\n        return maybeTrusted;\n      }\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sceDelegate#getTrusted\n     *\n     * @description\n     * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and\n     * returns the originally supplied value if the queried context type is a supertype of the\n     * created type.  If this condition isn't satisfied, throws an exception.\n     *\n     * @param {string} type The kind of context in which this value is to be used.\n     * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} call.\n     * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs\n     *     `$sceDelegate.trustAs`} if valid in this context.  Otherwise, throws an exception.\n     */\n    function getTrusted(type, maybeTrusted) {\n      if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') {\n        return maybeTrusted;\n      }\n      var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n      if (constructor && maybeTrusted instanceof constructor) {\n        return maybeTrusted.$$unwrapTrustedValue();\n      }\n      // If we get here, then we may only take one of two actions.\n      // 1. sanitize the value for the requested type, or\n      // 2. throw an exception.\n      if (type === SCE_CONTEXTS.RESOURCE_URL) {\n        if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n          return maybeTrusted;\n        } else {\n          throw $sceMinErr('insecurl',\n              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}',\n              maybeTrusted.toString());\n        }\n      } else if (type === SCE_CONTEXTS.HTML) {\n        return htmlSanitizer(maybeTrusted);\n      }\n      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n    }\n\n    return { trustAs: trustAs,\n             getTrusted: getTrusted,\n             valueOf: valueOf };\n  }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * -   enable/disable Strict Contextual Escaping (SCE) in a module\n * -   override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/* jshint maxlen: false*/\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * # Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain\n * contexts to result in a value that is marked as safe to use for that context.  One example of\n * such a context is binding arbitrary html controlled by the user via `ng-bind-html`.  We refer\n * to these contexts as privileged or SCE contexts.\n *\n * As of version 1.2, Angular ships with SCE enabled by default.\n *\n * Note:  When enabled (the default), IE<11 in quirks mode is not supported.  In this mode, IE<11 allow\n * one to execute arbitrary javascript by the use of the expression() syntax.  Refer\n * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.\n * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`\n * to the top of your HTML document.\n *\n * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for\n * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * <input ng-model=\"userHtml\">\n * <div ng-bind-html=\"userHtml\"></div>\n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user.  With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV.\n * In a more realistic example, one may be rendering user comments, blog articles, etc. via\n * bindings.  (HTML is just one example of a context where rendering user controlled input creates\n * security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?)  How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, you want to ensure that any such bindings are disallowed unless you can\n * determine that something explicitly says it's safe to use a value for binding in that\n * context.  You can then audit your code (a simple grep would do) to ensure that this is only done\n * for those values that you can easily tell are safe - because they were received from your server,\n * sanitized by your library, etc.  You can organize your codebase to help with this - perhaps\n * allowing only the files in a specific directory to do this.  Ensuring that the internal API\n * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * obtain values that will be accepted by SCE / privileged contexts.\n *\n *\n * ## How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly.  Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the\n * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}.  Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n *   return function(scope, element, attr) {\n *     scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n *       element.html(value || '');\n *     });\n *   };\n * }];\n * ```\n *\n * ## Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, Angular only loads templates from the same domain and protocol as the application\n * document.  This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL.  To load templates from other domains and/or\n * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded.  This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers.  Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ## This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.\n * `<div ng-bind-html=\"'<b>implicitly trusted</b>'\"></div>`) just works.\n *\n * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them\n * through {@link ng.$sce#getTrusted $sce.getTrusted}.  SCE doesn't play a role here.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document.  You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.\n *\n * This significantly reduces the overhead.  It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * <a name=\"contexts\"></a>\n * ## What trusted context types are supported?\n *\n * | Context             | Notes          |\n * |---------------------|----------------|\n * | `$sce.HTML`         | For HTML that's safe to source into the application.  The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS`          | For CSS that's safe to source into the application.  Currently unused.  Feel free to use it in your own directives. |\n * | `$sce.URL`          | For URLs that are safe to follow as links.  Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application.  Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)  <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |\n * | `$sce.JS`           | For JavaScript that is safe to execute in your application's context.  Currently unused.  Feel free to use it in your own directives. |\n *\n * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name=\"resourceUrlPatternItem\"></a>\n *\n *  Each element in these arrays must be one of the following:\n *\n *  - **'self'**\n *    - The special **string**, `'self'`, can be used to match against all URLs of the **same\n *      domain** as the application document using the **same protocol**.\n *  - **String** (except the special value `'self'`)\n *    - The string is matched against the full *normalized / absolute URL* of the resource\n *      being tested (substring matches are not good enough.)\n *    - There are exactly **two wildcard sequences** - `*` and `**`.  All other characters\n *      match themselves.\n *    - `*`: matches zero or more occurrences of any character other than one of the following 6\n *      characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'.  It's a useful wildcard for use\n *      in a whitelist.\n *    - `**`: matches zero or more occurrences of *any* character.  As such, it's not\n *      not appropriate to use in for a scheme, domain, etc. as it would match too much.  (e.g.\n *      http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n *      not have been the intention.)  Its usage at the very end of the path is ok.  (e.g.\n *      http://foo.example.com/templates/**).\n *  - **RegExp** (*see caveat below*)\n *    - *Caveat*:  While regular expressions are powerful and offer great flexibility,  their syntax\n *      (and all the inevitable escaping) makes them *harder to maintain*.  It's easy to\n *      accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n *      have good test coverage.).  For instance, the use of `.` in the regex is correct only in a\n *      small number of cases.  A `.` character in the regex used when matching the scheme or a\n *      subdomain could be matched against a `:` or literal `.` that was likely not intended.   It\n *      is highly recommended to use the string patterns and only fall back to regular expressions\n *      if they as a last resort.\n *    - The regular expression must be an instance of RegExp (i.e. not a string.)  It is\n *      matched against the **entire** *normalized / absolute URL* of the resource being tested\n *      (even when the RegExp did not have the `^` and `$` codes.)  In addition, any flags\n *      present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n *    - If you are generating your JavaScript from some other templating engine (not\n *      recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n *      remember to escape your regular expression (and be aware that you might need more than\n *      one level of escaping depending on your templating engine and the way you interpolated\n *      the value.)  Do make use of your platform's escaping mechanism as it might be good\n *      enough before coding your own.  e.g. Ruby has\n *      [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n *      and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n *      Javascript lacks a similar built in function for escaping.  Take a look at Google\n *      Closure library's [goog.string.regExpEscape(s)](\n *      http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ## Show me an example using SCE.\n *\n * <example module=\"mySceApp\" deps=\"angular-sanitize.js\">\n * <file name=\"index.html\">\n *   <div ng-controller=\"AppController as myCtrl\">\n *     <i ng-bind-html=\"myCtrl.explicitlyTrustedHtml\" id=\"explicitlyTrustedHtml\"></i><br><br>\n *     <b>User comments</b><br>\n *     By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n *     $sanitize is available.  If $sanitize isn't available, this results in an error instead of an\n *     exploit.\n *     <div class=\"well\">\n *       <div ng-repeat=\"userComment in myCtrl.userComments\">\n *         <b>{{userComment.name}}</b>:\n *         <span ng-bind-html=\"userComment.htmlComment\" class=\"htmlComment\"></span>\n *         <br>\n *       </div>\n *     </div>\n *   </div>\n * </file>\n *\n * <file name=\"script.js\">\n *   angular.module('mySceApp', ['ngSanitize'])\n *     .controller('AppController', ['$http', '$templateCache', '$sce',\n *       function($http, $templateCache, $sce) {\n *         var self = this;\n *         $http.get(\"test_data.json\", {cache: $templateCache}).success(function(userComments) {\n *           self.userComments = userComments;\n *         });\n *         self.explicitlyTrustedHtml = $sce.trustAsHtml(\n *             '<span onmouseover=\"this.textContent=&quot;Explicitly trusted HTML bypasses ' +\n *             'sanitization.&quot;\">Hover over this text.</span>');\n *       }]);\n * </file>\n *\n * <file name=\"test_data.json\">\n * [\n *   { \"name\": \"Alice\",\n *     \"htmlComment\":\n *         \"<span onmouseover='this.textContent=\\\"PWN3D!\\\"'>Is <i>anyone</i> reading this?</span>\"\n *   },\n *   { \"name\": \"Bob\",\n *     \"htmlComment\": \"<i>Yes!</i>  Am I the only other one?\"\n *   }\n * ]\n * </file>\n *\n * <file name=\"protractor.js\" type=\"protractor\">\n *   describe('SCE doc demo', function() {\n *     it('should sanitize untrusted values', function() {\n *       expect(element.all(by.css('.htmlComment')).first().getInnerHtml())\n *           .toBe('<span>Is <i>anyone</i> reading this?</span>');\n *     });\n *\n *     it('should NOT sanitize explicitly trusted values', function() {\n *       expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(\n *           '<span onmouseover=\"this.textContent=&quot;Explicitly trusted HTML bypasses ' +\n *           'sanitization.&quot;\">Hover over this text.</span>');\n *     });\n *   });\n * </file>\n * </example>\n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can.  However, this is strongly discouraged.  SCE gives you a lot of security benefits\n * for little coding overhead.  It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage.  It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n *   // Completely disable SCE.  For demonstration purposes only!\n *   // Do not use in new projects.\n *   $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n/* jshint maxlen: 100 */\n\nfunction $SceProvider() {\n  var enabled = true;\n\n  /**\n   * @ngdoc method\n   * @name $sceProvider#enabled\n   * @kind function\n   *\n   * @param {boolean=} value If provided, then enables/disables SCE.\n   * @return {boolean} true if SCE is enabled, false otherwise.\n   *\n   * @description\n   * Enables/disables SCE and returns the current value.\n   */\n  this.enabled = function(value) {\n    if (arguments.length) {\n      enabled = !!value;\n    }\n    return enabled;\n  };\n\n\n  /* Design notes on the default implementation for SCE.\n   *\n   * The API contract for the SCE delegate\n   * -------------------------------------\n   * The SCE delegate object must provide the following 3 methods:\n   *\n   * - trustAs(contextEnum, value)\n   *     This method is used to tell the SCE service that the provided value is OK to use in the\n   *     contexts specified by contextEnum.  It must return an object that will be accepted by\n   *     getTrusted() for a compatible contextEnum and return this value.\n   *\n   * - valueOf(value)\n   *     For values that were not produced by trustAs(), return them as is.  For values that were\n   *     produced by trustAs(), return the corresponding input value to trustAs.  Basically, if\n   *     trustAs is wrapping the given values into some type, this operation unwraps it when given\n   *     such a value.\n   *\n   * - getTrusted(contextEnum, value)\n   *     This function should return the a value that is safe to use in the context specified by\n   *     contextEnum or throw and exception otherwise.\n   *\n   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n   * opaque or wrapped in some holder object.  That happens to be an implementation detail.  For\n   * instance, an implementation could maintain a registry of all trusted objects by context.  In\n   * such a case, trustAs() would return the same object that was passed in.  getTrusted() would\n   * return the same object passed in if it was found in the registry under a compatible context or\n   * throw an exception otherwise.  An implementation might only wrap values some of the time based\n   * on some criteria.  getTrusted() might return a value and not throw an exception for special\n   * constants or objects even if not wrapped.  All such implementations fulfill this contract.\n   *\n   *\n   * A note on the inheritance model for SCE contexts\n   * ------------------------------------------------\n   * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types.  This\n   * is purely an implementation details.\n   *\n   * The contract is simply this:\n   *\n   *     getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n   *     will also succeed.\n   *\n   * Inheritance happens to capture this in a natural way.  In some future, we\n   * may not use inheritance anymore.  That is OK because no code outside of\n   * sce.js and sceSpecs.js would need to be aware of this detail.\n   */\n\n  this.$get = ['$parse', '$sceDelegate', function(\n                $parse,   $sceDelegate) {\n    // Prereq: Ensure that we're not running in IE<11 quirks mode.  In that mode, IE < 11 allow\n    // the \"expression(javascript expression)\" syntax which is insecure.\n    if (enabled && msie < 8) {\n      throw $sceMinErr('iequirks',\n        'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n        'mode.  You can fix this by adding the text <!doctype html> to the top of your HTML ' +\n        'document.  See http://docs.angularjs.org/api/ng.$sce for more information.');\n    }\n\n    var sce = shallowCopy(SCE_CONTEXTS);\n\n    /**\n     * @ngdoc method\n     * @name $sce#isEnabled\n     * @kind function\n     *\n     * @return {Boolean} true if SCE is enabled, false otherwise.  If you want to set the value, you\n     * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n     *\n     * @description\n     * Returns a boolean indicating if SCE is enabled.\n     */\n    sce.isEnabled = function() {\n      return enabled;\n    };\n    sce.trustAs = $sceDelegate.trustAs;\n    sce.getTrusted = $sceDelegate.getTrusted;\n    sce.valueOf = $sceDelegate.valueOf;\n\n    if (!enabled) {\n      sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n      sce.valueOf = identity;\n    }\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAs\n     *\n     * @description\n     * Converts Angular {@link guide/expression expression} into a function.  This is like {@link\n     * ng.$parse $parse} and is identical when the expression is a literal constant.  Otherwise, it\n     * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n     * *result*)}\n     *\n     * @param {string} type The kind of SCE context in which this result will be used.\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n    sce.parseAs = function sceParseAs(type, expr) {\n      var parsed = $parse(expr);\n      if (parsed.literal && parsed.constant) {\n        return parsed;\n      } else {\n        return $parse(expr, function(value) {\n          return sce.getTrusted(type, value);\n        });\n      }\n    };\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAs\n     *\n     * @description\n     * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.  As such,\n     * returns an object that is trusted by angular for use in specified strict contextual\n     * escaping contexts (such as ng-bind-html, ng-include, any src attribute\n     * interpolation, any dom event binding attribute interpolation such as for onclick,  etc.)\n     * that uses the provided value.  See * {@link ng.$sce $sce} for enabling strict contextual\n     * escaping.\n     *\n     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,\n     *   resource_url, html, js and css.\n     * @param {*} value The value that that should be considered trusted/safe.\n     * @returns {*} A value that can be used to stand in for the provided `value` in places\n     * where Angular expects a $sce.trustAs() return value.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsHtml(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml\n     *     $sce.getTrustedHtml(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsUrl(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl\n     *     $sce.getTrustedUrl(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsResourceUrl(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl\n     *     $sce.getTrustedResourceUrl(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the return\n     *     value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#trustAsJs\n     *\n     * @description\n     * Shorthand method.  `$sce.trustAsJs(value)` →\n     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n     *\n     * @param {*} value The value to trustAs.\n     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs\n     *     $sce.getTrustedJs(value)} to obtain the original value.  (privileged directives\n     *     only accept expressions that are either literal constants or are the\n     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrusted\n     *\n     * @description\n     * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}.  As such,\n     * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the\n     * originally supplied value if the queried context type is a supertype of the created type.\n     * If this condition isn't satisfied, throws an exception.\n     *\n     * @param {string} type The kind of context in which this value is to be used.\n     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}\n     *                         call.\n     * @returns {*} The value the was originally provided to\n     *              {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.\n     *              Otherwise, throws an exception.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedHtml(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedCss\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedCss(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedUrl(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n     *\n     * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#getTrustedJs\n     *\n     * @description\n     * Shorthand method.  `$sce.getTrustedJs(value)` →\n     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n     *\n     * @param {*} value The value to pass to `$sce.getTrusted`.\n     * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsHtml\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsHtml(expression string)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsCss\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsCss(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsUrl(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsResourceUrl\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsResourceUrl(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    /**\n     * @ngdoc method\n     * @name $sce#parseAsJs\n     *\n     * @description\n     * Shorthand method.  `$sce.parseAsJs(value)` →\n     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n     *\n     * @param {string} expression String expression to compile.\n     * @returns {function(context, locals)} a function which represents the compiled expression:\n     *\n     *    * `context` – `{object}` – an object against which any expressions embedded in the strings\n     *      are evaluated against (typically a scope object).\n     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in\n     *      `context`.\n     */\n\n    // Shorthand delegations.\n    var parse = sce.parseAs,\n        getTrusted = sce.getTrusted,\n        trustAs = sce.trustAs;\n\n    forEach(SCE_CONTEXTS, function(enumValue, name) {\n      var lName = lowercase(name);\n      sce[camelCase(\"parse_as_\" + lName)] = function(expr) {\n        return parse(enumValue, expr);\n      };\n      sce[camelCase(\"get_trusted_\" + lName)] = function(value) {\n        return getTrusted(enumValue, value);\n      };\n      sce[camelCase(\"trust_as_\" + lName)] = function(value) {\n        return trustAs(enumValue, value);\n      };\n    });\n\n    return sce;\n  }];\n}\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n  this.$get = ['$window', '$document', function($window, $document) {\n    var eventSupport = {},\n        android =\n          int((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n        boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n        document = $document[0] || {},\n        vendorPrefix,\n        vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,\n        bodyStyle = document.body && document.body.style,\n        transitions = false,\n        animations = false,\n        match;\n\n    if (bodyStyle) {\n      for (var prop in bodyStyle) {\n        if (match = vendorRegex.exec(prop)) {\n          vendorPrefix = match[0];\n          vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);\n          break;\n        }\n      }\n\n      if (!vendorPrefix) {\n        vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';\n      }\n\n      transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));\n      animations  = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));\n\n      if (android && (!transitions ||  !animations)) {\n        transitions = isString(document.body.style.webkitTransition);\n        animations = isString(document.body.style.webkitAnimation);\n      }\n    }\n\n\n    return {\n      // Android has history.pushState, but it does not update location correctly\n      // so let's not use the history API at all.\n      // http://code.google.com/p/android/issues/detail?id=17471\n      // https://github.com/angular/angular.js/issues/904\n\n      // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n      // so let's not use the history API also\n      // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n      // jshint -W018\n      history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),\n      // jshint +W018\n      hasEvent: function(event) {\n        // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n        // it. In particular the event is not fired when backspace or delete key are pressed or\n        // when cut operation is performed.\n        // IE10+ implements 'input' event but it erroneously fires under various situations,\n        // e.g. when placeholder changes, or a form is focused.\n        if (event === 'input' && msie <= 11) return false;\n\n        if (isUndefined(eventSupport[event])) {\n          var divElm = document.createElement('div');\n          eventSupport[event] = 'on' + event in divElm;\n        }\n\n        return eventSupport[event];\n      },\n      csp: csp(),\n      vendorPrefix: vendorPrefix,\n      transitions: transitions,\n      animations: animations,\n      android: android\n    };\n  }];\n}\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service downloads the provided template using `$http` and, upon success,\n * stores the contents inside of `$templateCache`. If the HTTP request fails or the response data\n * of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted\n * by setting the 2nd parameter of the function to true).\n *\n * @param {string} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} the HTTP Promise for the given.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\nfunction $TemplateRequestProvider() {\n  this.$get = ['$templateCache', '$http', '$q', function($templateCache, $http, $q) {\n    function handleRequestFn(tpl, ignoreRequestError) {\n      handleRequestFn.totalPendingRequests++;\n\n      var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n      if (isArray(transformResponse)) {\n        transformResponse = transformResponse.filter(function(transformer) {\n          return transformer !== defaultHttpResponseTransform;\n        });\n      } else if (transformResponse === defaultHttpResponseTransform) {\n        transformResponse = null;\n      }\n\n      var httpOptions = {\n        cache: $templateCache,\n        transformResponse: transformResponse\n      };\n\n      return $http.get(tpl, httpOptions)\n        ['finally'](function() {\n          handleRequestFn.totalPendingRequests--;\n        })\n        .then(function(response) {\n          return response.data;\n        }, handleError);\n\n      function handleError(resp) {\n        if (!ignoreRequestError) {\n          throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl);\n        }\n        return $q.reject(resp);\n      }\n    }\n\n    handleRequestFn.totalPendingRequests = 0;\n\n    return handleRequestFn;\n  }];\n}\n\nfunction $$TestabilityProvider() {\n  this.$get = ['$rootScope', '$browser', '$location',\n       function($rootScope,   $browser,   $location) {\n\n    /**\n     * @name $testability\n     *\n     * @description\n     * The private $$testability service provides a collection of methods for use when debugging\n     * or by automated test and debugging tools.\n     */\n    var testability = {};\n\n    /**\n     * @name $$testability#findBindings\n     *\n     * @description\n     * Returns an array of elements that are bound (via ng-bind or {{}})\n     * to expressions matching the input.\n     *\n     * @param {Element} element The element root to search from.\n     * @param {string} expression The binding expression to match.\n     * @param {boolean} opt_exactMatch If true, only returns exact matches\n     *     for the expression. Filters and whitespace are ignored.\n     */\n    testability.findBindings = function(element, expression, opt_exactMatch) {\n      var bindings = element.getElementsByClassName('ng-binding');\n      var matches = [];\n      forEach(bindings, function(binding) {\n        var dataBinding = angular.element(binding).data('$binding');\n        if (dataBinding) {\n          forEach(dataBinding, function(bindingName) {\n            if (opt_exactMatch) {\n              var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n              if (matcher.test(bindingName)) {\n                matches.push(binding);\n              }\n            } else {\n              if (bindingName.indexOf(expression) != -1) {\n                matches.push(binding);\n              }\n            }\n          });\n        }\n      });\n      return matches;\n    };\n\n    /**\n     * @name $$testability#findModels\n     *\n     * @description\n     * Returns an array of elements that are two-way found via ng-model to\n     * expressions matching the input.\n     *\n     * @param {Element} element The element root to search from.\n     * @param {string} expression The model expression to match.\n     * @param {boolean} opt_exactMatch If true, only returns exact matches\n     *     for the expression.\n     */\n    testability.findModels = function(element, expression, opt_exactMatch) {\n      var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n      for (var p = 0; p < prefixes.length; ++p) {\n        var attributeEquals = opt_exactMatch ? '=' : '*=';\n        var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n        var elements = element.querySelectorAll(selector);\n        if (elements.length) {\n          return elements;\n        }\n      }\n    };\n\n    /**\n     * @name $$testability#getLocation\n     *\n     * @description\n     * Shortcut for getting the location in a browser agnostic way. Returns\n     *     the path, search, and hash. (e.g. /path?a=b#hash)\n     */\n    testability.getLocation = function() {\n      return $location.url();\n    };\n\n    /**\n     * @name $$testability#setLocation\n     *\n     * @description\n     * Shortcut for navigating to a location without doing a full page reload.\n     *\n     * @param {string} url The location url (path, search and hash,\n     *     e.g. /path?a=b#hash) to go to.\n     */\n    testability.setLocation = function(url) {\n      if (url !== $location.url()) {\n        $location.url(url);\n        $rootScope.$digest();\n      }\n    };\n\n    /**\n     * @name $$testability#whenStable\n     *\n     * @description\n     * Calls the callback when $timeout and $http requests are completed.\n     *\n     * @param {function} callback\n     */\n    testability.whenStable = function(callback) {\n      $browser.notifyWhenNoOutstandingRequests(callback);\n    };\n\n    return testability;\n  }];\n}\n\nfunction $TimeoutProvider() {\n  this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n       function($rootScope,   $browser,   $q,   $$q,   $exceptionHandler) {\n    var deferreds = {};\n\n\n     /**\n      * @ngdoc service\n      * @name $timeout\n      *\n      * @description\n      * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n      * block and delegates any exceptions to\n      * {@link ng.$exceptionHandler $exceptionHandler} service.\n      *\n      * The return value of registering a timeout function is a promise, which will be resolved when\n      * the timeout is reached and the timeout function is executed.\n      *\n      * To cancel a timeout request, call `$timeout.cancel(promise)`.\n      *\n      * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n      * synchronously flush the queue of deferred functions.\n      *\n      * @param {function()} fn A function, whose execution should be delayed.\n      * @param {number=} [delay=0] Delay in milliseconds.\n      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n      * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this\n      *   promise will be resolved with is the return value of the `fn` function.\n      *\n      */\n    function timeout(fn, delay, invokeApply) {\n      var skipApply = (isDefined(invokeApply) && !invokeApply),\n          deferred = (skipApply ? $$q : $q).defer(),\n          promise = deferred.promise,\n          timeoutId;\n\n      timeoutId = $browser.defer(function() {\n        try {\n          deferred.resolve(fn());\n        } catch (e) {\n          deferred.reject(e);\n          $exceptionHandler(e);\n        }\n        finally {\n          delete deferreds[promise.$$timeoutId];\n        }\n\n        if (!skipApply) $rootScope.$apply();\n      }, delay);\n\n      promise.$$timeoutId = timeoutId;\n      deferreds[timeoutId] = deferred;\n\n      return promise;\n    }\n\n\n     /**\n      * @ngdoc method\n      * @name $timeout#cancel\n      *\n      * @description\n      * Cancels a task associated with the `promise`. As a result of this, the promise will be\n      * resolved with a rejection.\n      *\n      * @param {Promise=} promise Promise returned by the `$timeout` function.\n      * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n      *   canceled.\n      */\n    timeout.cancel = function(promise) {\n      if (promise && promise.$$timeoutId in deferreds) {\n        deferreds[promise.$$timeoutId].reject('canceled');\n        delete deferreds[promise.$$timeoutId];\n        return $browser.defer.cancel(promise.$$timeoutId);\n      }\n      return false;\n    };\n\n    return timeout;\n  }];\n}\n\n// NOTE:  The usage of window and document instead of $window and $document here is\n// deliberate.  This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests.  In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here.  There is little value is mocking these out for this\n// service.\nvar urlParsingNode = document.createElement(\"a\");\nvar originUrl = urlResolve(window.location.href);\n\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL.  Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL.  This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc.  See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers.  However, the parsed components will not be set if the URL assigned did not specify\n * them.  (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.)  We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again.  This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node.  (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729)  However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n *   http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n *   http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *   http://url.spec.whatwg.org/#urlutils\n *   https://github.com/angular/angular.js/pull/2902\n *   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n *   | member name   | Description    |\n *   |---------------|----------------|\n *   | href          | A normalized version of the provided URL if it was not an absolute URL |\n *   | protocol      | The protocol including the trailing colon                              |\n *   | host          | The host and port (if the port is non-default) of the normalizedUrl    |\n *   | search        | The search params, minus the question mark                             |\n *   | hash          | The hash string, minus the hash symbol\n *   | hostname      | The hostname\n *   | port          | The port, without \":\"\n *   | pathname      | The pathname, beginning with \"/\"\n *\n */\nfunction urlResolve(url) {\n  var href = url;\n\n  if (msie) {\n    // Normalize before parse.  Refer Implementation Notes on why this is\n    // done in two steps on IE.\n    urlParsingNode.setAttribute(\"href\", href);\n    href = urlParsingNode.href;\n  }\n\n  urlParsingNode.setAttribute('href', href);\n\n  // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n  return {\n    href: urlParsingNode.href,\n    protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n    host: urlParsingNode.host,\n    search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n    hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n    hostname: urlParsingNode.hostname,\n    port: urlParsingNode.port,\n    pathname: (urlParsingNode.pathname.charAt(0) === '/')\n      ? urlParsingNode.pathname\n      : '/' + urlParsingNode.pathname\n  };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n  var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n  return (parsed.protocol === originUrl.protocol &&\n          parsed.host === originUrl.host);\n}\n\n/**\n * @ngdoc service\n * @name $window\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In angular we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope.  Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n   <example module=\"windowExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('windowExample', [])\n           .controller('ExampleController', ['$scope', '$window', function($scope, $window) {\n             $scope.greeting = 'Hello, World!';\n             $scope.doGreeting = function(greeting) {\n               $window.alert(greeting);\n             };\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input type=\"text\" ng-model=\"greeting\" />\n         <button ng-click=\"doGreeting(greeting)\">ALERT</button>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n      it('should display the greeting in the input box', function() {\n       element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n       // If we click the button it will block the test runner\n       // element(':button').click();\n      });\n     </file>\n   </example>\n */\nfunction $WindowProvider() {\n  this.$get = valueFn(window);\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n * ```js\n *   // Filter registration\n *   function MyModule($provide, $filterProvider) {\n *     // create a service to demonstrate injection (not always needed)\n *     $provide.value('greet', function(name){\n *       return 'Hello ' + name + '!';\n *     });\n *\n *     // register a filter factory which uses the\n *     // greet service to demonstrate DI.\n *     $filterProvider.register('greet', function(greet){\n *       // return the filter function which uses the greet service\n *       // to generate salutation\n *       return function(text) {\n *         // filters need to be forgiving so check input validity\n *         return text && greet(text) || text;\n *       };\n *     });\n *   }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n *   it('should be the same instance', inject(\n *     function($filterProvider) {\n *       $filterProvider.register('reverse', function(){\n *         return ...;\n *       });\n *     },\n *     function($filter, reverseFilter) {\n *       expect($filter('reverse')).toBe(reverseFilter);\n *     });\n * ```\n *\n *\n * For more information about how angular filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the Angular Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * The general syntax in templates is as follows:\n *\n *         {{ expression [| filter_name[:parameter_value] ... ] }}\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n   <example name=\"$filter\" module=\"filterExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"MainCtrl\">\n        <h3>{{ originalText }}</h3>\n        <h3>{{ filteredText }}</h3>\n       </div>\n     </file>\n\n     <file name=\"script.js\">\n      angular.module('filterExample', [])\n      .controller('MainCtrl', function($scope, $filter) {\n        $scope.originalText = 'hello';\n        $scope.filteredText = $filter('uppercase')($scope.originalText);\n      });\n     </file>\n   </example>\n  */\n$FilterProvider.$inject = ['$provide'];\nfunction $FilterProvider($provide) {\n  var suffix = 'Filter';\n\n  /**\n   * @ngdoc method\n   * @name $filterProvider#register\n   * @param {string|Object} name Name of the filter function, or an object map of filters where\n   *    the keys are the filter names and the values are the filter factories.\n   * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n   *    of the registered filter instances.\n   */\n  function register(name, factory) {\n    if (isObject(name)) {\n      var filters = {};\n      forEach(name, function(filter, key) {\n        filters[key] = register(key, filter);\n      });\n      return filters;\n    } else {\n      return $provide.factory(name + suffix, factory);\n    }\n  }\n  this.register = register;\n\n  this.$get = ['$injector', function($injector) {\n    return function(name) {\n      return $injector.get(name + suffix);\n    };\n  }];\n\n  ////////////////////////////////////////\n\n  /* global\n    currencyFilter: false,\n    dateFilter: false,\n    filterFilter: false,\n    jsonFilter: false,\n    limitToFilter: false,\n    lowercaseFilter: false,\n    numberFilter: false,\n    orderByFilter: false,\n    uppercaseFilter: false,\n  */\n\n  register('currency', currencyFilter);\n  register('date', dateFilter);\n  register('filter', filterFilter);\n  register('json', jsonFilter);\n  register('limitTo', limitToFilter);\n  register('lowercase', lowercaseFilter);\n  register('number', numberFilter);\n  register('orderBy', orderByFilter);\n  register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n *   `array`.\n *\n *   Can be one of:\n *\n *   - `string`: The string is used for matching against the contents of the `array`. All strings or\n *     objects with string properties in `array` that match this string will be returned. This also\n *     applies to nested object properties.\n *     The predicate can be negated by prefixing the string with `!`.\n *\n *   - `Object`: A pattern object can be used to filter specific properties on objects contained\n *     by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n *     which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n *     property name `$` can be used (as in `{$:\"text\"}`) to accept a match against any\n *     property of the object or its nested object properties. That's equivalent to the simple\n *     substring match with a `string` as described above. The predicate can be negated by prefixing\n *     the string with `!`.\n *     For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n *     not containing \"M\".\n *\n *     Note that a named property will match properties on the same level only, while the special\n *     `$` property will match properties on the same level or deeper. E.g. an array item like\n *     `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n *     **will** be matched by `{$: 'John'}`.\n *\n *   - `function(value, index)`: A predicate function can be used to write arbitrary filters. The\n *     function is called for each element of `array`. The final result is an array of those\n *     elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in\n *     determining if the expected value (from the filter expression) and actual value (from\n *     the object in the array) should be considered a match.\n *\n *   Can be one of:\n *\n *   - `function(actual, expected)`:\n *     The function will be given the object value and the predicate value to compare and\n *     should return true if both values should be considered equal.\n *\n *   - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n *     This is essentially strict comparison of expected and actual.\n *\n *   - `false|undefined`: A short hand for a function which will look for a substring match in case\n *     insensitive way.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <div ng-init=\"friends = [{name:'John', phone:'555-1276'},\n                                {name:'Mary', phone:'800-BIG-MARY'},\n                                {name:'Mike', phone:'555-4321'},\n                                {name:'Adam', phone:'555-5678'},\n                                {name:'Julie', phone:'555-8765'},\n                                {name:'Juliette', phone:'555-5678'}]\"></div>\n\n       Search: <input ng-model=\"searchText\">\n       <table id=\"searchTextResults\">\n         <tr><th>Name</th><th>Phone</th></tr>\n         <tr ng-repeat=\"friend in friends | filter:searchText\">\n           <td>{{friend.name}}</td>\n           <td>{{friend.phone}}</td>\n         </tr>\n       </table>\n       <hr>\n       Any: <input ng-model=\"search.$\"> <br>\n       Name only <input ng-model=\"search.name\"><br>\n       Phone only <input ng-model=\"search.phone\"><br>\n       Equality <input type=\"checkbox\" ng-model=\"strict\"><br>\n       <table id=\"searchObjResults\">\n         <tr><th>Name</th><th>Phone</th></tr>\n         <tr ng-repeat=\"friendObj in friends | filter:search:strict\">\n           <td>{{friendObj.name}}</td>\n           <td>{{friendObj.phone}}</td>\n         </tr>\n       </table>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var expectFriendNames = function(expectedNames, key) {\n         element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n           arr.forEach(function(wd, i) {\n             expect(wd.getText()).toMatch(expectedNames[i]);\n           });\n         });\n       };\n\n       it('should search across all fields when filtering with a string', function() {\n         var searchText = element(by.model('searchText'));\n         searchText.clear();\n         searchText.sendKeys('m');\n         expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n         searchText.clear();\n         searchText.sendKeys('76');\n         expectFriendNames(['John', 'Julie'], 'friend');\n       });\n\n       it('should search in specific fields when filtering with a predicate object', function() {\n         var searchAny = element(by.model('search.$'));\n         searchAny.clear();\n         searchAny.sendKeys('i');\n         expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n       });\n       it('should use a equal comparison when comparator is true', function() {\n         var searchName = element(by.model('search.name'));\n         var strict = element(by.model('strict'));\n         searchName.clear();\n         searchName.sendKeys('Julie');\n         strict.click();\n         expectFriendNames(['Julie'], 'friendObj');\n       });\n     </file>\n   </example>\n */\nfunction filterFilter() {\n  return function(array, expression, comparator) {\n    if (!isArray(array)) return array;\n\n    var predicateFn;\n    var matchAgainstAnyProp;\n\n    switch (typeof expression) {\n      case 'function':\n        predicateFn = expression;\n        break;\n      case 'boolean':\n      case 'number':\n      case 'string':\n        matchAgainstAnyProp = true;\n        //jshint -W086\n      case 'object':\n        //jshint +W086\n        predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);\n        break;\n      default:\n        return array;\n    }\n\n    return array.filter(predicateFn);\n  };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, matchAgainstAnyProp) {\n  var shouldMatchPrimitives = isObject(expression) && ('$' in expression);\n  var predicateFn;\n\n  if (comparator === true) {\n    comparator = equals;\n  } else if (!isFunction(comparator)) {\n    comparator = function(actual, expected) {\n      if (isObject(actual) || isObject(expected)) {\n        // Prevent an object to be considered equal to a string like `'[object'`\n        return false;\n      }\n\n      actual = lowercase('' + actual);\n      expected = lowercase('' + expected);\n      return actual.indexOf(expected) !== -1;\n    };\n  }\n\n  predicateFn = function(item) {\n    if (shouldMatchPrimitives && !isObject(item)) {\n      return deepCompare(item, expression.$, comparator, false);\n    }\n    return deepCompare(item, expression, comparator, matchAgainstAnyProp);\n  };\n\n  return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {\n  var actualType = typeof actual;\n  var expectedType = typeof expected;\n\n  if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n    return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);\n  } else if (isArray(actual)) {\n    // In case `actual` is an array, consider it a match\n    // if ANY of it's items matches `expected`\n    return actual.some(function(item) {\n      return deepCompare(item, expected, comparator, matchAgainstAnyProp);\n    });\n  }\n\n  switch (actualType) {\n    case 'object':\n      var key;\n      if (matchAgainstAnyProp) {\n        for (key in actual) {\n          if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {\n            return true;\n          }\n        }\n        return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);\n      } else if (expectedType === 'object') {\n        for (key in expected) {\n          var expectedVal = expected[key];\n          if (isFunction(expectedVal)) {\n            continue;\n          }\n\n          var matchAnyProperty = key === '$';\n          var actualVal = matchAnyProperty ? actual : actual[key];\n          if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {\n            return false;\n          }\n        }\n        return true;\n      } else {\n        return comparator(actual, expected);\n      }\n      break;\n    case 'function':\n      return false;\n    default:\n      return comparator(actual, expected);\n  }\n}\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n   <example module=\"currencyExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('currencyExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.amount = 1234.56;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input type=\"number\" ng-model=\"amount\"> <br>\n         default currency symbol ($): <span id=\"currency-default\">{{amount | currency}}</span><br>\n         custom currency identifier (USD$): <span id=\"currency-custom\">{{amount | currency:\"USD$\"}}</span>\n         no fractions (0): <span id=\"currency-no-fractions\">{{amount | currency:\"USD$\":0}}</span>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should init with 1234.56', function() {\n         expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n         expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n         expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n       });\n       it('should update', function() {\n         if (browser.params.browser == 'safari') {\n           // Safari does not understand the minus key. See\n           // https://github.com/angular/protractor/issues/481\n           return;\n         }\n         element(by.model('amount')).clear();\n         element(by.model('amount')).sendKeys('-1234');\n         expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)');\n         expect(element(by.id('currency-custom')).getText()).toBe('(USD$1,234.00)');\n         expect(element(by.id('currency-no-fractions')).getText()).toBe('(USD$1,234)');\n       });\n     </file>\n   </example>\n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n  var formats = $locale.NUMBER_FORMATS;\n  return function(amount, currencySymbol, fractionSize) {\n    if (isUndefined(currencySymbol)) {\n      currencySymbol = formats.CURRENCY_SYM;\n    }\n\n    if (isUndefined(fractionSize)) {\n      fractionSize = formats.PATTERNS[1].maxFrac;\n    }\n\n    // if null or undefined pass it through\n    return (amount == null)\n        ? amount\n        : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n            replace(/\\u00A4/g, currencySymbol);\n  };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is not a number an empty string is returned.\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.\n *\n * @example\n   <example module=\"numberFilterExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('numberFilterExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.val = 1234.56789;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Enter number: <input ng-model='val'><br>\n         Default formatting: <span id='number-default'>{{val | number}}</span><br>\n         No fractions: <span>{{val | number:0}}</span><br>\n         Negative number: <span>{{-val | number:4}}</span>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should format numbers', function() {\n         expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n         expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n         expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n       });\n\n       it('should update', function() {\n         element(by.model('val')).clear();\n         element(by.model('val')).sendKeys('3374.333');\n         expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n         expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n         expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n      });\n     </file>\n   </example>\n */\n\n\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n  var formats = $locale.NUMBER_FORMATS;\n  return function(number, fractionSize) {\n\n    // if null or undefined pass it through\n    return (number == null)\n        ? number\n        : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n                       fractionSize);\n  };\n}\n\nvar DECIMAL_SEP = '.';\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n  if (!isFinite(number) || isObject(number)) return '';\n\n  var isNegative = number < 0;\n  number = Math.abs(number);\n  var numStr = number + '',\n      formatedText = '',\n      parts = [];\n\n  var hasExponent = false;\n  if (numStr.indexOf('e') !== -1) {\n    var match = numStr.match(/([\\d\\.]+)e(-?)(\\d+)/);\n    if (match && match[2] == '-' && match[3] > fractionSize + 1) {\n      number = 0;\n    } else {\n      formatedText = numStr;\n      hasExponent = true;\n    }\n  }\n\n  if (!hasExponent) {\n    var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;\n\n    // determine fractionSize if it is not specified\n    if (isUndefined(fractionSize)) {\n      fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);\n    }\n\n    // safely round numbers in JS without hitting imprecisions of floating-point arithmetics\n    // inspired by:\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n    number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);\n\n    var fraction = ('' + number).split(DECIMAL_SEP);\n    var whole = fraction[0];\n    fraction = fraction[1] || '';\n\n    var i, pos = 0,\n        lgroup = pattern.lgSize,\n        group = pattern.gSize;\n\n    if (whole.length >= (lgroup + group)) {\n      pos = whole.length - lgroup;\n      for (i = 0; i < pos; i++) {\n        if ((pos - i) % group === 0 && i !== 0) {\n          formatedText += groupSep;\n        }\n        formatedText += whole.charAt(i);\n      }\n    }\n\n    for (i = pos; i < whole.length; i++) {\n      if ((whole.length - i) % lgroup === 0 && i !== 0) {\n        formatedText += groupSep;\n      }\n      formatedText += whole.charAt(i);\n    }\n\n    // format fraction part.\n    while (fraction.length < fractionSize) {\n      fraction += '0';\n    }\n\n    if (fractionSize && fractionSize !== \"0\") formatedText += decimalSep + fraction.substr(0, fractionSize);\n  } else {\n    if (fractionSize > 0 && number < 1) {\n      formatedText = number.toFixed(fractionSize);\n      number = parseFloat(formatedText);\n    }\n  }\n\n  if (number === 0) {\n    isNegative = false;\n  }\n\n  parts.push(isNegative ? pattern.negPre : pattern.posPre,\n             formatedText,\n             isNegative ? pattern.negSuf : pattern.posSuf);\n  return parts.join('');\n}\n\nfunction padNumber(num, digits, trim) {\n  var neg = '';\n  if (num < 0) {\n    neg =  '-';\n    num = -num;\n  }\n  num = '' + num;\n  while (num.length < digits) num = '0' + num;\n  if (trim)\n    num = num.substr(num.length - digits);\n  return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim) {\n  offset = offset || 0;\n  return function(date) {\n    var value = date['get' + name]();\n    if (offset > 0 || value > -offset)\n      value += offset;\n    if (value === 0 && offset == -12) value = 12;\n    return padNumber(value, size, trim);\n  };\n}\n\nfunction dateStrGetter(name, shortForm) {\n  return function(date, formats) {\n    var value = date['get' + name]();\n    var get = uppercase(shortForm ? ('SHORT' + name) : name);\n\n    return formats[get][value];\n  };\n}\n\nfunction timeZoneGetter(date) {\n  var zone = -1 * date.getTimezoneOffset();\n  var paddedZone = (zone >= 0) ? \"+\" : \"\";\n\n  paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n                padNumber(Math.abs(zone % 60), 2);\n\n  return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n    // 0 = index of January\n    var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n    // 4 = index of Thursday (+1 to account for 1st = 5)\n    // 11 = index of *next* Thursday (+1 account for 1st = 12)\n    return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n    return new Date(datetime.getFullYear(), datetime.getMonth(),\n      // 4 = index of Thursday\n      datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n   return function(date) {\n      var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n         thisThurs = getThursdayThisWeek(date);\n\n      var diff = +thisThurs - +firstThurs,\n         result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n      return padNumber(result, size);\n   };\n}\n\nfunction ampmGetter(date, formats) {\n  return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nvar DATE_FORMATS = {\n  yyyy: dateGetter('FullYear', 4),\n    yy: dateGetter('FullYear', 2, 0, true),\n     y: dateGetter('FullYear', 1),\n  MMMM: dateStrGetter('Month'),\n   MMM: dateStrGetter('Month', true),\n    MM: dateGetter('Month', 2, 1),\n     M: dateGetter('Month', 1, 1),\n    dd: dateGetter('Date', 2),\n     d: dateGetter('Date', 1),\n    HH: dateGetter('Hours', 2),\n     H: dateGetter('Hours', 1),\n    hh: dateGetter('Hours', 2, -12),\n     h: dateGetter('Hours', 1, -12),\n    mm: dateGetter('Minutes', 2),\n     m: dateGetter('Minutes', 1),\n    ss: dateGetter('Seconds', 2),\n     s: dateGetter('Seconds', 1),\n     // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n     // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n   sss: dateGetter('Milliseconds', 3),\n  EEEE: dateStrGetter('Day'),\n   EEE: dateStrGetter('Day', true),\n     a: ampmGetter,\n     Z: timeZoneGetter,\n    ww: weekGetter(2),\n     w: weekGetter(1)\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/,\n    NUMBER_STRING = /^\\-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n *   Formats `date` to a string based on the requested `format`.\n *\n *   `format` string can be composed of the following elements:\n *\n *   * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n *   * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n *   * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n *   * `'MMMM'`: Month in year (January-December)\n *   * `'MMM'`: Month in year (Jan-Dec)\n *   * `'MM'`: Month in year, padded (01-12)\n *   * `'M'`: Month in year (1-12)\n *   * `'dd'`: Day in month, padded (01-31)\n *   * `'d'`: Day in month (1-31)\n *   * `'EEEE'`: Day in Week,(Sunday-Saturday)\n *   * `'EEE'`: Day in Week, (Sun-Sat)\n *   * `'HH'`: Hour in day, padded (00-23)\n *   * `'H'`: Hour in day (0-23)\n *   * `'hh'`: Hour in AM/PM, padded (01-12)\n *   * `'h'`: Hour in AM/PM, (1-12)\n *   * `'mm'`: Minute in hour, padded (00-59)\n *   * `'m'`: Minute in hour (0-59)\n *   * `'ss'`: Second in minute, padded (00-59)\n *   * `'s'`: Second in minute (0-59)\n *   * `'sss'`: Millisecond in second, padded (000-999)\n *   * `'a'`: AM/PM marker\n *   * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n *   * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n *   * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n *\n *   `format` string can also be one of the following predefined\n *   {@link guide/i18n localizable formats}:\n *\n *   * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n *     (e.g. Sep 3, 2010 12:05:08 PM)\n *   * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US  locale (e.g. 9/3/10 12:05 PM)\n *   * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US  locale\n *     (e.g. Friday, September 3, 2010)\n *   * `'longDate'`: equivalent to `'MMMM d, y'` for en_US  locale (e.g. September 3, 2010)\n *   * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US  locale (e.g. Sep 3, 2010)\n *   * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n *   * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n *   * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n *   `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n *   `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n *   (e.g. `\"h 'o''clock'\"`).\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n *    number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n *    shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n *    specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n *    `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. Right now, only `'UTC'` is supported.\n *    If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:\n           <span>{{1288323623006 | date:'medium'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n          <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n          <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>\n       <span ng-non-bindable>{{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}</span>:\n          <span>{{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}</span><br>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should format date', function() {\n         expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n            toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n         expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n            toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} (\\-|\\+)?\\d{4}/);\n         expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n            toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n         expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n            toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n       });\n     </file>\n   </example>\n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n  var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n                     // 1        2       3         4          5          6          7          8  9     10      11\n  function jsonStringToDate(string) {\n    var match;\n    if (match = string.match(R_ISO8601_STR)) {\n      var date = new Date(0),\n          tzHour = 0,\n          tzMin  = 0,\n          dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n          timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n      if (match[9]) {\n        tzHour = int(match[9] + match[10]);\n        tzMin = int(match[9] + match[11]);\n      }\n      dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));\n      var h = int(match[4] || 0) - tzHour;\n      var m = int(match[5] || 0) - tzMin;\n      var s = int(match[6] || 0);\n      var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n      timeSetter.call(date, h, m, s, ms);\n      return date;\n    }\n    return string;\n  }\n\n\n  return function(date, format, timezone) {\n    var text = '',\n        parts = [],\n        fn, match;\n\n    format = format || 'mediumDate';\n    format = $locale.DATETIME_FORMATS[format] || format;\n    if (isString(date)) {\n      date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);\n    }\n\n    if (isNumber(date)) {\n      date = new Date(date);\n    }\n\n    if (!isDate(date)) {\n      return date;\n    }\n\n    while (format) {\n      match = DATE_FORMATS_SPLIT.exec(format);\n      if (match) {\n        parts = concat(parts, match, 1);\n        format = parts.pop();\n      } else {\n        parts.push(format);\n        format = null;\n      }\n    }\n\n    if (timezone && timezone === 'UTC') {\n      date = new Date(date.getTime());\n      date.setMinutes(date.getMinutes() + date.getTimezoneOffset());\n    }\n    forEach(parts, function(value) {\n      fn = DATE_FORMATS[value];\n      text += fn ? fn(date, $locale.DATETIME_FORMATS)\n                 : value.replace(/(^'|'$)/g, '').replace(/''/g, \"'\");\n    });\n\n    return text;\n  };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n *   Allows you to convert a JavaScript object into JSON string.\n *\n *   This filter is mostly useful for debugging. When using the double curly {{value}} notation\n *   the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <pre id=\"default-spacing\">{{ {'name':'value'} | json }}</pre>\n       <pre id=\"custom-spacing\">{{ {'name':'value'} | json:4 }}</pre>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should jsonify filtered objects', function() {\n         expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n  \"name\": ?\"value\"\\n}/);\n         expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n    \"name\": ?\"value\"\\n}/);\n       });\n     </file>\n   </example>\n *\n */\nfunction jsonFilter() {\n  return function(object, spacing) {\n    if (isUndefined(spacing)) {\n        spacing = 2;\n    }\n    return toJson(object, spacing);\n  };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @see angular.uppercase\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements\n * are taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. If a number is used as input, it is\n * converted to a string.\n *\n * @param {Array|string|number} input Source array, string or number to be limited.\n * @param {string|number} limit The length of the returned array or string. If the `limit` number\n *     is positive, `limit` number of items from the beginning of the source array/string are copied.\n *     If the number is negative, `limit` number  of items from the end of the source array/string\n *     are copied. The `limit` will be trimmed if it exceeds `array.length`\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array\n *     had less than `limit` elements.\n *\n * @example\n   <example module=\"limitToExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('limitToExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.numbers = [1,2,3,4,5,6,7,8,9];\n             $scope.letters = \"abcdefghi\";\n             $scope.longNumber = 2345432342;\n             $scope.numLimit = 3;\n             $scope.letterLimit = 3;\n             $scope.longNumberLimit = 3;\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Limit {{numbers}} to: <input type=\"number\" step=\"1\" ng-model=\"numLimit\">\n         <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>\n         Limit {{letters}} to: <input type=\"number\" step=\"1\" ng-model=\"letterLimit\">\n         <p>Output letters: {{ letters | limitTo:letterLimit }}</p>\n         Limit {{longNumber}} to: <input type=\"number\" step=\"1\" ng-model=\"longNumberLimit\">\n         <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var numLimitInput = element(by.model('numLimit'));\n       var letterLimitInput = element(by.model('letterLimit'));\n       var longNumberLimitInput = element(by.model('longNumberLimit'));\n       var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n       var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n       var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n       it('should limit the number array to first three items', function() {\n         expect(numLimitInput.getAttribute('value')).toBe('3');\n         expect(letterLimitInput.getAttribute('value')).toBe('3');\n         expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n         expect(limitedLetters.getText()).toEqual('Output letters: abc');\n         expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n       });\n\n       // There is a bug in safari and protractor that doesn't like the minus key\n       // it('should update the output when -3 is entered', function() {\n       //   numLimitInput.clear();\n       //   numLimitInput.sendKeys('-3');\n       //   letterLimitInput.clear();\n       //   letterLimitInput.sendKeys('-3');\n       //   longNumberLimitInput.clear();\n       //   longNumberLimitInput.sendKeys('-3');\n       //   expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n       //   expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n       //   expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n       // });\n\n       it('should not exceed the maximum size of input array', function() {\n         numLimitInput.clear();\n         numLimitInput.sendKeys('100');\n         letterLimitInput.clear();\n         letterLimitInput.sendKeys('100');\n         longNumberLimitInput.clear();\n         longNumberLimitInput.sendKeys('100');\n         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n         expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n         expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n       });\n     </file>\n   </example>\n*/\nfunction limitToFilter() {\n  return function(input, limit) {\n    if (isNumber(input)) input = input.toString();\n    if (!isArray(input) && !isString(input)) return input;\n\n    if (Math.abs(Number(limit)) === Infinity) {\n      limit = Number(limit);\n    } else {\n      limit = int(limit);\n    }\n\n    //NaN check on limit\n    if (limit) {\n      return limit > 0 ? input.slice(0, limit) : input.slice(limit);\n    } else {\n      return isString(input) ? \"\" : [];\n    }\n  };\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically\n * for strings and numerically for numbers. Note: if you notice numbers are not being sorted\n * correctly, make sure they are actually being saved as numbers and not strings.\n *\n * @param {Array} array The array to sort.\n * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be\n *    used by the comparator to determine the order of elements.\n *\n *    Can be one of:\n *\n *    - `function`: Getter function. The result of this function will be sorted using the\n *      `<`, `=`, `>` operator.\n *    - `string`: An Angular expression. The result of this expression is used to compare elements\n *      (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by\n *      3 first characters of a property called `name`). The result of a constant expression\n *      is interpreted as a property name to be used in comparisons (for example `\"special name\"`\n *      to sort object by the value of their `special name` property). An expression can be\n *      optionally prefixed with `+` or `-` to control ascending or descending sort order\n *      (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array\n *      element itself is used to compare where sorting.\n *    - `Array`: An array of function or string predicates. The first predicate in the array\n *      is used for sorting, but when two items are equivalent, the next predicate is used.\n *\n *    If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse Reverse the order of the array.\n * @returns {Array} Sorted copy of the source array.\n *\n * @example\n   <example module=\"orderByExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('orderByExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.friends =\n                 [{name:'John', phone:'555-1212', age:10},\n                  {name:'Mary', phone:'555-9876', age:19},\n                  {name:'Mike', phone:'555-4321', age:21},\n                  {name:'Adam', phone:'555-5678', age:35},\n                  {name:'Julie', phone:'555-8765', age:29}];\n             $scope.predicate = '-age';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>\n         <hr/>\n         [ <a href=\"\" ng-click=\"predicate=''\">unsorted</a> ]\n         <table class=\"friend\">\n           <tr>\n             <th><a href=\"\" ng-click=\"predicate = 'name'; reverse=false\">Name</a>\n                 (<a href=\"\" ng-click=\"predicate = '-name'; reverse=false\">^</a>)</th>\n             <th><a href=\"\" ng-click=\"predicate = 'phone'; reverse=!reverse\">Phone Number</a></th>\n             <th><a href=\"\" ng-click=\"predicate = 'age'; reverse=!reverse\">Age</a></th>\n           </tr>\n           <tr ng-repeat=\"friend in friends | orderBy:predicate:reverse\">\n             <td>{{friend.name}}</td>\n             <td>{{friend.phone}}</td>\n             <td>{{friend.age}}</td>\n           </tr>\n         </table>\n       </div>\n     </file>\n   </example>\n *\n * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the\n * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the\n * desired parameters.\n *\n * Example:\n *\n * @example\n  <example module=\"orderByExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <table class=\"friend\">\n          <tr>\n            <th><a href=\"\" ng-click=\"reverse=false;order('name', false)\">Name</a>\n              (<a href=\"\" ng-click=\"order('-name',false)\">^</a>)</th>\n            <th><a href=\"\" ng-click=\"reverse=!reverse;order('phone', reverse)\">Phone Number</a></th>\n            <th><a href=\"\" ng-click=\"reverse=!reverse;order('age',reverse)\">Age</a></th>\n          </tr>\n          <tr ng-repeat=\"friend in friends\">\n            <td>{{friend.name}}</td>\n            <td>{{friend.phone}}</td>\n            <td>{{friend.age}}</td>\n          </tr>\n        </table>\n      </div>\n    </file>\n\n    <file name=\"script.js\">\n      angular.module('orderByExample', [])\n        .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {\n          var orderBy = $filter('orderBy');\n          $scope.friends = [\n            { name: 'John',    phone: '555-1212',    age: 10 },\n            { name: 'Mary',    phone: '555-9876',    age: 19 },\n            { name: 'Mike',    phone: '555-4321',    age: 21 },\n            { name: 'Adam',    phone: '555-5678',    age: 35 },\n            { name: 'Julie',   phone: '555-8765',    age: 29 }\n          ];\n          $scope.order = function(predicate, reverse) {\n            $scope.friends = orderBy($scope.friends, predicate, reverse);\n          };\n          $scope.order('-age',false);\n        }]);\n    </file>\n</example>\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n  return function(array, sortPredicate, reverseOrder) {\n    if (!(isArrayLike(array))) return array;\n    sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate];\n    if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n    sortPredicate = sortPredicate.map(function(predicate) {\n      var descending = false, get = predicate || identity;\n      if (isString(predicate)) {\n        if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {\n          descending = predicate.charAt(0) == '-';\n          predicate = predicate.substring(1);\n        }\n        if (predicate === '') {\n          // Effectively no predicate was passed so we compare identity\n          return reverseComparator(compare, descending);\n        }\n        get = $parse(predicate);\n        if (get.constant) {\n          var key = get();\n          return reverseComparator(function(a, b) {\n            return compare(a[key], b[key]);\n          }, descending);\n        }\n      }\n      return reverseComparator(function(a, b) {\n        return compare(get(a),get(b));\n      }, descending);\n    });\n    return slice.call(array).sort(reverseComparator(comparator, reverseOrder));\n\n    function comparator(o1, o2) {\n      for (var i = 0; i < sortPredicate.length; i++) {\n        var comp = sortPredicate[i](o1, o2);\n        if (comp !== 0) return comp;\n      }\n      return 0;\n    }\n    function reverseComparator(comp, descending) {\n      return descending\n          ? function(a, b) {return comp(b,a);}\n          : comp;\n    }\n\n    function isPrimitive(value) {\n      switch (typeof value) {\n        case 'number': /* falls through */\n        case 'boolean': /* falls through */\n        case 'string':\n          return true;\n        default:\n          return false;\n      }\n    }\n\n    function objectToString(value) {\n      if (value === null) return 'null';\n      if (typeof value.valueOf === 'function') {\n        value = value.valueOf();\n        if (isPrimitive(value)) return value;\n      }\n      if (typeof value.toString === 'function') {\n        value = value.toString();\n        if (isPrimitive(value)) return value;\n      }\n      return '';\n    }\n\n    function compare(v1, v2) {\n      var t1 = typeof v1;\n      var t2 = typeof v2;\n      if (t1 === t2 && t1 === \"object\") {\n        v1 = objectToString(v1);\n        v2 = objectToString(v2);\n      }\n      if (t1 === t2) {\n        if (t1 === \"string\") {\n           v1 = v1.toLowerCase();\n           v2 = v2.toLowerCase();\n        }\n        if (v1 === v2) return 0;\n        return v1 < v2 ? -1 : 1;\n      } else {\n        return t1 < t2 ? -1 : 1;\n      }\n    }\n  };\n}\n\nfunction ngDirective(directive) {\n  if (isFunction(directive)) {\n    directive = {\n      link: directive\n    };\n  }\n  directive.restrict = directive.restrict || 'AC';\n  return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html A tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * This change permits the easy creation of action links with the `ngClick` directive\n * without changing the location or causing page reloads, e.g.:\n * `<a href=\"\" ng-click=\"list.addItem()\">Add Item</a>`\n */\nvar htmlAnchorDirective = valueFn({\n  restrict: 'E',\n  compile: function(element, attr) {\n    if (!attr.href && !attr.xlinkHref && !attr.name) {\n      return function(scope, element) {\n        // If the linked element is not an anchor tag anymore, do nothing\n        if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n        // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n        var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n                   'xlink:href' : 'href';\n        element.on('click', function(event) {\n          // if we have no href url, then don't navigate anywhere.\n          if (!element.attr(href)) {\n            event.preventDefault();\n          }\n        });\n      };\n    }\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * Angular has a chance to replace the `{{hash}}` markup with its\n * value. Until Angular replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * <a href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <a ng-href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n    <example>\n      <file name=\"index.html\">\n        <input ng-model=\"value\" /><br />\n        <a id=\"link-1\" href ng-click=\"value = 1\">link 1</a> (link, don't reload)<br />\n        <a id=\"link-2\" href=\"\" ng-click=\"value = 2\">link 2</a> (link, don't reload)<br />\n        <a id=\"link-3\" ng-href=\"/{{'123'}}\">link 3</a> (link, reload!)<br />\n        <a id=\"link-4\" href=\"\" name=\"xx\" ng-click=\"value = 4\">anchor</a> (link, don't reload)<br />\n        <a id=\"link-5\" name=\"xxx\" ng-click=\"value = 5\">anchor</a> (no link)<br />\n        <a id=\"link-6\" ng-href=\"{{value}}\">link</a> (link, change location)\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should execute ng-click but not reload when href without value', function() {\n          element(by.id('link-1')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n          expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click but not reload when href empty string', function() {\n          element(by.id('link-2')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n          expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click and change url when ng-href specified', function() {\n          expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n          element(by.id('link-3')).click();\n\n          // At this point, we navigate away from an Angular page, so we need\n          // to use browser.driver to get the base webdriver.\n\n          browser.wait(function() {\n            return browser.driver.getCurrentUrl().then(function(url) {\n              return url.match(/\\/123$/);\n            });\n          }, 5000, 'page should navigate to /123');\n        });\n\n        xit('should execute ng-click but not reload when href empty string and name specified', function() {\n          element(by.id('link-4')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n          expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n        });\n\n        it('should execute ng-click but not reload when no href but name specified', function() {\n          element(by.id('link-5')).click();\n          expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n          expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n        });\n\n        it('should only change url when only ng-href', function() {\n          element(by.model('value')).clear();\n          element(by.model('value')).sendKeys('6');\n          expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n          element(by.id('link-6')).click();\n\n          // At this point, we navigate away from an Angular page, so we need\n          // to use browser.driver to get the base webdriver.\n          browser.wait(function() {\n            return browser.driver.getCurrentUrl().then(function(url) {\n              return url.match(/\\/6$/);\n            });\n          }, 5000, 'page should navigate to /6');\n        });\n      </file>\n    </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-src=\"http://www.gravatar.com/avatar/{{hash}}\"/>\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\"/>\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:\n * ```html\n * <div ng-init=\"scope = { isDisabled: false }\">\n *  <button disabled=\"{{scope.isDisabled}}\">Disabled</button>\n * </div>\n * ```\n *\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as disabled. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngDisabled` directive solves this problem for the `disabled` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        Click me to toggle: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n        <button ng-model=\"button\" ng-disabled=\"checked\">Button</button>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should toggle button', function() {\n          expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n          element(by.model('checked')).click();\n          expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n *     then special attribute \"disabled\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as checked. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngChecked` directive solves this problem for the `checked` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to check both: <input type=\"checkbox\" ng-model=\"master\"><br/>\n        <input id=\"checkSlave\" type=\"checkbox\" ng-checked=\"master\">\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should check both checkBoxes', function() {\n          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();\n          element(by.model('master')).click();\n          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n *     then special attribute \"checked\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as readonly. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngReadonly` directive solves this problem for the `readonly` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to make text readonly: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n        <input type=\"text\" ng-readonly=\"checked\" value=\"I'm Angular\"/>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should toggle readonly attr', function() {\n          expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n          element(by.model('checked')).click();\n          expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n *     then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as selected. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngSelected` directive solves this problem for the `selected` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        Check me to select: <input type=\"checkbox\" ng-model=\"selected\"><br/>\n        <select>\n          <option>Hello!</option>\n          <option id=\"greet\" ng-selected=\"selected\">Greetings!</option>\n        </select>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should select Greetings!', function() {\n          expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n          element(by.model('selected')).click();\n          expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n        });\n      </file>\n    </example>\n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n *     then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n * The HTML specification does not require browsers to preserve the values of boolean attributes\n * such as open. (Their presence means true and their absence means false.)\n * If we put an Angular interpolation expression into such an attribute then the\n * binding information would be lost when the browser removes the attribute.\n * The `ngOpen` directive solves this problem for the `open` attribute.\n * This complementary directive is not removed by the browser and so provides\n * a permanent reliable place to store the binding information.\n * @example\n     <example>\n       <file name=\"index.html\">\n         Check me check multiple: <input type=\"checkbox\" ng-model=\"open\"><br/>\n         <details id=\"details\" ng-open=\"open\">\n            <summary>Show/Hide me</summary>\n         </details>\n       </file>\n       <file name=\"protractor.js\" type=\"protractor\">\n         it('should toggle open', function() {\n           expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n           element(by.model('open')).click();\n           expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n         });\n       </file>\n     </example>\n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n *     then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n  // binding to multiple is not supported\n  if (propName == \"multiple\") return;\n\n  var normalized = directiveNormalize('ng-' + attrName);\n  ngAttributeAliasDirectives[normalized] = function() {\n    return {\n      restrict: 'A',\n      priority: 100,\n      link: function(scope, element, attr) {\n        scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n          attr.$set(attrName, !!value);\n        });\n      }\n    };\n  };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n  ngAttributeAliasDirectives[ngAttr] = function() {\n    return {\n      priority: 100,\n      link: function(scope, element, attr) {\n        //special case ngPattern when a literal regular expression value\n        //is used as the expression (this way we don't have to watch anything).\n        if (ngAttr === \"ngPattern\" && attr.ngPattern.charAt(0) == \"/\") {\n          var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n          if (match) {\n            attr.$set(\"ngPattern\", new RegExp(match[1], match[2]));\n            return;\n          }\n        }\n\n        scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n          attr.$set(ngAttr, value);\n        });\n      }\n    };\n  };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n  var normalized = directiveNormalize('ng-' + attrName);\n  ngAttributeAliasDirectives[normalized] = function() {\n    return {\n      priority: 99, // it needs to run after the attributes are interpolated\n      link: function(scope, element, attr) {\n        var propName = attrName,\n            name = attrName;\n\n        if (attrName === 'href' &&\n            toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n          name = 'xlinkHref';\n          attr.$attr[name] = 'xlink:href';\n          propName = null;\n        }\n\n        attr.$observe(normalized, function(value) {\n          if (!value) {\n            if (attrName === 'href') {\n              attr.$set(name, null);\n            }\n            return;\n          }\n\n          attr.$set(name, value);\n\n          // on IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n          // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n          // to set the property as well to achieve the desired effect.\n          // we use attr[attrName] value since $set can sanitize the url.\n          if (msie && propName) element.prop(propName, attr[name]);\n        });\n      }\n    };\n  };\n});\n\n/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true\n */\nvar nullFormCtrl = {\n  $addControl: noop,\n  $$renameControl: nullFormRenameControl,\n  $removeControl: noop,\n  $setValidity: noop,\n  $setDirty: noop,\n  $setPristine: noop,\n  $setSubmitted: noop\n},\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n  control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $error Is an object hash, containing references to controls or\n *  forms with failing validators, where:\n *\n *  - keys are validation tokens (error names),\n *  - values are arrays of controls or forms that have a failing validator for given error name.\n *\n *  Built-in validation tokens:\n *\n *  - `email`\n *  - `max`\n *  - `maxlength`\n *  - `min`\n *  - `minlength`\n *  - `number`\n *  - `pattern`\n *  - `required`\n *  - `url`\n *  - `date`\n *  - `datetimelocal`\n *  - `time`\n *  - `week`\n *  - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController(element, attrs, $scope, $animate, $interpolate) {\n  var form = this,\n      controls = [];\n\n  var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl;\n\n  // init state\n  form.$error = {};\n  form.$$success = {};\n  form.$pending = undefined;\n  form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);\n  form.$dirty = false;\n  form.$pristine = true;\n  form.$valid = true;\n  form.$invalid = false;\n  form.$submitted = false;\n\n  parentForm.$addControl(form);\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$rollbackViewValue\n   *\n   * @description\n   * Rollback all form controls pending updates to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. This method is typically needed by the reset button of\n   * a form that uses `ng-model-options` to pend updates.\n   */\n  form.$rollbackViewValue = function() {\n    forEach(controls, function(control) {\n      control.$rollbackViewValue();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$commitViewValue\n   *\n   * @description\n   * Commit all form controls pending updates to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n   * usually handles calling this in response to input events.\n   */\n  form.$commitViewValue = function() {\n    forEach(controls, function(control) {\n      control.$commitViewValue();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$addControl\n   *\n   * @description\n   * Register a control with the form.\n   *\n   * Input elements using ngModelController do this automatically when they are linked.\n   */\n  form.$addControl = function(control) {\n    // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n    // and not added to the scope.  Now we throw an error.\n    assertNotHasOwnProperty(control.$name, 'input');\n    controls.push(control);\n\n    if (control.$name) {\n      form[control.$name] = control;\n    }\n  };\n\n  // Private API: rename a form control\n  form.$$renameControl = function(control, newName) {\n    var oldName = control.$name;\n\n    if (form[oldName] === control) {\n      delete form[oldName];\n    }\n    form[newName] = control;\n    control.$name = newName;\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$removeControl\n   *\n   * @description\n   * Deregister a control from the form.\n   *\n   * Input elements using ngModelController do this automatically when they are destroyed.\n   */\n  form.$removeControl = function(control) {\n    if (control.$name && form[control.$name] === control) {\n      delete form[control.$name];\n    }\n    forEach(form.$pending, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n    forEach(form.$error, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n    forEach(form.$$success, function(value, name) {\n      form.$setValidity(name, null, control);\n    });\n\n    arrayRemove(controls, control);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setValidity\n   *\n   * @description\n   * Sets the validity of a form control.\n   *\n   * This method will also propagate to parent forms.\n   */\n  addSetValidityMethod({\n    ctrl: this,\n    $element: element,\n    set: function(object, property, controller) {\n      var list = object[property];\n      if (!list) {\n        object[property] = [controller];\n      } else {\n        var index = list.indexOf(controller);\n        if (index === -1) {\n          list.push(controller);\n        }\n      }\n    },\n    unset: function(object, property, controller) {\n      var list = object[property];\n      if (!list) {\n        return;\n      }\n      arrayRemove(list, controller);\n      if (list.length === 0) {\n        delete object[property];\n      }\n    },\n    parentForm: parentForm,\n    $animate: $animate\n  });\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setDirty\n   *\n   * @description\n   * Sets the form to a dirty state.\n   *\n   * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n   * state (ng-dirty class). This method will also propagate to parent forms.\n   */\n  form.$setDirty = function() {\n    $animate.removeClass(element, PRISTINE_CLASS);\n    $animate.addClass(element, DIRTY_CLASS);\n    form.$dirty = true;\n    form.$pristine = false;\n    parentForm.$setDirty();\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setPristine\n   *\n   * @description\n   * Sets the form to its pristine state.\n   *\n   * This method can be called to remove the 'ng-dirty' class and set the form to its pristine\n   * state (ng-pristine class). This method will also propagate to all the controls contained\n   * in this form.\n   *\n   * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n   * saving or resetting it.\n   */\n  form.$setPristine = function() {\n    $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n    form.$dirty = false;\n    form.$pristine = true;\n    form.$submitted = false;\n    forEach(controls, function(control) {\n      control.$setPristine();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setUntouched\n   *\n   * @description\n   * Sets the form to its untouched state.\n   *\n   * This method can be called to remove the 'ng-touched' class and set the form controls to their\n   * untouched state (ng-untouched class).\n   *\n   * Setting a form controls back to their untouched state is often useful when setting the form\n   * back to its pristine state.\n   */\n  form.$setUntouched = function() {\n    forEach(controls, function(control) {\n      control.$setUntouched();\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name form.FormController#$setSubmitted\n   *\n   * @description\n   * Sets the form to its submitted state.\n   */\n  form.$setSubmitted = function() {\n    $animate.addClass(element, SUBMITTED_CLASS);\n    form.$submitted = true;\n    parentForm.$setSubmitted();\n  };\n}\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Nestable alias of {@link ng.directive:form `form`} directive. HTML\n * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a\n * sub-group of controls needs to be determined.\n *\n * Note: the purpose of `ngForm` is to group controls,\n * but not to be a replacement for the `<form>` tag with all of its capabilities\n * (e.g. posting to the server, ...).\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into\n *                       related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * # Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In Angular forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so\n * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to\n * `<form>` but can be nested.  This allows you to have nested forms, which is very useful when\n * using Angular validation directives in forms that are dynamically generated using the\n * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name`\n * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an\n * `ngForm` directive and nest these in an outer `form` element.\n *\n *\n * # CSS classes\n *  - `ng-valid` is set if the form is valid.\n *  - `ng-invalid` is set if the form is invalid.\n *  - `ng-pristine` is set if the form is pristine.\n *  - `ng-dirty` is set if the form is dirty.\n *  - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * # Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side Angular applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, Angular prevents the default action (form submission to the server) unless the\n * `<form>` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n  *  button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ## Animation Hooks\n *\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-form.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * </pre>\n *\n * @example\n    <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"formExample\">\n      <file name=\"index.html\">\n       <script>\n         angular.module('formExample', [])\n           .controller('FormController', ['$scope', function($scope) {\n             $scope.userType = 'guest';\n           }]);\n       </script>\n       <style>\n        .my-form {\n          -webkit-transition:all linear 0.5s;\n          transition:all linear 0.5s;\n          background: transparent;\n        }\n        .my-form.ng-invalid {\n          background: red;\n        }\n       </style>\n       <form name=\"myForm\" ng-controller=\"FormController\" class=\"my-form\">\n         userType: <input name=\"input\" ng-model=\"userType\" required>\n         <span class=\"error\" ng-show=\"myForm.input.$error.required\">Required!</span><br>\n         <tt>userType = {{userType}}</tt><br>\n         <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>\n         <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>\n         <tt>myForm.$valid = {{myForm.$valid}}</tt><br>\n         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>\n        </form>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should initialize to model', function() {\n          var userType = element(by.binding('userType'));\n          var valid = element(by.binding('myForm.input.$valid'));\n\n          expect(userType.getText()).toContain('guest');\n          expect(valid.getText()).toContain('true');\n        });\n\n        it('should be invalid if empty', function() {\n          var userType = element(by.binding('userType'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var userInput = element(by.model('userType'));\n\n          userInput.clear();\n          userInput.sendKeys('');\n\n          expect(userType.getText()).toEqual('userType =');\n          expect(valid.getText()).toContain('false');\n        });\n      </file>\n    </example>\n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n *                       related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n  return ['$timeout', function($timeout) {\n    var formDirective = {\n      name: 'form',\n      restrict: isNgForm ? 'EAC' : 'E',\n      controller: FormController,\n      compile: function ngFormCompile(formElement) {\n        // Setup initial state of the control\n        formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n        return {\n          pre: function ngFormPreLink(scope, formElement, attr, controller) {\n            // if `action` attr is not present on the form, prevent the default action (submission)\n            if (!('action' in attr)) {\n              // we can't use jq events because if a form is destroyed during submission the default\n              // action is not prevented. see #1238\n              //\n              // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n              // page reload if the form was destroyed by submission of the form via a click handler\n              // on a button in the form. Looks like an IE9 specific bug.\n              var handleFormSubmission = function(event) {\n                scope.$apply(function() {\n                  controller.$commitViewValue();\n                  controller.$setSubmitted();\n                });\n\n                event.preventDefault();\n              };\n\n              addEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n\n              // unregister the preventDefault listener so that we don't not leak memory but in a\n              // way that will achieve the prevention of the default action.\n              formElement.on('$destroy', function() {\n                $timeout(function() {\n                  removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n                }, 0, false);\n              });\n            }\n\n            var parentFormCtrl = controller.$$parentForm,\n                alias = controller.$name;\n\n            if (alias) {\n              setter(scope, null, alias, controller, alias);\n              attr.$observe(attr.name ? 'name' : 'ngForm', function(newValue) {\n                if (alias === newValue) return;\n                setter(scope, null, alias, undefined, alias);\n                alias = newValue;\n                setter(scope, null, alias, controller, alias);\n                parentFormCtrl.$$renameControl(controller, alias);\n              });\n            }\n            formElement.on('$destroy', function() {\n              parentFormCtrl.$removeControl(controller);\n              if (alias) {\n                setter(scope, null, alias, undefined, alias);\n              }\n              extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n            });\n          }\n        };\n      }\n    };\n\n    return formDirective;\n  }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n/* global VALID_CLASS: false,\n  INVALID_CLASS: false,\n  PRISTINE_CLASS: false,\n  DIRTY_CLASS: false,\n  UNTOUCHED_CLASS: false,\n  TOUCHED_CLASS: false,\n  $ngModelMinErr: false,\n*/\n\n// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar ISO_DATE_REGEXP = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/;\nvar URL_REGEXP = /^(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?$/;\nvar EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;\nvar NUMBER_REGEXP = /^\\s*(\\-|\\+)?(\\d+|(\\d*(\\.\\d*)))\\s*$/;\nvar DATE_REGEXP = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar inputType = {\n\n  /**\n   * @ngdoc input\n   * @name input[text]\n   *\n   * @description\n   * Standard HTML text input with angular data binding, inherited by most of the `input` elements.\n   *\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Adds `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n   *    This parameter is ignored for input[type=password] controls, which will never trim the\n   *    input.\n   *\n   * @example\n      <example name=\"text-input-directive\" module=\"textInputExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('textInputExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.example = {\n                 text: 'guest',\n                 word: /^\\s*\\w*\\s*$/\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Single word: <input type=\"text\" name=\"input\" ng-model=\"example.text\"\n                               ng-pattern=\"example.word\" required ng-trim=\"false\">\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.pattern\">\n             Single word only!</span>\n\n           <tt>text = {{example.text}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('example.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('example.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('guest');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if multi word', function() {\n            input.clear();\n            input.sendKeys('hello world');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'text': textInputType,\n\n    /**\n     * @ngdoc input\n     * @name input[date]\n     *\n     * @description\n     * Input with date validation and transformation. In browsers that do not yet support\n     * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n     * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n     * modern browsers do not yet support this input type, it is important to provide cues to users on the\n     * expected input format via a placeholder or label.\n     *\n     * The model must always be a Date object, otherwise Angular will throw an error.\n     * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n     *\n     * The timezone to be used to read/write the `Date` instance in the model can be defined using\n     * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n     *\n     * @param {string} ngModel Assignable angular expression to data-bind to.\n     * @param {string=} name Property name of the form under which the control is published.\n     * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n     * valid ISO date string (yyyy-MM-dd).\n     * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n     * a valid ISO date string (yyyy-MM-dd).\n     * @param {string=} required Sets `required` validation error key if the value is not entered.\n     * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n     *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n     *    `required` when you want to data-bind to the `required` attribute.\n     * @param {string=} ngChange Angular expression to be executed when input changes due to user\n     *    interaction with the input element.\n     *\n     * @example\n     <example name=\"date-input-directive\" module=\"dateInputExample\">\n     <file name=\"index.html\">\n       <script>\n          angular.module('dateInputExample', [])\n            .controller('DateController', ['$scope', function($scope) {\n              $scope.example = {\n                value: new Date(2013, 9, 22)\n              };\n            }]);\n       </script>\n       <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n          Pick a date in 2013:\n          <input type=\"date\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n              placeholder=\"yyyy-MM-dd\" min=\"2013-01-01\" max=\"2013-12-31\" required />\n          <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n              Required!</span>\n          <span class=\"error\" ng-show=\"myForm.input.$error.date\">\n              Not a valid date!</span>\n           <tt>value = {{example.value | date: \"yyyy-MM-dd\"}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n       </form>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n        var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n        var valid = element(by.binding('myForm.input.$valid'));\n        var input = element(by.model('example.value'));\n\n        // currently protractor/webdriver does not support\n        // sending keys to all known HTML5 input controls\n        // for various browsers (see https://github.com/angular/protractor/issues/562).\n        function setInput(val) {\n          // set the value of the element and force validation.\n          var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n          \"ipt.value = '\" + val + \"';\" +\n          \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n          browser.executeScript(scr);\n        }\n\n        it('should initialize to model', function() {\n          expect(value.getText()).toContain('2013-10-22');\n          expect(valid.getText()).toContain('myForm.input.$valid = true');\n        });\n\n        it('should be invalid if empty', function() {\n          setInput('');\n          expect(value.getText()).toEqual('value =');\n          expect(valid.getText()).toContain('myForm.input.$valid = false');\n        });\n\n        it('should be invalid if over max', function() {\n          setInput('2015-01-01');\n          expect(value.getText()).toContain('');\n          expect(valid.getText()).toContain('myForm.input.$valid = false');\n        });\n     </file>\n     </example>\n     */\n  'date': createDateInputType('date', DATE_REGEXP,\n         createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n         'yyyy-MM-dd'),\n\n   /**\n    * @ngdoc input\n    * @name input[datetime-local]\n    *\n    * @description\n    * Input with datetime validation and transformation. In browsers that do not yet support\n    * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n    * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n    *\n    * The model must always be a Date object, otherwise Angular will throw an error.\n    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n    *\n    * The timezone to be used to read/write the `Date` instance in the model can be defined using\n    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n    *\n    * @param {string} ngModel Assignable angular expression to data-bind to.\n    * @param {string=} name Property name of the form under which the control is published.\n    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n    * valid ISO datetime format (yyyy-MM-ddTHH:mm:ss).\n    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n    * a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss).\n    * @param {string=} required Sets `required` validation error key if the value is not entered.\n    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n    *    `required` when you want to data-bind to the `required` attribute.\n    * @param {string=} ngChange Angular expression to be executed when input changes due to user\n    *    interaction with the input element.\n    *\n    * @example\n    <example name=\"datetimelocal-input-directive\" module=\"dateExample\">\n    <file name=\"index.html\">\n      <script>\n        angular.module('dateExample', [])\n          .controller('DateController', ['$scope', function($scope) {\n            $scope.example = {\n              value: new Date(2010, 11, 28, 14, 57)\n            };\n          }]);\n      </script>\n      <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a date between in 2013:\n        <input type=\"datetime-local\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"yyyy-MM-ddTHH:mm:ss\" min=\"2001-01-01T00:00:00\" max=\"2013-12-31T00:00:00\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.datetimelocal\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2010-12-28T14:57:00');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-01-01T23:59:00');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n    </file>\n    </example>\n    */\n  'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n      createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n      'yyyy-MM-ddTHH:mm:ss.sss'),\n\n  /**\n   * @ngdoc input\n   * @name input[time]\n   *\n   * @description\n   * Input with time validation and transformation. In browsers that do not yet support\n   * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n   * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n   * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n   *\n   * The model must always be a Date object, otherwise Angular will throw an error.\n   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n   *\n   * The timezone to be used to read/write the `Date` instance in the model can be defined using\n   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n   * valid ISO time format (HH:mm:ss).\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be a\n   * valid ISO time format (HH:mm:ss).\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n   <example name=\"time-input-directive\" module=\"timeExample\">\n   <file name=\"index.html\">\n     <script>\n      angular.module('timeExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(1970, 0, 1, 14, 57, 0)\n          };\n        }]);\n     </script>\n     <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a between 8am and 5pm:\n        <input type=\"time\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"HH:mm:ss\" min=\"08:00:00\" max=\"17:00:00\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.time\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"HH:mm:ss\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n     </form>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('14:57:00');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('23:59:00');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n   </file>\n   </example>\n   */\n  'time': createDateInputType('time', TIME_REGEXP,\n      createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n     'HH:mm:ss.sss'),\n\n   /**\n    * @ngdoc input\n    * @name input[week]\n    *\n    * @description\n    * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n    * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n    * week format (yyyy-W##), for example: `2013-W02`.\n    *\n    * The model must always be a Date object, otherwise Angular will throw an error.\n    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n    *\n    * The timezone to be used to read/write the `Date` instance in the model can be defined using\n    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n    *\n    * @param {string} ngModel Assignable angular expression to data-bind to.\n    * @param {string=} name Property name of the form under which the control is published.\n    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n    * valid ISO week format (yyyy-W##).\n    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n    * a valid ISO week format (yyyy-W##).\n    * @param {string=} required Sets `required` validation error key if the value is not entered.\n    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n    *    `required` when you want to data-bind to the `required` attribute.\n    * @param {string=} ngChange Angular expression to be executed when input changes due to user\n    *    interaction with the input element.\n    *\n    * @example\n    <example name=\"week-input-directive\" module=\"weekExample\">\n    <file name=\"index.html\">\n      <script>\n      angular.module('weekExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(2013, 0, 3)\n          };\n        }]);\n      </script>\n      <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n        Pick a date between in 2013:\n        <input id=\"exampleInput\" type=\"week\" name=\"input\" ng-model=\"example.value\"\n            placeholder=\"YYYY-W##\" min=\"2012-W32\" max=\"2013-W52\" required />\n        <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n            Required!</span>\n        <span class=\"error\" ng-show=\"myForm.input.$error.week\">\n            Not a valid date!</span>\n        <tt>value = {{example.value | date: \"yyyy-Www\"}}</tt><br/>\n        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2013-W01');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-W01');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n    </file>\n    </example>\n    */\n  'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n  /**\n   * @ngdoc input\n   * @name input[month]\n   *\n   * @description\n   * Input with month validation and transformation. In browsers that do not yet support\n   * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n   * month format (yyyy-MM), for example: `2009-01`.\n   *\n   * The model must always be a Date object, otherwise Angular will throw an error.\n   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n   * If the model is not set to the first of the month, the next view to model update will set it\n   * to the first of the month.\n   *\n   * The timezone to be used to read/write the `Date` instance in the model can be defined using\n   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be\n   * a valid ISO month format (yyyy-MM).\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must\n   * be a valid ISO month format (yyyy-MM).\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n   <example name=\"month-input-directive\" module=\"monthExample\">\n   <file name=\"index.html\">\n     <script>\n      angular.module('monthExample', [])\n        .controller('DateController', ['$scope', function($scope) {\n          $scope.example = {\n            value: new Date(2013, 9, 1)\n          };\n        }]);\n     </script>\n     <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n       Pick a month in 2013:\n       <input id=\"exampleInput\" type=\"month\" name=\"input\" ng-model=\"example.value\"\n          placeholder=\"yyyy-MM\" min=\"2013-01\" max=\"2013-12\" required />\n       <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n          Required!</span>\n       <span class=\"error\" ng-show=\"myForm.input.$error.month\">\n          Not a valid month!</span>\n       <tt>value = {{example.value | date: \"yyyy-MM\"}}</tt><br/>\n       <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n       <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n       <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n       <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n     </form>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n      var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n      var valid = element(by.binding('myForm.input.$valid'));\n      var input = element(by.model('example.value'));\n\n      // currently protractor/webdriver does not support\n      // sending keys to all known HTML5 input controls\n      // for various browsers (https://github.com/angular/protractor/issues/562).\n      function setInput(val) {\n        // set the value of the element and force validation.\n        var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n        \"ipt.value = '\" + val + \"';\" +\n        \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n        browser.executeScript(scr);\n      }\n\n      it('should initialize to model', function() {\n        expect(value.getText()).toContain('2013-10');\n        expect(valid.getText()).toContain('myForm.input.$valid = true');\n      });\n\n      it('should be invalid if empty', function() {\n        setInput('');\n        expect(value.getText()).toEqual('value =');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n\n      it('should be invalid if over max', function() {\n        setInput('2015-01');\n        expect(value.getText()).toContain('');\n        expect(valid.getText()).toContain('myForm.input.$valid = false');\n      });\n   </file>\n   </example>\n   */\n  'month': createDateInputType('month', MONTH_REGEXP,\n     createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n     'yyyy-MM'),\n\n  /**\n   * @ngdoc input\n   * @name input[number]\n   *\n   * @description\n   * Text input with number validation and transformation. Sets the `number` validation\n   * error if not a valid number.\n   *\n   * The model must always be a number, otherwise Angular will throw an error.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"number-input-directive\" module=\"numberExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('numberExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.example = {\n                 value: 12\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Number: <input type=\"number\" name=\"input\" ng-model=\"example.value\"\n                          min=\"0\" max=\"99\" required>\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.number\">\n             Not valid number!</span>\n           <tt>value = {{example.value}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var value = element(by.binding('example.value'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('example.value'));\n\n          it('should initialize to model', function() {\n            expect(value.getText()).toContain('12');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n            expect(value.getText()).toEqual('value =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if over max', function() {\n            input.clear();\n            input.sendKeys('123');\n            expect(value.getText()).toEqual('value =');\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'number': numberInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[url]\n   *\n   * @description\n   * Text input with URL validation. Sets the `url` validation error key if the content is not a\n   * valid URL.\n   *\n   * <div class=\"alert alert-warning\">\n   * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n   * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n   * the built-in validators (see the {@link guide/forms Forms guide})\n   * </div>\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"url-input-directive\" module=\"urlExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('urlExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.url = {\n                 text: 'http://google.com'\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           URL: <input type=\"url\" name=\"input\" ng-model=\"url.text\" required>\n           <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n             Required!</span>\n           <span class=\"error\" ng-show=\"myForm.input.$error.url\">\n             Not valid url!</span>\n           <tt>text = {{url.text}}</tt><br/>\n           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n           <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('url.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('url.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('http://google.com');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if not url', function() {\n            input.clear();\n            input.sendKeys('box');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'url': urlInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[email]\n   *\n   * @description\n   * Text input with email validation. Sets the `email` validation error key if not a valid email\n   * address.\n   *\n   * <div class=\"alert alert-warning\">\n   * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n   * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can\n   * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})\n   * </div>\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} required Sets `required` validation error key if the value is not entered.\n   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n   *    `required` when you want to data-bind to the `required` attribute.\n   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n   *    minlength.\n   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n   *    any length.\n   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n   *    that contains the regular expression body that will be converted to a regular expression\n   *    as in the ngPattern directive.\n   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match\n   *    a RegExp found by evaluating the Angular expression given in the attribute value.\n   *    If the expression evaluates to a RegExp object then this is used directly.\n   *    If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`\n   *    characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"email-input-directive\" module=\"emailExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('emailExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.email = {\n                 text: 'me@example.com'\n               };\n             }]);\n         </script>\n           <form name=\"myForm\" ng-controller=\"ExampleController\">\n             Email: <input type=\"email\" name=\"input\" ng-model=\"email.text\" required>\n             <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n               Required!</span>\n             <span class=\"error\" ng-show=\"myForm.input.$error.email\">\n               Not valid email!</span>\n             <tt>text = {{email.text}}</tt><br/>\n             <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n             <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n             <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n             <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n             <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>\n           </form>\n         </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var text = element(by.binding('email.text'));\n          var valid = element(by.binding('myForm.input.$valid'));\n          var input = element(by.model('email.text'));\n\n          it('should initialize to model', function() {\n            expect(text.getText()).toContain('me@example.com');\n            expect(valid.getText()).toContain('true');\n          });\n\n          it('should be invalid if empty', function() {\n            input.clear();\n            input.sendKeys('');\n            expect(text.getText()).toEqual('text =');\n            expect(valid.getText()).toContain('false');\n          });\n\n          it('should be invalid if not email', function() {\n            input.clear();\n            input.sendKeys('xxx');\n\n            expect(valid.getText()).toContain('false');\n          });\n        </file>\n      </example>\n   */\n  'email': emailInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[radio]\n   *\n   * @description\n   * HTML radio button.\n   *\n   * @param {string} ngModel Assignable angular expression to data-bind to.\n   * @param {string} value The value to which the expression should be set when selected.\n   * @param {string=} name Property name of the form under which the control is published.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   * @param {string} ngValue Angular expression which sets the value to which the expression should\n   *    be set when selected.\n   *\n   * @example\n      <example name=\"radio-input-directive\" module=\"radioExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('radioExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.color = {\n                 name: 'blue'\n               };\n               $scope.specialValue = {\n                 \"id\": \"12345\",\n                 \"value\": \"green\"\n               };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           <input type=\"radio\" ng-model=\"color.name\" value=\"red\">  Red <br/>\n           <input type=\"radio\" ng-model=\"color.name\" ng-value=\"specialValue\"> Green <br/>\n           <input type=\"radio\" ng-model=\"color.name\" value=\"blue\"> Blue <br/>\n           <tt>color = {{color.name | json}}</tt><br/>\n          </form>\n          Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          it('should change state', function() {\n            var color = element(by.binding('color.name'));\n\n            expect(color.getText()).toContain('blue');\n\n            element.all(by.model('color.name')).get(0).click();\n\n            expect(color.getText()).toContain('red');\n          });\n        </file>\n      </example>\n   */\n  'radio': radioInputType,\n\n\n  /**\n   * @ngdoc input\n   * @name input[checkbox]\n   *\n   * @description\n   * HTML checkbox.\n   *\n   * @param {string} ngModel 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=} ngTrueValue The value to which the expression should be set when selected.\n   * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n   * @param {string=} ngChange Angular expression to be executed when input changes due to user\n   *    interaction with the input element.\n   *\n   * @example\n      <example name=\"checkbox-input-directive\" module=\"checkboxExample\">\n        <file name=\"index.html\">\n         <script>\n           angular.module('checkboxExample', [])\n             .controller('ExampleController', ['$scope', function($scope) {\n               $scope.checkboxModel = {\n                value1 : true,\n                value2 : 'YES'\n              };\n             }]);\n         </script>\n         <form name=\"myForm\" ng-controller=\"ExampleController\">\n           Value1: <input type=\"checkbox\" ng-model=\"checkboxModel.value1\"> <br/>\n           Value2: <input type=\"checkbox\" ng-model=\"checkboxModel.value2\"\n                          ng-true-value=\"'YES'\" ng-false-value=\"'NO'\"> <br/>\n           <tt>value1 = {{checkboxModel.value1}}</tt><br/>\n           <tt>value2 = {{checkboxModel.value2}}</tt><br/>\n          </form>\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          it('should change state', function() {\n            var value1 = element(by.binding('checkboxModel.value1'));\n            var value2 = element(by.binding('checkboxModel.value2'));\n\n            expect(value1.getText()).toContain('true');\n            expect(value2.getText()).toContain('YES');\n\n            element(by.model('checkboxModel.value1')).click();\n            element(by.model('checkboxModel.value2')).click();\n\n            expect(value1.getText()).toContain('false');\n            expect(value2.getText()).toContain('NO');\n          });\n        </file>\n      </example>\n   */\n  'checkbox': checkboxInputType,\n\n  'hidden': noop,\n  'button': noop,\n  'submit': noop,\n  'reset': noop,\n  'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n  ctrl.$formatters.push(function(value) {\n    return ctrl.$isEmpty(value) ? value : value.toString();\n  });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  var type = lowercase(element[0].type);\n\n  // In composition mode, users are still inputing intermediate text buffer,\n  // hold the listener until composition is done.\n  // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n  if (!$sniffer.android) {\n    var composing = false;\n\n    element.on('compositionstart', function(data) {\n      composing = true;\n    });\n\n    element.on('compositionend', function() {\n      composing = false;\n      listener();\n    });\n  }\n\n  var listener = function(ev) {\n    if (timeout) {\n      $browser.defer.cancel(timeout);\n      timeout = null;\n    }\n    if (composing) return;\n    var value = element.val(),\n        event = ev && ev.type;\n\n    // By default we will trim the value\n    // If the attribute ng-trim exists we will avoid trimming\n    // If input type is 'password', the value is never trimmed\n    if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n      value = trim(value);\n    }\n\n    // If a control is suffering from bad input (due to native validators), browsers discard its\n    // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n    // control's value is the same empty value twice in a row.\n    if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n      ctrl.$setViewValue(value, event);\n    }\n  };\n\n  // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n  // input event on backspace, delete or cut\n  if ($sniffer.hasEvent('input')) {\n    element.on('input', listener);\n  } else {\n    var timeout;\n\n    var deferListener = function(ev, input, origValue) {\n      if (!timeout) {\n        timeout = $browser.defer(function() {\n          timeout = null;\n          if (!input || input.value !== origValue) {\n            listener(ev);\n          }\n        });\n      }\n    };\n\n    element.on('keydown', function(event) {\n      var key = event.keyCode;\n\n      // ignore\n      //    command            modifiers                   arrows\n      if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n      deferListener(event, this, this.value);\n    });\n\n    // if user modifies input value using context menu in IE, we need \"paste\" and \"cut\" events to catch it\n    if ($sniffer.hasEvent('paste')) {\n      element.on('paste cut', deferListener);\n    }\n  }\n\n  // if user paste into input using mouse on older browser\n  // or form autocomplete on newer browser, we need \"change\" event to catch it\n  element.on('change', listener);\n\n  ctrl.$render = function() {\n    element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);\n  };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n  if (isDate(isoWeek)) {\n    return isoWeek;\n  }\n\n  if (isString(isoWeek)) {\n    WEEK_REGEXP.lastIndex = 0;\n    var parts = WEEK_REGEXP.exec(isoWeek);\n    if (parts) {\n      var year = +parts[1],\n          week = +parts[2],\n          hours = 0,\n          minutes = 0,\n          seconds = 0,\n          milliseconds = 0,\n          firstThurs = getFirstThursdayOfYear(year),\n          addDays = (week - 1) * 7;\n\n      if (existingDate) {\n        hours = existingDate.getHours();\n        minutes = existingDate.getMinutes();\n        seconds = existingDate.getSeconds();\n        milliseconds = existingDate.getMilliseconds();\n      }\n\n      return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n    }\n  }\n\n  return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n  return function(iso, date) {\n    var parts, map;\n\n    if (isDate(iso)) {\n      return iso;\n    }\n\n    if (isString(iso)) {\n      // When a date is JSON'ified to wraps itself inside of an extra\n      // set of double quotes. This makes the date parsing code unable\n      // to match the date string and parse it as a date.\n      if (iso.charAt(0) == '\"' && iso.charAt(iso.length - 1) == '\"') {\n        iso = iso.substring(1, iso.length - 1);\n      }\n      if (ISO_DATE_REGEXP.test(iso)) {\n        return new Date(iso);\n      }\n      regexp.lastIndex = 0;\n      parts = regexp.exec(iso);\n\n      if (parts) {\n        parts.shift();\n        if (date) {\n          map = {\n            yyyy: date.getFullYear(),\n            MM: date.getMonth() + 1,\n            dd: date.getDate(),\n            HH: date.getHours(),\n            mm: date.getMinutes(),\n            ss: date.getSeconds(),\n            sss: date.getMilliseconds() / 1000\n          };\n        } else {\n          map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n        }\n\n        forEach(parts, function(part, index) {\n          if (index < mapping.length) {\n            map[mapping[index]] = +part;\n          }\n        });\n        return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n      }\n    }\n\n    return NaN;\n  };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n  return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {\n    badInputChecker(scope, element, attr, ctrl);\n    baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n    var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;\n    var previousDate;\n\n    ctrl.$$parserName = type;\n    ctrl.$parsers.push(function(value) {\n      if (ctrl.$isEmpty(value)) return null;\n      if (regexp.test(value)) {\n        // Note: We cannot read ctrl.$modelValue, as there might be a different\n        // parser/formatter in the processing chain so that the model\n        // contains some different data format!\n        var parsedDate = parseDate(value, previousDate);\n        if (timezone === 'UTC') {\n          parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());\n        }\n        return parsedDate;\n      }\n      return undefined;\n    });\n\n    ctrl.$formatters.push(function(value) {\n      if (value && !isDate(value)) {\n        throw $ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n      }\n      if (isValidDate(value)) {\n        previousDate = value;\n        if (previousDate && timezone === 'UTC') {\n          var timezoneOffset = 60000 * previousDate.getTimezoneOffset();\n          previousDate = new Date(previousDate.getTime() + timezoneOffset);\n        }\n        return $filter('date')(value, format, timezone);\n      } else {\n        previousDate = null;\n        return '';\n      }\n    });\n\n    if (isDefined(attr.min) || attr.ngMin) {\n      var minVal;\n      ctrl.$validators.min = function(value) {\n        return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;\n      };\n      attr.$observe('min', function(val) {\n        minVal = parseObservedDateValue(val);\n        ctrl.$validate();\n      });\n    }\n\n    if (isDefined(attr.max) || attr.ngMax) {\n      var maxVal;\n      ctrl.$validators.max = function(value) {\n        return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;\n      };\n      attr.$observe('max', function(val) {\n        maxVal = parseObservedDateValue(val);\n        ctrl.$validate();\n      });\n    }\n\n    function isValidDate(value) {\n      // Invalid Date: getTime() returns NaN\n      return value && !(value.getTime && value.getTime() !== value.getTime());\n    }\n\n    function parseObservedDateValue(val) {\n      return isDefined(val) ? (isDate(val) ? val : parseDate(val)) : undefined;\n    }\n  };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl) {\n  var node = element[0];\n  var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n  if (nativeValidation) {\n    ctrl.$parsers.push(function(value) {\n      var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n      // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430):\n      // - also sets validity.badInput (should only be validity.typeMismatch).\n      // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)\n      // - can ignore this case as we can still read out the erroneous email...\n      return validity.badInput && !validity.typeMismatch ? undefined : value;\n    });\n  }\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  badInputChecker(scope, element, attr, ctrl);\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n  ctrl.$$parserName = 'number';\n  ctrl.$parsers.push(function(value) {\n    if (ctrl.$isEmpty(value))      return null;\n    if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n    return undefined;\n  });\n\n  ctrl.$formatters.push(function(value) {\n    if (!ctrl.$isEmpty(value)) {\n      if (!isNumber(value)) {\n        throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n      }\n      value = value.toString();\n    }\n    return value;\n  });\n\n  if (attr.min || attr.ngMin) {\n    var minVal;\n    ctrl.$validators.min = function(value) {\n      return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;\n    };\n\n    attr.$observe('min', function(val) {\n      if (isDefined(val) && !isNumber(val)) {\n        val = parseFloat(val, 10);\n      }\n      minVal = isNumber(val) && !isNaN(val) ? val : undefined;\n      // TODO(matsko): implement validateLater to reduce number of validations\n      ctrl.$validate();\n    });\n  }\n\n  if (attr.max || attr.ngMax) {\n    var maxVal;\n    ctrl.$validators.max = function(value) {\n      return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;\n    };\n\n    attr.$observe('max', function(val) {\n      if (isDefined(val) && !isNumber(val)) {\n        val = parseFloat(val, 10);\n      }\n      maxVal = isNumber(val) && !isNaN(val) ? val : undefined;\n      // TODO(matsko): implement validateLater to reduce number of validations\n      ctrl.$validate();\n    });\n  }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  // Note: no badInputChecker here by purpose as `url` is only a validation\n  // in browsers, i.e. we can always read out input.value even if it is not valid!\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n\n  ctrl.$$parserName = 'url';\n  ctrl.$validators.url = function(modelValue, viewValue) {\n    var value = modelValue || viewValue;\n    return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n  };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n  // Note: no badInputChecker here by purpose as `url` is only a validation\n  // in browsers, i.e. we can always read out input.value even if it is not valid!\n  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n  stringBasedInputType(ctrl);\n\n  ctrl.$$parserName = 'email';\n  ctrl.$validators.email = function(modelValue, viewValue) {\n    var value = modelValue || viewValue;\n    return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n  };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n  // make the name unique, if not defined\n  if (isUndefined(attr.name)) {\n    element.attr('name', nextUid());\n  }\n\n  var listener = function(ev) {\n    if (element[0].checked) {\n      ctrl.$setViewValue(attr.value, ev && ev.type);\n    }\n  };\n\n  element.on('click', listener);\n\n  ctrl.$render = function() {\n    var value = attr.value;\n    element[0].checked = (value == ctrl.$viewValue);\n  };\n\n  attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n  var parseFn;\n  if (isDefined(expression)) {\n    parseFn = $parse(expression);\n    if (!parseFn.constant) {\n      throw minErr('ngModel')('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n                                   '`{1}`.', name, expression);\n    }\n    return parseFn(context);\n  }\n  return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n  var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n  var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n  var listener = function(ev) {\n    ctrl.$setViewValue(element[0].checked, ev && ev.type);\n  };\n\n  element.on('click', listener);\n\n  ctrl.$render = function() {\n    element[0].checked = ctrl.$viewValue;\n  };\n\n  // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n  // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n  // it to a boolean.\n  ctrl.$isEmpty = function(value) {\n    return value === false;\n  };\n\n  ctrl.$formatters.push(function(value) {\n    return equals(value, trueValue);\n  });\n\n  ctrl.$parsers.push(function(value) {\n    return value ? trueValue : falseValue;\n  });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with angular data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n *    `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n *    minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n *    length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the\n *    RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for\n *    patterns defined as scope expressions.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n *    interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n */\n\n\n/**\n * @ngdoc directive\n * @name input\n * @restrict E\n *\n * @description\n * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,\n * input state control, and validation.\n * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Not every feature offered is available for all input types.\n * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {boolean=} ngRequired Sets `required` attribute if set to true\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n *    minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n *    length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the\n *    RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for\n *    patterns defined as scope expressions.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n *    interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n *    This parameter is ignored for input[type=password] controls, which will never trim the\n *    input.\n *\n * @example\n    <example name=\"input-directive\" module=\"inputExample\">\n      <file name=\"index.html\">\n       <script>\n          angular.module('inputExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.user = {name: 'guest', last: 'visitor'};\n            }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <form name=\"myForm\">\n           User name: <input type=\"text\" name=\"userName\" ng-model=\"user.name\" required>\n           <span class=\"error\" ng-show=\"myForm.userName.$error.required\">\n             Required!</span><br>\n           Last name: <input type=\"text\" name=\"lastName\" ng-model=\"user.last\"\n             ng-minlength=\"3\" ng-maxlength=\"10\">\n           <span class=\"error\" ng-show=\"myForm.lastName.$error.minlength\">\n             Too short!</span>\n           <span class=\"error\" ng-show=\"myForm.lastName.$error.maxlength\">\n             Too long!</span><br>\n         </form>\n         <hr>\n         <tt>user = {{user}}</tt><br/>\n         <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>\n         <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>\n         <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>\n         <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br>\n         <tt>myForm.$valid = {{myForm.$valid}}</tt><br>\n         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>\n         <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br>\n         <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br>\n       </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        var user = element(by.exactBinding('user'));\n        var userNameValid = element(by.binding('myForm.userName.$valid'));\n        var lastNameValid = element(by.binding('myForm.lastName.$valid'));\n        var lastNameError = element(by.binding('myForm.lastName.$error'));\n        var formValid = element(by.binding('myForm.$valid'));\n        var userNameInput = element(by.model('user.name'));\n        var userLastInput = element(by.model('user.last'));\n\n        it('should initialize to model', function() {\n          expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"visitor\"}');\n          expect(userNameValid.getText()).toContain('true');\n          expect(formValid.getText()).toContain('true');\n        });\n\n        it('should be invalid if empty when required', function() {\n          userNameInput.clear();\n          userNameInput.sendKeys('');\n\n          expect(user.getText()).toContain('{\"last\":\"visitor\"}');\n          expect(userNameValid.getText()).toContain('false');\n          expect(formValid.getText()).toContain('false');\n        });\n\n        it('should be valid if empty when min length is set', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"\"}');\n          expect(lastNameValid.getText()).toContain('true');\n          expect(formValid.getText()).toContain('true');\n        });\n\n        it('should be invalid if less than required min length', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('xx');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\"}');\n          expect(lastNameValid.getText()).toContain('false');\n          expect(lastNameError.getText()).toContain('minlength');\n          expect(formValid.getText()).toContain('false');\n        });\n\n        it('should be invalid if longer than max length', function() {\n          userLastInput.clear();\n          userLastInput.sendKeys('some ridiculously long name');\n\n          expect(user.getText()).toContain('{\"name\":\"guest\"}');\n          expect(lastNameValid.getText()).toContain('false');\n          expect(lastNameError.getText()).toContain('maxlength');\n          expect(formValid.getText()).toContain('false');\n        });\n      </file>\n    </example>\n */\nvar inputDirective = ['$browser', '$sniffer', '$filter', '$parse',\n    function($browser, $sniffer, $filter, $parse) {\n  return {\n    restrict: 'E',\n    require: ['?ngModel'],\n    link: {\n      pre: function(scope, element, attr, ctrls) {\n        if (ctrls[0]) {\n          (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,\n                                                              $browser, $filter, $parse);\n        }\n      }\n    }\n  };\n}];\n\n\n\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ngValue\n *\n * @description\n * Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},\n * so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to\n * the bound value.\n *\n * `ngValue` is useful when dynamically generating lists of radio buttons using\n * {@link ngRepeat `ngRepeat`}, as shown below.\n *\n * Likewise, `ngValue` can be used to generate `<option>` elements for\n * the {@link select `select`} element. In that case however, only strings are supported\n * for the `value `attribute, so the resulting `ngModel` will always be a string.\n * Support for `select` models with non-string values is available via `ngOptions`.\n *\n * @element input\n * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute\n *   of the `input` element\n *\n * @example\n    <example name=\"ngValue-directive\" module=\"valueExample\">\n      <file name=\"index.html\">\n       <script>\n          angular.module('valueExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.names = ['pizza', 'unicorns', 'robots'];\n              $scope.my = { favorite: 'unicorns' };\n            }]);\n       </script>\n        <form ng-controller=\"ExampleController\">\n          <h2>Which is your favorite?</h2>\n            <label ng-repeat=\"name in names\" for=\"{{name}}\">\n              {{name}}\n              <input type=\"radio\"\n                     ng-model=\"my.favorite\"\n                     ng-value=\"name\"\n                     id=\"{{name}}\"\n                     name=\"favorite\">\n            </label>\n          <div>You chose {{my.favorite}}</div>\n        </form>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        var favorite = element(by.binding('my.favorite'));\n\n        it('should initialize to model', function() {\n          expect(favorite.getText()).toContain('unicorns');\n        });\n        it('should bind the values to the inputs', function() {\n          element.all(by.model('my.favorite')).get(0).click();\n          expect(favorite.getText()).toContain('pizza');\n        });\n      </file>\n    </example>\n */\nvar ngValueDirective = function() {\n  return {\n    restrict: 'A',\n    priority: 100,\n    compile: function(tpl, tplAttr) {\n      if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {\n        return function ngValueConstantLink(scope, elm, attr) {\n          attr.$set('value', scope.$eval(attr.ngValue));\n        };\n      } else {\n        return function ngValueLink(scope, elm, attr) {\n          scope.$watch(attr.ngValue, function valueWatchAction(value) {\n            attr.$set('value', value);\n          });\n        };\n      }\n    }\n  };\n};\n\n/**\n * @ngdoc directive\n * @name ngBind\n * @restrict AC\n *\n * @description\n * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element\n * with the value of a given expression, and to update the text content when the value of that\n * expression changes.\n *\n * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like\n * `{{ expression }}` which is similar but less verbose.\n *\n * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily\n * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an\n * element attribute, it makes the bindings invisible to the user while the page is loading.\n *\n * An alternative solution to this problem would be using the\n * {@link ng.directive:ngCloak ngCloak} directive.\n *\n *\n * @element ANY\n * @param {expression} ngBind {@link guide/expression Expression} to evaluate.\n *\n * @example\n * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.\n   <example module=\"bindExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('bindExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.name = 'Whirled';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         Enter name: <input type=\"text\" ng-model=\"name\"><br>\n         Hello <span ng-bind=\"name\"></span>!\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind', function() {\n         var nameInput = element(by.model('name'));\n\n         expect(element(by.binding('name')).getText()).toBe('Whirled');\n         nameInput.clear();\n         nameInput.sendKeys('world');\n         expect(element(by.binding('name')).getText()).toBe('world');\n       });\n     </file>\n   </example>\n */\nvar ngBindDirective = ['$compile', function($compile) {\n  return {\n    restrict: 'AC',\n    compile: function ngBindCompile(templateElement) {\n      $compile.$$addBindingClass(templateElement);\n      return function ngBindLink(scope, element, attr) {\n        $compile.$$addBindingInfo(element, attr.ngBind);\n        element = element[0];\n        scope.$watch(attr.ngBind, function ngBindWatchAction(value) {\n          element.textContent = value === undefined ? '' : value;\n        });\n      };\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindTemplate\n *\n * @description\n * The `ngBindTemplate` directive specifies that the element\n * text content should be replaced with the interpolation of the template\n * in the `ngBindTemplate` attribute.\n * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`\n * expressions. This directive is needed since some HTML elements\n * (such as TITLE and OPTION) cannot contain SPAN elements.\n *\n * @element ANY\n * @param {string} ngBindTemplate template of form\n *   <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.\n *\n * @example\n * Try it here: enter text in text box and watch the greeting change.\n   <example module=\"bindExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('bindExample', [])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.salutation = 'Hello';\n             $scope.name = 'World';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n        Salutation: <input type=\"text\" ng-model=\"salutation\"><br>\n        Name: <input type=\"text\" ng-model=\"name\"><br>\n        <pre ng-bind-template=\"{{salutation}} {{name}}!\"></pre>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind', function() {\n         var salutationElem = element(by.binding('salutation'));\n         var salutationInput = element(by.model('salutation'));\n         var nameInput = element(by.model('name'));\n\n         expect(salutationElem.getText()).toBe('Hello World!');\n\n         salutationInput.clear();\n         salutationInput.sendKeys('Greetings');\n         nameInput.clear();\n         nameInput.sendKeys('user');\n\n         expect(salutationElem.getText()).toBe('Greetings user!');\n       });\n     </file>\n   </example>\n */\nvar ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {\n  return {\n    compile: function ngBindTemplateCompile(templateElement) {\n      $compile.$$addBindingClass(templateElement);\n      return function ngBindTemplateLink(scope, element, attr) {\n        var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));\n        $compile.$$addBindingInfo(element, interpolateFn.expressions);\n        element = element[0];\n        attr.$observe('ngBindTemplate', function(value) {\n          element.textContent = value === undefined ? '' : value;\n        });\n      };\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindHtml\n *\n * @description\n * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,\n * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.\n * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link\n * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}\n * in your module's dependencies, you need to include \"angular-sanitize.js\" in your application.\n *\n * You may also bypass sanitization for values you know are safe. To do so, bind to\n * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}.  See the example\n * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.\n *\n * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you\n * will have an exception (instead of an exploit.)\n *\n * @element ANY\n * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.\n *\n * @example\n\n   <example module=\"bindHtmlExample\" deps=\"angular-sanitize.js\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n        <p ng-bind-html=\"myHTML\"></p>\n       </div>\n     </file>\n\n     <file name=\"script.js\">\n       angular.module('bindHtmlExample', ['ngSanitize'])\n         .controller('ExampleController', ['$scope', function($scope) {\n           $scope.myHTML =\n              'I am an <code>HTML</code>string with ' +\n              '<a href=\"#\">links!</a> and other <em>stuff</em>';\n         }]);\n     </file>\n\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-bind-html', function() {\n         expect(element(by.binding('myHTML')).getText()).toBe(\n             'I am an HTMLstring with links! and other stuff');\n       });\n     </file>\n   </example>\n */\nvar ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {\n  return {\n    restrict: 'A',\n    compile: function ngBindHtmlCompile(tElement, tAttrs) {\n      var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);\n      var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function getStringValue(value) {\n        return (value || '').toString();\n      });\n      $compile.$$addBindingClass(tElement);\n\n      return function ngBindHtmlLink(scope, element, attr) {\n        $compile.$$addBindingInfo(element, attr.ngBindHtml);\n\n        scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {\n          // we re-evaluate the expr because we want a TrustedValueHolderType\n          // for $sce, not a string\n          element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');\n        });\n      };\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngChange\n *\n * @description\n * Evaluate the given expression when the user changes the input.\n * The expression is evaluated immediately, unlike the JavaScript onchange event\n * which only triggers at the end of a change (usually, when the user leaves the\n * form element or presses the return key).\n *\n * The `ngChange` expression is only evaluated when a change in the input value causes\n * a new value to be committed to the model.\n *\n * It will not be evaluated:\n * * if the value returned from the `$parsers` transformation pipeline has not changed\n * * if the input has continued to be invalid since the model will stay `null`\n * * if the model is changed programmatically and not by a change to the input value\n *\n *\n * Note, this directive requires `ngModel` to be present.\n *\n * @element input\n * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change\n * in input value.\n *\n * @example\n * <example name=\"ngChange-directive\" module=\"changeExample\">\n *   <file name=\"index.html\">\n *     <script>\n *       angular.module('changeExample', [])\n *         .controller('ExampleController', ['$scope', function($scope) {\n *           $scope.counter = 0;\n *           $scope.change = function() {\n *             $scope.counter++;\n *           };\n *         }]);\n *     </script>\n *     <div ng-controller=\"ExampleController\">\n *       <input type=\"checkbox\" ng-model=\"confirmed\" ng-change=\"change()\" id=\"ng-change-example1\" />\n *       <input type=\"checkbox\" ng-model=\"confirmed\" id=\"ng-change-example2\" />\n *       <label for=\"ng-change-example2\">Confirmed</label><br />\n *       <tt>debug = {{confirmed}}</tt><br/>\n *       <tt>counter = {{counter}}</tt><br/>\n *     </div>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     var counter = element(by.binding('counter'));\n *     var debug = element(by.binding('confirmed'));\n *\n *     it('should evaluate the expression if changing from view', function() {\n *       expect(counter.getText()).toContain('0');\n *\n *       element(by.id('ng-change-example1')).click();\n *\n *       expect(counter.getText()).toContain('1');\n *       expect(debug.getText()).toContain('true');\n *     });\n *\n *     it('should not evaluate the expression if changing from model', function() {\n *       element(by.id('ng-change-example2')).click();\n\n *       expect(counter.getText()).toContain('0');\n *       expect(debug.getText()).toContain('true');\n *     });\n *   </file>\n * </example>\n */\nvar ngChangeDirective = valueFn({\n  restrict: 'A',\n  require: 'ngModel',\n  link: function(scope, element, attr, ctrl) {\n    ctrl.$viewChangeListeners.push(function() {\n      scope.$eval(attr.ngChange);\n    });\n  }\n});\n\nfunction classDirective(name, selector) {\n  name = 'ngClass' + name;\n  return ['$animate', function($animate) {\n    return {\n      restrict: 'AC',\n      link: function(scope, element, attr) {\n        var oldVal;\n\n        scope.$watch(attr[name], ngClassWatchAction, true);\n\n        attr.$observe('class', function(value) {\n          ngClassWatchAction(scope.$eval(attr[name]));\n        });\n\n\n        if (name !== 'ngClass') {\n          scope.$watch('$index', function($index, old$index) {\n            // jshint bitwise: false\n            var mod = $index & 1;\n            if (mod !== (old$index & 1)) {\n              var classes = arrayClasses(scope.$eval(attr[name]));\n              mod === selector ?\n                addClasses(classes) :\n                removeClasses(classes);\n            }\n          });\n        }\n\n        function addClasses(classes) {\n          var newClasses = digestClassCounts(classes, 1);\n          attr.$addClass(newClasses);\n        }\n\n        function removeClasses(classes) {\n          var newClasses = digestClassCounts(classes, -1);\n          attr.$removeClass(newClasses);\n        }\n\n        function digestClassCounts(classes, count) {\n          var classCounts = element.data('$classCounts') || {};\n          var classesToUpdate = [];\n          forEach(classes, function(className) {\n            if (count > 0 || classCounts[className]) {\n              classCounts[className] = (classCounts[className] || 0) + count;\n              if (classCounts[className] === +(count > 0)) {\n                classesToUpdate.push(className);\n              }\n            }\n          });\n          element.data('$classCounts', classCounts);\n          return classesToUpdate.join(' ');\n        }\n\n        function updateClasses(oldClasses, newClasses) {\n          var toAdd = arrayDifference(newClasses, oldClasses);\n          var toRemove = arrayDifference(oldClasses, newClasses);\n          toAdd = digestClassCounts(toAdd, 1);\n          toRemove = digestClassCounts(toRemove, -1);\n          if (toAdd && toAdd.length) {\n            $animate.addClass(element, toAdd);\n          }\n          if (toRemove && toRemove.length) {\n            $animate.removeClass(element, toRemove);\n          }\n        }\n\n        function ngClassWatchAction(newVal) {\n          if (selector === true || scope.$index % 2 === selector) {\n            var newClasses = arrayClasses(newVal || []);\n            if (!oldVal) {\n              addClasses(newClasses);\n            } else if (!equals(newVal,oldVal)) {\n              var oldClasses = arrayClasses(oldVal);\n              updateClasses(oldClasses, newClasses);\n            }\n          }\n          oldVal = shallowCopy(newVal);\n        }\n      }\n    };\n\n    function arrayDifference(tokens1, tokens2) {\n      var values = [];\n\n      outer:\n      for (var i = 0; i < tokens1.length; i++) {\n        var token = tokens1[i];\n        for (var j = 0; j < tokens2.length; j++) {\n          if (token == tokens2[j]) continue outer;\n        }\n        values.push(token);\n      }\n      return values;\n    }\n\n    function arrayClasses(classVal) {\n      if (isArray(classVal)) {\n        return classVal;\n      } else if (isString(classVal)) {\n        return classVal.split(' ');\n      } else if (isObject(classVal)) {\n        var classes = [];\n        forEach(classVal, function(v, k) {\n          if (v) {\n            classes = classes.concat(k.split(' '));\n          }\n        });\n        return classes;\n      }\n      return classVal;\n    }\n  }];\n}\n\n/**\n * @ngdoc directive\n * @name ngClass\n * @restrict AC\n *\n * @description\n * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding\n * an expression that represents all classes to be added.\n *\n * The directive operates in three different ways, depending on which of three types the expression\n * evaluates to:\n *\n * 1. If the expression evaluates to a string, the string should be one or more space-delimited class\n * names.\n *\n * 2. If the expression evaluates to an array, each element of the array should be a string that is\n * one or more space-delimited class names.\n *\n * 3. If the expression evaluates to an object, then for each key-value pair of the\n * object with a truthy value the corresponding key is used as a class name.\n *\n * The directive won't add duplicate classes if a particular class was already set.\n *\n * When the expression changes, the previously added classes are removed and only then the\n * new classes are added.\n *\n * @animations\n * **add** - happens just before the class is applied to the elements\n *\n * **remove** - happens just before the class is removed from the element\n *\n * @element ANY\n * @param {expression} ngClass {@link guide/expression Expression} to eval. The result\n *   of the evaluation can be a string representing space delimited class\n *   names, an array, or a map of class names to boolean values. In the case of a map, the\n *   names of the properties whose values are truthy will be added as css classes to the\n *   element.\n *\n * @example Example that demonstrates basic bindings via ngClass directive.\n   <example>\n     <file name=\"index.html\">\n       <p ng-class=\"{strike: deleted, bold: important, red: error}\">Map Syntax Example</p>\n       <input type=\"checkbox\" ng-model=\"deleted\"> deleted (apply \"strike\" class)<br>\n       <input type=\"checkbox\" ng-model=\"important\"> important (apply \"bold\" class)<br>\n       <input type=\"checkbox\" ng-model=\"error\"> error (apply \"red\" class)\n       <hr>\n       <p ng-class=\"style\">Using String Syntax</p>\n       <input type=\"text\" ng-model=\"style\" placeholder=\"Type: bold strike red\">\n       <hr>\n       <p ng-class=\"[style1, style2, style3]\">Using Array Syntax</p>\n       <input ng-model=\"style1\" placeholder=\"Type: bold, strike or red\"><br>\n       <input ng-model=\"style2\" placeholder=\"Type: bold, strike or red\"><br>\n       <input ng-model=\"style3\" placeholder=\"Type: bold, strike or red\"><br>\n     </file>\n     <file name=\"style.css\">\n       .strike {\n         text-decoration: line-through;\n       }\n       .bold {\n           font-weight: bold;\n       }\n       .red {\n           color: red;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var ps = element.all(by.css('p'));\n\n       it('should let you toggle the class', function() {\n\n         expect(ps.first().getAttribute('class')).not.toMatch(/bold/);\n         expect(ps.first().getAttribute('class')).not.toMatch(/red/);\n\n         element(by.model('important')).click();\n         expect(ps.first().getAttribute('class')).toMatch(/bold/);\n\n         element(by.model('error')).click();\n         expect(ps.first().getAttribute('class')).toMatch(/red/);\n       });\n\n       it('should let you toggle string example', function() {\n         expect(ps.get(1).getAttribute('class')).toBe('');\n         element(by.model('style')).clear();\n         element(by.model('style')).sendKeys('red');\n         expect(ps.get(1).getAttribute('class')).toBe('red');\n       });\n\n       it('array example should have 3 classes', function() {\n         expect(ps.last().getAttribute('class')).toBe('');\n         element(by.model('style1')).sendKeys('bold');\n         element(by.model('style2')).sendKeys('strike');\n         element(by.model('style3')).sendKeys('red');\n         expect(ps.last().getAttribute('class')).toBe('bold strike red');\n       });\n     </file>\n   </example>\n\n   ## Animations\n\n   The example below demonstrates how to perform animations using ngClass.\n\n   <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n     <file name=\"index.html\">\n      <input id=\"setbtn\" type=\"button\" value=\"set\" ng-click=\"myVar='my-class'\">\n      <input id=\"clearbtn\" type=\"button\" value=\"clear\" ng-click=\"myVar=''\">\n      <br>\n      <span class=\"base-class\" ng-class=\"myVar\">Sample Text</span>\n     </file>\n     <file name=\"style.css\">\n       .base-class {\n         -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n         transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n       }\n\n       .base-class.my-class {\n         color: red;\n         font-size:3em;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class', function() {\n         expect(element(by.css('.base-class')).getAttribute('class')).not.\n           toMatch(/my-class/);\n\n         element(by.id('setbtn')).click();\n\n         expect(element(by.css('.base-class')).getAttribute('class')).\n           toMatch(/my-class/);\n\n         element(by.id('clearbtn')).click();\n\n         expect(element(by.css('.base-class')).getAttribute('class')).not.\n           toMatch(/my-class/);\n       });\n     </file>\n   </example>\n\n\n   ## ngClass and pre-existing CSS3 Transitions/Animations\n   The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.\n   Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder\n   any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure\n   to view the step by step details of {@link ng.$animate#addClass $animate.addClass} and\n   {@link ng.$animate#removeClass $animate.removeClass}.\n */\nvar ngClassDirective = classDirective('', true);\n\n/**\n * @ngdoc directive\n * @name ngClassOdd\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result\n *   of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n          <li ng-repeat=\"name in names\">\n           <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n             {{name}}\n           </span>\n          </li>\n        </ol>\n     </file>\n     <file name=\"style.css\">\n       .odd {\n         color: red;\n       }\n       .even {\n         color: blue;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class-odd and ng-class-even', function() {\n         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n           toMatch(/odd/);\n         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n           toMatch(/even/);\n       });\n     </file>\n   </example>\n */\nvar ngClassOddDirective = classDirective('Odd', 0);\n\n/**\n * @ngdoc directive\n * @name ngClassEven\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The\n *   result of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n          <li ng-repeat=\"name in names\">\n           <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n             {{name}} &nbsp; &nbsp; &nbsp;\n           </span>\n          </li>\n        </ol>\n     </file>\n     <file name=\"style.css\">\n       .odd {\n         color: red;\n       }\n       .even {\n         color: blue;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-class-odd and ng-class-even', function() {\n         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n           toMatch(/odd/);\n         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n           toMatch(/even/);\n       });\n     </file>\n   </example>\n */\nvar ngClassEvenDirective = classDirective('Even', 1);\n\n/**\n * @ngdoc directive\n * @name ngCloak\n * @restrict AC\n *\n * @description\n * The `ngCloak` directive is used to prevent the Angular html template from being briefly\n * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this\n * directive to avoid the undesirable flicker effect caused by the html template display.\n *\n * The directive can be applied to the `<body>` element, but the preferred usage is to apply\n * multiple `ngCloak` directives to small portions of the page to permit progressive rendering\n * of the browser view.\n *\n * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and\n * `angular.min.js`.\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```css\n * [ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n *   display: none !important;\n * }\n * ```\n *\n * When this css rule is loaded by the browser, all html elements (including their children) that\n * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive\n * during the compilation of the template it deletes the `ngCloak` element attribute, making\n * the compiled element visible.\n *\n * For the best result, the `angular.js` script must be loaded in the head section of the html\n * document; alternatively, the css rule above must be included in the external stylesheet of the\n * application.\n *\n * Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they\n * cannot match the `[ng\\:cloak]` selector. To work around this limitation, you must add the css\n * class `ng-cloak` in addition to the `ngCloak` directive as shown in the example below.\n *\n * @element ANY\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <div id=\"template1\" ng-cloak>{{ 'hello' }}</div>\n        <div id=\"template2\" ng-cloak class=\"ng-cloak\">{{ 'hello IE7' }}</div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should remove the template directive and css class', function() {\n         expect($('#template1').getAttribute('ng-cloak')).\n           toBeNull();\n         expect($('#template2').getAttribute('ng-cloak')).\n           toBeNull();\n       });\n     </file>\n   </example>\n *\n */\nvar ngCloakDirective = ngDirective({\n  compile: function(element, attr) {\n    attr.$set('ngCloak', undefined);\n    element.removeClass('ng-cloak');\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngController\n *\n * @description\n * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular\n * supports the principles behind the Model-View-Controller design pattern.\n *\n * MVC components in angular:\n *\n * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties\n *   are accessed through bindings.\n * * View — The template (HTML with data bindings) that is rendered into the View.\n * * Controller — The `ngController` directive specifies a Controller class; the class contains business\n *   logic behind the application to decorate the scope with functions and values\n *\n * Note that you can also attach controllers to the DOM by declaring it in a route definition\n * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller\n * again using `ng-controller` in the template itself.  This will cause the controller to be attached\n * and executed twice.\n *\n * @element ANY\n * @scope\n * @priority 500\n * @param {expression} ngController Name of a constructor function registered with the current\n * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}\n * that on the current scope evaluates to a constructor function.\n *\n * The controller instance can be published into a scope property by specifying\n * `ng-controller=\"as propertyName\"`.\n *\n * If the current `$controllerProvider` is configured to use globals (via\n * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may\n * also be the name of a globally accessible constructor function (not recommended).\n *\n * @example\n * Here is a simple form for editing user contact information. Adding, removing, clearing, and\n * greeting are methods declared on the controller (see source tab). These methods can\n * easily be called from the angular markup. Any changes to the data are automatically reflected\n * in the View without the need for a manual update.\n *\n * Two different declaration styles are included below:\n *\n * * one binds methods and properties directly onto the controller using `this`:\n * `ng-controller=\"SettingsController1 as settings\"`\n * * one injects `$scope` into the controller:\n * `ng-controller=\"SettingsController2\"`\n *\n * The second option is more common in the Angular community, and is generally used in boilerplates\n * and in this guide. However, there are advantages to binding properties directly to the controller\n * and avoiding scope.\n *\n * * Using `controller as` makes it obvious which controller you are accessing in the template when\n * multiple controllers apply to an element.\n * * If you are writing your controllers as classes you have easier access to the properties and\n * methods, which will appear on the scope, from inside the controller code.\n * * Since there is always a `.` in the bindings, you don't have to worry about prototypal\n * inheritance masking primitives.\n *\n * This example demonstrates the `controller as` syntax.\n *\n * <example name=\"ngControllerAs\" module=\"controllerAsExample\">\n *   <file name=\"index.html\">\n *    <div id=\"ctrl-as-exmpl\" ng-controller=\"SettingsController1 as settings\">\n *      Name: <input type=\"text\" ng-model=\"settings.name\"/>\n *      [ <a href=\"\" ng-click=\"settings.greet()\">greet</a> ]<br/>\n *      Contact:\n *      <ul>\n *        <li ng-repeat=\"contact in settings.contacts\">\n *          <select ng-model=\"contact.type\">\n *             <option>phone</option>\n *             <option>email</option>\n *          </select>\n *          <input type=\"text\" ng-model=\"contact.value\"/>\n *          [ <a href=\"\" ng-click=\"settings.clearContact(contact)\">clear</a>\n *          | <a href=\"\" ng-click=\"settings.removeContact(contact)\">X</a> ]\n *        </li>\n *        <li>[ <a href=\"\" ng-click=\"settings.addContact()\">add</a> ]</li>\n *     </ul>\n *    </div>\n *   </file>\n *   <file name=\"app.js\">\n *    angular.module('controllerAsExample', [])\n *      .controller('SettingsController1', SettingsController1);\n *\n *    function SettingsController1() {\n *      this.name = \"John Smith\";\n *      this.contacts = [\n *        {type: 'phone', value: '408 555 1212'},\n *        {type: 'email', value: 'john.smith@example.org'} ];\n *    }\n *\n *    SettingsController1.prototype.greet = function() {\n *      alert(this.name);\n *    };\n *\n *    SettingsController1.prototype.addContact = function() {\n *      this.contacts.push({type: 'email', value: 'yourname@example.org'});\n *    };\n *\n *    SettingsController1.prototype.removeContact = function(contactToRemove) {\n *     var index = this.contacts.indexOf(contactToRemove);\n *      this.contacts.splice(index, 1);\n *    };\n *\n *    SettingsController1.prototype.clearContact = function(contact) {\n *      contact.type = 'phone';\n *      contact.value = '';\n *    };\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     it('should check controller as', function() {\n *       var container = element(by.id('ctrl-as-exmpl'));\n *         expect(container.element(by.model('settings.name'))\n *           .getAttribute('value')).toBe('John Smith');\n *\n *       var firstRepeat =\n *           container.element(by.repeater('contact in settings.contacts').row(0));\n *       var secondRepeat =\n *           container.element(by.repeater('contact in settings.contacts').row(1));\n *\n *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('408 555 1212');\n *\n *       expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('john.smith@example.org');\n *\n *       firstRepeat.element(by.linkText('clear')).click();\n *\n *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *           .toBe('');\n *\n *       container.element(by.linkText('add')).click();\n *\n *       expect(container.element(by.repeater('contact in settings.contacts').row(2))\n *           .element(by.model('contact.value'))\n *           .getAttribute('value'))\n *           .toBe('yourname@example.org');\n *     });\n *   </file>\n * </example>\n *\n * This example demonstrates the \"attach to `$scope`\" style of controller.\n *\n * <example name=\"ngController\" module=\"controllerExample\">\n *  <file name=\"index.html\">\n *   <div id=\"ctrl-exmpl\" ng-controller=\"SettingsController2\">\n *     Name: <input type=\"text\" ng-model=\"name\"/>\n *     [ <a href=\"\" ng-click=\"greet()\">greet</a> ]<br/>\n *     Contact:\n *     <ul>\n *       <li ng-repeat=\"contact in contacts\">\n *         <select ng-model=\"contact.type\">\n *            <option>phone</option>\n *            <option>email</option>\n *         </select>\n *         <input type=\"text\" ng-model=\"contact.value\"/>\n *         [ <a href=\"\" ng-click=\"clearContact(contact)\">clear</a>\n *         | <a href=\"\" ng-click=\"removeContact(contact)\">X</a> ]\n *       </li>\n *       <li>[ <a href=\"\" ng-click=\"addContact()\">add</a> ]</li>\n *    </ul>\n *   </div>\n *  </file>\n *  <file name=\"app.js\">\n *   angular.module('controllerExample', [])\n *     .controller('SettingsController2', ['$scope', SettingsController2]);\n *\n *   function SettingsController2($scope) {\n *     $scope.name = \"John Smith\";\n *     $scope.contacts = [\n *       {type:'phone', value:'408 555 1212'},\n *       {type:'email', value:'john.smith@example.org'} ];\n *\n *     $scope.greet = function() {\n *       alert($scope.name);\n *     };\n *\n *     $scope.addContact = function() {\n *       $scope.contacts.push({type:'email', value:'yourname@example.org'});\n *     };\n *\n *     $scope.removeContact = function(contactToRemove) {\n *       var index = $scope.contacts.indexOf(contactToRemove);\n *       $scope.contacts.splice(index, 1);\n *     };\n *\n *     $scope.clearContact = function(contact) {\n *       contact.type = 'phone';\n *       contact.value = '';\n *     };\n *   }\n *  </file>\n *  <file name=\"protractor.js\" type=\"protractor\">\n *    it('should check controller', function() {\n *      var container = element(by.id('ctrl-exmpl'));\n *\n *      expect(container.element(by.model('name'))\n *          .getAttribute('value')).toBe('John Smith');\n *\n *      var firstRepeat =\n *          container.element(by.repeater('contact in contacts').row(0));\n *      var secondRepeat =\n *          container.element(by.repeater('contact in contacts').row(1));\n *\n *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('408 555 1212');\n *      expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('john.smith@example.org');\n *\n *      firstRepeat.element(by.linkText('clear')).click();\n *\n *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n *          .toBe('');\n *\n *      container.element(by.linkText('add')).click();\n *\n *      expect(container.element(by.repeater('contact in contacts').row(2))\n *          .element(by.model('contact.value'))\n *          .getAttribute('value'))\n *          .toBe('yourname@example.org');\n *    });\n *  </file>\n *</example>\n\n */\nvar ngControllerDirective = [function() {\n  return {\n    restrict: 'A',\n    scope: true,\n    controller: '@',\n    priority: 500\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngCsp\n *\n * @element html\n * @description\n * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support.\n *\n * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.\n *\n * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things).\n * For Angular to be CSP compatible there are only two things that we need to do differently:\n *\n * - don't use `Function` constructor to generate optimized value getters\n * - don't inject custom stylesheet into the document\n *\n * AngularJS uses `Function(string)` generated functions as a speed optimization. Applying the `ngCsp`\n * directive will cause Angular to use CSP compatibility mode. When this mode is on AngularJS will\n * evaluate all expressions up to 30% slower than in non-CSP mode, but no security violations will\n * be raised.\n *\n * CSP forbids JavaScript to inline stylesheet rules. In non CSP mode Angular automatically\n * includes some CSS rules (e.g. {@link ng.directive:ngCloak ngCloak}).\n * To make those directives work in CSP mode, include the `angular-csp.css` manually.\n *\n * Angular tries to autodetect if CSP is active and automatically turn on the CSP-safe mode. This\n * autodetection however triggers a CSP error to be logged in the console:\n *\n * ```\n * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of\n * script in the following Content Security Policy directive: \"default-src 'self'\". Note that\n * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.\n * ```\n *\n * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`\n * directive on the root element of the application or on the `angular.js` script tag, whichever\n * appears first in the html document.\n *\n * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*\n *\n * @example\n * This example shows how to apply the `ngCsp` directive to the `html` tag.\n   ```html\n     <!doctype html>\n     <html ng-app ng-csp>\n     ...\n     ...\n     </html>\n   ```\n  * @example\n      // Note: the suffix `.csp` in the example name triggers\n      // csp mode in our http server!\n      <example name=\"example.csp\" module=\"cspExample\" ng-csp=\"true\">\n        <file name=\"index.html\">\n          <div ng-controller=\"MainController as ctrl\">\n            <div>\n              <button ng-click=\"ctrl.inc()\" id=\"inc\">Increment</button>\n              <span id=\"counter\">\n                {{ctrl.counter}}\n              </span>\n            </div>\n\n            <div>\n              <button ng-click=\"ctrl.evil()\" id=\"evil\">Evil</button>\n              <span id=\"evilError\">\n                {{ctrl.evilError}}\n              </span>\n            </div>\n          </div>\n        </file>\n        <file name=\"script.js\">\n           angular.module('cspExample', [])\n             .controller('MainController', function() {\n                this.counter = 0;\n                this.inc = function() {\n                  this.counter++;\n                };\n                this.evil = function() {\n                  // jshint evil:true\n                  try {\n                    eval('1+2');\n                  } catch (e) {\n                    this.evilError = e.message;\n                  }\n                };\n              });\n        </file>\n        <file name=\"protractor.js\" type=\"protractor\">\n          var util, webdriver;\n\n          var incBtn = element(by.id('inc'));\n          var counter = element(by.id('counter'));\n          var evilBtn = element(by.id('evil'));\n          var evilError = element(by.id('evilError'));\n\n          function getAndClearSevereErrors() {\n            return browser.manage().logs().get('browser').then(function(browserLog) {\n              return browserLog.filter(function(logEntry) {\n                return logEntry.level.value > webdriver.logging.Level.WARNING.value;\n              });\n            });\n          }\n\n          function clearErrors() {\n            getAndClearSevereErrors();\n          }\n\n          function expectNoErrors() {\n            getAndClearSevereErrors().then(function(filteredLog) {\n              expect(filteredLog.length).toEqual(0);\n              if (filteredLog.length) {\n                console.log('browser console errors: ' + util.inspect(filteredLog));\n              }\n            });\n          }\n\n          function expectError(regex) {\n            getAndClearSevereErrors().then(function(filteredLog) {\n              var found = false;\n              filteredLog.forEach(function(log) {\n                if (log.message.match(regex)) {\n                  found = true;\n                }\n              });\n              if (!found) {\n                throw new Error('expected an error that matches ' + regex);\n              }\n            });\n          }\n\n          beforeEach(function() {\n            util = require('util');\n            webdriver = require('protractor/node_modules/selenium-webdriver');\n          });\n\n          // For now, we only test on Chrome,\n          // as Safari does not load the page with Protractor's injected scripts,\n          // and Firefox webdriver always disables content security policy (#6358)\n          if (browser.params.browser !== 'chrome') {\n            return;\n          }\n\n          it('should not report errors when the page is loaded', function() {\n            // clear errors so we are not dependent on previous tests\n            clearErrors();\n            // Need to reload the page as the page is already loaded when\n            // we come here\n            browser.driver.getCurrentUrl().then(function(url) {\n              browser.get(url);\n            });\n            expectNoErrors();\n          });\n\n          it('should evaluate expressions', function() {\n            expect(counter.getText()).toEqual('0');\n            incBtn.click();\n            expect(counter.getText()).toEqual('1');\n            expectNoErrors();\n          });\n\n          it('should throw and report an error when using \"eval\"', function() {\n            evilBtn.click();\n            expect(evilError.getText()).toMatch(/Content Security Policy/);\n            expectError(/Content Security Policy/);\n          });\n        </file>\n      </example>\n  */\n\n// ngCsp is not implemented as a proper directive any more, because we need it be processed while we\n// bootstrap the system (before $parse is instantiated), for this reason we just have\n// the csp.isActive() fn that looks for ng-csp attribute anywhere in the current doc\n\n/**\n * @ngdoc directive\n * @name ngClick\n *\n * @description\n * The ngClick directive allows you to specify custom behavior when\n * an element is clicked.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon\n * click. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n        Increment\n      </button>\n      <span>\n        count: {{count}}\n      </span>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-click', function() {\n         expect(element(by.binding('count')).getText()).toMatch('0');\n         element(by.css('button')).click();\n         expect(element(by.binding('count')).getText()).toMatch('1');\n       });\n     </file>\n   </example>\n */\n/*\n * A collection of directives that allows creation of custom event handlers that are defined as\n * angular expressions and are compiled and executed within the current scope.\n */\nvar ngEventDirectives = {};\n\n// For events that might fire synchronously during DOM manipulation\n// we need to execute their event handlers asynchronously using $evalAsync,\n// so that they are not executed in an inconsistent state.\nvar forceAsyncEvents = {\n  'blur': true,\n  'focus': true\n};\nforEach(\n  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),\n  function(eventName) {\n    var directiveName = directiveNormalize('ng-' + eventName);\n    ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {\n      return {\n        restrict: 'A',\n        compile: function($element, attr) {\n          // We expose the powerful $event object on the scope that provides access to the Window,\n          // etc. that isn't protected by the fast paths in $parse.  We explicitly request better\n          // checks at the cost of speed since event handler expressions are not executed as\n          // frequently as regular change detection.\n          var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);\n          return function ngEventHandler(scope, element) {\n            element.on(eventName, function(event) {\n              var callback = function() {\n                fn(scope, {$event:event});\n              };\n              if (forceAsyncEvents[eventName] && $rootScope.$$phase) {\n                scope.$evalAsync(callback);\n              } else {\n                scope.$apply(callback);\n              }\n            });\n          };\n        }\n      };\n    }];\n  }\n);\n\n/**\n * @ngdoc directive\n * @name ngDblclick\n *\n * @description\n * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon\n * a dblclick. (The Event object is available as `$event`)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-dblclick=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on double click)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousedown\n *\n * @description\n * The ngMousedown directive allows you to specify custom behavior on mousedown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon\n * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mousedown=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on mouse down)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseup\n *\n * @description\n * Specify custom behavior on mouseup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon\n * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseup=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (on mouse up)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngMouseover\n *\n * @description\n * Specify custom behavior on mouseover event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon\n * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseover=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse is over)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseenter\n *\n * @description\n * Specify custom behavior on mouseenter event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon\n * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseenter=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse enters)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseleave\n *\n * @description\n * Specify custom behavior on mouseleave event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon\n * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mouseleave=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse leaves)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousemove\n *\n * @description\n * Specify custom behavior on mousemove event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon\n * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <button ng-mousemove=\"count = count + 1\" ng-init=\"count=0\">\n        Increment (when mouse moves)\n      </button>\n      count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeydown\n *\n * @description\n * Specify custom behavior on keydown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon\n * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-keydown=\"count = count + 1\" ng-init=\"count=0\">\n      key down count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeyup\n *\n * @description\n * Specify custom behavior on keyup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon\n * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n       <p>Typing in the input box below updates the key count</p>\n       <input ng-keyup=\"count = count + 1\" ng-init=\"count=0\"> key up count: {{count}}\n\n       <p>Typing in the input box below updates the keycode</p>\n       <input ng-keyup=\"event=$event\">\n       <p>event keyCode: {{ event.keyCode }}</p>\n       <p>event altKey: {{ event.altKey }}</p>\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeypress\n *\n * @description\n * Specify custom behavior on keypress event.\n *\n * @element ANY\n * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon\n * keypress. ({@link guide/expression#-event- Event object is available as `$event`}\n * and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-keypress=\"count = count + 1\" ng-init=\"count=0\">\n      key press count: {{count}}\n     </file>\n   </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSubmit\n *\n * @description\n * Enables binding angular expressions to onsubmit events.\n *\n * Additionally it prevents the default action (which for form means sending the request to the\n * server and reloading the current page), but only if the form does not contain `action`,\n * `data-action`, or `x-action` attributes.\n *\n * <div class=\"alert alert-warning\">\n * **Warning:** Be careful not to cause \"double-submission\" by using both the `ngClick` and\n * `ngSubmit` handlers together. See the\n * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}\n * for a detailed discussion of when `ngSubmit` may be triggered.\n * </div>\n *\n * @element form\n * @priority 0\n * @param {expression} ngSubmit {@link guide/expression Expression} to eval.\n * ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example module=\"submitExample\">\n     <file name=\"index.html\">\n      <script>\n        angular.module('submitExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.list = [];\n            $scope.text = 'hello';\n            $scope.submit = function() {\n              if ($scope.text) {\n                $scope.list.push(this.text);\n                $scope.text = '';\n              }\n            };\n          }]);\n      </script>\n      <form ng-submit=\"submit()\" ng-controller=\"ExampleController\">\n        Enter text and hit enter:\n        <input type=\"text\" ng-model=\"text\" name=\"text\" />\n        <input type=\"submit\" id=\"submit\" value=\"Submit\" />\n        <pre>list={{list}}</pre>\n      </form>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-submit', function() {\n         expect(element(by.binding('list')).getText()).toBe('list=[]');\n         element(by.css('#submit')).click();\n         expect(element(by.binding('list')).getText()).toContain('hello');\n         expect(element(by.model('text')).getAttribute('value')).toBe('');\n       });\n       it('should ignore empty strings', function() {\n         expect(element(by.binding('list')).getText()).toBe('list=[]');\n         element(by.css('#submit')).click();\n         element(by.css('#submit')).click();\n         expect(element(by.binding('list')).getText()).toContain('hello');\n        });\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngFocus\n *\n * @description\n * Specify custom behavior on focus event.\n *\n * Note: As the `focus` event is executed synchronously when calling `input.focus()`\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon\n * focus. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngBlur\n *\n * @description\n * Specify custom behavior on blur event.\n *\n * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when\n * an element has lost focus.\n *\n * Note: As the `blur` event is executed synchronously also during DOM manipulations\n * (e.g. removing a focussed input),\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon\n * blur. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngCopy\n *\n * @description\n * Specify custom behavior on copy event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon\n * copy. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-copy=\"copied=true\" ng-init=\"copied=false; value='copy me'\" ng-model=\"value\">\n      copied: {{copied}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngCut\n *\n * @description\n * Specify custom behavior on cut event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon\n * cut. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-cut=\"cut=true\" ng-init=\"cut=false; value='cut me'\" ng-model=\"value\">\n      cut: {{cut}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngPaste\n *\n * @description\n * Specify custom behavior on paste event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon\n * paste. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n      <input ng-paste=\"paste=true\" ng-init=\"paste=false\" placeholder='paste here'>\n      pasted: {{paste}}\n     </file>\n   </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngIf\n * @restrict A\n *\n * @description\n * The `ngIf` directive removes or recreates a portion of the DOM tree based on an\n * {expression}. If the expression assigned to `ngIf` evaluates to a false\n * value then the element is removed from the DOM, otherwise a clone of the\n * element is reinserted into the DOM.\n *\n * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the\n * element in the DOM rather than changing its visibility via the `display` css property.  A common\n * case when this difference is significant is when using css selectors that rely on an element's\n * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.\n *\n * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope\n * is created when the element is restored.  The scope created within `ngIf` inherits from\n * its parent scope using\n * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).\n * An important implication of this is if `ngModel` is used within `ngIf` to bind to\n * a javascript primitive defined in the parent scope. In this case any modifications made to the\n * variable within the child scope will override (hide) the value in the parent scope.\n *\n * Also, `ngIf` recreates elements using their compiled state. An example of this behavior\n * is if an element's class attribute is directly modified after it's compiled, using something like\n * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element\n * the added class will be lost because the original compiled state is used to regenerate the element.\n *\n * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`\n * and `leave` effects.\n *\n * @animations\n * enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container\n * leave - happens just before the `ngIf` contents are removed from the DOM\n *\n * @element ANY\n * @scope\n * @priority 600\n * @param {expression} ngIf If the {@link guide/expression expression} is falsy then\n *     the element is removed from the DOM tree. If it is truthy a copy of the compiled\n *     element is added to the DOM tree.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\" ng-init=\"checked=true\" /><br/>\n      Show when checked:\n      <span ng-if=\"checked\" class=\"animate-if\">\n        This is removed when the checkbox is unchecked.\n      </span>\n    </file>\n    <file name=\"animations.css\">\n      .animate-if {\n        background:white;\n        border:1px solid black;\n        padding:10px;\n      }\n\n      .animate-if.ng-enter, .animate-if.ng-leave {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n      }\n\n      .animate-if.ng-enter,\n      .animate-if.ng-leave.ng-leave-active {\n        opacity:0;\n      }\n\n      .animate-if.ng-leave,\n      .animate-if.ng-enter.ng-enter-active {\n        opacity:1;\n      }\n    </file>\n  </example>\n */\nvar ngIfDirective = ['$animate', function($animate) {\n  return {\n    multiElement: true,\n    transclude: 'element',\n    priority: 600,\n    terminal: true,\n    restrict: 'A',\n    $$tlb: true,\n    link: function($scope, $element, $attr, ctrl, $transclude) {\n        var block, childScope, previousElements;\n        $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {\n\n          if (value) {\n            if (!childScope) {\n              $transclude(function(clone, newScope) {\n                childScope = newScope;\n                clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');\n                // Note: We only need the first/last node of the cloned nodes.\n                // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n                // by a directive with templateUrl when its template arrives.\n                block = {\n                  clone: clone\n                };\n                $animate.enter(clone, $element.parent(), $element);\n              });\n            }\n          } else {\n            if (previousElements) {\n              previousElements.remove();\n              previousElements = null;\n            }\n            if (childScope) {\n              childScope.$destroy();\n              childScope = null;\n            }\n            if (block) {\n              previousElements = getBlockNodes(block.clone);\n              $animate.leave(previousElements).then(function() {\n                previousElements = null;\n              });\n              block = null;\n            }\n          }\n        });\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngInclude\n * @restrict ECA\n *\n * @description\n * Fetches, compiles and includes an external HTML fragment.\n *\n * By default, the template URL is restricted to the same domain and protocol as the\n * application document. This is done by calling {@link $sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols\n * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or\n * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link\n * ng.$sce Strict Contextual Escaping}.\n *\n * In addition, the browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy may further restrict whether the template is successfully loaded.\n * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`\n * access on some browsers.\n *\n * @animations\n * enter - animation is used to bring new content into the browser.\n * leave - animation is used to animate existing content away.\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n *\n * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,\n *                 make sure you wrap it in **single** quotes, e.g. `src=\"'myPartialTemplate.html'\"`.\n * @param {string=} onload Expression to evaluate when a new partial is loaded.\n *\n * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll\n *                  $anchorScroll} to scroll the viewport after the content is loaded.\n *\n *                  - If the attribute is not set, disable scrolling.\n *                  - If the attribute is set without value, enable scrolling.\n *                  - Otherwise enable scrolling only if the expression evaluates to truthy value.\n *\n * @example\n  <example module=\"includeExample\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n     <div ng-controller=\"ExampleController\">\n       <select ng-model=\"template\" ng-options=\"t.name for t in templates\">\n        <option value=\"\">(blank)</option>\n       </select>\n       url of the template: <code>{{template.url}}</code>\n       <hr/>\n       <div class=\"slide-animate-container\">\n         <div class=\"slide-animate\" ng-include=\"template.url\"></div>\n       </div>\n     </div>\n    </file>\n    <file name=\"script.js\">\n      angular.module('includeExample', ['ngAnimate'])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.templates =\n            [ { name: 'template1.html', url: 'template1.html'},\n              { name: 'template2.html', url: 'template2.html'} ];\n          $scope.template = $scope.templates[0];\n        }]);\n     </file>\n    <file name=\"template1.html\">\n      Content of template1.html\n    </file>\n    <file name=\"template2.html\">\n      Content of template2.html\n    </file>\n    <file name=\"animations.css\">\n      .slide-animate-container {\n        position:relative;\n        background:white;\n        border:1px solid black;\n        height:40px;\n        overflow:hidden;\n      }\n\n      .slide-animate {\n        padding:10px;\n      }\n\n      .slide-animate.ng-enter, .slide-animate.ng-leave {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n        position:absolute;\n        top:0;\n        left:0;\n        right:0;\n        bottom:0;\n        display:block;\n        padding:10px;\n      }\n\n      .slide-animate.ng-enter {\n        top:-50px;\n      }\n      .slide-animate.ng-enter.ng-enter-active {\n        top:0;\n      }\n\n      .slide-animate.ng-leave {\n        top:0;\n      }\n      .slide-animate.ng-leave.ng-leave-active {\n        top:50px;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var templateSelect = element(by.model('template'));\n      var includeElem = element(by.css('[ng-include]'));\n\n      it('should load template1.html', function() {\n        expect(includeElem.getText()).toMatch(/Content of template1.html/);\n      });\n\n      it('should load template2.html', function() {\n        if (browser.params.browser == 'firefox') {\n          // Firefox can't handle using selects\n          // See https://github.com/angular/protractor/issues/480\n          return;\n        }\n        templateSelect.click();\n        templateSelect.all(by.css('option')).get(2).click();\n        expect(includeElem.getText()).toMatch(/Content of template2.html/);\n      });\n\n      it('should change to blank', function() {\n        if (browser.params.browser == 'firefox') {\n          // Firefox can't handle using selects\n          return;\n        }\n        templateSelect.click();\n        templateSelect.all(by.css('option')).get(0).click();\n        expect(includeElem.isPresent()).toBe(false);\n      });\n    </file>\n  </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentRequested\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted every time the ngInclude content is requested.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentLoaded\n * @eventType emit on the current ngInclude scope\n * @description\n * Emitted every time the ngInclude content is reloaded.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentError\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\nvar ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce',\n                  function($templateRequest,   $anchorScroll,   $animate,   $sce) {\n  return {\n    restrict: 'ECA',\n    priority: 400,\n    terminal: true,\n    transclude: 'element',\n    controller: angular.noop,\n    compile: function(element, attr) {\n      var srcExp = attr.ngInclude || attr.src,\n          onloadExp = attr.onload || '',\n          autoScrollExp = attr.autoscroll;\n\n      return function(scope, $element, $attr, ctrl, $transclude) {\n        var changeCounter = 0,\n            currentScope,\n            previousElement,\n            currentElement;\n\n        var cleanupLastIncludeContent = function() {\n          if (previousElement) {\n            previousElement.remove();\n            previousElement = null;\n          }\n          if (currentScope) {\n            currentScope.$destroy();\n            currentScope = null;\n          }\n          if (currentElement) {\n            $animate.leave(currentElement).then(function() {\n              previousElement = null;\n            });\n            previousElement = currentElement;\n            currentElement = null;\n          }\n        };\n\n        scope.$watch($sce.parseAsResourceUrl(srcExp), function ngIncludeWatchAction(src) {\n          var afterAnimation = function() {\n            if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {\n              $anchorScroll();\n            }\n          };\n          var thisChangeId = ++changeCounter;\n\n          if (src) {\n            //set the 2nd param to true to ignore the template request error so that the inner\n            //contents and scope can be cleaned up.\n            $templateRequest(src, true).then(function(response) {\n              if (thisChangeId !== changeCounter) return;\n              var newScope = scope.$new();\n              ctrl.template = response;\n\n              // Note: This will also link all children of ng-include that were contained in the original\n              // html. If that content contains controllers, ... they could pollute/change the scope.\n              // However, using ng-include on an element with additional content does not make sense...\n              // Note: We can't remove them in the cloneAttchFn of $transclude as that\n              // function is called before linking the content, which would apply child\n              // directives to non existing elements.\n              var clone = $transclude(newScope, function(clone) {\n                cleanupLastIncludeContent();\n                $animate.enter(clone, null, $element).then(afterAnimation);\n              });\n\n              currentScope = newScope;\n              currentElement = clone;\n\n              currentScope.$emit('$includeContentLoaded', src);\n              scope.$eval(onloadExp);\n            }, function() {\n              if (thisChangeId === changeCounter) {\n                cleanupLastIncludeContent();\n                scope.$emit('$includeContentError', src);\n              }\n            });\n            scope.$emit('$includeContentRequested', src);\n          } else {\n            cleanupLastIncludeContent();\n            ctrl.template = null;\n          }\n        });\n      };\n    }\n  };\n}];\n\n// This directive is called during the $transclude call of the first `ngInclude` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngInclude\n// is called.\nvar ngIncludeFillContentDirective = ['$compile',\n  function($compile) {\n    return {\n      restrict: 'ECA',\n      priority: -400,\n      require: 'ngInclude',\n      link: function(scope, $element, $attr, ctrl) {\n        if (/SVG/.test($element[0].toString())) {\n          // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not\n          // support innerHTML, so detect this here and try to generate the contents\n          // specially.\n          $element.empty();\n          $compile(jqLiteBuildFragment(ctrl.template, document).childNodes)(scope,\n              function namespaceAdaptedClone(clone) {\n            $element.append(clone);\n          }, {futureParentElement: $element});\n          return;\n        }\n\n        $element.html(ctrl.template);\n        $compile($element.contents())(scope);\n      }\n    };\n  }];\n\n/**\n * @ngdoc directive\n * @name ngInit\n * @restrict AC\n *\n * @description\n * The `ngInit` directive allows you to evaluate an expression in the\n * current scope.\n *\n * <div class=\"alert alert-error\">\n * The only appropriate use of `ngInit` is for aliasing special properties of\n * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below. Besides this case, you\n * should use {@link guide/controller controllers} rather than `ngInit`\n * to initialize values on a scope.\n * </div>\n * <div class=\"alert alert-warning\">\n * **Note**: If you have assignment in `ngInit` along with {@link ng.$filter `$filter`}, make\n * sure you have parenthesis for correct precedence:\n * <pre class=\"prettyprint\">\n * `<div ng-init=\"test1 = (data | orderBy:'name')\"></div>`\n * </pre>\n * </div>\n *\n * @priority 450\n *\n * @element ANY\n * @param {expression} ngInit {@link guide/expression Expression} to eval.\n *\n * @example\n   <example module=\"initExample\">\n     <file name=\"index.html\">\n   <script>\n     angular.module('initExample', [])\n       .controller('ExampleController', ['$scope', function($scope) {\n         $scope.list = [['a', 'b'], ['c', 'd']];\n       }]);\n   </script>\n   <div ng-controller=\"ExampleController\">\n     <div ng-repeat=\"innerList in list\" ng-init=\"outerIndex = $index\">\n       <div ng-repeat=\"value in innerList\" ng-init=\"innerIndex = $index\">\n          <span class=\"example-init\">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>\n       </div>\n     </div>\n   </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should alias index positions', function() {\n         var elements = element.all(by.css('.example-init'));\n         expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');\n         expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');\n         expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');\n         expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');\n       });\n     </file>\n   </example>\n */\nvar ngInitDirective = ngDirective({\n  priority: 450,\n  compile: function() {\n    return {\n      pre: function(scope, element, attrs) {\n        scope.$eval(attrs.ngInit);\n      }\n    };\n  }\n});\n\n/**\n * @ngdoc directive\n * @name ngList\n *\n * @description\n * Text input that converts between a delimited string and an array of strings. The default\n * delimiter is a comma followed by a space - equivalent to `ng-list=\", \"`. You can specify a custom\n * delimiter as the value of the `ngList` attribute - for example, `ng-list=\" | \"`.\n *\n * The behaviour of the directive is affected by the use of the `ngTrim` attribute.\n * * If `ngTrim` is set to `\"false\"` then whitespace around both the separator and each\n *   list item is respected. This implies that the user of the directive is responsible for\n *   dealing with whitespace but also allows you to use whitespace as a delimiter, such as a\n *   tab or newline character.\n * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected\n *   when joining the list items back together) and whitespace around each list item is stripped\n *   before it is added to the model.\n *\n * ### Example with Validation\n *\n * <example name=\"ngList-directive\" module=\"listExample\">\n *   <file name=\"app.js\">\n *      angular.module('listExample', [])\n *        .controller('ExampleController', ['$scope', function($scope) {\n *          $scope.names = ['morpheus', 'neo', 'trinity'];\n *        }]);\n *   </file>\n *   <file name=\"index.html\">\n *    <form name=\"myForm\" ng-controller=\"ExampleController\">\n *      List: <input name=\"namesInput\" ng-model=\"names\" ng-list required>\n *      <span class=\"error\" ng-show=\"myForm.namesInput.$error.required\">\n *        Required!</span>\n *      <br>\n *      <tt>names = {{names}}</tt><br/>\n *      <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>\n *      <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>\n *      <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n *      <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n *     </form>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     var listInput = element(by.model('names'));\n *     var names = element(by.exactBinding('names'));\n *     var valid = element(by.binding('myForm.namesInput.$valid'));\n *     var error = element(by.css('span.error'));\n *\n *     it('should initialize to model', function() {\n *       expect(names.getText()).toContain('[\"morpheus\",\"neo\",\"trinity\"]');\n *       expect(valid.getText()).toContain('true');\n *       expect(error.getCssValue('display')).toBe('none');\n *     });\n *\n *     it('should be invalid if empty', function() {\n *       listInput.clear();\n *       listInput.sendKeys('');\n *\n *       expect(names.getText()).toContain('');\n *       expect(valid.getText()).toContain('false');\n *       expect(error.getCssValue('display')).not.toBe('none');\n *     });\n *   </file>\n * </example>\n *\n * ### Example - splitting on whitespace\n * <example name=\"ngList-directive-newlines\">\n *   <file name=\"index.html\">\n *    <textarea ng-model=\"list\" ng-list=\"&#10;\" ng-trim=\"false\"></textarea>\n *    <pre>{{ list | json }}</pre>\n *   </file>\n *   <file name=\"protractor.js\" type=\"protractor\">\n *     it(\"should split the text by newlines\", function() {\n *       var listInput = element(by.model('list'));\n *       var output = element(by.binding('list | json'));\n *       listInput.sendKeys('abc\\ndef\\nghi');\n *       expect(output.getText()).toContain('[\\n  \"abc\",\\n  \"def\",\\n  \"ghi\"\\n]');\n *     });\n *   </file>\n * </example>\n *\n * @element input\n * @param {string=} ngList optional delimiter that should be used to split the value.\n */\nvar ngListDirective = function() {\n  return {\n    restrict: 'A',\n    priority: 100,\n    require: 'ngModel',\n    link: function(scope, element, attr, ctrl) {\n      // We want to control whitespace trimming so we use this convoluted approach\n      // to access the ngList attribute, which doesn't pre-trim the attribute\n      var ngList = element.attr(attr.$attr.ngList) || ', ';\n      var trimValues = attr.ngTrim !== 'false';\n      var separator = trimValues ? trim(ngList) : ngList;\n\n      var parse = function(viewValue) {\n        // If the viewValue is invalid (say required but empty) it will be `undefined`\n        if (isUndefined(viewValue)) return;\n\n        var list = [];\n\n        if (viewValue) {\n          forEach(viewValue.split(separator), function(value) {\n            if (value) list.push(trimValues ? trim(value) : value);\n          });\n        }\n\n        return list;\n      };\n\n      ctrl.$parsers.push(parse);\n      ctrl.$formatters.push(function(value) {\n        if (isArray(value)) {\n          return value.join(ngList);\n        }\n\n        return undefined;\n      });\n\n      // Override the standard $isEmpty because an empty array means the input is empty.\n      ctrl.$isEmpty = function(value) {\n        return !value || !value.length;\n      };\n    }\n  };\n};\n\n/* global VALID_CLASS: true,\n  INVALID_CLASS: true,\n  PRISTINE_CLASS: true,\n  DIRTY_CLASS: true,\n  UNTOUCHED_CLASS: true,\n  TOUCHED_CLASS: true,\n*/\n\nvar VALID_CLASS = 'ng-valid',\n    INVALID_CLASS = 'ng-invalid',\n    PRISTINE_CLASS = 'ng-pristine',\n    DIRTY_CLASS = 'ng-dirty',\n    UNTOUCHED_CLASS = 'ng-untouched',\n    TOUCHED_CLASS = 'ng-touched',\n    PENDING_CLASS = 'ng-pending';\n\n\nvar $ngModelMinErr = new minErr('ngModel');\n\n/**\n * @ngdoc type\n * @name ngModel.NgModelController\n *\n * @property {string} $viewValue Actual string value in the view.\n * @property {*} $modelValue The value in the model that the control is bound to.\n * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever\n       the control reads value from the DOM. The functions are called in array order, each passing\n       its return value through to the next. The last return value is forwarded to the\n       {@link ngModel.NgModelController#$validators `$validators`} collection.\n\nParsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n`$viewValue`}.\n\nReturning `undefined` from a parser means a parse error occurred. In that case,\nno {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\nwill be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\nis set to `true`. The parse error is stored in `ngModel.$error.parse`.\n\n *\n * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever\n       the model value changes. The functions are called in reverse array order, each passing the value through to the\n       next. The last return value is used as the actual DOM value.\n       Used to format / convert values for display in the control.\n * ```js\n * function formatter(value) {\n *   if (value) {\n *     return value.toUpperCase();\n *   }\n * }\n * ngModel.$formatters.push(formatter);\n * ```\n *\n * @property {Object.<string, function>} $validators A collection of validators that are applied\n *      whenever the model value changes. The key value within the object refers to the name of the\n *      validator while the function refers to the validation operation. The validation operation is\n *      provided with the model value as an argument and must return a true or false value depending\n *      on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n *   var value = modelValue || viewValue;\n *   return /[0-9]+/.test(value) &&\n *          /[a-z]+/.test(value) &&\n *          /[A-Z]+/.test(value) &&\n *          /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to\n *      perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n *      is expected to return a promise when it is run during the model validation process. Once the promise\n *      is delivered then the validation status will be set to true when fulfilled and false when rejected.\n *      When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n *      value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n *      is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n *      will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n *   var value = modelValue || viewValue;\n *\n *   // Lookup user by username\n *   return $http.get('/api/users/' + value).\n *      then(function resolved() {\n *        //username exists, this means validation fails\n *        return $q.reject('exists');\n *      }, function rejected() {\n *        //username does not exist, therefore this validation passes\n *        return true;\n *      });\n * };\n * ```\n *\n * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the\n *     view value has changed. It is called with no arguments, and its return value is ignored.\n *     This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * Angular provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * Note that `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.  This will not work on older browsers.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. `<span onclick=\"...\">`).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * <example name=\"NgModelController\" module=\"customControl\" deps=\"angular-sanitize.js\">\n    <file name=\"style.css\">\n      [contenteditable] {\n        border: 1px solid black;\n        background-color: white;\n        min-height: 20px;\n      }\n\n      .ng-invalid {\n        border: 1px solid red;\n      }\n\n    </file>\n    <file name=\"script.js\">\n      angular.module('customControl', ['ngSanitize']).\n        directive('contenteditable', ['$sce', function($sce) {\n          return {\n            restrict: 'A', // only activate on element attribute\n            require: '?ngModel', // get a hold of NgModelController\n            link: function(scope, element, attrs, ngModel) {\n              if (!ngModel) return; // do nothing if no ng-model\n\n              // Specify how UI should be updated\n              ngModel.$render = function() {\n                element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n              };\n\n              // Listen for change events to enable binding\n              element.on('blur keyup change', function() {\n                scope.$evalAsync(read);\n              });\n              read(); // initialize\n\n              // Write data to the model\n              function read() {\n                var html = element.html();\n                // When we clear the content editable the browser leaves a <br> behind\n                // If strip-br attribute is provided then we strip this out\n                if ( attrs.stripBr && html == '<br>' ) {\n                  html = '';\n                }\n                ngModel.$setViewValue(html);\n              }\n            }\n          };\n        }]);\n    </file>\n    <file name=\"index.html\">\n      <form name=\"myForm\">\n       <div contenteditable\n            name=\"myWidget\" ng-model=\"userContent\"\n            strip-br=\"true\"\n            required>Change me!</div>\n        <span ng-show=\"myForm.myWidget.$error.required\">Required!</span>\n       <hr>\n       <textarea ng-model=\"userContent\"></textarea>\n      </form>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n    it('should data-bind and become invalid', function() {\n      if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {\n        // SafariDriver can't handle contenteditable\n        // and Firefox driver can't clear contenteditables very well\n        return;\n      }\n      var contentEditable = element(by.css('[contenteditable]'));\n      var content = 'Change me!';\n\n      expect(contentEditable.getText()).toEqual(content);\n\n      contentEditable.clear();\n      contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n      expect(contentEditable.getText()).toEqual('');\n      expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n    });\n    </file>\n * </example>\n *\n *\n */\nvar NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',\n    function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {\n  this.$viewValue = Number.NaN;\n  this.$modelValue = Number.NaN;\n  this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n  this.$validators = {};\n  this.$asyncValidators = {};\n  this.$parsers = [];\n  this.$formatters = [];\n  this.$viewChangeListeners = [];\n  this.$untouched = true;\n  this.$touched = false;\n  this.$pristine = true;\n  this.$dirty = false;\n  this.$valid = true;\n  this.$invalid = false;\n  this.$error = {}; // keep invalid keys here\n  this.$$success = {}; // keep valid keys here\n  this.$pending = undefined; // keep pending keys here\n  this.$name = $interpolate($attr.name || '', false)($scope);\n\n\n  var parsedNgModel = $parse($attr.ngModel),\n      parsedNgModelAssign = parsedNgModel.assign,\n      ngModelGet = parsedNgModel,\n      ngModelSet = parsedNgModelAssign,\n      pendingDebounce = null,\n      ctrl = this;\n\n  this.$$setOptions = function(options) {\n    ctrl.$options = options;\n    if (options && options.getterSetter) {\n      var invokeModelGetter = $parse($attr.ngModel + '()'),\n          invokeModelSetter = $parse($attr.ngModel + '($$$p)');\n\n      ngModelGet = function($scope) {\n        var modelValue = parsedNgModel($scope);\n        if (isFunction(modelValue)) {\n          modelValue = invokeModelGetter($scope);\n        }\n        return modelValue;\n      };\n      ngModelSet = function($scope, newValue) {\n        if (isFunction(parsedNgModel($scope))) {\n          invokeModelSetter($scope, {$$$p: ctrl.$modelValue});\n        } else {\n          parsedNgModelAssign($scope, ctrl.$modelValue);\n        }\n      };\n    } else if (!parsedNgModel.assign) {\n      throw $ngModelMinErr('nonassign', \"Expression '{0}' is non-assignable. Element: {1}\",\n          $attr.ngModel, startingTag($element));\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$render\n   *\n   * @description\n   * Called when the view needs to be updated. It is expected that the user of the ng-model\n   * directive will implement this method.\n   *\n   * The `$render()` method is invoked in the following situations:\n   *\n   * * `$rollbackViewValue()` is called.  If we are rolling back the view value to the last\n   *   committed value then `$render()` is called to update the input control.\n   * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n   *   the `$viewValue` are different to last time.\n   *\n   * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n   * `$modelValue` and `$viewValue` are actually different to their previous value. If `$modelValue`\n   * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n   * invoked if you only change a property on the objects.\n   */\n  this.$render = noop;\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$isEmpty\n   *\n   * @description\n   * This is called when we need to determine if the value of an input is empty.\n   *\n   * For instance, the required directive does this to work out if the input has data or not.\n   *\n   * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n   *\n   * You can override this for input directives whose concept of being empty is different to the\n   * default. The `checkboxInputType` directive does this because in its case a value of `false`\n   * implies empty.\n   *\n   * @param {*} value The value of the input to check for emptiness.\n   * @returns {boolean} True if `value` is \"empty\".\n   */\n  this.$isEmpty = function(value) {\n    return isUndefined(value) || value === '' || value === null || value !== value;\n  };\n\n  var parentForm = $element.inheritedData('$formController') || nullFormCtrl,\n      currentValidationRunId = 0;\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setValidity\n   *\n   * @description\n   * Change the validity state, and notify the form.\n   *\n   * This method can be called within $parsers/$formatters or a custom validation implementation.\n   * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n   * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n   *\n   * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n   *        to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n   *        (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n   *        The `validationErrorKey` should be in camelCase and will get converted into dash-case\n   *        for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n   *        class and can be bound to as  `{{someForm.someControl.$error.myError}}` .\n   * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n   *                          or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n   *                          Skipped is used by Angular when validators do not run because of parse errors and\n   *                          when `$asyncValidators` do not run because any of the `$validators` failed.\n   */\n  addSetValidityMethod({\n    ctrl: this,\n    $element: $element,\n    set: function(object, property) {\n      object[property] = true;\n    },\n    unset: function(object, property) {\n      delete object[property];\n    },\n    parentForm: parentForm,\n    $animate: $animate\n  });\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setPristine\n   *\n   * @description\n   * Sets the control to its pristine state.\n   *\n   * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n   * state (`ng-pristine` class). A model is considered to be pristine when the control\n   * has not been changed from when first compiled.\n   */\n  this.$setPristine = function() {\n    ctrl.$dirty = false;\n    ctrl.$pristine = true;\n    $animate.removeClass($element, DIRTY_CLASS);\n    $animate.addClass($element, PRISTINE_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setDirty\n   *\n   * @description\n   * Sets the control to its dirty state.\n   *\n   * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n   * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n   * from when first compiled.\n   */\n  this.$setDirty = function() {\n    ctrl.$dirty = true;\n    ctrl.$pristine = false;\n    $animate.removeClass($element, PRISTINE_CLASS);\n    $animate.addClass($element, DIRTY_CLASS);\n    parentForm.$setDirty();\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setUntouched\n   *\n   * @description\n   * Sets the control to its untouched state.\n   *\n   * This method can be called to remove the `ng-touched` class and set the control to its\n   * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n   * by default, however this function can be used to restore that state if the model has\n   * already been touched by the user.\n   */\n  this.$setUntouched = function() {\n    ctrl.$touched = false;\n    ctrl.$untouched = true;\n    $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setTouched\n   *\n   * @description\n   * Sets the control to its touched state.\n   *\n   * This method can be called to remove the `ng-untouched` class and set the control to its\n   * touched state (`ng-touched` class). A model is considered to be touched when the user has\n   * first focused the control element and then shifted focus away from the control (blur event).\n   */\n  this.$setTouched = function() {\n    ctrl.$touched = true;\n    ctrl.$untouched = false;\n    $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$rollbackViewValue\n   *\n   * @description\n   * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n   * which may be caused by a pending debounced event or because the input is waiting for a some\n   * future event.\n   *\n   * If you have an input that uses `ng-model-options` to set up debounced events or events such\n   * as blur you can have a situation where there is a period when the `$viewValue`\n   * is out of synch with the ngModel's `$modelValue`.\n   *\n   * In this case, you can run into difficulties if you try to update the ngModel's `$modelValue`\n   * programmatically before these debounced/future events have resolved/occurred, because Angular's\n   * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n   *\n   * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n   * input which may have such events pending. This is important in order to make sure that the\n   * input field will be updated with the new model value and any pending operations are cancelled.\n   *\n   * <example name=\"ng-model-cancel-update\" module=\"cancel-update-example\">\n   *   <file name=\"app.js\">\n   *     angular.module('cancel-update-example', [])\n   *\n   *     .controller('CancelUpdateController', ['$scope', function($scope) {\n   *       $scope.resetWithCancel = function(e) {\n   *         if (e.keyCode == 27) {\n   *           $scope.myForm.myInput1.$rollbackViewValue();\n   *           $scope.myValue = '';\n   *         }\n   *       };\n   *       $scope.resetWithoutCancel = function(e) {\n   *         if (e.keyCode == 27) {\n   *           $scope.myValue = '';\n   *         }\n   *       };\n   *     }]);\n   *   </file>\n   *   <file name=\"index.html\">\n   *     <div ng-controller=\"CancelUpdateController\">\n   *       <p>Try typing something in each input.  See that the model only updates when you\n   *          blur off the input.\n   *        </p>\n   *        <p>Now see what happens if you start typing then press the Escape key</p>\n   *\n   *       <form name=\"myForm\" ng-model-options=\"{ updateOn: 'blur' }\">\n   *         <p>With $rollbackViewValue()</p>\n   *         <input name=\"myInput1\" ng-model=\"myValue\" ng-keydown=\"resetWithCancel($event)\"><br/>\n   *         myValue: \"{{ myValue }}\"\n   *\n   *         <p>Without $rollbackViewValue()</p>\n   *         <input name=\"myInput2\" ng-model=\"myValue\" ng-keydown=\"resetWithoutCancel($event)\"><br/>\n   *         myValue: \"{{ myValue }}\"\n   *       </form>\n   *     </div>\n   *   </file>\n   * </example>\n   */\n  this.$rollbackViewValue = function() {\n    $timeout.cancel(pendingDebounce);\n    ctrl.$viewValue = ctrl.$$lastCommittedViewValue;\n    ctrl.$render();\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$validate\n   *\n   * @description\n   * Runs each of the registered validators (first synchronous validators and then\n   * asynchronous validators).\n   * If the validity changes to invalid, the model will be set to `undefined`,\n   * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n   * If the validity changes to valid, it will set the model to the last available valid\n   * modelValue, i.e. either the last parsed value or the last value set from the scope.\n   */\n  this.$validate = function() {\n    // ignore $validate before model is initialized\n    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n      return;\n    }\n\n    var viewValue = ctrl.$$lastCommittedViewValue;\n    // Note: we use the $$rawModelValue as $modelValue might have been\n    // set to undefined during a view -> model update that found validation\n    // errors. We can't parse the view here, since that could change\n    // the model although neither viewValue nor the model on the scope changed\n    var modelValue = ctrl.$$rawModelValue;\n\n    // Check if the there's a parse error, so we don't unset it accidentially\n    var parserName = ctrl.$$parserName || 'parse';\n    var parserValid = ctrl.$error[parserName] ? false : undefined;\n\n    var prevValid = ctrl.$valid;\n    var prevModelValue = ctrl.$modelValue;\n\n    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n\n    ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) {\n      // If there was no change in validity, don't update the model\n      // This prevents changing an invalid modelValue to undefined\n      if (!allowInvalid && prevValid !== allValid) {\n        // Note: Don't check ctrl.$valid here, as we could have\n        // external validators (e.g. calculated on the server),\n        // that just call $setValidity and need the model value\n        // to calculate their validity.\n        ctrl.$modelValue = allValid ? modelValue : undefined;\n\n        if (ctrl.$modelValue !== prevModelValue) {\n          ctrl.$$writeModelToScope();\n        }\n      }\n    });\n\n  };\n\n  this.$$runValidators = function(parseValid, modelValue, viewValue, doneCallback) {\n    currentValidationRunId++;\n    var localValidationRunId = currentValidationRunId;\n\n    // check parser error\n    if (!processParseErrors(parseValid)) {\n      validationDone(false);\n      return;\n    }\n    if (!processSyncValidators()) {\n      validationDone(false);\n      return;\n    }\n    processAsyncValidators();\n\n    function processParseErrors(parseValid) {\n      var errorKey = ctrl.$$parserName || 'parse';\n      if (parseValid === undefined) {\n        setValidity(errorKey, null);\n      } else {\n        setValidity(errorKey, parseValid);\n        if (!parseValid) {\n          forEach(ctrl.$validators, function(v, name) {\n            setValidity(name, null);\n          });\n          forEach(ctrl.$asyncValidators, function(v, name) {\n            setValidity(name, null);\n          });\n          return false;\n        }\n      }\n      return true;\n    }\n\n    function processSyncValidators() {\n      var syncValidatorsValid = true;\n      forEach(ctrl.$validators, function(validator, name) {\n        var result = validator(modelValue, viewValue);\n        syncValidatorsValid = syncValidatorsValid && result;\n        setValidity(name, result);\n      });\n      if (!syncValidatorsValid) {\n        forEach(ctrl.$asyncValidators, function(v, name) {\n          setValidity(name, null);\n        });\n        return false;\n      }\n      return true;\n    }\n\n    function processAsyncValidators() {\n      var validatorPromises = [];\n      var allValid = true;\n      forEach(ctrl.$asyncValidators, function(validator, name) {\n        var promise = validator(modelValue, viewValue);\n        if (!isPromiseLike(promise)) {\n          throw $ngModelMinErr(\"$asyncValidators\",\n            \"Expected asynchronous validator to return a promise but got '{0}' instead.\", promise);\n        }\n        setValidity(name, undefined);\n        validatorPromises.push(promise.then(function() {\n          setValidity(name, true);\n        }, function(error) {\n          allValid = false;\n          setValidity(name, false);\n        }));\n      });\n      if (!validatorPromises.length) {\n        validationDone(true);\n      } else {\n        $q.all(validatorPromises).then(function() {\n          validationDone(allValid);\n        }, noop);\n      }\n    }\n\n    function setValidity(name, isValid) {\n      if (localValidationRunId === currentValidationRunId) {\n        ctrl.$setValidity(name, isValid);\n      }\n    }\n\n    function validationDone(allValid) {\n      if (localValidationRunId === currentValidationRunId) {\n\n        doneCallback(allValid);\n      }\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$commitViewValue\n   *\n   * @description\n   * Commit a pending update to the `$modelValue`.\n   *\n   * Updates may be pending by a debounced event or because the input is waiting for a some future\n   * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n   * usually handles calling this in response to input events.\n   */\n  this.$commitViewValue = function() {\n    var viewValue = ctrl.$viewValue;\n\n    $timeout.cancel(pendingDebounce);\n\n    // If the view value has not changed then we should just exit, except in the case where there is\n    // a native validator on the element. In this case the validation state may have changed even though\n    // the viewValue has stayed empty.\n    if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {\n      return;\n    }\n    ctrl.$$lastCommittedViewValue = viewValue;\n\n    // change to dirty\n    if (ctrl.$pristine) {\n      this.$setDirty();\n    }\n    this.$$parseAndValidate();\n  };\n\n  this.$$parseAndValidate = function() {\n    var viewValue = ctrl.$$lastCommittedViewValue;\n    var modelValue = viewValue;\n    var parserValid = isUndefined(modelValue) ? undefined : true;\n\n    if (parserValid) {\n      for (var i = 0; i < ctrl.$parsers.length; i++) {\n        modelValue = ctrl.$parsers[i](modelValue);\n        if (isUndefined(modelValue)) {\n          parserValid = false;\n          break;\n        }\n      }\n    }\n    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n      // ctrl.$modelValue has not been touched yet...\n      ctrl.$modelValue = ngModelGet($scope);\n    }\n    var prevModelValue = ctrl.$modelValue;\n    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n    ctrl.$$rawModelValue = modelValue;\n\n    if (allowInvalid) {\n      ctrl.$modelValue = modelValue;\n      writeToModelIfNeeded();\n    }\n\n    // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n    // This can happen if e.g. $setViewValue is called from inside a parser\n    ctrl.$$runValidators(parserValid, modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {\n      if (!allowInvalid) {\n        // Note: Don't check ctrl.$valid here, as we could have\n        // external validators (e.g. calculated on the server),\n        // that just call $setValidity and need the model value\n        // to calculate their validity.\n        ctrl.$modelValue = allValid ? modelValue : undefined;\n        writeToModelIfNeeded();\n      }\n    });\n\n    function writeToModelIfNeeded() {\n      if (ctrl.$modelValue !== prevModelValue) {\n        ctrl.$$writeModelToScope();\n      }\n    }\n  };\n\n  this.$$writeModelToScope = function() {\n    ngModelSet($scope, ctrl.$modelValue);\n    forEach(ctrl.$viewChangeListeners, function(listener) {\n      try {\n        listener();\n      } catch (e) {\n        $exceptionHandler(e);\n      }\n    });\n  };\n\n  /**\n   * @ngdoc method\n   * @name ngModel.NgModelController#$setViewValue\n   *\n   * @description\n   * Update the view value.\n   *\n   * This method should be called when an input directive want to change the view value; typically,\n   * this is done from within a DOM event handler.\n   *\n   * For example {@link ng.directive:input input} calls it when the value of the input changes and\n   * {@link ng.directive:select select} calls it when an option is selected.\n   *\n   * If the new `value` is an object (rather than a string or a number), we should make a copy of the\n   * object before passing it to `$setViewValue`.  This is because `ngModel` does not perform a deep\n   * watch of objects, it only looks for a change of identity. If you only change the property of\n   * the object then ngModel will not realise that the object has changed and will not invoke the\n   * `$parsers` and `$validators` pipelines.\n   *\n   * For this reason, you should not change properties of the copy once it has been passed to\n   * `$setViewValue`. Otherwise you may cause the model value on the scope to change incorrectly.\n   *\n   * When this method is called, the new `value` will be staged for committing through the `$parsers`\n   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n   * value sent directly for processing, finally to be applied to `$modelValue` and then the\n   * **expression** specified in the `ng-model` attribute.\n   *\n   * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.\n   *\n   * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n   * and the `default` trigger is not listed, all those actions will remain pending until one of the\n   * `updateOn` events is triggered on the DOM element.\n   * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n   * directive is used with a custom debounce for this particular event.\n   *\n   * Note that calling this function does not trigger a `$digest`.\n   *\n   * @param {string} value Value from the view.\n   * @param {string} trigger Event that triggered the update.\n   */\n  this.$setViewValue = function(value, trigger) {\n    ctrl.$viewValue = value;\n    if (!ctrl.$options || ctrl.$options.updateOnDefault) {\n      ctrl.$$debounceViewValueCommit(trigger);\n    }\n  };\n\n  this.$$debounceViewValueCommit = function(trigger) {\n    var debounceDelay = 0,\n        options = ctrl.$options,\n        debounce;\n\n    if (options && isDefined(options.debounce)) {\n      debounce = options.debounce;\n      if (isNumber(debounce)) {\n        debounceDelay = debounce;\n      } else if (isNumber(debounce[trigger])) {\n        debounceDelay = debounce[trigger];\n      } else if (isNumber(debounce['default'])) {\n        debounceDelay = debounce['default'];\n      }\n    }\n\n    $timeout.cancel(pendingDebounce);\n    if (debounceDelay) {\n      pendingDebounce = $timeout(function() {\n        ctrl.$commitViewValue();\n      }, debounceDelay);\n    } else if ($rootScope.$$phase) {\n      ctrl.$commitViewValue();\n    } else {\n      $scope.$apply(function() {\n        ctrl.$commitViewValue();\n      });\n    }\n  };\n\n  // model -> value\n  // Note: we cannot use a normal scope.$watch as we want to detect the following:\n  // 1. scope value is 'a'\n  // 2. user enters 'b'\n  // 3. ng-change kicks in and reverts scope value to 'a'\n  //    -> scope value did not change since the last digest as\n  //       ng-change executes in apply phase\n  // 4. view should be changed back to 'a'\n  $scope.$watch(function ngModelWatch() {\n    var modelValue = ngModelGet($scope);\n\n    // if scope model value and ngModel value are out of sync\n    // TODO(perf): why not move this to the action fn?\n    if (modelValue !== ctrl.$modelValue) {\n      ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;\n\n      var formatters = ctrl.$formatters,\n          idx = formatters.length;\n\n      var viewValue = modelValue;\n      while (idx--) {\n        viewValue = formatters[idx](viewValue);\n      }\n      if (ctrl.$viewValue !== viewValue) {\n        ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;\n        ctrl.$render();\n\n        ctrl.$$runValidators(undefined, modelValue, viewValue, noop);\n      }\n    }\n\n    return modelValue;\n  });\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngModel\n *\n * @element input\n * @priority 1\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n *   require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, `ng-untouched`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n *  - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n *  - {@link ng.directive:input input}\n *    - {@link input[text] text}\n *    - {@link input[checkbox] checkbox}\n *    - {@link input[radio] radio}\n *    - {@link input[number] number}\n *    - {@link input[email] email}\n *    - {@link input[url] url}\n *    - {@link input[date] date}\n *    - {@link input[datetime-local] datetime-local}\n *    - {@link input[time] time}\n *    - {@link input[month] month}\n *    - {@link input[week] week}\n *  - {@link ng.directive:select select}\n *  - {@link ng.directive:textarea textarea}\n *\n * # CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n *  - `ng-valid`: the model is valid\n *  - `ng-invalid`: the model is invalid\n *  - `ng-valid-[key]`: for each valid key added by `$setValidity`\n *  - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n *  - `ng-pristine`: the control hasn't been interacted with yet\n *  - `ng-dirty`: the control has been interacted with\n *  - `ng-touched`: the control has been blurred\n *  - `ng-untouched`: the control hasn't been blurred\n *  - `ng-pending`: any `$asyncValidators` are unfulfilled\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * ## Animation Hooks\n *\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-input {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-input.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * </pre>\n *\n * @example\n * <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"inputExample\">\n     <file name=\"index.html\">\n       <script>\n        angular.module('inputExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.val = '1';\n          }]);\n       </script>\n       <style>\n         .my-input {\n           -webkit-transition:all linear 0.5s;\n           transition:all linear 0.5s;\n           background: transparent;\n         }\n         .my-input.ng-invalid {\n           color:white;\n           background: red;\n         }\n       </style>\n       Update input to see transitions when valid/invalid.\n       Integer is a valid value.\n       <form name=\"testForm\" ng-controller=\"ExampleController\">\n         <input ng-model=\"val\" ng-pattern=\"/^\\d+$/\" name=\"anim\" class=\"my-input\" />\n       </form>\n     </file>\n * </example>\n *\n * ## Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function.  A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different than what the model exposes\n * to the view.\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more\n * frequently than other parts of your code.\n * </div>\n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `<form>`, which will enable this behavior for all `<input>`s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * <example name=\"ngModel-getter-setter\" module=\"getterSetterExample\">\n     <file name=\"index.html\">\n       <div ng-controller=\"ExampleController\">\n         <form name=\"userForm\">\n           Name:\n           <input type=\"text\" name=\"userName\"\n                  ng-model=\"user.name\"\n                  ng-model-options=\"{ getterSetter: true }\" />\n         </form>\n         <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n       </div>\n     </file>\n     <file name=\"app.js\">\n       angular.module('getterSetterExample', [])\n         .controller('ExampleController', ['$scope', function($scope) {\n           var _name = 'Brian';\n           $scope.user = {\n             name: function(newName) {\n               if (angular.isDefined(newName)) {\n                 _name = newName;\n               }\n               return _name;\n             }\n           };\n         }]);\n     </file>\n * </example>\n */\nvar ngModelDirective = ['$rootScope', function($rootScope) {\n  return {\n    restrict: 'A',\n    require: ['ngModel', '^?form', '^?ngModelOptions'],\n    controller: NgModelController,\n    // Prelink needs to run before any input directive\n    // so that we can set the NgModelOptions in NgModelController\n    // before anyone else uses it.\n    priority: 1,\n    compile: function ngModelCompile(element) {\n      // Setup initial state of the control\n      element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n\n      return {\n        pre: function ngModelPreLink(scope, element, attr, ctrls) {\n          var modelCtrl = ctrls[0],\n              formCtrl = ctrls[1] || nullFormCtrl;\n\n          modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);\n\n          // notify others, especially parent forms\n          formCtrl.$addControl(modelCtrl);\n\n          attr.$observe('name', function(newValue) {\n            if (modelCtrl.$name !== newValue) {\n              formCtrl.$$renameControl(modelCtrl, newValue);\n            }\n          });\n\n          scope.$on('$destroy', function() {\n            formCtrl.$removeControl(modelCtrl);\n          });\n        },\n        post: function ngModelPostLink(scope, element, attr, ctrls) {\n          var modelCtrl = ctrls[0];\n          if (modelCtrl.$options && modelCtrl.$options.updateOn) {\n            element.on(modelCtrl.$options.updateOn, function(ev) {\n              modelCtrl.$$debounceViewValueCommit(ev && ev.type);\n            });\n          }\n\n          element.on('blur', function(ev) {\n            if (modelCtrl.$touched) return;\n\n            if ($rootScope.$$phase) {\n              scope.$evalAsync(modelCtrl.$setTouched);\n            } else {\n              scope.$apply(modelCtrl.$setTouched);\n            }\n          });\n        }\n      };\n    }\n  };\n}];\n\nvar DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n/**\n * @ngdoc directive\n * @name ngModelOptions\n *\n * @description\n * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of\n * events that will trigger a model update and/or a debouncing delay so that the actual update only\n * takes place when a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different than the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController `$rollbackViewValue`} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController `$rollbackViewValue`}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * `ngModelOptions` has an effect on the element it's declared on and its descendants.\n *\n * @param {Object} ngModelOptions options to apply to the current model. Valid keys are:\n *   - `updateOn`: string specifying which event should the input be bound to. You can set several\n *     events using an space delimited list. There is a special event called `default` that\n *     matches the default events belonging of the control.\n *   - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n *     value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n *     custom value for each event. For example:\n *     `ng-model-options=\"{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }\"`\n *   - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n *     not validate correctly instead of the default behavior of setting the model to undefined.\n *   - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n       `ngModel` as getters/setters.\n *   - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n *     `<input type=\"date\">`, `<input type=\"time\">`, ... . Right now, the only supported value is `'UTC'`,\n *     otherwise the default timezone of the browser will be used.\n *\n * @example\n\n  The following example shows how to override immediate updates. Changes on the inputs within the\n  form will update the model only when the control loses focus (blur event). If `escape` key is\n  pressed while the input field is focused, the value is reset to the value in the current model.\n\n  <example name=\"ngModelOptions-directive-blur\" module=\"optionsExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ updateOn: 'blur' }\"\n                 ng-keyup=\"cancel($event)\" /><br />\n\n          Other data:\n          <input type=\"text\" ng-model=\"user.data\" /><br />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('optionsExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.user = { name: 'say', data: '' };\n\n          $scope.cancel = function(e) {\n            if (e.keyCode == 27) {\n              $scope.userForm.userName.$rollbackViewValue();\n            }\n          };\n        }]);\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var model = element(by.binding('user.name'));\n      var input = element(by.model('user.name'));\n      var other = element(by.model('user.data'));\n\n      it('should allow custom events', function() {\n        input.sendKeys(' hello');\n        input.click();\n        expect(model.getText()).toEqual('say');\n        other.click();\n        expect(model.getText()).toEqual('say hello');\n      });\n\n      it('should $rollbackViewValue when model changes', function() {\n        input.sendKeys(' hello');\n        expect(input.getAttribute('value')).toEqual('say hello');\n        input.sendKeys(protractor.Key.ESCAPE);\n        expect(input.getAttribute('value')).toEqual('say');\n        other.click();\n        expect(model.getText()).toEqual('say');\n      });\n    </file>\n  </example>\n\n  This one shows how to debounce model changes. Model will be updated only 1 sec after last change.\n  If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n\n  <example name=\"ngModelOptions-directive-debounce\" module=\"optionsExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ debounce: 1000 }\" />\n          <button ng-click=\"userForm.userName.$rollbackViewValue(); user.name=''\">Clear</button><br />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('optionsExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.user = { name: 'say' };\n        }]);\n    </file>\n  </example>\n\n  This one shows how to bind to getter/setters:\n\n  <example name=\"ngModelOptions-directive-getter-setter\" module=\"getterSetterExample\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <form name=\"userForm\">\n          Name:\n          <input type=\"text\" name=\"userName\"\n                 ng-model=\"user.name\"\n                 ng-model-options=\"{ getterSetter: true }\" />\n        </form>\n        <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n      </div>\n    </file>\n    <file name=\"app.js\">\n      angular.module('getterSetterExample', [])\n        .controller('ExampleController', ['$scope', function($scope) {\n          var _name = 'Brian';\n          $scope.user = {\n            name: function(newName) {\n              return angular.isDefined(newName) ? (_name = newName) : _name;\n            }\n          };\n        }]);\n    </file>\n  </example>\n */\nvar ngModelOptionsDirective = function() {\n  return {\n    restrict: 'A',\n    controller: ['$scope', '$attrs', function($scope, $attrs) {\n      var that = this;\n      this.$options = $scope.$eval($attrs.ngModelOptions);\n      // Allow adding/overriding bound events\n      if (this.$options.updateOn !== undefined) {\n        this.$options.updateOnDefault = false;\n        // extract \"default\" pseudo-event from list of events that can trigger a model update\n        this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {\n          that.$options.updateOnDefault = true;\n          return ' ';\n        }));\n      } else {\n        this.$options.updateOnDefault = true;\n      }\n    }]\n  };\n};\n\n\n\n// helper methods\nfunction addSetValidityMethod(context) {\n  var ctrl = context.ctrl,\n      $element = context.$element,\n      classCache = {},\n      set = context.set,\n      unset = context.unset,\n      parentForm = context.parentForm,\n      $animate = context.$animate;\n\n  classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));\n\n  ctrl.$setValidity = setValidity;\n\n  function setValidity(validationErrorKey, state, controller) {\n    if (state === undefined) {\n      createAndSet('$pending', validationErrorKey, controller);\n    } else {\n      unsetAndCleanup('$pending', validationErrorKey, controller);\n    }\n    if (!isBoolean(state)) {\n      unset(ctrl.$error, validationErrorKey, controller);\n      unset(ctrl.$$success, validationErrorKey, controller);\n    } else {\n      if (state) {\n        unset(ctrl.$error, validationErrorKey, controller);\n        set(ctrl.$$success, validationErrorKey, controller);\n      } else {\n        set(ctrl.$error, validationErrorKey, controller);\n        unset(ctrl.$$success, validationErrorKey, controller);\n      }\n    }\n    if (ctrl.$pending) {\n      cachedToggleClass(PENDING_CLASS, true);\n      ctrl.$valid = ctrl.$invalid = undefined;\n      toggleValidationCss('', null);\n    } else {\n      cachedToggleClass(PENDING_CLASS, false);\n      ctrl.$valid = isObjectEmpty(ctrl.$error);\n      ctrl.$invalid = !ctrl.$valid;\n      toggleValidationCss('', ctrl.$valid);\n    }\n\n    // re-read the state as the set/unset methods could have\n    // combined state in ctrl.$error[validationError] (used for forms),\n    // where setting/unsetting only increments/decrements the value,\n    // and does not replace it.\n    var combinedState;\n    if (ctrl.$pending && ctrl.$pending[validationErrorKey]) {\n      combinedState = undefined;\n    } else if (ctrl.$error[validationErrorKey]) {\n      combinedState = false;\n    } else if (ctrl.$$success[validationErrorKey]) {\n      combinedState = true;\n    } else {\n      combinedState = null;\n    }\n\n    toggleValidationCss(validationErrorKey, combinedState);\n    parentForm.$setValidity(validationErrorKey, combinedState, ctrl);\n  }\n\n  function createAndSet(name, value, controller) {\n    if (!ctrl[name]) {\n      ctrl[name] = {};\n    }\n    set(ctrl[name], value, controller);\n  }\n\n  function unsetAndCleanup(name, value, controller) {\n    if (ctrl[name]) {\n      unset(ctrl[name], value, controller);\n    }\n    if (isObjectEmpty(ctrl[name])) {\n      ctrl[name] = undefined;\n    }\n  }\n\n  function cachedToggleClass(className, switchValue) {\n    if (switchValue && !classCache[className]) {\n      $animate.addClass($element, className);\n      classCache[className] = true;\n    } else if (!switchValue && classCache[className]) {\n      $animate.removeClass($element, className);\n      classCache[className] = false;\n    }\n  }\n\n  function toggleValidationCss(validationErrorKey, isValid) {\n    validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n\n    cachedToggleClass(VALID_CLASS + validationErrorKey, isValid === true);\n    cachedToggleClass(INVALID_CLASS + validationErrorKey, isValid === false);\n  }\n}\n\nfunction isObjectEmpty(obj) {\n  if (obj) {\n    for (var prop in obj) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n *\n * @description\n * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current\n * DOM element. This is useful if the element contains what appears to be Angular directives and\n * bindings but which should be ignored by Angular. This could be the case if you have a site that\n * displays snippets of code, for instance.\n *\n * @element ANY\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n * @example\n    <example>\n      <file name=\"index.html\">\n        <div>Normal: {{1 + 2}}</div>\n        <div ng-non-bindable>Ignored: {{1 + 2}}</div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n       it('should check ng-non-bindable', function() {\n         expect(element(by.binding('1 + 2')).getText()).toContain('3');\n         expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n       });\n      </file>\n    </example>\n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/**\n * @ngdoc directive\n * @name ngPluralize\n * @restrict EA\n *\n * @description\n * `ngPluralize` is a directive that displays messages according to en-US localization rules.\n * These rules are bundled with angular.js, but can be overridden\n * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive\n * by specifying the mappings between\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * and the strings to be displayed.\n *\n * # Plural categories and explicit number rules\n * There are two\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * in Angular's default en-US locale: \"one\" and \"other\".\n *\n * While a plural category may match many numbers (for example, in en-US locale, \"other\" can match\n * any number that is not 1), an explicit number rule can only match one number. For example, the\n * explicit number rule for \"3\" matches the number 3. There are examples of plural categories\n * and explicit number rules throughout the rest of this documentation.\n *\n * # Configuring ngPluralize\n * You configure ngPluralize by providing 2 attributes: `count` and `when`.\n * You can also provide an optional attribute, `offset`.\n *\n * The value of the `count` attribute can be either a string or an {@link guide/expression\n * Angular expression}; these are evaluated on the current scope for its bound value.\n *\n * The `when` attribute specifies the mappings between plural categories and the actual\n * string to be displayed. The value of the attribute should be a JSON object.\n *\n * The following example shows how to configure ngPluralize:\n *\n * ```html\n * <ng-pluralize count=\"personCount\"\n                 when=\"{'0': 'Nobody is viewing.',\n *                      'one': '1 person is viewing.',\n *                      'other': '{} people are viewing.'}\">\n * </ng-pluralize>\n *```\n *\n * In the example, `\"0: Nobody is viewing.\"` is an explicit number rule. If you did not\n * specify this rule, 0 would be matched to the \"other\" category and \"0 people are viewing\"\n * would be shown instead of \"Nobody is viewing\". You can specify an explicit number rule for\n * other numbers, for example 12, so that instead of showing \"12 people are viewing\", you can\n * show \"a dozen people are viewing\".\n *\n * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted\n * into pluralized strings. In the previous example, Angular will replace `{}` with\n * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder\n * for <span ng-non-bindable>{{numberExpression}}</span>.\n *\n * # Configuring ngPluralize with offset\n * The `offset` attribute allows further customization of pluralized text, which can result in\n * a better user experience. For example, instead of the message \"4 people are viewing this document\",\n * you might display \"John, Kate and 2 others are viewing this document\".\n * The offset attribute allows you to offset a number by any desired value.\n * Let's take a look at an example:\n *\n * ```html\n * <ng-pluralize count=\"personCount\" offset=2\n *               when=\"{'0': 'Nobody is viewing.',\n *                      '1': '{{person1}} is viewing.',\n *                      '2': '{{person1}} and {{person2}} are viewing.',\n *                      'one': '{{person1}}, {{person2}} and one other person are viewing.',\n *                      'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n * </ng-pluralize>\n * ```\n *\n * Notice that we are still using two plural categories(one, other), but we added\n * three explicit number rules 0, 1 and 2.\n * When one person, perhaps John, views the document, \"John is viewing\" will be shown.\n * When three people view the document, no explicit number rule is found, so\n * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.\n * In this case, plural category 'one' is matched and \"John, Mary and one other person are viewing\"\n * is shown.\n *\n * Note that when you specify offsets, you must provide explicit number rules for\n * numbers from 0 up to and including the offset. If you use an offset of 3, for example,\n * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for\n * plural categories \"one\" and \"other\".\n *\n * @param {string|expression} count The variable to be bound to.\n * @param {string} when The mapping between plural category to its corresponding strings.\n * @param {number=} offset Offset to deduct from the total number.\n *\n * @example\n    <example module=\"pluralizeExample\">\n      <file name=\"index.html\">\n        <script>\n          angular.module('pluralizeExample', [])\n            .controller('ExampleController', ['$scope', function($scope) {\n              $scope.person1 = 'Igor';\n              $scope.person2 = 'Misko';\n              $scope.personCount = 1;\n            }]);\n        </script>\n        <div ng-controller=\"ExampleController\">\n          Person 1:<input type=\"text\" ng-model=\"person1\" value=\"Igor\" /><br/>\n          Person 2:<input type=\"text\" ng-model=\"person2\" value=\"Misko\" /><br/>\n          Number of People:<input type=\"text\" ng-model=\"personCount\" value=\"1\" /><br/>\n\n          <!--- Example with simple pluralization rules for en locale --->\n          Without Offset:\n          <ng-pluralize count=\"personCount\"\n                        when=\"{'0': 'Nobody is viewing.',\n                               'one': '1 person is viewing.',\n                               'other': '{} people are viewing.'}\">\n          </ng-pluralize><br>\n\n          <!--- Example with offset --->\n          With Offset(2):\n          <ng-pluralize count=\"personCount\" offset=2\n                        when=\"{'0': 'Nobody is viewing.',\n                               '1': '{{person1}} is viewing.',\n                               '2': '{{person1}} and {{person2}} are viewing.',\n                               'one': '{{person1}}, {{person2}} and one other person are viewing.',\n                               'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n          </ng-pluralize>\n        </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n        it('should show correct pluralized string', function() {\n          var withoutOffset = element.all(by.css('ng-pluralize')).get(0);\n          var withOffset = element.all(by.css('ng-pluralize')).get(1);\n          var countInput = element(by.model('personCount'));\n\n          expect(withoutOffset.getText()).toEqual('1 person is viewing.');\n          expect(withOffset.getText()).toEqual('Igor is viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('0');\n\n          expect(withoutOffset.getText()).toEqual('Nobody is viewing.');\n          expect(withOffset.getText()).toEqual('Nobody is viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('2');\n\n          expect(withoutOffset.getText()).toEqual('2 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('3');\n\n          expect(withoutOffset.getText()).toEqual('3 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');\n\n          countInput.clear();\n          countInput.sendKeys('4');\n\n          expect(withoutOffset.getText()).toEqual('4 people are viewing.');\n          expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');\n        });\n        it('should show data-bound names', function() {\n          var withOffset = element.all(by.css('ng-pluralize')).get(1);\n          var personCount = element(by.model('personCount'));\n          var person1 = element(by.model('person1'));\n          var person2 = element(by.model('person2'));\n          personCount.clear();\n          personCount.sendKeys('4');\n          person1.clear();\n          person1.sendKeys('Di');\n          person2.clear();\n          person2.sendKeys('Vojta');\n          expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');\n        });\n      </file>\n    </example>\n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {\n  var BRACE = /{}/g,\n      IS_WHEN = /^when(Minus)?(.+)$/;\n\n  return {\n    restrict: 'EA',\n    link: function(scope, element, attr) {\n      var numberExp = attr.count,\n          whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs\n          offset = attr.offset || 0,\n          whens = scope.$eval(whenExp) || {},\n          whensExpFns = {},\n          startSymbol = $interpolate.startSymbol(),\n          endSymbol = $interpolate.endSymbol(),\n          braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,\n          watchRemover = angular.noop,\n          lastCount;\n\n      forEach(attr, function(expression, attributeName) {\n        var tmpMatch = IS_WHEN.exec(attributeName);\n        if (tmpMatch) {\n          var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);\n          whens[whenKey] = element.attr(attr.$attr[attributeName]);\n        }\n      });\n      forEach(whens, function(expression, key) {\n        whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));\n\n      });\n\n      scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {\n        var count = parseFloat(newVal);\n        var countIsNaN = isNaN(count);\n\n        if (!countIsNaN && !(count in whens)) {\n          // If an explicit number rule such as 1, 2, 3... is defined, just use it.\n          // Otherwise, check it against pluralization rules in $locale service.\n          count = $locale.pluralCat(count - offset);\n        }\n\n        // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.\n        // In JS `NaN !== NaN`, so we have to exlicitly check.\n        if ((count !== lastCount) && !(countIsNaN && isNaN(lastCount))) {\n          watchRemover();\n          watchRemover = scope.$watch(whensExpFns[count], updateElementText);\n          lastCount = count;\n        }\n      });\n\n      function updateElementText(newText) {\n        element.text(newText || '');\n      }\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngRepeat\n *\n * @description\n * The `ngRepeat` directive instantiates a template once per item from a collection. Each template\n * instance gets its own scope, where the given loop variable is set to the current collection item,\n * and `$index` is set to the item index or key.\n *\n * Special properties are exposed on the local scope of each template instance, including:\n *\n * | Variable  | Type            | Details                                                                     |\n * |-----------|-----------------|-----------------------------------------------------------------------------|\n * | `$index`  | {@type number}  | iterator offset of the repeated element (0..length-1)                       |\n * | `$first`  | {@type boolean} | true if the repeated element is first in the iterator.                      |\n * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |\n * | `$last`   | {@type boolean} | true if the repeated element is last in the iterator.                       |\n * | `$even`   | {@type boolean} | true if the iterator position `$index` is even (otherwise false).           |\n * | `$odd`    | {@type boolean} | true if the iterator position `$index` is odd (otherwise false).            |\n *\n * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.\n * This may be useful when, for instance, nesting ngRepeats.\n *\n * # Iterating over object properties\n *\n * It is possible to get `ngRepeat` to iterate over the properties of an object using the following\n * syntax:\n *\n * ```js\n * <div ng-repeat=\"(key, value) in myObj\"> ... </div>\n * ```\n *\n * You need to be aware that the JavaScript specification does not define what order\n * it will return the keys for an object. In order to have a guaranteed deterministic order\n * for the keys, Angular versions up to and including 1.3 **sort the keys alphabetically**.\n *\n * If this is not desired, the recommended workaround is to convert your object into an array\n * that is sorted into the order that you prefer before providing it to `ngRepeat`.  You could\n * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)\n * or implement a `$watch` on the object yourself.\n *\n * In version 1.4 we will remove the sorting, since it seems that browsers generally follow the\n * strategy of providing keys in the order in which they were defined, although there are exceptions\n * when keys are deleted and reinstated.\n *\n *\n * # Special repeat start and end points\n * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending\n * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.\n * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)\n * up to and including the ending HTML tag where **ng-repeat-end** is placed.\n *\n * The example below makes use of this feature:\n * ```html\n *   <header ng-repeat-start=\"item in items\">\n *     Header {{ item }}\n *   </header>\n *   <div class=\"body\">\n *     Body {{ item }}\n *   </div>\n *   <footer ng-repeat-end>\n *     Footer {{ item }}\n *   </footer>\n * ```\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * ```html\n *   <header>\n *     Header A\n *   </header>\n *   <div class=\"body\">\n *     Body A\n *   </div>\n *   <footer>\n *     Footer A\n *   </footer>\n *   <header>\n *     Header B\n *   </header>\n *   <div class=\"body\">\n *     Body B\n *   </div>\n *   <footer>\n *     Footer B\n *   </footer>\n * ```\n *\n * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such\n * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).\n *\n * @animations\n * **.enter** - when a new item is added to the list or when an item is revealed after a filter\n *\n * **.leave** - when an item is removed from the list or when an item is filtered out\n *\n * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered\n *\n * @element ANY\n * @scope\n * @priority 1000\n * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These\n *   formats are currently supported:\n *\n *   * `variable in expression` – where variable is the user defined loop variable and `expression`\n *     is a scope expression giving the collection to enumerate.\n *\n *     For example: `album in artist.albums`.\n *\n *   * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,\n *     and `expression` is the scope expression giving the collection to enumerate.\n *\n *     For example: `(name, age) in {'adam':10, 'amalie':12}`.\n *\n *   * `variable in expression track by tracking_expression` – You can also provide an optional tracking function\n *     which can be used to associate the objects in the collection with the DOM elements. If no tracking function\n *     is specified the ng-repeat associates elements by identity in the collection. It is an error to have\n *     more than one tracking function to resolve to the same key. (This would mean that two distinct objects are\n *     mapped to the same DOM element, which is not possible.)  Filters should be applied to the expression,\n *     before specifying a tracking expression.\n *\n *     For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements\n *     will be associated by item identity in the array.\n *\n *     For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique\n *     `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements\n *     with the corresponding item in the array by identity. Moving the same object in array would move the DOM\n *     element in the same way in the DOM.\n *\n *     For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this\n *     case the object identity does not matter. Two objects are considered equivalent as long as their `id`\n *     property is same.\n *\n *     For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter\n *     to items in conjunction with a tracking expression.\n *\n *   * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the\n *     intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message\n *     when a filter is active on the repeater, but the filtered result set is empty.\n *\n *     For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after\n *     the items have been processed through the filter.\n *\n * @example\n * This example initializes the scope to a list of names and\n * then uses `ngRepeat` to display every person:\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      <div ng-init=\"friends = [\n        {name:'John', age:25, gender:'boy'},\n        {name:'Jessie', age:30, gender:'girl'},\n        {name:'Johanna', age:28, gender:'girl'},\n        {name:'Joy', age:15, gender:'girl'},\n        {name:'Mary', age:28, gender:'girl'},\n        {name:'Peter', age:95, gender:'boy'},\n        {name:'Sebastian', age:50, gender:'boy'},\n        {name:'Erika', age:27, gender:'girl'},\n        {name:'Patrick', age:40, gender:'boy'},\n        {name:'Samantha', age:60, gender:'girl'}\n      ]\">\n        I have {{friends.length}} friends. They are:\n        <input type=\"search\" ng-model=\"q\" placeholder=\"filter friends...\" />\n        <ul class=\"example-animate-container\">\n          <li class=\"animate-repeat\" ng-repeat=\"friend in friends | filter:q as results\">\n            [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n          </li>\n          <li class=\"animate-repeat\" ng-if=\"results.length == 0\">\n            <strong>No results found...</strong>\n          </li>\n        </ul>\n      </div>\n    </file>\n    <file name=\"animations.css\">\n      .example-animate-container {\n        background:white;\n        border:1px solid black;\n        list-style:none;\n        margin:0;\n        padding:0 10px;\n      }\n\n      .animate-repeat {\n        line-height:40px;\n        list-style:none;\n        box-sizing:border-box;\n      }\n\n      .animate-repeat.ng-move,\n      .animate-repeat.ng-enter,\n      .animate-repeat.ng-leave {\n        -webkit-transition:all linear 0.5s;\n        transition:all linear 0.5s;\n      }\n\n      .animate-repeat.ng-leave.ng-leave-active,\n      .animate-repeat.ng-move,\n      .animate-repeat.ng-enter {\n        opacity:0;\n        max-height:0;\n      }\n\n      .animate-repeat.ng-leave,\n      .animate-repeat.ng-move.ng-move-active,\n      .animate-repeat.ng-enter.ng-enter-active {\n        opacity:1;\n        max-height:40px;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var friends = element.all(by.repeater('friend in friends'));\n\n      it('should render initial data set', function() {\n        expect(friends.count()).toBe(10);\n        expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');\n        expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');\n        expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');\n        expect(element(by.binding('friends.length')).getText())\n            .toMatch(\"I have 10 friends. They are:\");\n      });\n\n       it('should update repeater when filter predicate changes', function() {\n         expect(friends.count()).toBe(10);\n\n         element(by.model('q')).sendKeys('ma');\n\n         expect(friends.count()).toBe(2);\n         expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');\n         expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');\n       });\n      </file>\n    </example>\n */\nvar ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {\n  var NG_REMOVED = '$$NG_REMOVED';\n  var ngRepeatMinErr = minErr('ngRepeat');\n\n  var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {\n    // TODO(perf): generate setters to shave off ~40ms or 1-1.5%\n    scope[valueIdentifier] = value;\n    if (keyIdentifier) scope[keyIdentifier] = key;\n    scope.$index = index;\n    scope.$first = (index === 0);\n    scope.$last = (index === (arrayLength - 1));\n    scope.$middle = !(scope.$first || scope.$last);\n    // jshint bitwise: false\n    scope.$odd = !(scope.$even = (index&1) === 0);\n    // jshint bitwise: true\n  };\n\n  var getBlockStart = function(block) {\n    return block.clone[0];\n  };\n\n  var getBlockEnd = function(block) {\n    return block.clone[block.clone.length - 1];\n  };\n\n\n  return {\n    restrict: 'A',\n    multiElement: true,\n    transclude: 'element',\n    priority: 1000,\n    terminal: true,\n    $$tlb: true,\n    compile: function ngRepeatCompile($element, $attr) {\n      var expression = $attr.ngRepeat;\n      var ngRepeatEndComment = document.createComment(' end ngRepeat: ' + expression + ' ');\n\n      var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\n      if (!match) {\n        throw ngRepeatMinErr('iexp', \"Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.\",\n            expression);\n      }\n\n      var lhs = match[1];\n      var rhs = match[2];\n      var aliasAs = match[3];\n      var trackByExp = match[4];\n\n      match = lhs.match(/^(?:(\\s*[\\$\\w]+)|\\(\\s*([\\$\\w]+)\\s*,\\s*([\\$\\w]+)\\s*\\))$/);\n\n      if (!match) {\n        throw ngRepeatMinErr('iidexp', \"'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.\",\n            lhs);\n      }\n      var valueIdentifier = match[3] || match[1];\n      var keyIdentifier = match[2];\n\n      if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||\n          /^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))) {\n        throw ngRepeatMinErr('badident', \"alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.\",\n          aliasAs);\n      }\n\n      var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;\n      var hashFnLocals = {$id: hashKey};\n\n      if (trackByExp) {\n        trackByExpGetter = $parse(trackByExp);\n      } else {\n        trackByIdArrayFn = function(key, value) {\n          return hashKey(value);\n        };\n        trackByIdObjFn = function(key) {\n          return key;\n        };\n      }\n\n      return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {\n\n        if (trackByExpGetter) {\n          trackByIdExpFn = function(key, value, index) {\n            // assign key, value, and $index to the locals so that they can be used in hash functions\n            if (keyIdentifier) hashFnLocals[keyIdentifier] = key;\n            hashFnLocals[valueIdentifier] = value;\n            hashFnLocals.$index = index;\n            return trackByExpGetter($scope, hashFnLocals);\n          };\n        }\n\n        // Store a list of elements from previous run. This is a hash where key is the item from the\n        // iterator, and the value is objects with following properties.\n        //   - scope: bound scope\n        //   - element: previous element.\n        //   - index: position\n        //\n        // We are using no-proto object so that we don't need to guard against inherited props via\n        // hasOwnProperty.\n        var lastBlockMap = createMap();\n\n        //watch props\n        $scope.$watchCollection(rhs, function ngRepeatAction(collection) {\n          var index, length,\n              previousNode = $element[0],     // node that cloned nodes should be inserted after\n                                              // initialized to the comment node anchor\n              nextNode,\n              // Same as lastBlockMap but it has the current state. It will become the\n              // lastBlockMap on the next iteration.\n              nextBlockMap = createMap(),\n              collectionLength,\n              key, value, // key/value of iteration\n              trackById,\n              trackByIdFn,\n              collectionKeys,\n              block,       // last object information {scope, element, id}\n              nextBlockOrder,\n              elementsToRemove;\n\n          if (aliasAs) {\n            $scope[aliasAs] = collection;\n          }\n\n          if (isArrayLike(collection)) {\n            collectionKeys = collection;\n            trackByIdFn = trackByIdExpFn || trackByIdArrayFn;\n          } else {\n            trackByIdFn = trackByIdExpFn || trackByIdObjFn;\n            // if object, extract keys, sort them and use to determine order of iteration over obj props\n            collectionKeys = [];\n            for (var itemKey in collection) {\n              if (collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$') {\n                collectionKeys.push(itemKey);\n              }\n            }\n            collectionKeys.sort();\n          }\n\n          collectionLength = collectionKeys.length;\n          nextBlockOrder = new Array(collectionLength);\n\n          // locate existing items\n          for (index = 0; index < collectionLength; index++) {\n            key = (collection === collectionKeys) ? index : collectionKeys[index];\n            value = collection[key];\n            trackById = trackByIdFn(key, value, index);\n            if (lastBlockMap[trackById]) {\n              // found previously seen block\n              block = lastBlockMap[trackById];\n              delete lastBlockMap[trackById];\n              nextBlockMap[trackById] = block;\n              nextBlockOrder[index] = block;\n            } else if (nextBlockMap[trackById]) {\n              // if collision detected. restore lastBlockMap and throw an error\n              forEach(nextBlockOrder, function(block) {\n                if (block && block.scope) lastBlockMap[block.id] = block;\n              });\n              throw ngRepeatMinErr('dupes',\n                  \"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}\",\n                  expression, trackById, value);\n            } else {\n              // new never before seen block\n              nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};\n              nextBlockMap[trackById] = true;\n            }\n          }\n\n          // remove leftover items\n          for (var blockKey in lastBlockMap) {\n            block = lastBlockMap[blockKey];\n            elementsToRemove = getBlockNodes(block.clone);\n            $animate.leave(elementsToRemove);\n            if (elementsToRemove[0].parentNode) {\n              // if the element was not removed yet because of pending animation, mark it as deleted\n              // so that we can ignore it later\n              for (index = 0, length = elementsToRemove.length; index < length; index++) {\n                elementsToRemove[index][NG_REMOVED] = true;\n              }\n            }\n            block.scope.$destroy();\n          }\n\n          // we are not using forEach for perf reasons (trying to avoid #call)\n          for (index = 0; index < collectionLength; index++) {\n            key = (collection === collectionKeys) ? index : collectionKeys[index];\n            value = collection[key];\n            block = nextBlockOrder[index];\n\n            if (block.scope) {\n              // if we have already seen this object, then we need to reuse the\n              // associated scope/element\n\n              nextNode = previousNode;\n\n              // skip nodes that are already pending removal via leave animation\n              do {\n                nextNode = nextNode.nextSibling;\n              } while (nextNode && nextNode[NG_REMOVED]);\n\n              if (getBlockStart(block) != nextNode) {\n                // existing item which got moved\n                $animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));\n              }\n              previousNode = getBlockEnd(block);\n              updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n            } else {\n              // new item which we don't know about\n              $transclude(function ngRepeatTransclude(clone, scope) {\n                block.scope = scope;\n                // http://jsperf.com/clone-vs-createcomment\n                var endNode = ngRepeatEndComment.cloneNode(false);\n                clone[clone.length++] = endNode;\n\n                // TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?\n                $animate.enter(clone, null, jqLite(previousNode));\n                previousNode = endNode;\n                // Note: We only need the first/last node of the cloned nodes.\n                // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n                // by a directive with templateUrl when its template arrives.\n                block.clone = clone;\n                nextBlockMap[block.id] = block;\n                updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n              });\n            }\n          }\n          lastBlockMap = nextBlockMap;\n        });\n      };\n    }\n  };\n}];\n\nvar NG_HIDE_CLASS = 'ng-hide';\nvar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';\n/**\n * @ngdoc directive\n * @name ngShow\n *\n * @description\n * The `ngShow` directive shows or hides the given HTML element based on the expression\n * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding\n * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is visible) -->\n * <div ng-show=\"myValue\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is hidden) -->\n * <div ng-show=\"myValue\" class=\"ng-hide\"></div>\n * ```\n *\n * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope\n * with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n *   /&#42; this is just another form of hiding an element &#42;/\n *   display: block!important;\n *   position: absolute;\n *   top: -9999px;\n *   left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngShow`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass except that\n * you must also include the !important flag to override the display property\n * so that you can perform an animation when the element is hidden during the time of the animation.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n *   /&#42; this is required as of 1.3x to properly\n *      apply all styling in a show/hide animation &#42;/\n *   transition: 0s linear all;\n * }\n *\n * .my-element.ng-hide-add-active,\n * .my-element.ng-hide-remove-active {\n *   /&#42; the transition is defined in the active class &#42;/\n *   transition: 1s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible\n * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden\n *\n * @element ANY\n * @param {expression} ngShow If the {@link guide/expression expression} is truthy\n *     then the element is shown or hidden respectively.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n      <div>\n        Show:\n        <div class=\"check-element animate-show\" ng-show=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n        </div>\n      </div>\n      <div>\n        Hide:\n        <div class=\"check-element animate-show\" ng-hide=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n        </div>\n      </div>\n    </file>\n    <file name=\"glyphicons.css\">\n      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n    </file>\n    <file name=\"animations.css\">\n      .animate-show {\n        line-height: 20px;\n        opacity: 1;\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n\n      .animate-show.ng-hide-add.ng-hide-add-active,\n      .animate-show.ng-hide-remove.ng-hide-remove-active {\n        -webkit-transition: all linear 0.5s;\n        transition: all linear 0.5s;\n      }\n\n      .animate-show.ng-hide {\n        line-height: 0;\n        opacity: 0;\n        padding: 0 10px;\n      }\n\n      .check-element {\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n      it('should check ng-show / ng-hide', function() {\n        expect(thumbsUp.isDisplayed()).toBeFalsy();\n        expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n        element(by.model('checked')).click();\n\n        expect(thumbsUp.isDisplayed()).toBeTruthy();\n        expect(thumbsDown.isDisplayed()).toBeFalsy();\n      });\n    </file>\n  </example>\n */\nvar ngShowDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'A',\n    multiElement: true,\n    link: function(scope, element, attr) {\n      scope.$watch(attr.ngShow, function ngShowWatchAction(value) {\n        // we're adding a temporary, animation-specific class for ng-hide since this way\n        // we can control when the element is actually displayed on screen without having\n        // to have a global/greedy CSS selector that breaks when other animations are run.\n        // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845\n        $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {\n          tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n        });\n      });\n    }\n  };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngHide\n *\n * @description\n * The `ngHide` directive shows or hides the given HTML element based on the expression\n * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding\n * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is hidden) -->\n * <div ng-hide=\"myValue\" class=\"ng-hide\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is visible) -->\n * <div ng-hide=\"myValue\"></div>\n * ```\n *\n * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class in CSS:\n *\n * ```css\n * .ng-hide {\n *   /&#42; this is just another form of hiding an element &#42;/\n *   display: block!important;\n *   position: absolute;\n *   top: -9999px;\n *   left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngHide`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`\n * CSS class is added and removed for you instead of your own CSS class.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n *   transition: 0.5s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden\n * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible\n *\n * @element ANY\n * @param {expression} ngHide If the {@link guide/expression expression} is truthy then\n *     the element is shown or hidden respectively.\n *\n * @example\n  <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      Click me: <input type=\"checkbox\" ng-model=\"checked\"><br/>\n      <div>\n        Show:\n        <div class=\"check-element animate-hide\" ng-show=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n        </div>\n      </div>\n      <div>\n        Hide:\n        <div class=\"check-element animate-hide\" ng-hide=\"checked\">\n          <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n        </div>\n      </div>\n    </file>\n    <file name=\"glyphicons.css\">\n      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n    </file>\n    <file name=\"animations.css\">\n      .animate-hide {\n        -webkit-transition: all linear 0.5s;\n        transition: all linear 0.5s;\n        line-height: 20px;\n        opacity: 1;\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n\n      .animate-hide.ng-hide {\n        line-height: 0;\n        opacity: 0;\n        padding: 0 10px;\n      }\n\n      .check-element {\n        padding: 10px;\n        border: 1px solid black;\n        background: white;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n      it('should check ng-show / ng-hide', function() {\n        expect(thumbsUp.isDisplayed()).toBeFalsy();\n        expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n        element(by.model('checked')).click();\n\n        expect(thumbsUp.isDisplayed()).toBeTruthy();\n        expect(thumbsDown.isDisplayed()).toBeFalsy();\n      });\n    </file>\n  </example>\n */\nvar ngHideDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'A',\n    multiElement: true,\n    link: function(scope, element, attr) {\n      scope.$watch(attr.ngHide, function ngHideWatchAction(value) {\n        // The comment inside of the ngShowDirective explains why we add and\n        // remove a temporary class for the show/hide animation\n        $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {\n          tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n        });\n      });\n    }\n  };\n}];\n\n/**\n * @ngdoc directive\n * @name ngStyle\n * @restrict AC\n *\n * @description\n * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.\n *\n * @element ANY\n * @param {expression} ngStyle\n *\n * {@link guide/expression Expression} which evals to an\n * object whose keys are CSS style names and values are corresponding values for those CSS\n * keys.\n *\n * Since some CSS style names are not valid keys for an object, they must be quoted.\n * See the 'background-color' style in the example below.\n *\n * @example\n   <example>\n     <file name=\"index.html\">\n        <input type=\"button\" value=\"set color\" ng-click=\"myStyle={color:'red'}\">\n        <input type=\"button\" value=\"set background\" ng-click=\"myStyle={'background-color':'blue'}\">\n        <input type=\"button\" value=\"clear\" ng-click=\"myStyle={}\">\n        <br/>\n        <span ng-style=\"myStyle\">Sample Text</span>\n        <pre>myStyle={{myStyle}}</pre>\n     </file>\n     <file name=\"style.css\">\n       span {\n         color: black;\n       }\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       var colorSpan = element(by.css('span'));\n\n       it('should check ng-style', function() {\n         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n         element(by.css('input[value=\\'set color\\']')).click();\n         expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');\n         element(by.css('input[value=clear]')).click();\n         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n       });\n     </file>\n   </example>\n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n  scope.$watchCollection(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {\n    if (oldStyles && (newStyles !== oldStyles)) {\n      forEach(oldStyles, function(val, style) { element.css(style, '');});\n    }\n    if (newStyles) element.css(newStyles);\n  });\n});\n\n/**\n * @ngdoc directive\n * @name ngSwitch\n * @restrict EA\n *\n * @description\n * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.\n * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location\n * as specified in the template.\n *\n * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it\n * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element\n * matches the value obtained from the evaluated expression. In other words, you define a container element\n * (where you place the directive), place an expression on the **`on=\"...\"` attribute**\n * (or the **`ng-switch=\"...\"` attribute**), define any inner elements inside of the directive and place\n * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on\n * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default\n * attribute is displayed.\n *\n * <div class=\"alert alert-info\">\n * Be aware that the attribute values to match against cannot be expressions. They are interpreted\n * as literal string values to match against.\n * For example, **`ng-switch-when=\"someVal\"`** will match against the string `\"someVal\"` not against the\n * value of the expression `$scope.someVal`.\n * </div>\n\n * @animations\n * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container\n * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM\n *\n * @usage\n *\n * ```\n * <ANY ng-switch=\"expression\">\n *   <ANY ng-switch-when=\"matchValue1\">...</ANY>\n *   <ANY ng-switch-when=\"matchValue2\">...</ANY>\n *   <ANY ng-switch-default>...</ANY>\n * </ANY>\n * ```\n *\n *\n * @scope\n * @priority 1200\n * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.\n * On child elements add:\n *\n * * `ngSwitchWhen`: the case statement to match against. If match then this\n *   case will be displayed. If the same match appears multiple times, all the\n *   elements will be displayed.\n * * `ngSwitchDefault`: the default case when no other case match. If there\n *   are multiple default cases, all of them will be displayed when no other\n *   case match.\n *\n *\n * @example\n  <example module=\"switchExample\" deps=\"angular-animate.js\" animations=\"true\">\n    <file name=\"index.html\">\n      <div ng-controller=\"ExampleController\">\n        <select ng-model=\"selection\" ng-options=\"item for item in items\">\n        </select>\n        <tt>selection={{selection}}</tt>\n        <hr/>\n        <div class=\"animate-switch-container\"\n          ng-switch on=\"selection\">\n            <div class=\"animate-switch\" ng-switch-when=\"settings\">Settings Div</div>\n            <div class=\"animate-switch\" ng-switch-when=\"home\">Home Span</div>\n            <div class=\"animate-switch\" ng-switch-default>default</div>\n        </div>\n      </div>\n    </file>\n    <file name=\"script.js\">\n      angular.module('switchExample', ['ngAnimate'])\n        .controller('ExampleController', ['$scope', function($scope) {\n          $scope.items = ['settings', 'home', 'other'];\n          $scope.selection = $scope.items[0];\n        }]);\n    </file>\n    <file name=\"animations.css\">\n      .animate-switch-container {\n        position:relative;\n        background:white;\n        border:1px solid black;\n        height:40px;\n        overflow:hidden;\n      }\n\n      .animate-switch {\n        padding:10px;\n      }\n\n      .animate-switch.ng-animate {\n        -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n        position:absolute;\n        top:0;\n        left:0;\n        right:0;\n        bottom:0;\n      }\n\n      .animate-switch.ng-leave.ng-leave-active,\n      .animate-switch.ng-enter {\n        top:-50px;\n      }\n      .animate-switch.ng-leave,\n      .animate-switch.ng-enter.ng-enter-active {\n        top:0;\n      }\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      var switchElem = element(by.css('[ng-switch]'));\n      var select = element(by.model('selection'));\n\n      it('should start in settings', function() {\n        expect(switchElem.getText()).toMatch(/Settings Div/);\n      });\n      it('should change to home', function() {\n        select.all(by.css('option')).get(1).click();\n        expect(switchElem.getText()).toMatch(/Home Span/);\n      });\n      it('should select default', function() {\n        select.all(by.css('option')).get(2).click();\n        expect(switchElem.getText()).toMatch(/default/);\n      });\n    </file>\n  </example>\n */\nvar ngSwitchDirective = ['$animate', function($animate) {\n  return {\n    restrict: 'EA',\n    require: 'ngSwitch',\n\n    // asks for $scope to fool the BC controller module\n    controller: ['$scope', function ngSwitchController() {\n     this.cases = {};\n    }],\n    link: function(scope, element, attr, ngSwitchController) {\n      var watchExpr = attr.ngSwitch || attr.on,\n          selectedTranscludes = [],\n          selectedElements = [],\n          previousLeaveAnimations = [],\n          selectedScopes = [];\n\n      var spliceFactory = function(array, index) {\n          return function() { array.splice(index, 1); };\n      };\n\n      scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n        var i, ii;\n        for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {\n          $animate.cancel(previousLeaveAnimations[i]);\n        }\n        previousLeaveAnimations.length = 0;\n\n        for (i = 0, ii = selectedScopes.length; i < ii; ++i) {\n          var selected = getBlockNodes(selectedElements[i].clone);\n          selectedScopes[i].$destroy();\n          var promise = previousLeaveAnimations[i] = $animate.leave(selected);\n          promise.then(spliceFactory(previousLeaveAnimations, i));\n        }\n\n        selectedElements.length = 0;\n        selectedScopes.length = 0;\n\n        if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n          forEach(selectedTranscludes, function(selectedTransclude) {\n            selectedTransclude.transclude(function(caseElement, selectedScope) {\n              selectedScopes.push(selectedScope);\n              var anchor = selectedTransclude.element;\n              caseElement[caseElement.length++] = document.createComment(' end ngSwitchWhen: ');\n              var block = { clone: caseElement };\n\n              selectedElements.push(block);\n              $animate.enter(caseElement, anchor.parent(), anchor);\n            });\n          });\n        }\n      });\n    }\n  };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n  transclude: 'element',\n  priority: 1200,\n  require: '^ngSwitch',\n  multiElement: true,\n  link: function(scope, element, attrs, ctrl, $transclude) {\n    ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);\n    ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });\n  }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n  transclude: 'element',\n  priority: 1200,\n  require: '^ngSwitch',\n  multiElement: true,\n  link: function(scope, element, attr, ctrl, $transclude) {\n    ctrl.cases['?'] = (ctrl.cases['?'] || []);\n    ctrl.cases['?'].push({ transclude: $transclude, element: element });\n   }\n});\n\n/**\n * @ngdoc directive\n * @name ngTransclude\n * @restrict EAC\n *\n * @description\n * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.\n *\n * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.\n *\n * @element ANY\n *\n * @example\n   <example module=\"transcludeExample\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('transcludeExample', [])\n          .directive('pane', function(){\n             return {\n               restrict: 'E',\n               transclude: true,\n               scope: { title:'@' },\n               template: '<div style=\"border: 1px solid black;\">' +\n                           '<div style=\"background-color: gray\">{{title}}</div>' +\n                           '<ng-transclude></ng-transclude>' +\n                         '</div>'\n             };\n         })\n         .controller('ExampleController', ['$scope', function($scope) {\n           $scope.title = 'Lorem Ipsum';\n           $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n         }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n         <input ng-model=\"title\"> <br/>\n         <textarea ng-model=\"text\"></textarea> <br/>\n         <pane title=\"{{title}}\">{{text}}</pane>\n       </div>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n        it('should have transcluded', function() {\n          var titleElement = element(by.model('title'));\n          titleElement.clear();\n          titleElement.sendKeys('TITLE');\n          var textElement = element(by.model('text'));\n          textElement.clear();\n          textElement.sendKeys('TEXT');\n          expect(element(by.binding('title')).getText()).toEqual('TITLE');\n          expect(element(by.binding('text')).getText()).toEqual('TEXT');\n        });\n     </file>\n   </example>\n *\n */\nvar ngTranscludeDirective = ngDirective({\n  restrict: 'EAC',\n  link: function($scope, $element, $attrs, controller, $transclude) {\n    if (!$transclude) {\n      throw minErr('ngTransclude')('orphan',\n       'Illegal use of ngTransclude directive in the template! ' +\n       'No parent directive that requires a transclusion found. ' +\n       'Element: {0}',\n       startingTag($element));\n    }\n\n    $transclude(function(clone) {\n      $element.empty();\n      $element.append(clone);\n    });\n  }\n});\n\n/**\n * @ngdoc directive\n * @name script\n * @restrict E\n *\n * @description\n * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the\n * template can be used by {@link ng.directive:ngInclude `ngInclude`},\n * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the\n * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be\n * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.\n *\n * @param {string} type Must be set to `'text/ng-template'`.\n * @param {string} id Cache name of the template.\n *\n * @example\n  <example>\n    <file name=\"index.html\">\n      <script type=\"text/ng-template\" id=\"/tpl.html\">\n        Content of the template.\n      </script>\n\n      <a ng-click=\"currentTpl='/tpl.html'\" id=\"tpl-link\">Load inlined template</a>\n      <div id=\"tpl-content\" ng-include src=\"currentTpl\"></div>\n    </file>\n    <file name=\"protractor.js\" type=\"protractor\">\n      it('should load template defined inside script tag', function() {\n        element(by.css('#tpl-link')).click();\n        expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);\n      });\n    </file>\n  </example>\n */\nvar scriptDirective = ['$templateCache', function($templateCache) {\n  return {\n    restrict: 'E',\n    terminal: true,\n    compile: function(element, attr) {\n      if (attr.type == 'text/ng-template') {\n        var templateUrl = attr.id,\n            text = element[0].text;\n\n        $templateCache.put(templateUrl, text);\n      }\n    }\n  };\n}];\n\nvar ngOptionsMinErr = minErr('ngOptions');\n/**\n * @ngdoc directive\n * @name select\n * @restrict E\n *\n * @description\n * HTML `SELECT` element with angular data-binding.\n *\n * # `ngOptions`\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`\n * elements for the `<select>` element using the array or object obtained by evaluating the\n * `ngOptions` comprehension expression.\n *\n * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a\n * similar result. However, `ngOptions` provides some benefits such as reducing memory and\n * increasing speed by not creating a new scope for each repeated instance, as well as providing\n * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound\n *  to a non-string value. This is because an option element can only be bound to string values at\n * present.\n *\n * When an item in the `<select>` menu is selected, the array element or object property\n * represented by the selected option will be bound to the model identified by the `ngModel`\n * directive.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `ngModel` compares by reference, not value. This is important when binding to an\n * array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).\n * </div>\n *\n * ## `select` **`as`**\n *\n * Using `select` **`as`** will bind the result of the `select` expression to the model, but\n * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)\n * or property name (for object data sources) of the value within the collection. If a **`track by`** expression\n * is used, the result of that expression will be set as the value of the `option` and `select` elements.\n *\n *\n * ### `select` **`as`** and **`track by`**\n *\n * <div class=\"alert alert-warning\">\n * Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.\n * </div>\n *\n * Consider the following example:\n *\n * ```html\n * <select ng-options=\"item.subItem as item.label for item in values track by item.id\" ng-model=\"selected\">\n * ```\n *\n * ```js\n * $scope.values = [{\n *   id: 1,\n *   label: 'aLabel',\n *   subItem: { name: 'aSubItem' }\n * }, {\n *   id: 2,\n *   label: 'bLabel',\n *   subItem: { name: 'bSubItem' }\n * }];\n *\n * $scope.selected = { name: 'aSubItem' };\n * ```\n *\n * With the purpose of preserving the selection, the **`track by`** expression is always applied to the element\n * of the data source (to `item` in this example). To calculate whether an element is selected, we do the\n * following:\n *\n * 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`\n * 2. Apply **`track by`** to the already selected value in `ngModel`.\n *    In the example: this is not possible as **`track by`** refers to `item.id`, but the selected\n *    value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to\n *    a wrong object, the selected element can't be found, `<select>` is always reset to the \"not\n *    selected\" option.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required The control is considered valid only if value is entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n *    `required` when you want to data-bind to the `required` attribute.\n * @param {comprehension_expression=} ngOptions in one of the following forms:\n *\n *   * for array data sources:\n *     * `label` **`for`** `value` **`in`** `array`\n *     * `select` **`as`** `label` **`for`** `value` **`in`** `array`\n *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array`\n *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n *     * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`\n *        (for including a filter with `track by`)\n *   * for object data sources:\n *     * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n *     * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n *     * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`\n *     * `select` **`as`** `label` **`group by`** `group`\n *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n *\n * Where:\n *\n *   * `array` / `object`: an expression which evaluates to an array / object to iterate over.\n *   * `value`: local variable which will refer to each item in the `array` or each property value\n *      of `object` during iteration.\n *   * `key`: local variable which will refer to a property name in `object` during iteration.\n *   * `label`: The result of this expression will be the label for `<option>` element. The\n *     `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).\n *   * `select`: The result of this expression will be bound to the model of the parent `<select>`\n *      element. If not specified, `select` expression will default to `value`.\n *   * `group`: The result of this expression will be used to group options using the `<optgroup>`\n *      DOM element.\n *   * `trackexpr`: Used when working with an array of objects. The result of this expression will be\n *      used to identify the objects in the array. The `trackexpr` will most likely refer to the\n *     `value` variable (e.g. `value.propertyName`). With this the selection is preserved\n *      even when the options are recreated (e.g. reloaded from the server).\n *\n * @example\n    <example module=\"selectExample\">\n      <file name=\"index.html\">\n        <script>\n        angular.module('selectExample', [])\n          .controller('ExampleController', ['$scope', function($scope) {\n            $scope.colors = [\n              {name:'black', shade:'dark'},\n              {name:'white', shade:'light'},\n              {name:'red', shade:'dark'},\n              {name:'blue', shade:'dark'},\n              {name:'yellow', shade:'light'}\n            ];\n            $scope.myColor = $scope.colors[2]; // red\n          }]);\n        </script>\n        <div ng-controller=\"ExampleController\">\n          <ul>\n            <li ng-repeat=\"color in colors\">\n              Name: <input ng-model=\"color.name\">\n              [<a href ng-click=\"colors.splice($index, 1)\">X</a>]\n            </li>\n            <li>\n              [<a href ng-click=\"colors.push({})\">add</a>]\n            </li>\n          </ul>\n          <hr/>\n          Color (null not allowed):\n          <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\"></select><br>\n\n          Color (null allowed):\n          <span  class=\"nullable\">\n            <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\">\n              <option value=\"\">-- choose color --</option>\n            </select>\n          </span><br/>\n\n          Color grouped by shade:\n          <select ng-model=\"myColor\" ng-options=\"color.name group by color.shade for color in colors\">\n          </select><br/>\n\n\n          Select <a href ng-click=\"myColor = { name:'not in list', shade: 'other' }\">bogus</a>.<br>\n          <hr/>\n          Currently selected: {{ {selected_color:myColor} }}\n          <div style=\"border:solid 1px black; height:20px\"\n               ng-style=\"{'background-color':myColor.name}\">\n          </div>\n        </div>\n      </file>\n      <file name=\"protractor.js\" type=\"protractor\">\n         it('should check ng-options', function() {\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');\n           element.all(by.model('myColor')).first().click();\n           element.all(by.css('select[ng-model=\"myColor\"] option')).first().click();\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');\n           element(by.css('.nullable select[ng-model=\"myColor\"]')).click();\n           element.all(by.css('.nullable select[ng-model=\"myColor\"] option')).first().click();\n           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');\n         });\n      </file>\n    </example>\n */\n\nvar ngOptionsDirective = valueFn({\n  restrict: 'A',\n  terminal: true\n});\n\n// jshint maxlen: false\nvar selectDirective = ['$compile', '$parse', function($compile,   $parse) {\n                         //000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888\n  var NG_OPTIONS_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+group\\s+by\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?$/,\n      nullModelCtrl = {$setViewValue: noop};\n// jshint maxlen: 100\n\n  return {\n    restrict: 'E',\n    require: ['select', '?ngModel'],\n    controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {\n      var self = this,\n          optionsMap = {},\n          ngModelCtrl = nullModelCtrl,\n          nullOption,\n          unknownOption;\n\n\n      self.databound = $attrs.ngModel;\n\n\n      self.init = function(ngModelCtrl_, nullOption_, unknownOption_) {\n        ngModelCtrl = ngModelCtrl_;\n        nullOption = nullOption_;\n        unknownOption = unknownOption_;\n      };\n\n\n      self.addOption = function(value, element) {\n        assertNotHasOwnProperty(value, '\"option value\"');\n        optionsMap[value] = true;\n\n        if (ngModelCtrl.$viewValue == value) {\n          $element.val(value);\n          if (unknownOption.parent()) unknownOption.remove();\n        }\n        // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459\n        // Adding an <option selected=\"selected\"> element to a <select required=\"required\"> should\n        // automatically select the new element\n        if (element && element[0].hasAttribute('selected')) {\n          element[0].selected = true;\n        }\n      };\n\n\n      self.removeOption = function(value) {\n        if (this.hasOption(value)) {\n          delete optionsMap[value];\n          if (ngModelCtrl.$viewValue === value) {\n            this.renderUnknownOption(value);\n          }\n        }\n      };\n\n\n      self.renderUnknownOption = function(val) {\n        var unknownVal = '? ' + hashKey(val) + ' ?';\n        unknownOption.val(unknownVal);\n        $element.prepend(unknownOption);\n        $element.val(unknownVal);\n        unknownOption.prop('selected', true); // needed for IE\n      };\n\n\n      self.hasOption = function(value) {\n        return optionsMap.hasOwnProperty(value);\n      };\n\n      $scope.$on('$destroy', function() {\n        // disable unknown option so that we don't do work when the whole select is being destroyed\n        self.renderUnknownOption = noop;\n      });\n    }],\n\n    link: function(scope, element, attr, ctrls) {\n      // if ngModel is not defined, we don't need to do anything\n      if (!ctrls[1]) return;\n\n      var selectCtrl = ctrls[0],\n          ngModelCtrl = ctrls[1],\n          multiple = attr.multiple,\n          optionsExp = attr.ngOptions,\n          nullOption = false, // if false, user will not be able to select it (used by ngOptions)\n          emptyOption,\n          renderScheduled = false,\n          // we can't just jqLite('<option>') since jqLite is not smart enough\n          // to create it in <select> and IE barfs otherwise.\n          optionTemplate = jqLite(document.createElement('option')),\n          optGroupTemplate =jqLite(document.createElement('optgroup')),\n          unknownOption = optionTemplate.clone();\n\n      // find \"null\" option\n      for (var i = 0, children = element.children(), ii = children.length; i < ii; i++) {\n        if (children[i].value === '') {\n          emptyOption = nullOption = children.eq(i);\n          break;\n        }\n      }\n\n      selectCtrl.init(ngModelCtrl, nullOption, unknownOption);\n\n      // required validator\n      if (multiple) {\n        ngModelCtrl.$isEmpty = function(value) {\n          return !value || value.length === 0;\n        };\n      }\n\n      if (optionsExp) setupAsOptions(scope, element, ngModelCtrl);\n      else if (multiple) setupAsMultiple(scope, element, ngModelCtrl);\n      else setupAsSingle(scope, element, ngModelCtrl, selectCtrl);\n\n\n      ////////////////////////////\n\n\n\n      function setupAsSingle(scope, selectElement, ngModelCtrl, selectCtrl) {\n        ngModelCtrl.$render = function() {\n          var viewValue = ngModelCtrl.$viewValue;\n\n          if (selectCtrl.hasOption(viewValue)) {\n            if (unknownOption.parent()) unknownOption.remove();\n            selectElement.val(viewValue);\n            if (viewValue === '') emptyOption.prop('selected', true); // to make IE9 happy\n          } else {\n            if (isUndefined(viewValue) && emptyOption) {\n              selectElement.val('');\n            } else {\n              selectCtrl.renderUnknownOption(viewValue);\n            }\n          }\n        };\n\n        selectElement.on('change', function() {\n          scope.$apply(function() {\n            if (unknownOption.parent()) unknownOption.remove();\n            ngModelCtrl.$setViewValue(selectElement.val());\n          });\n        });\n      }\n\n      function setupAsMultiple(scope, selectElement, ctrl) {\n        var lastView;\n        ctrl.$render = function() {\n          var items = new HashMap(ctrl.$viewValue);\n          forEach(selectElement.find('option'), function(option) {\n            option.selected = isDefined(items.get(option.value));\n          });\n        };\n\n        // we have to do it on each watch since ngModel watches reference, but\n        // we need to work of an array, so we need to see if anything was inserted/removed\n        scope.$watch(function selectMultipleWatch() {\n          if (!equals(lastView, ctrl.$viewValue)) {\n            lastView = shallowCopy(ctrl.$viewValue);\n            ctrl.$render();\n          }\n        });\n\n        selectElement.on('change', function() {\n          scope.$apply(function() {\n            var array = [];\n            forEach(selectElement.find('option'), function(option) {\n              if (option.selected) {\n                array.push(option.value);\n              }\n            });\n            ctrl.$setViewValue(array);\n          });\n        });\n      }\n\n      function setupAsOptions(scope, selectElement, ctrl) {\n        var match;\n\n        if (!(match = optionsExp.match(NG_OPTIONS_REGEXP))) {\n          throw ngOptionsMinErr('iexp',\n            \"Expected expression in form of \" +\n            \"'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'\" +\n            \" but got '{0}'. Element: {1}\",\n            optionsExp, startingTag(selectElement));\n        }\n\n        var displayFn = $parse(match[2] || match[1]),\n            valueName = match[4] || match[6],\n            selectAs = / as /.test(match[0]) && match[1],\n            selectAsFn = selectAs ? $parse(selectAs) : null,\n            keyName = match[5],\n            groupByFn = $parse(match[3] || ''),\n            valueFn = $parse(match[2] ? match[1] : valueName),\n            valuesFn = $parse(match[7]),\n            track = match[8],\n            trackFn = track ? $parse(match[8]) : null,\n            trackKeysCache = {},\n            // This is an array of array of existing option groups in DOM.\n            // We try to reuse these if possible\n            // - optionGroupsCache[0] is the options with no option group\n            // - optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element\n            optionGroupsCache = [[{element: selectElement, label:''}]],\n            //re-usable object to represent option's locals\n            locals = {};\n\n        if (nullOption) {\n          // compile the element since there might be bindings in it\n          $compile(nullOption)(scope);\n\n          // remove the class, which is added automatically because we recompile the element and it\n          // becomes the compilation root\n          nullOption.removeClass('ng-scope');\n\n          // we need to remove it before calling selectElement.empty() because otherwise IE will\n          // remove the label from the element. wtf?\n          nullOption.remove();\n        }\n\n        // clear contents, we'll add what's needed based on the model\n        selectElement.empty();\n\n        selectElement.on('change', selectionChanged);\n\n        ctrl.$render = render;\n\n        scope.$watchCollection(valuesFn, scheduleRendering);\n        scope.$watchCollection(getLabels, scheduleRendering);\n\n        if (multiple) {\n          scope.$watchCollection(function() { return ctrl.$modelValue; }, scheduleRendering);\n        }\n\n        // ------------------------------------------------------------------ //\n\n        function callExpression(exprFn, key, value) {\n          locals[valueName] = value;\n          if (keyName) locals[keyName] = key;\n          return exprFn(scope, locals);\n        }\n\n        function selectionChanged() {\n          scope.$apply(function() {\n            var collection = valuesFn(scope) || [];\n            var viewValue;\n            if (multiple) {\n              viewValue = [];\n              forEach(selectElement.val(), function(selectedKey) {\n                  selectedKey = trackFn ? trackKeysCache[selectedKey] : selectedKey;\n                viewValue.push(getViewValue(selectedKey, collection[selectedKey]));\n              });\n            } else {\n              var selectedKey = trackFn ? trackKeysCache[selectElement.val()] : selectElement.val();\n              viewValue = getViewValue(selectedKey, collection[selectedKey]);\n            }\n            ctrl.$setViewValue(viewValue);\n            render();\n          });\n        }\n\n        function getViewValue(key, value) {\n          if (key === '?') {\n            return undefined;\n          } else if (key === '') {\n            return null;\n          } else {\n            var viewValueFn = selectAsFn ? selectAsFn : valueFn;\n            return callExpression(viewValueFn, key, value);\n          }\n        }\n\n        function getLabels() {\n          var values = valuesFn(scope);\n          var toDisplay;\n          if (values && isArray(values)) {\n            toDisplay = new Array(values.length);\n            for (var i = 0, ii = values.length; i < ii; i++) {\n              toDisplay[i] = callExpression(displayFn, i, values[i]);\n            }\n            return toDisplay;\n          } else if (values) {\n            // TODO: Add a test for this case\n            toDisplay = {};\n            for (var prop in values) {\n              if (values.hasOwnProperty(prop)) {\n                toDisplay[prop] = callExpression(displayFn, prop, values[prop]);\n              }\n            }\n          }\n          return toDisplay;\n        }\n\n        function createIsSelectedFn(viewValue) {\n          var selectedSet;\n          if (multiple) {\n            if (trackFn && isArray(viewValue)) {\n\n              selectedSet = new HashMap([]);\n              for (var trackIndex = 0; trackIndex < viewValue.length; trackIndex++) {\n                // tracking by key\n                selectedSet.put(callExpression(trackFn, null, viewValue[trackIndex]), true);\n              }\n            } else {\n              selectedSet = new HashMap(viewValue);\n            }\n          } else if (trackFn) {\n            viewValue = callExpression(trackFn, null, viewValue);\n          }\n\n          return function isSelected(key, value) {\n            var compareValueFn;\n            if (trackFn) {\n              compareValueFn = trackFn;\n            } else if (selectAsFn) {\n              compareValueFn = selectAsFn;\n            } else {\n              compareValueFn = valueFn;\n            }\n\n            if (multiple) {\n              return isDefined(selectedSet.remove(callExpression(compareValueFn, key, value)));\n            } else {\n              return viewValue === callExpression(compareValueFn, key, value);\n            }\n          };\n        }\n\n        function scheduleRendering() {\n          if (!renderScheduled) {\n            scope.$$postDigest(render);\n            renderScheduled = true;\n          }\n        }\n\n        /**\n         * A new labelMap is created with each render.\n         * This function is called for each existing option with added=false,\n         * and each new option with added=true.\n         * - Labels that are passed to this method twice,\n         * (once with added=true and once with added=false) will end up with a value of 0, and\n         * will cause no change to happen to the corresponding option.\n         * - Labels that are passed to this method only once with added=false will end up with a\n         * value of -1 and will eventually be passed to selectCtrl.removeOption()\n         * - Labels that are passed to this method only once with added=true will end up with a\n         * value of 1 and will eventually be passed to selectCtrl.addOption()\n        */\n        function updateLabelMap(labelMap, label, added) {\n          labelMap[label] = labelMap[label] || 0;\n          labelMap[label] += (added ? 1 : -1);\n        }\n\n        function render() {\n          renderScheduled = false;\n\n          // Temporary location for the option groups before we render them\n          var optionGroups = {'':[]},\n              optionGroupNames = [''],\n              optionGroupName,\n              optionGroup,\n              option,\n              existingParent, existingOptions, existingOption,\n              viewValue = ctrl.$viewValue,\n              values = valuesFn(scope) || [],\n              keys = keyName ? sortedKeys(values) : values,\n              key,\n              value,\n              groupLength, length,\n              groupIndex, index,\n              labelMap = {},\n              selected,\n              isSelected = createIsSelectedFn(viewValue),\n              anySelected = false,\n              lastElement,\n              element,\n              label,\n              optionId;\n\n          trackKeysCache = {};\n\n          // We now build up the list of options we need (we merge later)\n          for (index = 0; length = keys.length, index < length; index++) {\n            key = index;\n            if (keyName) {\n              key = keys[index];\n              if (key.charAt(0) === '$') continue;\n            }\n            value = values[key];\n\n            optionGroupName = callExpression(groupByFn, key, value) || '';\n            if (!(optionGroup = optionGroups[optionGroupName])) {\n              optionGroup = optionGroups[optionGroupName] = [];\n              optionGroupNames.push(optionGroupName);\n            }\n\n            selected = isSelected(key, value);\n            anySelected = anySelected || selected;\n\n            label = callExpression(displayFn, key, value); // what will be seen by the user\n\n            // doing displayFn(scope, locals) || '' overwrites zero values\n            label = isDefined(label) ? label : '';\n            optionId = trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index);\n            if (trackFn) {\n              trackKeysCache[optionId] = key;\n            }\n\n            optionGroup.push({\n              // either the index into array or key from object\n              id: optionId,\n              label: label,\n              selected: selected                   // determine if we should be selected\n            });\n          }\n          if (!multiple) {\n            if (nullOption || viewValue === null) {\n              // insert null option if we have a placeholder, or the model is null\n              optionGroups[''].unshift({id:'', label:'', selected:!anySelected});\n            } else if (!anySelected) {\n              // option could not be found, we have to insert the undefined item\n              optionGroups[''].unshift({id:'?', label:'', selected:true});\n            }\n          }\n\n          // Now we need to update the list of DOM nodes to match the optionGroups we computed above\n          for (groupIndex = 0, groupLength = optionGroupNames.length;\n               groupIndex < groupLength;\n               groupIndex++) {\n            // current option group name or '' if no group\n            optionGroupName = optionGroupNames[groupIndex];\n\n            // list of options for that group. (first item has the parent)\n            optionGroup = optionGroups[optionGroupName];\n\n            if (optionGroupsCache.length <= groupIndex) {\n              // we need to grow the optionGroups\n              existingParent = {\n                element: optGroupTemplate.clone().attr('label', optionGroupName),\n                label: optionGroup.label\n              };\n              existingOptions = [existingParent];\n              optionGroupsCache.push(existingOptions);\n              selectElement.append(existingParent.element);\n            } else {\n              existingOptions = optionGroupsCache[groupIndex];\n              existingParent = existingOptions[0];  // either SELECT (no group) or OPTGROUP element\n\n              // update the OPTGROUP label if not the same.\n              if (existingParent.label != optionGroupName) {\n                existingParent.element.attr('label', existingParent.label = optionGroupName);\n              }\n            }\n\n            lastElement = null;  // start at the beginning\n            for (index = 0, length = optionGroup.length; index < length; index++) {\n              option = optionGroup[index];\n              if ((existingOption = existingOptions[index + 1])) {\n                // reuse elements\n                lastElement = existingOption.element;\n                if (existingOption.label !== option.label) {\n                  updateLabelMap(labelMap, existingOption.label, false);\n                  updateLabelMap(labelMap, option.label, true);\n                  lastElement.text(existingOption.label = option.label);\n                  lastElement.prop('label', existingOption.label);\n                }\n                if (existingOption.id !== option.id) {\n                  lastElement.val(existingOption.id = option.id);\n                }\n                // lastElement.prop('selected') provided by jQuery has side-effects\n                if (lastElement[0].selected !== option.selected) {\n                  lastElement.prop('selected', (existingOption.selected = option.selected));\n                  if (msie) {\n                    // See #7692\n                    // The selected item wouldn't visually update on IE without this.\n                    // Tested on Win7: IE9, IE10 and IE11. Future IEs should be tested as well\n                    lastElement.prop('selected', existingOption.selected);\n                  }\n                }\n              } else {\n                // grow elements\n\n                // if it's a null option\n                if (option.id === '' && nullOption) {\n                  // put back the pre-compiled element\n                  element = nullOption;\n                } else {\n                  // jQuery(v1.4.2) Bug: We should be able to chain the method calls, but\n                  // in this version of jQuery on some browser the .text() returns a string\n                  // rather then the element.\n                  (element = optionTemplate.clone())\n                      .val(option.id)\n                      .prop('selected', option.selected)\n                      .attr('selected', option.selected)\n                      .prop('label', option.label)\n                      .text(option.label);\n                }\n\n                existingOptions.push(existingOption = {\n                    element: element,\n                    label: option.label,\n                    id: option.id,\n                    selected: option.selected\n                });\n                updateLabelMap(labelMap, option.label, true);\n                if (lastElement) {\n                  lastElement.after(element);\n                } else {\n                  existingParent.element.append(element);\n                }\n                lastElement = element;\n              }\n            }\n            // remove any excessive OPTIONs in a group\n            index++; // increment since the existingOptions[0] is parent element not OPTION\n            while (existingOptions.length > index) {\n              option = existingOptions.pop();\n              updateLabelMap(labelMap, option.label, false);\n              option.element.remove();\n            }\n          }\n          // remove any excessive OPTGROUPs from select\n          while (optionGroupsCache.length > groupIndex) {\n            // remove all the labels in the option group\n            optionGroup = optionGroupsCache.pop();\n            for (index = 1; index < optionGroup.length; ++index) {\n              updateLabelMap(labelMap, optionGroup[index].label, false);\n            }\n            optionGroup[0].element.remove();\n          }\n          forEach(labelMap, function(count, label) {\n            if (count > 0) {\n              selectCtrl.addOption(label);\n            } else if (count < 0) {\n              selectCtrl.removeOption(label);\n            }\n          });\n        }\n      }\n    }\n  };\n}];\n\nvar optionDirective = ['$interpolate', function($interpolate) {\n  var nullSelectCtrl = {\n    addOption: noop,\n    removeOption: noop\n  };\n\n  return {\n    restrict: 'E',\n    priority: 100,\n    compile: function(element, attr) {\n      if (isUndefined(attr.value)) {\n        var interpolateFn = $interpolate(element.text(), true);\n        if (!interpolateFn) {\n          attr.$set('value', element.text());\n        }\n      }\n\n      return function(scope, element, attr) {\n        var selectCtrlName = '$selectController',\n            parent = element.parent(),\n            selectCtrl = parent.data(selectCtrlName) ||\n              parent.parent().data(selectCtrlName); // in case we are in optgroup\n\n        if (!selectCtrl || !selectCtrl.databound) {\n          selectCtrl = nullSelectCtrl;\n        }\n\n        if (interpolateFn) {\n          scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {\n            attr.$set('value', newVal);\n            if (oldVal !== newVal) {\n              selectCtrl.removeOption(oldVal);\n            }\n            selectCtrl.addOption(newVal, element);\n          });\n        } else {\n          selectCtrl.addOption(attr.value, element);\n        }\n\n        element.on('$destroy', function() {\n          selectCtrl.removeOption(attr.value);\n        });\n      };\n    }\n  };\n}];\n\nvar styleDirective = valueFn({\n  restrict: 'E',\n  terminal: false\n});\n\nvar requiredDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n      attr.required = true; // force truthy in case we are on non input element\n\n      ctrl.$validators.required = function(modelValue, viewValue) {\n        return !attr.required || !ctrl.$isEmpty(viewValue);\n      };\n\n      attr.$observe('required', function() {\n        ctrl.$validate();\n      });\n    }\n  };\n};\n\n\nvar patternDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var regexp, patternExp = attr.ngPattern || attr.pattern;\n      attr.$observe('pattern', function(regex) {\n        if (isString(regex) && regex.length > 0) {\n          regex = new RegExp('^' + regex + '$');\n        }\n\n        if (regex && !regex.test) {\n          throw minErr('ngPattern')('noregexp',\n            'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,\n            regex, startingTag(elm));\n        }\n\n        regexp = regex || undefined;\n        ctrl.$validate();\n      });\n\n      ctrl.$validators.pattern = function(value) {\n        return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);\n      };\n    }\n  };\n};\n\n\nvar maxlengthDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var maxlength = -1;\n      attr.$observe('maxlength', function(value) {\n        var intVal = int(value);\n        maxlength = isNaN(intVal) ? -1 : intVal;\n        ctrl.$validate();\n      });\n      ctrl.$validators.maxlength = function(modelValue, viewValue) {\n        return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);\n      };\n    }\n  };\n};\n\nvar minlengthDirective = function() {\n  return {\n    restrict: 'A',\n    require: '?ngModel',\n    link: function(scope, elm, attr, ctrl) {\n      if (!ctrl) return;\n\n      var minlength = 0;\n      attr.$observe('minlength', function(value) {\n        minlength = int(value) || 0;\n        ctrl.$validate();\n      });\n      ctrl.$validators.minlength = function(modelValue, viewValue) {\n        return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;\n      };\n    }\n  };\n};\n\n  if (window.angular.bootstrap) {\n    //AngularJS is already loaded, so we can return here...\n    console.log('WARNING: Tried to load angular more than once.');\n    return;\n  }\n\n  //try to bind to jquery now so that one can write jqLite(document).ready()\n  //but we will rebind on bootstrap again.\n  bindJQuery();\n\n  publishExternalAPI(angular);\n\n  jqLite(document).ready(function() {\n    angularInit(document, bootstrap);\n  });\n\n})(window, document);\n\n!window.angular.$$csp() && window.angular.element(document).find('head').prepend('<style type=\"text/css\">@charset \"UTF-8\";[ng\\\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\\\:form{display:block;}</style>');\n\n/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* jshint maxlen: false */\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for JavaScript, CSS3 transition and CSS3 keyframe animation hooks within existing core and custom directives.\n *\n * <div doc-module-components=\"ngAnimate\"></div>\n *\n * # Usage\n *\n * To see animations in action, all that is required is to define the appropriate CSS classes\n * or to register a JavaScript animation via the `myModule.animation()` function. The directives that support animation automatically are:\n * `ngRepeat`, `ngInclude`, `ngIf`, `ngSwitch`, `ngShow`, `ngHide`, `ngView` and `ngClass`. Custom directives can take advantage of animation\n * by using the `$animate` service.\n *\n * Below is a more detailed breakdown of the supported animation events provided by pre-existing ng directives:\n *\n * | Directive                                                                                                | Supported Animations                                                     |\n * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n * | {@link ng.directive:ngRepeat#animations ngRepeat}                                                        | enter, leave and move                                                    |\n * | {@link ngRoute.directive:ngView#animations ngView}                                                       | enter and leave                                                          |\n * | {@link ng.directive:ngInclude#animations ngInclude}                                                      | enter and leave                                                          |\n * | {@link ng.directive:ngSwitch#animations ngSwitch}                                                        | enter and leave                                                          |\n * | {@link ng.directive:ngIf#animations ngIf}                                                                | enter and leave                                                          |\n * | {@link ng.directive:ngClass#animations ngClass}                                                          | add and remove (the CSS class(es) present)                               |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide}            | add and remove (the ng-hide class value)                                 |\n * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel}    | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages}                                                          | add and remove (ng-active & ng-inactive)                                 |\n * | {@link module:ngMessages#animations ngMessage}                                                           | enter and leave                                                          |\n *\n * You can find out more information about animations upon visiting each directive page.\n *\n * Below is an example of how to apply animations to a directive that supports animation hooks:\n *\n * ```html\n * <style type=\"text/css\">\n * .slide.ng-enter, .slide.ng-leave {\n *   -webkit-transition:0.5s linear all;\n *   transition:0.5s linear all;\n * }\n *\n * .slide.ng-enter { }        /&#42; starting animations for enter &#42;/\n * .slide.ng-enter.ng-enter-active { } /&#42; terminal animations for enter &#42;/\n * .slide.ng-leave { }        /&#42; starting animations for leave &#42;/\n * .slide.ng-leave.ng-leave-active { } /&#42; terminal animations for leave &#42;/\n * </style>\n *\n * <!--\n * the animate service will automatically add .ng-enter and .ng-leave to the element\n * to trigger the CSS transition/animations\n * -->\n * <ANY class=\"slide\" ng-include=\"...\"></ANY>\n * ```\n *\n * Keep in mind that, by default, if an animation is running, any child elements cannot be animated\n * until the parent element's animation has completed. This blocking feature can be overridden by\n * placing the `ng-animate-children` attribute on a parent container tag.\n *\n * ```html\n * <div class=\"slide-animation\" ng-if=\"on\" ng-animate-children>\n *   <div class=\"fade-animation\" ng-if=\"on\">\n *     <div class=\"explode-animation\" ng-if=\"on\">\n *        ...\n *     </div>\n *   </div>\n * </div>\n * ```\n *\n * When the `on` expression value changes and an animation is triggered then each of the elements within\n * will all animate without the block being applied to child elements.\n *\n * ## Are animations run when the application starts?\n * No they are not. When an application is bootstrapped Angular will disable animations from running to avoid\n * a frenzy of animations from being triggered as soon as the browser has rendered the screen. For this to work,\n * Angular will wait for two digest cycles until enabling animations. From there on, any animation-triggering\n * layout changes in the application will trigger animations as normal.\n *\n * In addition, upon bootstrap, if the routing system or any directives or load remote data (via $http) then Angular\n * will automatically extend the wait time to enable animations once **all** of the outbound HTTP requests\n * are complete.\n *\n * ## CSS-defined Animations\n * The animate service will automatically apply two CSS classes to the animated element and these two CSS classes\n * are designed to contain the start and end CSS styling. Both CSS transitions and keyframe animations are supported\n * and can be used to play along with this naming structure.\n *\n * The following code below demonstrates how to perform animations using **CSS transitions** with Angular:\n *\n * ```html\n * <style type=\"text/css\">\n * /&#42;\n *  The animate class is apart of the element and the ng-enter class\n *  is attached to the element once the enter animation event is triggered\n * &#42;/\n * .reveal-animation.ng-enter {\n *  -webkit-transition: 1s linear all; /&#42; Safari/Chrome &#42;/\n *  transition: 1s linear all; /&#42; All other modern browsers and IE10+ &#42;/\n *\n *  /&#42; The animation preparation code &#42;/\n *  opacity: 0;\n * }\n *\n * /&#42;\n *  Keep in mind that you want to combine both CSS\n *  classes together to avoid any CSS-specificity\n *  conflicts\n * &#42;/\n * .reveal-animation.ng-enter.ng-enter-active {\n *  /&#42; The animation code itself &#42;/\n *  opacity: 1;\n * }\n * </style>\n *\n * <div class=\"view-container\">\n *   <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * ```\n *\n * The following code below demonstrates how to perform animations using **CSS animations** with Angular:\n *\n * ```html\n * <style type=\"text/css\">\n * .reveal-animation.ng-enter {\n *   -webkit-animation: enter_sequence 1s linear; /&#42; Safari/Chrome &#42;/\n *   animation: enter_sequence 1s linear; /&#42; IE10+ and Future Browsers &#42;/\n * }\n * @-webkit-keyframes enter_sequence {\n *   from { opacity:0; }\n *   to { opacity:1; }\n * }\n * @keyframes enter_sequence {\n *   from { opacity:0; }\n *   to { opacity:1; }\n * }\n * </style>\n *\n * <div class=\"view-container\">\n *   <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * ```\n *\n * Both CSS3 animations and transitions can be used together and the animate service will figure out the correct duration and delay timing.\n *\n * Upon DOM mutation, the event class is added first (something like `ng-enter`), then the browser prepares itself to add\n * the active class (in this case `ng-enter-active`) which then triggers the animation. The animation module will automatically\n * detect the CSS code to determine when the animation ends. Once the animation is over then both CSS classes will be\n * removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end\n * immediately resulting in a DOM element that is at its final state. This final state is when the DOM element\n * has no CSS transition/animation classes applied to it.\n *\n * ### Structural transition animations\n *\n * Structural transitions (such as enter, leave and move) will always apply a `0s none` transition\n * value to force the browser into rendering the styles defined in the setup (`.ng-enter`, `.ng-leave`\n * or `.ng-move`) class. This means that any active transition animations operating on the element\n * will be cut off to make way for the enter, leave or move animation.\n *\n * ### Class-based transition animations\n *\n * Class-based transitions refer to transition animations that are triggered when a CSS class is\n * added to or removed from the element (via `$animate.addClass`, `$animate.removeClass`,\n * `$animate.setClass`, or by directives such as `ngClass`, `ngModel` and `form`).\n * They are different when compared to structural animations since they **do not cancel existing\n * animations** nor do they **block successive transitions** from rendering on the same element.\n * This distinction allows for **multiple class-based transitions** to be performed on the same element.\n *\n * In addition to ngAnimate supporting the default (natural) functionality of class-based transition\n * animations, ngAnimate also decorates the element with starting and ending CSS classes to aid the\n * developer in further styling the element throughout the transition animation. Earlier versions\n * of ngAnimate may have caused natural CSS transitions to break and not render properly due to\n * $animate temporarily blocking transitions using `0s none` in order to allow the setup CSS class\n * (the `-add` or `-remove` class) to be applied without triggering an animation. However, as of\n * **version 1.3**, this workaround has been removed with ngAnimate and all non-ngAnimate CSS\n * class transitions are compatible with ngAnimate.\n *\n * There is, however, one special case when dealing with class-based transitions in ngAnimate.\n * When rendering class-based transitions that make use of the setup and active CSS classes\n * (e.g. `.fade-add` and `.fade-add-active` for when `.fade` is added) be sure to define\n * the transition value **on the active CSS class** and not the setup class.\n *\n * ```css\n * .fade-add {\n *   /&#42; remember to place a 0s transition here\n *      to ensure that the styles are applied instantly\n *      even if the element already has a transition style &#42;/\n *   transition:0s linear all;\n *\n *   /&#42; starting CSS styles &#42;/\n *   opacity:1;\n * }\n * .fade-add.fade-add-active {\n *   /&#42; this will be the length of the animation &#42;/\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * The setup CSS class (in this case `.fade-add`) also has a transition style property, however, it\n * has a duration of zero. This may not be required, however, incase the browser is unable to render\n * the styling present in this CSS class instantly then it could be that the browser is attempting\n * to perform an unnecessary transition.\n *\n * This workaround, however, does not apply to  standard class-based transitions that are rendered\n * when a CSS class containing a transition is applied to an element:\n *\n * ```css\n * /&#42; this works as expected &#42;/\n * .fade {\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * Please keep this in mind when coding the CSS markup that will be used within class-based transitions.\n * Also, try not to mix the two class-based animation flavors together since the CSS code may become\n * overly complex.\n *\n *\n * ### Preventing Collisions With Third Party Libraries\n *\n * Some third-party frameworks place animation duration defaults across many element or className\n * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which\n * is expecting actual animations on these elements and has to wait for their completion.\n *\n * You can prevent this unwanted behavior by using a prefix on all your animation classes:\n *\n * ```css\n * /&#42; prefixed with animate- &#42;/\n * .animate-fade-add.animate-fade-add-active {\n *   transition:1s linear all;\n *   opacity:0;\n * }\n * ```\n *\n * You then configure `$animate` to enforce this prefix:\n *\n * ```js\n * $animateProvider.classNameFilter(/animate-/);\n * ```\n * </div>\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n *   /&#42; standard transition code &#42;/\n *   -webkit-transition: 1s linear all;\n *   transition: 1s linear all;\n *   opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n *   /&#42; this will have a 100ms delay between each successive leave animation &#42;/\n *   -webkit-transition-delay: 0.1s;\n *   transition-delay: 0.1s;\n *\n *   /&#42; in case the stagger doesn't work then these two values\n *    must be set to 0 to avoid an accidental CSS inheritance &#42;/\n *   -webkit-transition-duration: 0s;\n *   transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n *   /&#42; standard transition styles &#42;/\n *   opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if more than 10ms has passed after the last animation has been fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * $timeout(function() {\n *   //stagger has reset itself\n *   $animate.leave(kids[5]); //stagger index=0\n *   $animate.leave(kids[6]); //stagger index=1\n * }, 100, false);\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ## JavaScript-defined Animations\n * In the event that you do not want to use CSS3 transitions or CSS3 animations or if you wish to offer animations on browsers that do not\n * yet support CSS transitions/animations, then you can make use of JavaScript animations defined inside of your AngularJS module.\n *\n * ```js\n * //!annotate=\"YourApp\" Your AngularJS Module|Replace this or ngModule with the module that you used to define your application.\n * var ngModule = angular.module('YourApp', ['ngAnimate']);\n * ngModule.animation('.my-crazy-animation', function() {\n *   return {\n *     enter: function(element, done) {\n *       //run the animation here and call done when the animation is complete\n *       return function(cancelled) {\n *         //this (optional) function will be called when the animation\n *         //completes or when the animation is cancelled (the cancelled\n *         //flag will be set to true if cancelled).\n *       };\n *     },\n *     leave: function(element, done) { },\n *     move: function(element, done) { },\n *\n *     //animation that can be triggered before the class is added\n *     beforeAddClass: function(element, className, done) { },\n *\n *     //animation that can be triggered after the class is added\n *     addClass: function(element, className, done) { },\n *\n *     //animation that can be triggered before the class is removed\n *     beforeRemoveClass: function(element, className, done) { },\n *\n *     //animation that can be triggered after the class is removed\n *     removeClass: function(element, className, done) { }\n *   };\n * });\n * ```\n *\n * JavaScript-defined animations are created with a CSS-like class selector and a collection of events which are set to run\n * a javascript callback function. When an animation is triggered, $animate will look for a matching animation which fits\n * the element's CSS class attribute value and then run the matching animation event function (if found).\n * In other words, if the CSS classes present on the animated element match any of the JavaScript animations then the callback function will\n * be executed. It should be also noted that only simple, single class selectors are allowed (compound class selectors are not supported).\n *\n * Within a JavaScript animation, an object containing various event callback animation functions is expected to be returned.\n * As explained above, these callbacks are triggered based on the animation event. Therefore if an enter animation is run,\n * and the JavaScript animation is found, then the enter callback will handle that animation (in addition to the CSS keyframe animation\n * or transition code that is defined via a stylesheet).\n *\n *\n * ### Applying Directive-specific Styles to an Animation\n * In some cases a directive or service may want to provide `$animate` with extra details that the animation will\n * include into its animation. Let's say for example we wanted to render an animation that animates an element\n * towards the mouse coordinates as to where the user clicked last. By collecting the X/Y coordinates of the click\n * (via the event parameter) we can set the `top` and `left` styles into an object and pass that into our function\n * call to `$animate.addClass`.\n *\n * ```js\n * canvas.on('click', function(e) {\n *   $animate.addClass(element, 'on', {\n *     to: {\n *       left : e.client.x + 'px',\n *       top : e.client.y + 'px'\n *     }\n *   }):\n * });\n * ```\n *\n * Now when the animation runs, and a transition or keyframe animation is picked up, then the animation itself will\n * also include and transition the styling of the `left` and `top` properties into its running animation. If we want\n * to provide some starting animation values then we can do so by placing the starting animations styles into an object\n * called `from` in the same object as the `to` animations.\n *\n * ```js\n * canvas.on('click', function(e) {\n *   $animate.addClass(element, 'on', {\n *     from: {\n *        position: 'absolute',\n *        left: '0px',\n *        top: '0px'\n *     },\n *     to: {\n *       left : e.client.x + 'px',\n *       top : e.client.y + 'px'\n *     }\n *   }):\n * });\n * ```\n *\n * Once the animation is complete or cancelled then the union of both the before and after styles are applied to the\n * element. If `ngAnimate` is not present then the styles will be applied immediately.\n *\n */\n\nangular.module('ngAnimate', ['ng'])\n\n  /**\n   * @ngdoc provider\n   * @name $animateProvider\n   * @description\n   *\n   * The `$animateProvider` allows developers to register JavaScript animation event handlers directly inside of a module.\n   * When an animation is triggered, the $animate service will query the $animate service to find any animations that match\n   * the provided name value.\n   *\n   * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n   *\n   * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n   *\n   */\n  .directive('ngAnimateChildren', function() {\n    var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren';\n    return function(scope, element, attrs) {\n      var val = attrs.ngAnimateChildren;\n      if (angular.isString(val) && val.length === 0) { //empty attribute\n        element.data(NG_ANIMATE_CHILDREN, true);\n      } else {\n        scope.$watch(val, function(value) {\n          element.data(NG_ANIMATE_CHILDREN, !!value);\n        });\n      }\n    };\n  })\n\n  //this private service is only used within CSS-enabled animations\n  //IE8 + IE9 do not support rAF natively, but that is fine since they\n  //also don't support transitions and keyframes which means that the code\n  //below will never be used by the two browsers.\n  .factory('$$animateReflow', ['$$rAF', '$document', function($$rAF, $document) {\n    var bod = $document[0].body;\n    return function(fn) {\n      //the returned function acts as the cancellation function\n      return $$rAF(function() {\n        //the line below will force the browser to perform a repaint\n        //so that all the animated elements within the animation frame\n        //will be properly updated and drawn on screen. This is\n        //required to perform multi-class CSS based animations with\n        //Firefox. DO NOT REMOVE THIS LINE.\n        var a = bod.offsetWidth + 1;\n        fn();\n      });\n    };\n  }])\n\n  .config(['$provide', '$animateProvider', function($provide, $animateProvider) {\n    var noop = angular.noop;\n    var forEach = angular.forEach;\n    var selectors = $animateProvider.$$selectors;\n    var isArray = angular.isArray;\n    var isString = angular.isString;\n    var isObject = angular.isObject;\n\n    var ELEMENT_NODE = 1;\n    var NG_ANIMATE_STATE = '$$ngAnimateState';\n    var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren';\n    var NG_ANIMATE_CLASS_NAME = 'ng-animate';\n    var rootAnimateState = {running: true};\n\n    function extractElementNode(element) {\n      for (var i = 0; i < element.length; i++) {\n        var elm = element[i];\n        if (elm.nodeType == ELEMENT_NODE) {\n          return elm;\n        }\n      }\n    }\n\n    function prepareElement(element) {\n      return element && angular.element(element);\n    }\n\n    function stripCommentsFromElement(element) {\n      return angular.element(extractElementNode(element));\n    }\n\n    function isMatchingElement(elm1, elm2) {\n      return extractElementNode(elm1) == extractElementNode(elm2);\n    }\n    var $$jqLite;\n    $provide.decorator('$animate',\n        ['$delegate', '$$q', '$injector', '$sniffer', '$rootElement', '$$asyncCallback', '$rootScope', '$document', '$templateRequest', '$$jqLite',\n function($delegate,   $$q,   $injector,   $sniffer,   $rootElement,   $$asyncCallback,   $rootScope,   $document,   $templateRequest,   $$$jqLite) {\n\n      $$jqLite = $$$jqLite;\n      $rootElement.data(NG_ANIMATE_STATE, rootAnimateState);\n\n      // Wait until all directive and route-related templates are downloaded and\n      // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n      // all of the remote templates being currently downloaded. If there are no\n      // templates currently downloading then the watcher will still fire anyway.\n      var deregisterWatch = $rootScope.$watch(\n        function() { return $templateRequest.totalPendingRequests; },\n        function(val, oldVal) {\n          if (val !== 0) return;\n          deregisterWatch();\n\n          // Now that all templates have been downloaded, $animate will wait until\n          // the post digest queue is empty before enabling animations. By having two\n          // calls to $postDigest calls we can ensure that the flag is enabled at the\n          // very end of the post digest queue. Since all of the animations in $animate\n          // use $postDigest, it's important that the code below executes at the end.\n          // This basically means that the page is fully downloaded and compiled before\n          // any animations are triggered.\n          $rootScope.$$postDigest(function() {\n            $rootScope.$$postDigest(function() {\n              rootAnimateState.running = false;\n            });\n          });\n        }\n      );\n\n      var globalAnimationCounter = 0;\n      var classNameFilter = $animateProvider.classNameFilter();\n      var isAnimatableClassName = !classNameFilter\n              ? function() { return true; }\n              : function(className) {\n                return classNameFilter.test(className);\n              };\n\n      function classBasedAnimationsBlocked(element, setter) {\n        var data = element.data(NG_ANIMATE_STATE) || {};\n        if (setter) {\n          data.running = true;\n          data.structural = true;\n          element.data(NG_ANIMATE_STATE, data);\n        }\n        return data.disabled || (data.running && data.structural);\n      }\n\n      function runAnimationPostDigest(fn) {\n        var cancelFn, defer = $$q.defer();\n        defer.promise.$$cancelFn = function() {\n          cancelFn && cancelFn();\n        };\n        $rootScope.$$postDigest(function() {\n          cancelFn = fn(function() {\n            defer.resolve();\n          });\n        });\n        return defer.promise;\n      }\n\n      function parseAnimateOptions(options) {\n        // some plugin code may still be passing in the callback\n        // function as the last param for the $animate methods so\n        // it's best to only allow string or array values for now\n        if (isObject(options)) {\n          if (options.tempClasses && isString(options.tempClasses)) {\n            options.tempClasses = options.tempClasses.split(/\\s+/);\n          }\n          return options;\n        }\n      }\n\n      function resolveElementClasses(element, cache, runningAnimations) {\n        runningAnimations = runningAnimations || {};\n\n        var lookup = {};\n        forEach(runningAnimations, function(data, selector) {\n          forEach(selector.split(' '), function(s) {\n            lookup[s]=data;\n          });\n        });\n\n        var hasClasses = Object.create(null);\n        forEach((element.attr('class') || '').split(/\\s+/), function(className) {\n          hasClasses[className] = true;\n        });\n\n        var toAdd = [], toRemove = [];\n        forEach((cache && cache.classes) || [], function(status, className) {\n          var hasClass = hasClasses[className];\n          var matchingAnimation = lookup[className] || {};\n\n          // When addClass and removeClass is called then $animate will check to\n          // see if addClass and removeClass cancel each other out. When there are\n          // more calls to removeClass than addClass then the count falls below 0\n          // and then the removeClass animation will be allowed. Otherwise if the\n          // count is above 0 then that means an addClass animation will commence.\n          // Once an animation is allowed then the code will also check to see if\n          // there exists any on-going animation that is already adding or remvoing\n          // the matching CSS class.\n          if (status === false) {\n            //does it have the class or will it have the class\n            if (hasClass || matchingAnimation.event == 'addClass') {\n              toRemove.push(className);\n            }\n          } else if (status === true) {\n            //is the class missing or will it be removed?\n            if (!hasClass || matchingAnimation.event == 'removeClass') {\n              toAdd.push(className);\n            }\n          }\n        });\n\n        return (toAdd.length + toRemove.length) > 0 && [toAdd.join(' '), toRemove.join(' ')];\n      }\n\n      function lookup(name) {\n        if (name) {\n          var matches = [],\n              flagMap = {},\n              classes = name.substr(1).split('.');\n\n          //the empty string value is the default animation\n          //operation which performs CSS transition and keyframe\n          //animations sniffing. This is always included for each\n          //element animation procedure if the browser supports\n          //transitions and/or keyframe animations. The default\n          //animation is added to the top of the list to prevent\n          //any previous animations from affecting the element styling\n          //prior to the element being animated.\n          if ($sniffer.transitions || $sniffer.animations) {\n            matches.push($injector.get(selectors['']));\n          }\n\n          for (var i=0; i < classes.length; i++) {\n            var klass = classes[i],\n                selectorFactoryName = selectors[klass];\n            if (selectorFactoryName && !flagMap[klass]) {\n              matches.push($injector.get(selectorFactoryName));\n              flagMap[klass] = true;\n            }\n          }\n          return matches;\n        }\n      }\n\n      function animationRunner(element, animationEvent, className, options) {\n        //transcluded directives may sometimes fire an animation using only comment nodes\n        //best to catch this early on to prevent any animation operations from occurring\n        var node = element[0];\n        if (!node) {\n          return;\n        }\n\n        if (options) {\n          options.to = options.to || {};\n          options.from = options.from || {};\n        }\n\n        var classNameAdd;\n        var classNameRemove;\n        if (isArray(className)) {\n          classNameAdd = className[0];\n          classNameRemove = className[1];\n          if (!classNameAdd) {\n            className = classNameRemove;\n            animationEvent = 'removeClass';\n          } else if (!classNameRemove) {\n            className = classNameAdd;\n            animationEvent = 'addClass';\n          } else {\n            className = classNameAdd + ' ' + classNameRemove;\n          }\n        }\n\n        var isSetClassOperation = animationEvent == 'setClass';\n        var isClassBased = isSetClassOperation\n                           || animationEvent == 'addClass'\n                           || animationEvent == 'removeClass'\n                           || animationEvent == 'animate';\n\n        var currentClassName = element.attr('class');\n        var classes = currentClassName + ' ' + className;\n        if (!isAnimatableClassName(classes)) {\n          return;\n        }\n\n        var beforeComplete = noop,\n            beforeCancel = [],\n            before = [],\n            afterComplete = noop,\n            afterCancel = [],\n            after = [];\n\n        var animationLookup = (' ' + classes).replace(/\\s+/g,'.');\n        forEach(lookup(animationLookup), function(animationFactory) {\n          var created = registerAnimation(animationFactory, animationEvent);\n          if (!created && isSetClassOperation) {\n            registerAnimation(animationFactory, 'addClass');\n            registerAnimation(animationFactory, 'removeClass');\n          }\n        });\n\n        function registerAnimation(animationFactory, event) {\n          var afterFn = animationFactory[event];\n          var beforeFn = animationFactory['before' + event.charAt(0).toUpperCase() + event.substr(1)];\n          if (afterFn || beforeFn) {\n            if (event == 'leave') {\n              beforeFn = afterFn;\n              //when set as null then animation knows to skip this phase\n              afterFn = null;\n            }\n            after.push({\n              event: event, fn: afterFn\n            });\n            before.push({\n              event: event, fn: beforeFn\n            });\n            return true;\n          }\n        }\n\n        function run(fns, cancellations, allCompleteFn) {\n          var animations = [];\n          forEach(fns, function(animation) {\n            animation.fn && animations.push(animation);\n          });\n\n          var count = 0;\n          function afterAnimationComplete(index) {\n            if (cancellations) {\n              (cancellations[index] || noop)();\n              if (++count < animations.length) return;\n              cancellations = null;\n            }\n            allCompleteFn();\n          }\n\n          //The code below adds directly to the array in order to work with\n          //both sync and async animations. Sync animations are when the done()\n          //operation is called right away. DO NOT REFACTOR!\n          forEach(animations, function(animation, index) {\n            var progress = function() {\n              afterAnimationComplete(index);\n            };\n            switch (animation.event) {\n              case 'setClass':\n                cancellations.push(animation.fn(element, classNameAdd, classNameRemove, progress, options));\n                break;\n              case 'animate':\n                cancellations.push(animation.fn(element, className, options.from, options.to, progress));\n                break;\n              case 'addClass':\n                cancellations.push(animation.fn(element, classNameAdd || className,     progress, options));\n                break;\n              case 'removeClass':\n                cancellations.push(animation.fn(element, classNameRemove || className,  progress, options));\n                break;\n              default:\n                cancellations.push(animation.fn(element, progress, options));\n                break;\n            }\n          });\n\n          if (cancellations && cancellations.length === 0) {\n            allCompleteFn();\n          }\n        }\n\n        return {\n          node: node,\n          event: animationEvent,\n          className: className,\n          isClassBased: isClassBased,\n          isSetClassOperation: isSetClassOperation,\n          applyStyles: function() {\n            if (options) {\n              element.css(angular.extend(options.from || {}, options.to || {}));\n            }\n          },\n          before: function(allCompleteFn) {\n            beforeComplete = allCompleteFn;\n            run(before, beforeCancel, function() {\n              beforeComplete = noop;\n              allCompleteFn();\n            });\n          },\n          after: function(allCompleteFn) {\n            afterComplete = allCompleteFn;\n            run(after, afterCancel, function() {\n              afterComplete = noop;\n              allCompleteFn();\n            });\n          },\n          cancel: function() {\n            if (beforeCancel) {\n              forEach(beforeCancel, function(cancelFn) {\n                (cancelFn || noop)(true);\n              });\n              beforeComplete(true);\n            }\n            if (afterCancel) {\n              forEach(afterCancel, function(cancelFn) {\n                (cancelFn || noop)(true);\n              });\n              afterComplete(true);\n            }\n          }\n        };\n      }\n\n      /**\n       * @ngdoc service\n       * @name $animate\n       * @kind object\n       *\n       * @description\n       * The `$animate` service provides animation detection support while performing DOM operations (enter, leave and move) as well as during addClass and removeClass operations.\n       * When any of these operations are run, the $animate service\n       * will examine any JavaScript-defined animations (which are defined by using the $animateProvider provider object)\n       * as well as any CSS-defined animations against the CSS classes present on the element once the DOM operation is run.\n       *\n       * The `$animate` service is used behind the scenes with pre-existing directives and animation with these directives\n       * will work out of the box without any extra configuration.\n       *\n       * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n       *\n       * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n       * ## Callback Promises\n       * With AngularJS 1.3, each of the animation methods, on the `$animate` service, return a promise when called. The\n       * promise itself is then resolved once the animation has completed itself, has been cancelled or has been\n       * skipped due to animations being disabled. (Note that even if the animation is cancelled it will still\n       * call the resolve function of the animation.)\n       *\n       * ```js\n       * $animate.enter(element, container).then(function() {\n       *   //...this is called once the animation is complete...\n       * });\n       * ```\n       *\n       * Also note that, due to the nature of the callback promise, if any Angular-specific code (like changing the scope,\n       * location of the page, etc...) is executed within the callback promise then be sure to wrap the code using\n       * `$scope.$apply(...)`;\n       *\n       * ```js\n       * $animate.leave(element).then(function() {\n       *   $scope.$apply(function() {\n       *     $location.path('/new-page');\n       *   });\n       * });\n       * ```\n       *\n       * An animation can also be cancelled by calling the `$animate.cancel(promise)` method with the provided\n       * promise that was returned when the animation was started.\n       *\n       * ```js\n       * var promise = $animate.addClass(element, 'super-long-animation');\n       * promise.then(function() {\n       *   //this will still be called even if cancelled\n       * });\n       *\n       * element.on('click', function() {\n       *   //tooo lazy to wait for the animation to end\n       *   $animate.cancel(promise);\n       * });\n       * ```\n       *\n       * (Keep in mind that the promise cancellation is unique to `$animate` since promises in\n       * general cannot be cancelled.)\n       *\n       */\n      return {\n        /**\n         * @ngdoc method\n         * @name $animate#animate\n         * @kind function\n         *\n         * @description\n         * Performs an inline animation on the element which applies the provided `to` and `from` CSS styles to the element.\n         * If any detected CSS transition, keyframe or JavaScript matches the provided `className` value then the animation\n         * will take on the provided styles. For example, if a transition animation is set for the given className then the\n         * provided `from` and `to` styles will be applied alongside the given transition. If a JavaScript animation is\n         * detected then the provided styles will be given in as function paramters.\n         *\n         * ```js\n         * ngModule.animation('.my-inline-animation', function() {\n         *   return {\n         *     animate : function(element, className, from, to, done) {\n         *       //styles\n         *     }\n         *   }\n         * });\n         * ```\n         *\n         * Below is a breakdown of each step that occurs during the `animate` animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                  |\n         * |-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n         * | 1. `$animate.animate(...)` is called                                                                                  | `class=\"my-animation\"`                                       |\n         * | 2. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                            |\n         * | 3. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                            |\n         * | 4. the `className` class value is added to the element                                                                | `class=\"my-animation ng-animate className\"`                  |\n         * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate className\"`                  |\n         * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.className` class styling is applied right away| `class=\"my-animation ng-animate className\"`                  |\n         * | 7. `$animate` applies the provided collection of `from` CSS styles to the element                                     | `class=\"my-animation ng-animate className\"`                  |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate className\"`                  |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate className\"`                  |\n         * | 10. the `className-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate className className-active\"` |\n         * | 11. `$animate` applies the collection of `to` CSS styles to the element which are then handled by the transition      | `class=\"my-animation ng-animate className className-active\"` |\n         * | 12. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate className className-active\"` |\n         * | 13. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                       |\n         * | 14. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                       |\n         *\n         * @param {DOMElement} element the element that will be the focus of the enter animation\n         * @param {object} from a collection of CSS styles that will be applied to the element at the start of the animation\n         * @param {object} to a collection of CSS styles that the element will animate towards\n         * @param {string=} className an optional CSS class that will be added to the element for the duration of the animation (the default class is `ng-inline-animate`)\n         * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        animate: function(element, from, to, className, options) {\n          className = className || 'ng-inline-animate';\n          options = parseAnimateOptions(options) || {};\n          options.from = to ? from : null;\n          options.to   = to ? to : from;\n\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('animate', className, stripCommentsFromElement(element), null, null, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#enter\n         * @kind function\n         *\n         * @description\n         * Appends the element to the parentElement element that resides in the document and then runs the enter animation. Once\n         * the animation is started, the following CSS classes will be present on the element for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during enter animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                |\n         * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n         * | 1. `$animate.enter(...)` is called                                                                                    | `class=\"my-animation\"`                                     |\n         * | 2. element is inserted into the `parentElement` element or beside the `afterElement` element                          | `class=\"my-animation\"`                                     |\n         * | 3. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                          |\n         * | 4. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                          |\n         * | 5. the `.ng-enter` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-enter` class styling is applied right away | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate ng-enter\"`                 |\n         * | 10. the `.ng-enter-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate ng-enter ng-enter-active\"` |\n         * | 11. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate ng-enter ng-enter-active\"` |\n         * | 12. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                     |\n         * | 13. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                     |\n         *\n         * @param {DOMElement} element the element that will be the focus of the enter animation\n         * @param {DOMElement} parentElement the parent element of the element that will be the focus of the enter animation\n         * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation\n         * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        enter: function(element, parentElement, afterElement, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n          parentElement = prepareElement(parentElement);\n          afterElement = prepareElement(afterElement);\n\n          classBasedAnimationsBlocked(element, true);\n          $delegate.enter(element, parentElement, afterElement);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('enter', 'ng-enter', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#leave\n         * @kind function\n         *\n         * @description\n         * Runs the leave animation operation and, upon completion, removes the element from the DOM. Once\n         * the animation is started, the following CSS classes will be added for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during leave animation:\n         *\n         * | Animation Step                                                                                                        | What the element class attribute looks like                |\n         * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n         * | 1. `$animate.leave(...)` is called                                                                                    | `class=\"my-animation\"`                                     |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                          | `class=\"my-animation ng-animate\"`                          |\n         * | 3. `$animate` waits for the next digest to start the animation                                                        | `class=\"my-animation ng-animate\"`                          |\n         * | 4. the `.ng-leave` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay                         | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.ng-leave` class styling is applied right away | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 7. `$animate` waits for a single animation frame (this performs a reflow)                                             | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 8. `$animate` removes the CSS transition block placed on the element                                                  | `class=\"my-animation ng-animate ng-leave\"`                 |\n         * | 9. the `.ng-leave-active` class is added (this triggers the CSS transition/animation)                                 | `class=\"my-animation ng-animate ng-leave ng-leave-active\"` |\n         * | 10. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate ng-leave ng-leave-active\"` |\n         * | 11. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                     |\n         * | 12. The element is removed from the DOM                                                                               | ...                                                        |\n         * | 13. The returned promise is resolved.                                                                                 | ...                                                        |\n         *\n         * @param {DOMElement} element the element that will be the focus of the leave animation\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        leave: function(element, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n\n          cancelChildAnimations(element);\n          classBasedAnimationsBlocked(element, true);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('leave', 'ng-leave', stripCommentsFromElement(element), null, null, function() {\n              $delegate.leave(element);\n            }, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#move\n         * @kind function\n         *\n         * @description\n         * Fires the move DOM operation. Just before the animation starts, the animate service will either append it into the parentElement container or\n         * add the element directly after the afterElement element if present. Then the move animation will be run. Once\n         * the animation is started, the following CSS classes will be added for the duration of the animation:\n         *\n         * Below is a breakdown of each step that occurs during move animation:\n         *\n         * | Animation Step                                                                                                       | What the element class attribute looks like              |\n         * |----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n         * | 1. `$animate.move(...)` is called                                                                                    | `class=\"my-animation\"`                                   |\n         * | 2. element is moved into the parentElement element or beside the afterElement element                                | `class=\"my-animation\"`                                   |\n         * | 3. `$animate` waits for the next digest to start the animation                                                       | `class=\"my-animation ng-animate\"`                        |\n         * | 4. `$animate` runs the JavaScript-defined animations detected on the element                                         | `class=\"my-animation ng-animate\"`                        |\n         * | 5. the `.ng-move` class is added to the element                                                                      | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                        | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-move` class styling is applied right away | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 8. `$animate` waits for a single animation frame (this performs a reflow)                                            | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 9. `$animate` removes the CSS transition block placed on the element                                                 | `class=\"my-animation ng-animate ng-move\"`                |\n         * | 10. the `.ng-move-active` class is added (this triggers the CSS transition/animation)                                | `class=\"my-animation ng-animate ng-move ng-move-active\"` |\n         * | 11. `$animate` waits for the animation to complete (via events and timeout)                                          | `class=\"my-animation ng-animate ng-move ng-move-active\"` |\n         * | 12. The animation ends and all generated CSS classes are removed from the element                                    | `class=\"my-animation\"`                                   |\n         * | 13. The returned promise is resolved.                                                                                | `class=\"my-animation\"`                                   |\n         *\n         * @param {DOMElement} element the element that will be the focus of the move animation\n         * @param {DOMElement} parentElement the parentElement element of the element that will be the focus of the move animation\n         * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        move: function(element, parentElement, afterElement, options) {\n          options = parseAnimateOptions(options);\n          element = angular.element(element);\n          parentElement = prepareElement(parentElement);\n          afterElement = prepareElement(afterElement);\n\n          cancelChildAnimations(element);\n          classBasedAnimationsBlocked(element, true);\n          $delegate.move(element, parentElement, afterElement);\n          return runAnimationPostDigest(function(done) {\n            return performAnimation('move', 'ng-move', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#addClass\n         *\n         * @description\n         * Triggers a custom animation event based off the className variable and then attaches the className value to the element as a CSS class.\n         * Unlike the other animation methods, the animate service will suffix the className value with {@type -add} in order to provide\n         * the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if no CSS transitions\n         * or keyframes are defined on the -add-active or base CSS class).\n         *\n         * Below is a breakdown of each step that occurs during addClass animation:\n         *\n         * | Animation Step                                                                                         | What the element class attribute looks like                        |\n         * |--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n         * | 1. `$animate.addClass(element, 'super')` is called                                                     | `class=\"my-animation\"`                                             |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                           | `class=\"my-animation ng-animate\"`                                  |\n         * | 3. the `.super-add` class is added to the element                                                      | `class=\"my-animation ng-animate super-add\"`                        |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                              | `class=\"my-animation ng-animate super-add\"`                        |\n         * | 5. the `.super` and `.super-add-active` classes are added (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay          | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                             | `class=\"my-animation ng-animate super super-add super-add-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                       | `class=\"my-animation super\"`                                       |\n         * | 9. The super class is kept on the element                                                              | `class=\"my-animation super\"`                                       |\n         * | 10. The returned promise is resolved.                                                                  | `class=\"my-animation super\"`                                       |\n         *\n         * @param {DOMElement} element the element that will be animated\n         * @param {string} className the CSS class that will be added to the element and then animated\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        addClass: function(element, className, options) {\n          return this.setClass(element, className, [], options);\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#removeClass\n         *\n         * @description\n         * Triggers a custom animation event based off the className variable and then removes the CSS class provided by the className value\n         * from the element. Unlike the other animation methods, the animate service will suffix the className value with {@type -remove} in\n         * order to provide the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if\n         * no CSS transitions or keyframes are defined on the -remove or base CSS classes).\n         *\n         * Below is a breakdown of each step that occurs during removeClass animation:\n         *\n         * | Animation Step                                                                                                       | What the element class attribute looks like                        |\n         * |----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n         * | 1. `$animate.removeClass(element, 'super')` is called                                                                | `class=\"my-animation super\"`                                       |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                         | `class=\"my-animation super ng-animate\"`                            |\n         * | 3. the `.super-remove` class is added to the element                                                                 | `class=\"my-animation super ng-animate super-remove\"`               |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                                            | `class=\"my-animation super ng-animate super-remove\"`               |\n         * | 5. the `.super-remove-active` classes are added and `.super` is removed (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                        | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                                           | `class=\"my-animation ng-animate super-remove super-remove-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                                     | `class=\"my-animation\"`                                             |\n         * | 9. The returned promise is resolved.                                                                                 | `class=\"my-animation\"`                                             |\n         *\n         *\n         * @param {DOMElement} element the element that will be animated\n         * @param {string} className the CSS class that will be animated and then removed from the element\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n        */\n        removeClass: function(element, className, options) {\n          return this.setClass(element, [], className, options);\n        },\n\n        /**\n         *\n         * @ngdoc method\n         * @name $animate#setClass\n         *\n         * @description Adds and/or removes the given CSS classes to and from the element.\n         * Once complete, the `done()` callback will be fired (if provided).\n         *\n         * | Animation Step                                                                                                                               | What the element class attribute looks like                                            |\n         * |----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n         * | 1. `$animate.setClass(element, 'on', 'off')` is called                                                                                       | `class=\"my-animation off\"`                                                             |\n         * | 2. `$animate` runs the JavaScript-defined animations detected on the element                                                                 | `class=\"my-animation ng-animate off\"`                                                  |\n         * | 3. the `.on-add` and `.off-remove` classes are added to the element                                                                          | `class=\"my-animation ng-animate on-add off-remove off\"`                                |\n         * | 4. `$animate` waits for a single animation frame (this performs a reflow)                                                                    | `class=\"my-animation ng-animate on-add off-remove off\"`                                |\n         * | 5. the `.on`, `.on-add-active` and `.off-remove-active` classes are added and `.off` is removed (this triggers the CSS transition/animation) | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay                                                | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 7. `$animate` waits for the animation to complete (via events and timeout)                                                                   | `class=\"my-animation ng-animate on on-add on-add-active off-remove off-remove-active\"` |\n         * | 8. The animation ends and all generated CSS classes are removed from the element                                                             | `class=\"my-animation on\"`                                                              |\n         * | 9. The returned promise is resolved.                                                                                                         | `class=\"my-animation on\"`                                                              |\n         *\n         * @param {DOMElement} element the element which will have its CSS classes changed\n         *   removed from it\n         * @param {string} add the CSS classes which will be added to the element\n         * @param {string} remove the CSS class which will be removed from the element\n         *   CSS classes have been set on the element\n         * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation\n         * @return {Promise} the animation callback promise\n         */\n        setClass: function(element, add, remove, options) {\n          options = parseAnimateOptions(options);\n\n          var STORAGE_KEY = '$$animateClasses';\n          element = angular.element(element);\n          element = stripCommentsFromElement(element);\n\n          if (classBasedAnimationsBlocked(element)) {\n            return $delegate.$$setClassImmediately(element, add, remove, options);\n          }\n\n          // we're using a combined array for both the add and remove\n          // operations since the ORDER OF addClass and removeClass matters\n          var classes, cache = element.data(STORAGE_KEY);\n          var hasCache = !!cache;\n          if (!cache) {\n            cache = {};\n            cache.classes = {};\n          }\n          classes = cache.classes;\n\n          add = isArray(add) ? add : add.split(' ');\n          forEach(add, function(c) {\n            if (c && c.length) {\n              classes[c] = true;\n            }\n          });\n\n          remove = isArray(remove) ? remove : remove.split(' ');\n          forEach(remove, function(c) {\n            if (c && c.length) {\n              classes[c] = false;\n            }\n          });\n\n          if (hasCache) {\n            if (options && cache.options) {\n              cache.options = angular.extend(cache.options || {}, options);\n            }\n\n            //the digest cycle will combine all the animations into one function\n            return cache.promise;\n          } else {\n            element.data(STORAGE_KEY, cache = {\n              classes: classes,\n              options: options\n            });\n          }\n\n          return cache.promise = runAnimationPostDigest(function(done) {\n            var parentElement = element.parent();\n            var elementNode = extractElementNode(element);\n            var parentNode = elementNode.parentNode;\n            // TODO(matsko): move this code into the animationsDisabled() function once #8092 is fixed\n            if (!parentNode || parentNode['$$NG_REMOVED'] || elementNode['$$NG_REMOVED']) {\n              done();\n              return;\n            }\n\n            var cache = element.data(STORAGE_KEY);\n            element.removeData(STORAGE_KEY);\n\n            var state = element.data(NG_ANIMATE_STATE) || {};\n            var classes = resolveElementClasses(element, cache, state.active);\n            return !classes\n              ? done()\n              : performAnimation('setClass', classes, element, parentElement, null, function() {\n                  if (classes[0]) $delegate.$$addClassImmediately(element, classes[0]);\n                  if (classes[1]) $delegate.$$removeClassImmediately(element, classes[1]);\n                }, cache.options, done);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#cancel\n         * @kind function\n         *\n         * @param {Promise} animationPromise The animation promise that is returned when an animation is started.\n         *\n         * @description\n         * Cancels the provided animation.\n        */\n        cancel: function(promise) {\n          promise.$$cancelFn();\n        },\n\n        /**\n         * @ngdoc method\n         * @name $animate#enabled\n         * @kind function\n         *\n         * @param {boolean=} value If provided then set the animation on or off.\n         * @param {DOMElement=} element If provided then the element will be used to represent the enable/disable operation\n         * @return {boolean} Current animation state.\n         *\n         * @description\n         * Globally enables/disables animations.\n         *\n        */\n        enabled: function(value, element) {\n          switch (arguments.length) {\n            case 2:\n              if (value) {\n                cleanup(element);\n              } else {\n                var data = element.data(NG_ANIMATE_STATE) || {};\n                data.disabled = true;\n                element.data(NG_ANIMATE_STATE, data);\n              }\n            break;\n\n            case 1:\n              rootAnimateState.disabled = !value;\n            break;\n\n            default:\n              value = !rootAnimateState.disabled;\n            break;\n          }\n          return !!value;\n         }\n      };\n\n      /*\n        all animations call this shared animation triggering function internally.\n        The animationEvent variable refers to the JavaScript animation event that will be triggered\n        and the className value is the name of the animation that will be applied within the\n        CSS code. Element, `parentElement` and `afterElement` are provided DOM elements for the animation\n        and the onComplete callback will be fired once the animation is fully complete.\n      */\n      function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {\n        var noopCancel = noop;\n        var runner = animationRunner(element, animationEvent, className, options);\n        if (!runner) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          closeAnimation();\n          return noopCancel;\n        }\n\n        animationEvent = runner.event;\n        className = runner.className;\n        var elementEvents = angular.element._data(runner.node);\n        elementEvents = elementEvents && elementEvents.events;\n\n        if (!parentElement) {\n          parentElement = afterElement ? afterElement.parent() : element.parent();\n        }\n\n        //skip the animation if animations are disabled, a parent is already being animated,\n        //the element is not currently attached to the document body or then completely close\n        //the animation if any matching animations are not found at all.\n        //NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case an animation was found.\n        if (animationsDisabled(element, parentElement)) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          closeAnimation();\n          return noopCancel;\n        }\n\n        var ngAnimateState  = element.data(NG_ANIMATE_STATE) || {};\n        var runningAnimations     = ngAnimateState.active || {};\n        var totalActiveAnimations = ngAnimateState.totalActive || 0;\n        var lastAnimation         = ngAnimateState.last;\n        var skipAnimation = false;\n\n        if (totalActiveAnimations > 0) {\n          var animationsToCancel = [];\n          if (!runner.isClassBased) {\n            if (animationEvent == 'leave' && runningAnimations['ng-leave']) {\n              skipAnimation = true;\n            } else {\n              //cancel all animations when a structural animation takes place\n              for (var klass in runningAnimations) {\n                animationsToCancel.push(runningAnimations[klass]);\n              }\n              ngAnimateState = {};\n              cleanup(element, true);\n            }\n          } else if (lastAnimation.event == 'setClass') {\n            animationsToCancel.push(lastAnimation);\n            cleanup(element, className);\n          } else if (runningAnimations[className]) {\n            var current = runningAnimations[className];\n            if (current.event == animationEvent) {\n              skipAnimation = true;\n            } else {\n              animationsToCancel.push(current);\n              cleanup(element, className);\n            }\n          }\n\n          if (animationsToCancel.length > 0) {\n            forEach(animationsToCancel, function(operation) {\n              operation.cancel();\n            });\n          }\n        }\n\n        if (runner.isClassBased\n            && !runner.isSetClassOperation\n            && animationEvent != 'animate'\n            && !skipAnimation) {\n          skipAnimation = (animationEvent == 'addClass') == element.hasClass(className); //opposite of XOR\n        }\n\n        if (skipAnimation) {\n          fireDOMOperation();\n          fireBeforeCallbackAsync();\n          fireAfterCallbackAsync();\n          fireDoneCallbackAsync();\n          return noopCancel;\n        }\n\n        runningAnimations     = ngAnimateState.active || {};\n        totalActiveAnimations = ngAnimateState.totalActive || 0;\n\n        if (animationEvent == 'leave') {\n          //there's no need to ever remove the listener since the element\n          //will be removed (destroyed) after the leave animation ends or\n          //is cancelled midway\n          element.one('$destroy', function(e) {\n            var element = angular.element(this);\n            var state = element.data(NG_ANIMATE_STATE);\n            if (state) {\n              var activeLeaveAnimation = state.active['ng-leave'];\n              if (activeLeaveAnimation) {\n                activeLeaveAnimation.cancel();\n                cleanup(element, 'ng-leave');\n              }\n            }\n          });\n        }\n\n        //the ng-animate class does nothing, but it's here to allow for\n        //parent animations to find and cancel child animations when needed\n        $$jqLite.addClass(element, NG_ANIMATE_CLASS_NAME);\n        if (options && options.tempClasses) {\n          forEach(options.tempClasses, function(className) {\n            $$jqLite.addClass(element, className);\n          });\n        }\n\n        var localAnimationCount = globalAnimationCounter++;\n        totalActiveAnimations++;\n        runningAnimations[className] = runner;\n\n        element.data(NG_ANIMATE_STATE, {\n          last: runner,\n          active: runningAnimations,\n          index: localAnimationCount,\n          totalActive: totalActiveAnimations\n        });\n\n        //first we run the before animations and when all of those are complete\n        //then we perform the DOM operation and run the next set of animations\n        fireBeforeCallbackAsync();\n        runner.before(function(cancelled) {\n          var data = element.data(NG_ANIMATE_STATE);\n          cancelled = cancelled ||\n                        !data || !data.active[className] ||\n                        (runner.isClassBased && data.active[className].event != animationEvent);\n\n          fireDOMOperation();\n          if (cancelled === true) {\n            closeAnimation();\n          } else {\n            fireAfterCallbackAsync();\n            runner.after(closeAnimation);\n          }\n        });\n\n        return runner.cancel;\n\n        function fireDOMCallback(animationPhase) {\n          var eventName = '$animate:' + animationPhase;\n          if (elementEvents && elementEvents[eventName] && elementEvents[eventName].length > 0) {\n            $$asyncCallback(function() {\n              element.triggerHandler(eventName, {\n                event: animationEvent,\n                className: className\n              });\n            });\n          }\n        }\n\n        function fireBeforeCallbackAsync() {\n          fireDOMCallback('before');\n        }\n\n        function fireAfterCallbackAsync() {\n          fireDOMCallback('after');\n        }\n\n        function fireDoneCallbackAsync() {\n          fireDOMCallback('close');\n          doneCallback();\n        }\n\n        //it is less complicated to use a flag than managing and canceling\n        //timeouts containing multiple callbacks.\n        function fireDOMOperation() {\n          if (!fireDOMOperation.hasBeenRun) {\n            fireDOMOperation.hasBeenRun = true;\n            domOperation();\n          }\n        }\n\n        function closeAnimation() {\n          if (!closeAnimation.hasBeenRun) {\n            if (runner) { //the runner doesn't exist if it fails to instantiate\n              runner.applyStyles();\n            }\n\n            closeAnimation.hasBeenRun = true;\n            if (options && options.tempClasses) {\n              forEach(options.tempClasses, function(className) {\n                $$jqLite.removeClass(element, className);\n              });\n            }\n\n            var data = element.data(NG_ANIMATE_STATE);\n            if (data) {\n\n              /* only structural animations wait for reflow before removing an\n                 animation, but class-based animations don't. An example of this\n                 failing would be when a parent HTML tag has a ng-class attribute\n                 causing ALL directives below to skip animations during the digest */\n              if (runner && runner.isClassBased) {\n                cleanup(element, className);\n              } else {\n                $$asyncCallback(function() {\n                  var data = element.data(NG_ANIMATE_STATE) || {};\n                  if (localAnimationCount == data.index) {\n                    cleanup(element, className, animationEvent);\n                  }\n                });\n                element.data(NG_ANIMATE_STATE, data);\n              }\n            }\n            fireDoneCallbackAsync();\n          }\n        }\n      }\n\n      function cancelChildAnimations(element) {\n        var node = extractElementNode(element);\n        if (node) {\n          var nodes = angular.isFunction(node.getElementsByClassName) ?\n            node.getElementsByClassName(NG_ANIMATE_CLASS_NAME) :\n            node.querySelectorAll('.' + NG_ANIMATE_CLASS_NAME);\n          forEach(nodes, function(element) {\n            element = angular.element(element);\n            var data = element.data(NG_ANIMATE_STATE);\n            if (data && data.active) {\n              forEach(data.active, function(runner) {\n                runner.cancel();\n              });\n            }\n          });\n        }\n      }\n\n      function cleanup(element, className) {\n        if (isMatchingElement(element, $rootElement)) {\n          if (!rootAnimateState.disabled) {\n            rootAnimateState.running = false;\n            rootAnimateState.structural = false;\n          }\n        } else if (className) {\n          var data = element.data(NG_ANIMATE_STATE) || {};\n\n          var removeAnimations = className === true;\n          if (!removeAnimations && data.active && data.active[className]) {\n            data.totalActive--;\n            delete data.active[className];\n          }\n\n          if (removeAnimations || !data.totalActive) {\n            $$jqLite.removeClass(element, NG_ANIMATE_CLASS_NAME);\n            element.removeData(NG_ANIMATE_STATE);\n          }\n        }\n      }\n\n      function animationsDisabled(element, parentElement) {\n        if (rootAnimateState.disabled) {\n          return true;\n        }\n\n        if (isMatchingElement(element, $rootElement)) {\n          return rootAnimateState.running;\n        }\n\n        var allowChildAnimations, parentRunningAnimation, hasParent;\n        do {\n          //the element did not reach the root element which means that it\n          //is not apart of the DOM. Therefore there is no reason to do\n          //any animations on it\n          if (parentElement.length === 0) break;\n\n          var isRoot = isMatchingElement(parentElement, $rootElement);\n          var state = isRoot ? rootAnimateState : (parentElement.data(NG_ANIMATE_STATE) || {});\n          if (state.disabled) {\n            return true;\n          }\n\n          //no matter what, for an animation to work it must reach the root element\n          //this implies that the element is attached to the DOM when the animation is run\n          if (isRoot) {\n            hasParent = true;\n          }\n\n          //once a flag is found that is strictly false then everything before\n          //it will be discarded and all child animations will be restricted\n          if (allowChildAnimations !== false) {\n            var animateChildrenFlag = parentElement.data(NG_ANIMATE_CHILDREN);\n            if (angular.isDefined(animateChildrenFlag)) {\n              allowChildAnimations = animateChildrenFlag;\n            }\n          }\n\n          parentRunningAnimation = parentRunningAnimation ||\n                                   state.running ||\n                                   (state.last && !state.last.isClassBased);\n        }\n        while (parentElement = parentElement.parent());\n\n        return !hasParent || (!allowChildAnimations && parentRunningAnimation);\n      }\n    }]);\n\n    $animateProvider.register('', ['$window', '$sniffer', '$timeout', '$$animateReflow',\n                           function($window,   $sniffer,   $timeout,   $$animateReflow) {\n      // Detect proper transitionend/animationend event names.\n      var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n      // If unprefixed events are not supported but webkit-prefixed are, use the latter.\n      // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n      // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n      // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n      // Register both events in case `window.onanimationend` is not supported because of that,\n      // do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n      // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n      // therefore there is no reason to test anymore for other vendor prefixes: http://caniuse.com/#search=transition\n      if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {\n        CSS_PREFIX = '-webkit-';\n        TRANSITION_PROP = 'WebkitTransition';\n        TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n      } else {\n        TRANSITION_PROP = 'transition';\n        TRANSITIONEND_EVENT = 'transitionend';\n      }\n\n      if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {\n        CSS_PREFIX = '-webkit-';\n        ANIMATION_PROP = 'WebkitAnimation';\n        ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n      } else {\n        ANIMATION_PROP = 'animation';\n        ANIMATIONEND_EVENT = 'animationend';\n      }\n\n      var DURATION_KEY = 'Duration';\n      var PROPERTY_KEY = 'Property';\n      var DELAY_KEY = 'Delay';\n      var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\n      var ANIMATION_PLAYSTATE_KEY = 'PlayState';\n      var NG_ANIMATE_PARENT_KEY = '$$ngAnimateKey';\n      var NG_ANIMATE_CSS_DATA_KEY = '$$ngAnimateCSS3Data';\n      var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\n      var CLOSING_TIME_BUFFER = 1.5;\n      var ONE_SECOND = 1000;\n\n      var lookupCache = {};\n      var parentCounter = 0;\n      var animationReflowQueue = [];\n      var cancelAnimationReflow;\n      function clearCacheAfterReflow() {\n        if (!cancelAnimationReflow) {\n          cancelAnimationReflow = $$animateReflow(function() {\n            animationReflowQueue = [];\n            cancelAnimationReflow = null;\n            lookupCache = {};\n          });\n        }\n      }\n\n      function afterReflow(element, callback) {\n        if (cancelAnimationReflow) {\n          cancelAnimationReflow();\n        }\n        animationReflowQueue.push(callback);\n        cancelAnimationReflow = $$animateReflow(function() {\n          forEach(animationReflowQueue, function(fn) {\n            fn();\n          });\n\n          animationReflowQueue = [];\n          cancelAnimationReflow = null;\n          lookupCache = {};\n        });\n      }\n\n      var closingTimer = null;\n      var closingTimestamp = 0;\n      var animationElementQueue = [];\n      function animationCloseHandler(element, totalTime) {\n        var node = extractElementNode(element);\n        element = angular.element(node);\n\n        //this item will be garbage collected by the closing\n        //animation timeout\n        animationElementQueue.push(element);\n\n        //but it may not need to cancel out the existing timeout\n        //if the timestamp is less than the previous one\n        var futureTimestamp = Date.now() + totalTime;\n        if (futureTimestamp <= closingTimestamp) {\n          return;\n        }\n\n        $timeout.cancel(closingTimer);\n\n        closingTimestamp = futureTimestamp;\n        closingTimer = $timeout(function() {\n          closeAllAnimations(animationElementQueue);\n          animationElementQueue = [];\n        }, totalTime, false);\n      }\n\n      function closeAllAnimations(elements) {\n        forEach(elements, function(element) {\n          var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);\n          if (elementData) {\n            forEach(elementData.closeAnimationFns, function(fn) {\n              fn();\n            });\n          }\n        });\n      }\n\n      function getElementAnimationDetails(element, cacheKey) {\n        var data = cacheKey ? lookupCache[cacheKey] : null;\n        if (!data) {\n          var transitionDuration = 0;\n          var transitionDelay = 0;\n          var animationDuration = 0;\n          var animationDelay = 0;\n\n          //we want all the styles defined before and after\n          forEach(element, function(element) {\n            if (element.nodeType == ELEMENT_NODE) {\n              var elementStyles = $window.getComputedStyle(element) || {};\n\n              var transitionDurationStyle = elementStyles[TRANSITION_PROP + DURATION_KEY];\n              transitionDuration = Math.max(parseMaxTime(transitionDurationStyle), transitionDuration);\n\n              var transitionDelayStyle = elementStyles[TRANSITION_PROP + DELAY_KEY];\n              transitionDelay  = Math.max(parseMaxTime(transitionDelayStyle), transitionDelay);\n\n              var animationDelayStyle = elementStyles[ANIMATION_PROP + DELAY_KEY];\n              animationDelay   = Math.max(parseMaxTime(elementStyles[ANIMATION_PROP + DELAY_KEY]), animationDelay);\n\n              var aDuration  = parseMaxTime(elementStyles[ANIMATION_PROP + DURATION_KEY]);\n\n              if (aDuration > 0) {\n                aDuration *= parseInt(elementStyles[ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY], 10) || 1;\n              }\n              animationDuration = Math.max(aDuration, animationDuration);\n            }\n          });\n          data = {\n            total: 0,\n            transitionDelay: transitionDelay,\n            transitionDuration: transitionDuration,\n            animationDelay: animationDelay,\n            animationDuration: animationDuration\n          };\n          if (cacheKey) {\n            lookupCache[cacheKey] = data;\n          }\n        }\n        return data;\n      }\n\n      function parseMaxTime(str) {\n        var maxValue = 0;\n        var values = isString(str) ?\n          str.split(/\\s*,\\s*/) :\n          [];\n        forEach(values, function(value) {\n          maxValue = Math.max(parseFloat(value) || 0, maxValue);\n        });\n        return maxValue;\n      }\n\n      function getCacheKey(element) {\n        var parentElement = element.parent();\n        var parentID = parentElement.data(NG_ANIMATE_PARENT_KEY);\n        if (!parentID) {\n          parentElement.data(NG_ANIMATE_PARENT_KEY, ++parentCounter);\n          parentID = parentCounter;\n        }\n        return parentID + '-' + extractElementNode(element).getAttribute('class');\n      }\n\n      function animateSetup(animationEvent, element, className, styles) {\n        var structural = ['ng-enter','ng-leave','ng-move'].indexOf(className) >= 0;\n\n        var cacheKey = getCacheKey(element);\n        var eventCacheKey = cacheKey + ' ' + className;\n        var itemIndex = lookupCache[eventCacheKey] ? ++lookupCache[eventCacheKey].total : 0;\n\n        var stagger = {};\n        if (itemIndex > 0) {\n          var staggerClassName = className + '-stagger';\n          var staggerCacheKey = cacheKey + ' ' + staggerClassName;\n          var applyClasses = !lookupCache[staggerCacheKey];\n\n          applyClasses && $$jqLite.addClass(element, staggerClassName);\n\n          stagger = getElementAnimationDetails(element, staggerCacheKey);\n\n          applyClasses && $$jqLite.removeClass(element, staggerClassName);\n        }\n\n        $$jqLite.addClass(element, className);\n\n        var formerData = element.data(NG_ANIMATE_CSS_DATA_KEY) || {};\n        var timings = getElementAnimationDetails(element, eventCacheKey);\n        var transitionDuration = timings.transitionDuration;\n        var animationDuration = timings.animationDuration;\n\n        if (structural && transitionDuration === 0 && animationDuration === 0) {\n          $$jqLite.removeClass(element, className);\n          return false;\n        }\n\n        var blockTransition = styles || (structural && transitionDuration > 0);\n        var blockAnimation = animationDuration > 0 &&\n                             stagger.animationDelay > 0 &&\n                             stagger.animationDuration === 0;\n\n        var closeAnimationFns = formerData.closeAnimationFns || [];\n        element.data(NG_ANIMATE_CSS_DATA_KEY, {\n          stagger: stagger,\n          cacheKey: eventCacheKey,\n          running: formerData.running || 0,\n          itemIndex: itemIndex,\n          blockTransition: blockTransition,\n          closeAnimationFns: closeAnimationFns\n        });\n\n        var node = extractElementNode(element);\n\n        if (blockTransition) {\n          blockTransitions(node, true);\n          if (styles) {\n            element.css(styles);\n          }\n        }\n\n        if (blockAnimation) {\n          blockAnimations(node, true);\n        }\n\n        return true;\n      }\n\n      function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {\n        var node = extractElementNode(element);\n        var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);\n        if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {\n          activeAnimationComplete();\n          return;\n        }\n\n        var activeClassName = '';\n        var pendingClassName = '';\n        forEach(className.split(' '), function(klass, i) {\n          var prefix = (i > 0 ? ' ' : '') + klass;\n          activeClassName += prefix + '-active';\n          pendingClassName += prefix + '-pending';\n        });\n\n        var style = '';\n        var appliedStyles = [];\n        var itemIndex = elementData.itemIndex;\n        var stagger = elementData.stagger;\n        var staggerTime = 0;\n        if (itemIndex > 0) {\n          var transitionStaggerDelay = 0;\n          if (stagger.transitionDelay > 0 && stagger.transitionDuration === 0) {\n            transitionStaggerDelay = stagger.transitionDelay * itemIndex;\n          }\n\n          var animationStaggerDelay = 0;\n          if (stagger.animationDelay > 0 && stagger.animationDuration === 0) {\n            animationStaggerDelay = stagger.animationDelay * itemIndex;\n            appliedStyles.push(CSS_PREFIX + 'animation-play-state');\n          }\n\n          staggerTime = Math.round(Math.max(transitionStaggerDelay, animationStaggerDelay) * 100) / 100;\n        }\n\n        if (!staggerTime) {\n          $$jqLite.addClass(element, activeClassName);\n          if (elementData.blockTransition) {\n            blockTransitions(node, false);\n          }\n        }\n\n        var eventCacheKey = elementData.cacheKey + ' ' + activeClassName;\n        var timings = getElementAnimationDetails(element, eventCacheKey);\n        var maxDuration = Math.max(timings.transitionDuration, timings.animationDuration);\n        if (maxDuration === 0) {\n          $$jqLite.removeClass(element, activeClassName);\n          animateClose(element, className);\n          activeAnimationComplete();\n          return;\n        }\n\n        if (!staggerTime && styles && Object.keys(styles).length > 0) {\n          if (!timings.transitionDuration) {\n            element.css('transition', timings.animationDuration + 's linear all');\n            appliedStyles.push('transition');\n          }\n          element.css(styles);\n        }\n\n        var maxDelay = Math.max(timings.transitionDelay, timings.animationDelay);\n        var maxDelayTime = maxDelay * ONE_SECOND;\n\n        if (appliedStyles.length > 0) {\n          //the element being animated may sometimes contain comment nodes in\n          //the jqLite object, so we're safe to use a single variable to house\n          //the styles since there is always only one element being animated\n          var oldStyle = node.getAttribute('style') || '';\n          if (oldStyle.charAt(oldStyle.length - 1) !== ';') {\n            oldStyle += ';';\n          }\n          node.setAttribute('style', oldStyle + ' ' + style);\n        }\n\n        var startTime = Date.now();\n        var css3AnimationEvents = ANIMATIONEND_EVENT + ' ' + TRANSITIONEND_EVENT;\n        var animationTime     = (maxDelay + maxDuration) * CLOSING_TIME_BUFFER;\n        var totalTime         = (staggerTime + animationTime) * ONE_SECOND;\n\n        var staggerTimeout;\n        if (staggerTime > 0) {\n          $$jqLite.addClass(element, pendingClassName);\n          staggerTimeout = $timeout(function() {\n            staggerTimeout = null;\n\n            if (timings.transitionDuration > 0) {\n              blockTransitions(node, false);\n            }\n            if (timings.animationDuration > 0) {\n              blockAnimations(node, false);\n            }\n\n            $$jqLite.addClass(element, activeClassName);\n            $$jqLite.removeClass(element, pendingClassName);\n\n            if (styles) {\n              if (timings.transitionDuration === 0) {\n                element.css('transition', timings.animationDuration + 's linear all');\n              }\n              element.css(styles);\n              appliedStyles.push('transition');\n            }\n          }, staggerTime * ONE_SECOND, false);\n        }\n\n        element.on(css3AnimationEvents, onAnimationProgress);\n        elementData.closeAnimationFns.push(function() {\n          onEnd();\n          activeAnimationComplete();\n        });\n\n        elementData.running++;\n        animationCloseHandler(element, totalTime);\n        return onEnd;\n\n        // This will automatically be called by $animate so\n        // there is no need to attach this internally to the\n        // timeout done method.\n        function onEnd() {\n          element.off(css3AnimationEvents, onAnimationProgress);\n          $$jqLite.removeClass(element, activeClassName);\n          $$jqLite.removeClass(element, pendingClassName);\n          if (staggerTimeout) {\n            $timeout.cancel(staggerTimeout);\n          }\n          animateClose(element, className);\n          var node = extractElementNode(element);\n          for (var i in appliedStyles) {\n            node.style.removeProperty(appliedStyles[i]);\n          }\n        }\n\n        function onAnimationProgress(event) {\n          event.stopPropagation();\n          var ev = event.originalEvent || event;\n          var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();\n\n          /* Firefox (or possibly just Gecko) likes to not round values up\n           * when a ms measurement is used for the animation */\n          var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n          /* $manualTimeStamp is a mocked timeStamp value which is set\n           * within browserTrigger(). This is only here so that tests can\n           * mock animations properly. Real events fallback to event.timeStamp,\n           * or, if they don't, then a timeStamp is automatically created for them.\n           * We're checking to see if the timeStamp surpasses the expected delay,\n           * but we're using elapsedTime instead of the timeStamp on the 2nd\n           * pre-condition since animations sometimes close off early */\n          if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n            activeAnimationComplete();\n          }\n        }\n      }\n\n      function blockTransitions(node, bool) {\n        node.style[TRANSITION_PROP + PROPERTY_KEY] = bool ? 'none' : '';\n      }\n\n      function blockAnimations(node, bool) {\n        node.style[ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY] = bool ? 'paused' : '';\n      }\n\n      function animateBefore(animationEvent, element, className, styles) {\n        if (animateSetup(animationEvent, element, className, styles)) {\n          return function(cancelled) {\n            cancelled && animateClose(element, className);\n          };\n        }\n      }\n\n      function animateAfter(animationEvent, element, className, afterAnimationComplete, styles) {\n        if (element.data(NG_ANIMATE_CSS_DATA_KEY)) {\n          return animateRun(animationEvent, element, className, afterAnimationComplete, styles);\n        } else {\n          animateClose(element, className);\n          afterAnimationComplete();\n        }\n      }\n\n      function animate(animationEvent, element, className, animationComplete, options) {\n        //If the animateSetup function doesn't bother returning a\n        //cancellation function then it means that there is no animation\n        //to perform at all\n        var preReflowCancellation = animateBefore(animationEvent, element, className, options.from);\n        if (!preReflowCancellation) {\n          clearCacheAfterReflow();\n          animationComplete();\n          return;\n        }\n\n        //There are two cancellation functions: one is before the first\n        //reflow animation and the second is during the active state\n        //animation. The first function will take care of removing the\n        //data from the element which will not make the 2nd animation\n        //happen in the first place\n        var cancel = preReflowCancellation;\n        afterReflow(element, function() {\n          //once the reflow is complete then we point cancel to\n          //the new cancellation function which will remove all of the\n          //animation properties from the active animation\n          cancel = animateAfter(animationEvent, element, className, animationComplete, options.to);\n        });\n\n        return function(cancelled) {\n          (cancel || noop)(cancelled);\n        };\n      }\n\n      function animateClose(element, className) {\n        $$jqLite.removeClass(element, className);\n        var data = element.data(NG_ANIMATE_CSS_DATA_KEY);\n        if (data) {\n          if (data.running) {\n            data.running--;\n          }\n          if (!data.running || data.running === 0) {\n            element.removeData(NG_ANIMATE_CSS_DATA_KEY);\n          }\n        }\n      }\n\n      return {\n        animate: function(element, className, from, to, animationCompleted, options) {\n          options = options || {};\n          options.from = from;\n          options.to = to;\n          return animate('animate', element, className, animationCompleted, options);\n        },\n\n        enter: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('enter', element, 'ng-enter', animationCompleted, options);\n        },\n\n        leave: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('leave', element, 'ng-leave', animationCompleted, options);\n        },\n\n        move: function(element, animationCompleted, options) {\n          options = options || {};\n          return animate('move', element, 'ng-move', animationCompleted, options);\n        },\n\n        beforeSetClass: function(element, add, remove, animationCompleted, options) {\n          options = options || {};\n          var className = suffixClasses(remove, '-remove') + ' ' +\n                          suffixClasses(add, '-add');\n          var cancellationMethod = animateBefore('setClass', element, className, options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        beforeAddClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          var cancellationMethod = animateBefore('addClass', element, suffixClasses(className, '-add'), options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        beforeRemoveClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          var cancellationMethod = animateBefore('removeClass', element, suffixClasses(className, '-remove'), options.from);\n          if (cancellationMethod) {\n            afterReflow(element, animationCompleted);\n            return cancellationMethod;\n          }\n          clearCacheAfterReflow();\n          animationCompleted();\n        },\n\n        setClass: function(element, add, remove, animationCompleted, options) {\n          options = options || {};\n          remove = suffixClasses(remove, '-remove');\n          add = suffixClasses(add, '-add');\n          var className = remove + ' ' + add;\n          return animateAfter('setClass', element, className, animationCompleted, options.to);\n        },\n\n        addClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          return animateAfter('addClass', element, suffixClasses(className, '-add'), animationCompleted, options.to);\n        },\n\n        removeClass: function(element, className, animationCompleted, options) {\n          options = options || {};\n          return animateAfter('removeClass', element, suffixClasses(className, '-remove'), animationCompleted, options.to);\n        }\n      };\n\n      function suffixClasses(classes, suffix) {\n        var className = '';\n        classes = isArray(classes) ? classes : classes.split(/\\s+/);\n        forEach(classes, function(klass, i) {\n          if (klass && klass.length > 0) {\n            className += (i > 0 ? ' ' : '') + klass + suffix;\n          }\n        });\n        return className;\n      }\n    }]);\n  }]);\n\n\n})(window, window.angular);\n\n/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/**\n * @license AngularJS v1.3.13\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\nvar $sanitizeMinErr = angular.$$minErr('$sanitize');\n\n/**\n * @ngdoc module\n * @name ngSanitize\n * @description\n *\n * # ngSanitize\n *\n * The `ngSanitize` module provides functionality to sanitize HTML.\n *\n *\n * <div doc-module-components=\"ngSanitize\"></div>\n *\n * See {@link ngSanitize.$sanitize `$sanitize`} for usage.\n */\n\n/*\n * HTML Parser By Misko Hevery (misko@hevery.com)\n * based on:  HTML Parser By John Resig (ejohn.org)\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n *\n * // Use like so:\n * htmlParser(htmlString, {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * });\n *\n */\n\n\n/**\n * @ngdoc service\n * @name $sanitize\n * @kind function\n *\n * @description\n *   The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are\n *   then serialized back to properly escaped html string. This means that no unsafe input can make\n *   it into the returned string, however, since our parser is more strict than a typical browser\n *   parser, it's possible that some obscure input, which would be recognized as valid HTML by a\n *   browser, won't make it through the sanitizer. The input may also contain SVG markup.\n *   The whitelist is configured using the functions `aHrefSanitizationWhitelist` and\n *   `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.\n *\n * @param {string} html HTML input.\n * @returns {string} Sanitized HTML.\n *\n * @example\n   <example module=\"sanitizeExample\" deps=\"angular-sanitize.js\">\n   <file name=\"index.html\">\n     <script>\n         angular.module('sanitizeExample', ['ngSanitize'])\n           .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {\n             $scope.snippet =\n               '<p style=\"color:blue\">an html\\n' +\n               '<em onmouseover=\"this.textContent=\\'PWN3D!\\'\">click here</em>\\n' +\n               'snippet</p>';\n             $scope.deliberatelyTrustDangerousSnippet = function() {\n               return $sce.trustAsHtml($scope.snippet);\n             };\n           }]);\n     </script>\n     <div ng-controller=\"ExampleController\">\n        Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n       <table>\n         <tr>\n           <td>Directive</td>\n           <td>How</td>\n           <td>Source</td>\n           <td>Rendered</td>\n         </tr>\n         <tr id=\"bind-html-with-sanitize\">\n           <td>ng-bind-html</td>\n           <td>Automatically uses $sanitize</td>\n           <td><pre>&lt;div ng-bind-html=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n           <td><div ng-bind-html=\"snippet\"></div></td>\n         </tr>\n         <tr id=\"bind-html-with-trust\">\n           <td>ng-bind-html</td>\n           <td>Bypass $sanitize by explicitly trusting the dangerous value</td>\n           <td>\n           <pre>&lt;div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"&gt;\n&lt;/div&gt;</pre>\n           </td>\n           <td><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"></div></td>\n         </tr>\n         <tr id=\"bind-default\">\n           <td>ng-bind</td>\n           <td>Automatically escapes</td>\n           <td><pre>&lt;div ng-bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n           <td><div ng-bind=\"snippet\"></div></td>\n         </tr>\n       </table>\n       </div>\n   </file>\n   <file name=\"protractor.js\" type=\"protractor\">\n     it('should sanitize the html snippet by default', function() {\n       expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n         toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n     });\n\n     it('should inline raw snippet if bound to a trusted value', function() {\n       expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).\n         toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n              \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n              \"snippet</p>\");\n     });\n\n     it('should escape snippet without any filter', function() {\n       expect(element(by.css('#bind-default div')).getInnerHtml()).\n         toBe(\"&lt;p style=\\\"color:blue\\\"&gt;an html\\n\" +\n              \"&lt;em onmouseover=\\\"this.textContent='PWN3D!'\\\"&gt;click here&lt;/em&gt;\\n\" +\n              \"snippet&lt;/p&gt;\");\n     });\n\n     it('should update', function() {\n       element(by.model('snippet')).clear();\n       element(by.model('snippet')).sendKeys('new <b onclick=\"alert(1)\">text</b>');\n       expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n         toBe('new <b>text</b>');\n       expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n         'new <b onclick=\"alert(1)\">text</b>');\n       expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n         \"new &lt;b onclick=\\\"alert(1)\\\"&gt;text&lt;/b&gt;\");\n     });\n   </file>\n   </example>\n */\nfunction $SanitizeProvider() {\n  this.$get = ['$$sanitizeUri', function($$sanitizeUri) {\n    return function(html) {\n      var buf = [];\n      htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {\n        return !/^unsafe/.test($$sanitizeUri(uri, isImage));\n      }));\n      return buf.join('');\n    };\n  }];\n}\n\nfunction sanitizeText(chars) {\n  var buf = [];\n  var writer = htmlSanitizeWriter(buf, angular.noop);\n  writer.chars(chars);\n  return buf.join('');\n}\n\n\n// Regular Expressions for parsing tags and attributes\nvar START_TAG_REGEXP =\n       /^<((?:[a-zA-Z])[\\w:-]*)((?:\\s+[\\w:-]+(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)\\s*(>?)/,\n  END_TAG_REGEXP = /^<\\/\\s*([\\w:-]+)[^>]*>/,\n  ATTR_REGEXP = /([\\w:-]+)(?:\\s*=\\s*(?:(?:\"((?:[^\"])*)\")|(?:'((?:[^'])*)')|([^>\\s]+)))?/g,\n  BEGIN_TAG_REGEXP = /^</,\n  BEGING_END_TAGE_REGEXP = /^<\\//,\n  COMMENT_REGEXP = /<!--(.*?)-->/g,\n  DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,\n  CDATA_REGEXP = /<!\\[CDATA\\[(.*?)]]>/g,\n  SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n  // Match everything outside of normal chars and \" (quote character)\n  NON_ALPHANUMERIC_REGEXP = /([^\\#-~| |!])/g;\n\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar voidElements = makeMap(\"area,br,col,hr,img,wbr\");\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar optionalEndTagBlockElements = makeMap(\"colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr\"),\n    optionalEndTagInlineElements = makeMap(\"rp,rt\"),\n    optionalEndTagElements = angular.extend({},\n                                            optionalEndTagInlineElements,\n                                            optionalEndTagBlockElements);\n\n// Safe Block Elements - HTML5\nvar blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap(\"address,article,\" +\n        \"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,\" +\n        \"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul\"));\n\n// Inline Elements - HTML5\nvar inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap(\"a,abbr,acronym,b,\" +\n        \"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,\" +\n        \"samp,small,span,strike,strong,sub,sup,time,tt,u,var\"));\n\n// SVG Elements\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements\nvar svgElements = makeMap(\"animate,animateColor,animateMotion,animateTransform,circle,defs,\" +\n        \"desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,\" +\n        \"line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,\" +\n        \"stop,svg,switch,text,title,tspan,use\");\n\n// Special Elements (can contain anything)\nvar specialElements = makeMap(\"script,style\");\n\nvar validElements = angular.extend({},\n                                   voidElements,\n                                   blockElements,\n                                   inlineElements,\n                                   optionalEndTagElements,\n                                   svgElements);\n\n//Attributes that have href and hence need to be sanitized\nvar uriAttrs = makeMap(\"background,cite,href,longdesc,src,usemap,xlink:href\");\n\nvar htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +\n    'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +\n    'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +\n    'scope,scrolling,shape,size,span,start,summary,target,title,type,' +\n    'valign,value,vspace,width');\n\n// SVG attributes (without \"id\" and \"name\" attributes)\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes\nvar svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +\n    'attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,' +\n    'color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,' +\n    'font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,' +\n    'gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,' +\n    'keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,' +\n    'markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,' +\n    'overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,' +\n    'repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,' +\n    'stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,' +\n    'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,' +\n    'stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,' +\n    'underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,' +\n    'viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,' +\n    'xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,' +\n    'zoomAndPan');\n\nvar validAttrs = angular.extend({},\n                                uriAttrs,\n                                svgAttrs,\n                                htmlAttrs);\n\nfunction makeMap(str) {\n  var obj = {}, items = str.split(','), i;\n  for (i = 0; i < items.length; i++) obj[items[i]] = true;\n  return obj;\n}\n\n\n/**\n * @example\n * htmlParser(htmlString, {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * });\n *\n * @param {string} html string\n * @param {object} handler\n */\nfunction htmlParser(html, handler) {\n  if (typeof html !== 'string') {\n    if (html === null || typeof html === 'undefined') {\n      html = '';\n    } else {\n      html = '' + html;\n    }\n  }\n  var index, chars, match, stack = [], last = html, text;\n  stack.last = function() { return stack[stack.length - 1]; };\n\n  while (html) {\n    text = '';\n    chars = true;\n\n    // Make sure we're not in a script or style element\n    if (!stack.last() || !specialElements[stack.last()]) {\n\n      // Comment\n      if (html.indexOf(\"<!--\") === 0) {\n        // comments containing -- are not allowed unless they terminate the comment\n        index = html.indexOf(\"--\", 4);\n\n        if (index >= 0 && html.lastIndexOf(\"-->\", index) === index) {\n          if (handler.comment) handler.comment(html.substring(4, index));\n          html = html.substring(index + 3);\n          chars = false;\n        }\n      // DOCTYPE\n      } else if (DOCTYPE_REGEXP.test(html)) {\n        match = html.match(DOCTYPE_REGEXP);\n\n        if (match) {\n          html = html.replace(match[0], '');\n          chars = false;\n        }\n      // end tag\n      } else if (BEGING_END_TAGE_REGEXP.test(html)) {\n        match = html.match(END_TAG_REGEXP);\n\n        if (match) {\n          html = html.substring(match[0].length);\n          match[0].replace(END_TAG_REGEXP, parseEndTag);\n          chars = false;\n        }\n\n      // start tag\n      } else if (BEGIN_TAG_REGEXP.test(html)) {\n        match = html.match(START_TAG_REGEXP);\n\n        if (match) {\n          // We only have a valid start-tag if there is a '>'.\n          if (match[4]) {\n            html = html.substring(match[0].length);\n            match[0].replace(START_TAG_REGEXP, parseStartTag);\n          }\n          chars = false;\n        } else {\n          // no ending tag found --- this piece should be encoded as an entity.\n          text += '<';\n          html = html.substring(1);\n        }\n      }\n\n      if (chars) {\n        index = html.indexOf(\"<\");\n\n        text += index < 0 ? html : html.substring(0, index);\n        html = index < 0 ? \"\" : html.substring(index);\n\n        if (handler.chars) handler.chars(decodeEntities(text));\n      }\n\n    } else {\n      // IE versions 9 and 10 do not understand the regex '[^]', so using a workaround with [\\W\\w].\n      html = html.replace(new RegExp(\"([\\\\W\\\\w]*)<\\\\s*\\\\/\\\\s*\" + stack.last() + \"[^>]*>\", 'i'),\n        function(all, text) {\n          text = text.replace(COMMENT_REGEXP, \"$1\").replace(CDATA_REGEXP, \"$1\");\n\n          if (handler.chars) handler.chars(decodeEntities(text));\n\n          return \"\";\n      });\n\n      parseEndTag(\"\", stack.last());\n    }\n\n    if (html == last) {\n      throw $sanitizeMinErr('badparse', \"The sanitizer was unable to parse the following block \" +\n                                        \"of html: {0}\", html);\n    }\n    last = html;\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function parseStartTag(tag, tagName, rest, unary) {\n    tagName = angular.lowercase(tagName);\n    if (blockElements[tagName]) {\n      while (stack.last() && inlineElements[stack.last()]) {\n        parseEndTag(\"\", stack.last());\n      }\n    }\n\n    if (optionalEndTagElements[tagName] && stack.last() == tagName) {\n      parseEndTag(\"\", tagName);\n    }\n\n    unary = voidElements[tagName] || !!unary;\n\n    if (!unary)\n      stack.push(tagName);\n\n    var attrs = {};\n\n    rest.replace(ATTR_REGEXP,\n      function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {\n        var value = doubleQuotedValue\n          || singleQuotedValue\n          || unquotedValue\n          || '';\n\n        attrs[name] = decodeEntities(value);\n    });\n    if (handler.start) handler.start(tagName, attrs, unary);\n  }\n\n  function parseEndTag(tag, tagName) {\n    var pos = 0, i;\n    tagName = angular.lowercase(tagName);\n    if (tagName)\n      // Find the closest opened tag of the same type\n      for (pos = stack.length - 1; pos >= 0; pos--)\n        if (stack[pos] == tagName)\n          break;\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (i = stack.length - 1; i >= pos; i--)\n        if (handler.end) handler.end(stack[i]);\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n    }\n  }\n}\n\nvar hiddenPre=document.createElement(\"pre\");\nvar spaceRe = /^(\\s*)([\\s\\S]*?)(\\s*)$/;\n/**\n * decodes all entities into regular string\n * @param value\n * @returns {string} A string with decoded entities.\n */\nfunction decodeEntities(value) {\n  if (!value) { return ''; }\n\n  // Note: IE8 does not preserve spaces at the start/end of innerHTML\n  // so we must capture them and reattach them afterward\n  var parts = spaceRe.exec(value);\n  var spaceBefore = parts[1];\n  var spaceAfter = parts[3];\n  var content = parts[2];\n  if (content) {\n    hiddenPre.innerHTML=content.replace(/</g,\"&lt;\");\n    // innerText depends on styling as it doesn't display hidden elements.\n    // Therefore, it's better to use textContent not to cause unnecessary\n    // reflows. However, IE<9 don't support textContent so the innerText\n    // fallback is necessary.\n    content = 'textContent' in hiddenPre ?\n      hiddenPre.textContent : hiddenPre.innerText;\n  }\n  return spaceBefore + content + spaceAfter;\n}\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n * @returns {string} escaped text\n */\nfunction encodeEntities(value) {\n  return value.\n    replace(/&/g, '&amp;').\n    replace(SURROGATE_PAIR_REGEXP, function(value) {\n      var hi = value.charCodeAt(0);\n      var low = value.charCodeAt(1);\n      return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n    }).\n    replace(NON_ALPHANUMERIC_REGEXP, function(value) {\n      return '&#' + value.charCodeAt(0) + ';';\n    }).\n    replace(/</g, '&lt;').\n    replace(/>/g, '&gt;');\n}\n\n/**\n * create an HTML/XML writer which writes to buffer\n * @param {Array} buf use buf.jain('') to get out sanitized html string\n * @returns {object} in the form of {\n *     start: function(tag, attrs, unary) {},\n *     end: function(tag) {},\n *     chars: function(text) {},\n *     comment: function(text) {}\n * }\n */\nfunction htmlSanitizeWriter(buf, uriValidator) {\n  var ignore = false;\n  var out = angular.bind(buf, buf.push);\n  return {\n    start: function(tag, attrs, unary) {\n      tag = angular.lowercase(tag);\n      if (!ignore && specialElements[tag]) {\n        ignore = tag;\n      }\n      if (!ignore && validElements[tag] === true) {\n        out('<');\n        out(tag);\n        angular.forEach(attrs, function(value, key) {\n          var lkey=angular.lowercase(key);\n          var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');\n          if (validAttrs[lkey] === true &&\n            (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {\n            out(' ');\n            out(key);\n            out('=\"');\n            out(encodeEntities(value));\n            out('\"');\n          }\n        });\n        out(unary ? '/>' : '>');\n      }\n    },\n    end: function(tag) {\n        tag = angular.lowercase(tag);\n        if (!ignore && validElements[tag] === true) {\n          out('</');\n          out(tag);\n          out('>');\n        }\n        if (tag == ignore) {\n          ignore = false;\n        }\n      },\n    chars: function(chars) {\n        if (!ignore) {\n          out(encodeEntities(chars));\n        }\n      }\n  };\n}\n\n\n// define ngSanitize module and register $sanitize service\nangular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);\n\n/* global sanitizeText: false */\n\n/**\n * @ngdoc filter\n * @name linky\n * @kind function\n *\n * @description\n * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and\n * plain email address links.\n *\n * Requires the {@link ngSanitize `ngSanitize`} module to be installed.\n *\n * @param {string} text Input text.\n * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.\n * @returns {string} Html-linkified text.\n *\n * @usage\n   <span ng-bind-html=\"linky_expression | linky\"></span>\n *\n * @example\n   <example module=\"linkyExample\" deps=\"angular-sanitize.js\">\n     <file name=\"index.html\">\n       <script>\n         angular.module('linkyExample', ['ngSanitize'])\n           .controller('ExampleController', ['$scope', function($scope) {\n             $scope.snippet =\n               'Pretty text with some links:\\n'+\n               'http://angularjs.org/,\\n'+\n               'mailto:us@somewhere.org,\\n'+\n               'another@somewhere.org,\\n'+\n               'and one more: ftp://127.0.0.1/.';\n             $scope.snippetWithTarget = 'http://angularjs.org/';\n           }]);\n       </script>\n       <div ng-controller=\"ExampleController\">\n       Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n       <table>\n         <tr>\n           <td>Filter</td>\n           <td>Source</td>\n           <td>Rendered</td>\n         </tr>\n         <tr id=\"linky-filter\">\n           <td>linky filter</td>\n           <td>\n             <pre>&lt;div ng-bind-html=\"snippet | linky\"&gt;<br>&lt;/div&gt;</pre>\n           </td>\n           <td>\n             <div ng-bind-html=\"snippet | linky\"></div>\n           </td>\n         </tr>\n         <tr id=\"linky-target\">\n          <td>linky target</td>\n          <td>\n            <pre>&lt;div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"&gt;<br>&lt;/div&gt;</pre>\n          </td>\n          <td>\n            <div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"></div>\n          </td>\n         </tr>\n         <tr id=\"escaped-html\">\n           <td>no filter</td>\n           <td><pre>&lt;div ng-bind=\"snippet\"&gt;<br>&lt;/div&gt;</pre></td>\n           <td><div ng-bind=\"snippet\"></div></td>\n         </tr>\n       </table>\n     </file>\n     <file name=\"protractor.js\" type=\"protractor\">\n       it('should linkify the snippet with urls', function() {\n         expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n             toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +\n                  'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n         expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);\n       });\n\n       it('should not linkify snippet without the linky filter', function() {\n         expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).\n             toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +\n                  'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n         expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);\n       });\n\n       it('should update', function() {\n         element(by.model('snippet')).clear();\n         element(by.model('snippet')).sendKeys('new http://link.');\n         expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n             toBe('new http://link.');\n         expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);\n         expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())\n             .toBe('new http://link.');\n       });\n\n       it('should work with the target property', function() {\n        expect(element(by.id('linky-target')).\n            element(by.binding(\"snippetWithTarget | linky:'_blank'\")).getText()).\n            toBe('http://angularjs.org/');\n        expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');\n       });\n     </file>\n   </example>\n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n  var LINKY_URL_REGEXP =\n        /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]/,\n      MAILTO_REGEXP = /^mailto:/;\n\n  return function(text, target) {\n    if (!text) return text;\n    var match;\n    var raw = text;\n    var html = [];\n    var url;\n    var i;\n    while ((match = raw.match(LINKY_URL_REGEXP))) {\n      // We can not end in these as they are sometimes found at the end of the sentence\n      url = match[0];\n      // if we did not match ftp/http/www/mailto then assume mailto\n      if (!match[2] && !match[4]) {\n        url = (match[3] ? 'http://' : 'mailto:') + url;\n      }\n      i = match.index;\n      addText(raw.substr(0, i));\n      addLink(url, match[0].replace(MAILTO_REGEXP, ''));\n      raw = raw.substring(i + match[0].length);\n    }\n    addText(raw);\n    return $sanitize(html.join(''));\n\n    function addText(text) {\n      if (!text) {\n        return;\n      }\n      html.push(sanitizeText(text));\n    }\n\n    function addLink(url, text) {\n      html.push('<a ');\n      if (angular.isDefined(target)) {\n        html.push('target=\"',\n                  target,\n                  '\" ');\n      }\n      html.push('href=\"',\n                url.replace(/\"/g, '&quot;'),\n                '\">');\n      addText(text);\n      html.push('</a>');\n    }\n  };\n}]);\n\n\n})(window, window.angular);\n\n/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/**\n * State-based routing for AngularJS\n * @version v0.2.13\n * @link http://angular-ui.github.com/\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n\n/* commonjs package manager support (eg componentjs) */\nif (typeof module !== \"undefined\" && typeof exports !== \"undefined\" && module.exports === exports){\n  module.exports = 'ui.router';\n}\n\n(function (window, angular, undefined) {\n/*jshint globalstrict:true*/\n/*global angular:false*/\n'use strict';\n\nvar isDefined = angular.isDefined,\n    isFunction = angular.isFunction,\n    isString = angular.isString,\n    isObject = angular.isObject,\n    isArray = angular.isArray,\n    forEach = angular.forEach,\n    extend = angular.extend,\n    copy = angular.copy;\n\nfunction inherit(parent, extra) {\n  return extend(new (extend(function() {}, { prototype: parent }))(), extra);\n}\n\nfunction merge(dst) {\n  forEach(arguments, function(obj) {\n    if (obj !== dst) {\n      forEach(obj, function(value, key) {\n        if (!dst.hasOwnProperty(key)) dst[key] = value;\n      });\n    }\n  });\n  return dst;\n}\n\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n  var path = [];\n\n  for (var n in first.path) {\n    if (first.path[n] !== second.path[n]) break;\n    path.push(first.path[n]);\n  }\n  return path;\n}\n\n/**\n * IE8-safe wrapper for `Object.keys()`.\n *\n * @param {Object} object A JavaScript object.\n * @return {Array} Returns the keys of the object as an array.\n */\nfunction objectKeys(object) {\n  if (Object.keys) {\n    return Object.keys(object);\n  }\n  var result = [];\n\n  angular.forEach(object, function(val, key) {\n    result.push(key);\n  });\n  return result;\n}\n\n/**\n * IE8-safe wrapper for `Array.prototype.indexOf()`.\n *\n * @param {Array} array A JavaScript array.\n * @param {*} value A value to search the array for.\n * @return {Number} Returns the array index value of `value`, or `-1` if not present.\n */\nfunction indexOf(array, value) {\n  if (Array.prototype.indexOf) {\n    return array.indexOf(value, Number(arguments[2]) || 0);\n  }\n  var len = array.length >>> 0, from = Number(arguments[2]) || 0;\n  from = (from < 0) ? Math.ceil(from) : Math.floor(from);\n\n  if (from < 0) from += len;\n\n  for (; from < len; from++) {\n    if (from in array && array[from] === value) return from;\n  }\n  return -1;\n}\n\n/**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} currentParams The value of the current state parameters ($stateParams).\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\nfunction inheritParams(currentParams, newParams, $current, $to) {\n  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];\n\n  for (var i in parents) {\n    if (!parents[i].params) continue;\n    parentParams = objectKeys(parents[i].params);\n    if (!parentParams.length) continue;\n\n    for (var j in parentParams) {\n      if (indexOf(inheritList, parentParams[j]) >= 0) continue;\n      inheritList.push(parentParams[j]);\n      inherited[parentParams[j]] = currentParams[parentParams[j]];\n    }\n  }\n  return extend({}, inherited, newParams);\n}\n\n/**\n * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.\n *\n * @param {Object} a The first object.\n * @param {Object} b The second object.\n * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,\n *                     it defaults to the list of keys in `a`.\n * @return {Boolean} Returns `true` if the keys match, otherwise `false`.\n */\nfunction equalForKeys(a, b, keys) {\n  if (!keys) {\n    keys = [];\n    for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n  }\n\n  for (var i=0; i<keys.length; i++) {\n    var k = keys[i];\n    if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n  }\n  return true;\n}\n\n/**\n * Returns the subset of an object, based on a list of keys.\n *\n * @param {Array} keys\n * @param {Object} values\n * @return {Boolean} Returns a subset of `values`.\n */\nfunction filterByKeys(keys, values) {\n  var filtered = {};\n\n  forEach(keys, function (name) {\n    filtered[name] = values[name];\n  });\n  return filtered;\n}\n\n// like _.indexBy\n// when you know that your index values will be unique, or you want last-one-in to win\nfunction indexBy(array, propName) {\n  var result = {};\n  forEach(array, function(item) {\n    result[item[propName]] = item;\n  });\n  return result;\n}\n\n// extracted from underscore.js\n// Return a copy of the object only containing the whitelisted properties.\nfunction pick(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  forEach(keys, function(key) {\n    if (key in obj) copy[key] = obj[key];\n  });\n  return copy;\n}\n\n// extracted from underscore.js\n// Return a copy of the object omitting the blacklisted properties.\nfunction omit(obj) {\n  var copy = {};\n  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n  for (var key in obj) {\n    if (indexOf(keys, key) == -1) copy[key] = obj[key];\n  }\n  return copy;\n}\n\nfunction pluck(collection, key) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = isFunction(key) ? key(val) : val[key];\n  });\n  return result;\n}\n\nfunction filter(collection, callback) {\n  var array = isArray(collection);\n  var result = array ? [] : {};\n  forEach(collection, function(val, i) {\n    if (callback(val, i)) {\n      result[array ? result.length : i] = val;\n    }\n  });\n  return result;\n}\n\nfunction map(collection, callback) {\n  var result = isArray(collection) ? [] : {};\n\n  forEach(collection, function(val, i) {\n    result[i] = callback(val, i);\n  });\n  return result;\n}\n\n/**\n * @ngdoc overview\n * @name ui.router.util\n *\n * @description\n * # ui.router.util sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n *\n */\nangular.module('ui.router.util', ['ng']);\n\n/**\n * @ngdoc overview\n * @name ui.router.router\n * \n * @requires ui.router.util\n *\n * @description\n * # ui.router.router sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n */\nangular.module('ui.router.router', ['ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router.state\n * \n * @requires ui.router.router\n * @requires ui.router.util\n *\n * @description\n * # ui.router.state sub-module\n *\n * This module is a dependency of the main ui.router module. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n * \n */\nangular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router\n *\n * @requires ui.router.state\n *\n * @description\n * # ui.router\n * \n * ## The main module for ui.router \n * There are several sub-modules included with the ui.router module, however only this module is needed\n * as a dependency within your angular app. The other modules are for organization purposes. \n *\n * The modules are:\n * * ui.router - the main \"umbrella\" module\n * * ui.router.router - \n * \n * *You'll need to include **only** this module as the dependency within your angular app.*\n * \n * <pre>\n * <!doctype html>\n * <html ng-app=\"myApp\">\n * <head>\n *   <script src=\"js/angular.js\"></script>\n *   <!-- Include the ui-router script -->\n *   <script src=\"js/angular-ui-router.min.js\"></script>\n *   <script>\n *     // ...and add 'ui.router' as a dependency\n *     var myApp = angular.module('myApp', ['ui.router']);\n *   </script>\n * </head>\n * <body>\n * </body>\n * </html>\n * </pre>\n */\nangular.module('ui.router', ['ui.router.state']);\n\nangular.module('ui.router.compat', ['ui.router']);\n\n/**\n * @ngdoc object\n * @name ui.router.util.$resolve\n *\n * @requires $q\n * @requires $injector\n *\n * @description\n * Manages resolution of (acyclic) graphs of promises.\n */\n$Resolve.$inject = ['$q', '$injector'];\nfunction $Resolve(  $q,    $injector) {\n  \n  var VISIT_IN_PROGRESS = 1,\n      VISIT_DONE = 2,\n      NOTHING = {},\n      NO_DEPENDENCIES = [],\n      NO_LOCALS = NOTHING,\n      NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n  \n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#study\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Studies a set of invocables that are likely to be used multiple times.\n   * <pre>\n   * $resolve.study(invocables)(locals, parent, self)\n   * </pre>\n   * is equivalent to\n   * <pre>\n   * $resolve.resolve(invocables, locals, parent, self)\n   * </pre>\n   * but the former is more efficient (in fact `resolve` just calls `study` \n   * internally).\n   *\n   * @param {object} invocables Invocable objects\n   * @return {function} a function to pass in locals, parent and self\n   */\n  this.study = function (invocables) {\n    if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n    var invocableKeys = objectKeys(invocables || {});\n    \n    // Perform a topological sort of invocables to build an ordered plan\n    var plan = [], cycle = [], visited = {};\n    function visit(value, key) {\n      if (visited[key] === VISIT_DONE) return;\n      \n      cycle.push(key);\n      if (visited[key] === VISIT_IN_PROGRESS) {\n        cycle.splice(0, indexOf(cycle, key));\n        throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n      }\n      visited[key] = VISIT_IN_PROGRESS;\n      \n      if (isString(value)) {\n        plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n      } else {\n        var params = $injector.annotate(value);\n        forEach(params, function (param) {\n          if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n        });\n        plan.push(key, value, params);\n      }\n      \n      cycle.pop();\n      visited[key] = VISIT_DONE;\n    }\n    forEach(invocables, visit);\n    invocables = cycle = visited = null; // plan is all that's required\n    \n    function isResolve(value) {\n      return isObject(value) && value.then && value.$$promises;\n    }\n    \n    return function (locals, parent, self) {\n      if (isResolve(locals) && self === undefined) {\n        self = parent; parent = locals; locals = null;\n      }\n      if (!locals) locals = NO_LOCALS;\n      else if (!isObject(locals)) {\n        throw new Error(\"'locals' must be an object\");\n      }       \n      if (!parent) parent = NO_PARENT;\n      else if (!isResolve(parent)) {\n        throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n      }\n      \n      // To complete the overall resolution, we have to wait for the parent\n      // promise and for the promise for each invokable in our plan.\n      var resolution = $q.defer(),\n          result = resolution.promise,\n          promises = result.$$promises = {},\n          values = extend({}, locals),\n          wait = 1 + plan.length/3,\n          merged = false;\n          \n      function done() {\n        // Merge parent values we haven't got yet and publish our own $$values\n        if (!--wait) {\n          if (!merged) merge(values, parent.$$values); \n          result.$$values = values;\n          result.$$promises = result.$$promises || true; // keep for isResolve()\n          delete result.$$inheritedValues;\n          resolution.resolve(values);\n        }\n      }\n      \n      function fail(reason) {\n        result.$$failure = reason;\n        resolution.reject(reason);\n      }\n\n      // Short-circuit if parent has already failed\n      if (isDefined(parent.$$failure)) {\n        fail(parent.$$failure);\n        return result;\n      }\n      \n      if (parent.$$inheritedValues) {\n        merge(values, omit(parent.$$inheritedValues, invocableKeys));\n      }\n\n      // Merge parent values if the parent has already resolved, or merge\n      // parent promises and wait if the parent resolve is still in progress.\n      extend(promises, parent.$$promises);\n      if (parent.$$values) {\n        merged = merge(values, omit(parent.$$values, invocableKeys));\n        result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n        done();\n      } else {\n        if (parent.$$inheritedValues) {\n          result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n        }        \n        parent.then(done, fail);\n      }\n      \n      // Process each invocable in the plan, but ignore any where a local of the same name exists.\n      for (var i=0, ii=plan.length; i<ii; i+=3) {\n        if (locals.hasOwnProperty(plan[i])) done();\n        else invoke(plan[i], plan[i+1], plan[i+2]);\n      }\n      \n      function invoke(key, invocable, params) {\n        // Create a deferred for this invocation. Failures will propagate to the resolution as well.\n        var invocation = $q.defer(), waitParams = 0;\n        function onfailure(reason) {\n          invocation.reject(reason);\n          fail(reason);\n        }\n        // Wait for any parameter that we have a promise for (either from parent or from this\n        // resolve; in that case study() will have made sure it's ordered before us in the plan).\n        forEach(params, function (dep) {\n          if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {\n            waitParams++;\n            promises[dep].then(function (result) {\n              values[dep] = result;\n              if (!(--waitParams)) proceed();\n            }, onfailure);\n          }\n        });\n        if (!waitParams) proceed();\n        function proceed() {\n          if (isDefined(result.$$failure)) return;\n          try {\n            invocation.resolve($injector.invoke(invocable, self, values));\n            invocation.promise.then(function (result) {\n              values[key] = result;\n              done();\n            }, onfailure);\n          } catch (e) {\n            onfailure(e);\n          }\n        }\n        // Publish promise synchronously; invocations further down in the plan may depend on it.\n        promises[key] = invocation.promise;\n      }\n      \n      return result;\n    };\n  };\n  \n  /**\n   * @ngdoc function\n   * @name ui.router.util.$resolve#resolve\n   * @methodOf ui.router.util.$resolve\n   *\n   * @description\n   * Resolves a set of invocables. An invocable is a function to be invoked via \n   * `$injector.invoke()`, and can have an arbitrary number of dependencies. \n   * An invocable can either return a value directly,\n   * or a `$q` promise. If a promise is returned it will be resolved and the \n   * resulting value will be used instead. Dependencies of invocables are resolved \n   * (in this order of precedence)\n   *\n   * - from the specified `locals`\n   * - from another invocable that is part of this `$resolve` call\n   * - from an invocable that is inherited from a `parent` call to `$resolve` \n   *   (or recursively\n   * - from any ancestor `$resolve` of that parent).\n   *\n   * The return value of `$resolve` is a promise for an object that contains \n   * (in this order of precedence)\n   *\n   * - any `locals` (if specified)\n   * - the resolved return values of all injectables\n   * - any values inherited from a `parent` call to `$resolve` (if specified)\n   *\n   * The promise will resolve after the `parent` promise (if any) and all promises \n   * returned by injectables have been resolved. If any invocable \n   * (or `$injector.invoke`) throws an exception, or if a promise returned by an \n   * invocable is rejected, the `$resolve` promise is immediately rejected with the \n   * same error. A rejection of a `parent` promise (if specified) will likewise be \n   * propagated immediately. Once the `$resolve` promise has been rejected, no \n   * further invocables will be called.\n   * \n   * Cyclic dependencies between invocables are not permitted and will caues `$resolve`\n   * to throw an error. As a special case, an injectable can depend on a parameter \n   * with the same name as the injectable, which will be fulfilled from the `parent` \n   * injectable of the same name. This allows inherited values to be decorated. \n   * Note that in this case any other injectable in the same `$resolve` with the same\n   * dependency would see the decorated value, not the inherited value.\n   *\n   * Note that missing dependencies -- unlike cyclic dependencies -- will cause an \n   * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) \n   * exception.\n   *\n   * Invocables are invoked eagerly as soon as all dependencies are available. \n   * This is true even for dependencies inherited from a `parent` call to `$resolve`.\n   *\n   * As a special case, an invocable can be a string, in which case it is taken to \n   * be a service name to be passed to `$injector.get()`. This is supported primarily \n   * for backwards-compatibility with the `resolve` property of `$routeProvider` \n   * routes.\n   *\n   * @param {object} invocables functions to invoke or \n   * `$injector` services to fetch.\n   * @param {object} locals  values to make available to the injectables\n   * @param {object} parent  a promise returned by another call to `$resolve`.\n   * @param {object} self  the `this` for the invoked methods\n   * @return {object} Promise for an object that contains the resolved return value\n   * of all invocables, as well as any inherited and local values.\n   */\n  this.resolve = function (invocables, locals, parent, self) {\n    return this.study(invocables)(locals, parent, self);\n  };\n}\n\nangular.module('ui.router.util').service('$resolve', $Resolve);\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\n$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];\nfunction $TemplateFactory(  $http,   $templateCache,   $injector) {\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromConfig\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a configuration object. \n   *\n   * @param {object} config Configuration object for which to load a template. \n   * The following properties are search in the specified order, and the first one \n   * that is defined is used to create the template:\n   *\n   * @param {string|object} config.template html string template or function to \n   * load via {@link ui.router.util.$templateFactory#fromString fromString}.\n   * @param {string|object} config.templateUrl url to load or a function returning \n   * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.\n   * @param {Function} config.templateProvider function to invoke via \n   * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.\n   * @param {object} params  Parameters to pass to the template function.\n   * @param {object} locals Locals to pass to `invoke` if the template is loaded \n   * via a `templateProvider`. Defaults to `{ params: params }`.\n   *\n   * @return {string|object}  The template html as a string, or a promise for \n   * that string,or `null` if no template is configured.\n   */\n  this.fromConfig = function (config, params, locals) {\n    return (\n      isDefined(config.template) ? this.fromString(config.template, params) :\n      isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :\n      isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :\n      null\n    );\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromString\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template from a string or a function returning a string.\n   *\n   * @param {string|object} template html template as a string or function that \n   * returns an html template as a string.\n   * @param {object} params Parameters to pass to the template function.\n   *\n   * @return {string|object} The template html as a string, or a promise for that \n   * string.\n   */\n  this.fromString = function (template, params) {\n    return isFunction(template) ? template(params) : template;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromUrl\n   * @methodOf ui.router.util.$templateFactory\n   * \n   * @description\n   * Loads a template from the a URL via `$http` and `$templateCache`.\n   *\n   * @param {string|Function} url url of the template to load, or a function \n   * that returns a url.\n   * @param {Object} params Parameters to pass to the url function.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromUrl = function (url, params) {\n    if (isFunction(url)) url = url(params);\n    if (url == null) return null;\n    else return $http\n        .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n        .then(function(response) { return response.data; });\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$templateFactory#fromProvider\n   * @methodOf ui.router.util.$templateFactory\n   *\n   * @description\n   * Creates a template by invoking an injectable provider function.\n   *\n   * @param {Function} provider Function to invoke via `$injector.invoke`\n   * @param {Object} params Parameters for the template.\n   * @param {Object} locals Locals to pass to `invoke`. Defaults to \n   * `{ params: params }`.\n   * @return {string|Promise.<string>} The template html as a string, or a promise \n   * for that string.\n   */\n  this.fromProvider = function (provider, params, locals) {\n    return $injector.invoke(provider, null, locals || { params: params });\n  };\n}\n\nangular.module('ui.router.util').service('$templateFactory', $TemplateFactory);\n\nvar $$UMFP; // reference to $UrlMatcherFactoryProvider\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:UrlMatcher\n *\n * @description\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n * \n * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n * syntax, which optionally allows a regular expression for the parameter to be specified:\n *\n * * `':'` name - colon placeholder\n * * `'*'` name - catch-all placeholder\n * * `'{' name '}'` - curly placeholder\n * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n *   regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters). For colon \n * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n * number of characters other than '/'. For catch-all placeholders the path parameter matches\n * any number of characters.\n * \n * Examples:\n * \n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n *   trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n *   parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n *   path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n *   in the built-in  `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n * @param {string} pattern  The pattern to compile into a matcher.\n * @param {Object} config  A configuration object hash:\n * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n *   an existing UrlMatcher\n *\n * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n *\n * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any\n *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n *   non-null) will start with this prefix.\n *\n * @property {string} source  The pattern that was passed into the constructor\n *\n * @property {string} sourcePath  The path portion of the source property\n *\n * @property {string} sourceSearch  The search portion of the source property\n *\n * @property {string} regex  The constructed regex that will be used to match against the url when \n *   it is time to determine which url will match.\n *\n * @returns {Object}  New `UrlMatcher` object\n */\nfunction UrlMatcher(pattern, config, parentMatcher) {\n  config = extend({ params: {} }, isObject(config) ? config : {});\n\n  // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n  //   '*' name\n  //   ':' name\n  //   '{' name '}'\n  //   '{' name ':' regexp '}'\n  // The regular expression is somewhat complicated due to the need to allow curly braces\n  // inside the regular expression. The placeholder regexp breaks down as follows:\n  //    ([:*])([\\w\\[\\]]+)              - classic placeholder ($1 / $2) (search version has - for snake-case)\n  //    \\{([\\w\\[\\]]+)(?:\\:( ... ))?\\}  - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n  //    (?: ... | ... | ... )+         - the regexp consists of any number of atoms, an atom being either\n  //    [^{}\\\\]+                       - anything other than curly braces or backslash\n  //    \\\\.                            - a backslash escape\n  //    \\{(?:[^{}\\\\]+|\\\\.)*\\}          - a matched set of curly braces containing other atoms\n  var placeholder       = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      searchPlaceholder = /([:]?)([\\w\\[\\]-]+)|\\{([\\w\\[\\]-]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n      compiled = '^', last = 0, m,\n      segments = this.segments = [],\n      parentParams = parentMatcher ? parentMatcher.params : {},\n      params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n      paramNames = [];\n\n  function addParameter(id, type, config, location) {\n    paramNames.push(id);\n    if (parentParams[id]) return parentParams[id];\n    if (!/^\\w+(-+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n    params[id] = new $$UMFP.Param(id, type, config, location);\n    return params[id];\n  }\n\n  function quoteRegExp(string, pattern, squash) {\n    var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n    if (!pattern) return result;\n    switch(squash) {\n      case false: surroundPattern = ['(', ')'];   break;\n      case true:  surroundPattern = ['?(', ')?']; break;\n      default:    surroundPattern = ['(' + squash + \"|\", ')?'];  break;\n    }\n    return result + surroundPattern[0] + pattern + surroundPattern[1];\n  }\n\n  this.source = pattern;\n\n  // Split into static segments separated by path parameter placeholders.\n  // The number of segments is always 1 more than the number of parameters.\n  function matchDetails(m, isSearch) {\n    var id, regexp, segment, type, cfg, arrayMode;\n    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n    cfg         = config.params[id];\n    segment     = pattern.substring(last, m.index);\n    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n    type        = $$UMFP.type(regexp || \"string\") || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp) });\n    return {\n      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n    };\n  }\n\n  var p, param, segment;\n  while ((m = placeholder.exec(pattern))) {\n    p = matchDetails(m, false);\n    if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\n    param = addParameter(p.id, p.type, p.cfg, \"path\");\n    compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash);\n    segments.push(p.segment);\n    last = placeholder.lastIndex;\n  }\n  segment = pattern.substring(last);\n\n  // Find any search parameter names and remove them from the last segment\n  var i = segment.indexOf('?');\n\n  if (i >= 0) {\n    var search = this.sourceSearch = segment.substring(i);\n    segment = segment.substring(0, i);\n    this.sourcePath = pattern.substring(0, last + i);\n\n    if (search.length > 0) {\n      last = 0;\n      while ((m = searchPlaceholder.exec(search))) {\n        p = matchDetails(m, true);\n        param = addParameter(p.id, p.type, p.cfg, \"search\");\n        last = placeholder.lastIndex;\n        // check if ?&\n      }\n    }\n  } else {\n    this.sourcePath = pattern;\n    this.sourceSearch = '';\n  }\n\n  compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n  segments.push(segment);\n\n  this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n  this.prefix = segments[0];\n  this.$$paramNames = paramNames;\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#concat\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns a new matcher for a pattern constructed by appending the path part and adding the\n * search parameters of the specified pattern to this pattern. The current pattern is not\n * modified. This can be understood as creating a pattern for URLs that are relative to (or\n * suffixes of) the current pattern.\n *\n * @example\n * The following two matchers are equivalent:\n * <pre>\n * new UrlMatcher('/user/{id}?q').concat('/details?date');\n * new UrlMatcher('/user/{id}/details?q&date');\n * </pre>\n *\n * @param {string} pattern  The pattern to append.\n * @param {Object} config  An object hash of the configuration for the matcher.\n * @returns {UrlMatcher}  A matcher for the concatenated pattern.\n */\nUrlMatcher.prototype.concat = function (pattern, config) {\n  // Because order of search parameters is irrelevant, we can add our own search\n  // parameters to the end of the new pattern. Parse the new pattern by itself\n  // and then join the bits together, but it's much easier to do this on a string level.\n  var defaultConfig = {\n    caseInsensitive: $$UMFP.caseInsensitive(),\n    strict: $$UMFP.strictMode(),\n    squash: $$UMFP.defaultSquashPolicy()\n  };\n  return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n};\n\nUrlMatcher.prototype.toString = function () {\n  return this.source;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#exec\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Tests the specified path against this matcher, and returns an object containing the captured\n * parameter values, or null if the path does not match. The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `searchParams`. This means that search parameters are always treated\n * as optional.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n *   x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * </pre>\n *\n * @param {string} path  The URL path to match, e.g. `$location.path()`.\n * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.\n * @returns {Object}  The captured parameter values.\n */\nUrlMatcher.prototype.exec = function (path, searchParams) {\n  var m = this.regexp.exec(path);\n  if (!m) return null;\n  searchParams = searchParams || {};\n\n  var paramNames = this.parameters(), nTotal = paramNames.length,\n    nPath = this.segments.length - 1,\n    values = {}, i, j, cfg, paramName;\n\n  if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\n  function decodePathArray(string) {\n    function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n    function unquoteDashes(str) { return str.replace(/\\\\-/, \"-\"); }\n\n    var split = reverseString(string).split(/-(?!\\\\)/);\n    var allReversed = map(split, reverseString);\n    return map(allReversed, unquoteDashes).reverse();\n  }\n\n  for (i = 0; i < nPath; i++) {\n    paramName = paramNames[i];\n    var param = this.params[paramName];\n    var paramVal = m[i+1];\n    // if the param value matches a pre-replace pair, replace the value before decoding.\n    for (j = 0; j < param.replace; j++) {\n      if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n    }\n    if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n    values[paramName] = param.value(paramVal);\n  }\n  for (/**/; i < nTotal; i++) {\n    paramName = paramNames[i];\n    values[paramName] = this.params[paramName].value(searchParams[paramName]);\n  }\n\n  return values;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#parameters\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns the names of all path and search parameters of this pattern in an unspecified order.\n * \n * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the\n *    pattern has no parameters, an empty array is returned.\n */\nUrlMatcher.prototype.parameters = function (param) {\n  if (!isDefined(param)) return this.$$paramNames;\n  return this.params[param] || null;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#validate\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param {Object} params The object hash of parameters to validate.\n * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n */\nUrlMatcher.prototype.validates = function (params) {\n  return this.params.$$validates(params);\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#format\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters. Null values for path parameters are\n * treated as empty strings.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * </pre>\n *\n * @param {Object} values  the values to substitute for the parameters in this pattern.\n * @returns {string}  the formatted URL (path and optionally search part).\n */\nUrlMatcher.prototype.format = function (values) {\n  values = values || {};\n  var segments = this.segments, params = this.parameters(), paramset = this.params;\n  if (!this.validates(values)) return null;\n\n  var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\n  function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n    return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n  }\n\n  for (i = 0; i < nTotal; i++) {\n    var isPathParam = i < nPath;\n    var name = params[i], param = paramset[name], value = param.value(values[name]);\n    var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n    var squash = isDefaultValue ? param.squash : false;\n    var encoded = param.type.encode(value);\n\n    if (isPathParam) {\n      var nextSegment = segments[i + 1];\n      if (squash === false) {\n        if (encoded != null) {\n          if (isArray(encoded)) {\n            result += map(encoded, encodeDashes).join(\"-\");\n          } else {\n            result += encodeURIComponent(encoded);\n          }\n        }\n        result += nextSegment;\n      } else if (squash === true) {\n        var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n        result += nextSegment.match(capture)[1];\n      } else if (isString(squash)) {\n        result += squash + nextSegment;\n      }\n    } else {\n      if (encoded == null || (isDefaultValue && squash !== false)) continue;\n      if (!isArray(encoded)) encoded = [ encoded ];\n      encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n      result += (search ? '&' : '?') + (name + '=' + encoded);\n      search = true;\n    }\n  }\n\n  return result;\n};\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:Type\n *\n * @description\n * Implements an interface to define custom parameter types that can be decoded from and encoded to\n * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n * objects when matching or formatting URLs, or comparing or validating parameter values.\n *\n * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n * information on registering custom types.\n *\n * @param {Object} config  A configuration object which contains the custom type definition.  The object's\n *        properties will override the default methods and/or pattern in `Type`'s public interface.\n * @example\n * <pre>\n * {\n *   decode: function(val) { return parseInt(val, 10); },\n *   encode: function(val) { return val && val.toString(); },\n *   equals: function(a, b) { return this.is(a) && a === b; },\n *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n *   pattern: /\\d+/\n * }\n * </pre>\n *\n * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n *           coming from a substring of a URL.\n *\n * @returns {Object}  Returns a new `Type` object.\n */\nfunction Type(config) {\n  extend(this, config);\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#is\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Detects whether a value is of a particular type. Accepts a native (decoded) value\n * and determines whether it matches the current `Type` object.\n *\n * @param {*} val  The value to check.\n * @param {string} key  Optional. If the type check is happening in the context of a specific\n *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.\n */\nType.prototype.is = function(val, key) {\n  return true;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#encode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n * only needs to be a representation of `val` that has been coerced to a string.\n *\n * @param {*} val  The value to encode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.\n */\nType.prototype.encode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#decode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Converts a parameter value (from URL string or transition param) to a custom/native value.\n *\n * @param {string} val  The URL parameter value to decode.\n * @param {string} key  The name of the parameter in which `val` is stored. Can be used for\n *        meta-programming of `Type` objects.\n * @returns {*}  Returns a custom representation of the URL parameter value.\n */\nType.prototype.decode = function(val, key) {\n  return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#equals\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Determines whether two decoded values are equivalent.\n *\n * @param {*} a  A value to compare against.\n * @param {*} b  A value to compare against.\n * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.\n */\nType.prototype.equals = function(a, b) {\n  return a == b;\n};\n\nType.prototype.$subPattern = function() {\n  var sub = this.pattern.toString();\n  return sub.substr(1, sub.length - 2);\n};\n\nType.prototype.pattern = /.*/;\n\nType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\n/*\n * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\nType.prototype.$asArray = function(mode, isSearch) {\n  if (!mode) return this;\n  if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n  return new ArrayType(this, mode);\n\n  function ArrayType(type, mode) {\n    function bindTo(type, callbackName) {\n      return function() {\n        return type[callbackName].apply(type, arguments);\n      };\n    }\n\n    // Wrap non-array value as array\n    function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n    // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n    function arrayUnwrap(val) {\n      switch(val.length) {\n        case 0: return undefined;\n        case 1: return mode === \"auto\" ? val[0] : val;\n        default: return val;\n      }\n    }\n    function falsey(val) { return !val; }\n\n    // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n    function arrayHandler(callback, allTruthyMode) {\n      return function handleArray(val) {\n        val = arrayWrap(val);\n        var result = map(val, callback);\n        if (allTruthyMode === true)\n          return filter(result, falsey).length === 0;\n        return arrayUnwrap(result);\n      };\n    }\n\n    // Wraps type (.equals) functions to operate on each value of an array\n    function arrayEqualsHandler(callback) {\n      return function handleArray(val1, val2) {\n        var left = arrayWrap(val1), right = arrayWrap(val2);\n        if (left.length !== right.length) return false;\n        for (var i = 0; i < left.length; i++) {\n          if (!callback(left[i], right[i])) return false;\n        }\n        return true;\n      };\n    }\n\n    this.encode = arrayHandler(bindTo(type, 'encode'));\n    this.decode = arrayHandler(bindTo(type, 'decode'));\n    this.is     = arrayHandler(bindTo(type, 'is'), true);\n    this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n    this.pattern = type.pattern;\n    this.$arrayMode = mode;\n  }\n};\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$urlMatcherFactory\n *\n * @description\n * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n * is also available to providers under the name `$urlMatcherFactoryProvider`.\n */\nfunction $UrlMatcherFactory() {\n  $$UMFP = this;\n\n  var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\n  function valToString(val) { return val != null ? val.toString().replace(/\\//g, \"%2F\") : val; }\n  function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, \"/\") : val; }\n//  TODO: in 1.0, make string .is() return false if value is undefined by default.\n//  function regexpMatches(val) { /*jshint validthis:true */ return isDefined(val) && this.pattern.test(val); }\n  function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); }\n\n  var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n    string: {\n      encode: valToString,\n      decode: valFromString,\n      is: regexpMatches,\n      pattern: /[^/]*/\n    },\n    int: {\n      encode: valToString,\n      decode: function(val) { return parseInt(val, 10); },\n      is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },\n      pattern: /\\d+/\n    },\n    bool: {\n      encode: function(val) { return val ? 1 : 0; },\n      decode: function(val) { return parseInt(val, 10) !== 0; },\n      is: function(val) { return val === true || val === false; },\n      pattern: /0|1/\n    },\n    date: {\n      encode: function (val) {\n        if (!this.is(val))\n          return undefined;\n        return [ val.getFullYear(),\n          ('0' + (val.getMonth() + 1)).slice(-2),\n          ('0' + val.getDate()).slice(-2)\n        ].join(\"-\");\n      },\n      decode: function (val) {\n        if (this.is(val)) return val;\n        var match = this.capture.exec(val);\n        return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n      },\n      is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n      equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n      pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n      capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n    },\n    json: {\n      encode: angular.toJson,\n      decode: angular.fromJson,\n      is: angular.isObject,\n      equals: angular.equals,\n      pattern: /[^/]*/\n    },\n    any: { // does not encode/decode\n      encode: angular.identity,\n      decode: angular.identity,\n      is: angular.identity,\n      equals: angular.equals,\n      pattern: /.*/\n    }\n  };\n\n  function getDefaultConfig() {\n    return {\n      strict: isStrictMode,\n      caseInsensitive: isCaseInsensitive\n    };\n  }\n\n  function isInjectable(value) {\n    return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n  }\n\n  /**\n   * [Internal] Get the default value of a parameter, which may be an injectable function.\n   */\n  $UrlMatcherFactory.$$getDefaultValue = function(config) {\n    if (!isInjectable(config.value)) return config.value;\n    if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n    return injector.invoke(config.value);\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URL matching should be case sensitive (the default behavior), or not.\n   *\n   * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n   * @returns {boolean} the current value of caseInsensitive\n   */\n  this.caseInsensitive = function(value) {\n    if (isDefined(value))\n      isCaseInsensitive = value;\n    return isCaseInsensitive;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#strictMode\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Defines whether URLs should match trailing slashes, or not (the default behavior).\n   *\n   * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n   * @returns {boolean} the current value of strictMode\n   */\n  this.strictMode = function(value) {\n    if (isDefined(value))\n      isStrictMode = value;\n    return isStrictMode;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Sets the default behavior when generating or matching URLs with default parameter values.\n   *\n   * @param {string} value A string that defines the default parameter URL squashing behavior.\n   *    `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n   *    `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n   *             parameter is surrounded by slashes, squash (remove) one slash from the URL\n   *    any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n   *             the parameter value from the URL and replace it with this string.\n   */\n  this.defaultSquashPolicy = function(value) {\n    if (!isDefined(value)) return defaultSquashPolicy;\n    if (value !== true && value !== false && !isString(value))\n      throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n    defaultSquashPolicy = value;\n    return value;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#compile\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n   *\n   * @param {string} pattern  The URL pattern.\n   * @param {Object} config  The config object hash.\n   * @returns {UrlMatcher}  The UrlMatcher.\n   */\n  this.compile = function (pattern, config) {\n    return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#isMatcher\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n   *\n   * @param {Object} object  The object to perform the type check against.\n   * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by\n   *          implementing all the same methods.\n   */\n  this.isMatcher = function (o) {\n    if (!isObject(o)) return false;\n    var result = true;\n\n    forEach(UrlMatcher.prototype, function(val, name) {\n      if (isFunction(val)) {\n        result = result && (isDefined(o[name]) && isFunction(o[name]));\n      }\n    });\n    return result;\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.util.$urlMatcherFactory#type\n   * @methodOf ui.router.util.$urlMatcherFactory\n   *\n   * @description\n   * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n   * generate URLs with typed parameters.\n   *\n   * @param {string} name  The type name.\n   * @param {Object|Function} definition   The type definition. See\n   *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n   *        runtime starts.  The result of this function is merged into the existing `definition`.\n   *        See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n   *\n   * @returns {Object}  Returns `$urlMatcherFactoryProvider`.\n   *\n   * @example\n   * This is a simple example of a custom type that encodes and decodes items from an\n   * array, using the array index as the URL-encoded value:\n   *\n   * <pre>\n   * var list = ['John', 'Paul', 'George', 'Ringo'];\n   *\n   * $urlMatcherFactoryProvider.type('listItem', {\n   *   encode: function(item) {\n   *     // Represent the list item in the URL using its corresponding index\n   *     return list.indexOf(item);\n   *   },\n   *   decode: function(item) {\n   *     // Look up the list item by index\n   *     return list[parseInt(item, 10)];\n   *   },\n   *   is: function(item) {\n   *     // Ensure the item is valid by checking to see that it appears\n   *     // in the list\n   *     return list.indexOf(item) > -1;\n   *   }\n   * });\n   *\n   * $stateProvider.state('list', {\n   *   url: \"/list/{item:listItem}\",\n   *   controller: function($scope, $stateParams) {\n   *     console.log($stateParams.item);\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * // Changes URL to '/list/3', logs \"Ringo\" to the console\n   * $state.go('list', { item: \"Ringo\" });\n   * </pre>\n   *\n   * This is a more complex example of a type that relies on dependency injection to\n   * interact with services, and uses the parameter name from the URL to infer how to\n   * handle encoding and decoding parameter values:\n   *\n   * <pre>\n   * // Defines a custom type that gets a value from a service,\n   * // where each service gets different types of values from\n   * // a backend API:\n   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n   *\n   *   // Matches up services to URL parameter names\n   *   var services = {\n   *     user: Users,\n   *     post: Posts\n   *   };\n   *\n   *   return {\n   *     encode: function(object) {\n   *       // Represent the object in the URL using its unique ID\n   *       return object.id;\n   *     },\n   *     decode: function(value, key) {\n   *       // Look up the object by ID, using the parameter\n   *       // name (key) to call the correct service\n   *       return services[key].findById(value);\n   *     },\n   *     is: function(object, key) {\n   *       // Check that object is a valid dbObject\n   *       return angular.isObject(object) && object.id && services[key];\n   *     }\n   *     equals: function(a, b) {\n   *       // Check the equality of decoded objects by comparing\n   *       // their unique IDs\n   *       return a.id === b.id;\n   *     }\n   *   };\n   * });\n   *\n   * // In a config() block, you can then attach URLs with\n   * // type-annotated parameters:\n   * $stateProvider.state('users', {\n   *   url: \"/users\",\n   *   // ...\n   * }).state('users.item', {\n   *   url: \"/{user:dbObject}\",\n   *   controller: function($scope, $stateParams) {\n   *     // $stateParams.user will now be an object returned from\n   *     // the Users service\n   *   },\n   *   // ...\n   * });\n   * </pre>\n   */\n  this.type = function (name, definition, definitionFn) {\n    if (!isDefined(definition)) return $types[name];\n    if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\n    $types[name] = new Type(extend({ name: name }, definition));\n    if (definitionFn) {\n      typeQueue.push({ name: name, def: definitionFn });\n      if (!enqueue) flushTypeQueue();\n    }\n    return this;\n  };\n\n  // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n  function flushTypeQueue() {\n    while(typeQueue.length) {\n      var type = typeQueue.shift();\n      if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n      angular.extend($types[type.name], injector.invoke(type.def));\n    }\n  }\n\n  // Register default types. Store them in the prototype of $types.\n  forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n  $types = inherit($types, {});\n\n  /* No need to document $get, since it returns this */\n  this.$get = ['$injector', function ($injector) {\n    injector = $injector;\n    enqueue = false;\n    flushTypeQueue();\n\n    forEach(defaultTypes, function(type, name) {\n      if (!$types[name]) $types[name] = new Type(type);\n    });\n    return this;\n  }];\n\n  this.Param = function Param(id, type, config, location) {\n    var self = this;\n    config = unwrapShorthand(config);\n    type = getType(config, type, location);\n    var arrayMode = getArrayMode();\n    type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n    if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n      config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n    var isOptional = config.value !== undefined;\n    var squash = getSquashPolicy(config, isOptional);\n    var replace = getReplace(config, arrayMode, isOptional, squash);\n\n    function unwrapShorthand(config) {\n      var keys = isObject(config) ? objectKeys(config) : [];\n      var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n                        indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n      if (isShorthand) config = { value: config };\n      config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n      return config;\n    }\n\n    function getType(config, urlType, location) {\n      if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n      if (urlType) return urlType;\n      if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n      return config.type instanceof Type ? config.type : new Type(config.type);\n    }\n\n    // array config: param name (param[]) overrides default settings.  explicit config overrides param name.\n    function getArrayMode() {\n      var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n      var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n      return extend(arrayDefaults, arrayParamNomenclature, config).array;\n    }\n\n    /**\n     * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n     */\n    function getSquashPolicy(config, isOptional) {\n      var squash = config.squash;\n      if (!isOptional || squash === false) return false;\n      if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n      if (squash === true || isString(squash)) return squash;\n      throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n    }\n\n    function getReplace(config, arrayMode, isOptional, squash) {\n      var replace, configuredKeys, defaultPolicy = [\n        { from: \"\",   to: (isOptional || arrayMode ? undefined : \"\") },\n        { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n      ];\n      replace = isArray(config.replace) ? config.replace : [];\n      if (isString(squash))\n        replace.push({ from: squash, to: undefined });\n      configuredKeys = map(replace, function(item) { return item.from; } );\n      return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n    }\n\n    /**\n     * [Internal] Get the default value of a parameter, which may be an injectable function.\n     */\n    function $$getDefaultValue() {\n      if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n      return injector.invoke(config.$$fn);\n    }\n\n    /**\n     * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n     * default value, which may be the result of an injectable function.\n     */\n    function $value(value) {\n      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n      function $replace(value) {\n        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n        return replacement.length ? replacement[0] : value;\n      }\n      value = $replace(value);\n      return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n    }\n\n    function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\n    extend(this, {\n      id: id,\n      type: type,\n      location: location,\n      array: arrayMode,\n      squash: squash,\n      replace: replace,\n      isOptional: isOptional,\n      value: $value,\n      dynamic: undefined,\n      config: config,\n      toString: toString\n    });\n  };\n\n  function ParamSet(params) {\n    extend(this, params || {});\n  }\n\n  ParamSet.prototype = {\n    $$new: function() {\n      return inherit(this, extend(new ParamSet(), { $$parent: this}));\n    },\n    $$keys: function () {\n      var keys = [], chain = [], parent = this,\n        ignore = objectKeys(ParamSet.prototype);\n      while (parent) { chain.push(parent); parent = parent.$$parent; }\n      chain.reverse();\n      forEach(chain, function(paramset) {\n        forEach(objectKeys(paramset), function(key) {\n            if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n        });\n      });\n      return keys;\n    },\n    $$values: function(paramValues) {\n      var values = {}, self = this;\n      forEach(self.$$keys(), function(key) {\n        values[key] = self[key].value(paramValues && paramValues[key]);\n      });\n      return values;\n    },\n    $$equals: function(paramValues1, paramValues2) {\n      var equal = true, self = this;\n      forEach(self.$$keys(), function(key) {\n        var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n        if (!self[key].type.equals(left, right)) equal = false;\n      });\n      return equal;\n    },\n    $$validates: function $$validate(paramValues) {\n      var result = true, isOptional, val, param, self = this;\n\n      forEach(this.$$keys(), function(key) {\n        param = self[key];\n        val = paramValues[key];\n        isOptional = !val && param.isOptional;\n        result = result && (isOptional || !!param.type.is(val));\n      });\n      return result;\n    },\n    $$parent: undefined\n  };\n\n  this.ParamSet = ParamSet;\n}\n\n// Register as a provider so it's available to other providers\nangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\nangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n\n/**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider\n *\n * @requires ui.router.util.$urlMatcherFactoryProvider\n * @requires $locationProvider\n *\n * @description\n * `$urlRouterProvider` has the responsibility of watching `$location`. \n * When `$location` changes it runs through a list of rules one by one until a \n * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n *\n * There are several methods on `$urlRouterProvider` that make it useful to use directly\n * in your module config.\n */\n$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\nfunction $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {\n  var rules = [], otherwise = null, interceptDeferred = false, listener;\n\n  // Returns a string that is a prefix of all strings matching the RegExp\n  function regExpPrefix(re) {\n    var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n    return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n  }\n\n  // Interpolates matched values into a String.replace()-style pattern\n  function interpolate(pattern, match) {\n    return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n      return match[what === '$' ? 0 : Number(what)];\n    });\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#rule\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines rules that are used by `$urlRouterProvider` to find matches for\n   * specific URLs.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // Here's an example of how you might allow case insensitive urls\n   *   $urlRouterProvider.rule(function ($injector, $location) {\n   *     var path = $location.path(),\n   *         normalized = path.toLowerCase();\n   *\n   *     if (path !== normalized) {\n   *       return normalized;\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {object} rule Handler function that takes `$injector` and `$location`\n   * services as arguments. You can use them to return a valid path as a string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.rule = function (rule) {\n    if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    rules.push(rule);\n    return this;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouterProvider#otherwise\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Defines a path that is used when an invalid route is requested.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   // if the path doesn't match any of the urls you configured\n   *   // otherwise will take care of routing the user to the\n   *   // specified url\n   *   $urlRouterProvider.otherwise('/index');\n   *\n   *   // Example of using function rule as param\n   *   $urlRouterProvider.otherwise(function ($injector, $location) {\n   *     return '/a/valid/url';\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} rule The url path you want to redirect to or a function \n   * rule that returns the url path. The function version is passed two params: \n   * `$injector` and `$location` services, and must return a url string.\n   *\n   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n   */\n  this.otherwise = function (rule) {\n    if (isString(rule)) {\n      var redirect = rule;\n      rule = function () { return redirect; };\n    }\n    else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n    otherwise = rule;\n    return this;\n  };\n\n\n  function handleIfMatch($injector, handler, match) {\n    if (!match) return false;\n    var result = $injector.invoke(handler, handler, { $match: match });\n    return isDefined(result) ? result : true;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#when\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Registers a handler for a given url matching. if handle is a string, it is\n   * treated as a redirect, and is interpolated according to the syntax of match\n   * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n   *\n   * If the handler is a function, it is injectable. It gets invoked if `$location`\n   * matches. You have the option of inject the match object as `$match`.\n   *\n   * The handler can return\n   *\n   * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n   *   will continue trying to find another one that matches.\n   * - **string** which is treated as a redirect and passed to `$location.url()`\n   * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n   *     if ($state.$current.navigable !== state ||\n   *         !equalForKeys($match, $stateParams) {\n   *      $state.transitionTo(state, $match, false);\n   *     }\n   *   });\n   * });\n   * </pre>\n   *\n   * @param {string|object} what The incoming path that you want to redirect.\n   * @param {string|object} handler The path you want to redirect your user to.\n   */\n  this.when = function (what, handler) {\n    var redirect, handlerIsString = isString(handler);\n    if (isString(what)) what = $urlMatcherFactory.compile(what);\n\n    if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n      throw new Error(\"invalid 'handler' in when()\");\n\n    var strategies = {\n      matcher: function (what, handler) {\n        if (handlerIsString) {\n          redirect = $urlMatcherFactory.compile(handler);\n          handler = ['$match', function ($match) { return redirect.format($match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n        }, {\n          prefix: isString(what.prefix) ? what.prefix : ''\n        });\n      },\n      regex: function (what, handler) {\n        if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\n        if (handlerIsString) {\n          redirect = handler;\n          handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n        }\n        return extend(function ($injector, $location) {\n          return handleIfMatch($injector, handler, what.exec($location.path()));\n        }, {\n          prefix: regExpPrefix(what)\n        });\n      }\n    };\n\n    var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\n    for (var n in check) {\n      if (check[n]) return this.rule(strategies[n](what, handler));\n    }\n\n    throw new Error(\"invalid 'what' in when()\");\n  };\n\n  /**\n   * @ngdoc function\n   * @name ui.router.router.$urlRouterProvider#deferIntercept\n   * @methodOf ui.router.router.$urlRouterProvider\n   *\n   * @description\n   * Disables (or enables) deferring location change interception.\n   *\n   * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n   * defer a transition but maintain the current URL), call this method at configuration time.\n   * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n   * `$locationChangeSuccess` event handler.\n   *\n   * @example\n   * <pre>\n   * var app = angular.module('app', ['ui.router.router']);\n   *\n   * app.config(function ($urlRouterProvider) {\n   *\n   *   // Prevent $urlRouter from automatically intercepting URL changes;\n   *   // this allows you to configure custom behavior in between\n   *   // location changes and route synchronization:\n   *   $urlRouterProvider.deferIntercept();\n   *\n   * }).run(function ($rootScope, $urlRouter, UserService) {\n   *\n   *   $rootScope.$on('$locationChangeSuccess', function(e) {\n   *     // UserService is an example service for managing user state\n   *     if (UserService.isLoggedIn()) return;\n   *\n   *     // Prevent $urlRouter's default handler from firing\n   *     e.preventDefault();\n   *\n   *     UserService.handleLogin().then(function() {\n   *       // Once the user has logged in, sync the current URL\n   *       // to the router:\n   *       $urlRouter.sync();\n   *     });\n   *   });\n   *\n   *   // Configures $urlRouter's listener *after* your custom listener\n   *   $urlRouter.listen();\n   * });\n   * </pre>\n   *\n   * @param {boolean} defer Indicates whether to defer location change interception. Passing\n            no parameter is equivalent to `true`.\n   */\n  this.deferIntercept = function (defer) {\n    if (defer === undefined) defer = true;\n    interceptDeferred = defer;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.router.$urlRouter\n   *\n   * @requires $location\n   * @requires $rootScope\n   * @requires $injector\n   * @requires $browser\n   *\n   * @description\n   *\n   */\n  this.$get = $get;\n  $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];\n  function $get(   $location,   $rootScope,   $injector,   $browser) {\n\n    var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\n    function appendBasePath(url, isHtml5, absolute) {\n      if (baseHref === '/') return url;\n      if (isHtml5) return baseHref.slice(0, -1) + url;\n      if (absolute) return baseHref.slice(1) + url;\n      return url;\n    }\n\n    // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n    function update(evt) {\n      if (evt && evt.defaultPrevented) return;\n      var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n      lastPushedUrl = undefined;\n      if (ignoreUpdate) return true;\n\n      function check(rule) {\n        var handled = rule($injector, $location);\n\n        if (!handled) return false;\n        if (isString(handled)) $location.replace().url(handled);\n        return true;\n      }\n      var n = rules.length, i;\n\n      for (i = 0; i < n; i++) {\n        if (check(rules[i])) return;\n      }\n      // always check otherwise last to allow dynamic updates to the set of rules\n      if (otherwise) check(otherwise);\n    }\n\n    function listen() {\n      listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n      return listener;\n    }\n\n    if (!interceptDeferred) listen();\n\n    return {\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#sync\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n       * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n       * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n       * with the transition by calling `$urlRouter.sync()`.\n       *\n       * @example\n       * <pre>\n       * angular.module('app', ['ui.router'])\n       *   .run(function($rootScope, $urlRouter) {\n       *     $rootScope.$on('$locationChangeSuccess', function(evt) {\n       *       // Halt state change from even starting\n       *       evt.preventDefault();\n       *       // Perform custom logic\n       *       var meetsRequirement = ...\n       *       // Continue with the update and state transition if logic allows\n       *       if (meetsRequirement) $urlRouter.sync();\n       *     });\n       * });\n       * </pre>\n       */\n      sync: function() {\n        update();\n      },\n\n      listen: function() {\n        return listen();\n      },\n\n      update: function(read) {\n        if (read) {\n          location = $location.url();\n          return;\n        }\n        if ($location.url() === location) return;\n\n        $location.url(location);\n        $location.replace();\n      },\n\n      push: function(urlMatcher, params, options) {\n        $location.url(urlMatcher.format(params || {}));\n        lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n        if (options && options.replace) $location.replace();\n      },\n\n      /**\n       * @ngdoc function\n       * @name ui.router.router.$urlRouter#href\n       * @methodOf ui.router.router.$urlRouter\n       *\n       * @description\n       * A URL generation method that returns the compiled URL for a given\n       * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n       *\n       * @example\n       * <pre>\n       * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n       *   person: \"bob\"\n       * });\n       * // $bob == \"/about/bob\";\n       * </pre>\n       *\n       * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n       * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n       * @param {object=} options Options object. The options are:\n       *\n       * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n       *\n       * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n       */\n      href: function(urlMatcher, params, options) {\n        if (!urlMatcher.validates(params)) return null;\n\n        var isHtml5 = $locationProvider.html5Mode();\n        if (angular.isObject(isHtml5)) {\n          isHtml5 = isHtml5.enabled;\n        }\n        \n        var url = urlMatcher.format(params);\n        options = options || {};\n\n        if (!isHtml5 && url !== null) {\n          url = \"#\" + $locationProvider.hashPrefix() + url;\n        }\n        url = appendBasePath(url, isHtml5, options.absolute);\n\n        if (!options.absolute || !url) {\n          return url;\n        }\n\n        var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n        port = (port === 80 || port === 443 ? '' : ':' + port);\n\n        return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n      }\n    };\n  }\n}\n\nangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$stateProvider\n *\n * @requires ui.router.router.$urlRouterProvider\n * @requires ui.router.util.$urlMatcherFactoryProvider\n *\n * @description\n * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\n$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\nfunction $StateProvider(   $urlRouterProvider,   $urlMatcherFactory) {\n\n  var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\n  // Builds state properties from definition passed to registerState()\n  var stateBuilder = {\n\n    // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n    // state.children = [];\n    // if (parent) parent.children.push(state);\n    parent: function(state) {\n      if (isDefined(state.parent) && state.parent) return findState(state.parent);\n      // regex matches any valid composite state name\n      // would match \"contact.list\" but not \"contacts\"\n      var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n      return compositeName ? findState(compositeName[1]) : root;\n    },\n\n    // inherit 'data' from parent and override by own values (if any)\n    data: function(state) {\n      if (state.parent && state.parent.data) {\n        state.data = state.self.data = extend({}, state.parent.data, state.data);\n      }\n      return state.data;\n    },\n\n    // Build a URLMatcher if necessary, either via a relative or absolute URL\n    url: function(state) {\n      var url = state.url, config = { params: state.params || {} };\n\n      if (isString(url)) {\n        if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n        return (state.parent.navigable || root).url.concat(url, config);\n      }\n\n      if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n      throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n    },\n\n    // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n    navigable: function(state) {\n      return state.url ? state : (state.parent ? state.parent.navigable : null);\n    },\n\n    // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n    ownParams: function(state) {\n      var params = state.url && state.url.params || new $$UMFP.ParamSet();\n      forEach(state.params || {}, function(config, id) {\n        if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n      });\n      return params;\n    },\n\n    // Derive parameters for this state and ensure they're a super-set of parent's parameters\n    params: function(state) {\n      return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();\n    },\n\n    // If there is no explicit multi-view configuration, make one up so we don't have\n    // to handle both cases in the view directive later. Note that having an explicit\n    // 'views' property will mean the default unnamed view properties are ignored. This\n    // is also a good time to resolve view names to absolute names, so everything is a\n    // straight lookup at link time.\n    views: function(state) {\n      var views = {};\n\n      forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n        if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n        views[name] = view;\n      });\n      return views;\n    },\n\n    // Keep a full path from the root down to this state as this is needed for state activation.\n    path: function(state) {\n      return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n    },\n\n    // Speed up $state.contains() as it's used a lot\n    includes: function(state) {\n      var includes = state.parent ? extend({}, state.parent.includes) : {};\n      includes[state.name] = true;\n      return includes;\n    },\n\n    $delegates: {}\n  };\n\n  function isRelative(stateName) {\n    return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n  }\n\n  function findState(stateOrName, base) {\n    if (!stateOrName) return undefined;\n\n    var isStr = isString(stateOrName),\n        name  = isStr ? stateOrName : stateOrName.name,\n        path  = isRelative(name);\n\n    if (path) {\n      if (!base) throw new Error(\"No reference point given for path '\"  + name + \"'\");\n      base = findState(base);\n      \n      var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\n      for (; i < pathLength; i++) {\n        if (rel[i] === \"\" && i === 0) {\n          current = base;\n          continue;\n        }\n        if (rel[i] === \"^\") {\n          if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n          current = current.parent;\n          continue;\n        }\n        break;\n      }\n      rel = rel.slice(i).join(\".\");\n      name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n    }\n    var state = states[name];\n\n    if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n      return state;\n    }\n    return undefined;\n  }\n\n  function queueState(parentName, state) {\n    if (!queue[parentName]) {\n      queue[parentName] = [];\n    }\n    queue[parentName].push(state);\n  }\n\n  function flushQueuedChildren(parentName) {\n    var queued = queue[parentName] || [];\n    while(queued.length) {\n      registerState(queued.shift());\n    }\n  }\n\n  function registerState(state) {\n    // Wrap a new object around the state so we can store our private details easily.\n    state = inherit(state, {\n      self: state,\n      resolve: state.resolve || {},\n      toString: function() { return this.name; }\n    });\n\n    var name = state.name;\n    if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n    if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"'' is already defined\");\n\n    // Get parent name\n    var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n        : (isString(state.parent)) ? state.parent\n        : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n        : '';\n\n    // If parent is not registered yet, add state to queue and register later\n    if (parentName && !states[parentName]) {\n      return queueState(parentName, state.self);\n    }\n\n    for (var key in stateBuilder) {\n      if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n    }\n    states[name] = state;\n\n    // Register the state in the global state list and with $urlRouter if necessary.\n    if (!state[abstractKey] && state.url) {\n      $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n        if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n          $state.transitionTo(state, $match, { inherit: true, location: false });\n        }\n      }]);\n    }\n\n    // Register any queued children\n    flushQueuedChildren(name);\n\n    return state;\n  }\n\n  // Checks text to see if it looks like a glob.\n  function isGlob (text) {\n    return text.indexOf('*') > -1;\n  }\n\n  // Returns true if glob matches current $state name.\n  function doesStateMatchGlob (glob) {\n    var globSegments = glob.split('.'),\n        segments = $state.$current.name.split('.');\n\n    //match greedy starts\n    if (globSegments[0] === '**') {\n       segments = segments.slice(indexOf(segments, globSegments[1]));\n       segments.unshift('**');\n    }\n    //match greedy ends\n    if (globSegments[globSegments.length - 1] === '**') {\n       segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n       segments.push('**');\n    }\n\n    if (globSegments.length != segments.length) {\n      return false;\n    }\n\n    //match single stars\n    for (var i = 0, l = globSegments.length; i < l; i++) {\n      if (globSegments[i] === '*') {\n        segments[i] = '*';\n      }\n    }\n\n    return segments.join('') === globSegments.join('');\n  }\n\n\n  // Implicit root state that is always active\n  root = registerState({\n    name: '',\n    url: '^',\n    views: null,\n    'abstract': true\n  });\n  root.navigable = null;\n\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#decorator\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Allows you to extend (carefully) or override (at your own peril) the \n   * `stateBuilder` object used internally by `$stateProvider`. This can be used \n   * to add custom functionality to ui-router, for example inferring templateUrl \n   * based on the state name.\n   *\n   * When passing only a name, it returns the current (original or decorated) builder\n   * function that matches `name`.\n   *\n   * The builder functions that can be decorated are listed below. Though not all\n   * necessarily have a good use case for decoration, that is up to you to decide.\n   *\n   * In addition, users can attach custom decorators, which will generate new \n   * properties within the state's internal definition. There is currently no clear \n   * use-case for this beyond accessing internal states (i.e. $state.$current), \n   * however, expect this to become increasingly relevant as we introduce additional \n   * meta-programming features.\n   *\n   * **Warning**: Decorators should not be interdependent because the order of \n   * execution of the builder functions in non-deterministic. Builder functions \n   * should only be dependent on the state definition object and super function.\n   *\n   *\n   * Existing builder functions and current return values:\n   *\n   * - **parent** `{object}` - returns the parent state object.\n   * - **data** `{object}` - returns state data, including any inherited data that is not\n   *   overridden by own values (if any).\n   * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n   *   or `null`.\n   * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n   *   navigable).\n   * - **params** `{object}` - returns an array of state params that are ensured to \n   *   be a super-set of parent's params.\n   * - **views** `{object}` - returns a views object where each key is an absolute view \n   *   name (i.e. \"viewName@stateName\") and each value is the config object \n   *   (template, controller) for the view. Even when you don't use the views object \n   *   explicitly on a state config, one is still created for you internally.\n   *   So by decorating this builder function you have access to decorating template \n   *   and controller properties.\n   * - **ownParams** `{object}` - returns an array of params that belong to the state, \n   *   not including any params defined by ancestor states.\n   * - **path** `{string}` - returns the full path from the root down to this state. \n   *   Needed for state activation.\n   * - **includes** `{object}` - returns an object that includes every state that \n   *   would pass a `$state.includes()` test.\n   *\n   * @example\n   * <pre>\n   * // Override the internal 'views' builder with a function that takes the state\n   * // definition, and a reference to the internal function being overridden:\n   * $stateProvider.decorator('views', function (state, parent) {\n   *   var result = {},\n   *       views = parent(state);\n   *\n   *   angular.forEach(views, function (config, name) {\n   *     var autoName = (state.name + '.' + name).replace('.', '/');\n   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n   *     result[name] = config;\n   *   });\n   *   return result;\n   * });\n   *\n   * $stateProvider.state('home', {\n   *   views: {\n   *     'contact.list': { controller: 'ListController' },\n   *     'contact.item': { controller: 'ItemController' }\n   *   }\n   * });\n   *\n   * // ...\n   *\n   * $state.go('home');\n   * // Auto-populates list and item views with /partials/home/contact/list.html,\n   * // and /partials/home/contact/item.html, respectively.\n   * </pre>\n   *\n   * @param {string} name The name of the builder function to decorate. \n   * @param {object} func A function that is responsible for decorating the original \n   * builder function. The function receives two parameters:\n   *\n   *   - `{object}` - state - The state config object.\n   *   - `{object}` - super - The original builder function.\n   *\n   * @return {object} $stateProvider - $stateProvider instance\n   */\n  this.decorator = decorator;\n  function decorator(name, func) {\n    /*jshint validthis: true */\n    if (isString(name) && !isDefined(func)) {\n      return stateBuilder[name];\n    }\n    if (!isFunction(func) || !isString(name)) {\n      return this;\n    }\n    if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n      stateBuilder.$delegates[name] = stateBuilder[name];\n    }\n    stateBuilder[name] = func;\n    return this;\n  }\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$stateProvider#state\n   * @methodOf ui.router.state.$stateProvider\n   *\n   * @description\n   * Registers a state configuration under a given state name. The stateConfig object\n   * has the following acceptable properties.\n   *\n   * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n   * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n   * @param {object} stateConfig State configuration object.\n   * @param {string|function=} stateConfig.template\n   * <a id='template'></a>\n   *   html template as a string or a function that returns\n   *   an html template as a string which should be used by the uiView directives. This property \n   *   takes precedence over templateUrl.\n   *   \n   *   If `template` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by\n   *     applying the current state\n   *\n   * <pre>template:\n   *   \"<h1>inline template definition</h1>\" +\n   *   \"<div ui-view></div>\"</pre>\n   * <pre>template: function(params) {\n   *       return \"<h1>generated template</h1>\"; }</pre>\n   * </div>\n   *\n   * @param {string|function=} stateConfig.templateUrl\n   * <a id='templateUrl'></a>\n   *\n   *   path or function that returns a path to an html\n   *   template that should be used by uiView.\n   *   \n   *   If `templateUrl` is a function, it will be called with the following parameters:\n   *\n   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by \n   *     applying the current state\n   *\n   * <pre>templateUrl: \"home.html\"</pre>\n   * <pre>templateUrl: function(params) {\n   *     return myTemplates[params.pageId]; }</pre>\n   *\n   * @param {function=} stateConfig.templateProvider\n   * <a id='templateProvider'></a>\n   *    Provider function that returns HTML content string.\n   * <pre> templateProvider:\n   *       function(MyTemplateService, params) {\n   *         return MyTemplateService.getTemplate(params.pageId);\n   *       }</pre>\n   *\n   * @param {string|function=} stateConfig.controller\n   * <a id='controller'></a>\n   *\n   *  Controller fn that should be associated with newly\n   *   related scope or the name of a registered controller if passed as a string.\n   *   Optionally, the ControllerAs may be declared here.\n   * <pre>controller: \"MyRegisteredController\"</pre>\n   * <pre>controller:\n   *     \"MyRegisteredController as fooCtrl\"}</pre>\n   * <pre>controller: function($scope, MyService) {\n   *     $scope.data = MyService.getData(); }</pre>\n   *\n   * @param {function=} stateConfig.controllerProvider\n   * <a id='controllerProvider'></a>\n   *\n   * Injectable provider function that returns the actual controller or string.\n   * <pre>controllerProvider:\n   *   function(MyResolveData) {\n   *     if (MyResolveData.foo)\n   *       return \"FooCtrl\"\n   *     else if (MyResolveData.bar)\n   *       return \"BarCtrl\";\n   *     else return function($scope) {\n   *       $scope.baz = \"Qux\";\n   *     }\n   *   }</pre>\n   *\n   * @param {string=} stateConfig.controllerAs\n   * <a id='controllerAs'></a>\n   * \n   * A controller alias name. If present the controller will be\n   *   published to scope under the controllerAs name.\n   * <pre>controllerAs: \"myCtrl\"</pre>\n   *\n   * @param {object=} stateConfig.resolve\n   * <a id='resolve'></a>\n   *\n   * An optional map&lt;string, function&gt; of dependencies which\n   *   should be injected into the controller. If any of these dependencies are promises, \n   *   the router will wait for them all to be resolved before the controller is instantiated.\n   *   If all the promises are resolved successfully, the $stateChangeSuccess event is fired\n   *   and the values of the resolved promises are injected into any controllers that reference them.\n   *   If any  of the promises are rejected the $stateChangeError event is fired.\n   *\n   *   The map object is:\n   *   \n   *   - key - {string}: name of dependency to be injected into controller\n   *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, \n   *     it is injected and return value it treated as dependency. If result is a promise, it is \n   *     resolved before its value is injected into controller.\n   *\n   * <pre>resolve: {\n   *     myResolve1:\n   *       function($http, $stateParams) {\n   *         return $http.get(\"/api/foos/\"+stateParams.fooID);\n   *       }\n   *     }</pre>\n   *\n   * @param {string=} stateConfig.url\n   * <a id='url'></a>\n   *\n   *   A url fragment with optional parameters. When a state is navigated or\n   *   transitioned to, the `$stateParams` service will be populated with any \n   *   parameters that were passed.\n   *\n   * examples:\n   * <pre>url: \"/home\"\n   * url: \"/users/:userid\"\n   * url: \"/books/{bookid:[a-zA-Z_-]}\"\n   * url: \"/books/{categoryid:int}\"\n   * url: \"/books/{publishername:string}/{categoryid:int}\"\n   * url: \"/messages?before&after\"\n   * url: \"/messages?{before:date}&{after:date}\"</pre>\n   * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n   *\n   * @param {object=} stateConfig.views\n   * <a id='views'></a>\n   * an optional map&lt;string, object&gt; which defined multiple views, or targets views\n   * manually/explicitly.\n   *\n   * Examples:\n   *\n   * Targets three named `ui-view`s in the parent state's template\n   * <pre>views: {\n   *     header: {\n   *       controller: \"headerCtrl\",\n   *       templateUrl: \"header.html\"\n   *     }, body: {\n   *       controller: \"bodyCtrl\",\n   *       templateUrl: \"body.html\"\n   *     }, footer: {\n   *       controller: \"footCtrl\",\n   *       templateUrl: \"footer.html\"\n   *     }\n   *   }</pre>\n   *\n   * Targets named `ui-view=\"header\"` from grandparent state 'top''s template, and named `ui-view=\"body\" from parent state's template.\n   * <pre>views: {\n   *     'header@top': {\n   *       controller: \"msgHeaderCtrl\",\n   *       templateUrl: \"msgHeader.html\"\n   *     }, 'body': {\n   *       controller: \"messagesCtrl\",\n   *       templateUrl: \"messages.html\"\n   *     }\n   *   }</pre>\n   *\n   * @param {boolean=} [stateConfig.abstract=false]\n   * <a id='abstract'></a>\n   * An abstract state will never be directly activated,\n   *   but can provide inherited properties to its common children states.\n   * <pre>abstract: true</pre>\n   *\n   * @param {function=} stateConfig.onEnter\n   * <a id='onEnter'></a>\n   *\n   * Callback function for when a state is entered. Good way\n   *   to trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onEnter: function(MyService, $stateParams) {\n   *     MyService.foo($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {function=} stateConfig.onExit\n   * <a id='onExit'></a>\n   *\n   * Callback function for when a state is exited. Good way to\n   *   trigger an action or dispatch an event, such as opening a dialog.\n   * If minifying your scripts, make sure to explictly annotate this function,\n   * because it won't be automatically annotated by your build tools.\n   *\n   * <pre>onExit: function(MyService, $stateParams) {\n   *     MyService.cleanup($stateParams.myParam);\n   * }</pre>\n   *\n   * @param {boolean=} [stateConfig.reloadOnSearch=true]\n   * <a id='reloadOnSearch'></a>\n   *\n   * If `false`, will not retrigger the same state\n   *   just because a search/query parameter has changed (via $location.search() or $location.hash()). \n   *   Useful for when you'd like to modify $location.search() without triggering a reload.\n   * <pre>reloadOnSearch: false</pre>\n   *\n   * @param {object=} stateConfig.data\n   * <a id='data'></a>\n   *\n   * Arbitrary data object, useful for custom configuration.  The parent state's `data` is\n   *   prototypally inherited.  In other words, adding a data property to a state adds it to\n   *   the entire subtree via prototypal inheritance.\n   *\n   * <pre>data: {\n   *     requiredRole: 'foo'\n   * } </pre>\n   *\n   * @param {object=} stateConfig.params\n   * <a id='params'></a>\n   *\n   * A map which optionally configures parameters declared in the `url`, or\n   *   defines additional non-url parameters.  For each parameter being\n   *   configured, add a configuration object keyed to the name of the parameter.\n   *\n   *   Each parameter configuration object may contain the following properties:\n   *\n   *   - ** value ** - {object|function=}: specifies the default value for this\n   *     parameter.  This implicitly sets this parameter as optional.\n   *\n   *     When UI-Router routes to a state and no value is\n   *     specified for this parameter in the URL or transition, the\n   *     default value will be used instead.  If `value` is a function,\n   *     it will be injected and invoked, and the return value used.\n   *\n   *     *Note*: `undefined` is treated as \"no default value\" while `null`\n   *     is treated as \"the default value is `null`\".\n   *\n   *     *Shorthand*: If you only need to configure the default value of the\n   *     parameter, you may use a shorthand syntax.   In the **`params`**\n   *     map, instead mapping the param name to a full parameter configuration\n   *     object, simply set map it to the default parameter value, e.g.:\n   *\n   * <pre>// define a parameter's default value\n   * params: {\n   *     param1: { value: \"defaultValue\" }\n   * }\n   * // shorthand default values\n   * params: {\n   *     param1: \"defaultValue\",\n   *     param2: \"param2Default\"\n   * }</pre>\n   *\n   *   - ** array ** - {boolean=}: *(default: false)* If true, the param value will be\n   *     treated as an array of values.  If you specified a Type, the value will be\n   *     treated as an array of the specified Type.  Note: query parameter values\n   *     default to a special `\"auto\"` mode.\n   *\n   *     For query parameters in `\"auto\"` mode, if multiple  values for a single parameter\n   *     are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values\n   *     are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`).  However, if\n   *     only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single\n   *     value (e.g.: `{ foo: '1' }`).\n   *\n   * <pre>params: {\n   *     param1: { array: true }\n   * }</pre>\n   *\n   *   - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when\n   *     the current parameter value is the same as the default value. If `squash` is not set, it uses the\n   *     configured default squash policy.\n   *     (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})\n   *\n   *   There are three squash settings:\n   *\n   *     - false: The parameter's default value is not squashed.  It is encoded and included in the URL\n   *     - true: The parameter's default value is omitted from the URL.  If the parameter is preceeded and followed\n   *       by slashes in the state's `url` declaration, then one of those slashes are omitted.\n   *       This can allow for cleaner looking URLs.\n   *     - `\"<arbitrary string>\"`: The parameter's default value is replaced with an arbitrary placeholder of  your choice.\n   *\n   * <pre>params: {\n   *     param1: {\n   *       value: \"defaultId\",\n   *       squash: true\n   * } }\n   * // squash \"defaultValue\" to \"~\"\n   * params: {\n   *     param1: {\n   *       value: \"defaultValue\",\n   *       squash: \"~\"\n   * } }\n   * </pre>\n   *\n   *\n   * @example\n   * <pre>\n   * // Some state name examples\n   *\n   * // stateName can be a single top-level name (must be unique).\n   * $stateProvider.state(\"home\", {});\n   *\n   * // Or it can be a nested state name. This state is a child of the\n   * // above \"home\" state.\n   * $stateProvider.state(\"home.newest\", {});\n   *\n   * // Nest states as deeply as needed.\n   * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n   *\n   * // state() returns $stateProvider, so you can chain state declarations.\n   * $stateProvider\n   *   .state(\"home\", {})\n   *   .state(\"about\", {})\n   *   .state(\"contacts\", {});\n   * </pre>\n   *\n   */\n  this.state = state;\n  function state(name, definition) {\n    /*jshint validthis: true */\n    if (isObject(name)) definition = name;\n    else definition.name = name;\n    registerState(definition);\n    return this;\n  }\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$state\n   *\n   * @requires $rootScope\n   * @requires $q\n   * @requires ui.router.state.$view\n   * @requires $injector\n   * @requires ui.router.util.$resolve\n   * @requires ui.router.state.$stateParams\n   * @requires ui.router.router.$urlRouter\n   *\n   * @property {object} params A param object, e.g. {sectionId: section.id)}, that \n   * you'd like to test against the current active state.\n   * @property {object} current A reference to the state's config object. However \n   * you passed it in. Useful for accessing custom data.\n   * @property {object} transition Currently pending transition. A promise that'll \n   * resolve or reject.\n   *\n   * @description\n   * `$state` service is responsible for representing states as well as transitioning\n   * between them. It also provides interfaces to ask for current state or even states\n   * you're coming from.\n   */\n  this.$get = $get;\n  $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];\n  function $get(   $rootScope,   $q,   $view,   $injector,   $resolve,   $stateParams,   $urlRouter,   $location,   $urlMatcherFactory) {\n\n    var TransitionSuperseded = $q.reject(new Error('transition superseded'));\n    var TransitionPrevented = $q.reject(new Error('transition prevented'));\n    var TransitionAborted = $q.reject(new Error('transition aborted'));\n    var TransitionFailed = $q.reject(new Error('transition failed'));\n\n    // Handles the case where a state which is the target of a transition is not found, and the user\n    // can optionally retry or defer the transition\n    function handleRedirect(redirect, state, params, options) {\n      /**\n       * @ngdoc event\n       * @name ui.router.state.$state#$stateNotFound\n       * @eventOf ui.router.state.$state\n       * @eventType broadcast on root scope\n       * @description\n       * Fired when a requested state **cannot be found** using the provided state name during transition.\n       * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n       * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n       * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n       * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n       *\n       * @param {Object} event Event object.\n       * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n       * @param {State} fromState Current state object.\n       * @param {Object} fromParams Current state params.\n       *\n       * @example\n       *\n       * <pre>\n       * // somewhere, assume lazy.state has not been defined\n       * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n       *\n       * // somewhere else\n       * $scope.$on('$stateNotFound',\n       * function(event, unfoundState, fromState, fromParams){\n       *     console.log(unfoundState.to); // \"lazy.state\"\n       *     console.log(unfoundState.toParams); // {a:1, b:2}\n       *     console.log(unfoundState.options); // {inherit:false} + default options\n       * })\n       * </pre>\n       */\n      var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n      if (evt.defaultPrevented) {\n        $urlRouter.update();\n        return TransitionAborted;\n      }\n\n      if (!evt.retry) {\n        return null;\n      }\n\n      // Allow the handler to return a promise to defer state lookup retry\n      if (options.$retry) {\n        $urlRouter.update();\n        return TransitionFailed;\n      }\n      var retryTransition = $state.transition = $q.when(evt.retry);\n\n      retryTransition.then(function() {\n        if (retryTransition !== $state.transition) return TransitionSuperseded;\n        redirect.options.$retry = true;\n        return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n      }, function() {\n        return TransitionAborted;\n      });\n      $urlRouter.update();\n\n      return retryTransition;\n    }\n\n    root.locals = { resolve: null, globals: { $stateParams: {} } };\n\n    $state = {\n      params: {},\n      current: root.self,\n      $current: root,\n      transition: null\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#reload\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired, \n     * and controllers reinstantiated (bug with controllers reinstantiating right now, fixing soon).\n     *\n     * @example\n     * <pre>\n     * var app angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.reload = function(){\n     *     $state.reload();\n     *   }\n     * });\n     * </pre>\n     *\n     * `reload()` is just an alias for:\n     * <pre>\n     * $state.transitionTo($state.current, $stateParams, { \n     *   reload: true, inherit: false, notify: true\n     * });\n     * </pre>\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.reload = function reload() {\n      return $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#go\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Convenience method for transitioning to a new state. `$state.go` calls \n     * `$state.transitionTo` internally but automatically sets options to \n     * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. \n     * This allows you to easily use an absolute or relative to path and specify \n     * only the parameters you'd like to update (while letting unspecified parameters \n     * inherit from the currently active ancestor states).\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.go('contact.detail');\n     *   };\n     * });\n     * </pre>\n     * <img src='../ngdoc_assets/StateGoExamples.png'/>\n     *\n     * @param {string} to Absolute state name or relative state path. Some examples:\n     *\n     * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n     * - `$state.go('^')` - will go to a parent state\n     * - `$state.go('^.sibling')` - will go to a sibling state\n     * - `$state.go('.child.grandchild')` - will go to grandchild state\n     *\n     * @param {object=} params A map of the parameters that will be sent to the state, \n     * will populate $stateParams. Any parameters that are not specified will be inherited from currently \n     * defined parameters. This allows, for example, going to a sibling state that shares parameters\n     * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.\n     * transitioning to a sibling will get you the parameters for all parents, transitioning to a child\n     * will get you all current parameters, etc.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition.\n     *\n     * Possible success values:\n     *\n     * - $state.current\n     *\n     * <br/>Possible rejection values:\n     *\n     * - 'transition superseded' - when a newer transition has been started after this one\n     * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener\n     * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or\n     *   when a `$stateNotFound` `event.retry` promise errors.\n     * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.\n     * - *resolve error* - when an error has occurred with a `resolve`\n     *\n     */\n    $state.go = function go(to, params, options) {\n      return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#transitionTo\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}\n     * uses `transitionTo` internally. `$state.go` is recommended in most situations.\n     *\n     * @example\n     * <pre>\n     * var app = angular.module('app', ['ui.router']);\n     *\n     * app.controller('ctrl', function ($scope, $state) {\n     *   $scope.changeState = function () {\n     *     $state.transitionTo('contact.detail');\n     *   };\n     * });\n     * </pre>\n     *\n     * @param {string} to State name.\n     * @param {object=} toParams A map of the parameters that will be sent to the state,\n     * will populate $stateParams.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n     *    will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n     * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params \n     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n     *    use this when you want to force a reload when *everything* is the same, including search params.\n     *\n     * @returns {promise} A promise representing the state of the new transition. See\n     * {@link ui.router.state.$state#methods_go $state.go}.\n     */\n    $state.transitionTo = function transitionTo(to, toParams, options) {\n      toParams = toParams || {};\n      options = extend({\n        location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false\n      }, options || {});\n\n      var from = $state.$current, fromParams = $state.params, fromPath = from.path;\n      var evt, toState = findState(to, options.relative);\n\n      if (!isDefined(toState)) {\n        var redirect = { to: to, toParams: toParams, options: options };\n        var redirectResult = handleRedirect(redirect, from.self, fromParams, options);\n\n        if (redirectResult) {\n          return redirectResult;\n        }\n\n        // Always retry once if the $stateNotFound was not prevented\n        // (handles either redirect changed or state lazy-definition)\n        to = redirect.to;\n        toParams = redirect.toParams;\n        options = redirect.options;\n        toState = findState(to, options.relative);\n\n        if (!isDefined(toState)) {\n          if (!options.relative) throw new Error(\"No such state '\" + to + \"'\");\n          throw new Error(\"Could not resolve '\" + to + \"' from state '\" + options.relative + \"'\");\n        }\n      }\n      if (toState[abstractKey]) throw new Error(\"Cannot transition to abstract state '\" + to + \"'\");\n      if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);\n      if (!toState.params.$$validates(toParams)) return TransitionFailed;\n\n      toParams = toState.params.$$values(toParams);\n      to = toState;\n\n      var toPath = to.path;\n\n      // Starting from the root of the path, keep all levels that haven't changed\n      var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];\n\n      if (!options.reload) {\n        while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {\n          locals = toLocals[keep] = state.locals;\n          keep++;\n          state = toPath[keep];\n        }\n      }\n\n      // If we're going to the same state and all locals are kept, we've got nothing to do.\n      // But clear 'transition', as we still want to cancel any other pending transitions.\n      // TODO: We may not want to bump 'transition' if we're called from a location change\n      // that we've initiated ourselves, because we might accidentally abort a legitimate\n      // transition initiated from code?\n      if (shouldTriggerReload(to, from, locals, options)) {\n        if (to.self.reloadOnSearch !== false) $urlRouter.update();\n        $state.transition = null;\n        return $q.when($state.current);\n      }\n\n      // Filter parameters before we pass them to event handlers etc.\n      toParams = filterByKeys(to.params.$$keys(), toParams || {});\n\n      // Broadcast start event and cancel the transition if requested\n      if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeStart\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when the state transition **begins**. You can use `event.preventDefault()`\n         * to prevent the transition from happening and then the transition promise will be\n         * rejected with a `'transition prevented'` value.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         *\n         * @example\n         *\n         * <pre>\n         * $rootScope.$on('$stateChangeStart',\n         * function(event, toState, toParams, fromState, fromParams){\n         *     event.preventDefault();\n         *     // transitionTo() promise will be rejected with\n         *     // a 'transition prevented' error\n         * })\n         * </pre>\n         */\n        if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {\n          $urlRouter.update();\n          return TransitionPrevented;\n        }\n      }\n\n      // Resolve locals for the remaining states, but don't update any global state just\n      // yet -- if anything fails to resolve the current state needs to remain untouched.\n      // We also set up an inheritance chain for the locals here. This allows the view directive\n      // to quickly look up the correct definition for each view in the current state. Even\n      // though we create the locals object itself outside resolveState(), it is initially\n      // empty and gets filled asynchronously. We need to keep track of the promise for the\n      // (fully resolved) current locals, and pass this down the chain.\n      var resolved = $q.when(locals);\n\n      for (var l = keep; l < toPath.length; l++, state = toPath[l]) {\n        locals = toLocals[l] = inherit(locals);\n        resolved = resolveState(state, toParams, state === to, resolved, locals, options);\n      }\n\n      // Once everything is resolved, we are ready to perform the actual transition\n      // and return a promise for the new state. We also keep track of what the\n      // current promise is, so that we can detect overlapping transitions and\n      // keep only the outcome of the last transition.\n      var transition = $state.transition = resolved.then(function () {\n        var l, entering, exiting;\n\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Exit 'from' states not kept\n        for (l = fromPath.length - 1; l >= keep; l--) {\n          exiting = fromPath[l];\n          if (exiting.self.onExit) {\n            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);\n          }\n          exiting.locals = null;\n        }\n\n        // Enter 'to' states not kept\n        for (l = keep; l < toPath.length; l++) {\n          entering = toPath[l];\n          entering.locals = toLocals[l];\n          if (entering.self.onEnter) {\n            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);\n          }\n        }\n\n        // Run it again, to catch any transitions in callbacks\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        // Update globals in $state\n        $state.$current = to;\n        $state.current = to.self;\n        $state.params = toParams;\n        copy($state.params, $stateParams);\n        $state.transition = null;\n\n        if (options.location && to.navigable) {\n          $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {\n            $$avoidResync: true, replace: options.location === 'replace'\n          });\n        }\n\n        if (options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeSuccess\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired once the state transition is **complete**.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         */\n          $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);\n        }\n        $urlRouter.update(true);\n\n        return $state.current;\n      }, function (error) {\n        if ($state.transition !== transition) return TransitionSuperseded;\n\n        $state.transition = null;\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$stateChangeError\n         * @eventOf ui.router.state.$state\n         * @eventType broadcast on root scope\n         * @description\n         * Fired when an **error occurs** during transition. It's important to note that if you\n         * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n         * they will not throw traditionally. You must listen for this $stateChangeError event to\n         * catch **ALL** errors.\n         *\n         * @param {Object} event Event object.\n         * @param {State} toState The state being transitioned to.\n         * @param {Object} toParams The params supplied to the `toState`.\n         * @param {State} fromState The current state, pre-transition.\n         * @param {Object} fromParams The params supplied to the `fromState`.\n         * @param {Error} error The resolve error object.\n         */\n        evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);\n\n        if (!evt.defaultPrevented) {\n            $urlRouter.update();\n        }\n\n        return $q.reject(error);\n      });\n\n      return transition;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#is\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Similar to {@link ui.router.state.$state#methods_includes $state.includes},\n     * but only checks for the full state name. If params is supplied then it will be\n     * tested for strict equality against the current active params object, so all params\n     * must match with none missing and no extras.\n     *\n     * @example\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // absolute name\n     * $state.is('contact.details.item'); // returns true\n     * $state.is(contactDetailItemStateObject); // returns true\n     *\n     * // relative name (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like\n     * to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object} -  If `stateOrName` is a relative state name and `options.relative` is set, .is will\n     * test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it is the state.\n     */\n    $state.is = function is(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) { return undefined; }\n      if ($state.$current !== state) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#includes\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A method to determine if the current active state is equal to or is the child of the\n     * state stateName. If any params are passed then they will be tested for a match as well.\n     * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n     *\n     * @example\n     * Partial and relative names\n     * <pre>\n     * $state.$current.name = 'contacts.details.item';\n     *\n     * // Using partial names\n     * $state.includes(\"contacts\"); // returns true\n     * $state.includes(\"contacts.details\"); // returns true\n     * $state.includes(\"contacts.details.item\"); // returns true\n     * $state.includes(\"contacts.list\"); // returns false\n     * $state.includes(\"about\"); // returns false\n     *\n     * // Using relative names (. and ^), typically from a template\n     * // E.g. from the 'contacts.details' template\n     * <div ng-class=\"{highlighted: $state.includes('.item')}\">Item</div>\n     * </pre>\n     *\n     * Basic globbing patterns\n     * <pre>\n     * $state.$current.name = 'contacts.details.item.url';\n     *\n     * $state.includes(\"*.details.*.*\"); // returns true\n     * $state.includes(\"*.details.**\"); // returns true\n     * $state.includes(\"**.item.**\"); // returns true\n     * $state.includes(\"*.details.item.url\"); // returns true\n     * $state.includes(\"*.details.*.url\"); // returns true\n     * $state.includes(\"*.details.*\"); // returns false\n     * $state.includes(\"item.**\"); // returns false\n     * </pre>\n     *\n     * @param {string} stateOrName A partial name, relative name, or glob pattern\n     * to be searched for within the current state name.\n     * @param {object=} params A param object, e.g. `{sectionId: section.id}`,\n     * that you'd like to test against the current active state.\n     * @param {object=} options An options object.  The options are:\n     *\n     * - **`relative`** - {string|object=} -  If `stateOrName` is a relative state reference and `options.relative` is set,\n     * .includes will test relative to `options.relative` state (or name).\n     *\n     * @returns {boolean} Returns true if it does include the state\n     */\n    $state.includes = function includes(stateOrName, params, options) {\n      options = extend({ relative: $state.$current }, options || {});\n      if (isString(stateOrName) && isGlob(stateOrName)) {\n        if (!doesStateMatchGlob(stateOrName)) {\n          return false;\n        }\n        stateOrName = $state.$current.name;\n      }\n\n      var state = findState(stateOrName, options.relative);\n      if (!isDefined(state)) { return undefined; }\n      if (!isDefined($state.$current.includes[state.name])) { return false; }\n      return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;\n    };\n\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#href\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * A url generation method that returns the compiled url for the given state populated with the given params.\n     *\n     * @example\n     * <pre>\n     * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n     * </pre>\n     *\n     * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.\n     * @param {object=} params An object of parameter values to fill the state's required parameters.\n     * @param {object=} options Options object. The options are:\n     *\n     * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the\n     *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka\n     *    ancestor with a valid url).\n     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n     *    defines which state to be relative from.\n     * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n     * \n     * @returns {string} compiled state url\n     */\n    $state.href = function href(stateOrName, params, options) {\n      options = extend({\n        lossy:    true,\n        inherit:  true,\n        absolute: false,\n        relative: $state.$current\n      }, options || {});\n\n      var state = findState(stateOrName, options.relative);\n\n      if (!isDefined(state)) return null;\n      if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);\n      \n      var nav = (state && options.lossy) ? state.navigable : state;\n\n      if (!nav || nav.url === undefined || nav.url === null) {\n        return null;\n      }\n      return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys(), params || {}), {\n        absolute: options.absolute\n      });\n    };\n\n    /**\n     * @ngdoc function\n     * @name ui.router.state.$state#get\n     * @methodOf ui.router.state.$state\n     *\n     * @description\n     * Returns the state configuration object for any specific state or all states.\n     *\n     * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for\n     * the requested state. If not provided, returns an array of ALL state configs.\n     * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.\n     * @returns {Object|Array} State configuration object or array of all objects.\n     */\n    $state.get = function (stateOrName, context) {\n      if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });\n      var state = findState(stateOrName, context || $state.$current);\n      return (state && state.self) ? state.self : null;\n    };\n\n    function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {\n      // Make a restricted $stateParams with only the parameters that apply to this state if\n      // necessary. In addition to being available to the controller and onEnter/onExit callbacks,\n      // we also need $stateParams to be available for any $injector calls we make during the\n      // dependency resolution process.\n      var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);\n      var locals = { $stateParams: $stateParams };\n\n      // Resolve 'global' dependencies for the state, i.e. those not specific to a view.\n      // We're also including $stateParams in this; that way the parameters are restricted\n      // to the set that should be visible to the state, and are independent of when we update\n      // the global $state and $stateParams values.\n      dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);\n      var promises = [dst.resolve.then(function (globals) {\n        dst.globals = globals;\n      })];\n      if (inherited) promises.push(inherited);\n\n      // Resolve template and dependencies for all views.\n      forEach(state.views, function (view, name) {\n        var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});\n        injectables.$template = [ function () {\n          return $view.load(name, { view: view, locals: locals, params: $stateParams, notify: options.notify }) || '';\n        }];\n\n        promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {\n          // References to the controller (only instantiated at link time)\n          if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {\n            var injectLocals = angular.extend({}, injectables, locals);\n            result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);\n          } else {\n            result.$$controller = view.controller;\n          }\n          // Provide access to the state itself for internal use\n          result.$$state = state;\n          result.$$controllerAs = view.controllerAs;\n          dst[name] = result;\n        }));\n      });\n\n      // Wait for all the promises and then return the activation object\n      return $q.all(promises).then(function (values) {\n        return dst;\n      });\n    }\n\n    return $state;\n  }\n\n  function shouldTriggerReload(to, from, locals, options) {\n    if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {\n      return true;\n    }\n  }\n}\n\nangular.module('ui.router.state')\n  .value('$stateParams', {})\n  .provider('$state', $StateProvider);\n\n\n$ViewProvider.$inject = [];\nfunction $ViewProvider() {\n\n  this.$get = $get;\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$view\n   *\n   * @requires ui.router.util.$templateFactory\n   * @requires $rootScope\n   *\n   * @description\n   *\n   */\n  $get.$inject = ['$rootScope', '$templateFactory'];\n  function $get(   $rootScope,   $templateFactory) {\n    return {\n      // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })\n      /**\n       * @ngdoc function\n       * @name ui.router.state.$view#load\n       * @methodOf ui.router.state.$view\n       *\n       * @description\n       *\n       * @param {string} name name\n       * @param {object} options option object.\n       */\n      load: function load(name, options) {\n        var result, defaults = {\n          template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}\n        };\n        options = extend(defaults, options);\n\n        if (options.view) {\n          result = $templateFactory.fromConfig(options.view, options.params, options.locals);\n        }\n        if (result && options.notify) {\n        /**\n         * @ngdoc event\n         * @name ui.router.state.$state#$viewContentLoading\n         * @eventOf ui.router.state.$view\n         * @eventType broadcast on root scope\n         * @description\n         *\n         * Fired once the view **begins loading**, *before* the DOM is rendered.\n         *\n         * @param {Object} event Event object.\n         * @param {Object} viewConfig The view config properties (template, controller, etc).\n         *\n         * @example\n         *\n         * <pre>\n         * $scope.$on('$viewContentLoading',\n         * function(event, viewConfig){\n         *     // Access to all the view config properties.\n         *     // and one special property 'targetView'\n         *     // viewConfig.targetView\n         * });\n         * </pre>\n         */\n          $rootScope.$broadcast('$viewContentLoading', options);\n        }\n        return result;\n      }\n    };\n  }\n}\n\nangular.module('ui.router.state').provider('$view', $ViewProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.\n */\nfunction $ViewScrollProvider() {\n\n  var useAnchorScroll = false;\n\n  /**\n   * @ngdoc function\n   * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll\n   * @methodOf ui.router.state.$uiViewScrollProvider\n   *\n   * @description\n   * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for\n   * scrolling based on the url anchor.\n   */\n  this.useAnchorScroll = function () {\n    useAnchorScroll = true;\n  };\n\n  /**\n   * @ngdoc object\n   * @name ui.router.state.$uiViewScroll\n   *\n   * @requires $anchorScroll\n   * @requires $timeout\n   *\n   * @description\n   * When called with a jqLite element, it scrolls the element into view (after a\n   * `$timeout` so the DOM has time to refresh).\n   *\n   * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n   * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.\n   */\n  this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n    if (useAnchorScroll) {\n      return $anchorScroll;\n    }\n\n    return function ($element) {\n      $timeout(function () {\n        $element[0].scrollIntoView();\n      }, 0, false);\n    };\n  }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-view\n *\n * @requires ui.router.state.$state\n * @requires $compile\n * @requires $controller\n * @requires $injector\n * @requires ui.router.state.$uiViewScroll\n * @requires $document\n *\n * @restrict ECA\n *\n * @description\n * The ui-view directive tells $state where to place your templates.\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states.\n *\n * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window\n * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll\n * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you\n * scroll ui-view elements into view when they are populated during a state activation.\n *\n * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*\n *\n * @param {string=} onload Expression to evaluate whenever the view updates.\n * \n * @example\n * A view can be unnamed or named. \n * <pre>\n * <!-- Unnamed -->\n * <div ui-view></div> \n * \n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n * </pre>\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a \n * single view and it is unnamed then you can populate it like so:\n * <pre>\n * <div ui-view></div> \n * $stateProvider.state(\"home\", {\n *   template: \"<h1>HELLO!</h1>\"\n * })\n * </pre>\n * \n * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}\n * config property, by name, in this case an empty name:\n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * But typically you'll only use the views property if you name your view or have more than one view \n * in the same template. There's not really a compelling reason to name a view if its the only one, \n * but you could if you wanted, like so:\n * <pre>\n * <div ui-view=\"main\"></div>\n * </pre> \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"main\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     }\n *   }    \n * })\n * </pre>\n * \n * Really though, you'll use views to set up multiple views:\n * <pre>\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div> \n * <div ui-view=\"data\"></div> \n * </pre>\n * \n * <pre>\n * $stateProvider.state(\"home\", {\n *   views: {\n *     \"\": {\n *       template: \"<h1>HELLO!</h1>\"\n *     },\n *     \"chart\": {\n *       template: \"<chart_thing/>\"\n *     },\n *     \"data\": {\n *       template: \"<data_thing/>\"\n *     }\n *   }    \n * })\n * </pre>\n *\n * Examples for `autoscroll`:\n *\n * <pre>\n * <!-- If autoscroll present with no expression,\n *      then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n *      then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * </pre>\n */\n$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];\nfunction $ViewDirective(   $state,   $injector,   $uiViewScroll,   $interpolate) {\n\n  function getService() {\n    return ($injector.has) ? function(service) {\n      return $injector.has(service) ? $injector.get(service) : null;\n    } : function(service) {\n      try {\n        return $injector.get(service);\n      } catch (e) {\n        return null;\n      }\n    };\n  }\n\n  var service = getService(),\n      $animator = service('$animator'),\n      $animate = service('$animate');\n\n  // Returns a set of DOM manipulation functions based on which Angular version\n  // it should use\n  function getRenderer(attrs, scope) {\n    var statics = function() {\n      return {\n        enter: function (element, target, cb) { target.after(element); cb(); },\n        leave: function (element, cb) { element.remove(); cb(); }\n      };\n    };\n\n    if ($animate) {\n      return {\n        enter: function(element, target, cb) {\n          var promise = $animate.enter(element, null, target, cb);\n          if (promise && promise.then) promise.then(cb);\n        },\n        leave: function(element, cb) {\n          var promise = $animate.leave(element, cb);\n          if (promise && promise.then) promise.then(cb);\n        }\n      };\n    }\n\n    if ($animator) {\n      var animate = $animator && $animator(scope, attrs);\n\n      return {\n        enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n        leave: function(element, cb) { animate.leave(element); cb(); }\n      };\n    }\n\n    return statics();\n  }\n\n  var directive = {\n    restrict: 'ECA',\n    terminal: true,\n    priority: 400,\n    transclude: 'element',\n    compile: function (tElement, tAttrs, $transclude) {\n      return function (scope, $element, attrs) {\n        var previousEl, currentEl, currentScope, latestLocals,\n            onloadExp     = attrs.onload || '',\n            autoScrollExp = attrs.autoscroll,\n            renderer      = getRenderer(attrs, scope);\n\n        scope.$on('$stateChangeSuccess', function() {\n          updateView(false);\n        });\n        scope.$on('$viewContentLoading', function() {\n          updateView(false);\n        });\n\n        updateView(true);\n\n        function cleanupLastView() {\n          if (previousEl) {\n            previousEl.remove();\n            previousEl = null;\n          }\n\n          if (currentScope) {\n            currentScope.$destroy();\n            currentScope = null;\n          }\n\n          if (currentEl) {\n            renderer.leave(currentEl, function() {\n              previousEl = null;\n            });\n\n            previousEl = currentEl;\n            currentEl = null;\n          }\n        }\n\n        function updateView(firstTime) {\n          var newScope,\n              name            = getUiViewName(scope, attrs, $element, $interpolate),\n              previousLocals  = name && $state.$current && $state.$current.locals[name];\n\n          if (!firstTime && previousLocals === latestLocals) return; // nothing to do\n          newScope = scope.$new();\n          latestLocals = $state.$current.locals[name];\n\n          var clone = $transclude(newScope, function(clone) {\n            renderer.enter(clone, $element, function onUiViewEnter() {\n              if(currentScope) {\n                currentScope.$emit('$viewContentAnimationEnded');\n              }\n\n              if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n                $uiViewScroll(clone);\n              }\n            });\n            cleanupLastView();\n          });\n\n          currentEl = clone;\n          currentScope = newScope;\n          /**\n           * @ngdoc event\n           * @name ui.router.state.directive:ui-view#$viewContentLoaded\n           * @eventOf ui.router.state.directive:ui-view\n           * @eventType emits on ui-view directive scope\n           * @description           *\n           * Fired once the view is **loaded**, *after* the DOM is rendered.\n           *\n           * @param {Object} event Event object.\n           */\n          currentScope.$emit('$viewContentLoaded');\n          currentScope.$eval(onloadExp);\n        }\n      };\n    }\n  };\n\n  return directive;\n}\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\nfunction $ViewDirectiveFill (  $compile,   $controller,   $state,   $interpolate) {\n  return {\n    restrict: 'ECA',\n    priority: -400,\n    compile: function (tElement) {\n      var initial = tElement.html();\n      return function (scope, $element, attrs) {\n        var current = $state.$current,\n            name = getUiViewName(scope, attrs, $element, $interpolate),\n            locals  = current && current.locals[name];\n\n        if (! locals) {\n          return;\n        }\n\n        $element.data('$uiView', { name: name, state: locals.$$state });\n        $element.html(locals.$template ? locals.$template : initial);\n\n        var link = $compile($element.contents());\n\n        if (locals.$$controller) {\n          locals.$scope = scope;\n          var controller = $controller(locals.$$controller, locals);\n          if (locals.$$controllerAs) {\n            scope[locals.$$controllerAs] = controller;\n          }\n          $element.data('$ngControllerController', controller);\n          $element.children().data('$ngControllerController', controller);\n        }\n\n        link(scope);\n      };\n    }\n  };\n}\n\n/**\n * Shared ui-view code for both directives:\n * Given scope, element, and its attributes, return the view's name\n */\nfunction getUiViewName(scope, attrs, element, $interpolate) {\n  var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n  var inherited = element.inheritedData('$uiView');\n  return name.indexOf('@') >= 0 ?  name :  (name + '@' + (inherited ? inherited.state.name : ''));\n}\n\nangular.module('ui.router.state').directive('uiView', $ViewDirective);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\nfunction parseStateRef(ref, current) {\n  var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n  if (preparsed) ref = current + '(' + preparsed[1] + ')';\n  parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n  if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n  return { state: parsed[1], paramExpr: parsed[3] || null };\n}\n\nfunction stateContext(el) {\n  var stateData = el.parent().inheritedData('$uiView');\n\n  if (stateData && stateData.state && stateData.state.name) {\n    return stateData.state;\n  }\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref\n *\n * @requires ui.router.state.$state\n * @requires $timeout\n *\n * @restrict A\n *\n * @description\n * A directive that binds a link (`<a>` tag) to a state. If the state has an associated \n * URL, the directive will automatically generate & update the `href` attribute via \n * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking \n * the link will trigger a state transition with optional parameters. \n *\n * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be \n * handled natively by the browser.\n *\n * You can also use relative state paths within ui-sref, just like the relative \n * paths passed to `$state.go()`. You just need to be aware that the path is relative\n * to the state that the link lives in, in other words the state that loaded the \n * template containing the link.\n *\n * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}\n * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n * and `reload`.\n *\n * @example\n * Here's an example of how you'd use ui-sref and how it would compile. If you have the \n * following template:\n * <pre>\n * <a ui-sref=\"home\">Home</a> | <a ui-sref=\"about\">About</a> | <a ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n *     </li>\n * </ul>\n * </pre>\n * \n * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n * <pre>\n * <a href=\"#/home\" ui-sref=\"home\">Home</a> | <a href=\"#/about\" ui-sref=\"about\">About</a> | <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n * \n * <ul>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n *     </li>\n *     <li ng-repeat=\"contact in contacts\">\n *         <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n *     </li>\n * </ul>\n *\n * <a ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * </pre>\n *\n * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDirective($state, $timeout) {\n  var allowedOptions = ['location', 'inherit', 'reload'];\n\n  return {\n    restrict: 'A',\n    require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n    link: function(scope, element, attrs, uiSrefActive) {\n      var ref = parseStateRef(attrs.uiSref, $state.current.name);\n      var params = null, url = null, base = stateContext(element) || $state.$current;\n      var newHref = null, isAnchor = element.prop(\"tagName\") === \"A\";\n      var isForm = element[0].nodeName === \"FORM\";\n      var attr = isForm ? \"action\" : \"href\", nav = true;\n\n      var options = { relative: base, inherit: true };\n      var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};\n\n      angular.forEach(allowedOptions, function(option) {\n        if (option in optionsOverride) {\n          options[option] = optionsOverride[option];\n        }\n      });\n\n      var update = function(newVal) {\n        if (newVal) params = angular.copy(newVal);\n        if (!nav) return;\n\n        newHref = $state.href(ref.state, params, options);\n\n        var activeDirective = uiSrefActive[1] || uiSrefActive[0];\n        if (activeDirective) {\n          activeDirective.$$setStateInfo(ref.state, params);\n        }\n        if (newHref === null) {\n          nav = false;\n          return false;\n        }\n        attrs.$set(attr, newHref);\n      };\n\n      if (ref.paramExpr) {\n        scope.$watch(ref.paramExpr, function(newVal, oldVal) {\n          if (newVal !== params) update(newVal);\n        }, true);\n        params = angular.copy(scope.$eval(ref.paramExpr));\n      }\n      update();\n\n      if (isForm) return;\n\n      element.bind(\"click\", function(e) {\n        var button = e.which || e.button;\n        if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {\n          // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n          var transition = $timeout(function() {\n            $state.go(ref.state, params, options);\n          });\n          e.preventDefault();\n\n          // if the state has no URL, ignore one preventDefault from the <a> directive.\n          var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;\n          e.preventDefault = function() {\n            if (ignorePreventDefaultCount-- <= 0)\n              $timeout.cancel(transition);\n          };\n        }\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * A directive working alongside ui-sref to add classes to an element when the\n * related ui-sref directive's state is active, and removing them when it is inactive.\n * The primary use-case is to simplify the special appearance of navigation menus\n * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n * distinguishing it from the inactive menu items.\n *\n * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n * ui-sref-active found at the same level or above the ui-sref will be used.\n *\n * Will activate when the ui-sref's target state or any child state is active. If you\n * need to activate only when the ui-sref target state is active and *not* any of\n * it's children, then you will use\n * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n *\n * @example\n * Given the following template:\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item\">\n *     <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n *\n * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n * <pre>\n * <ul>\n *   <li ui-sref-active=\"active\" class=\"item active\">\n *     <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n *   </li>\n * </ul>\n * </pre>\n *\n * The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * Multiple classes may be specified in a space-separated format:\n * <pre>\n * <ul>\n *   <li ui-sref-active='class1 class2 class3'>\n *     <a ui-sref=\"app.user\">link</a>\n *   </li>\n * </ul>\n * </pre>\n */\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active-eq\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n * when the exact target state used in the `ui-sref` is active; no child states.\n *\n */\n$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\nfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n  return  {\n    restrict: \"A\",\n    controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\n      var state, params, activeClass;\n\n      // There probably isn't much point in $observing this\n      // uiSrefActive and uiSrefActiveEq share the same directive object with some\n      // slight difference in logic routing\n      activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);\n\n      // Allow uiSref to communicate with uiSrefActive[Equals]\n      this.$$setStateInfo = function (newState, newParams) {\n        state = $state.get(newState, stateContext($element));\n        params = newParams;\n        update();\n      };\n\n      $scope.$on('$stateChangeSuccess', update);\n\n      // Update route state\n      function update() {\n        if (isMatch()) {\n          $element.addClass(activeClass);\n        } else {\n          $element.removeClass(activeClass);\n        }\n      }\n\n      function isMatch() {\n        if (typeof $attrs.uiSrefActiveEq !== 'undefined') {\n          return state && $state.is(state.name, params);\n        } else {\n          return state && $state.includes(state.name, params);\n        }\n      }\n    }]\n  };\n}\n\nangular.module('ui.router.state')\n  .directive('uiSref', $StateRefDirective)\n  .directive('uiSrefActive', $StateRefActiveDirective)\n  .directive('uiSrefActiveEq', $StateRefActiveDirective);\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:isState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n  var isFilter = function (state) {\n    return $state.is(state);\n  };\n  isFilter.$stateful = true;\n  return isFilter;\n}\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:includedByState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n  var includesFilter = function (state) {\n    return $state.includes(state);\n  };\n  includesFilter.$stateful = true;\n  return  includesFilter;\n}\n\nangular.module('ui.router.state')\n  .filter('isState', $IsStateFilter)\n  .filter('includedByState', $IncludedByStateFilter);\n})(window, window.angular);\n/*!\n * ionic.bundle.js is a concatenation of:\n * ionic.js, angular.js, angular-animate.js,\n * angular-sanitize.js, angular-ui-router.js,\n * and ionic-angular.js\n */\n\n/*!\n * Copyright 2014 Drifty Co.\n * http://drifty.com/\n *\n * Ionic, v1.0.0\n * A powerful HTML5 mobile app framework.\n * http://ionicframework.com/\n *\n * By @maxlynch, @benjsperry, @adamdbradley <3\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n\n(function() {\n/* eslint no-unused-vars:0 */\nvar IonicModule = angular.module('ionic', ['ngAnimate', 'ngSanitize', 'ui.router']),\n  extend = angular.extend,\n  forEach = angular.forEach,\n  isDefined = angular.isDefined,\n  isNumber = angular.isNumber,\n  isString = angular.isString,\n  jqLite = angular.element,\n  noop = angular.noop;\n\n/**\n * @ngdoc service\n * @name $ionicActionSheet\n * @module ionic\n * @description\n * The Action Sheet is a slide-up pane that lets the user choose from a set of options.\n * Dangerous options are highlighted in red and made obvious.\n *\n * There are easy ways to cancel out of the action sheet, such as tapping the backdrop or even\n * hitting escape on the keyboard for desktop testing.\n *\n * ![Action Sheet](http://ionicframework.com.s3.amazonaws.com/docs/controllers/actionSheet.gif)\n *\n * @usage\n * To trigger an Action Sheet in your code, use the $ionicActionSheet service in your angular controllers:\n *\n * ```js\n * angular.module('mySuperApp', ['ionic'])\n * .controller(function($scope, $ionicActionSheet, $timeout) {\n *\n *  // Triggered on a button click, or some other target\n *  $scope.show = function() {\n *\n *    // Show the action sheet\n *    var hideSheet = $ionicActionSheet.show({\n *      buttons: [\n *        { text: '<b>Share</b> This' },\n *        { text: 'Move' }\n *      ],\n *      destructiveText: 'Delete',\n *      titleText: 'Modify your album',\n *      cancelText: 'Cancel',\n *      cancel: function() {\n          // add cancel code..\n        },\n *      buttonClicked: function(index) {\n *        return true;\n *      }\n *    });\n *\n *    // For example's sake, hide the sheet after two seconds\n *    $timeout(function() {\n *      hideSheet();\n *    }, 2000);\n *\n *  };\n * });\n * ```\n *\n */\nIonicModule\n.factory('$ionicActionSheet', [\n  '$rootScope',\n  '$compile',\n  '$animate',\n  '$timeout',\n  '$ionicTemplateLoader',\n  '$ionicPlatform',\n  '$ionicBody',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicPlatform, $ionicBody, IONIC_BACK_PRIORITY) {\n\n  return {\n    show: actionSheet\n  };\n\n  /**\n   * @ngdoc method\n   * @name $ionicActionSheet#show\n   * @description\n   * Load and return a new action sheet.\n   *\n   * A new isolated scope will be created for the\n   * action sheet and the new element will be appended into the body.\n   *\n   * @param {object} options The options for this ActionSheet. Properties:\n   *\n   *  - `[Object]` `buttons` Which buttons to show.  Each button is an object with a `text` field.\n   *  - `{string}` `titleText` The title to show on the action sheet.\n   *  - `{string=}` `cancelText` the text for a 'cancel' button on the action sheet.\n   *  - `{string=}` `destructiveText` The text for a 'danger' on the action sheet.\n   *  - `{function=}` `cancel` Called if the cancel button is pressed, the backdrop is tapped or\n   *     the hardware back button is pressed.\n   *  - `{function=}` `buttonClicked` Called when one of the non-destructive buttons is clicked,\n   *     with the index of the button that was clicked and the button object. Return true to close\n   *     the action sheet, or false to keep it opened.\n   *  - `{function=}` `destructiveButtonClicked` Called when the destructive button is clicked.\n   *     Return true to close the action sheet, or false to keep it opened.\n   *  -  `{boolean=}` `cancelOnStateChange` Whether to cancel the actionSheet when navigating\n   *     to a new state.  Default true.\n   *  - `{string}` `cssClass` The custom CSS class name.\n   *\n   * @returns {function} `hideSheet` A function which, when called, hides & cancels the action sheet.\n   */\n  function actionSheet(opts) {\n    var scope = $rootScope.$new(true);\n\n    extend(scope, {\n      cancel: noop,\n      destructiveButtonClicked: noop,\n      buttonClicked: noop,\n      $deregisterBackButton: noop,\n      buttons: [],\n      cancelOnStateChange: true\n    }, opts || {});\n\n    function textForIcon(text) {\n      if (text && /icon/.test(text)) {\n        scope.$actionSheetHasIcon = true;\n      }\n    }\n\n    for (var x = 0; x < scope.buttons.length; x++) {\n      textForIcon(scope.buttons[x].text);\n    }\n    textForIcon(scope.cancelText);\n    textForIcon(scope.destructiveText);\n\n    // Compile the template\n    var element = scope.element = $compile('<ion-action-sheet ng-class=\"cssClass\" buttons=\"buttons\"></ion-action-sheet>')(scope);\n\n    // Grab the sheet element for animation\n    var sheetEl = jqLite(element[0].querySelector('.action-sheet-wrapper'));\n\n    var stateChangeListenDone = scope.cancelOnStateChange ?\n      $rootScope.$on('$stateChangeSuccess', function() { scope.cancel(); }) :\n      noop;\n\n    // removes the actionSheet from the screen\n    scope.removeSheet = function(done) {\n      if (scope.removed) return;\n\n      scope.removed = true;\n      sheetEl.removeClass('action-sheet-up');\n      $timeout(function() {\n        // wait to remove this due to a 300ms delay native\n        // click which would trigging whatever was underneath this\n        $ionicBody.removeClass('action-sheet-open');\n      }, 400);\n      scope.$deregisterBackButton();\n      stateChangeListenDone();\n\n      $animate.removeClass(element, 'active').then(function() {\n        scope.$destroy();\n        element.remove();\n        // scope.cancel.$scope is defined near the bottom\n        scope.cancel.$scope = sheetEl = null;\n        (done || noop)();\n      });\n    };\n\n    scope.showSheet = function(done) {\n      if (scope.removed) return;\n\n      $ionicBody.append(element)\n                .addClass('action-sheet-open');\n\n      $animate.addClass(element, 'active').then(function() {\n        if (scope.removed) return;\n        (done || noop)();\n      });\n      $timeout(function() {\n        if (scope.removed) return;\n        sheetEl.addClass('action-sheet-up');\n      }, 20, false);\n    };\n\n    // registerBackButtonAction returns a callback to deregister the action\n    scope.$deregisterBackButton = $ionicPlatform.registerBackButtonAction(\n      function() {\n        $timeout(scope.cancel);\n      },\n      IONIC_BACK_PRIORITY.actionSheet\n    );\n\n    // called when the user presses the cancel button\n    scope.cancel = function() {\n      // after the animation is out, call the cancel callback\n      scope.removeSheet(opts.cancel);\n    };\n\n    scope.buttonClicked = function(index) {\n      // Check if the button click event returned true, which means\n      // we can close the action sheet\n      if (opts.buttonClicked(index, opts.buttons[index]) === true) {\n        scope.removeSheet();\n      }\n    };\n\n    scope.destructiveButtonClicked = function() {\n      // Check if the destructive button click event returned true, which means\n      // we can close the action sheet\n      if (opts.destructiveButtonClicked() === true) {\n        scope.removeSheet();\n      }\n    };\n\n    scope.showSheet();\n\n    // Expose the scope on $ionicActionSheet's return value for the sake\n    // of testing it.\n    scope.cancel.$scope = scope;\n\n    return scope.cancel;\n  }\n}]);\n\n\njqLite.prototype.addClass = function(cssClasses) {\n  var x, y, cssClass, el, splitClasses, existingClasses;\n  if (cssClasses && cssClasses != 'ng-scope' && cssClasses != 'ng-isolate-scope') {\n    for (x = 0; x < this.length; x++) {\n      el = this[x];\n      if (el.setAttribute) {\n\n        if (cssClasses.indexOf(' ') < 0 && el.classList.add) {\n          el.classList.add(cssClasses);\n        } else {\n          existingClasses = (' ' + (el.getAttribute('class') || '') + ' ')\n            .replace(/[\\n\\t]/g, \" \");\n          splitClasses = cssClasses.split(' ');\n\n          for (y = 0; y < splitClasses.length; y++) {\n            cssClass = splitClasses[y].trim();\n            if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n              existingClasses += cssClass + ' ';\n            }\n          }\n          el.setAttribute('class', existingClasses.trim());\n        }\n      }\n    }\n  }\n  return this;\n};\n\njqLite.prototype.removeClass = function(cssClasses) {\n  var x, y, splitClasses, cssClass, el;\n  if (cssClasses) {\n    for (x = 0; x < this.length; x++) {\n      el = this[x];\n      if (el.getAttribute) {\n        if (cssClasses.indexOf(' ') < 0 && el.classList.remove) {\n          el.classList.remove(cssClasses);\n        } else {\n          splitClasses = cssClasses.split(' ');\n\n          for (y = 0; y < splitClasses.length; y++) {\n            cssClass = splitClasses[y];\n            el.setAttribute('class', (\n                (\" \" + (el.getAttribute('class') || '') + \" \")\n                .replace(/[\\n\\t]/g, \" \")\n                .replace(\" \" + cssClass.trim() + \" \", \" \")).trim()\n            );\n          }\n        }\n      }\n    }\n  }\n  return this;\n};\n\n/**\n * @ngdoc service\n * @name $ionicBackdrop\n * @module ionic\n * @description\n * Shows and hides a backdrop over the UI.  Appears behind popups, loading,\n * and other overlays.\n *\n * Often, multiple UI components require a backdrop, but only one backdrop is\n * ever needed in the DOM at a time.\n *\n * Therefore, each component that requires the backdrop to be shown calls\n * `$ionicBackdrop.retain()` when it wants the backdrop, then `$ionicBackdrop.release()`\n * when it is done with the backdrop.\n *\n * For each time `retain` is called, the backdrop will be shown until `release` is called.\n *\n * For example, if `retain` is called three times, the backdrop will be shown until `release`\n * is called three times.\n *\n * @usage\n *\n * ```js\n * function MyController($scope, $ionicBackdrop, $timeout) {\n *   //Show a backdrop for one second\n *   $scope.action = function() {\n *     $ionicBackdrop.retain();\n *     $timeout(function() {\n *       $ionicBackdrop.release();\n *     }, 1000);\n *   };\n * }\n * ```\n */\nIonicModule\n.factory('$ionicBackdrop', [\n  '$document', '$timeout', '$$rAF',\nfunction($document, $timeout, $$rAF) {\n\n  var el = jqLite('<div class=\"backdrop\">');\n  var backdropHolds = 0;\n\n  $document[0].body.appendChild(el[0]);\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicBackdrop#retain\n     * @description Retains the backdrop.\n     */\n    retain: retain,\n    /**\n     * @ngdoc method\n     * @name $ionicBackdrop#release\n     * @description\n     * Releases the backdrop.\n     */\n    release: release,\n\n    getElement: getElement,\n\n    // exposed for testing\n    _element: el\n  };\n\n  function retain() {\n    backdropHolds++;\n    if (backdropHolds === 1) {\n      el.addClass('visible');\n      $$rAF(function() {\n        // If we're still at >0 backdropHolds after async...\n        if (backdropHolds >= 1) el.addClass('active');\n      });\n    }\n  }\n  function release() {\n    if (backdropHolds === 1) {\n      el.removeClass('active');\n      $timeout(function() {\n        // If we're still at 0 backdropHolds after async...\n        if (backdropHolds === 0) el.removeClass('visible');\n      }, 400, false);\n    }\n    backdropHolds = Math.max(0, backdropHolds - 1);\n  }\n\n  function getElement() {\n    return el;\n  }\n\n}]);\n\n/**\n * @private\n */\nIonicModule\n.factory('$ionicBind', ['$parse', '$interpolate', function($parse, $interpolate) {\n  var LOCAL_REGEXP = /^\\s*([@=&])(\\??)\\s*(\\w*)\\s*$/;\n  return function(scope, attrs, bindDefinition) {\n    forEach(bindDefinition || {}, function(definition, scopeName) {\n      //Adapted from angular.js $compile\n      var match = definition.match(LOCAL_REGEXP) || [],\n        attrName = match[3] || scopeName,\n        mode = match[1], // @, =, or &\n        parentGet,\n        unwatch;\n\n      switch (mode) {\n        case '@':\n          if (!attrs[attrName]) {\n            return;\n          }\n          attrs.$observe(attrName, function(value) {\n            scope[scopeName] = value;\n          });\n          // we trigger an interpolation to ensure\n          // the value is there for use immediately\n          if (attrs[attrName]) {\n            scope[scopeName] = $interpolate(attrs[attrName])(scope);\n          }\n          break;\n\n        case '=':\n          if (!attrs[attrName]) {\n            return;\n          }\n          unwatch = scope.$watch(attrs[attrName], function(value) {\n            scope[scopeName] = value;\n          });\n          //Destroy parent scope watcher when this scope is destroyed\n          scope.$on('$destroy', unwatch);\n          break;\n\n        case '&':\n          /* jshint -W044 */\n          if (attrs[attrName] && attrs[attrName].match(RegExp(scopeName + '\\(.*?\\)'))) {\n            throw new Error('& expression binding \"' + scopeName + '\" looks like it will recursively call \"' +\n                          attrs[attrName] + '\" and cause a stack overflow! Please choose a different scopeName.');\n          }\n          parentGet = $parse(attrs[attrName]);\n          scope[scopeName] = function(locals) {\n            return parentGet(scope, locals);\n          };\n          break;\n      }\n    });\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicBody\n * @module ionic\n * @description An angular utility service to easily and efficiently\n * add and remove CSS classes from the document's body element.\n */\nIonicModule\n.factory('$ionicBody', ['$document', function($document) {\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicBody#add\n     * @description Add a class to the document's body element.\n     * @param {string} class Each argument will be added to the body element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    addClass: function() {\n      for (var x = 0; x < arguments.length; x++) {\n        $document[0].body.classList.add(arguments[x]);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#removeClass\n     * @description Remove a class from the document's body element.\n     * @param {string} class Each argument will be removed from the body element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    removeClass: function() {\n      for (var x = 0; x < arguments.length; x++) {\n        $document[0].body.classList.remove(arguments[x]);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#enableClass\n     * @description Similar to the `add` method, except the first parameter accepts a boolean\n     * value determining if the class should be added or removed. Rather than writing user code,\n     * such as \"if true then add the class, else then remove the class\", this method can be\n     * given a true or false value which reduces redundant code.\n     * @param {boolean} shouldEnableClass A true/false value if the class should be added or removed.\n     * @param {string} class Each remaining argument would be added or removed depending on\n     * the first argument.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    enableClass: function(shouldEnableClass) {\n      var args = Array.prototype.slice.call(arguments).slice(1);\n      if (shouldEnableClass) {\n        this.addClass.apply(this, args);\n      } else {\n        this.removeClass.apply(this, args);\n      }\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#append\n     * @description Append a child to the document's body.\n     * @param {element} element The element to be appended to the body. The passed in element\n     * can be either a jqLite element, or a DOM element.\n     * @returns {$ionicBody} The $ionicBody service so methods can be chained.\n     */\n    append: function(ele) {\n      $document[0].body.appendChild(ele.length ? ele[0] : ele);\n      return this;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicBody#get\n     * @description Get the document's body element.\n     * @returns {element} Returns the document's body element.\n     */\n    get: function() {\n      return $document[0].body;\n    }\n  };\n}]);\n\nIonicModule\n.factory('$ionicClickBlock', [\n  '$document',\n  '$ionicBody',\n  '$timeout',\nfunction($document, $ionicBody, $timeout) {\n  var CSS_HIDE = 'click-block-hide';\n  var cbEle, fallbackTimer, pendingShow;\n\n  function preventClick(ev) {\n    ev.preventDefault();\n    ev.stopPropagation();\n  }\n\n  function addClickBlock() {\n    if (pendingShow) {\n      if (cbEle) {\n        cbEle.classList.remove(CSS_HIDE);\n      } else {\n        cbEle = $document[0].createElement('div');\n        cbEle.className = 'click-block';\n        $ionicBody.append(cbEle);\n        cbEle.addEventListener('touchstart', preventClick);\n        cbEle.addEventListener('mousedown', preventClick);\n      }\n      pendingShow = false;\n    }\n  }\n\n  function removeClickBlock() {\n    cbEle && cbEle.classList.add(CSS_HIDE);\n  }\n\n  return {\n    show: function(autoExpire) {\n      pendingShow = true;\n      $timeout.cancel(fallbackTimer);\n      fallbackTimer = $timeout(this.hide, autoExpire || 310, false);\n      addClickBlock();\n    },\n    hide: function() {\n      pendingShow = false;\n      $timeout.cancel(fallbackTimer);\n      removeClickBlock();\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicGesture\n * @module ionic\n * @description An angular service exposing ionic\n * {@link ionic.utility:ionic.EventController}'s gestures.\n */\nIonicModule\n.factory('$ionicGesture', [function() {\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicGesture#on\n     * @description Add an event listener for a gesture on an element. See {@link ionic.utility:ionic.EventController#onGesture}.\n     * @param {string} eventType The gesture event to listen for.\n     * @param {function(e)} callback The function to call when the gesture\n     * happens.\n     * @param {element} $element The angular element to listen for the event on.\n     * @param {object} options object.\n     * @returns {ionic.Gesture} The gesture object (use this to remove the gesture later on).\n     */\n    on: function(eventType, cb, $element, options) {\n      return window.ionic.onGesture(eventType, cb, $element[0], options);\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicGesture#off\n     * @description Remove an event listener for a gesture on an element. See {@link ionic.utility:ionic.EventController#offGesture}.\n     * @param {ionic.Gesture} gesture The gesture that should be removed.\n     * @param {string} eventType The gesture event to remove the listener for.\n     * @param {function(e)} callback The listener to remove.\n     */\n    off: function(gesture, eventType, cb) {\n      return window.ionic.offGesture(gesture, eventType, cb);\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicHistory\n * @module ionic\n * @description\n * $ionicHistory keeps track of views as the user navigates through an app. Similar to the way a\n * browser behaves, an Ionic app is able to keep track of the previous view, the current view, and\n * the forward view (if there is one).  However, a typical web browser only keeps track of one\n * history stack in a linear fashion.\n *\n * Unlike a traditional browser environment, apps and webapps have parallel independent histories,\n * such as with tabs. Should a user navigate few pages deep on one tab, and then switch to a new\n * tab and back, the back button relates not to the previous tab, but to the previous pages\n * visited within _that_ tab.\n *\n * `$ionicHistory` facilitates this parallel history architecture.\n */\n\nIonicModule\n.factory('$ionicHistory', [\n  '$rootScope',\n  '$state',\n  '$location',\n  '$window',\n  '$timeout',\n  '$ionicViewSwitcher',\n  '$ionicNavViewDelegate',\nfunction($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $ionicNavViewDelegate) {\n\n  // history actions while navigating views\n  var ACTION_INITIAL_VIEW = 'initialView';\n  var ACTION_NEW_VIEW = 'newView';\n  var ACTION_MOVE_BACK = 'moveBack';\n  var ACTION_MOVE_FORWARD = 'moveForward';\n\n  // direction of navigation\n  var DIRECTION_BACK = 'back';\n  var DIRECTION_FORWARD = 'forward';\n  var DIRECTION_ENTER = 'enter';\n  var DIRECTION_EXIT = 'exit';\n  var DIRECTION_SWAP = 'swap';\n  var DIRECTION_NONE = 'none';\n\n  var stateChangeCounter = 0;\n  var lastStateId, nextViewOptions, nextViewExpireTimer, forcedNav;\n\n  var viewHistory = {\n    histories: { root: { historyId: 'root', parentHistoryId: null, stack: [], cursor: -1 } },\n    views: {},\n    backView: null,\n    forwardView: null,\n    currentView: null\n  };\n\n  var View = function() {};\n  View.prototype.initialize = function(data) {\n    if (data) {\n      for (var name in data) this[name] = data[name];\n      return this;\n    }\n    return null;\n  };\n  View.prototype.go = function() {\n\n    if (this.stateName) {\n      return $state.go(this.stateName, this.stateParams);\n    }\n\n    if (this.url && this.url !== $location.url()) {\n\n      if (viewHistory.backView === this) {\n        return $window.history.go(-1);\n      } else if (viewHistory.forwardView === this) {\n        return $window.history.go(1);\n      }\n\n      $location.url(this.url);\n    }\n\n    return null;\n  };\n  View.prototype.destroy = function() {\n    if (this.scope) {\n      this.scope.$destroy && this.scope.$destroy();\n      this.scope = null;\n    }\n  };\n\n\n  function getViewById(viewId) {\n    return (viewId ? viewHistory.views[ viewId ] : null);\n  }\n\n  function getBackView(view) {\n    return (view ? getViewById(view.backViewId) : null);\n  }\n\n  function getForwardView(view) {\n    return (view ? getViewById(view.forwardViewId) : null);\n  }\n\n  function getHistoryById(historyId) {\n    return (historyId ? viewHistory.histories[ historyId ] : null);\n  }\n\n  function getHistory(scope) {\n    var histObj = getParentHistoryObj(scope);\n\n    if (!viewHistory.histories[ histObj.historyId ]) {\n      // this history object exists in parent scope, but doesn't\n      // exist in the history data yet\n      viewHistory.histories[ histObj.historyId ] = {\n        historyId: histObj.historyId,\n        parentHistoryId: getParentHistoryObj(histObj.scope.$parent).historyId,\n        stack: [],\n        cursor: -1\n      };\n    }\n    return getHistoryById(histObj.historyId);\n  }\n\n  function getParentHistoryObj(scope) {\n    var parentScope = scope;\n    while (parentScope) {\n      if (parentScope.hasOwnProperty('$historyId')) {\n        // this parent scope has a historyId\n        return { historyId: parentScope.$historyId, scope: parentScope };\n      }\n      // nothing found keep climbing up\n      parentScope = parentScope.$parent;\n    }\n    // no history for the parent, use the root\n    return { historyId: 'root', scope: $rootScope };\n  }\n\n  function setNavViews(viewId) {\n    viewHistory.currentView = getViewById(viewId);\n    viewHistory.backView = getBackView(viewHistory.currentView);\n    viewHistory.forwardView = getForwardView(viewHistory.currentView);\n  }\n\n  function getCurrentStateId() {\n    var id;\n    if ($state && $state.current && $state.current.name) {\n      id = $state.current.name;\n      if ($state.params) {\n        for (var key in $state.params) {\n          if ($state.params.hasOwnProperty(key) && $state.params[key]) {\n            id += \"_\" + key + \"=\" + $state.params[key];\n          }\n        }\n      }\n      return id;\n    }\n    // if something goes wrong make sure its got a unique stateId\n    return ionic.Utils.nextUid();\n  }\n\n  function getCurrentStateParams() {\n    var rtn;\n    if ($state && $state.params) {\n      for (var key in $state.params) {\n        if ($state.params.hasOwnProperty(key)) {\n          rtn = rtn || {};\n          rtn[key] = $state.params[key];\n        }\n      }\n    }\n    return rtn;\n  }\n\n\n  return {\n\n    register: function(parentScope, viewLocals) {\n\n      var currentStateId = getCurrentStateId(),\n          hist = getHistory(parentScope),\n          currentView = viewHistory.currentView,\n          backView = viewHistory.backView,\n          forwardView = viewHistory.forwardView,\n          viewId = null,\n          action = null,\n          direction = DIRECTION_NONE,\n          historyId = hist.historyId,\n          url = $location.url(),\n          tmp, x, ele;\n\n      if (lastStateId !== currentStateId) {\n        lastStateId = currentStateId;\n        stateChangeCounter++;\n      }\n\n      if (forcedNav) {\n        // we've previously set exactly what to do\n        viewId = forcedNav.viewId;\n        action = forcedNav.action;\n        direction = forcedNav.direction;\n        forcedNav = null;\n\n      } else if (backView && backView.stateId === currentStateId) {\n        // they went back one, set the old current view as a forward view\n        viewId = backView.viewId;\n        historyId = backView.historyId;\n        action = ACTION_MOVE_BACK;\n        if (backView.historyId === currentView.historyId) {\n          // went back in the same history\n          direction = DIRECTION_BACK;\n\n        } else if (currentView) {\n          direction = DIRECTION_EXIT;\n\n          tmp = getHistoryById(backView.historyId);\n          if (tmp && tmp.parentHistoryId === currentView.historyId) {\n            direction = DIRECTION_ENTER;\n\n          } else {\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n            }\n          }\n        }\n\n      } else if (forwardView && forwardView.stateId === currentStateId) {\n        // they went to the forward one, set the forward view to no longer a forward view\n        viewId = forwardView.viewId;\n        historyId = forwardView.historyId;\n        action = ACTION_MOVE_FORWARD;\n        if (forwardView.historyId === currentView.historyId) {\n          direction = DIRECTION_FORWARD;\n\n        } else if (currentView) {\n          direction = DIRECTION_EXIT;\n\n          if (currentView.historyId === hist.parentHistoryId) {\n            direction = DIRECTION_ENTER;\n\n          } else {\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n            }\n          }\n        }\n\n        tmp = getParentHistoryObj(parentScope);\n        if (forwardView.historyId && tmp.scope) {\n          // if a history has already been created by the forward view then make sure it stays the same\n          tmp.scope.$historyId = forwardView.historyId;\n          historyId = forwardView.historyId;\n        }\n\n      } else if (currentView && currentView.historyId !== historyId &&\n                hist.cursor > -1 && hist.stack.length > 0 && hist.cursor < hist.stack.length &&\n                hist.stack[hist.cursor].stateId === currentStateId) {\n        // they just changed to a different history and the history already has views in it\n        var switchToView = hist.stack[hist.cursor];\n        viewId = switchToView.viewId;\n        historyId = switchToView.historyId;\n        action = ACTION_MOVE_BACK;\n        direction = DIRECTION_SWAP;\n\n        tmp = getHistoryById(currentView.historyId);\n        if (tmp && tmp.parentHistoryId === historyId) {\n          direction = DIRECTION_EXIT;\n\n        } else {\n          tmp = getHistoryById(historyId);\n          if (tmp && tmp.parentHistoryId === currentView.historyId) {\n            direction = DIRECTION_ENTER;\n          }\n        }\n\n        // if switching to a different history, and the history of the view we're switching\n        // to has an existing back view from a different history than itself, then\n        // it's back view would be better represented using the current view as its back view\n        tmp = getViewById(switchToView.backViewId);\n        if (tmp && switchToView.historyId !== tmp.historyId) {\n          hist.stack[hist.cursor].backViewId = currentView.viewId;\n        }\n\n      } else {\n\n        // create an element from the viewLocals template\n        ele = $ionicViewSwitcher.createViewEle(viewLocals);\n        if (this.isAbstractEle(ele, viewLocals)) {\n          void 0;\n          return {\n            action: 'abstractView',\n            direction: DIRECTION_NONE,\n            ele: ele\n          };\n        }\n\n        // set a new unique viewId\n        viewId = ionic.Utils.nextUid();\n\n        if (currentView) {\n          // set the forward view if there is a current view (ie: if its not the first view)\n          currentView.forwardViewId = viewId;\n\n          action = ACTION_NEW_VIEW;\n\n          // check if there is a new forward view within the same history\n          if (forwardView && currentView.stateId !== forwardView.stateId &&\n             currentView.historyId === forwardView.historyId) {\n            // they navigated to a new view but the stack already has a forward view\n            // since its a new view remove any forwards that existed\n            tmp = getHistoryById(forwardView.historyId);\n            if (tmp) {\n              // the forward has a history\n              for (x = tmp.stack.length - 1; x >= forwardView.index; x--) {\n                // starting from the end destroy all forwards in this history from this point\n                var stackItem = tmp.stack[x];\n                stackItem && stackItem.destroy && stackItem.destroy();\n                tmp.stack.splice(x);\n              }\n              historyId = forwardView.historyId;\n            }\n          }\n\n          // its only moving forward if its in the same history\n          if (hist.historyId === currentView.historyId) {\n            direction = DIRECTION_FORWARD;\n\n          } else if (currentView.historyId !== hist.historyId) {\n            direction = DIRECTION_ENTER;\n\n            tmp = getHistoryById(currentView.historyId);\n            if (tmp && tmp.parentHistoryId === hist.parentHistoryId) {\n              direction = DIRECTION_SWAP;\n\n            } else {\n              tmp = getHistoryById(tmp.parentHistoryId);\n              if (tmp && tmp.historyId === hist.historyId) {\n                direction = DIRECTION_EXIT;\n              }\n            }\n          }\n\n        } else {\n          // there's no current view, so this must be the initial view\n          action = ACTION_INITIAL_VIEW;\n        }\n\n        if (stateChangeCounter < 2) {\n          // views that were spun up on the first load should not animate\n          direction = DIRECTION_NONE;\n        }\n\n        // add the new view\n        viewHistory.views[viewId] = this.createView({\n          viewId: viewId,\n          index: hist.stack.length,\n          historyId: hist.historyId,\n          backViewId: (currentView && currentView.viewId ? currentView.viewId : null),\n          forwardViewId: null,\n          stateId: currentStateId,\n          stateName: this.currentStateName(),\n          stateParams: getCurrentStateParams(),\n          url: url,\n          canSwipeBack: canSwipeBack(ele, viewLocals)\n        });\n\n        // add the new view to this history's stack\n        hist.stack.push(viewHistory.views[viewId]);\n      }\n\n      $timeout.cancel(nextViewExpireTimer);\n      if (nextViewOptions) {\n        if (nextViewOptions.disableAnimate) direction = DIRECTION_NONE;\n        if (nextViewOptions.disableBack) viewHistory.views[viewId].backViewId = null;\n        if (nextViewOptions.historyRoot) {\n          for (x = 0; x < hist.stack.length; x++) {\n            if (hist.stack[x].viewId === viewId) {\n              hist.stack[x].index = 0;\n              hist.stack[x].backViewId = hist.stack[x].forwardViewId = null;\n            } else {\n              delete viewHistory.views[hist.stack[x].viewId];\n            }\n          }\n          hist.stack = [viewHistory.views[viewId]];\n        }\n        nextViewOptions = null;\n      }\n\n      setNavViews(viewId);\n\n      if (viewHistory.backView && historyId == viewHistory.backView.historyId && currentStateId == viewHistory.backView.stateId && url == viewHistory.backView.url) {\n        for (x = 0; x < hist.stack.length; x++) {\n          if (hist.stack[x].viewId == viewId) {\n            action = 'dupNav';\n            direction = DIRECTION_NONE;\n            if (x > 0) {\n              hist.stack[x - 1].forwardViewId = null;\n            }\n            viewHistory.forwardView = null;\n            viewHistory.currentView.index = viewHistory.backView.index;\n            viewHistory.currentView.backViewId = viewHistory.backView.backViewId;\n            viewHistory.backView = getBackView(viewHistory.backView);\n            hist.stack.splice(x, 1);\n            break;\n          }\n        }\n      }\n\n      void 0;\n\n      hist.cursor = viewHistory.currentView.index;\n\n      return {\n        viewId: viewId,\n        action: action,\n        direction: direction,\n        historyId: historyId,\n        enableBack: this.enabledBack(viewHistory.currentView),\n        isHistoryRoot: (viewHistory.currentView.index === 0),\n        ele: ele\n      };\n    },\n\n    registerHistory: function(scope) {\n      scope.$historyId = ionic.Utils.nextUid();\n    },\n\n    createView: function(data) {\n      var newView = new View();\n      return newView.initialize(data);\n    },\n\n    getViewById: getViewById,\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#viewHistory\n     * @description The app's view history data, such as all the views and histories, along\n     * with how they are ordered and linked together within the navigation stack.\n     * @returns {object} Returns an object containing the apps view history data.\n     */\n    viewHistory: function() {\n      return viewHistory;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentView\n     * @description The app's current view.\n     * @returns {object} Returns the current view.\n     */\n    currentView: function(view) {\n      if (arguments.length) {\n        viewHistory.currentView = view;\n      }\n      return viewHistory.currentView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentHistoryId\n     * @description The ID of the history stack which is the parent container of the current view.\n     * @returns {string} Returns the current history ID.\n     */\n    currentHistoryId: function() {\n      return viewHistory.currentView ? viewHistory.currentView.historyId : null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentTitle\n     * @description Gets and sets the current view's title.\n     * @param {string=} val The title to update the current view with.\n     * @returns {string} Returns the current view's title.\n     */\n    currentTitle: function(val) {\n      if (viewHistory.currentView) {\n        if (arguments.length) {\n          viewHistory.currentView.title = val;\n        }\n        return viewHistory.currentView.title;\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#backView\n     * @description Returns the view that was before the current view in the history stack.\n     * If the user navigated from View A to View B, then View A would be the back view, and\n     * View B would be the current view.\n     * @returns {object} Returns the back view.\n     */\n    backView: function(view) {\n      if (arguments.length) {\n        viewHistory.backView = view;\n      }\n      return viewHistory.backView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#backTitle\n     * @description Gets the back view's title.\n     * @returns {string} Returns the back view's title.\n     */\n    backTitle: function(view) {\n      var backView = (view && getViewById(view.backViewId)) || viewHistory.backView;\n      return backView && backView.title;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#forwardView\n     * @description Returns the view that was in front of the current view in the history stack.\n     * A forward view would exist if the user navigated from View A to View B, then\n     * navigated back to View A. At this point then View B would be the forward view, and View\n     * A would be the current view.\n     * @returns {object} Returns the forward view.\n     */\n    forwardView: function(view) {\n      if (arguments.length) {\n        viewHistory.forwardView = view;\n      }\n      return viewHistory.forwardView;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#currentStateName\n     * @description Returns the current state name.\n     * @returns {string}\n     */\n    currentStateName: function() {\n      return ($state && $state.current ? $state.current.name : null);\n    },\n\n    isCurrentStateNavView: function(navView) {\n      return !!($state && $state.current && $state.current.views && $state.current.views[navView]);\n    },\n\n    goToHistoryRoot: function(historyId) {\n      if (historyId) {\n        var hist = getHistoryById(historyId);\n        if (hist && hist.stack.length) {\n          if (viewHistory.currentView && viewHistory.currentView.viewId === hist.stack[0].viewId) {\n            return;\n          }\n          forcedNav = {\n            viewId: hist.stack[0].viewId,\n            action: ACTION_MOVE_BACK,\n            direction: DIRECTION_BACK\n          };\n          hist.stack[0].go();\n        }\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#goBack\n     * @param {number=} backCount Optional negative integer setting how many views to go\n     * back. By default it'll go back one view by using the value `-1`. To go back two\n     * views you would use `-2`. If the number goes farther back than the number of views\n     * in the current history's stack then it'll go to the first view in the current history's\n     * stack. If the number is zero or greater then it'll do nothing. It also does not\n     * cross history stacks, meaning it can only go as far back as the current history.\n     * @description Navigates the app to the back view, if a back view exists.\n     */\n    goBack: function(backCount) {\n      if (isDefined(backCount) && backCount !== -1) {\n        if (backCount > -1) return;\n\n        var currentHistory = viewHistory.histories[this.currentHistoryId()];\n        var newCursor = currentHistory.cursor + backCount + 1;\n        if (newCursor < 1) {\n          newCursor = 1;\n        }\n\n        currentHistory.cursor = newCursor;\n        setNavViews(currentHistory.stack[newCursor].viewId);\n\n        var cursor = newCursor - 1;\n        var clearStateIds = [];\n        var fwdView = getViewById(currentHistory.stack[cursor].forwardViewId);\n        while (fwdView) {\n          clearStateIds.push(fwdView.stateId || fwdView.viewId);\n          cursor++;\n          if (cursor >= currentHistory.stack.length) break;\n          fwdView = getViewById(currentHistory.stack[cursor].forwardViewId);\n        }\n\n        var self = this;\n        if (clearStateIds.length) {\n          $timeout(function() {\n            self.clearCache(clearStateIds);\n          }, 600);\n        }\n      }\n\n      viewHistory.backView && viewHistory.backView.go();\n    },\n\n\n    enabledBack: function(view) {\n      var backView = getBackView(view);\n      return !!(backView && backView.historyId === view.historyId);\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#clearHistory\n     * @description Clears out the app's entire history, except for the current view.\n     */\n    clearHistory: function() {\n      var\n      histories = viewHistory.histories,\n      currentView = viewHistory.currentView;\n\n      if (histories) {\n        for (var historyId in histories) {\n\n          if (histories[historyId].stack) {\n            histories[historyId].stack = [];\n            histories[historyId].cursor = -1;\n          }\n\n          if (currentView && currentView.historyId === historyId) {\n            currentView.backViewId = currentView.forwardViewId = null;\n            histories[historyId].stack.push(currentView);\n          } else if (histories[historyId].destroy) {\n            histories[historyId].destroy();\n          }\n\n        }\n      }\n\n      for (var viewId in viewHistory.views) {\n        if (viewId !== currentView.viewId) {\n          delete viewHistory.views[viewId];\n        }\n      }\n\n      if (currentView) {\n        setNavViews(currentView.viewId);\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#clearCache\n     * @description Removes all cached views within every {@link ionic.directive:ionNavView}.\n     * This both removes the view element from the DOM, and destroy it's scope.\n     */\n    clearCache: function(stateIds) {\n      $timeout(function() {\n        $ionicNavViewDelegate._instances.forEach(function(instance) {\n          instance.clearCache(stateIds);\n        });\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicHistory#nextViewOptions\n     * @description Sets options for the next view. This method can be useful to override\n     * certain view/transition defaults right before a view transition happens. For example,\n     * the {@link ionic.directive:menuClose} directive uses this method internally to ensure\n     * an animated view transition does not happen when a side menu is open, and also sets\n     * the next view as the root of its history stack. After the transition these options\n     * are set back to null.\n     *\n     * Available options:\n     *\n     * * `disableAnimate`: Do not animate the next transition.\n     * * `disableBack`: The next view should forget its back view, and set it to null.\n     * * `historyRoot`: The next view should become the root view in its history stack.\n     *\n     * ```js\n     * $ionicHistory.nextViewOptions({\n     *   disableAnimate: true,\n     *   disableBack: true\n     * });\n     * ```\n     */\n    nextViewOptions: function(opts) {\n      if (arguments.length) {\n        $timeout.cancel(nextViewExpireTimer);\n        if (opts === null) {\n          nextViewOptions = opts;\n        } else {\n          nextViewOptions = nextViewOptions || {};\n          extend(nextViewOptions, opts);\n          if (nextViewOptions.expire) {\n            nextViewExpireTimer = $timeout(function() {\n              nextViewOptions = null;\n            }, nextViewOptions.expire);\n          }\n        }\n      }\n      return nextViewOptions;\n    },\n\n    isAbstractEle: function(ele, viewLocals) {\n      if (viewLocals && viewLocals.$$state && viewLocals.$$state.self['abstract']) {\n        return true;\n      }\n      return !!(ele && (isAbstractTag(ele) || isAbstractTag(ele.children())));\n    },\n\n    isActiveScope: function(scope) {\n      if (!scope) return false;\n\n      var climbScope = scope;\n      var currentHistoryId = this.currentHistoryId();\n      var foundHistoryId;\n\n      while (climbScope) {\n        if (climbScope.$$disconnected) {\n          return false;\n        }\n\n        if (!foundHistoryId && climbScope.hasOwnProperty('$historyId')) {\n          foundHistoryId = true;\n        }\n\n        if (currentHistoryId) {\n          if (climbScope.hasOwnProperty('$historyId') && currentHistoryId == climbScope.$historyId) {\n            return true;\n          }\n          if (climbScope.hasOwnProperty('$activeHistoryId')) {\n            if (currentHistoryId == climbScope.$activeHistoryId) {\n              if (climbScope.hasOwnProperty('$historyId')) {\n                return true;\n              }\n              if (!foundHistoryId) {\n                return true;\n              }\n            }\n          }\n        }\n\n        if (foundHistoryId && climbScope.hasOwnProperty('$activeHistoryId')) {\n          foundHistoryId = false;\n        }\n\n        climbScope = climbScope.$parent;\n      }\n\n      return currentHistoryId ? currentHistoryId == 'root' : true;\n    }\n\n  };\n\n  function isAbstractTag(ele) {\n    return ele && ele.length && /ion-side-menus|ion-tabs/i.test(ele[0].tagName);\n  }\n\n  function canSwipeBack(ele, viewLocals) {\n    if (viewLocals && viewLocals.$$state && viewLocals.$$state.self.canSwipeBack === false) {\n      return false;\n    }\n    if (ele && ele.attr('can-swipe-back') === 'false') {\n      return false;\n    }\n    return true;\n  }\n\n}])\n\n.run([\n  '$rootScope',\n  '$state',\n  '$location',\n  '$document',\n  '$ionicPlatform',\n  '$ionicHistory',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $state, $location, $document, $ionicPlatform, $ionicHistory, IONIC_BACK_PRIORITY) {\n\n  // always reset the keyboard state when change stage\n  $rootScope.$on('$ionicView.beforeEnter', function() {\n    ionic.keyboard && ionic.keyboard.hide && ionic.keyboard.hide();\n  });\n\n  $rootScope.$on('$ionicHistory.change', function(e, data) {\n    if (!data) return null;\n\n    var viewHistory = $ionicHistory.viewHistory();\n\n    var hist = (data.historyId ? viewHistory.histories[ data.historyId ] : null);\n    if (hist && hist.cursor > -1 && hist.cursor < hist.stack.length) {\n      // the history they're going to already exists\n      // go to it's last view in its stack\n      var view = hist.stack[ hist.cursor ];\n      return view.go(data);\n    }\n\n    // this history does not have a URL, but it does have a uiSref\n    // figure out its URL from the uiSref\n    if (!data.url && data.uiSref) {\n      data.url = $state.href(data.uiSref);\n    }\n\n    if (data.url) {\n      // don't let it start with a #, messes with $location.url()\n      if (data.url.indexOf('#') === 0) {\n        data.url = data.url.replace('#', '');\n      }\n      if (data.url !== $location.url()) {\n        // we've got a good URL, ready GO!\n        $location.url(data.url);\n      }\n    }\n  });\n\n  $rootScope.$ionicGoBack = function(backCount) {\n    $ionicHistory.goBack(backCount);\n  };\n\n  // Set the document title when a new view is shown\n  $rootScope.$on('$ionicView.afterEnter', function(ev, data) {\n    if (data && data.title) {\n      $document[0].title = data.title;\n    }\n  });\n\n  // Triggered when devices with a hardware back button (Android) is clicked by the user\n  // This is a Cordova/Phonegap platform specifc method\n  function onHardwareBackButton(e) {\n    var backView = $ionicHistory.backView();\n    if (backView) {\n      // there is a back view, go to it\n      backView.go();\n    } else {\n      // there is no back view, so close the app instead\n      ionic.Platform.exitApp();\n    }\n    e.preventDefault();\n    return false;\n  }\n  $ionicPlatform.registerBackButtonAction(\n    onHardwareBackButton,\n    IONIC_BACK_PRIORITY.view\n  );\n\n}]);\n\n/**\n * @ngdoc provider\n * @name $ionicConfigProvider\n * @module ionic\n * @description\n * Ionic automatically takes platform configurations into account to adjust things like what\n * transition style to use and whether tab icons should show on the top or bottom. For example,\n * iOS will move forward by transitioning the entering view from right to center and the leaving\n * view from center to left. However, Android will transition with the entering view going from\n * bottom to center, covering the previous view, which remains stationary. It should be noted\n * that when a platform is not iOS or Android, then it'll default to iOS. So if you are\n * developing on a desktop browser, it's going to take on iOS default configs.\n *\n * These configs can be changed using the `$ionicConfigProvider` during the configuration phase\n * of your app. Additionally, `$ionicConfig` can also set and get config values during the run\n * phase and within the app itself.\n *\n * By default, all base config variables are set to `'platform'`, which means it'll take on the\n * default config of the platform on which it's running. Config variables can be set at this\n * level so all platforms follow the same setting, rather than its platform config.\n * The following code would set the same config variable for all platforms:\n *\n * ```js\n * $ionicConfigProvider.views.maxCache(10);\n * ```\n *\n * Additionally, each platform can have it's own config within the `$ionicConfigProvider.platform`\n * property. The config below would only apply to Android devices.\n *\n * ```js\n * $ionicConfigProvider.platform.android.views.maxCache(5);\n * ```\n *\n * @usage\n * ```js\n * var myApp = angular.module('reallyCoolApp', ['ionic']);\n *\n * myApp.config(function($ionicConfigProvider) {\n *   $ionicConfigProvider.views.maxCache(5);\n *\n *   // note that you can also chain configs\n *   $ionicConfigProvider.backButton.text('Go Back').icon('ion-chevron-left');\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.transition\n * @description Animation style when transitioning between views. Default `platform`.\n *\n * @param {string} transition Which style of view transitioning to use.\n *\n * * `platform`: Dynamically choose the correct transition style depending on the platform\n * the app is running from. If the platform is not `ios` or `android` then it will default\n * to `ios`.\n * * `ios`: iOS style transition.\n * * `android`: Android style transition.\n * * `none`: Do not perform animated transitions.\n *\n * @returns {string} value\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.maxCache\n * @description  Maximum number of view elements to cache in the DOM. When the max number is\n * exceeded, the view with the longest time period since it was accessed is removed. Views that\n * stay in the DOM cache the view's scope, current state, and scroll position. The scope is\n * disconnected from the `$watch` cycle when it is cached and reconnected when it enters again.\n * When the maximum cache is `0`, the leaving view's element will be removed from the DOM after\n * each view transition, and the next time the same view is shown, it will have to re-compile,\n * attach to the DOM, and link the element again. This disables caching, in effect.\n * @param {number} maxNumber Maximum number of views to retain. Default `10`.\n * @returns {number} How many views Ionic will hold onto until the a view is removed.\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#views.forwardCache\n * @description  By default, when navigating, views that were recently visited are cached, and\n * the same instance data and DOM elements are referenced when navigating back. However, when\n * navigating back in the history, the \"forward\" views are removed from the cache. If you\n * navigate forward to the same view again, it'll create a new DOM element and controller\n * instance. Basically, any forward views are reset each time. Set this config to `true` to have\n * forward views cached and not reset on each load.\n * @param {boolean} value\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#scrolling.jsScrolling\n * @description  Whether to use JS or Native scrolling. Defaults to JS scrolling. Setting this to\n * `false` has the same effect as setting each `ion-content` to have `overflow-scroll='true'`.\n * @param {boolean} value Defaults to `true`\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.icon\n * @description Back button icon.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.text\n * @description Back button text.\n * @param {string} value Defaults to `Back`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#backButton.previousTitleText\n * @description If the previous title text should become the back button text. This\n * is the default for iOS.\n * @param {boolean} value\n * @returns {boolean}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#form.checkbox\n * @description Checkbox style. Android defaults to `square` and iOS defaults to `circle`.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#form.toggle\n * @description Toggle item style. Android defaults to `small` and iOS defaults to `large`.\n * @param {string} value\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#tabs.style\n * @description Tab style. Android defaults to `striped` and iOS defaults to `standard`.\n * @param {string} value Available values include `striped` and `standard`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#tabs.position\n * @description Tab position. Android defaults to `top` and iOS defaults to `bottom`.\n * @param {string} value Available values include `top` and `bottom`.\n * @returns {string}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#templates.maxPrefetch\n * @description Sets the maximum number of templates to prefetch from the templateUrls defined in\n * $stateProvider.state. If set to `0`, the user will have to wait\n * for a template to be fetched the first time when navigating to a new page. Default `30`.\n * @param {integer} value Max number of template to prefetch from the templateUrls defined in\n * `$stateProvider.state()`.\n * @returns {integer}\n */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#navBar.alignTitle\n * @description Which side of the navBar to align the title. Default `center`.\n *\n * @param {string} value side of the navBar to align the title.\n *\n * * `platform`: Dynamically choose the correct title style depending on the platform\n * the app is running from. If the platform is `ios`, it will default to `center`.\n * If the platform is `android`, it will default to `left`. If the platform is not\n * `ios` or `android`, it will default to `center`.\n *\n * * `left`: Left align the title in the navBar\n * * `center`: Center align the title in the navBar\n * * `right`: Right align the title in the navBar.\n *\n * @returns {string} value\n */\n\n/**\n  * @ngdoc method\n  * @name $ionicConfigProvider#navBar.positionPrimaryButtons\n  * @description Which side of the navBar to align the primary navBar buttons. Default `left`.\n  *\n  * @param {string} value side of the navBar to align the primary navBar buttons.\n  *\n  * * `platform`: Dynamically choose the correct title style depending on the platform\n  * the app is running from. If the platform is `ios`, it will default to `left`.\n  * If the platform is `android`, it will default to `right`. If the platform is not\n  * `ios` or `android`, it will default to `left`.\n  *\n  * * `left`: Left align the primary navBar buttons in the navBar\n  * * `right`: Right align the primary navBar buttons in the navBar.\n  *\n  * @returns {string} value\n  */\n\n/**\n * @ngdoc method\n * @name $ionicConfigProvider#navBar.positionSecondaryButtons\n * @description Which side of the navBar to align the secondary navBar buttons. Default `right`.\n *\n * @param {string} value side of the navBar to align the secondary navBar buttons.\n *\n * * `platform`: Dynamically choose the correct title style depending on the platform\n * the app is running from. If the platform is `ios`, it will default to `right`.\n * If the platform is `android`, it will default to `right`. If the platform is not\n * `ios` or `android`, it will default to `right`.\n *\n * * `left`: Left align the secondary navBar buttons in the navBar\n * * `right`: Right align the secondary navBar buttons in the navBar.\n *\n * @returns {string} value\n */\n\nIonicModule\n.provider('$ionicConfig', function() {\n\n  var provider = this;\n  provider.platform = {};\n  var PLATFORM = 'platform';\n\n  var configProperties = {\n    views: {\n      maxCache: PLATFORM,\n      forwardCache: PLATFORM,\n      transition: PLATFORM,\n      swipeBackEnabled: PLATFORM,\n      swipeBackHitWidth: PLATFORM\n    },\n    navBar: {\n      alignTitle: PLATFORM,\n      positionPrimaryButtons: PLATFORM,\n      positionSecondaryButtons: PLATFORM,\n      transition: PLATFORM\n    },\n    backButton: {\n      icon: PLATFORM,\n      text: PLATFORM,\n      previousTitleText: PLATFORM\n    },\n    form: {\n      checkbox: PLATFORM,\n      toggle: PLATFORM\n    },\n    scrolling: {\n      jsScrolling: PLATFORM\n    },\n    tabs: {\n      style: PLATFORM,\n      position: PLATFORM\n    },\n    templates: {\n      maxPrefetch: PLATFORM\n    },\n    platform: {}\n  };\n  createConfig(configProperties, provider, '');\n\n\n\n  // Default\n  // -------------------------\n  setPlatformConfig('default', {\n\n    views: {\n      maxCache: 10,\n      forwardCache: false,\n      transition: 'ios',\n      swipeBackEnabled: true,\n      swipeBackHitWidth: 45\n    },\n\n    navBar: {\n      alignTitle: 'center',\n      positionPrimaryButtons: 'left',\n      positionSecondaryButtons: 'right',\n      transition: 'view'\n    },\n\n    backButton: {\n      icon: 'ion-ios-arrow-back',\n      text: 'Back',\n      previousTitleText: true\n    },\n\n    form: {\n      checkbox: 'circle',\n      toggle: 'large'\n    },\n\n    scrolling: {\n      jsScrolling: true\n    },\n\n    tabs: {\n      style: 'standard',\n      position: 'bottom'\n    },\n\n    templates: {\n      maxPrefetch: 30\n    }\n\n  });\n\n\n\n  // iOS (it is the default already)\n  // -------------------------\n  setPlatformConfig('ios', {});\n\n\n\n  // Android\n  // -------------------------\n  setPlatformConfig('android', {\n\n    views: {\n      transition: 'android',\n      swipeBackEnabled: false\n    },\n\n    navBar: {\n      alignTitle: 'left',\n      positionPrimaryButtons: 'right',\n      positionSecondaryButtons: 'right'\n    },\n\n    backButton: {\n      icon: 'ion-android-arrow-back',\n      text: false,\n      previousTitleText: false\n    },\n\n    form: {\n      checkbox: 'square',\n      toggle: 'small'\n    },\n\n    tabs: {\n      style: 'striped',\n      position: 'top'\n    }\n\n  });\n\n  // Windows Phone\n  // -------------------------\n  setPlatformConfig('windowsphone', {\n    //scrolling: {\n    //  jsScrolling: false\n    //}\n  });\n\n\n  provider.transitions = {\n    views: {},\n    navBar: {}\n  };\n\n\n  // iOS Transitions\n  // -----------------------\n  provider.transitions.views.ios = function(enteringEle, leavingEle, direction, shouldAnimate) {\n\n    function setStyles(ele, opacity, x, boxShadowOpacity) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : 0;\n      css.opacity = opacity;\n      if (boxShadowOpacity > -1) {\n        css.boxShadow = '0 0 10px rgba(0,0,0,' + (d.shouldAnimate ? boxShadowOpacity * 0.45 : 0.3) + ')';\n      }\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + x + '%,0,0)';\n      ionic.DomUtil.cachedStyles(ele, css);\n    }\n\n    var d = {\n      run: function(step) {\n        if (direction == 'forward') {\n          setStyles(enteringEle, 1, (1 - step) * 99, 1 - step); // starting at 98% prevents a flicker\n          setStyles(leavingEle, (1 - 0.1 * step), step * -33, -1);\n\n        } else if (direction == 'back') {\n          setStyles(enteringEle, (1 - 0.1 * (1 - step)), (1 - step) * -33, -1);\n          setStyles(leavingEle, 1, step * 100, 1 - step);\n\n        } else {\n          // swap, enter, exit\n          setStyles(enteringEle, 1, 0, -1);\n          setStyles(leavingEle, 0, 0, -1);\n        }\n      },\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n\n    return d;\n  };\n\n  provider.transitions.navBar.ios = function(enteringHeaderBar, leavingHeaderBar, direction, shouldAnimate) {\n\n    function setStyles(ctrl, opacity, titleX, backTextX) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : '0ms';\n      css.opacity = opacity === 1 ? '' : opacity;\n\n      ctrl.setCss('buttons-left', css);\n      ctrl.setCss('buttons-right', css);\n      ctrl.setCss('back-button', css);\n\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + backTextX + 'px,0,0)';\n      ctrl.setCss('back-text', css);\n\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + titleX + 'px,0,0)';\n      ctrl.setCss('title', css);\n    }\n\n    function enter(ctrlA, ctrlB, step) {\n      if (!ctrlA || !ctrlB) return;\n      var titleX = (ctrlA.titleTextX() + ctrlA.titleWidth()) * (1 - step);\n      var backTextX = (ctrlB && (ctrlB.titleTextX() - ctrlA.backButtonTextLeft()) * (1 - step)) || 0;\n      setStyles(ctrlA, step, titleX, backTextX);\n    }\n\n    function leave(ctrlA, ctrlB, step) {\n      if (!ctrlA || !ctrlB) return;\n      var titleX = (-(ctrlA.titleTextX() - ctrlB.backButtonTextLeft()) - (ctrlA.titleLeftRight())) * step;\n      setStyles(ctrlA, 1 - step, titleX, 0);\n    }\n\n    var d = {\n      run: function(step) {\n        var enteringHeaderCtrl = enteringHeaderBar.controller();\n        var leavingHeaderCtrl = leavingHeaderBar && leavingHeaderBar.controller();\n        if (d.direction == 'back') {\n          leave(enteringHeaderCtrl, leavingHeaderCtrl, 1 - step);\n          enter(leavingHeaderCtrl, enteringHeaderCtrl, 1 - step);\n        } else {\n          enter(enteringHeaderCtrl, leavingHeaderCtrl, step);\n          leave(leavingHeaderCtrl, enteringHeaderCtrl, step);\n        }\n      },\n      direction: direction,\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n\n    return d;\n  };\n\n\n  // Android Transitions\n  // -----------------------\n\n  provider.transitions.views.android = function(enteringEle, leavingEle, direction, shouldAnimate) {\n    shouldAnimate = shouldAnimate && (direction == 'forward' || direction == 'back');\n\n    function setStyles(ele, x) {\n      var css = {};\n      css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : 0;\n      css[ionic.CSS.TRANSFORM] = 'translate3d(' + x + '%,0,0)';\n      ionic.DomUtil.cachedStyles(ele, css);\n    }\n\n    var d = {\n      run: function(step) {\n        if (direction == 'forward') {\n          setStyles(enteringEle, (1 - step) * 99); // starting at 98% prevents a flicker\n          setStyles(leavingEle, step * -100);\n\n        } else if (direction == 'back') {\n          setStyles(enteringEle, (1 - step) * -100);\n          setStyles(leavingEle, step * 100);\n\n        } else {\n          // swap, enter, exit\n          setStyles(enteringEle, 0);\n          setStyles(leavingEle, 0);\n        }\n      },\n      shouldAnimate: shouldAnimate\n    };\n\n    return d;\n  };\n\n  provider.transitions.navBar.android = function(enteringHeaderBar, leavingHeaderBar, direction, shouldAnimate) {\n\n    function setStyles(ctrl, opacity) {\n      if (!ctrl) return;\n      var css = {};\n      css.opacity = opacity === 1 ? '' : opacity;\n\n      ctrl.setCss('buttons-left', css);\n      ctrl.setCss('buttons-right', css);\n      ctrl.setCss('back-button', css);\n      ctrl.setCss('back-text', css);\n      ctrl.setCss('title', css);\n    }\n\n    return {\n      run: function(step) {\n        setStyles(enteringHeaderBar.controller(), step);\n        setStyles(leavingHeaderBar && leavingHeaderBar.controller(), 1 - step);\n      },\n      shouldAnimate: shouldAnimate && (direction == 'forward' || direction == 'back')\n    };\n  };\n\n\n  // No Transition\n  // -----------------------\n\n  provider.transitions.views.none = function(enteringEle, leavingEle) {\n    return {\n      run: function(step) {\n        provider.transitions.views.android(enteringEle, leavingEle, false, false).run(step);\n      },\n      shouldAnimate: false\n    };\n  };\n\n  provider.transitions.navBar.none = function(enteringHeaderBar, leavingHeaderBar) {\n    return {\n      run: function(step) {\n        provider.transitions.navBar.ios(enteringHeaderBar, leavingHeaderBar, false, false).run(step);\n        provider.transitions.navBar.android(enteringHeaderBar, leavingHeaderBar, false, false).run(step);\n      },\n      shouldAnimate: false\n    };\n  };\n\n\n  // private: used to set platform configs\n  function setPlatformConfig(platformName, platformConfigs) {\n    configProperties.platform[platformName] = platformConfigs;\n    provider.platform[platformName] = {};\n\n    addConfig(configProperties, configProperties.platform[platformName]);\n\n    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');\n  }\n\n\n  // private: used to recursively add new platform configs\n  function addConfig(configObj, platformObj) {\n    for (var n in configObj) {\n      if (n != PLATFORM && configObj.hasOwnProperty(n)) {\n        if (angular.isObject(configObj[n])) {\n          if (!isDefined(platformObj[n])) {\n            platformObj[n] = {};\n          }\n          addConfig(configObj[n], platformObj[n]);\n\n        } else if (!isDefined(platformObj[n])) {\n          platformObj[n] = null;\n        }\n      }\n    }\n  }\n\n\n  // private: create methods for each config to get/set\n  function createConfig(configObj, providerObj, platformPath) {\n    forEach(configObj, function(value, namespace) {\n\n      if (angular.isObject(configObj[namespace])) {\n        // recursively drill down the config object so we can create a method for each one\n        providerObj[namespace] = {};\n        createConfig(configObj[namespace], providerObj[namespace], platformPath + '.' + namespace);\n\n      } else {\n        // create a method for the provider/config methods that will be exposed\n        providerObj[namespace] = function(newValue) {\n          if (arguments.length) {\n            configObj[namespace] = newValue;\n            return providerObj;\n          }\n          if (configObj[namespace] == PLATFORM) {\n            // if the config is set to 'platform', then get this config's platform value\n            var platformConfig = stringObj(configProperties.platform, ionic.Platform.platform() + platformPath + '.' + namespace);\n            if (platformConfig || platformConfig === false) {\n              return platformConfig;\n            }\n            // didnt find a specific platform config, now try the default\n            return stringObj(configProperties.platform, 'default' + platformPath + '.' + namespace);\n          }\n          return configObj[namespace];\n        };\n      }\n\n    });\n  }\n\n  function stringObj(obj, str) {\n    str = str.split(\".\");\n    for (var i = 0; i < str.length; i++) {\n      if (obj && isDefined(obj[str[i]])) {\n        obj = obj[str[i]];\n      } else {\n        return null;\n      }\n    }\n    return obj;\n  }\n\n  provider.setPlatformConfig = setPlatformConfig;\n\n\n  // private: Service definition for internal Ionic use\n  /**\n   * @ngdoc service\n   * @name $ionicConfig\n   * @module ionic\n   * @private\n   */\n  provider.$get = function() {\n    return provider;\n  };\n})\n// Fix for URLs in Cordova apps on Windows Phone\n// http://blogs.msdn.com/b/msdn_answers/archive/2015/02/10/\n// running-cordova-apps-on-windows-and-windows-phone-8-1-using-ionic-angularjs-and-other-frameworks.aspx\n.config(['$compileProvider', function($compileProvider) {\n  $compileProvider.aHrefSanitizationWhitelist(/^\\s*(https?|tel|ftp|mailto|file|ghttps?|ms-appx|x-wmapp0):/);\n  $compileProvider.imgSrcSanitizationWhitelist(/^\\s*(https?|tel|ftp|file|blob|ms-appx|x-wmapp0):|data:image\\//);\n}]);\n\n\nvar LOADING_TPL =\n  '<div class=\"loading-container\">' +\n    '<div class=\"loading\">' +\n    '</div>' +\n  '</div>';\n\nvar LOADING_HIDE_DEPRECATED = '$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().';\nvar LOADING_SHOW_DEPRECATED = '$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().';\nvar LOADING_SET_DEPRECATED = '$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: \\'my content\\' }).';\n\n/**\n * @ngdoc service\n * @name $ionicLoading\n * @module ionic\n * @description\n * An overlay that can be used to indicate activity while blocking user\n * interaction.\n *\n * @usage\n * ```js\n * angular.module('LoadingApp', ['ionic'])\n * .controller('LoadingCtrl', function($scope, $ionicLoading) {\n *   $scope.show = function() {\n *     $ionicLoading.show({\n *       template: 'Loading...'\n *     });\n *   };\n *   $scope.hide = function(){\n *     $ionicLoading.hide();\n *   };\n * });\n * ```\n */\n/**\n * @ngdoc object\n * @name $ionicLoadingConfig\n * @module ionic\n * @description\n * Set the default options to be passed to the {@link ionic.service:$ionicLoading} service.\n *\n * @usage\n * ```js\n * var app = angular.module('myApp', ['ionic'])\n * app.constant('$ionicLoadingConfig', {\n *   template: 'Default Loading Template...'\n * });\n * app.controller('AppCtrl', function($scope, $ionicLoading) {\n *   $scope.showLoading = function() {\n *     $ionicLoading.show(); //options default to values in $ionicLoadingConfig\n *   };\n * });\n * ```\n */\nIonicModule\n.constant('$ionicLoadingConfig', {\n  template: '<ion-spinner></ion-spinner>'\n})\n.factory('$ionicLoading', [\n  '$ionicLoadingConfig',\n  '$ionicBody',\n  '$ionicTemplateLoader',\n  '$ionicBackdrop',\n  '$timeout',\n  '$q',\n  '$log',\n  '$compile',\n  '$ionicPlatform',\n  '$rootScope',\n  'IONIC_BACK_PRIORITY',\nfunction($ionicLoadingConfig, $ionicBody, $ionicTemplateLoader, $ionicBackdrop, $timeout, $q, $log, $compile, $ionicPlatform, $rootScope, IONIC_BACK_PRIORITY) {\n\n  var loaderInstance;\n  //default values\n  var deregisterBackAction = noop;\n  var deregisterStateListener1 = noop;\n  var deregisterStateListener2 = noop;\n  var loadingShowDelay = $q.when();\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicLoading#show\n     * @description Shows a loading indicator. If the indicator is already shown,\n     * it will set the options given and keep the indicator shown.\n     * @param {object} opts The options for the loading indicator. Available properties:\n     *  - `{string=}` `template` The html content of the indicator.\n     *  - `{string=}` `templateUrl` The url of an html template to load as the content of the indicator.\n     *  - `{object=}` `scope` The scope to be a child of. Default: creates a child of $rootScope.\n     *  - `{boolean=}` `noBackdrop` Whether to hide the backdrop. By default it will be shown.\n     *  - `{boolean=}` `hideOnStateChange` Whether to hide the loading spinner when navigating\n     *    to a new state. Default false.\n     *  - `{number=}` `delay` How many milliseconds to delay showing the indicator. By default there is no delay.\n     *  - `{number=}` `duration` How many milliseconds to wait until automatically\n     *  hiding the indicator. By default, the indicator will be shown until `.hide()` is called.\n     */\n    show: showLoader,\n    /**\n     * @ngdoc method\n     * @name $ionicLoading#hide\n     * @description Hides the loading indicator, if shown.\n     */\n    hide: hideLoader,\n    /**\n     * @private for testing\n     */\n    _getLoader: getLoader\n  };\n\n  function getLoader() {\n    if (!loaderInstance) {\n      loaderInstance = $ionicTemplateLoader.compile({\n        template: LOADING_TPL,\n        appendTo: $ionicBody.get()\n      })\n      .then(function(self) {\n        self.show = function(options) {\n          var templatePromise = options.templateUrl ?\n            $ionicTemplateLoader.load(options.templateUrl) :\n            //options.content: deprecated\n            $q.when(options.template || options.content || '');\n\n          self.scope = options.scope || self.scope;\n\n          if (!self.isShown) {\n            //options.showBackdrop: deprecated\n            self.hasBackdrop = !options.noBackdrop && options.showBackdrop !== false;\n            if (self.hasBackdrop) {\n              $ionicBackdrop.retain();\n              $ionicBackdrop.getElement().addClass('backdrop-loading');\n            }\n          }\n\n          if (options.duration) {\n            $timeout.cancel(self.durationTimeout);\n            self.durationTimeout = $timeout(\n              angular.bind(self, self.hide),\n              +options.duration\n            );\n          }\n\n          deregisterBackAction();\n          //Disable hardware back button while loading\n          deregisterBackAction = $ionicPlatform.registerBackButtonAction(\n            noop,\n            IONIC_BACK_PRIORITY.loading\n          );\n\n          templatePromise.then(function(html) {\n            if (html) {\n              var loading = self.element.children();\n              loading.html(html);\n              $compile(loading.contents())(self.scope);\n            }\n\n            //Don't show until template changes\n            if (self.isShown) {\n              self.element.addClass('visible');\n              ionic.requestAnimationFrame(function() {\n                if (self.isShown) {\n                  self.element.addClass('active');\n                  $ionicBody.addClass('loading-active');\n                }\n              });\n            }\n          });\n\n          self.isShown = true;\n        };\n        self.hide = function() {\n\n          deregisterBackAction();\n          if (self.isShown) {\n            if (self.hasBackdrop) {\n              $ionicBackdrop.release();\n              $ionicBackdrop.getElement().removeClass('backdrop-loading');\n            }\n            self.element.removeClass('active');\n            $ionicBody.removeClass('loading-active');\n            setTimeout(function() {\n              !self.isShown && self.element.removeClass('visible');\n            }, 200);\n          }\n          $timeout.cancel(self.durationTimeout);\n          self.isShown = false;\n        };\n\n        return self;\n      });\n    }\n    return loaderInstance;\n  }\n\n  function showLoader(options) {\n    options = extend({}, $ionicLoadingConfig || {}, options || {});\n    var delay = options.delay || options.showDelay || 0;\n\n    deregisterStateListener1();\n    deregisterStateListener2();\n    if (options.hideOnStateChange) {\n      deregisterStateListener1 = $rootScope.$on('$stateChangeSuccess', hideLoader);\n      deregisterStateListener2 = $rootScope.$on('$stateChangeError', hideLoader);\n    }\n\n    //If loading.show() was called previously, cancel it and show with our new options\n    $timeout.cancel(loadingShowDelay);\n    loadingShowDelay = $timeout(noop, delay);\n    loadingShowDelay.then(getLoader).then(function(loader) {\n      return loader.show(options);\n    });\n\n    return {\n      hide: function deprecatedHide() {\n        $log.error(LOADING_HIDE_DEPRECATED);\n        return hideLoader.apply(this, arguments);\n      },\n      show: function deprecatedShow() {\n        $log.error(LOADING_SHOW_DEPRECATED);\n        return showLoader.apply(this, arguments);\n      },\n      setContent: function deprecatedSetContent(content) {\n        $log.error(LOADING_SET_DEPRECATED);\n        return getLoader().then(function(loader) {\n          loader.show({ template: content });\n        });\n      }\n    };\n  }\n\n  function hideLoader() {\n    deregisterStateListener1();\n    deregisterStateListener2();\n    $timeout.cancel(loadingShowDelay);\n    getLoader().then(function(loader) {\n      loader.hide();\n    });\n  }\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicModal\n * @module ionic\n * @description\n *\n * Related: {@link ionic.controller:ionicModal ionicModal controller}.\n *\n * The Modal is a content pane that can go over the user's main view\n * temporarily.  Usually used for making a choice or editing an item.\n *\n * Put the content of the modal inside of an `<ion-modal-view>` element.\n *\n * **Notes:**\n * - A modal will broadcast 'modal.shown', 'modal.hidden', and 'modal.removed' events from its originating\n * scope, passing in itself as an event argument. Both the modal.removed and modal.hidden events are\n * called when the modal is removed.\n *\n * - This example assumes your modal is in your main index file or another template file. If it is in its own\n * template file, remove the script tags and call it by file name.\n *\n * @usage\n * ```html\n * <script id=\"my-modal.html\" type=\"text/ng-template\">\n *   <ion-modal-view>\n *     <ion-header-bar>\n *       <h1 class=\"title\">My Modal title</h1>\n *     </ion-header-bar>\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-modal-view>\n * </script>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $ionicModal) {\n *   $ionicModal.fromTemplateUrl('my-modal.html', {\n *     scope: $scope,\n *     animation: 'slide-in-up'\n *   }).then(function(modal) {\n *     $scope.modal = modal;\n *   });\n *   $scope.openModal = function() {\n *     $scope.modal.show();\n *   };\n *   $scope.closeModal = function() {\n *     $scope.modal.hide();\n *   };\n *   //Cleanup the modal when we're done with it!\n *   $scope.$on('$destroy', function() {\n *     $scope.modal.remove();\n *   });\n *   // Execute action on hide modal\n *   $scope.$on('modal.hidden', function() {\n *     // Execute action\n *   });\n *   // Execute action on remove modal\n *   $scope.$on('modal.removed', function() {\n *     // Execute action\n *   });\n * });\n * ```\n */\nIonicModule\n.factory('$ionicModal', [\n  '$rootScope',\n  '$ionicBody',\n  '$compile',\n  '$timeout',\n  '$ionicPlatform',\n  '$ionicTemplateLoader',\n  '$$q',\n  '$log',\n  '$ionicClickBlock',\n  '$window',\n  'IONIC_BACK_PRIORITY',\nfunction($rootScope, $ionicBody, $compile, $timeout, $ionicPlatform, $ionicTemplateLoader, $$q, $log, $ionicClickBlock, $window, IONIC_BACK_PRIORITY) {\n\n  /**\n   * @ngdoc controller\n   * @name ionicModal\n   * @module ionic\n   * @description\n   * Instantiated by the {@link ionic.service:$ionicModal} service.\n   *\n   * Be sure to call [remove()](#remove) when you are done with each modal\n   * to clean it up and avoid memory leaks.\n   *\n   * Note: a modal will broadcast 'modal.shown', 'modal.hidden', and 'modal.removed' events from its originating\n   * scope, passing in itself as an event argument. Note: both modal.removed and modal.hidden are\n   * called when the modal is removed.\n   */\n  var ModalView = ionic.views.Modal.inherit({\n    /**\n     * @ngdoc method\n     * @name ionicModal#initialize\n     * @description Creates a new modal controller instance.\n     * @param {object} options An options object with the following properties:\n     *  - `{object=}` `scope` The scope to be a child of.\n     *    Default: creates a child of $rootScope.\n     *  - `{string=}` `animation` The animation to show & hide with.\n     *    Default: 'slide-in-up'\n     *  - `{boolean=}` `focusFirstInput` Whether to autofocus the first input of\n     *    the modal when shown. Will only show the keyboard on iOS, to force the keyboard to show\n     *    on Android, please use the [Ionic keyboard plugin](https://github.com/driftyco/ionic-plugin-keyboard#keyboardshow).\n     *    Default: false.\n     *  - `{boolean=}` `backdropClickToClose` Whether to close the modal on clicking the backdrop.\n     *    Default: true.\n     *  - `{boolean=}` `hardwareBackButtonClose` Whether the modal can be closed using the hardware\n     *    back button on Android and similar devices.  Default: true.\n     */\n    initialize: function(opts) {\n      ionic.views.Modal.prototype.initialize.call(this, opts);\n      this.animation = opts.animation || 'slide-in-up';\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#show\n     * @description Show this modal instance.\n     * @returns {promise} A promise which is resolved when the modal is finished animating in.\n     */\n    show: function(target) {\n      var self = this;\n\n      if (self.scope.$$destroyed) {\n        $log.error('Cannot call ' + self.viewType + '.show() after remove(). Please create a new ' + self.viewType + ' instance.');\n        return $$q.when();\n      }\n\n      // on iOS, clicks will sometimes bleed through/ghost click on underlying\n      // elements\n      $ionicClickBlock.show(600);\n\n      var modalEl = jqLite(self.modalEl);\n\n      self.el.classList.remove('hide');\n      $timeout(function() {\n        if (!self._isShown) return;\n        $ionicBody.addClass(self.viewType + '-open');\n      }, 400, false);\n\n      if (!self.el.parentElement) {\n        modalEl.addClass(self.animation);\n        $ionicBody.append(self.el);\n      }\n\n      // if modal was closed while the keyboard was up, reset scroll view on\n      // next show since we can only resize it once it's visible\n      var scrollCtrl = modalEl.data('$$ionicScrollController');\n      scrollCtrl && scrollCtrl.resize();\n\n      if (target && self.positionView) {\n        self.positionView(target, modalEl);\n        // set up a listener for in case the window size changes\n\n        self._onWindowResize = function() {\n          if (self._isShown) self.positionView(target, modalEl);\n        };\n        ionic.on('resize', self._onWindowResize, window);\n      }\n\n      modalEl.addClass('ng-enter active')\n             .removeClass('ng-leave ng-leave-active');\n\n      self._isShown = true;\n      self._deregisterBackButton = $ionicPlatform.registerBackButtonAction(\n        self.hardwareBackButtonClose ? angular.bind(self, self.hide) : noop,\n        IONIC_BACK_PRIORITY.modal\n      );\n\n      ionic.views.Modal.prototype.show.call(self);\n\n      $timeout(function() {\n        if (!self._isShown) return;\n        modalEl.addClass('ng-enter-active');\n        ionic.trigger('resize');\n        self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.shown', self);\n        self.el.classList.add('active');\n        self.scope.$broadcast('$ionicHeader.align');\n      }, 20);\n\n      return $timeout(function() {\n        if (!self._isShown) return;\n        //After animating in, allow hide on backdrop click\n        self.$el.on('click', function(e) {\n          if (self.backdropClickToClose && e.target === self.el) {\n            self.hide();\n          }\n        });\n      }, 400);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#hide\n     * @description Hide this modal instance.\n     * @returns {promise} A promise which is resolved when the modal is finished animating out.\n     */\n    hide: function() {\n      var self = this;\n      var modalEl = jqLite(self.modalEl);\n\n      // on iOS, clicks will sometimes bleed through/ghost click on underlying\n      // elements\n      $ionicClickBlock.show(600);\n\n      self.el.classList.remove('active');\n      modalEl.addClass('ng-leave');\n\n      $timeout(function() {\n        if (self._isShown) return;\n        modalEl.addClass('ng-leave-active')\n               .removeClass('ng-enter ng-enter-active active');\n      }, 20, false);\n\n      self.$el.off('click');\n      self._isShown = false;\n      self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.hidden', self);\n      self._deregisterBackButton && self._deregisterBackButton();\n\n      ionic.views.Modal.prototype.hide.call(self);\n\n      // clean up event listeners\n      if (self.positionView) {\n        ionic.off('resize', self._onWindowResize, window);\n      }\n\n      return $timeout(function() {\n        $ionicBody.removeClass(self.viewType + '-open');\n        self.el.classList.add('hide');\n      }, self.hideDelay || 320);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#remove\n     * @description Remove this modal instance from the DOM and clean up.\n     * @returns {promise} A promise which is resolved when the modal is finished animating out.\n     */\n    remove: function() {\n      var self = this;\n      self.scope.$parent && self.scope.$parent.$broadcast(self.viewType + '.removed', self);\n\n      return self.hide().then(function() {\n        self.scope.$destroy();\n        self.$el.remove();\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionicModal#isShown\n     * @returns boolean Whether this modal is currently shown.\n     */\n    isShown: function() {\n      return !!this._isShown;\n    }\n  });\n\n  var createModal = function(templateString, options) {\n    // Create a new scope for the modal\n    var scope = options.scope && options.scope.$new() || $rootScope.$new(true);\n\n    options.viewType = options.viewType || 'modal';\n\n    extend(scope, {\n      $hasHeader: false,\n      $hasSubheader: false,\n      $hasFooter: false,\n      $hasSubfooter: false,\n      $hasTabs: false,\n      $hasTabsTop: false\n    });\n\n    // Compile the template\n    var element = $compile('<ion-' + options.viewType + '>' + templateString + '</ion-' + options.viewType + '>')(scope);\n\n    options.$el = element;\n    options.el = element[0];\n    options.modalEl = options.el.querySelector('.' + options.viewType);\n    var modal = new ModalView(options);\n\n    modal.scope = scope;\n\n    // If this wasn't a defined scope, we can assign the viewType to the isolated scope\n    // we created\n    if (!options.scope) {\n      scope[ options.viewType ] = modal;\n    }\n\n    return modal;\n  };\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicModal#fromTemplate\n     * @param {string} templateString The template string to use as the modal's\n     * content.\n     * @param {object} options Options to be passed {@link ionic.controller:ionicModal#initialize ionicModal#initialize} method.\n     * @returns {object} An instance of an {@link ionic.controller:ionicModal}\n     * controller.\n     */\n    fromTemplate: function(templateString, options) {\n      var modal = createModal(templateString, options || {});\n      return modal;\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicModal#fromTemplateUrl\n     * @param {string} templateUrl The url to load the template from.\n     * @param {object} options Options to be passed {@link ionic.controller:ionicModal#initialize ionicModal#initialize} method.\n     * options object.\n     * @returns {promise} A promise that will be resolved with an instance of\n     * an {@link ionic.controller:ionicModal} controller.\n     */\n    fromTemplateUrl: function(url, options, _) {\n      var cb;\n      //Deprecated: allow a callback as second parameter. Now we return a promise.\n      if (angular.isFunction(options)) {\n        cb = options;\n        options = _;\n      }\n      return $ionicTemplateLoader.load(url).then(function(templateString) {\n        var modal = createModal(templateString, options || {});\n        cb && cb(modal);\n        return modal;\n      });\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc service\n * @name $ionicNavBarDelegate\n * @module ionic\n * @description\n * Delegate for controlling the {@link ionic.directive:ionNavBar} directive.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MyCtrl\">\n *   <ion-nav-bar>\n *     <button ng-click=\"setNavTitle('banana')\">\n *       Set title to banana!\n *     </button>\n *   </ion-nav-bar>\n * </body>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicNavBarDelegate) {\n *   $scope.setNavTitle = function(title) {\n *     $ionicNavBarDelegate.title(title);\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicNavBarDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#align\n   * @description Aligns the title with the buttons in a given direction.\n   * @param {string=} direction The direction to the align the title text towards.\n   * Available: 'left', 'right', 'center'. Default: 'center'.\n   */\n  'align',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#showBackButton\n   * @description\n   * Set/get whether the {@link ionic.directive:ionNavBackButton} is shown\n   * (if it exists and there is a previous view that can be navigated to).\n   * @param {boolean=} show Whether to show the back button.\n   * @returns {boolean} Whether the back button is shown.\n   */\n  'showBackButton',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#showBar\n   * @description\n   * Set/get whether the {@link ionic.directive:ionNavBar} is shown.\n   * @param {boolean} show Whether to show the bar.\n   * @returns {boolean} Whether the bar is shown.\n   */\n  'showBar',\n  /**\n   * @ngdoc method\n   * @name $ionicNavBarDelegate#title\n   * @description\n   * Set the title for the {@link ionic.directive:ionNavBar}.\n   * @param {string} title The new title to show.\n   */\n  'title',\n\n  // DEPRECATED, as of v1.0.0-beta14 -------\n  'changeTitle',\n  'setTitle',\n  'getTitle',\n  'back',\n  'getPreviousTitle'\n  // END DEPRECATED -------\n]));\n\n\nIonicModule\n.service('$ionicNavViewDelegate', ionic.DelegateService([\n  'clearCache'\n]));\n\n\n\n/**\n * @ngdoc service\n * @name $ionicPlatform\n * @module ionic\n * @description\n * An angular abstraction of {@link ionic.utility:ionic.Platform}.\n *\n * Used to detect the current platform, as well as do things like override the\n * Android back button in PhoneGap/Cordova.\n */\nIonicModule\n.constant('IONIC_BACK_PRIORITY', {\n  view: 100,\n  sideMenu: 150,\n  modal: 200,\n  actionSheet: 300,\n  popup: 400,\n  loading: 500\n})\n.provider('$ionicPlatform', function() {\n  return {\n    $get: ['$q', function($q) {\n      var self = {\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#onHardwareBackButton\n         * @description\n         * Some platforms have a hardware back button, so this is one way to\n         * bind to it.\n         * @param {function} callback the callback to trigger when this event occurs\n         */\n        onHardwareBackButton: function(cb) {\n          ionic.Platform.ready(function() {\n            document.addEventListener('backbutton', cb, false);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#offHardwareBackButton\n         * @description\n         * Remove an event listener for the backbutton.\n         * @param {function} callback The listener function that was\n         * originally bound.\n         */\n        offHardwareBackButton: function(fn) {\n          ionic.Platform.ready(function() {\n            document.removeEventListener('backbutton', fn);\n          });\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#registerBackButtonAction\n         * @description\n         * Register a hardware back button action. Only one action will execute\n         * when the back button is clicked, so this method decides which of\n         * the registered back button actions has the highest priority.\n         *\n         * For example, if an actionsheet is showing, the back button should\n         * close the actionsheet, but it should not also go back a page view\n         * or close a modal which may be open.\n         *\n         * The priorities for the existing back button hooks are as follows:\n         *   Return to previous view = 100\n         *   Close side menu = 150\n         *   Dismiss modal = 200\n         *   Close action sheet = 300\n         *   Dismiss popup = 400\n         *   Dismiss loading overlay = 500\n         *\n         * Your back button action will override each of the above actions\n         * whose priority is less than the priority you provide. For example,\n         * an action assigned a priority of 101 will override the 'return to\n         * previous view' action, but not any of the other actions.\n         *\n         * @param {function} callback Called when the back button is pressed,\n         * if this listener is the highest priority.\n         * @param {number} priority Only the highest priority will execute.\n         * @param {*=} actionId The id to assign this action. Default: a\n         * random unique id.\n         * @returns {function} A function that, when called, will deregister\n         * this backButtonAction.\n         */\n        $backButtonActions: {},\n        registerBackButtonAction: function(fn, priority, actionId) {\n\n          if (!self._hasBackButtonHandler) {\n            // add a back button listener if one hasn't been setup yet\n            self.$backButtonActions = {};\n            self.onHardwareBackButton(self.hardwareBackButtonClick);\n            self._hasBackButtonHandler = true;\n          }\n\n          var action = {\n            id: (actionId ? actionId : ionic.Utils.nextUid()),\n            priority: (priority ? priority : 0),\n            fn: fn\n          };\n          self.$backButtonActions[action.id] = action;\n\n          // return a function to de-register this back button action\n          return function() {\n            delete self.$backButtonActions[action.id];\n          };\n        },\n\n        /**\n         * @private\n         */\n        hardwareBackButtonClick: function(e) {\n          // loop through all the registered back button actions\n          // and only run the last one of the highest priority\n          var priorityAction, actionId;\n          for (actionId in self.$backButtonActions) {\n            if (!priorityAction || self.$backButtonActions[actionId].priority >= priorityAction.priority) {\n              priorityAction = self.$backButtonActions[actionId];\n            }\n          }\n          if (priorityAction) {\n            priorityAction.fn(e);\n            return priorityAction;\n          }\n        },\n\n        is: function(type) {\n          return ionic.Platform.is(type);\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#on\n         * @description\n         * Add Cordova event listeners, such as `pause`, `resume`, `volumedownbutton`, `batterylow`,\n         * `offline`, etc. More information about available event types can be found in\n         * [Cordova's event documentation](https://cordova.apache.org/docs/en/edge/cordova_events_events.md.html#Events).\n         * @param {string} type Cordova [event type](https://cordova.apache.org/docs/en/edge/cordova_events_events.md.html#Events).\n         * @param {function} callback Called when the Cordova event is fired.\n         * @returns {function} Returns a deregistration function to remove the event listener.\n         */\n        on: function(type, cb) {\n          ionic.Platform.ready(function() {\n            document.addEventListener(type, cb, false);\n          });\n          return function() {\n            ionic.Platform.ready(function() {\n              document.removeEventListener(type, cb);\n            });\n          };\n        },\n\n        /**\n         * @ngdoc method\n         * @name $ionicPlatform#ready\n         * @description\n         * Trigger a callback once the device is ready,\n         * or immediately if the device is already ready.\n         * @param {function=} callback The function to call.\n         * @returns {promise} A promise which is resolved when the device is ready.\n         */\n        ready: function(cb) {\n          var q = $q.defer();\n\n          ionic.Platform.ready(function() {\n            q.resolve();\n            cb && cb();\n          });\n\n          return q.promise;\n        }\n      };\n      return self;\n    }]\n  };\n\n});\n\n/**\n * @ngdoc service\n * @name $ionicPopover\n * @module ionic\n * @description\n *\n * Related: {@link ionic.controller:ionicPopover ionicPopover controller}.\n *\n * The Popover is a view that floats above an app’s content. Popovers provide an\n * easy way to present or gather information from the user and are\n * commonly used in the following situations:\n *\n * - Show more info about the current view\n * - Select a commonly used tool or configuration\n * - Present a list of actions to perform inside one of your views\n *\n * Put the content of the popover inside of an `<ion-popover-view>` element.\n *\n * @usage\n * ```html\n * <p>\n *   <button ng-click=\"openPopover($event)\">Open Popover</button>\n * </p>\n *\n * <script id=\"my-popover.html\" type=\"text/ng-template\">\n *   <ion-popover-view>\n *     <ion-header-bar>\n *       <h1 class=\"title\">My Popover Title</h1>\n *     </ion-header-bar>\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-popover-view>\n * </script>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $ionicPopover) {\n *\n *   // .fromTemplate() method\n *   var template = '<ion-popover-view><ion-header-bar> <h1 class=\"title\">My Popover Title</h1> </ion-header-bar> <ion-content> Hello! </ion-content></ion-popover-view>';\n *\n *   $scope.popover = $ionicPopover.fromTemplate(template, {\n *     scope: $scope\n *   });\n *\n *   // .fromTemplateUrl() method\n *   $ionicPopover.fromTemplateUrl('my-popover.html', {\n *     scope: $scope\n *   }).then(function(popover) {\n *     $scope.popover = popover;\n *   });\n *\n *\n *   $scope.openPopover = function($event) {\n *     $scope.popover.show($event);\n *   };\n *   $scope.closePopover = function() {\n *     $scope.popover.hide();\n *   };\n *   //Cleanup the popover when we're done with it!\n *   $scope.$on('$destroy', function() {\n *     $scope.popover.remove();\n *   });\n *   // Execute action on hide popover\n *   $scope.$on('popover.hidden', function() {\n *     // Execute action\n *   });\n *   // Execute action on remove popover\n *   $scope.$on('popover.removed', function() {\n *     // Execute action\n *   });\n * });\n * ```\n */\n\n\nIonicModule\n.factory('$ionicPopover', ['$ionicModal', '$ionicPosition', '$document', '$window',\nfunction($ionicModal, $ionicPosition, $document, $window) {\n\n  var POPOVER_BODY_PADDING = 6;\n\n  var POPOVER_OPTIONS = {\n    viewType: 'popover',\n    hideDelay: 1,\n    animation: 'none',\n    positionView: positionView\n  };\n\n  function positionView(target, popoverEle) {\n    var targetEle = jqLite(target.target || target);\n    var buttonOffset = $ionicPosition.offset(targetEle);\n    var popoverWidth = popoverEle.prop('offsetWidth');\n    var popoverHeight = popoverEle.prop('offsetHeight');\n    // Use innerWidth and innerHeight, because clientWidth and clientHeight\n    // doesn't work consistently for body on all platforms\n    var bodyWidth = $window.innerWidth;\n    var bodyHeight = $window.innerHeight;\n\n    var popoverCSS = {\n      left: buttonOffset.left + buttonOffset.width / 2 - popoverWidth / 2\n    };\n    var arrowEle = jqLite(popoverEle[0].querySelector('.popover-arrow'));\n\n    if (popoverCSS.left < POPOVER_BODY_PADDING) {\n      popoverCSS.left = POPOVER_BODY_PADDING;\n    } else if (popoverCSS.left + popoverWidth + POPOVER_BODY_PADDING > bodyWidth) {\n      popoverCSS.left = bodyWidth - popoverWidth - POPOVER_BODY_PADDING;\n    }\n\n    // If the popover when popped down stretches past bottom of screen,\n    // make it pop up if there's room above\n    if (buttonOffset.top + buttonOffset.height + popoverHeight > bodyHeight &&\n        buttonOffset.top - popoverHeight > 0) {\n      popoverCSS.top = buttonOffset.top - popoverHeight;\n      popoverEle.addClass('popover-bottom');\n    } else {\n      popoverCSS.top = buttonOffset.top + buttonOffset.height;\n      popoverEle.removeClass('popover-bottom');\n    }\n\n    arrowEle.css({\n      left: buttonOffset.left + buttonOffset.width / 2 -\n        arrowEle.prop('offsetWidth') / 2 - popoverCSS.left + 'px'\n    });\n\n    popoverEle.css({\n      top: popoverCSS.top + 'px',\n      left: popoverCSS.left + 'px',\n      marginLeft: '0',\n      opacity: '1'\n    });\n\n  }\n\n  /**\n   * @ngdoc controller\n   * @name ionicPopover\n   * @module ionic\n   * @description\n   * Instantiated by the {@link ionic.service:$ionicPopover} service.\n   *\n   * Be sure to call [remove()](#remove) when you are done with each popover\n   * to clean it up and avoid memory leaks.\n   *\n   * Note: a popover will broadcast 'popover.shown', 'popover.hidden', and 'popover.removed' events from its originating\n   * scope, passing in itself as an event argument. Both the popover.removed and popover.hidden events are\n   * called when the popover is removed.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#initialize\n   * @description Creates a new popover controller instance.\n   * @param {object} options An options object with the following properties:\n   *  - `{object=}` `scope` The scope to be a child of.\n   *    Default: creates a child of $rootScope.\n   *  - `{boolean=}` `focusFirstInput` Whether to autofocus the first input of\n   *    the popover when shown.  Default: false.\n   *  - `{boolean=}` `backdropClickToClose` Whether to close the popover on clicking the backdrop.\n   *    Default: true.\n   *  - `{boolean=}` `hardwareBackButtonClose` Whether the popover can be closed using the hardware\n   *    back button on Android and similar devices.  Default: true.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#show\n   * @description Show this popover instance.\n   * @param {$event} $event The $event or target element which the popover should align\n   * itself next to.\n   * @returns {promise} A promise which is resolved when the popover is finished animating in.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#hide\n   * @description Hide this popover instance.\n   * @returns {promise} A promise which is resolved when the popover is finished animating out.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#remove\n   * @description Remove this popover instance from the DOM and clean up.\n   * @returns {promise} A promise which is resolved when the popover is finished animating out.\n   */\n\n  /**\n   * @ngdoc method\n   * @name ionicPopover#isShown\n   * @returns boolean Whether this popover is currently shown.\n   */\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicPopover#fromTemplate\n     * @param {string} templateString The template string to use as the popovers's\n     * content.\n     * @param {object} options Options to be passed to the initialize method.\n     * @returns {object} An instance of an {@link ionic.controller:ionicPopover}\n     * controller (ionicPopover is built on top of $ionicPopover).\n     */\n    fromTemplate: function(templateString, options) {\n      return $ionicModal.fromTemplate(templateString, ionic.Utils.extend(POPOVER_OPTIONS, options || {}));\n    },\n    /**\n     * @ngdoc method\n     * @name $ionicPopover#fromTemplateUrl\n     * @param {string} templateUrl The url to load the template from.\n     * @param {object} options Options to be passed to the initialize method.\n     * @returns {promise} A promise that will be resolved with an instance of\n     * an {@link ionic.controller:ionicPopover} controller (ionicPopover is built on top of $ionicPopover).\n     */\n    fromTemplateUrl: function(url, options) {\n      return $ionicModal.fromTemplateUrl(url, ionic.Utils.extend(POPOVER_OPTIONS, options || {}));\n    }\n  };\n\n}]);\n\n\nvar POPUP_TPL =\n  '<div class=\"popup-container\" ng-class=\"cssClass\">' +\n    '<div class=\"popup\">' +\n      '<div class=\"popup-head\">' +\n        '<h3 class=\"popup-title\" ng-bind-html=\"title\"></h3>' +\n        '<h5 class=\"popup-sub-title\" ng-bind-html=\"subTitle\" ng-if=\"subTitle\"></h5>' +\n      '</div>' +\n      '<div class=\"popup-body\">' +\n      '</div>' +\n      '<div class=\"popup-buttons\" ng-show=\"buttons.length\">' +\n        '<button ng-repeat=\"button in buttons\" ng-click=\"$buttonTapped(button, $event)\" class=\"button\" ng-class=\"button.type || \\'button-default\\'\" ng-bind-html=\"button.text\"></button>' +\n      '</div>' +\n    '</div>' +\n  '</div>';\n\n/**\n * @ngdoc service\n * @name $ionicPopup\n * @module ionic\n * @restrict E\n * @codepen zkmhJ\n * @description\n *\n * The Ionic Popup service allows programmatically creating and showing popup\n * windows that require the user to respond in order to continue.\n *\n * The popup system has support for more flexible versions of the built in `alert()`, `prompt()`,\n * and `confirm()` functions that users are used to, in addition to allowing popups with completely\n * custom content and look.\n *\n * An input can be given an `autofocus` attribute so it automatically receives focus when\n * the popup first shows. However, depending on certain use-cases this can cause issues with\n * the tap/click system, which is why Ionic prefers using the `autofocus` attribute as\n * an opt-in feature and not the default.\n *\n * @usage\n * A few basic examples, see below for details about all of the options available.\n *\n * ```js\n *angular.module('mySuperApp', ['ionic'])\n *.controller('PopupCtrl',function($scope, $ionicPopup, $timeout) {\n *\n * // Triggered on a button click, or some other target\n * $scope.showPopup = function() {\n *   $scope.data = {}\n *\n *   // An elaborate, custom popup\n *   var myPopup = $ionicPopup.show({\n *     template: '<input type=\"password\" ng-model=\"data.wifi\">',\n *     title: 'Enter Wi-Fi Password',\n *     subTitle: 'Please use normal things',\n *     scope: $scope,\n *     buttons: [\n *       { text: 'Cancel' },\n *       {\n *         text: '<b>Save</b>',\n *         type: 'button-positive',\n *         onTap: function(e) {\n *           if (!$scope.data.wifi) {\n *             //don't allow the user to close unless he enters wifi password\n *             e.preventDefault();\n *           } else {\n *             return $scope.data.wifi;\n *           }\n *         }\n *       }\n *     ]\n *   });\n *   myPopup.then(function(res) {\n *     console.log('Tapped!', res);\n *   });\n *   $timeout(function() {\n *      myPopup.close(); //close the popup after 3 seconds for some reason\n *   }, 3000);\n *  };\n *  // A confirm dialog\n *  $scope.showConfirm = function() {\n *    var confirmPopup = $ionicPopup.confirm({\n *      title: 'Consume Ice Cream',\n *      template: 'Are you sure you want to eat this ice cream?'\n *    });\n *    confirmPopup.then(function(res) {\n *      if(res) {\n *        console.log('You are sure');\n *      } else {\n *        console.log('You are not sure');\n *      }\n *    });\n *  };\n *\n *  // An alert dialog\n *  $scope.showAlert = function() {\n *    var alertPopup = $ionicPopup.alert({\n *      title: 'Don\\'t eat that!',\n *      template: 'It might taste good'\n *    });\n *    alertPopup.then(function(res) {\n *      console.log('Thank you for not eating my delicious ice cream cone');\n *    });\n *  };\n *});\n *```\n */\n\nIonicModule\n.factory('$ionicPopup', [\n  '$ionicTemplateLoader',\n  '$ionicBackdrop',\n  '$q',\n  '$timeout',\n  '$rootScope',\n  '$ionicBody',\n  '$compile',\n  '$ionicPlatform',\n  'IONIC_BACK_PRIORITY',\nfunction($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicBody, $compile, $ionicPlatform, IONIC_BACK_PRIORITY) {\n  //TODO allow this to be configured\n  var config = {\n    stackPushDelay: 75\n  };\n  var popupStack = [];\n\n  var $ionicPopup = {\n    /**\n     * @ngdoc method\n     * @description\n     * Show a complex popup. This is the master show function for all popups.\n     *\n     * A complex popup has a `buttons` array, with each button having a `text` and `type`\n     * field, in addition to an `onTap` function.  The `onTap` function, called when\n     * the corresponding button on the popup is tapped, will by default close the popup\n     * and resolve the popup promise with its return value.  If you wish to prevent the\n     * default and keep the popup open on button tap, call `event.preventDefault()` on the\n     * passed in tap event.  Details below.\n     *\n     * @name $ionicPopup#show\n     * @param {object} options The options for the new popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   scope: null, // Scope (optional). A scope to link to the popup content.\n     *   buttons: [{ // Array[Object] (optional). Buttons to place in the popup footer.\n     *     text: 'Cancel',\n     *     type: 'button-default',\n     *     onTap: function(e) {\n     *       // e.preventDefault() will stop the popup from closing when tapped.\n     *       e.preventDefault();\n     *     }\n     *   }, {\n     *     text: 'OK',\n     *     type: 'button-positive',\n     *     onTap: function(e) {\n     *       // Returning a value will cause the promise to resolve with the given value.\n     *       return scope.data.response;\n     *     }\n     *   }]\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has an additional\n     * `close` function, which can be used to programmatically close the popup.\n     */\n    show: showPopup,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#alert\n     * @description Show a simple alert popup with a message and one button that the user can\n     * tap to close the popup.\n     *\n     * @param {object} options The options for showing the alert, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   okText: '', // String (default: 'OK'). The text of the OK button.\n     *   okType: '', // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    alert: showAlert,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#confirm\n     * @description\n     * Show a simple confirm popup with a Cancel and OK button.\n     *\n     * Resolves the promise with true if the user presses the OK button, and false if the\n     * user presses the Cancel button.\n     *\n     * @param {object} options The options for showing the confirm popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   cancelText: '', // String (default: 'Cancel'). The text of the Cancel button.\n     *   cancelType: '', // String (default: 'button-default'). The type of the Cancel button.\n     *   okText: '', // String (default: 'OK'). The text of the OK button.\n     *   okType: '', // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    confirm: showConfirm,\n\n    /**\n     * @ngdoc method\n     * @name $ionicPopup#prompt\n     * @description Show a simple prompt popup, which has an input, OK button, and Cancel button.\n     * Resolves the promise with the value of the input if the user presses OK, and with undefined\n     * if the user presses Cancel.\n     *\n     * ```javascript\n     *  $ionicPopup.prompt({\n     *    title: 'Password Check',\n     *    template: 'Enter your secret password',\n     *    inputType: 'password',\n     *    inputPlaceholder: 'Your password'\n     *  }).then(function(res) {\n     *    console.log('Your password is', res);\n     *  });\n     * ```\n     * @param {object} options The options for showing the prompt popup, of the form:\n     *\n     * ```\n     * {\n     *   title: '', // String. The title of the popup.\n     *   cssClass: '', // String, The custom CSS class name\n     *   subTitle: '', // String (optional). The sub-title of the popup.\n     *   template: '', // String (optional). The html template to place in the popup body.\n     *   templateUrl: '', // String (optional). The URL of an html template to place in the popup   body.\n     *   inputType: // String (default: 'text'). The type of input to use\n     *   inputPlaceholder: // String (default: ''). A placeholder to use for the input.\n     *   cancelText: // String (default: 'Cancel'. The text of the Cancel button.\n     *   cancelType: // String (default: 'button-default'). The type of the Cancel button.\n     *   okText: // String (default: 'OK'). The text of the OK button.\n     *   okType: // String (default: 'button-positive'). The type of the OK button.\n     * }\n     * ```\n     *\n     * @returns {object} A promise which is resolved when the popup is closed. Has one additional\n     * function `close`, which can be called with any value to programmatically close the popup\n     * with the given value.\n     */\n    prompt: showPrompt,\n    /**\n     * @private for testing\n     */\n    _createPopup: createPopup,\n    _popupStack: popupStack\n  };\n\n  return $ionicPopup;\n\n  function createPopup(options) {\n    options = extend({\n      scope: null,\n      title: '',\n      buttons: []\n    }, options || {});\n\n    var self = {};\n    self.scope = (options.scope || $rootScope).$new();\n    self.element = jqLite(POPUP_TPL);\n    self.responseDeferred = $q.defer();\n\n    $ionicBody.get().appendChild(self.element[0]);\n    $compile(self.element)(self.scope);\n\n    extend(self.scope, {\n      title: options.title,\n      buttons: options.buttons,\n      subTitle: options.subTitle,\n      cssClass: options.cssClass,\n      $buttonTapped: function(button, event) {\n        var result = (button.onTap || noop)(event);\n        event = event.originalEvent || event; //jquery events\n\n        if (!event.defaultPrevented) {\n          self.responseDeferred.resolve(result);\n        }\n      }\n    });\n\n    $q.when(\n      options.templateUrl ?\n      $ionicTemplateLoader.load(options.templateUrl) :\n        (options.template || options.content || '')\n    ).then(function(template) {\n      var popupBody = jqLite(self.element[0].querySelector('.popup-body'));\n      if (template) {\n        popupBody.html(template);\n        $compile(popupBody.contents())(self.scope);\n      } else {\n        popupBody.remove();\n      }\n    });\n\n    self.show = function() {\n      if (self.isShown || self.removed) return;\n\n      self.isShown = true;\n      ionic.requestAnimationFrame(function() {\n        //if hidden while waiting for raf, don't show\n        if (!self.isShown) return;\n\n        self.element.removeClass('popup-hidden');\n        self.element.addClass('popup-showing active');\n        focusInput(self.element);\n      });\n    };\n\n    self.hide = function(callback) {\n      callback = callback || noop;\n      if (!self.isShown) return callback();\n\n      self.isShown = false;\n      self.element.removeClass('active');\n      self.element.addClass('popup-hidden');\n      $timeout(callback, 250, false);\n    };\n\n    self.remove = function() {\n      if (self.removed) return;\n\n      self.hide(function() {\n        self.element.remove();\n        self.scope.$destroy();\n      });\n\n      self.removed = true;\n    };\n\n    return self;\n  }\n\n  function onHardwareBackButton() {\n    var last = popupStack[popupStack.length - 1];\n    last && last.responseDeferred.resolve();\n  }\n\n  function showPopup(options) {\n    var popup = $ionicPopup._createPopup(options);\n    var showDelay = 0;\n\n    if (popupStack.length > 0) {\n      popupStack[popupStack.length - 1].hide();\n      showDelay = config.stackPushDelay;\n    } else {\n      //Add popup-open & backdrop if this is first popup\n      $ionicBody.addClass('popup-open');\n      $ionicBackdrop.retain();\n      //only show the backdrop on the first popup\n      $ionicPopup._backButtonActionDone = $ionicPlatform.registerBackButtonAction(\n        onHardwareBackButton,\n        IONIC_BACK_PRIORITY.popup\n      );\n    }\n\n    // Expose a 'close' method on the returned promise\n    popup.responseDeferred.promise.close = function popupClose(result) {\n      if (!popup.removed) popup.responseDeferred.resolve(result);\n    };\n    //DEPRECATED: notify the promise with an object with a close method\n    popup.responseDeferred.notify({ close: popup.responseDeferred.close });\n\n    doShow();\n\n    return popup.responseDeferred.promise;\n\n    function doShow() {\n      popupStack.push(popup);\n      $timeout(popup.show, showDelay, false);\n\n      popup.responseDeferred.promise.then(function(result) {\n        var index = popupStack.indexOf(popup);\n        if (index !== -1) {\n          popupStack.splice(index, 1);\n        }\n\n        if (popupStack.length > 0) {\n          popupStack[popupStack.length - 1].show();\n        } else {\n          $ionicBackdrop.release();\n          //Remove popup-open & backdrop if this is last popup\n          $timeout(function() {\n            // wait to remove this due to a 300ms delay native\n            // click which would trigging whatever was underneath this\n            if (!popupStack.length) {\n              $ionicBody.removeClass('popup-open');\n            }\n          }, 400, false);\n          ($ionicPopup._backButtonActionDone || noop)();\n        }\n\n        popup.remove();\n\n        return result;\n      });\n\n    }\n\n  }\n\n  function focusInput(element) {\n    var focusOn = element[0].querySelector('[autofocus]');\n    if (focusOn) {\n      focusOn.focus();\n    }\n  }\n\n  function showAlert(opts) {\n    return showPopup(extend({\n      buttons: [{\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() {\n          return true;\n        }\n      }]\n    }, opts || {}));\n  }\n\n  function showConfirm(opts) {\n    return showPopup(extend({\n      buttons: [{\n        text: opts.cancelText || 'Cancel',\n        type: opts.cancelType || 'button-default',\n        onTap: function() { return false; }\n      }, {\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() { return true; }\n      }]\n    }, opts || {}));\n  }\n\n  function showPrompt(opts) {\n    var scope = $rootScope.$new(true);\n    scope.data = {};\n    var text = '';\n    if (opts.template && /<[a-z][\\s\\S]*>/i.test(opts.template) === false) {\n      text = '<span>' + opts.template + '</span>';\n      delete opts.template;\n    }\n    return showPopup(extend({\n      template: text + '<input ng-model=\"data.response\" type=\"' + (opts.inputType || 'text') +\n        '\" placeholder=\"' + (opts.inputPlaceholder || '') + '\">',\n      scope: scope,\n      buttons: [{\n        text: opts.cancelText || 'Cancel',\n        type: opts.cancelType || 'button-default',\n        onTap: function() {}\n      }, {\n        text: opts.okText || 'OK',\n        type: opts.okType || 'button-positive',\n        onTap: function() {\n          return scope.data.response || '';\n        }\n      }]\n    }, opts || {}));\n  }\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicPosition\n * @module ionic\n * @description\n * A set of utility methods that can be use to retrieve position of DOM elements.\n * It is meant to be used where we need to absolute-position DOM elements in\n * relation to other, existing elements (this is the case for tooltips, popovers, etc.).\n *\n * Adapted from [AngularUI Bootstrap](https://github.com/angular-ui/bootstrap/blob/master/src/position/position.js),\n * ([license](https://github.com/angular-ui/bootstrap/blob/master/LICENSE))\n */\nIonicModule\n.factory('$ionicPosition', ['$document', '$window', function($document, $window) {\n\n  function getStyle(el, cssprop) {\n    if (el.currentStyle) { //IE\n      return el.currentStyle[cssprop];\n    } else if ($window.getComputedStyle) {\n      return $window.getComputedStyle(el)[cssprop];\n    }\n    // finally try and get inline style\n    return el.style[cssprop];\n  }\n\n  /**\n   * Checks if a given element is statically positioned\n   * @param element - raw DOM element\n   */\n  function isStaticPositioned(element) {\n    return (getStyle(element, 'position') || 'static') === 'static';\n  }\n\n  /**\n   * returns the closest, non-statically positioned parentOffset of a given element\n   * @param element\n   */\n  var parentOffsetEl = function(element) {\n    var docDomEl = $document[0];\n    var offsetParent = element.offsetParent || docDomEl;\n    while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent)) {\n      offsetParent = offsetParent.offsetParent;\n    }\n    return offsetParent || docDomEl;\n  };\n\n  return {\n    /**\n     * @ngdoc method\n     * @name $ionicPosition#position\n     * @description Get the current coordinates of the element, relative to the offset parent.\n     * Read-only equivalent of [jQuery's position function](http://api.jquery.com/position/).\n     * @param {element} element The element to get the position of.\n     * @returns {object} Returns an object containing the properties top, left, width and height.\n     */\n    position: function(element) {\n      var elBCR = this.offset(element);\n      var offsetParentBCR = { top: 0, left: 0 };\n      var offsetParentEl = parentOffsetEl(element[0]);\n      if (offsetParentEl != $document[0]) {\n        offsetParentBCR = this.offset(jqLite(offsetParentEl));\n        offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;\n        offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;\n      }\n\n      var boundingClientRect = element[0].getBoundingClientRect();\n      return {\n        width: boundingClientRect.width || element.prop('offsetWidth'),\n        height: boundingClientRect.height || element.prop('offsetHeight'),\n        top: elBCR.top - offsetParentBCR.top,\n        left: elBCR.left - offsetParentBCR.left\n      };\n    },\n\n    /**\n     * @ngdoc method\n     * @name $ionicPosition#offset\n     * @description Get the current coordinates of the element, relative to the document.\n     * Read-only equivalent of [jQuery's offset function](http://api.jquery.com/offset/).\n     * @param {element} element The element to get the offset of.\n     * @returns {object} Returns an object containing the properties top, left, width and height.\n     */\n    offset: function(element) {\n      var boundingClientRect = element[0].getBoundingClientRect();\n      return {\n        width: boundingClientRect.width || element.prop('offsetWidth'),\n        height: boundingClientRect.height || element.prop('offsetHeight'),\n        top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop),\n        left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)\n      };\n    }\n\n  };\n}]);\n\n\n/**\n * @ngdoc service\n * @name $ionicScrollDelegate\n * @module ionic\n * @description\n * Delegate for controlling scrollViews (created by\n * {@link ionic.directive:ionContent} and\n * {@link ionic.directive:ionScroll} directives).\n *\n * Methods called directly on the $ionicScrollDelegate service will control all scroll\n * views.  Use the {@link ionic.service:$ionicScrollDelegate#$getByHandle $getByHandle}\n * method to control specific scrollViews.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-content>\n *     <button ng-click=\"scrollTop()\">Scroll to Top!</button>\n *   </ion-content>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicScrollDelegate) {\n *   $scope.scrollTop = function() {\n *     $ionicScrollDelegate.scrollTop();\n *   };\n * }\n * ```\n *\n * Example of advanced usage, with two scroll areas using `delegate-handle`\n * for fine control.\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-content delegate-handle=\"mainScroll\">\n *     <button ng-click=\"scrollMainToTop()\">\n *       Scroll content to top!\n *     </button>\n *     <ion-scroll delegate-handle=\"small\" style=\"height: 100px;\">\n *       <button ng-click=\"scrollSmallToTop()\">\n *         Scroll small area to top!\n *       </button>\n *     </ion-scroll>\n *   </ion-content>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicScrollDelegate) {\n *   $scope.scrollMainToTop = function() {\n *     $ionicScrollDelegate.$getByHandle('mainScroll').scrollTop();\n *   };\n *   $scope.scrollSmallToTop = function() {\n *     $ionicScrollDelegate.$getByHandle('small').scrollTop();\n *   };\n * }\n * ```\n */\nIonicModule\n.service('$ionicScrollDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#resize\n   * @description Tell the scrollView to recalculate the size of its container.\n   */\n  'resize',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollTop\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollTop',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollBottom\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollBottom',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollTo\n   * @param {number} left The x-value to scroll to.\n   * @param {number} top The y-value to scroll to.\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollTo',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#scrollBy\n   * @param {number} left The x-offset to scroll by.\n   * @param {number} top The y-offset to scroll by.\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'scrollBy',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#zoomTo\n   * @param {number} level Level to zoom to.\n   * @param {boolean=} animate Whether to animate the zoom.\n   * @param {number=} originLeft Zoom in at given left coordinate.\n   * @param {number=} originTop Zoom in at given top coordinate.\n   */\n  'zoomTo',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#zoomBy\n   * @param {number} factor The factor to zoom by.\n   * @param {boolean=} animate Whether to animate the zoom.\n   * @param {number=} originLeft Zoom in at given left coordinate.\n   * @param {number=} originTop Zoom in at given top coordinate.\n   */\n  'zoomBy',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#getScrollPosition\n   * @returns {object} The scroll position of this view, with the following properties:\n   *  - `{number}` `left` The distance the user has scrolled from the left (starts at 0).\n   *  - `{number}` `top` The distance the user has scrolled from the top (starts at 0).\n   */\n  'getScrollPosition',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#anchorScroll\n   * @description Tell the scrollView to scroll to the element with an id\n   * matching window.location.hash.\n   *\n   * If no matching element is found, it will scroll to top.\n   *\n   * @param {boolean=} shouldAnimate Whether the scroll should animate.\n   */\n  'anchorScroll',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#freezeScroll\n   * @description Does not allow this scroll view to scroll either x or y.\n   * @param {boolean=} shouldFreeze Should this scroll view be prevented from scrolling or not.\n   * @returns {object} If the scroll view is being prevented from scrolling or not.\n   */\n  'freezeScroll',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#freezeAllScrolls\n   * @description Does not allow any of the app's scroll views to scroll either x or y.\n   * @param {boolean=} shouldFreeze Should all app scrolls be prevented from scrolling or not.\n   */\n  'freezeAllScrolls',\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#getScrollView\n   * @returns {object} The scrollView associated with this delegate.\n   */\n  'getScrollView'\n  /**\n   * @ngdoc method\n   * @name $ionicScrollDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * scrollViews with `delegate-handle` matching the given handle.\n   *\n   * Example: `$ionicScrollDelegate.$getByHandle('my-handle').scrollTop();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicSideMenuDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionSideMenus} directive.\n *\n * Methods called directly on the $ionicSideMenuDelegate service will control all side\n * menus.  Use the {@link ionic.service:$ionicSideMenuDelegate#$getByHandle $getByHandle}\n * method to control specific ionSideMenus instances.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MainCtrl\">\n *   <ion-side-menus>\n *     <ion-side-menu-content>\n *       Content!\n *       <button ng-click=\"toggleLeftSideMenu()\">\n *         Toggle Left Side Menu\n *       </button>\n *     </ion-side-menu-content>\n *     <ion-side-menu side=\"left\">\n *       Left Menu!\n *     <ion-side-menu>\n *   </ion-side-menus>\n * </body>\n * ```\n * ```js\n * function MainCtrl($scope, $ionicSideMenuDelegate) {\n *   $scope.toggleLeftSideMenu = function() {\n *     $ionicSideMenuDelegate.toggleLeft();\n *   };\n * }\n * ```\n */\nIonicModule\n.service('$ionicSideMenuDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#toggleLeft\n   * @description Toggle the left side menu (if it exists).\n   * @param {boolean=} isOpen Whether to open or close the menu.\n   * Default: Toggles the menu.\n   */\n  'toggleLeft',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#toggleRight\n   * @description Toggle the right side menu (if it exists).\n   * @param {boolean=} isOpen Whether to open or close the menu.\n   * Default: Toggles the menu.\n   */\n  'toggleRight',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#getOpenRatio\n   * @description Gets the ratio of open amount over menu width. For example, a\n   * menu of width 100 that is opened by 50 pixels is 50% opened, and would return\n   * a ratio of 0.5.\n   *\n   * @returns {float} 0 if nothing is open, between 0 and 1 if left menu is\n   * opened/opening, and between 0 and -1 if right menu is opened/opening.\n   */\n  'getOpenRatio',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpen\n   * @returns {boolean} Whether either the left or right menu is currently opened.\n   */\n  'isOpen',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpenLeft\n   * @returns {boolean} Whether the left menu is currently opened.\n   */\n  'isOpenLeft',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#isOpenRight\n   * @returns {boolean} Whether the right menu is currently opened.\n   */\n  'isOpenRight',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#canDragContent\n   * @param {boolean=} canDrag Set whether the content can or cannot be dragged to open\n   * side menus.\n   * @returns {boolean} Whether the content can be dragged to open side menus.\n   */\n  'canDragContent',\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#edgeDragThreshold\n   * @param {boolean|number=} value Set whether the content drag can only start if it is below a certain threshold distance from the edge of the screen. Accepts three different values:\n   *  - If a non-zero number is given, that many pixels is used as the maximum allowed distance from the edge that starts dragging the side menu.\n   *  - If true is given, the default number of pixels (25) is used as the maximum allowed distance.\n   *  - If false or 0 is given, the edge drag threshold is disabled, and dragging from anywhere on the content is allowed.\n   * @returns {boolean} Whether the drag can start only from within the edge of screen threshold.\n   */\n  'edgeDragThreshold'\n  /**\n   * @ngdoc method\n   * @name $ionicSideMenuDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionSideMenus} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicSideMenuDelegate.$getByHandle('my-handle').toggleLeft();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicSlideBoxDelegate\n * @module ionic\n * @description\n * Delegate that controls the {@link ionic.directive:ionSlideBox} directive.\n *\n * Methods called directly on the $ionicSlideBoxDelegate service will control all slide boxes.  Use the {@link ionic.service:$ionicSlideBoxDelegate#$getByHandle $getByHandle}\n * method to control specific slide box instances.\n *\n * @usage\n *\n * ```html\n * <ion-view>\n *   <ion-slide-box>\n *     <ion-slide>\n *       <div class=\"box blue\">\n *         <button ng-click=\"nextSlide()\">Next slide!</button>\n *       </div>\n *     </ion-slide>\n *     <ion-slide>\n *       <div class=\"box red\">\n *         Slide 2!\n *       </div>\n *     </ion-slide>\n *   </ion-slide-box>\n * </ion-view>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicSlideBoxDelegate) {\n *   $scope.nextSlide = function() {\n *     $ionicSlideBoxDelegate.next();\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicSlideBoxDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#update\n   * @description\n   * Update the slidebox (for example if using Angular with ng-repeat,\n   * resize it for the elements inside).\n   */\n  'update',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#slide\n   * @param {number} to The index to slide to.\n   * @param {number=} speed The number of milliseconds the change should take.\n   */\n  'slide',\n  'select',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#enableSlide\n   * @param {boolean=} shouldEnable Whether to enable sliding the slidebox.\n   * @returns {boolean} Whether sliding is enabled.\n   */\n  'enableSlide',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#previous\n   * @param {number=} speed The number of milliseconds the change should take.\n   * @description Go to the previous slide. Wraps around if at the beginning.\n   */\n  'previous',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#next\n   * @param {number=} speed The number of milliseconds the change should take.\n   * @description Go to the next slide. Wraps around if at the end.\n   */\n  'next',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#stop\n   * @description Stop sliding. The slideBox will not move again until\n   * explicitly told to do so.\n   */\n  'stop',\n  'autoPlay',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#start\n   * @description Start sliding again if the slideBox was stopped.\n   */\n  'start',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#currentIndex\n   * @returns number The index of the current slide.\n   */\n  'currentIndex',\n  'selected',\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#slidesCount\n   * @returns number The number of slides there are currently.\n   */\n  'slidesCount',\n  'count',\n  'loop'\n  /**\n   * @ngdoc method\n   * @name $ionicSlideBoxDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionSlideBox} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicSlideBoxDelegate.$getByHandle('my-handle').stop();`\n   */\n]));\n\n\n/**\n * @ngdoc service\n * @name $ionicTabsDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionTabs} directive.\n *\n * Methods called directly on the $ionicTabsDelegate service will control all ionTabs\n * directives. Use the {@link ionic.service:$ionicTabsDelegate#$getByHandle $getByHandle}\n * method to control specific ionTabs instances.\n *\n * @usage\n *\n * ```html\n * <body ng-controller=\"MyCtrl\">\n *   <ion-tabs>\n *\n *     <ion-tab title=\"Tab 1\">\n *       Hello tab 1!\n *       <button ng-click=\"selectTabWithIndex(1)\">Select tab 2!</button>\n *     </ion-tab>\n *     <ion-tab title=\"Tab 2\">Hello tab 2!</ion-tab>\n *\n *   </ion-tabs>\n * </body>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicTabsDelegate) {\n *   $scope.selectTabWithIndex = function(index) {\n *     $ionicTabsDelegate.select(index);\n *   }\n * }\n * ```\n */\nIonicModule\n.service('$ionicTabsDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#select\n   * @description Select the tab matching the given index.\n   *\n   * @param {number} index Index of the tab to select.\n   */\n  'select',\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#selectedIndex\n   * @returns `number` The index of the selected tab, or -1.\n   */\n  'selectedIndex'\n  /**\n   * @ngdoc method\n   * @name $ionicTabsDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionTabs} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicTabsDelegate.$getByHandle('my-handle').select(0);`\n   */\n]));\n\n\n// closure to keep things neat\n(function() {\n  var templatesToCache = [];\n\n/**\n * @ngdoc service\n * @name $ionicTemplateCache\n * @module ionic\n * @description A service that preemptively caches template files to eliminate transition flicker and boost performance.\n * @usage\n * State templates are cached automatically, but you can optionally cache other templates.\n *\n * ```js\n * $ionicTemplateCache('myNgIncludeTemplate.html');\n * ```\n *\n * Optionally disable all preemptive caching with the `$ionicConfigProvider` or individual states by setting `prefetchTemplate`\n * in the `$state` definition\n *\n * ```js\n *   angular.module('myApp', ['ionic'])\n *   .config(function($stateProvider, $ionicConfigProvider) {\n *\n *     // disable preemptive template caching globally\n *     $ionicConfigProvider.templates.prefetch(false);\n *\n *     // disable individual states\n *     $stateProvider\n *       .state('tabs', {\n *         url: \"/tab\",\n *         abstract: true,\n *         prefetchTemplate: false,\n *         templateUrl: \"tabs-templates/tabs.html\"\n *       })\n *       .state('tabs.home', {\n *         url: \"/home\",\n *         views: {\n *           'home-tab': {\n *             prefetchTemplate: false,\n *             templateUrl: \"tabs-templates/home.html\",\n *             controller: 'HomeTabCtrl'\n *           }\n *         }\n *       });\n *   });\n * ```\n */\nIonicModule\n.factory('$ionicTemplateCache', [\n'$http',\n'$templateCache',\n'$timeout',\nfunction($http, $templateCache, $timeout) {\n  var toCache = templatesToCache,\n      hasRun;\n\n  function $ionicTemplateCache(templates) {\n    if (typeof templates === 'undefined') {\n      return run();\n    }\n    if (isString(templates)) {\n      templates = [templates];\n    }\n    forEach(templates, function(template) {\n      toCache.push(template);\n    });\n    if (hasRun) {\n      run();\n    }\n  }\n\n  // run through methods - internal method\n  function run() {\n    var template;\n    $ionicTemplateCache._runCount++;\n\n    hasRun = true;\n    // ignore if race condition already zeroed out array\n    if (toCache.length === 0) return;\n\n    var i = 0;\n    while (i < 4 && (template = toCache.pop())) {\n      // note that inline templates are ignored by this request\n      if (isString(template)) $http.get(template, { cache: $templateCache });\n      i++;\n    }\n    // only preload 3 templates a second\n    if (toCache.length) {\n      $timeout(run, 1000);\n    }\n  }\n\n  // exposing for testing\n  $ionicTemplateCache._runCount = 0;\n  // default method\n  return $ionicTemplateCache;\n}])\n\n// Intercepts the $stateprovider.state() command to look for templateUrls that can be cached\n.config([\n'$stateProvider',\n'$ionicConfigProvider',\nfunction($stateProvider, $ionicConfigProvider) {\n  var stateProviderState = $stateProvider.state;\n  $stateProvider.state = function(stateName, definition) {\n    // don't even bother if it's disabled. note, another config may run after this, so it's not a catch-all\n    if (typeof definition === 'object') {\n      var enabled = definition.prefetchTemplate !== false && templatesToCache.length < $ionicConfigProvider.templates.maxPrefetch();\n      if (enabled && isString(definition.templateUrl)) templatesToCache.push(definition.templateUrl);\n      if (angular.isObject(definition.views)) {\n        for (var key in definition.views) {\n          enabled = definition.views[key].prefetchTemplate !== false && templatesToCache.length < $ionicConfigProvider.templates.maxPrefetch();\n          if (enabled && isString(definition.views[key].templateUrl)) templatesToCache.push(definition.views[key].templateUrl);\n        }\n      }\n    }\n    return stateProviderState.call($stateProvider, stateName, definition);\n  };\n}])\n\n// process the templateUrls collected by the $stateProvider, adding them to the cache\n.run(['$ionicTemplateCache', function($ionicTemplateCache) {\n  $ionicTemplateCache();\n}]);\n\n})();\n\nIonicModule\n.factory('$ionicTemplateLoader', [\n  '$compile',\n  '$controller',\n  '$http',\n  '$q',\n  '$rootScope',\n  '$templateCache',\nfunction($compile, $controller, $http, $q, $rootScope, $templateCache) {\n\n  return {\n    load: fetchTemplate,\n    compile: loadAndCompile\n  };\n\n  function fetchTemplate(url) {\n    return $http.get(url, {cache: $templateCache})\n    .then(function(response) {\n      return response.data && response.data.trim();\n    });\n  }\n\n  function loadAndCompile(options) {\n    options = extend({\n      template: '',\n      templateUrl: '',\n      scope: null,\n      controller: null,\n      locals: {},\n      appendTo: null\n    }, options || {});\n\n    var templatePromise = options.templateUrl ?\n      this.load(options.templateUrl) :\n      $q.when(options.template);\n\n    return templatePromise.then(function(template) {\n      var controller;\n      var scope = options.scope || $rootScope.$new();\n\n      //Incase template doesn't have just one root element, do this\n      var element = jqLite('<div>').html(template).contents();\n\n      if (options.controller) {\n        controller = $controller(\n          options.controller,\n          extend(options.locals, {\n            $scope: scope\n          })\n        );\n        element.children().data('$ngControllerController', controller);\n      }\n      if (options.appendTo) {\n        jqLite(options.appendTo).append(element);\n      }\n\n      $compile(element)(scope);\n\n      return {\n        element: element,\n        scope: scope\n      };\n    });\n  }\n\n}]);\n\n/**\n * @private\n * DEPRECATED, as of v1.0.0-beta14 -------\n */\nIonicModule\n.factory('$ionicViewService', ['$ionicHistory', '$log', function($ionicHistory, $log) {\n\n  function warn(oldMethod, newMethod) {\n    $log.warn('$ionicViewService' + oldMethod + ' is deprecated, please use $ionicHistory' + newMethod + ' instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/');\n  }\n\n  warn('', '');\n\n  var methodsMap = {\n    getCurrentView: 'currentView',\n    getBackView: 'backView',\n    getForwardView: 'forwardView',\n    getCurrentStateName: 'currentStateName',\n    nextViewOptions: 'nextViewOptions',\n    clearHistory: 'clearHistory'\n  };\n\n  forEach(methodsMap, function(newMethod, oldMethod) {\n    methodsMap[oldMethod] = function() {\n      warn('.' + oldMethod, '.' + newMethod);\n      return $ionicHistory[newMethod].apply(this, arguments);\n    };\n  });\n\n  return methodsMap;\n\n}]);\n\n/**\n * @private\n * TODO document\n */\n\nIonicModule.factory('$ionicViewSwitcher', [\n  '$timeout',\n  '$document',\n  '$q',\n  '$ionicClickBlock',\n  '$ionicConfig',\n  '$ionicNavBarDelegate',\nfunction($timeout, $document, $q, $ionicClickBlock, $ionicConfig, $ionicNavBarDelegate) {\n\n  var TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n  var DATA_NO_CACHE = '$noCache';\n  var DATA_DESTROY_ELE = '$destroyEle';\n  var DATA_ELE_IDENTIFIER = '$eleId';\n  var DATA_VIEW_ACCESSED = '$accessed';\n  var DATA_FALLBACK_TIMER = '$fallbackTimer';\n  var DATA_VIEW = '$viewData';\n  var NAV_VIEW_ATTR = 'nav-view';\n  var VIEW_STATUS_ACTIVE = 'active';\n  var VIEW_STATUS_CACHED = 'cached';\n  var VIEW_STATUS_STAGED = 'stage';\n\n  var transitionCounter = 0;\n  var nextTransition, nextDirection;\n  ionic.transition = ionic.transition || {};\n  ionic.transition.isActive = false;\n  var isActiveTimer;\n  var cachedAttr = ionic.DomUtil.cachedAttr;\n  var transitionPromises = [];\n  var defaultTimeout = 1100;\n\n  var ionicViewSwitcher = {\n\n    create: function(navViewCtrl, viewLocals, enteringView, leavingView, renderStart, renderEnd) {\n      // get a reference to an entering/leaving element if they exist\n      // loop through to see if the view is already in the navViewElement\n      var enteringEle, leavingEle;\n      var transitionId = ++transitionCounter;\n      var alreadyInDom;\n\n      var switcher = {\n\n        init: function(registerData, callback) {\n          ionicViewSwitcher.isTransitioning(true);\n\n          switcher.loadViewElements(registerData);\n\n          switcher.render(registerData, function() {\n            callback && callback();\n          });\n        },\n\n        loadViewElements: function(registerData) {\n          var x, l, viewEle;\n          var viewElements = navViewCtrl.getViewElements();\n          var enteringEleIdentifier = getViewElementIdentifier(viewLocals, enteringView);\n          var navViewActiveEleId = navViewCtrl.activeEleId();\n\n          for (x = 0, l = viewElements.length; x < l; x++) {\n            viewEle = viewElements.eq(x);\n\n            if (viewEle.data(DATA_ELE_IDENTIFIER) === enteringEleIdentifier) {\n              // we found an existing element in the DOM that should be entering the view\n              if (viewEle.data(DATA_NO_CACHE)) {\n                // the existing element should not be cached, don't use it\n                viewEle.data(DATA_ELE_IDENTIFIER, enteringEleIdentifier + ionic.Utils.nextUid());\n                viewEle.data(DATA_DESTROY_ELE, true);\n\n              } else {\n                enteringEle = viewEle;\n              }\n\n            } else if (isDefined(navViewActiveEleId) && viewEle.data(DATA_ELE_IDENTIFIER) === navViewActiveEleId) {\n              leavingEle = viewEle;\n            }\n\n            if (enteringEle && leavingEle) break;\n          }\n\n          alreadyInDom = !!enteringEle;\n\n          if (!alreadyInDom) {\n            // still no existing element to use\n            // create it using existing template/scope/locals\n            enteringEle = registerData.ele || ionicViewSwitcher.createViewEle(viewLocals);\n\n            // existing elements in the DOM are looked up by their state name and state id\n            enteringEle.data(DATA_ELE_IDENTIFIER, enteringEleIdentifier);\n          }\n\n          if (renderEnd) {\n            navViewCtrl.activeEleId(enteringEleIdentifier);\n          }\n\n          registerData.ele = null;\n        },\n\n        render: function(registerData, callback) {\n          if (alreadyInDom) {\n            // it was already found in the DOM, just reconnect the scope\n            ionic.Utils.reconnectScope(enteringEle.scope());\n\n          } else {\n            // the entering element is not already in the DOM\n            // set that the entering element should be \"staged\" and its\n            // styles of where this element will go before it hits the DOM\n            navViewAttr(enteringEle, VIEW_STATUS_STAGED);\n\n            var enteringData = getTransitionData(viewLocals, enteringEle, registerData.direction, enteringView);\n            var transitionFn = $ionicConfig.transitions.views[enteringData.transition] || $ionicConfig.transitions.views.none;\n            transitionFn(enteringEle, null, enteringData.direction, true).run(0);\n\n            enteringEle.data(DATA_VIEW, {\n              viewId: enteringData.viewId,\n              historyId: enteringData.historyId,\n              stateName: enteringData.stateName,\n              stateParams: enteringData.stateParams\n            });\n\n            // if the current state has cache:false\n            // or the element has cache-view=\"false\" attribute\n            if (viewState(viewLocals).cache === false || viewState(viewLocals).cache === 'false' ||\n                enteringEle.attr('cache-view') == 'false' || $ionicConfig.views.maxCache() === 0) {\n              enteringEle.data(DATA_NO_CACHE, true);\n            }\n\n            // append the entering element to the DOM, create a new scope and run link\n            var viewScope = navViewCtrl.appendViewElement(enteringEle, viewLocals);\n\n            delete enteringData.direction;\n            delete enteringData.transition;\n            viewScope.$emit('$ionicView.loaded', enteringData);\n          }\n\n          // update that this view was just accessed\n          enteringEle.data(DATA_VIEW_ACCESSED, Date.now());\n\n          callback && callback();\n        },\n\n        transition: function(direction, enableBack, allowAnimate) {\n          var deferred;\n          var enteringData = getTransitionData(viewLocals, enteringEle, direction, enteringView);\n          var leavingData = extend(extend({}, enteringData), getViewData(leavingView));\n          enteringData.transitionId = leavingData.transitionId = transitionId;\n          enteringData.fromCache = !!alreadyInDom;\n          enteringData.enableBack = !!enableBack;\n          enteringData.renderStart = renderStart;\n          enteringData.renderEnd = renderEnd;\n\n          cachedAttr(enteringEle.parent(), 'nav-view-transition', enteringData.transition);\n          cachedAttr(enteringEle.parent(), 'nav-view-direction', enteringData.direction);\n\n          // cancel any previous transition complete fallbacks\n          $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n\n          // get the transition ready and see if it'll animate\n          var transitionFn = $ionicConfig.transitions.views[enteringData.transition] || $ionicConfig.transitions.views.none;\n          var viewTransition = transitionFn(enteringEle, leavingEle, enteringData.direction,\n                                            enteringData.shouldAnimate && allowAnimate && renderEnd);\n\n          if (viewTransition.shouldAnimate) {\n            // attach transitionend events (and fallback timer)\n            enteringEle.on(TRANSITIONEND_EVENT, completeOnTransitionEnd);\n            enteringEle.data(DATA_FALLBACK_TIMER, $timeout(transitionComplete, defaultTimeout));\n            $ionicClickBlock.show(defaultTimeout);\n          }\n\n          if (renderStart) {\n            // notify the views \"before\" the transition starts\n            switcher.emit('before', enteringData, leavingData);\n\n            // stage entering element, opacity 0, no transition duration\n            navViewAttr(enteringEle, VIEW_STATUS_STAGED);\n\n            // render the elements in the correct location for their starting point\n            viewTransition.run(0);\n          }\n\n          if (renderEnd) {\n            // create a promise so we can keep track of when all transitions finish\n            // only required if this transition should complete\n            deferred = $q.defer();\n            transitionPromises.push(deferred.promise);\n          }\n\n          if (renderStart && renderEnd) {\n            // CSS \"auto\" transitioned, not manually transitioned\n            // wait a frame so the styles apply before auto transitioning\n            $timeout(onReflow, 16);\n\n          } else if (!renderEnd) {\n            // just the start of a manual transition\n            // but it will not render the end of the transition\n            navViewAttr(enteringEle, 'entering');\n            navViewAttr(leavingEle, 'leaving');\n\n            // return the transition run method so each step can be ran manually\n            return {\n              run: viewTransition.run,\n              cancel: function(shouldAnimate) {\n                if (shouldAnimate) {\n                  enteringEle.on(TRANSITIONEND_EVENT, cancelOnTransitionEnd);\n                  enteringEle.data(DATA_FALLBACK_TIMER, $timeout(cancelTransition, defaultTimeout));\n                  $ionicClickBlock.show(defaultTimeout);\n                } else {\n                  cancelTransition();\n                }\n                viewTransition.shouldAnimate = shouldAnimate;\n                viewTransition.run(0);\n                viewTransition = null;\n              }\n            };\n\n          } else if (renderEnd) {\n            // just the end of a manual transition\n            // happens after the manual transition has completed\n            // and a full history change has happened\n            onReflow();\n          }\n\n\n          function onReflow() {\n            // remove that we're staging the entering element so it can auto transition\n            navViewAttr(enteringEle, viewTransition.shouldAnimate ? 'entering' : VIEW_STATUS_ACTIVE);\n            navViewAttr(leavingEle, viewTransition.shouldAnimate ? 'leaving' : VIEW_STATUS_CACHED);\n\n            // start the auto transition and let the CSS take over\n            viewTransition.run(1);\n\n            // trigger auto transitions on the associated nav bars\n            $ionicNavBarDelegate._instances.forEach(function(instance) {\n              instance.triggerTransitionStart(transitionId);\n            });\n\n            if (!viewTransition.shouldAnimate) {\n              // no animated auto transition\n              transitionComplete();\n            }\n          }\n\n          // Make sure that transitionend events bubbling up from children won't fire\n          // transitionComplete. Will only go forward if ev.target == the element listening.\n          function completeOnTransitionEnd(ev) {\n            if (ev.target !== this) return;\n            transitionComplete();\n          }\n          function transitionComplete() {\n            if (transitionComplete.x) return;\n            transitionComplete.x = true;\n\n            enteringEle.off(TRANSITIONEND_EVENT, completeOnTransitionEnd);\n            $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n            leavingEle && $timeout.cancel(leavingEle.data(DATA_FALLBACK_TIMER));\n\n            // emit that the views have finished transitioning\n            // each parent nav-view will update which views are active and cached\n            switcher.emit('after', enteringData, leavingData);\n\n            // resolve that this one transition (there could be many w/ nested views)\n            deferred && deferred.resolve(navViewCtrl);\n\n            // the most recent transition added has completed and all the active\n            // transition promises should be added to the services array of promises\n            if (transitionId === transitionCounter) {\n              $q.all(transitionPromises).then(ionicViewSwitcher.transitionEnd);\n              switcher.cleanup(enteringData);\n            }\n\n            // tell the nav bars that the transition has ended\n            $ionicNavBarDelegate._instances.forEach(function(instance) {\n              instance.triggerTransitionEnd();\n            });\n\n            // remove any references that could cause memory issues\n            nextTransition = nextDirection = enteringView = leavingView = enteringEle = leavingEle = null;\n          }\n\n          // Make sure that transitionend events bubbling up from children won't fire\n          // transitionComplete. Will only go forward if ev.target == the element listening.\n          function cancelOnTransitionEnd(ev) {\n            if (ev.target !== this) return;\n            cancelTransition();\n          }\n          function cancelTransition() {\n            navViewAttr(enteringEle, VIEW_STATUS_CACHED);\n            navViewAttr(leavingEle, VIEW_STATUS_ACTIVE);\n            enteringEle.off(TRANSITIONEND_EVENT, cancelOnTransitionEnd);\n            $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER));\n            ionicViewSwitcher.transitionEnd([navViewCtrl]);\n          }\n\n        },\n\n        emit: function(step, enteringData, leavingData) {\n          var scope = enteringEle.scope();\n          if (scope) {\n            scope.$emit('$ionicView.' + step + 'Enter', enteringData);\n            if (step == 'after') {\n              scope.$emit('$ionicView.enter', enteringData);\n            }\n          }\n\n          if (leavingEle) {\n            scope = leavingEle.scope();\n            if (scope) {\n              scope.$emit('$ionicView.' + step + 'Leave', leavingData);\n              if (step == 'after') {\n                scope.$emit('$ionicView.leave', leavingData);\n              }\n            }\n\n          } else if (scope && leavingData && leavingData.viewId) {\n            scope.$emit('$ionicNavView.' + step + 'Leave', leavingData);\n            if (step == 'after') {\n              scope.$emit('$ionicNavView.leave', leavingData);\n            }\n          }\n        },\n\n        cleanup: function(transData) {\n          // check if any views should be removed\n          if (leavingEle && transData.direction == 'back' && !$ionicConfig.views.forwardCache()) {\n            // if they just navigated back we can destroy the forward view\n            // do not remove forward views if cacheForwardViews config is true\n            destroyViewEle(leavingEle);\n          }\n\n          var viewElements = navViewCtrl.getViewElements();\n          var viewElementsLength = viewElements.length;\n          var x, viewElement;\n          var removeOldestAccess = (viewElementsLength - 1) > $ionicConfig.views.maxCache();\n          var removableEle;\n          var oldestAccess = Date.now();\n\n          for (x = 0; x < viewElementsLength; x++) {\n            viewElement = viewElements.eq(x);\n\n            if (removeOldestAccess && viewElement.data(DATA_VIEW_ACCESSED) < oldestAccess) {\n              // remember what was the oldest element to be accessed so it can be destroyed\n              oldestAccess = viewElement.data(DATA_VIEW_ACCESSED);\n              removableEle = viewElements.eq(x);\n\n            } else if (viewElement.data(DATA_DESTROY_ELE) && navViewAttr(viewElement) != VIEW_STATUS_ACTIVE) {\n              destroyViewEle(viewElement);\n            }\n          }\n\n          destroyViewEle(removableEle);\n\n          if (enteringEle.data(DATA_NO_CACHE)) {\n            enteringEle.data(DATA_DESTROY_ELE, true);\n          }\n        },\n\n        enteringEle: function() { return enteringEle; },\n        leavingEle: function() { return leavingEle; }\n\n      };\n\n      return switcher;\n    },\n\n    transitionEnd: function(navViewCtrls) {\n      forEach(navViewCtrls, function(navViewCtrl) {\n        navViewCtrl.transitionEnd();\n      });\n\n      ionicViewSwitcher.isTransitioning(false);\n      $ionicClickBlock.hide();\n      transitionPromises = [];\n    },\n\n    nextTransition: function(val) {\n      nextTransition = val;\n    },\n\n    nextDirection: function(val) {\n      nextDirection = val;\n    },\n\n    isTransitioning: function(val) {\n      if (arguments.length) {\n        ionic.transition.isActive = !!val;\n        $timeout.cancel(isActiveTimer);\n        if (val) {\n          isActiveTimer = $timeout(function() {\n            ionicViewSwitcher.isTransitioning(false);\n          }, 999);\n        }\n      }\n      return ionic.transition.isActive;\n    },\n\n    createViewEle: function(viewLocals) {\n      var containerEle = $document[0].createElement('div');\n      if (viewLocals && viewLocals.$template) {\n        containerEle.innerHTML = viewLocals.$template;\n        if (containerEle.children.length === 1) {\n          containerEle.children[0].classList.add('pane');\n          return jqLite(containerEle.children[0]);\n        }\n      }\n      containerEle.className = \"pane\";\n      return jqLite(containerEle);\n    },\n\n    viewEleIsActive: function(viewEle, isActiveAttr) {\n      navViewAttr(viewEle, isActiveAttr ? VIEW_STATUS_ACTIVE : VIEW_STATUS_CACHED);\n    },\n\n    getTransitionData: getTransitionData,\n    navViewAttr: navViewAttr,\n    destroyViewEle: destroyViewEle\n\n  };\n\n  return ionicViewSwitcher;\n\n\n  function getViewElementIdentifier(locals, view) {\n    if (viewState(locals)['abstract']) return viewState(locals).name;\n    if (view) return view.stateId || view.viewId;\n    return ionic.Utils.nextUid();\n  }\n\n  function viewState(locals) {\n    return locals && locals.$$state && locals.$$state.self || {};\n  }\n\n  function getTransitionData(viewLocals, enteringEle, direction, view) {\n    // Priority\n    // 1) attribute directive on the button/link to this view\n    // 2) entering element's attribute\n    // 3) entering view's $state config property\n    // 4) view registration data\n    // 5) global config\n    // 6) fallback value\n\n    var state = viewState(viewLocals);\n    var viewTransition = nextTransition || cachedAttr(enteringEle, 'view-transition') || state.viewTransition || $ionicConfig.views.transition() || 'ios';\n    var navBarTransition = $ionicConfig.navBar.transition();\n    direction = nextDirection || cachedAttr(enteringEle, 'view-direction') || state.viewDirection || direction || 'none';\n\n    return extend(getViewData(view), {\n      transition: viewTransition,\n      navBarTransition: navBarTransition === 'view' ? viewTransition : navBarTransition,\n      direction: direction,\n      shouldAnimate: (viewTransition !== 'none' && direction !== 'none')\n    });\n  }\n\n  function getViewData(view) {\n    view = view || {};\n    return {\n      viewId: view.viewId,\n      historyId: view.historyId,\n      stateId: view.stateId,\n      stateName: view.stateName,\n      stateParams: view.stateParams\n    };\n  }\n\n  function navViewAttr(ele, value) {\n    if (arguments.length > 1) {\n      cachedAttr(ele, NAV_VIEW_ATTR, value);\n    } else {\n      return cachedAttr(ele, NAV_VIEW_ATTR);\n    }\n  }\n\n  function destroyViewEle(ele) {\n    // we found an element that should be removed\n    // destroy its scope, then remove the element\n    if (ele && ele.length) {\n      var viewScope = ele.scope();\n      if (viewScope) {\n        viewScope.$emit('$ionicView.unloaded', ele.data(DATA_VIEW));\n        viewScope.$destroy();\n      }\n      ele.remove();\n    }\n  }\n\n}]);\n\n/**\n * @private\n * Parts of Ionic requires that $scope data is attached to the element.\n * We do not want to disable adding $scope data to the $element when\n * $compileProvider.debugInfoEnabled(false) is used.\n */\nIonicModule.config(['$provide', function($provide) {\n  $provide.decorator('$compile', ['$delegate', function($compile) {\n     $compile.$$addScopeInfo = function $$addScopeInfo($element, scope, isolated, noTemplate) {\n       var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n       $element.data(dataName, scope);\n     };\n     return $compile;\n  }]);\n}]);\n\n/**\n * @private\n */\nIonicModule.config([\n  '$provide',\nfunction($provide) {\n  function $LocationDecorator($location, $timeout) {\n\n    $location.__hash = $location.hash;\n    //Fix: when window.location.hash is set, the scrollable area\n    //found nearest to body's scrollTop is set to scroll to an element\n    //with that ID.\n    $location.hash = function(value) {\n      if (isDefined(value)) {\n        $timeout(function() {\n          var scroll = document.querySelector('.scroll-content');\n          if (scroll) {\n            scroll.scrollTop = 0;\n          }\n        }, 0, false);\n      }\n      return $location.__hash(value);\n    };\n\n    return $location;\n  }\n\n  $provide.decorator('$location', ['$delegate', '$timeout', $LocationDecorator]);\n}]);\n\nIonicModule\n\n.controller('$ionicHeaderBar', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$q',\n  '$ionicConfig',\n  '$ionicHistory',\nfunction($scope, $element, $attrs, $q, $ionicConfig, $ionicHistory) {\n  var TITLE = 'title';\n  var BACK_TEXT = 'back-text';\n  var BACK_BUTTON = 'back-button';\n  var DEFAULT_TITLE = 'default-title';\n  var PREVIOUS_TITLE = 'previous-title';\n  var HIDE = 'hide';\n\n  var self = this;\n  var titleText = '';\n  var previousTitleText = '';\n  var titleLeft = 0;\n  var titleRight = 0;\n  var titleCss = '';\n  var isBackEnabled = false;\n  var isBackShown = true;\n  var isNavBackShown = true;\n  var isBackElementShown = false;\n  var titleTextWidth = 0;\n\n\n  self.beforeEnter = function(viewData) {\n    $scope.$broadcast('$ionicView.beforeEnter', viewData);\n  };\n\n\n  self.title = function(newTitleText) {\n    if (arguments.length && newTitleText !== titleText) {\n      getEle(TITLE).innerHTML = newTitleText;\n      titleText = newTitleText;\n      titleTextWidth = 0;\n    }\n    return titleText;\n  };\n\n\n  self.enableBack = function(shouldEnable, disableReset) {\n    // whether or not the back button show be visible, according\n    // to the navigation and history\n    if (arguments.length) {\n      isBackEnabled = shouldEnable;\n      if (!disableReset) self.updateBackButton();\n    }\n    return isBackEnabled;\n  };\n\n\n  self.showBack = function(shouldShow, disableReset) {\n    // different from enableBack() because this will always have the back\n    // visually hidden if false, even if the history says it should show\n    if (arguments.length) {\n      isBackShown = shouldShow;\n      if (!disableReset) self.updateBackButton();\n    }\n    return isBackShown;\n  };\n\n\n  self.showNavBack = function(shouldShow) {\n    // different from showBack() because this is for the entire nav bar's\n    // setting for all of it's child headers. For internal use.\n    isNavBackShown = shouldShow;\n    self.updateBackButton();\n  };\n\n\n  self.updateBackButton = function() {\n    var ele;\n    if ((isBackShown && isNavBackShown && isBackEnabled) !== isBackElementShown) {\n      isBackElementShown = isBackShown && isNavBackShown && isBackEnabled;\n      ele = getEle(BACK_BUTTON);\n      ele && ele.classList[ isBackElementShown ? 'remove' : 'add' ](HIDE);\n    }\n\n    if (isBackEnabled) {\n      ele = ele || getEle(BACK_BUTTON);\n      if (ele) {\n        if (self.backButtonIcon !== $ionicConfig.backButton.icon()) {\n          ele = getEle(BACK_BUTTON + ' .icon');\n          if (ele) {\n            self.backButtonIcon = $ionicConfig.backButton.icon();\n            ele.className = 'icon ' + self.backButtonIcon;\n          }\n        }\n\n        if (self.backButtonText !== $ionicConfig.backButton.text()) {\n          ele = getEle(BACK_BUTTON + ' .back-text');\n          if (ele) {\n            ele.textContent = self.backButtonText = $ionicConfig.backButton.text();\n          }\n        }\n      }\n    }\n  };\n\n\n  self.titleTextWidth = function() {\n    if (!titleTextWidth) {\n      var bounds = ionic.DomUtil.getTextBounds(getEle(TITLE));\n      titleTextWidth = Math.min(bounds && bounds.width || 30);\n    }\n    return titleTextWidth;\n  };\n\n\n  self.titleWidth = function() {\n    var titleWidth = self.titleTextWidth();\n    var offsetWidth = getEle(TITLE).offsetWidth;\n    if (offsetWidth < titleWidth) {\n      titleWidth = offsetWidth + (titleLeft - titleRight - 5);\n    }\n    return titleWidth;\n  };\n\n\n  self.titleTextX = function() {\n    return ($element[0].offsetWidth / 2) - (self.titleWidth() / 2);\n  };\n\n\n  self.titleLeftRight = function() {\n    return titleLeft - titleRight;\n  };\n\n\n  self.backButtonTextLeft = function() {\n    var offsetLeft = 0;\n    var ele = getEle(BACK_TEXT);\n    while (ele) {\n      offsetLeft += ele.offsetLeft;\n      ele = ele.parentElement;\n    }\n    return offsetLeft;\n  };\n\n\n  self.resetBackButton = function(viewData) {\n    if ($ionicConfig.backButton.previousTitleText()) {\n      var previousTitleEle = getEle(PREVIOUS_TITLE);\n      if (previousTitleEle) {\n        previousTitleEle.classList.remove(HIDE);\n\n        var view = (viewData && $ionicHistory.getViewById(viewData.viewId));\n        var newPreviousTitleText = $ionicHistory.backTitle(view);\n\n        if (newPreviousTitleText !== previousTitleText) {\n          previousTitleText = previousTitleEle.innerHTML = newPreviousTitleText;\n        }\n      }\n      var defaultTitleEle = getEle(DEFAULT_TITLE);\n      if (defaultTitleEle) {\n        defaultTitleEle.classList.remove(HIDE);\n      }\n    }\n  };\n\n\n  self.align = function(textAlign) {\n    var titleEle = getEle(TITLE);\n\n    textAlign = textAlign || $attrs.alignTitle || $ionicConfig.navBar.alignTitle();\n\n    var widths = self.calcWidths(textAlign, false);\n\n    if (isBackShown && previousTitleText && $ionicConfig.backButton.previousTitleText()) {\n      var previousTitleWidths = self.calcWidths(textAlign, true);\n\n      var availableTitleWidth = $element[0].offsetWidth - previousTitleWidths.titleLeft - previousTitleWidths.titleRight;\n\n      if (self.titleTextWidth() <= availableTitleWidth) {\n        widths = previousTitleWidths;\n      }\n    }\n\n    return self.updatePositions(titleEle, widths.titleLeft, widths.titleRight, widths.buttonsLeft, widths.buttonsRight, widths.css, widths.showPrevTitle);\n  };\n\n\n  self.calcWidths = function(textAlign, isPreviousTitle) {\n    var titleEle = getEle(TITLE);\n    var backBtnEle = getEle(BACK_BUTTON);\n    var x, y, z, b, c, d, childSize, bounds;\n    var childNodes = $element[0].childNodes;\n    var buttonsLeft = 0;\n    var buttonsRight = 0;\n    var isCountRightOfTitle;\n    var updateTitleLeft = 0;\n    var updateTitleRight = 0;\n    var updateCss = '';\n    var backButtonWidth = 0;\n\n    // Compute how wide the left children are\n    // Skip all titles (there may still be two titles, one leaving the dom)\n    // Once we encounter a titleEle, realize we are now counting the right-buttons, not left\n    for (x = 0; x < childNodes.length; x++) {\n      c = childNodes[x];\n\n      childSize = 0;\n      if (c.nodeType == 1) {\n        // element node\n        if (c === titleEle) {\n          isCountRightOfTitle = true;\n          continue;\n        }\n\n        if (c.classList.contains(HIDE)) {\n          continue;\n        }\n\n        if (isBackShown && c === backBtnEle) {\n\n          for (y = 0; y < c.childNodes.length; y++) {\n            b = c.childNodes[y];\n\n            if (b.nodeType == 1) {\n\n              if (b.classList.contains(BACK_TEXT)) {\n                for (z = 0; z < b.children.length; z++) {\n                  d = b.children[z];\n\n                  if (isPreviousTitle) {\n                    if (d.classList.contains(DEFAULT_TITLE)) continue;\n                    backButtonWidth += d.offsetWidth;\n                  } else {\n                    if (d.classList.contains(PREVIOUS_TITLE)) continue;\n                    backButtonWidth += d.offsetWidth;\n                  }\n                }\n\n              } else {\n                backButtonWidth += b.offsetWidth;\n              }\n\n            } else if (b.nodeType == 3 && b.nodeValue.trim()) {\n              bounds = ionic.DomUtil.getTextBounds(b);\n              backButtonWidth += bounds && bounds.width || 0;\n            }\n\n          }\n          childSize = backButtonWidth || c.offsetWidth;\n\n        } else {\n          // not the title, not the back button, not a hidden element\n          childSize = c.offsetWidth;\n        }\n\n      } else if (c.nodeType == 3 && c.nodeValue.trim()) {\n        // text node\n        bounds = ionic.DomUtil.getTextBounds(c);\n        childSize = bounds && bounds.width || 0;\n      }\n\n      if (isCountRightOfTitle) {\n        buttonsRight += childSize;\n      } else {\n        buttonsLeft += childSize;\n      }\n    }\n\n    // Size and align the header titleEle based on the sizes of the left and\n    // right children, and the desired alignment mode\n    if (textAlign == 'left') {\n      updateCss = 'title-left';\n      if (buttonsLeft) {\n        updateTitleLeft = buttonsLeft + 15;\n      }\n      if (buttonsRight) {\n        updateTitleRight = buttonsRight + 15;\n      }\n\n    } else if (textAlign == 'right') {\n      updateCss = 'title-right';\n      if (buttonsLeft) {\n        updateTitleLeft = buttonsLeft + 15;\n      }\n      if (buttonsRight) {\n        updateTitleRight = buttonsRight + 15;\n      }\n\n    } else {\n      // center the default\n      var margin = Math.max(buttonsLeft, buttonsRight) + 10;\n      if (margin > 10) {\n        updateTitleLeft = updateTitleRight = margin;\n      }\n    }\n\n    return {\n      backButtonWidth: backButtonWidth,\n      buttonsLeft: buttonsLeft,\n      buttonsRight: buttonsRight,\n      titleLeft: updateTitleLeft,\n      titleRight: updateTitleRight,\n      showPrevTitle: isPreviousTitle,\n      css: updateCss\n    };\n  };\n\n\n  self.updatePositions = function(titleEle, updateTitleLeft, updateTitleRight, buttonsLeft, buttonsRight, updateCss, showPreviousTitle) {\n    var deferred = $q.defer();\n\n    // only make DOM updates when there are actual changes\n    if (titleEle) {\n      if (updateTitleLeft !== titleLeft) {\n        titleEle.style.left = updateTitleLeft ? updateTitleLeft + 'px' : '';\n        titleLeft = updateTitleLeft;\n      }\n      if (updateTitleRight !== titleRight) {\n        titleEle.style.right = updateTitleRight ? updateTitleRight + 'px' : '';\n        titleRight = updateTitleRight;\n      }\n\n      if (updateCss !== titleCss) {\n        updateCss && titleEle.classList.add(updateCss);\n        titleCss && titleEle.classList.remove(titleCss);\n        titleCss = updateCss;\n      }\n    }\n\n    if ($ionicConfig.backButton.previousTitleText()) {\n      var prevTitle = getEle(PREVIOUS_TITLE);\n      var defaultTitle = getEle(DEFAULT_TITLE);\n\n      prevTitle && prevTitle.classList[ showPreviousTitle ? 'remove' : 'add'](HIDE);\n      defaultTitle && defaultTitle.classList[ showPreviousTitle ? 'add' : 'remove'](HIDE);\n    }\n\n    ionic.requestAnimationFrame(function() {\n      if (titleEle && titleEle.offsetWidth + 10 < titleEle.scrollWidth) {\n        var minRight = buttonsRight + 5;\n        var testRight = $element[0].offsetWidth - titleLeft - self.titleTextWidth() - 20;\n        updateTitleRight = testRight < minRight ? minRight : testRight;\n        if (updateTitleRight !== titleRight) {\n          titleEle.style.right = updateTitleRight + 'px';\n          titleRight = updateTitleRight;\n        }\n      }\n      deferred.resolve();\n    });\n\n    return deferred.promise;\n  };\n\n\n  self.setCss = function(elementClassname, css) {\n    ionic.DomUtil.cachedStyles(getEle(elementClassname), css);\n  };\n\n\n  var eleCache = {};\n  function getEle(className) {\n    if (!eleCache[className]) {\n      eleCache[className] = $element[0].querySelector('.' + className);\n    }\n    return eleCache[className];\n  }\n\n\n  $scope.$on('$destroy', function() {\n    for (var n in eleCache) eleCache[n] = null;\n  });\n\n}]);\n\nIonicModule\n.controller('$ionInfiniteScroll', [\n  '$scope',\n  '$attrs',\n  '$element',\n  '$timeout',\nfunction($scope, $attrs, $element, $timeout) {\n  var self = this;\n  self.isLoading = false;\n\n  $scope.icon = function() {\n    return isDefined($attrs.icon) ? $attrs.icon : 'ion-load-d';\n  };\n\n  $scope.spinner = function() {\n    return isDefined($attrs.spinner) ? $attrs.spinner : '';\n  };\n\n  $scope.$on('scroll.infiniteScrollComplete', function() {\n    finishInfiniteScroll();\n  });\n\n  $scope.$on('$destroy', function() {\n    if (self.scrollCtrl && self.scrollCtrl.$element) self.scrollCtrl.$element.off('scroll', self.checkBounds);\n    if (self.scrollEl && self.scrollEl.removeEventListener) {\n      self.scrollEl.removeEventListener('scroll', self.checkBounds);\n    }\n  });\n\n  // debounce checking infinite scroll events\n  self.checkBounds = ionic.Utils.throttle(checkInfiniteBounds, 300);\n\n  function onInfinite() {\n    ionic.requestAnimationFrame(function() {\n      $element[0].classList.add('active');\n    });\n    self.isLoading = true;\n    $scope.$parent && $scope.$parent.$apply($attrs.onInfinite || '');\n  }\n\n  function finishInfiniteScroll() {\n    ionic.requestAnimationFrame(function() {\n      $element[0].classList.remove('active');\n    });\n    $timeout(function() {\n      if (self.jsScrolling) self.scrollView.resize();\n      // only check bounds again immediately if the page isn't cached (scroll el has height)\n      if ((self.jsScrolling && self.scrollView.__container && self.scrollView.__container.offsetHeight > 0) ||\n      !self.jsScrolling) {\n        self.checkBounds();\n      }\n    }, 30, false);\n    self.isLoading = false;\n  }\n\n  // check if we've scrolled far enough to trigger an infinite scroll\n  function checkInfiniteBounds() {\n    if (self.isLoading) return;\n    var maxScroll = {};\n\n    if (self.jsScrolling) {\n      maxScroll = self.getJSMaxScroll();\n      var scrollValues = self.scrollView.getValues();\n      if ((maxScroll.left !== -1 && scrollValues.left >= maxScroll.left) ||\n        (maxScroll.top !== -1 && scrollValues.top >= maxScroll.top)) {\n        onInfinite();\n      }\n    } else {\n      maxScroll = self.getNativeMaxScroll();\n      if ((\n        maxScroll.left !== -1 &&\n        self.scrollEl.scrollLeft >= maxScroll.left - self.scrollEl.clientWidth\n        ) || (\n        maxScroll.top !== -1 &&\n        self.scrollEl.scrollTop >= maxScroll.top - self.scrollEl.clientHeight\n        )) {\n        onInfinite();\n      }\n    }\n  }\n\n  // determine the threshold at which we should fire an infinite scroll\n  // note: this gets processed every scroll event, can it be cached?\n  self.getJSMaxScroll = function() {\n    var maxValues = self.scrollView.getScrollMax();\n    return {\n      left: self.scrollView.options.scrollingX ?\n        calculateMaxValue(maxValues.left) :\n        -1,\n      top: self.scrollView.options.scrollingY ?\n        calculateMaxValue(maxValues.top) :\n        -1\n    };\n  };\n\n  self.getNativeMaxScroll = function() {\n    var maxValues = {\n      left: self.scrollEl.scrollWidth,\n      top: self.scrollEl.scrollHeight\n    };\n    var computedStyle = window.getComputedStyle(self.scrollEl) || {};\n    return {\n      left: computedStyle.overflowX === 'scroll' ||\n      computedStyle.overflowX === 'auto' ||\n      self.scrollEl.style['overflow-x'] === 'scroll' ?\n        calculateMaxValue(maxValues.left) : -1,\n      top: computedStyle.overflowY === 'scroll' ||\n      computedStyle.overflowY === 'auto' ||\n      self.scrollEl.style['overflow-y'] === 'scroll' ?\n        calculateMaxValue(maxValues.top) : -1\n    };\n  };\n\n  // determine pixel refresh distance based on % or value\n  function calculateMaxValue(maximum) {\n    var distance = ($attrs.distance || '2.5%').trim();\n    var isPercent = distance.indexOf('%') !== -1;\n    return isPercent ?\n    maximum * (1 - parseFloat(distance) / 100) :\n    maximum - parseFloat(distance);\n  }\n\n  //for testing\n  self.__finishInfiniteScroll = finishInfiniteScroll;\n\n}]);\n\n/**\n * @ngdoc service\n * @name $ionicListDelegate\n * @module ionic\n *\n * @description\n * Delegate for controlling the {@link ionic.directive:ionList} directive.\n *\n * Methods called directly on the $ionicListDelegate service will control all lists.\n * Use the {@link ionic.service:$ionicListDelegate#$getByHandle $getByHandle}\n * method to control specific ionList instances.\n *\n * @usage\n *\n * ````html\n * <ion-content ng-controller=\"MyCtrl\">\n *   <button class=\"button\" ng-click=\"showDeleteButtons()\"></button>\n *   <ion-list>\n *     <ion-item ng-repeat=\"i in items\">\n *       {% raw %}Hello, {{i}}!{% endraw %}\n *       <ion-delete-button class=\"ion-minus-circled\"></ion-delete-button>\n *     </ion-item>\n *   </ion-list>\n * </ion-content>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicListDelegate) {\n *   $scope.showDeleteButtons = function() {\n *     $ionicListDelegate.showDelete(true);\n *   };\n * }\n * ```\n */\nIonicModule.service('$ionicListDelegate', ionic.DelegateService([\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#showReorder\n   * @param {boolean=} showReorder Set whether or not this list is showing its reorder buttons.\n   * @returns {boolean} Whether the reorder buttons are shown.\n   */\n  'showReorder',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#showDelete\n   * @param {boolean=} showDelete Set whether or not this list is showing its delete buttons.\n   * @returns {boolean} Whether the delete buttons are shown.\n   */\n  'showDelete',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#canSwipeItems\n   * @param {boolean=} canSwipeItems Set whether or not this list is able to swipe to show\n   * option buttons.\n   * @returns {boolean} Whether the list is able to swipe to show option buttons.\n   */\n  'canSwipeItems',\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#closeOptionButtons\n   * @description Closes any option buttons on the list that are swiped open.\n   */\n  'closeOptionButtons'\n  /**\n   * @ngdoc method\n   * @name $ionicListDelegate#$getByHandle\n   * @param {string} handle\n   * @returns `delegateInstance` A delegate instance that controls only the\n   * {@link ionic.directive:ionList} directives with `delegate-handle` matching\n   * the given handle.\n   *\n   * Example: `$ionicListDelegate.$getByHandle('my-handle').showReorder(true);`\n   */\n]))\n\n.controller('$ionicList', [\n  '$scope',\n  '$attrs',\n  '$ionicListDelegate',\n  '$ionicHistory',\nfunction($scope, $attrs, $ionicListDelegate, $ionicHistory) {\n  var self = this;\n  var isSwipeable = true;\n  var isReorderShown = false;\n  var isDeleteShown = false;\n\n  var deregisterInstance = $ionicListDelegate._registerInstance(\n    self, $attrs.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n  $scope.$on('$destroy', deregisterInstance);\n\n  self.showReorder = function(show) {\n    if (arguments.length) {\n      isReorderShown = !!show;\n    }\n    return isReorderShown;\n  };\n\n  self.showDelete = function(show) {\n    if (arguments.length) {\n      isDeleteShown = !!show;\n    }\n    return isDeleteShown;\n  };\n\n  self.canSwipeItems = function(can) {\n    if (arguments.length) {\n      isSwipeable = !!can;\n    }\n    return isSwipeable;\n  };\n\n  self.closeOptionButtons = function() {\n    self.listView && self.listView.clearDragEffects();\n  };\n}]);\n\nIonicModule\n\n.controller('$ionicNavBar', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$timeout',\n  '$ionicNavBarDelegate',\n  '$ionicConfig',\n  '$ionicHistory',\nfunction($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $ionicConfig, $ionicHistory) {\n\n  var CSS_HIDE = 'hide';\n  var DATA_NAV_BAR_CTRL = '$ionNavBarController';\n  var PRIMARY_BUTTONS = 'primaryButtons';\n  var SECONDARY_BUTTONS = 'secondaryButtons';\n  var BACK_BUTTON = 'backButton';\n  var ITEM_TYPES = 'primaryButtons secondaryButtons leftButtons rightButtons title'.split(' ');\n\n  var self = this;\n  var headerBars = [];\n  var navElementHtml = {};\n  var isVisible = true;\n  var queuedTransitionStart, queuedTransitionEnd, latestTransitionId;\n\n  $element.parent().data(DATA_NAV_BAR_CTRL, self);\n\n  var delegateHandle = $attrs.delegateHandle || 'navBar' + ionic.Utils.nextUid();\n\n  var deregisterInstance = $ionicNavBarDelegate._registerInstance(self, delegateHandle);\n\n\n  self.init = function() {\n    $element.addClass('nav-bar-container');\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-transition', $ionicConfig.views.transition());\n\n    // create two nav bar blocks which will trade out which one is shown\n    self.createHeaderBar(false);\n    self.createHeaderBar(true);\n\n    $scope.$emit('ionNavBar.init', delegateHandle);\n  };\n\n\n  self.createHeaderBar = function(isActive) {\n    var containerEle = jqLite('<div class=\"nav-bar-block\">');\n    ionic.DomUtil.cachedAttr(containerEle, 'nav-bar', isActive ? 'active' : 'cached');\n\n    var alignTitle = $attrs.alignTitle || $ionicConfig.navBar.alignTitle();\n    var headerBarEle = jqLite('<ion-header-bar>').addClass($attrs['class']).attr('align-title', alignTitle);\n    if (isDefined($attrs.noTapScroll)) headerBarEle.attr('no-tap-scroll', $attrs.noTapScroll);\n    var titleEle = jqLite('<div class=\"title title-' + alignTitle + '\">');\n    var navEle = {};\n    var lastViewItemEle = {};\n    var leftButtonsEle, rightButtonsEle;\n\n    navEle[BACK_BUTTON] = createNavElement(BACK_BUTTON);\n    navEle[BACK_BUTTON] && headerBarEle.append(navEle[BACK_BUTTON]);\n\n    // append title in the header, this is the rock to where buttons append\n    headerBarEle.append(titleEle);\n\n    forEach(ITEM_TYPES, function(itemType) {\n      // create default button elements\n      navEle[itemType] = createNavElement(itemType);\n      // append and position buttons\n      positionItem(navEle[itemType], itemType);\n    });\n\n    // add header-item to the root children\n    for (var x = 0; x < headerBarEle[0].children.length; x++) {\n      headerBarEle[0].children[x].classList.add('header-item');\n    }\n\n    // compile header and append to the DOM\n    containerEle.append(headerBarEle);\n    $element.append($compile(containerEle)($scope.$new()));\n\n    var headerBarCtrl = headerBarEle.data('$ionHeaderBarController');\n    headerBarCtrl.backButtonIcon = $ionicConfig.backButton.icon();\n    headerBarCtrl.backButtonText = $ionicConfig.backButton.text();\n\n    var headerBarInstance = {\n      isActive: isActive,\n      title: function(newTitleText) {\n        headerBarCtrl.title(newTitleText);\n      },\n      setItem: function(navBarItemEle, itemType) {\n        // first make sure any exiting nav bar item has been removed\n        headerBarInstance.removeItem(itemType);\n\n        if (navBarItemEle) {\n          if (itemType === 'title') {\n            // clear out the text based title\n            headerBarInstance.title(\"\");\n          }\n\n          // there's a custom nav bar item\n          positionItem(navBarItemEle, itemType);\n\n          if (navEle[itemType]) {\n            // make sure the default on this itemType is hidden\n            navEle[itemType].addClass(CSS_HIDE);\n          }\n          lastViewItemEle[itemType] = navBarItemEle;\n\n        } else if (navEle[itemType]) {\n          // there's a default button for this side and no view button\n          navEle[itemType].removeClass(CSS_HIDE);\n        }\n      },\n      removeItem: function(itemType) {\n        if (lastViewItemEle[itemType]) {\n          lastViewItemEle[itemType].scope().$destroy();\n          lastViewItemEle[itemType].remove();\n          lastViewItemEle[itemType] = null;\n        }\n      },\n      containerEle: function() {\n        return containerEle;\n      },\n      headerBarEle: function() {\n        return headerBarEle;\n      },\n      afterLeave: function() {\n        forEach(ITEM_TYPES, function(itemType) {\n          headerBarInstance.removeItem(itemType);\n        });\n        headerBarCtrl.resetBackButton();\n      },\n      controller: function() {\n        return headerBarCtrl;\n      },\n      destroy: function() {\n        forEach(ITEM_TYPES, function(itemType) {\n          headerBarInstance.removeItem(itemType);\n        });\n        containerEle.scope().$destroy();\n        for (var n in navEle) {\n          if (navEle[n]) {\n            navEle[n].removeData();\n            navEle[n] = null;\n          }\n        }\n        leftButtonsEle && leftButtonsEle.removeData();\n        rightButtonsEle && rightButtonsEle.removeData();\n        titleEle.removeData();\n        headerBarEle.removeData();\n        containerEle.remove();\n        containerEle = headerBarEle = titleEle = leftButtonsEle = rightButtonsEle = null;\n      }\n    };\n\n    function positionItem(ele, itemType) {\n      if (!ele) return;\n\n      if (itemType === 'title') {\n        // title element\n        titleEle.append(ele);\n\n      } else if (itemType == 'rightButtons' ||\n                (itemType == SECONDARY_BUTTONS && $ionicConfig.navBar.positionSecondaryButtons() != 'left') ||\n                (itemType == PRIMARY_BUTTONS && $ionicConfig.navBar.positionPrimaryButtons() == 'right')) {\n        // right side\n        if (!rightButtonsEle) {\n          rightButtonsEle = jqLite('<div class=\"buttons buttons-right\">');\n          headerBarEle.append(rightButtonsEle);\n        }\n        if (itemType == SECONDARY_BUTTONS) {\n          rightButtonsEle.append(ele);\n        } else {\n          rightButtonsEle.prepend(ele);\n        }\n\n      } else {\n        // left side\n        if (!leftButtonsEle) {\n          leftButtonsEle = jqLite('<div class=\"buttons buttons-left\">');\n          if (navEle[BACK_BUTTON]) {\n            navEle[BACK_BUTTON].after(leftButtonsEle);\n          } else {\n            headerBarEle.prepend(leftButtonsEle);\n          }\n        }\n        if (itemType == SECONDARY_BUTTONS) {\n          leftButtonsEle.append(ele);\n        } else {\n          leftButtonsEle.prepend(ele);\n        }\n      }\n\n    }\n\n    headerBars.push(headerBarInstance);\n\n    return headerBarInstance;\n  };\n\n\n  self.navElement = function(type, html) {\n    if (isDefined(html)) {\n      navElementHtml[type] = html;\n    }\n    return navElementHtml[type];\n  };\n\n\n  self.update = function(viewData) {\n    var showNavBar = !viewData.hasHeaderBar && viewData.showNavBar;\n    viewData.transition = $ionicConfig.views.transition();\n\n    if (!showNavBar) {\n      viewData.direction = 'none';\n    }\n\n    self.enable(showNavBar);\n    var enteringHeaderBar = self.isInitialized ? getOffScreenHeaderBar() : getOnScreenHeaderBar();\n    var leavingHeaderBar = self.isInitialized ? getOnScreenHeaderBar() : null;\n    var enteringHeaderCtrl = enteringHeaderBar.controller();\n\n    // update if the entering header should show the back button or not\n    enteringHeaderCtrl.enableBack(viewData.enableBack, true);\n    enteringHeaderCtrl.showBack(viewData.showBack, true);\n    enteringHeaderCtrl.updateBackButton();\n\n    // update the entering header bar's title\n    self.title(viewData.title, enteringHeaderBar);\n\n    self.showBar(showNavBar);\n\n    // update the nav bar items, depending if the view has their own or not\n    if (viewData.navBarItems) {\n      forEach(ITEM_TYPES, function(itemType) {\n        enteringHeaderBar.setItem(viewData.navBarItems[itemType], itemType);\n      });\n    }\n\n    // begin transition of entering and leaving header bars\n    self.transition(enteringHeaderBar, leavingHeaderBar, viewData);\n\n    self.isInitialized = true;\n    navSwipeAttr('');\n  };\n\n\n  self.transition = function(enteringHeaderBar, leavingHeaderBar, viewData) {\n    var enteringHeaderBarCtrl = enteringHeaderBar.controller();\n    var transitionFn = $ionicConfig.transitions.navBar[viewData.navBarTransition] || $ionicConfig.transitions.navBar.none;\n    var transitionId = viewData.transitionId;\n\n    enteringHeaderBarCtrl.beforeEnter(viewData);\n\n    var navBarTransition = transitionFn(enteringHeaderBar, leavingHeaderBar, viewData.direction, viewData.shouldAnimate && self.isInitialized);\n\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-transition', viewData.navBarTransition);\n    ionic.DomUtil.cachedAttr($element, 'nav-bar-direction', viewData.direction);\n\n    if (navBarTransition.shouldAnimate && viewData.renderEnd) {\n      navBarAttr(enteringHeaderBar, 'stage');\n    } else {\n      navBarAttr(enteringHeaderBar, 'entering');\n      navBarAttr(leavingHeaderBar, 'leaving');\n    }\n\n    enteringHeaderBarCtrl.resetBackButton(viewData);\n\n    navBarTransition.run(0);\n\n    self.activeTransition = {\n      run: function(step) {\n        navBarTransition.shouldAnimate = false;\n        navBarTransition.direction = 'back';\n        navBarTransition.run(step);\n      },\n      cancel: function(shouldAnimate, speed, cancelData) {\n        navSwipeAttr(speed);\n        navBarAttr(leavingHeaderBar, 'active');\n        navBarAttr(enteringHeaderBar, 'cached');\n        navBarTransition.shouldAnimate = shouldAnimate;\n        navBarTransition.run(0);\n        self.activeTransition = navBarTransition = null;\n\n        var runApply;\n        if (cancelData.showBar !== self.showBar()) {\n          self.showBar(cancelData.showBar);\n        }\n        if (cancelData.showBackButton !== self.showBackButton()) {\n          self.showBackButton(cancelData.showBackButton);\n        }\n        if (runApply) {\n          $scope.$apply();\n        }\n      },\n      complete: function(shouldAnimate, speed) {\n        navSwipeAttr(speed);\n        navBarTransition.shouldAnimate = shouldAnimate;\n        navBarTransition.run(1);\n        queuedTransitionEnd = transitionEnd;\n      }\n    };\n\n    $timeout(enteringHeaderBarCtrl.align, 16);\n\n    queuedTransitionStart = function() {\n      if (latestTransitionId !== transitionId) return;\n\n      navBarAttr(enteringHeaderBar, 'entering');\n      navBarAttr(leavingHeaderBar, 'leaving');\n\n      navBarTransition.run(1);\n\n      queuedTransitionEnd = function() {\n        if (latestTransitionId == transitionId || !navBarTransition.shouldAnimate) {\n          transitionEnd();\n        }\n      };\n\n      queuedTransitionStart = null;\n    };\n\n    function transitionEnd() {\n      for (var x = 0; x < headerBars.length; x++) {\n        headerBars[x].isActive = false;\n      }\n      enteringHeaderBar.isActive = true;\n\n      navBarAttr(enteringHeaderBar, 'active');\n      navBarAttr(leavingHeaderBar, 'cached');\n\n      self.activeTransition = navBarTransition = queuedTransitionEnd = null;\n    }\n\n    queuedTransitionStart();\n  };\n\n\n  self.triggerTransitionStart = function(triggerTransitionId) {\n    latestTransitionId = triggerTransitionId;\n    queuedTransitionStart && queuedTransitionStart();\n  };\n\n\n  self.triggerTransitionEnd = function() {\n    queuedTransitionEnd && queuedTransitionEnd();\n  };\n\n\n  self.showBar = function(shouldShow) {\n    if (arguments.length) {\n      self.visibleBar(shouldShow);\n      $scope.$parent.$hasHeader = !!shouldShow;\n    }\n    return !!$scope.$parent.$hasHeader;\n  };\n\n\n  self.visibleBar = function(shouldShow) {\n    if (shouldShow && !isVisible) {\n      $element.removeClass(CSS_HIDE);\n      self.align();\n    } else if (!shouldShow && isVisible) {\n      $element.addClass(CSS_HIDE);\n    }\n    isVisible = shouldShow;\n  };\n\n\n  self.enable = function(val) {\n    // set primary to show first\n    self.visibleBar(val);\n\n    // set non primary to hide second\n    for (var x = 0; x < $ionicNavBarDelegate._instances.length; x++) {\n      if ($ionicNavBarDelegate._instances[x] !== self) $ionicNavBarDelegate._instances[x].visibleBar(false);\n    }\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavBar#showBackButton\n   * @description Show/hide the nav bar back button when there is a\n   * back view. If the back button is not possible, for example, the\n   * first view in the stack, then this will not force the back button\n   * to show.\n   */\n  self.showBackButton = function(shouldShow) {\n    if (arguments.length) {\n      for (var x = 0; x < headerBars.length; x++) {\n        headerBars[x].controller().showNavBack(!!shouldShow);\n      }\n      $scope.$isBackButtonShown = !!shouldShow;\n    }\n    return $scope.$isBackButtonShown;\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavBar#showActiveBackButton\n   * @description Show/hide only the active header bar's back button.\n   */\n  self.showActiveBackButton = function(shouldShow) {\n    var headerBar = getOnScreenHeaderBar();\n    if (headerBar) {\n      if (arguments.length) {\n        return headerBar.controller().showBack(shouldShow);\n      }\n      return headerBar.controller().showBack();\n    }\n  };\n\n\n  self.title = function(newTitleText, headerBar) {\n    if (isDefined(newTitleText)) {\n      newTitleText = newTitleText || '';\n      headerBar = headerBar || getOnScreenHeaderBar();\n      headerBar && headerBar.title(newTitleText);\n      $scope.$title = newTitleText;\n      $ionicHistory.currentTitle(newTitleText);\n    }\n    return $scope.$title;\n  };\n\n\n  self.align = function(val, headerBar) {\n    headerBar = headerBar || getOnScreenHeaderBar();\n    headerBar && headerBar.controller().align(val);\n  };\n\n\n  self.hasTabsTop = function(isTabsTop) {\n    $element[isTabsTop ? 'addClass' : 'removeClass']('nav-bar-tabs-top');\n  };\n\n  self.hasBarSubheader = function(isBarSubheader) {\n    $element[isBarSubheader ? 'addClass' : 'removeClass']('nav-bar-has-subheader');\n  };\n\n  // DEPRECATED, as of v1.0.0-beta14 -------\n  self.changeTitle = function(val) {\n    deprecatedWarning('changeTitle(val)', 'title(val)');\n    self.title(val);\n  };\n  self.setTitle = function(val) {\n    deprecatedWarning('setTitle(val)', 'title(val)');\n    self.title(val);\n  };\n  self.getTitle = function() {\n    deprecatedWarning('getTitle()', 'title()');\n    return self.title();\n  };\n  self.back = function() {\n    deprecatedWarning('back()', '$ionicHistory.goBack()');\n    $ionicHistory.goBack();\n  };\n  self.getPreviousTitle = function() {\n    deprecatedWarning('getPreviousTitle()', '$ionicHistory.backTitle()');\n    $ionicHistory.goBack();\n  };\n  function deprecatedWarning(oldMethod, newMethod) {\n    var warn = console.warn || console.log;\n    warn && warn.call(console, 'navBarController.' + oldMethod + ' is deprecated, please use ' + newMethod + ' instead');\n  }\n  // END DEPRECATED -------\n\n\n  function createNavElement(type) {\n    if (navElementHtml[type]) {\n      return jqLite(navElementHtml[type]);\n    }\n  }\n\n\n  function getOnScreenHeaderBar() {\n    for (var x = 0; x < headerBars.length; x++) {\n      if (headerBars[x].isActive) return headerBars[x];\n    }\n  }\n\n\n  function getOffScreenHeaderBar() {\n    for (var x = 0; x < headerBars.length; x++) {\n      if (!headerBars[x].isActive) return headerBars[x];\n    }\n  }\n\n\n  function navBarAttr(ctrl, val) {\n    ctrl && ionic.DomUtil.cachedAttr(ctrl.containerEle(), 'nav-bar', val);\n  }\n\n  function navSwipeAttr(val) {\n    ionic.DomUtil.cachedAttr($element, 'nav-swipe', val);\n  }\n\n\n  $scope.$on('$destroy', function() {\n    $scope.$parent.$hasHeader = false;\n    $element.parent().removeData(DATA_NAV_BAR_CTRL);\n    for (var x = 0; x < headerBars.length; x++) {\n      headerBars[x].destroy();\n    }\n    $element.remove();\n    $element = headerBars = null;\n    deregisterInstance();\n  });\n\n}]);\n\nIonicModule\n.controller('$ionicNavView', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$controller',\n  '$ionicNavBarDelegate',\n  '$ionicNavViewDelegate',\n  '$ionicHistory',\n  '$ionicViewSwitcher',\n  '$ionicConfig',\n  '$ionicScrollDelegate',\nfunction($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate, $ionicNavViewDelegate, $ionicHistory, $ionicViewSwitcher, $ionicConfig, $ionicScrollDelegate) {\n\n  var DATA_ELE_IDENTIFIER = '$eleId';\n  var DATA_DESTROY_ELE = '$destroyEle';\n  var DATA_NO_CACHE = '$noCache';\n  var VIEW_STATUS_ACTIVE = 'active';\n  var VIEW_STATUS_CACHED = 'cached';\n\n  var self = this;\n  var direction;\n  var isPrimary = false;\n  var navBarDelegate;\n  var activeEleId;\n  var navViewAttr = $ionicViewSwitcher.navViewAttr;\n  var disableRenderStartViewId, disableAnimation;\n\n  self.scope = $scope;\n  self.element = $element;\n\n  self.init = function() {\n    var navViewName = $attrs.name || '';\n\n    // Find the details of the parent view directive (if any) and use it\n    // to derive our own qualified view name, then hang our own details\n    // off the DOM so child directives can find it.\n    var parent = $element.parent().inheritedData('$uiView');\n    var parentViewName = ((parent && parent.state) ? parent.state.name : '');\n    if (navViewName.indexOf('@') < 0) navViewName = navViewName + '@' + parentViewName;\n\n    var viewData = { name: navViewName, state: null };\n    $element.data('$uiView', viewData);\n\n    var deregisterInstance = $ionicNavViewDelegate._registerInstance(self, $attrs.delegateHandle);\n    $scope.$on('$destroy', function() {\n      deregisterInstance();\n\n      // ensure no scrolls have been left frozen\n      if (self.isSwipeFreeze) {\n        $ionicScrollDelegate.freezeAllScrolls(false);\n      }\n    });\n\n    $scope.$on('$ionicHistory.deselect', self.cacheCleanup);\n    $scope.$on('$ionicTabs.top', onTabsTop);\n    $scope.$on('$ionicSubheader', onBarSubheader);\n\n    $scope.$on('$ionicTabs.beforeLeave', onTabsLeave);\n    $scope.$on('$ionicTabs.afterLeave', onTabsLeave);\n    $scope.$on('$ionicTabs.leave', onTabsLeave);\n\n    ionic.Platform.ready(function() {\n      if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) {\n        self.initSwipeBack();\n      }\n    });\n\n    return viewData;\n  };\n\n\n  self.register = function(viewLocals) {\n    var leavingView = extend({}, $ionicHistory.currentView());\n\n    // register that a view is coming in and get info on how it should transition\n    var registerData = $ionicHistory.register($scope, viewLocals);\n\n    // update which direction\n    self.update(registerData);\n\n    // begin rendering and transitioning\n    var enteringView = $ionicHistory.getViewById(registerData.viewId) || {};\n\n    var renderStart = (disableRenderStartViewId !== registerData.viewId);\n    self.render(registerData, viewLocals, enteringView, leavingView, renderStart, true);\n  };\n\n\n  self.update = function(registerData) {\n    // always reset that this is the primary navView\n    isPrimary = true;\n\n    // remember what direction this navView should use\n    // this may get updated later by a child navView\n    direction = registerData.direction;\n\n    var parentNavViewCtrl = $element.parent().inheritedData('$ionNavViewController');\n    if (parentNavViewCtrl) {\n      // this navView is nested inside another one\n      // update the parent to use this direction and not\n      // the other it originally was set to\n\n      // inform the parent navView that it is not the primary navView\n      parentNavViewCtrl.isPrimary(false);\n\n      if (direction === 'enter' || direction === 'exit') {\n        // they're entering/exiting a history\n        // find parent navViewController\n        parentNavViewCtrl.direction(direction);\n\n        if (direction === 'enter') {\n          // reset the direction so this navView doesn't animate\n          // because it's parent will\n          direction = 'none';\n        }\n      }\n    }\n  };\n\n\n  self.render = function(registerData, viewLocals, enteringView, leavingView, renderStart, renderEnd) {\n    // register the view and figure out where it lives in the various\n    // histories and nav stacks, along with how views should enter/leave\n    var switcher = $ionicViewSwitcher.create(self, viewLocals, enteringView, leavingView, renderStart, renderEnd);\n\n    // init the rendering of views for this navView directive\n    switcher.init(registerData, function() {\n      // the view is now compiled, in the dom and linked, now lets transition the views.\n      // this uses a callback incase THIS nav-view has a nested nav-view, and after the NESTED\n      // nav-view links, the NESTED nav-view would update which direction THIS nav-view should use\n\n      // kick off the transition of views\n      switcher.transition(self.direction(), registerData.enableBack, !disableAnimation);\n\n      // reset private vars for next time\n      disableRenderStartViewId = disableAnimation = null;\n    });\n\n  };\n\n\n  self.beforeEnter = function(transitionData) {\n    if (isPrimary) {\n      // only update this nav-view's nav-bar if this is the primary nav-view\n      navBarDelegate = transitionData.navBarDelegate;\n      var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n      associatedNavBarCtrl && associatedNavBarCtrl.update(transitionData);\n      navSwipeAttr('');\n    }\n  };\n\n\n  self.activeEleId = function(eleId) {\n    if (arguments.length) {\n      activeEleId = eleId;\n    }\n    return activeEleId;\n  };\n\n\n  self.transitionEnd = function() {\n    var viewElements = $element.children();\n    var x, l, viewElement;\n\n    for (x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n\n      if (viewElement.data(DATA_ELE_IDENTIFIER) === activeEleId) {\n        // this is the active element\n        navViewAttr(viewElement, VIEW_STATUS_ACTIVE);\n\n      } else if (navViewAttr(viewElement) === 'leaving' || navViewAttr(viewElement) === VIEW_STATUS_ACTIVE || navViewAttr(viewElement) === VIEW_STATUS_CACHED) {\n        // this is a leaving element or was the former active element, or is an cached element\n        if (viewElement.data(DATA_DESTROY_ELE) || viewElement.data(DATA_NO_CACHE)) {\n          // this element shouldn't stay cached\n          $ionicViewSwitcher.destroyViewEle(viewElement);\n\n        } else {\n          // keep in the DOM, mark as cached\n          navViewAttr(viewElement, VIEW_STATUS_CACHED);\n\n          // disconnect the leaving scope\n          ionic.Utils.disconnectScope(viewElement.scope());\n        }\n      }\n    }\n\n    navSwipeAttr('');\n\n    // ensure no scrolls have been left frozen\n    if (self.isSwipeFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n  };\n\n\n  function onTabsLeave(ev, data) {\n    var viewElements = $element.children();\n    var viewElement, viewScope;\n\n    for (var x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n      if (navViewAttr(viewElement) == VIEW_STATUS_ACTIVE) {\n        viewScope = viewElement.scope();\n        viewScope && viewScope.$emit(ev.name.replace('Tabs', 'View'), data);\n        break;\n      }\n    }\n  }\n\n\n  self.cacheCleanup = function() {\n    var viewElements = $element.children();\n    for (var x = 0, l = viewElements.length; x < l; x++) {\n      if (viewElements.eq(x).data(DATA_DESTROY_ELE)) {\n        $ionicViewSwitcher.destroyViewEle(viewElements.eq(x));\n      }\n    }\n  };\n\n\n  self.clearCache = function(stateIds) {\n    var viewElements = $element.children();\n    var viewElement, viewScope, x, l, y, eleIdentifier;\n\n    for (x = 0, l = viewElements.length; x < l; x++) {\n      viewElement = viewElements.eq(x);\n\n      if (stateIds) {\n        eleIdentifier = viewElement.data(DATA_ELE_IDENTIFIER);\n\n        for (y = 0; y < stateIds.length; y++) {\n          if (eleIdentifier === stateIds[y]) {\n            $ionicViewSwitcher.destroyViewEle(viewElement);\n          }\n        }\n        continue;\n      }\n\n      if (navViewAttr(viewElement) == VIEW_STATUS_CACHED) {\n        $ionicViewSwitcher.destroyViewEle(viewElement);\n\n      } else if (navViewAttr(viewElement) == VIEW_STATUS_ACTIVE) {\n        viewScope = viewElement.scope();\n        viewScope && viewScope.$broadcast('$ionicView.clearCache');\n      }\n\n    }\n  };\n\n\n  self.getViewElements = function() {\n    return $element.children();\n  };\n\n\n  self.appendViewElement = function(viewEle, viewLocals) {\n    // compile the entering element and get the link function\n    var linkFn = $compile(viewEle);\n\n    $element.append(viewEle);\n\n    var viewScope = $scope.$new();\n\n    if (viewLocals && viewLocals.$$controller) {\n      viewLocals.$scope = viewScope;\n      var controller = $controller(viewLocals.$$controller, viewLocals);\n      $element.children().data('$ngControllerController', controller);\n    }\n\n    linkFn(viewScope);\n\n    return viewScope;\n  };\n\n\n  self.title = function(val) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.title(val);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavView#enableBackButton\n   * @description Enable/disable if the back button can be shown or not. For\n   * example, the very first view in the navigation stack would not have a\n   * back view, so the back button would be disabled.\n   */\n  self.enableBackButton = function(shouldEnable) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.enableBackButton(shouldEnable);\n  };\n\n\n  /**\n   * @ngdoc method\n   * @name $ionicNavView#showBackButton\n   * @description Show/hide the nav bar active back button. If the back button\n   * is not possible this will not force the back button to show. The\n   * `enableBackButton()` method handles if a back button is even possible or not.\n   */\n  self.showBackButton = function(shouldShow) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    if (associatedNavBarCtrl) {\n      if (arguments.length) {\n        return associatedNavBarCtrl.showActiveBackButton(shouldShow);\n      }\n      return associatedNavBarCtrl.showActiveBackButton();\n    }\n    return true;\n  };\n\n\n  self.showBar = function(val) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    if (associatedNavBarCtrl) {\n      if (arguments.length) {\n        return associatedNavBarCtrl.showBar(val);\n      }\n      return associatedNavBarCtrl.showBar();\n    }\n    return true;\n  };\n\n\n  self.isPrimary = function(val) {\n    if (arguments.length) {\n      isPrimary = val;\n    }\n    return isPrimary;\n  };\n\n\n  self.direction = function(val) {\n    if (arguments.length) {\n      direction = val;\n    }\n    return direction;\n  };\n\n\n  self.initSwipeBack = function() {\n    var swipeBackHitWidth = $ionicConfig.views.swipeBackHitWidth();\n    var viewTransition, associatedNavBarCtrl, backView;\n    var deregDragStart, deregDrag, deregRelease;\n    var windowWidth, startDragX, dragPoints;\n    var cancelData = {};\n\n    function onDragStart(ev) {\n      if (!isPrimary) return;\n\n      startDragX = getDragX(ev);\n      if (startDragX > swipeBackHitWidth) return;\n\n      backView = $ionicHistory.backView();\n\n      var currentView = $ionicHistory.currentView();\n\n      if (!backView || backView.historyId !== currentView.historyId || currentView.canSwipeBack === false) return;\n\n      if (!windowWidth) windowWidth = window.innerWidth;\n\n      self.isSwipeFreeze = $ionicScrollDelegate.freezeAllScrolls(true);\n\n      var registerData = {\n        direction: 'back'\n      };\n\n      dragPoints = [];\n\n      cancelData = {\n        showBar: self.showBar(),\n        showBackButton: self.showBackButton()\n      };\n\n      var switcher = $ionicViewSwitcher.create(self, registerData, backView, currentView, true, false);\n      switcher.loadViewElements(registerData);\n      switcher.render(registerData);\n\n      viewTransition = switcher.transition('back', $ionicHistory.enabledBack(backView), true);\n\n      associatedNavBarCtrl = getAssociatedNavBarCtrl();\n\n      deregDrag = ionic.onGesture('drag', onDrag, $element[0]);\n      deregRelease = ionic.onGesture('release', onRelease, $element[0]);\n    }\n\n    function onDrag(ev) {\n      if (isPrimary && viewTransition) {\n        var dragX = getDragX(ev);\n\n        dragPoints.push({\n          t: Date.now(),\n          x: dragX\n        });\n\n        if (dragX >= windowWidth - 15) {\n          onRelease(ev);\n\n        } else {\n          var step = Math.min(Math.max(getSwipeCompletion(dragX), 0), 1);\n          viewTransition.run(step);\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.run(step);\n        }\n\n      }\n    }\n\n    function onRelease(ev) {\n      if (isPrimary && viewTransition && dragPoints && dragPoints.length > 1) {\n\n        var now = Date.now();\n        var releaseX = getDragX(ev);\n        var startDrag = dragPoints[dragPoints.length - 1];\n\n        for (var x = dragPoints.length - 2; x >= 0; x--) {\n          if (now - startDrag.t > 200) {\n            break;\n          }\n          startDrag = dragPoints[x];\n        }\n\n        var isSwipingRight = (releaseX >= dragPoints[dragPoints.length - 2].x);\n        var releaseSwipeCompletion = getSwipeCompletion(releaseX);\n        var velocity = Math.abs(startDrag.x - releaseX) / (now - startDrag.t);\n\n        // private variables because ui-router has no way to pass custom data using $state.go\n        disableRenderStartViewId = backView.viewId;\n        disableAnimation = (releaseSwipeCompletion < 0.03 || releaseSwipeCompletion > 0.97);\n\n        if (isSwipingRight && (releaseSwipeCompletion > 0.5 || velocity > 0.1)) {\n          // complete view transition on release\n          var speed = (velocity > 0.5 || velocity < 0.05 || releaseX > windowWidth - 45) ? 'fast' : 'slow';\n          navSwipeAttr(disableAnimation ? '' : speed);\n          backView.go();\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.complete(!disableAnimation, speed);\n\n        } else {\n          // cancel view transition on release\n          navSwipeAttr(disableAnimation ? '' : 'fast');\n          disableRenderStartViewId = null;\n          viewTransition.cancel(!disableAnimation);\n          associatedNavBarCtrl && associatedNavBarCtrl.activeTransition && associatedNavBarCtrl.activeTransition.cancel(!disableAnimation, 'fast', cancelData);\n          disableAnimation = null;\n        }\n\n      }\n\n      ionic.offGesture(deregDrag, 'drag', onDrag);\n      ionic.offGesture(deregRelease, 'release', onRelease);\n\n      windowWidth = viewTransition = dragPoints = null;\n\n      self.isSwipeFreeze = $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n\n    function getDragX(ev) {\n      return ionic.tap.pointerCoord(ev.gesture.srcEvent).x;\n    }\n\n    function getSwipeCompletion(dragX) {\n      return (dragX - startDragX) / windowWidth;\n    }\n\n    deregDragStart = ionic.onGesture('dragstart', onDragStart, $element[0]);\n\n    $scope.$on('$destroy', function() {\n      ionic.offGesture(deregDragStart, 'dragstart', onDragStart);\n      ionic.offGesture(deregDrag, 'drag', onDrag);\n      ionic.offGesture(deregRelease, 'release', onRelease);\n      self.element = viewTransition = associatedNavBarCtrl = null;\n    });\n  };\n\n\n  function navSwipeAttr(val) {\n    ionic.DomUtil.cachedAttr($element, 'nav-swipe', val);\n  }\n\n\n  function onTabsTop(ev, isTabsTop) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.hasTabsTop(isTabsTop);\n  }\n\n  function onBarSubheader(ev, isBarSubheader) {\n    var associatedNavBarCtrl = getAssociatedNavBarCtrl();\n    associatedNavBarCtrl && associatedNavBarCtrl.hasBarSubheader(isBarSubheader);\n  }\n\n  function getAssociatedNavBarCtrl() {\n    if (navBarDelegate) {\n      for (var x = 0; x < $ionicNavBarDelegate._instances.length; x++) {\n        if ($ionicNavBarDelegate._instances[x].$$delegateHandle == navBarDelegate) {\n          return $ionicNavBarDelegate._instances[x];\n        }\n      }\n    }\n    return $element.inheritedData('$ionNavBarController');\n  }\n\n}]);\n\nIonicModule\n.controller('$ionicRefresher', [\n  '$scope',\n  '$attrs',\n  '$element',\n  '$ionicBind',\n  '$timeout',\n  function($scope, $attrs, $element, $ionicBind, $timeout) {\n    var self = this,\n        isDragging = false,\n        isOverscrolling = false,\n        dragOffset = 0,\n        lastOverscroll = 0,\n        ptrThreshold = 60,\n        activated = false,\n        scrollTime = 500,\n        startY = null,\n        deltaY = null,\n        canOverscroll = true,\n        scrollParent,\n        scrollChild;\n\n    if (!isDefined($attrs.pullingIcon)) {\n      $attrs.$set('pullingIcon', 'ion-android-arrow-down');\n    }\n\n    $scope.showSpinner = !isDefined($attrs.refreshingIcon) && $attrs.spinner != 'none';\n\n    $scope.showIcon = isDefined($attrs.refreshingIcon);\n\n    $ionicBind($scope, $attrs, {\n      pullingIcon: '@',\n      pullingText: '@',\n      refreshingIcon: '@',\n      refreshingText: '@',\n      spinner: '@',\n      disablePullingRotation: '@',\n      $onRefresh: '&onRefresh',\n      $onPulling: '&onPulling'\n    });\n\n    function handleTouchend() {\n      // if this wasn't an overscroll, get out immediately\n      if (!canOverscroll && !isDragging) {\n        return;\n      }\n      // reset Y\n      startY = null;\n      // the user has overscrolled but went back to native scrolling\n      if (!isDragging) {\n        dragOffset = 0;\n        isOverscrolling = false;\n        setScrollLock(false);\n      } else {\n        isDragging = false;\n        dragOffset = 0;\n\n        // the user has scroll far enough to trigger a refresh\n        if (lastOverscroll > ptrThreshold) {\n          start();\n          scrollTo(ptrThreshold, scrollTime);\n\n        // the user has overscrolled but not far enough to trigger a refresh\n        } else {\n          scrollTo(0, scrollTime, deactivate);\n          isOverscrolling = false;\n        }\n      }\n    }\n\n    function handleTouchmove(e) {\n      // if multitouch or regular scroll event, get out immediately\n      if (!canOverscroll || e.touches.length > 1) {\n        return;\n      }\n      //if this is a new drag, keep track of where we start\n      if (startY === null) {\n        startY = parseInt(e.touches[0].screenY, 10);\n      }\n\n      // kitkat fix for touchcancel events http://updates.html5rocks.com/2014/05/A-More-Compatible-Smoother-Touch\n      if (ionic.Platform.isAndroid() && ionic.Platform.version() === 4.4 && scrollParent.scrollTop === 0) {\n        isDragging = true;\n        e.preventDefault();\n      }\n\n      // how far have we dragged so far?\n      deltaY = parseInt(e.touches[0].screenY, 10) - startY;\n\n      // if we've dragged up and back down in to native scroll territory\n      if (deltaY - dragOffset <= 0 || scrollParent.scrollTop !== 0) {\n\n        if (isOverscrolling) {\n          isOverscrolling = false;\n          setScrollLock(false);\n        }\n\n        if (isDragging) {\n          nativescroll(scrollParent, parseInt(deltaY - dragOffset, 10) * -1);\n        }\n\n        // if we're not at overscroll 0 yet, 0 out\n        if (lastOverscroll !== 0) {\n          overscroll(0);\n        }\n        return;\n\n      } else if (deltaY > 0 && scrollParent.scrollTop === 0 && !isOverscrolling) {\n        // starting overscroll, but drag started below scrollTop 0, so we need to offset the position\n        dragOffset = deltaY;\n      }\n\n      // prevent native scroll events while overscrolling\n      e.preventDefault();\n\n      // if not overscrolling yet, initiate overscrolling\n      if (!isOverscrolling) {\n        isOverscrolling = true;\n        setScrollLock(true);\n      }\n\n      isDragging = true;\n      // overscroll according to the user's drag so far\n      overscroll(parseInt((deltaY - dragOffset) / 3, 10));\n\n      // update the icon accordingly\n      if (!activated && lastOverscroll > ptrThreshold) {\n        activated = true;\n        ionic.requestAnimationFrame(activate);\n\n      } else if (activated && lastOverscroll < ptrThreshold) {\n        activated = false;\n        ionic.requestAnimationFrame(deactivate);\n      }\n    }\n\n    function handleScroll(e) {\n      // canOverscrol is used to greatly simplify the drag handler during normal scrolling\n      canOverscroll = (e.target.scrollTop === 0) || isDragging;\n    }\n\n    function overscroll(val) {\n      scrollChild.style[ionic.CSS.TRANSFORM] = 'translateY(' + val + 'px)';\n      lastOverscroll = val;\n    }\n\n    function nativescroll(target, newScrollTop) {\n      // creates a scroll event that bubbles, can be cancelled, and with its view\n      // and detail property initialized to window and 1, respectively\n      target.scrollTop = newScrollTop;\n      var e = document.createEvent(\"UIEvents\");\n      e.initUIEvent(\"scroll\", true, true, window, 1);\n      target.dispatchEvent(e);\n    }\n\n    function setScrollLock(enabled) {\n      // set the scrollbar to be position:fixed in preparation to overscroll\n      // or remove it so the app can be natively scrolled\n      if (enabled) {\n        ionic.requestAnimationFrame(function() {\n          scrollChild.classList.add('overscroll');\n          show();\n        });\n\n      } else {\n        ionic.requestAnimationFrame(function() {\n          scrollChild.classList.remove('overscroll');\n          hide();\n          deactivate();\n        });\n      }\n    }\n\n    $scope.$on('scroll.refreshComplete', function() {\n      // prevent the complete from firing before the scroll has started\n      $timeout(function() {\n\n        ionic.requestAnimationFrame(tail);\n\n        // scroll back to home during tail animation\n        scrollTo(0, scrollTime, deactivate);\n\n        // return to native scrolling after tail animation has time to finish\n        $timeout(function() {\n\n          if (isOverscrolling) {\n            isOverscrolling = false;\n            setScrollLock(false);\n          }\n\n        }, scrollTime);\n\n      }, scrollTime);\n    });\n\n    function scrollTo(Y, duration, callback) {\n      // scroll animation loop w/ easing\n      // credit https://gist.github.com/dezinezync/5487119\n      var start = Date.now(),\n          from = lastOverscroll;\n\n      if (from === Y) {\n        callback();\n        return; /* Prevent scrolling to the Y point if already there */\n      }\n\n      // decelerating to zero velocity\n      function easeOutCubic(t) {\n        return (--t) * t * t + 1;\n      }\n\n      // scroll loop\n      function scroll() {\n        var currentTime = Date.now(),\n          time = Math.min(1, ((currentTime - start) / duration)),\n          // where .5 would be 50% of time on a linear scale easedT gives a\n          // fraction based on the easing method\n          easedT = easeOutCubic(time);\n\n        overscroll(parseInt((easedT * (Y - from)) + from, 10));\n\n        if (time < 1) {\n          ionic.requestAnimationFrame(scroll);\n\n        } else {\n\n          if (Y < 5 && Y > -5) {\n            isOverscrolling = false;\n            setScrollLock(false);\n          }\n\n          callback && callback();\n        }\n      }\n\n      // start scroll loop\n      ionic.requestAnimationFrame(scroll);\n    }\n\n\n    self.init = function() {\n      scrollParent = $element.parent().parent()[0];\n      scrollChild = $element.parent()[0];\n\n      if (!scrollParent || !scrollParent.classList.contains('ionic-scroll') ||\n        !scrollChild || !scrollChild.classList.contains('scroll')) {\n        throw new Error('Refresher must be immediate child of ion-content or ion-scroll');\n      }\n\n      ionic.on('touchmove', handleTouchmove, scrollChild);\n      ionic.on('touchend', handleTouchend, scrollChild);\n      ionic.on('scroll', handleScroll, scrollParent);\n\n      // cleanup when done\n      $scope.$on('$destroy', destroy);\n    };\n\n    function destroy() {\n      ionic.off('touchmove', handleTouchmove, scrollChild);\n      ionic.off('touchend', handleTouchend, scrollChild);\n      ionic.off('scroll', handleScroll, scrollParent);\n      scrollParent = null;\n      scrollChild = null;\n    }\n\n    // DOM manipulation and broadcast methods shared by JS and Native Scrolling\n    // getter used by JS Scrolling\n    self.getRefresherDomMethods = function() {\n      return {\n        activate: activate,\n        deactivate: deactivate,\n        start: start,\n        show: show,\n        hide: hide,\n        tail: tail\n      };\n    };\n\n    function activate() {\n      $element[0].classList.add('active');\n      $scope.$onPulling();\n    }\n\n    function deactivate() {\n      // give tail 150ms to finish\n      $timeout(function() {\n        // deactivateCallback\n        $element.removeClass('active refreshing refreshing-tail');\n        if (activated) activated = false;\n      }, 150);\n    }\n\n    function start() {\n      // startCallback\n      $element[0].classList.add('refreshing');\n      $scope.$onRefresh();\n    }\n\n    function show() {\n      // showCallback\n      $element[0].classList.remove('invisible');\n    }\n\n    function hide() {\n      // showCallback\n      $element[0].classList.add('invisible');\n    }\n\n    function tail() {\n      // tailCallback\n      $element[0].classList.add('refreshing-tail');\n    }\n\n    // for testing\n    self.__handleTouchmove = handleTouchmove;\n    self.__getScrollChild = function() { return scrollChild; };\n    self.__getScrollParent = function() { return scrollParent; };\n  }\n]);\n\n/**\n * @private\n */\nIonicModule\n\n.controller('$ionicScroll', [\n  '$scope',\n  'scrollViewOptions',\n  '$timeout',\n  '$window',\n  '$location',\n  '$document',\n  '$ionicScrollDelegate',\n  '$ionicHistory',\nfunction($scope,\n         scrollViewOptions,\n         $timeout,\n         $window,\n         $location,\n         $document,\n         $ionicScrollDelegate,\n         $ionicHistory) {\n\n  var self = this;\n  // for testing\n  self.__timeout = $timeout;\n\n  self._scrollViewOptions = scrollViewOptions; //for testing\n  self.isNative = function() {\n    return !!scrollViewOptions.nativeScrolling;\n  };\n\n  var element = self.element = scrollViewOptions.el;\n  var $element = self.$element = jqLite(element);\n  var scrollView;\n  if (self.isNative()) {\n    scrollView = self.scrollView = new ionic.views.ScrollNative(scrollViewOptions);\n  } else {\n    scrollView = self.scrollView = new ionic.views.Scroll(scrollViewOptions);\n  }\n\n\n  //Attach self to element as a controller so other directives can require this controller\n  //through `require: '$ionicScroll'\n  //Also attach to parent so that sibling elements can require this\n  ($element.parent().length ? $element.parent() : $element)\n    .data('$$ionicScrollController', self);\n\n  var deregisterInstance = $ionicScrollDelegate._registerInstance(\n    self, scrollViewOptions.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n\n  if (!isDefined(scrollViewOptions.bouncing)) {\n    ionic.Platform.ready(function() {\n      if (scrollView.options) {\n        scrollView.options.bouncing = true;\n        if (ionic.Platform.isAndroid()) {\n          // No bouncing by default on Android\n          scrollView.options.bouncing = false;\n          // Faster scroll decel\n          scrollView.options.deceleration = 0.95;\n        }\n      }\n    });\n  }\n\n  var resize = angular.bind(scrollView, scrollView.resize);\n  angular.element($window).on('resize', resize);\n\n  var scrollFunc = function(e) {\n    var detail = (e.originalEvent || e).detail || {};\n    $scope.$onScroll && $scope.$onScroll({\n      event: e,\n      scrollTop: detail.scrollTop || 0,\n      scrollLeft: detail.scrollLeft || 0\n    });\n  };\n\n  $element.on('scroll', scrollFunc);\n\n  $scope.$on('$destroy', function() {\n    deregisterInstance();\n    scrollView && scrollView.__cleanup && scrollView.__cleanup();\n    angular.element($window).off('resize', resize);\n    $element.off('scroll', scrollFunc);\n    scrollView = self.scrollView = scrollViewOptions = self._scrollViewOptions = scrollViewOptions.el = self._scrollViewOptions.el = $element = self.$element = element = null;\n  });\n\n  $timeout(function() {\n    scrollView && scrollView.run && scrollView.run();\n  });\n\n  self.getScrollView = function() {\n    return scrollView;\n  };\n\n  self.getScrollPosition = function() {\n    return scrollView.getValues();\n  };\n\n  self.resize = function() {\n    return $timeout(resize, 0, false).then(function() {\n      $element && $element.triggerHandler('scroll-resize');\n    });\n  };\n\n  self.scrollTop = function(shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollTo(0, 0, !!shouldAnimate);\n    });\n  };\n\n  self.scrollBottom = function(shouldAnimate) {\n    self.resize().then(function() {\n      var max = scrollView.getScrollMax();\n      scrollView.scrollTo(max.left, max.top, !!shouldAnimate);\n    });\n  };\n\n  self.scrollTo = function(left, top, shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollTo(left, top, !!shouldAnimate);\n    });\n  };\n\n  self.zoomTo = function(zoom, shouldAnimate, originLeft, originTop) {\n    self.resize().then(function() {\n      scrollView.zoomTo(zoom, !!shouldAnimate, originLeft, originTop);\n    });\n  };\n\n  self.zoomBy = function(zoom, shouldAnimate, originLeft, originTop) {\n    self.resize().then(function() {\n      scrollView.zoomBy(zoom, !!shouldAnimate, originLeft, originTop);\n    });\n  };\n\n  self.scrollBy = function(left, top, shouldAnimate) {\n    self.resize().then(function() {\n      scrollView.scrollBy(left, top, !!shouldAnimate);\n    });\n  };\n\n  self.anchorScroll = function(shouldAnimate) {\n    self.resize().then(function() {\n      var hash = $location.hash();\n      var elm = hash && $document[0].getElementById(hash);\n      if (!(hash && elm)) {\n        scrollView.scrollTo(0, 0, !!shouldAnimate);\n        return;\n      }\n      var curElm = elm;\n      var scrollLeft = 0, scrollTop = 0;\n      do {\n        if (curElm !== null) scrollLeft += curElm.offsetLeft;\n        if (curElm !== null) scrollTop += curElm.offsetTop;\n        curElm = curElm.offsetParent;\n      } while (curElm.attributes != self.element.attributes && curElm.offsetParent);\n      scrollView.scrollTo(scrollLeft, scrollTop, !!shouldAnimate);\n    });\n  };\n\n  self.freezeScroll = scrollView.freeze;\n\n  self.freezeAllScrolls = function(shouldFreeze) {\n    for (var i = 0; i < $ionicScrollDelegate._instances.length; i++) {\n      $ionicScrollDelegate._instances[i].freezeScroll(shouldFreeze);\n    }\n  };\n\n\n  /**\n   * @private\n   */\n  self._setRefresher = function(refresherScope, refresherElement, refresherMethods) {\n    self.refresher = refresherElement;\n    var refresherHeight = self.refresher.clientHeight || 60;\n    scrollView.activatePullToRefresh(\n      refresherHeight,\n      refresherMethods\n    );\n  };\n\n}]);\n\nIonicModule\n.controller('$ionicSideMenus', [\n  '$scope',\n  '$attrs',\n  '$ionicSideMenuDelegate',\n  '$ionicPlatform',\n  '$ionicBody',\n  '$ionicHistory',\n  '$ionicScrollDelegate',\n  'IONIC_BACK_PRIORITY',\nfunction($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $ionicHistory, $ionicScrollDelegate, IONIC_BACK_PRIORITY) {\n  var self = this;\n  var rightShowing, leftShowing, isDragging;\n  var startX, lastX, offsetX, isAsideExposed;\n  var enableMenuWithBackViews = true;\n\n  self.$scope = $scope;\n\n  self.initialize = function(options) {\n    self.left = options.left;\n    self.right = options.right;\n    self.setContent(options.content);\n    self.dragThresholdX = options.dragThresholdX || 10;\n    $ionicHistory.registerHistory(self.$scope);\n  };\n\n  /**\n   * Set the content view controller if not passed in the constructor options.\n   *\n   * @param {object} content\n   */\n  self.setContent = function(content) {\n    if (content) {\n      self.content = content;\n\n      self.content.onDrag = function(e) {\n        self._handleDrag(e);\n      };\n\n      self.content.endDrag = function(e) {\n        self._endDrag(e);\n      };\n    }\n  };\n\n  self.isOpenLeft = function() {\n    return self.getOpenAmount() > 0;\n  };\n\n  self.isOpenRight = function() {\n    return self.getOpenAmount() < 0;\n  };\n\n  /**\n   * Toggle the left menu to open 100%\n   */\n  self.toggleLeft = function(shouldOpen) {\n    if (isAsideExposed || !self.left.isEnabled) return;\n    var openAmount = self.getOpenAmount();\n    if (arguments.length === 0) {\n      shouldOpen = openAmount <= 0;\n    }\n    self.content.enableAnimation();\n    if (!shouldOpen) {\n      self.openPercentage(0);\n    } else {\n      self.openPercentage(100);\n    }\n  };\n\n  /**\n   * Toggle the right menu to open 100%\n   */\n  self.toggleRight = function(shouldOpen) {\n    if (isAsideExposed || !self.right.isEnabled) return;\n    var openAmount = self.getOpenAmount();\n    if (arguments.length === 0) {\n      shouldOpen = openAmount >= 0;\n    }\n    self.content.enableAnimation();\n    if (!shouldOpen) {\n      self.openPercentage(0);\n    } else {\n      self.openPercentage(-100);\n    }\n  };\n\n  self.toggle = function(side) {\n    if (side == 'right') {\n      self.toggleRight();\n    } else {\n      self.toggleLeft();\n    }\n  };\n\n  /**\n   * Close all menus.\n   */\n  self.close = function() {\n    self.openPercentage(0);\n  };\n\n  /**\n   * @return {float} The amount the side menu is open, either positive or negative for left (positive), or right (negative)\n   */\n  self.getOpenAmount = function() {\n    return self.content && self.content.getTranslateX() || 0;\n  };\n\n  /**\n   * @return {float} The ratio of open amount over menu width. For example, a\n   * menu of width 100 open 50 pixels would be open 50% or a ratio of 0.5. Value is negative\n   * for right menu.\n   */\n  self.getOpenRatio = function() {\n    var amount = self.getOpenAmount();\n    if (amount >= 0) {\n      return amount / self.left.width;\n    }\n    return amount / self.right.width;\n  };\n\n  self.isOpen = function() {\n    return self.getOpenAmount() !== 0;\n  };\n\n  /**\n   * @return {float} The percentage of open amount over menu width. For example, a\n   * menu of width 100 open 50 pixels would be open 50%. Value is negative\n   * for right menu.\n   */\n  self.getOpenPercentage = function() {\n    return self.getOpenRatio() * 100;\n  };\n\n  /**\n   * Open the menu with a given percentage amount.\n   * @param {float} percentage The percentage (positive or negative for left/right) to open the menu.\n   */\n  self.openPercentage = function(percentage) {\n    var p = percentage / 100;\n\n    if (self.left && percentage >= 0) {\n      self.openAmount(self.left.width * p);\n    } else if (self.right && percentage < 0) {\n      self.openAmount(self.right.width * p);\n    }\n\n    // add the CSS class \"menu-open\" if the percentage does not\n    // equal 0, otherwise remove the class from the body element\n    $ionicBody.enableClass((percentage !== 0), 'menu-open');\n\n    freezeAllScrolls(false);\n  };\n\n  function freezeAllScrolls(shouldFreeze) {\n    if (shouldFreeze && !self.isScrollFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(shouldFreeze);\n\n    } else if (!shouldFreeze && self.isScrollFreeze) {\n      $ionicScrollDelegate.freezeAllScrolls(false);\n    }\n    self.isScrollFreeze = shouldFreeze;\n  }\n\n  /**\n   * Open the menu the given pixel amount.\n   * @param {float} amount the pixel amount to open the menu. Positive value for left menu,\n   * negative value for right menu (only one menu will be visible at a time).\n   */\n  self.openAmount = function(amount) {\n    var maxLeft = self.left && self.left.width || 0;\n    var maxRight = self.right && self.right.width || 0;\n\n    // Check if we can move to that side, depending if the left/right panel is enabled\n    if (!(self.left && self.left.isEnabled) && amount > 0) {\n      self.content.setTranslateX(0);\n      return;\n    }\n\n    if (!(self.right && self.right.isEnabled) && amount < 0) {\n      self.content.setTranslateX(0);\n      return;\n    }\n\n    if (leftShowing && amount > maxLeft) {\n      self.content.setTranslateX(maxLeft);\n      return;\n    }\n\n    if (rightShowing && amount < -maxRight) {\n      self.content.setTranslateX(-maxRight);\n      return;\n    }\n\n    self.content.setTranslateX(amount);\n\n    if (amount >= 0) {\n      leftShowing = true;\n      rightShowing = false;\n\n      if (amount > 0) {\n        // Push the z-index of the right menu down\n        self.right && self.right.pushDown && self.right.pushDown();\n        // Bring the z-index of the left menu up\n        self.left && self.left.bringUp && self.left.bringUp();\n      }\n    } else {\n      rightShowing = true;\n      leftShowing = false;\n\n      // Bring the z-index of the right menu up\n      self.right && self.right.bringUp && self.right.bringUp();\n      // Push the z-index of the left menu down\n      self.left && self.left.pushDown && self.left.pushDown();\n    }\n  };\n\n  /**\n   * Given an event object, find the final resting position of this side\n   * menu. For example, if the user \"throws\" the content to the right and\n   * releases the touch, the left menu should snap open (animated, of course).\n   *\n   * @param {Event} e the gesture event to use for snapping\n   */\n  self.snapToRest = function(e) {\n    // We want to animate at the end of this\n    self.content.enableAnimation();\n    isDragging = false;\n\n    // Check how much the panel is open after the drag, and\n    // what the drag velocity is\n    var ratio = self.getOpenRatio();\n\n    if (ratio === 0) {\n      // Just to be safe\n      self.openPercentage(0);\n      return;\n    }\n\n    var velocityThreshold = 0.3;\n    var velocityX = e.gesture.velocityX;\n    var direction = e.gesture.direction;\n\n    // Going right, less than half, too slow (snap back)\n    if (ratio > 0 && ratio < 0.5 && direction == 'right' && velocityX < velocityThreshold) {\n      self.openPercentage(0);\n    }\n\n    // Going left, more than half, too slow (snap back)\n    else if (ratio > 0.5 && direction == 'left' && velocityX < velocityThreshold) {\n      self.openPercentage(100);\n    }\n\n    // Going left, less than half, too slow (snap back)\n    else if (ratio < 0 && ratio > -0.5 && direction == 'left' && velocityX < velocityThreshold) {\n      self.openPercentage(0);\n    }\n\n    // Going right, more than half, too slow (snap back)\n    else if (ratio < 0.5 && direction == 'right' && velocityX < velocityThreshold) {\n      self.openPercentage(-100);\n    }\n\n    // Going right, more than half, or quickly (snap open)\n    else if (direction == 'right' && ratio >= 0 && (ratio >= 0.5 || velocityX > velocityThreshold)) {\n      self.openPercentage(100);\n    }\n\n    // Going left, more than half, or quickly (span open)\n    else if (direction == 'left' && ratio <= 0 && (ratio <= -0.5 || velocityX > velocityThreshold)) {\n      self.openPercentage(-100);\n    }\n\n    // Snap back for safety\n    else {\n      self.openPercentage(0);\n    }\n  };\n\n  self.enableMenuWithBackViews = function(val) {\n    if (arguments.length) {\n      enableMenuWithBackViews = !!val;\n    }\n    return enableMenuWithBackViews;\n  };\n\n  self.isAsideExposed = function() {\n    return !!isAsideExposed;\n  };\n\n  self.exposeAside = function(shouldExposeAside) {\n    if (!(self.left && self.left.isEnabled) && !(self.right && self.right.isEnabled)) return;\n    self.close();\n\n    isAsideExposed = shouldExposeAside;\n    if (self.left && self.left.isEnabled) {\n      // set the left marget width if it should be exposed\n      // otherwise set false so there's no left margin\n      self.content.setMarginLeft(isAsideExposed ? self.left.width : 0);\n    } else if (self.right && self.right.isEnabled) {\n      self.content.setMarginRight(isAsideExposed ? self.right.width : 0);\n    }\n\n    self.$scope.$emit('$ionicExposeAside', isAsideExposed);\n  };\n\n  self.activeAsideResizing = function(isResizing) {\n    $ionicBody.enableClass(isResizing, 'aside-resizing');\n  };\n\n  // End a drag with the given event\n  self._endDrag = function(e) {\n    freezeAllScrolls(false);\n\n    if (isAsideExposed) return;\n\n    if (isDragging) {\n      self.snapToRest(e);\n    }\n    startX = null;\n    lastX = null;\n    offsetX = null;\n  };\n\n  // Handle a drag event\n  self._handleDrag = function(e) {\n    if (isAsideExposed || !$scope.dragContent) return;\n\n    // If we don't have start coords, grab and store them\n    if (!startX) {\n      startX = e.gesture.touches[0].pageX;\n      lastX = startX;\n    } else {\n      // Grab the current tap coords\n      lastX = e.gesture.touches[0].pageX;\n    }\n\n    // Calculate difference from the tap points\n    if (!isDragging && Math.abs(lastX - startX) > self.dragThresholdX) {\n      // if the difference is greater than threshold, start dragging using the current\n      // point as the starting point\n      startX = lastX;\n\n      isDragging = true;\n      // Initialize dragging\n      self.content.disableAnimation();\n      offsetX = self.getOpenAmount();\n    }\n\n    if (isDragging) {\n      self.openAmount(offsetX + (lastX - startX));\n      freezeAllScrolls(true);\n    }\n  };\n\n  self.canDragContent = function(canDrag) {\n    if (arguments.length) {\n      $scope.dragContent = !!canDrag;\n    }\n    return $scope.dragContent;\n  };\n\n  self.edgeThreshold = 25;\n  self.edgeThresholdEnabled = false;\n  self.edgeDragThreshold = function(value) {\n    if (arguments.length) {\n      if (isNumber(value) && value > 0) {\n        self.edgeThreshold = value;\n        self.edgeThresholdEnabled = true;\n      } else {\n        self.edgeThresholdEnabled = !!value;\n      }\n    }\n    return self.edgeThresholdEnabled;\n  };\n\n  self.isDraggableTarget = function(e) {\n    //Only restrict edge when sidemenu is closed and restriction is enabled\n    var shouldOnlyAllowEdgeDrag = self.edgeThresholdEnabled && !self.isOpen();\n    var startX = e.gesture.startEvent && e.gesture.startEvent.center &&\n      e.gesture.startEvent.center.pageX;\n\n    var dragIsWithinBounds = !shouldOnlyAllowEdgeDrag ||\n      startX <= self.edgeThreshold ||\n      startX >= self.content.element.offsetWidth - self.edgeThreshold;\n\n    var backView = $ionicHistory.backView();\n    var menuEnabled = enableMenuWithBackViews ? true : !backView;\n    if (!menuEnabled) {\n      var currentView = $ionicHistory.currentView() || {};\n      return backView.historyId !== currentView.historyId;\n    }\n\n    return ($scope.dragContent || self.isOpen()) &&\n      dragIsWithinBounds &&\n      !e.gesture.srcEvent.defaultPrevented &&\n      menuEnabled &&\n      !e.target.tagName.match(/input|textarea|select|object|embed/i) &&\n      !e.target.isContentEditable &&\n      !(e.target.dataset ? e.target.dataset.preventScroll : e.target.getAttribute('data-prevent-scroll') == 'true');\n  };\n\n  $scope.sideMenuContentTranslateX = 0;\n\n  var deregisterBackButtonAction = noop;\n  var closeSideMenu = angular.bind(self, self.close);\n\n  $scope.$watch(function() {\n    return self.getOpenAmount() !== 0;\n  }, function(isOpen) {\n    deregisterBackButtonAction();\n    if (isOpen) {\n      deregisterBackButtonAction = $ionicPlatform.registerBackButtonAction(\n        closeSideMenu,\n        IONIC_BACK_PRIORITY.sideMenu\n      );\n    }\n  });\n\n  var deregisterInstance = $ionicSideMenuDelegate._registerInstance(\n    self, $attrs.delegateHandle, function() {\n      return $ionicHistory.isActiveScope($scope);\n    }\n  );\n\n  $scope.$on('$destroy', function() {\n    deregisterInstance();\n    deregisterBackButtonAction();\n    self.$scope = null;\n    if (self.content) {\n      self.content.element = null;\n      self.content = null;\n    }\n\n    // ensure scrolls are unfrozen\n    freezeAllScrolls(false);\n  });\n\n  self.initialize({\n    left: {\n      width: 275\n    },\n    right: {\n      width: 275\n    }\n  });\n\n}]);\n\n(function(ionic) {\n\n  var TRANSLATE32 = 'translate(32,32)';\n  var STROKE_OPACITY = 'stroke-opacity';\n  var ROUND = 'round';\n  var INDEFINITE = 'indefinite';\n  var DURATION = '750ms';\n  var NONE = 'none';\n  var SHORTCUTS = {\n    a: 'animate',\n    an: 'attributeName',\n    at: 'animateTransform',\n    c: 'circle',\n    da: 'stroke-dasharray',\n    os: 'stroke-dashoffset',\n    f: 'fill',\n    lc: 'stroke-linecap',\n    rc: 'repeatCount',\n    sw: 'stroke-width',\n    t: 'transform',\n    v: 'values'\n  };\n\n  var SPIN_ANIMATION = {\n    v: '0,32,32;360,32,32',\n    an: 'transform',\n    type: 'rotate',\n    rc: INDEFINITE,\n    dur: DURATION\n  };\n\n  function createSvgElement(tagName, data, parent, spinnerName) {\n    var ele = document.createElement(SHORTCUTS[tagName] || tagName);\n    var k, x, y;\n\n    for (k in data) {\n\n      if (angular.isArray(data[k])) {\n        for (x = 0; x < data[k].length; x++) {\n          if (data[k][x].fn) {\n            for (y = 0; y < data[k][x].t; y++) {\n              createSvgElement(k, data[k][x].fn(y, spinnerName), ele, spinnerName);\n            }\n          } else {\n            createSvgElement(k, data[k][x], ele, spinnerName);\n          }\n        }\n\n      } else {\n        setSvgAttribute(ele, k, data[k]);\n      }\n    }\n\n    parent.appendChild(ele);\n  }\n\n  function setSvgAttribute(ele, k, v) {\n    ele.setAttribute(SHORTCUTS[k] || k, v);\n  }\n\n  function animationValues(strValues, i) {\n    var values = strValues.split(';');\n    var back = values.slice(i);\n    var front = values.slice(0, values.length - back.length);\n    values = back.concat(front).reverse();\n    return values.join(';') + ';' + values[0];\n  }\n\n  var IOS_SPINNER = {\n    sw: 4,\n    lc: ROUND,\n    line: [{\n      fn: function(i, spinnerName) {\n        return {\n          y1: spinnerName == 'ios' ? 17 : 12,\n          y2: spinnerName == 'ios' ? 29 : 20,\n          t: TRANSLATE32 + ' rotate(' + (30 * i + (i < 6 ? 180 : -180)) + ')',\n          a: [{\n            fn: function() {\n              return {\n                an: STROKE_OPACITY,\n                dur: DURATION,\n                v: animationValues('0;.1;.15;.25;.35;.45;.55;.65;.7;.85;1', i),\n                rc: INDEFINITE\n              };\n            },\n            t: 1\n          }]\n        };\n      },\n      t: 12\n    }]\n  };\n\n  var spinners = {\n\n    android: {\n      c: [{\n        sw: 6,\n        da: 128,\n        os: 82,\n        r: 26,\n        cx: 32,\n        cy: 32,\n        f: NONE\n      }]\n    },\n\n    ios: IOS_SPINNER,\n\n    'ios-small': IOS_SPINNER,\n\n    bubbles: {\n      sw: 0,\n      c: [{\n        fn: function(i) {\n          return {\n            cx: 24 * Math.cos(2 * Math.PI * i / 8),\n            cy: 24 * Math.sin(2 * Math.PI * i / 8),\n            t: TRANSLATE32,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'r',\n                  dur: DURATION,\n                  v: animationValues('1;2;3;4;5;6;7;8', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 8\n      }]\n    },\n\n    circles: {\n\n      c: [{\n        fn: function(i) {\n          return {\n            r: 5,\n            cx: 24 * Math.cos(2 * Math.PI * i / 8),\n            cy: 24 * Math.sin(2 * Math.PI * i / 8),\n            t: TRANSLATE32,\n            sw: 0,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'fill-opacity',\n                  dur: DURATION,\n                  v: animationValues('.3;.3;.3;.4;.7;.85;.9;1', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 8\n      }]\n    },\n\n    crescent: {\n      c: [{\n        sw: 4,\n        da: 128,\n        os: 82,\n        r: 26,\n        cx: 32,\n        cy: 32,\n        f: NONE,\n        at: [SPIN_ANIMATION]\n      }]\n    },\n\n    dots: {\n\n      c: [{\n        fn: function(i) {\n          return {\n            cx: 16 + (16 * i),\n            cy: 32,\n            sw: 0,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'fill-opacity',\n                  dur: DURATION,\n                  v: animationValues('.5;.6;.8;1;.8;.6;.5', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: 'r',\n                  dur: DURATION,\n                  v: animationValues('4;5;6;5;4;3;3', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 3\n      }]\n    },\n\n    lines: {\n      sw: 7,\n      lc: ROUND,\n      line: [{\n        fn: function(i) {\n          return {\n            x1: 10 + (i * 14),\n            x2: 10 + (i * 14),\n            a: [{\n              fn: function() {\n                return {\n                  an: 'y1',\n                  dur: DURATION,\n                  v: animationValues('16;18;28;18;16', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: 'y2',\n                  dur: DURATION,\n                  v: animationValues('48;44;36;46;48', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: STROKE_OPACITY,\n                  dur: DURATION,\n                  v: animationValues('1;.8;.5;.4;1', i),\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 4\n      }]\n    },\n\n    ripple: {\n      f: NONE,\n      'fill-rule': 'evenodd',\n      sw: 3,\n      circle: [{\n        fn: function(i) {\n          return {\n            cx: 32,\n            cy: 32,\n            a: [{\n              fn: function() {\n                return {\n                  an: 'r',\n                  begin: (i * -1) + 's',\n                  dur: '2s',\n                  v: '0;24',\n                  keyTimes: '0;1',\n                  keySplines: '0.1,0.2,0.3,1',\n                  calcMode: 'spline',\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }, {\n              fn: function() {\n                return {\n                  an: STROKE_OPACITY,\n                  begin: (i * -1) + 's',\n                  dur: '2s',\n                  v: '.2;1;.2;0',\n                  rc: INDEFINITE\n                };\n              },\n              t: 1\n            }]\n          };\n        },\n        t: 2\n      }]\n    },\n\n    spiral: {\n      defs: [{\n        linearGradient: [{\n          id: 'sGD',\n          gradientUnits: 'userSpaceOnUse',\n          x1: 55, y1: 46, x2: 2, y2: 46,\n          stop: [{\n            offset: 0.1,\n            class: 'stop1'\n          }, {\n            offset: 1,\n            class: 'stop2'\n          }]\n        }]\n      }],\n      g: [{\n        sw: 4,\n        lc: ROUND,\n        f: NONE,\n        path: [{\n          stroke: 'url(#sGD)',\n          d: 'M4,32 c0,15,12,28,28,28c8,0,16-4,21-9'\n        }, {\n          d: 'M60,32 C60,16,47.464,4,32,4S4,16,4,32'\n        }],\n        at: [SPIN_ANIMATION]\n      }]\n    }\n\n  };\n\n  var animations = {\n\n    android: function(ele) {\n      var rIndex = 0;\n      var rotateCircle = 0;\n      var startTime;\n      var svgEle = ele.querySelector('g');\n      var circleEle = ele.querySelector('circle');\n\n      function run() {\n        var v = easeInOutCubic(Date.now() - startTime, 650);\n        var scaleX = 1;\n        var translateX = 0;\n        var dasharray = (188 - (58 * v));\n        var dashoffset = (182 - (182 * v));\n\n        if (rIndex % 2) {\n          scaleX = -1;\n          translateX = -64;\n          dasharray = (128 - (-58 * v));\n          dashoffset = (182 * v);\n        }\n\n        var rotateLine = [0, -101, -90, -11, -180, 79, -270, -191][rIndex];\n\n        setSvgAttribute(circleEle, 'da', Math.max(Math.min(dasharray, 188), 128));\n        setSvgAttribute(circleEle, 'os', Math.max(Math.min(dashoffset, 182), 0));\n        setSvgAttribute(circleEle, 't', 'scale(' + scaleX + ',1) translate(' + translateX + ',0) rotate(' + rotateLine + ',32,32)');\n\n        rotateCircle += 4.1;\n        if (rotateCircle > 359) rotateCircle = 0;\n        setSvgAttribute(svgEle, 't', 'rotate(' + rotateCircle + ',32,32)');\n\n        if (v >= 1) {\n          rIndex++;\n          if (rIndex > 7) rIndex = 0;\n          startTime = Date.now();\n        }\n\n        ionic.requestAnimationFrame(run);\n      }\n\n      return function() {\n        startTime = Date.now();\n        run();\n      };\n\n    }\n\n  };\n\n  function easeInOutCubic(t, c) {\n    t /= c / 2;\n    if (t < 1) return 1 / 2 * t * t * t;\n    t -= 2;\n    return 1 / 2 * (t * t * t + 2);\n  }\n\n\n  IonicModule\n  .controller('$ionicSpinner', [\n    '$element',\n    '$attrs',\n  function($element, $attrs) {\n    var spinnerName, spinner;\n\n    this.init = function() {\n      var override = null;\n      if (ionic.Platform.platform() === 'windowsphone') {\n        override = 'android';\n      }\n      spinnerName = $attrs.icon || override || ionic.Platform.platform();\n      spinner = spinners[spinnerName];\n      if (!spinner) {\n        spinnerName = 'ios';\n        spinner = spinners.ios;\n      }\n\n      var container = document.createElement('div');\n      createSvgElement('svg', {\n        viewBox: '0 0 64 64',\n        g: [spinners[spinnerName]]\n      }, container, spinnerName);\n\n      // Specifically for animations to work,\n      // Android 4.3 and below requires the element to be\n      // added as an html string, rather than dynmically\n      // building up the svg element and appending it.\n      $element.html(container.innerHTML);\n\n      this.start();\n\n      return spinnerName;\n    };\n\n    this.start = function() {\n      animations[spinnerName] && animations[spinnerName]($element[0])();\n    };\n\n  }]);\n\n})(ionic);\n\nIonicModule\n.controller('$ionicTab', [\n  '$scope',\n  '$ionicHistory',\n  '$attrs',\n  '$location',\n  '$state',\nfunction($scope, $ionicHistory, $attrs, $location, $state) {\n  this.$scope = $scope;\n\n  //All of these exposed for testing\n  this.hrefMatchesState = function() {\n    return $attrs.href && $location.path().indexOf(\n      $attrs.href.replace(/^#/, '').replace(/\\/$/, '')\n    ) === 0;\n  };\n  this.srefMatchesState = function() {\n    return $attrs.uiSref && $state.includes($attrs.uiSref.split('(')[0]);\n  };\n  this.navNameMatchesState = function() {\n    return this.navViewName && $ionicHistory.isCurrentStateNavView(this.navViewName);\n  };\n\n  this.tabMatchesState = function() {\n    return this.hrefMatchesState() || this.srefMatchesState() || this.navNameMatchesState();\n  };\n}]);\n\nIonicModule\n.controller('$ionicTabs', [\n  '$scope',\n  '$element',\n  '$ionicHistory',\nfunction($scope, $element, $ionicHistory) {\n  var self = this;\n  var selectedTab = null;\n  var previousSelectedTab = null;\n  var selectedTabIndex;\n  self.tabs = [];\n\n  self.selectedIndex = function() {\n    return self.tabs.indexOf(selectedTab);\n  };\n  self.selectedTab = function() {\n    return selectedTab;\n  };\n  self.previousSelectedTab = function() {\n    return previousSelectedTab;\n  };\n\n  self.add = function(tab) {\n    $ionicHistory.registerHistory(tab);\n    self.tabs.push(tab);\n  };\n\n  self.remove = function(tab) {\n    var tabIndex = self.tabs.indexOf(tab);\n    if (tabIndex === -1) {\n      return;\n    }\n    //Use a field like '$tabSelected' so developers won't accidentally set it in controllers etc\n    if (tab.$tabSelected) {\n      self.deselect(tab);\n      //Try to select a new tab if we're removing a tab\n      if (self.tabs.length === 1) {\n        //Do nothing if there are no other tabs to select\n      } else {\n        //Select previous tab if it's the last tab, else select next tab\n        var newTabIndex = tabIndex === self.tabs.length - 1 ? tabIndex - 1 : tabIndex + 1;\n        self.select(self.tabs[newTabIndex]);\n      }\n    }\n    self.tabs.splice(tabIndex, 1);\n  };\n\n  self.deselect = function(tab) {\n    if (tab.$tabSelected) {\n      previousSelectedTab = selectedTab;\n      selectedTab = selectedTabIndex = null;\n      tab.$tabSelected = false;\n      (tab.onDeselect || noop)();\n      tab.$broadcast && tab.$broadcast('$ionicHistory.deselect');\n    }\n  };\n\n  self.select = function(tab, shouldEmitEvent) {\n    var tabIndex;\n    if (isNumber(tab)) {\n      tabIndex = tab;\n      if (tabIndex >= self.tabs.length) return;\n      tab = self.tabs[tabIndex];\n    } else {\n      tabIndex = self.tabs.indexOf(tab);\n    }\n\n    if (arguments.length === 1) {\n      shouldEmitEvent = !!(tab.navViewName || tab.uiSref);\n    }\n\n    if (selectedTab && selectedTab.$historyId == tab.$historyId) {\n      if (shouldEmitEvent) {\n        $ionicHistory.goToHistoryRoot(tab.$historyId);\n      }\n\n    } else if (selectedTabIndex !== tabIndex) {\n      forEach(self.tabs, function(tab) {\n        self.deselect(tab);\n      });\n\n      selectedTab = tab;\n      selectedTabIndex = tabIndex;\n\n      if (self.$scope && self.$scope.$parent) {\n        self.$scope.$parent.$activeHistoryId = tab.$historyId;\n      }\n\n      //Use a funny name like $tabSelected so the developer doesn't overwrite the var in a child scope\n      tab.$tabSelected = true;\n      (tab.onSelect || noop)();\n\n      if (shouldEmitEvent) {\n        $scope.$emit('$ionicHistory.change', {\n          type: 'tab',\n          tabIndex: tabIndex,\n          historyId: tab.$historyId,\n          navViewName: tab.navViewName,\n          hasNavView: !!tab.navViewName,\n          title: tab.title,\n          url: tab.href,\n          uiSref: tab.uiSref\n        });\n      }\n    }\n  };\n\n  self.hasActiveScope = function() {\n    for (var x = 0; x < self.tabs.length; x++) {\n      if ($ionicHistory.isActiveScope(self.tabs[x])) {\n        return true;\n      }\n    }\n    return false;\n  };\n\n}]);\n\nIonicModule\n.controller('$ionicView', [\n  '$scope',\n  '$element',\n  '$attrs',\n  '$compile',\n  '$rootScope',\nfunction($scope, $element, $attrs, $compile, $rootScope) {\n  var self = this;\n  var navElementHtml = {};\n  var navViewCtrl;\n  var navBarDelegateHandle;\n  var hasViewHeaderBar;\n  var deregisters = [];\n  var viewTitle;\n\n  var deregIonNavBarInit = $scope.$on('ionNavBar.init', function(ev, delegateHandle) {\n    // this view has its own ion-nav-bar, remember the navBarDelegateHandle for this view\n    ev.stopPropagation();\n    navBarDelegateHandle = delegateHandle;\n  });\n\n\n  self.init = function() {\n    deregIonNavBarInit();\n\n    var modalCtrl = $element.inheritedData('$ionModalController');\n    navViewCtrl = $element.inheritedData('$ionNavViewController');\n\n    // don't bother if inside a modal or there's no parent navView\n    if (!navViewCtrl || modalCtrl) return;\n\n    // add listeners for when this view changes\n    $scope.$on('$ionicView.beforeEnter', self.beforeEnter);\n    $scope.$on('$ionicView.afterEnter', afterEnter);\n    $scope.$on('$ionicView.beforeLeave', deregisterFns);\n  };\n\n  self.beforeEnter = function(ev, transData) {\n    // this event was emitted, starting at intial ion-view, then bubbles up\n    // only the first ion-view should do something with it, parent ion-views should ignore\n    if (transData && !transData.viewNotified) {\n      transData.viewNotified = true;\n\n      if (!$rootScope.$$phase) $scope.$digest();\n      viewTitle = isDefined($attrs.viewTitle) ? $attrs.viewTitle : $attrs.title;\n\n      var navBarItems = {};\n      for (var n in navElementHtml) {\n        navBarItems[n] = generateNavBarItem(navElementHtml[n]);\n      }\n\n      navViewCtrl.beforeEnter(extend(transData, {\n        title: viewTitle,\n        showBack: !attrTrue('hideBackButton'),\n        navBarItems: navBarItems,\n        navBarDelegate: navBarDelegateHandle || null,\n        showNavBar: !attrTrue('hideNavBar'),\n        hasHeaderBar: !!hasViewHeaderBar\n      }));\n\n      // make sure any existing observers are cleaned up\n      deregisterFns();\n    }\n  };\n\n\n  function afterEnter() {\n    // only listen for title updates after it has entered\n    // but also deregister the observe before it leaves\n    var viewTitleAttr = isDefined($attrs.viewTitle) && 'viewTitle' || isDefined($attrs.title) && 'title';\n    if (viewTitleAttr) {\n      titleUpdate($attrs[viewTitleAttr]);\n      deregisters.push($attrs.$observe(viewTitleAttr, titleUpdate));\n    }\n\n    if (isDefined($attrs.hideBackButton)) {\n      deregisters.push($scope.$watch($attrs.hideBackButton, function(val) {\n        navViewCtrl.showBackButton(!val);\n      }));\n    }\n\n    if (isDefined($attrs.hideNavBar)) {\n      deregisters.push($scope.$watch($attrs.hideNavBar, function(val) {\n        navViewCtrl.showBar(!val);\n      }));\n    }\n  }\n\n\n  function titleUpdate(newTitle) {\n    if (isDefined(newTitle) && newTitle !== viewTitle) {\n      viewTitle = newTitle;\n      navViewCtrl.title(viewTitle);\n    }\n  }\n\n\n  function deregisterFns() {\n    // remove all existing $attrs.$observe's\n    for (var x = 0; x < deregisters.length; x++) {\n      deregisters[x]();\n    }\n    deregisters = [];\n  }\n\n\n  function generateNavBarItem(html) {\n    if (html) {\n      // every time a view enters we need to recreate its view buttons if they exist\n      return $compile(html)($scope.$new());\n    }\n  }\n\n\n  function attrTrue(key) {\n    return !!$scope.$eval($attrs[key]);\n  }\n\n\n  self.navElement = function(type, html) {\n    navElementHtml[type] = html;\n  };\n\n}]);\n\n/*\n * We don't document the ionActionSheet directive, we instead document\n * the $ionicActionSheet service\n */\nIonicModule\n.directive('ionActionSheet', ['$document', function($document) {\n  return {\n    restrict: 'E',\n    scope: true,\n    replace: true,\n    link: function($scope, $element) {\n\n      var keyUp = function(e) {\n        if (e.which == 27) {\n          $scope.cancel();\n          $scope.$apply();\n        }\n      };\n\n      var backdropClick = function(e) {\n        if (e.target == $element[0]) {\n          $scope.cancel();\n          $scope.$apply();\n        }\n      };\n      $scope.$on('$destroy', function() {\n        $element.remove();\n        $document.unbind('keyup', keyUp);\n      });\n\n      $document.bind('keyup', keyUp);\n      $element.bind('click', backdropClick);\n    },\n    template: '<div class=\"action-sheet-backdrop\">' +\n                '<div class=\"action-sheet-wrapper\">' +\n                  '<div class=\"action-sheet\" ng-class=\"{\\'action-sheet-has-icons\\': $actionSheetHasIcon}\">' +\n                    '<div class=\"action-sheet-group action-sheet-options\">' +\n                      '<div class=\"action-sheet-title\" ng-if=\"titleText\" ng-bind-html=\"titleText\"></div>' +\n                      '<button class=\"button action-sheet-option\" ng-click=\"buttonClicked($index)\" ng-repeat=\"b in buttons\" ng-bind-html=\"b.text\"></button>' +\n                      '<button class=\"button destructive action-sheet-destructive\" ng-if=\"destructiveText\" ng-click=\"destructiveButtonClicked()\" ng-bind-html=\"destructiveText\"></button>' +\n                    '</div>' +\n                    '<div class=\"action-sheet-group action-sheet-cancel\" ng-if=\"cancelText\">' +\n                      '<button class=\"button\" ng-click=\"cancel()\" ng-bind-html=\"cancelText\"></button>' +\n                    '</div>' +\n                  '</div>' +\n                '</div>' +\n              '</div>'\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionCheckbox\n * @module ionic\n * @restrict E\n * @codepen hqcju\n * @description\n * The checkbox is no different than the HTML checkbox input, except it's styled differently.\n *\n * The checkbox behaves like any [AngularJS checkbox](http://docs.angularjs.org/api/ng/input/input[checkbox]).\n *\n * @usage\n * ```html\n * <ion-checkbox ng-model=\"isChecked\">Checkbox Label</ion-checkbox>\n * ```\n */\n\nIonicModule\n.directive('ionCheckbox', ['$ionicConfig', function($ionicConfig) {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<label class=\"item item-checkbox\">' +\n        '<div class=\"checkbox checkbox-input-hidden disable-pointer-events\">' +\n          '<input type=\"checkbox\">' +\n          '<i class=\"checkbox-icon\"></i>' +\n        '</div>' +\n        '<div class=\"item-content disable-pointer-events\" ng-transclude></div>' +\n      '</label>',\n    compile: function(element, attr) {\n      var input = element.find('input');\n      forEach({\n        'name': attr.name,\n        'ng-value': attr.ngValue,\n        'ng-model': attr.ngModel,\n        'ng-checked': attr.ngChecked,\n        'ng-disabled': attr.ngDisabled,\n        'ng-true-value': attr.ngTrueValue,\n        'ng-false-value': attr.ngFalseValue,\n        'ng-change': attr.ngChange,\n        'ng-required': attr.ngRequired,\n        'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n          input.attr(name, value);\n        }\n      });\n      var checkboxWrapper = element[0].querySelector('.checkbox');\n      checkboxWrapper.classList.add('checkbox-' + $ionicConfig.form.checkbox());\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @restrict A\n * @name collectionRepeat\n * @module ionic\n * @codepen 7ec1ec58f2489ab8f359fa1a0fe89c15\n * @description\n * `collection-repeat` allows an app to show huge lists of items much more performantly than\n * `ng-repeat`.\n *\n * It renders into the DOM only as many items as are currently visible.\n *\n * This means that on a phone screen that can fit eight items, only the eight items matching\n * the current scroll position will be rendered.\n *\n * **The Basics**:\n *\n * - The data given to collection-repeat must be an array.\n * - If the `item-height` and `item-width` attributes are not supplied, it will be assumed that\n *   every item in the list has the same dimensions as the first item.\n * - Don't use angular one-time binding (`::`) with collection-repeat. The scope of each item is\n *   assigned new data and re-digested as you scroll. Bindings need to update, and one-time bindings\n *   won't.\n *\n * **Performance Tips**:\n *\n * - The iOS webview has a performance bottleneck when switching out `<img src>` attributes.\n *   To increase performance of images on iOS, cache your images in advance and,\n *   if possible, lower the number of unique images. We're working on [a solution](https://github.com/driftyco/ionic/issues/3194).\n *\n * @usage\n * #### Basic Item List ([codepen](http://codepen.io/ionic/pen/0c2c35a34a8b18ad4d793fef0b081693))\n * ```html\n * <ion-content>\n *   <ion-item collection-repeat=\"item in items\">\n *     {% raw %}{{item}}{% endraw %}\n *   </ion-item>\n * </ion-content>\n * ```\n *\n * #### Grid of Images ([codepen](http://codepen.io/ionic/pen/5515d4efd9d66f780e96787387f41664))\n * ```html\n * <ion-content>\n *   <img collection-repeat=\"photo in photos\"\n *     item-width=\"33%\"\n *     item-height=\"200px\"\n *     ng-src=\"{% raw %}{{photo.url}}{% endraw %}\">\n * </ion-content>\n * ```\n *\n * #### Horizontal Scroller, Dynamic Item Width ([codepen](http://codepen.io/ionic/pen/67cc56b349124a349acb57a0740e030e))\n * ```html\n * <ion-content>\n *   <h2>Available Kittens:</h2>\n *   <ion-scroll direction=\"x\" class=\"available-scroller\">\n *     <div class=\"photo\" collection-repeat=\"photo in main.photos\"\n *        item-height=\"250\" item-width=\"photo.width + 30\">\n *        <img ng-src=\"{{photo.src}}\">\n *     </div>\n *   </ion-scroll>\n * </ion-content>\n * ```\n *\n * @param {expression} collection-repeat The expression indicating how to enumerate a collection,\n *   of the format  `variable in expression` – where variable is the user defined loop variable\n *   and `expression` is a scope expression giving the collection to enumerate.\n *   For example: `album in artist.albums` or `album in artist.albums | orderBy:'name'`.\n * @param {expression=} item-width The width of the repeated element. The expression must return\n *   a number (pixels) or a percentage. Defaults to the width of the first item in the list.\n *   (previously named collection-item-width)\n * @param {expression=} item-height The height of the repeated element. The expression must return\n *   a number (pixels) or a percentage. Defaults to the height of the first item in the list.\n *   (previously named collection-item-height)\n * @param {number=} item-render-buffer The number of items to load before and after the visible\n *   items in the list. Default 3. Tip: set this higher if you have lots of images to preload, but\n *   don't set it too high or you'll see performance loss.\n * @param {boolean=} force-refresh-images Force images to refresh as you scroll. This fixes a problem\n *   where, when an element is interchanged as scrolling, its image will still have the old src\n *   while the new src loads. Setting this to true comes with a small performance loss.\n */\n\nIonicModule\n.directive('collectionRepeat', CollectionRepeatDirective)\n.factory('$ionicCollectionManager', RepeatManagerFactory);\n\nvar ONE_PX_TRANSPARENT_IMG_SRC = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\nvar WIDTH_HEIGHT_REGEX = /height:.*?px;\\s*width:.*?px/;\nvar DEFAULT_RENDER_BUFFER = 3;\n\nCollectionRepeatDirective.$inject = ['$ionicCollectionManager', '$parse', '$window', '$$rAF', '$rootScope', '$timeout'];\nfunction CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$rAF, $rootScope, $timeout) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    transclude: 'element',\n    $$tlb: true,\n    require: '^^$ionicScroll',\n    link: postLink\n  };\n\n  function postLink(scope, element, attr, scrollCtrl, transclude) {\n    var scrollView = scrollCtrl.scrollView;\n    var node = element[0];\n    var containerNode = angular.element('<div class=\"collection-repeat-container\">')[0];\n    node.parentNode.replaceChild(containerNode, node);\n\n    if (scrollView.options.scrollingX && scrollView.options.scrollingY) {\n      throw new Error(\"collection-repeat expected a parent x or y scrollView, not \" +\n                      \"an xy scrollView.\");\n    }\n\n    var repeatExpr = attr.collectionRepeat;\n    var match = repeatExpr.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n    if (!match) {\n      throw new Error(\"collection-repeat expected expression in form of '_item_ in \" +\n                      \"_collection_[ track by _id_]' but got '\" + attr.collectionRepeat + \"'.\");\n    }\n    var keyExpr = match[1];\n    var listExpr = match[2];\n    var listGetter = $parse(listExpr);\n    var heightData = {};\n    var widthData = {};\n    var computedStyleDimensions = {};\n    var data = [];\n    var repeatManager;\n\n    // attr.collectionBufferSize is deprecated\n    var renderBufferExpr = attr.itemRenderBuffer || attr.collectionBufferSize;\n    var renderBuffer = angular.isDefined(renderBufferExpr) ?\n      parseInt(renderBufferExpr) :\n      DEFAULT_RENDER_BUFFER;\n\n    // attr.collectionItemHeight is deprecated\n    var heightExpr = attr.itemHeight || attr.collectionItemHeight;\n    // attr.collectionItemWidth is deprecated\n    var widthExpr = attr.itemWidth || attr.collectionItemWidth;\n\n    var afterItemsContainer = initAfterItemsContainer();\n\n    var changeValidator = makeChangeValidator();\n    initDimensions();\n\n    // Dimensions are refreshed on resize or data change.\n    scrollCtrl.$element.on('scroll-resize', refreshDimensions);\n\n    angular.element($window).on('resize', onResize);\n    var unlistenToExposeAside = $rootScope.$on('$ionicExposeAside', ionic.animationFrameThrottle(function() {\n      scrollCtrl.scrollView.resize();\n      onResize();\n    }));\n    $timeout(refreshDimensions, 0, false);\n\n    function onResize() {\n      if (changeValidator.resizeRequiresRefresh(scrollView.__clientWidth, scrollView.__clientHeight)) {\n        refreshDimensions();\n      }\n    }\n\n    scope.$watchCollection(listGetter, function(newValue) {\n      data = newValue || (newValue = []);\n      if (!angular.isArray(newValue)) {\n        throw new Error(\"collection-repeat expected an array for '\" + listExpr + \"', \" +\n          \"but got a \" + typeof value);\n      }\n      // Wait for this digest to end before refreshing everything.\n      scope.$$postDigest(function() {\n        getRepeatManager().setData(data);\n        if (changeValidator.dataChangeRequiresRefresh(data)) refreshDimensions();\n      });\n    });\n\n    scope.$on('$destroy', function() {\n      angular.element($window).off('resize', onResize);\n      unlistenToExposeAside();\n      scrollCtrl.$element && scrollCtrl.$element.off('scroll-resize', refreshDimensions);\n\n      computedStyleNode && computedStyleNode.parentNode &&\n        computedStyleNode.parentNode.removeChild(computedStyleNode);\n      computedStyleScope && computedStyleScope.$destroy();\n      computedStyleScope = computedStyleNode = null;\n\n      repeatManager && repeatManager.destroy();\n      repeatManager = null;\n    });\n\n    function makeChangeValidator() {\n      var self;\n      return (self = {\n        dataLength: 0,\n        width: 0,\n        height: 0,\n        // A resize triggers a refresh only if we have data, the scrollView has size,\n        // and the size has changed.\n        resizeRequiresRefresh: function(newWidth, newHeight) {\n          var requiresRefresh = self.dataLength && newWidth && newHeight &&\n            (newWidth !== self.width || newHeight !== self.height);\n\n          self.width = newWidth;\n          self.height = newHeight;\n\n          return !!requiresRefresh;\n        },\n        // A change in data only triggers a refresh if the data has length, or if the data's\n        // length is less than before.\n        dataChangeRequiresRefresh: function(newData) {\n          var requiresRefresh = newData.length > 0 || newData.length < self.dataLength;\n\n          self.dataLength = newData.length;\n\n          return !!requiresRefresh;\n        }\n      });\n    }\n\n    function getRepeatManager() {\n      return repeatManager || (repeatManager = new $ionicCollectionManager({\n        afterItemsNode: afterItemsContainer[0],\n        containerNode: containerNode,\n        heightData: heightData,\n        widthData: widthData,\n        forceRefreshImages: !!(isDefined(attr.forceRefreshImages) && attr.forceRefreshImages !== 'false'),\n        keyExpression: keyExpr,\n        renderBuffer: renderBuffer,\n        scope: scope,\n        scrollView: scrollCtrl.scrollView,\n        transclude: transclude\n      }));\n    }\n\n    function initAfterItemsContainer() {\n      var container = angular.element(\n        scrollView.__content.querySelector('.collection-repeat-after-container')\n      );\n      // Put everything in the view after the repeater into a container.\n      if (!container.length) {\n        var elementIsAfterRepeater = false;\n        var afterNodes = [].filter.call(scrollView.__content.childNodes, function(node) {\n          if (ionic.DomUtil.contains(node, containerNode)) {\n            elementIsAfterRepeater = true;\n            return false;\n          }\n          return elementIsAfterRepeater;\n        });\n        container = angular.element('<span class=\"collection-repeat-after-container\">');\n        if (scrollView.options.scrollingX) {\n          container.addClass('horizontal');\n        }\n        container.append(afterNodes);\n        scrollView.__content.appendChild(container[0]);\n      }\n      return container;\n    }\n\n    function initDimensions() {\n      //Height and width have four 'modes':\n      //1) Computed Mode\n      //  - Nothing is supplied, so we getComputedStyle() on one element in the list and use\n      //    that width and height value for the width and height of every item. This is re-computed\n      //    every resize.\n      //2) Constant Mode, Static Integer\n      //  - The user provides a constant number for width or height, in pixels. We parse it,\n      //    store it on the `value` field, and it never changes\n      //3) Constant Mode, Percent\n      //  - The user provides a percent string for width or height. The getter for percent is\n      //    stored on the `getValue()` field, and is re-evaluated once every resize. The result\n      //    is stored on the `value` field.\n      //4) Dynamic Mode\n      //  - The user provides a dynamic expression for the width or height.  This is re-evaluated\n      //    for every item, stored on the `.getValue()` field.\n      if (heightExpr) {\n        parseDimensionAttr(heightExpr, heightData);\n      } else {\n        heightData.computed = true;\n      }\n      if (widthExpr) {\n        parseDimensionAttr(widthExpr, widthData);\n      } else {\n        widthData.computed = true;\n      }\n    }\n\n    function refreshDimensions() {\n      var hasData = data.length > 0;\n\n      if (hasData && (heightData.computed || widthData.computed)) {\n        computeStyleDimensions();\n      }\n\n      if (hasData && heightData.computed) {\n        heightData.value = computedStyleDimensions.height;\n        if (!heightData.value) {\n          throw new Error('collection-repeat tried to compute the height of repeated elements \"' +\n            repeatExpr + '\", but was unable to. Please provide the \"item-height\" attribute. ' +\n            'http://ionicframework.com/docs/api/directive/collectionRepeat/');\n        }\n      } else if (!heightData.dynamic && heightData.getValue) {\n        // If it's a constant with a getter (eg percent), we just refresh .value after resize\n        heightData.value = heightData.getValue();\n      }\n\n      if (hasData && widthData.computed) {\n        widthData.value = computedStyleDimensions.width;\n        if (!widthData.value) {\n          throw new Error('collection-repeat tried to compute the width of repeated elements \"' +\n            repeatExpr + '\", but was unable to. Please provide the \"item-width\" attribute. ' +\n            'http://ionicframework.com/docs/api/directive/collectionRepeat/');\n        }\n      } else if (!widthData.dynamic && widthData.getValue) {\n        // If it's a constant with a getter (eg percent), we just refresh .value after resize\n        widthData.value = widthData.getValue();\n      }\n      // Dynamic dimensions aren't updated on resize. Since they're already dynamic anyway,\n      // .getValue() will be used.\n\n      getRepeatManager().refreshLayout();\n    }\n\n    function parseDimensionAttr(attrValue, dimensionData) {\n      if (!attrValue) return;\n\n      var parsedValue;\n      // Try to just parse the plain attr value\n      try {\n        parsedValue = $parse(attrValue);\n      } catch (e) {\n        // If the parse fails and the value has `px` or `%` in it, surround the attr in\n        // quotes, to attempt to let the user provide a simple `attr=\"100%\"` or `attr=\"100px\"`\n        if (attrValue.trim().match(/\\d+(px|%)$/)) {\n          attrValue = '\"' + attrValue + '\"';\n        }\n        parsedValue = $parse(attrValue);\n      }\n\n      var constantAttrValue = attrValue.replace(/(\\'|\\\"|px|%)/g, '').trim();\n      var isConstant = constantAttrValue.length && !/([a-zA-Z]|\\$|:|\\?)/.test(constantAttrValue);\n      dimensionData.attrValue = attrValue;\n\n      // If it's a constant, it's either a percent or just a constant pixel number.\n      if (isConstant) {\n        var intValue = parseInt(parsedValue());\n\n        // For percents, store the percent getter on .getValue()\n        if (attrValue.indexOf('%') > -1) {\n          var decimalValue = intValue / 100;\n          dimensionData.getValue = dimensionData === heightData ?\n            function() { return Math.floor(decimalValue * scrollView.__clientHeight); } :\n            function() { return Math.floor(decimalValue * scrollView.__clientWidth); };\n        } else {\n          // For static constants, just store the static constant.\n          dimensionData.value = intValue;\n        }\n\n      } else {\n        dimensionData.dynamic = true;\n        dimensionData.getValue = dimensionData === heightData ?\n          function heightGetter(scope, locals) {\n            var result = parsedValue(scope, locals);\n            if (result.charAt && result.charAt(result.length - 1) === '%') {\n              return Math.floor(parseInt(result) / 100 * scrollView.__clientHeight);\n            }\n            return parseInt(result);\n          } :\n          function widthGetter(scope, locals) {\n            var result = parsedValue(scope, locals);\n            if (result.charAt && result.charAt(result.length - 1) === '%') {\n              return Math.floor(parseInt(result) / 100 * scrollView.__clientWidth);\n            }\n            return parseInt(result);\n          };\n      }\n    }\n\n    var computedStyleNode;\n    var computedStyleScope;\n    function computeStyleDimensions() {\n      if (!computedStyleNode) {\n        transclude(computedStyleScope = scope.$new(), function(clone) {\n          clone[0].removeAttribute('collection-repeat'); // remove absolute position styling\n          computedStyleNode = clone[0];\n        });\n      }\n\n      computedStyleScope[keyExpr] = (listGetter(scope) || [])[0];\n      if (!$rootScope.$$phase) computedStyleScope.$digest();\n      containerNode.appendChild(computedStyleNode);\n\n      var style = $window.getComputedStyle(computedStyleNode);\n      computedStyleDimensions.width = parseInt(style.width);\n      computedStyleDimensions.height = parseInt(style.height);\n\n      containerNode.removeChild(computedStyleNode);\n    }\n\n  }\n\n}\n\nRepeatManagerFactory.$inject = ['$rootScope', '$window', '$$rAF'];\nfunction RepeatManagerFactory($rootScope, $window, $$rAF) {\n  var EMPTY_DIMENSION = { primaryPos: 0, secondaryPos: 0, primarySize: 0, secondarySize: 0, rowPrimarySize: 0 };\n\n  return function RepeatController(options) {\n    var afterItemsNode = options.afterItemsNode;\n    var containerNode = options.containerNode;\n    var forceRefreshImages = options.forceRefreshImages;\n    var heightData = options.heightData;\n    var widthData = options.widthData;\n    var keyExpression = options.keyExpression;\n    var renderBuffer = options.renderBuffer;\n    var scope = options.scope;\n    var scrollView = options.scrollView;\n    var transclude = options.transclude;\n\n    var data = [];\n\n    var getterLocals = {};\n    var heightFn = heightData.getValue || function() { return heightData.value; };\n    var heightGetter = function(index, value) {\n      getterLocals[keyExpression] = value;\n      getterLocals.$index = index;\n      return heightFn(scope, getterLocals);\n    };\n\n    var widthFn = widthData.getValue || function() { return widthData.value; };\n    var widthGetter = function(index, value) {\n      getterLocals[keyExpression] = value;\n      getterLocals.$index = index;\n      return widthFn(scope, getterLocals);\n    };\n\n    var isVertical = !!scrollView.options.scrollingY;\n\n    // We say it's a grid view if we're either dynamic or not 100% width\n    var isGridView = isVertical ?\n      (widthData.dynamic || widthData.value !== scrollView.__clientWidth) :\n      (heightData.dynamic || heightData.value !== scrollView.__clientHeight);\n\n    var isStaticView = !heightData.dynamic && !widthData.dynamic;\n\n    var PRIMARY = 'PRIMARY';\n    var SECONDARY = 'SECONDARY';\n    var TRANSLATE_TEMPLATE_STR = isVertical ?\n      'translate3d(SECONDARYpx,PRIMARYpx,0)' :\n      'translate3d(PRIMARYpx,SECONDARYpx,0)';\n    var WIDTH_HEIGHT_TEMPLATE_STR = isVertical ?\n      'height: PRIMARYpx; width: SECONDARYpx;' :\n      'height: SECONDARYpx; width: PRIMARYpx;';\n\n    var estimatedHeight;\n    var estimatedWidth;\n\n    var repeaterBeforeSize = 0;\n    var repeaterAfterSize = 0;\n\n    var renderStartIndex = -1;\n    var renderEndIndex = -1;\n    var renderAfterBoundary = -1;\n    var renderBeforeBoundary = -1;\n\n    var itemsPool = [];\n    var itemsLeaving = [];\n    var itemsEntering = [];\n    var itemsShownMap = {};\n    var nextItemId = 0;\n\n    var scrollViewSetDimensions = isVertical ?\n      function() { scrollView.setDimensions(null, null, null, view.getContentSize(), true); } :\n      function() { scrollView.setDimensions(null, null, view.getContentSize(), null, true); };\n\n    // view is a mix of list/grid methods + static/dynamic methods.\n    // See bottom for implementations. Available methods:\n    //\n    // getEstimatedPrimaryPos(i), getEstimatedSecondaryPos(i), getEstimatedIndex(scrollTop),\n    // calculateDimensions(toIndex), getDimensions(index),\n    // updateRenderRange(scrollTop, scrollValueEnd), onRefreshLayout(), onRefreshData()\n    var view = isVertical ? new VerticalViewType() : new HorizontalViewType();\n    (isGridView ? GridViewType : ListViewType).call(view);\n    (isStaticView ? StaticViewType : DynamicViewType).call(view);\n\n    var contentSizeStr = isVertical ? 'getContentHeight' : 'getContentWidth';\n    var originalGetContentSize = scrollView.options[contentSizeStr];\n    scrollView.options[contentSizeStr] = angular.bind(view, view.getContentSize);\n\n    scrollView.__$callback = scrollView.__callback;\n    scrollView.__callback = function(transformLeft, transformTop, zoom, wasResize) {\n      var scrollValue = view.getScrollValue();\n      if (renderStartIndex === -1 ||\n          scrollValue + view.scrollPrimarySize > renderAfterBoundary ||\n          scrollValue < renderBeforeBoundary) {\n        render();\n      }\n      scrollView.__$callback(transformLeft, transformTop, zoom, wasResize);\n    };\n\n    var isLayoutReady = false;\n    var isDataReady = false;\n    this.refreshLayout = function() {\n      if (data.length) {\n        estimatedHeight = heightGetter(0, data[0]);\n        estimatedWidth = widthGetter(0, data[0]);\n      } else {\n        // If we don't have any data in our array, just guess.\n        estimatedHeight = 100;\n        estimatedWidth = 100;\n      }\n\n      // Get the size of every element AFTER the repeater. We have to get the margin before and\n      // after the first/last element to fix a browser bug with getComputedStyle() not counting\n      // the first/last child's margins into height.\n      var style = getComputedStyle(afterItemsNode) || {};\n      var firstStyle = afterItemsNode.firstElementChild && getComputedStyle(afterItemsNode.firstElementChild) || {};\n      var lastStyle = afterItemsNode.lastElementChild && getComputedStyle(afterItemsNode.lastElementChild) || {};\n      repeaterAfterSize = (parseInt(style[isVertical ? 'height' : 'width']) || 0) +\n        (firstStyle && parseInt(firstStyle[isVertical ? 'marginTop' : 'marginLeft']) || 0) +\n        (lastStyle && parseInt(lastStyle[isVertical ? 'marginBottom' : 'marginRight']) || 0);\n\n      // Get the offsetTop of the repeater.\n      repeaterBeforeSize = 0;\n      var current = containerNode;\n      do {\n        repeaterBeforeSize += current[isVertical ? 'offsetTop' : 'offsetLeft'];\n      } while ( ionic.DomUtil.contains(scrollView.__content, current = current.offsetParent) );\n\n      var containerPrevNode = containerNode.previousElementSibling;\n      var beforeStyle = containerPrevNode ? $window.getComputedStyle(containerPrevNode) : {};\n      var beforeMargin = parseInt(beforeStyle[isVertical ? 'marginBottom' : 'marginRight'] || 0);\n\n      // Because we position the collection container with position: relative, it doesn't take\n      // into account where to position itself relative to the previous element's marginBottom.\n      // To compensate, we translate the container up by the previous element's margin.\n      containerNode.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n        .replace(PRIMARY, -beforeMargin)\n        .replace(SECONDARY, 0);\n      repeaterBeforeSize -= beforeMargin;\n\n      if (!scrollView.__clientHeight || !scrollView.__clientWidth) {\n        scrollView.__clientWidth = scrollView.__container.clientWidth;\n        scrollView.__clientHeight = scrollView.__container.clientHeight;\n      }\n\n      (view.onRefreshLayout || angular.noop)();\n      view.refreshDirection();\n      scrollViewSetDimensions();\n\n      // Create the pool of items for reuse, setting the size to (estimatedItemsOnScreen) * 2,\n      // plus the size of the renderBuffer.\n      if (!isLayoutReady) {\n        var poolSize = Math.max(20, renderBuffer * 3);\n        for (var i = 0; i < poolSize; i++) {\n          itemsPool.push(new RepeatItem());\n        }\n      }\n\n      isLayoutReady = true;\n      if (isLayoutReady && isDataReady) {\n        // If the resize or latest data change caused the scrollValue to\n        // now be out of bounds, resize the scrollView.\n        if (scrollView.__scrollLeft > scrollView.__maxScrollLeft ||\n            scrollView.__scrollTop > scrollView.__maxScrollTop) {\n          scrollView.resize();\n        }\n        forceRerender(true);\n      }\n    };\n\n    this.setData = function(newData) {\n      data = newData;\n      (view.onRefreshData || angular.noop)();\n      isDataReady = true;\n    };\n\n    this.destroy = function() {\n      render.destroyed = true;\n\n      itemsPool.forEach(function(item) {\n        item.scope.$destroy();\n        item.scope = item.element = item.node = item.images = null;\n      });\n      itemsPool.length = itemsEntering.length = itemsLeaving.length = 0;\n      itemsShownMap = {};\n\n      //Restore the scrollView's normal behavior and resize it to normal size.\n      scrollView.options[contentSizeStr] = originalGetContentSize;\n      scrollView.__callback = scrollView.__$callback;\n      scrollView.resize();\n\n      (view.onDestroy || angular.noop)();\n    };\n\n    function forceRerender() {\n      return render(true);\n    }\n    function render(forceRerender) {\n      if (render.destroyed) return;\n      var i;\n      var ii;\n      var item;\n      var dim;\n      var scope;\n      var scrollValue = view.getScrollValue();\n      var scrollValueEnd = scrollValue + view.scrollPrimarySize;\n\n      view.updateRenderRange(scrollValue, scrollValueEnd);\n\n      renderStartIndex = Math.max(0, renderStartIndex - renderBuffer);\n      renderEndIndex = Math.min(data.length - 1, renderEndIndex + renderBuffer);\n\n      for (i in itemsShownMap) {\n        if (i < renderStartIndex || i > renderEndIndex) {\n          item = itemsShownMap[i];\n          delete itemsShownMap[i];\n          itemsLeaving.push(item);\n          item.isShown = false;\n        }\n      }\n\n      // Render indicies that aren't shown yet\n      //\n      // NOTE(ajoslin): this may sound crazy, but calling any other functions during this render\n      // loop will often push the render time over the edge from less than one frame to over\n      // one frame, causing visible jank.\n      // DON'T call any other functions inside this loop unless it's vital.\n      for (i = renderStartIndex; i <= renderEndIndex; i++) {\n        // We only go forward with render if the index is in data, the item isn't already shown,\n        // or forceRerender is on.\n        if (i >= data.length || (itemsShownMap[i] && !forceRerender)) continue;\n\n        item = itemsShownMap[i] || (itemsShownMap[i] = itemsLeaving.length ? itemsLeaving.pop() :\n                                    itemsPool.length ? itemsPool.shift() :\n                                    new RepeatItem());\n        itemsEntering.push(item);\n        item.isShown = true;\n\n        scope = item.scope;\n        scope.$index = i;\n        scope[keyExpression] = data[i];\n        scope.$first = (i === 0);\n        scope.$last = (i === (data.length - 1));\n        scope.$middle = !(scope.$first || scope.$last);\n        scope.$odd = !(scope.$even = (i & 1) === 0);\n\n        if (scope.$$disconnected) ionic.Utils.reconnectScope(item.scope);\n\n        dim = view.getDimensions(i);\n        if (item.secondaryPos !== dim.secondaryPos || item.primaryPos !== dim.primaryPos) {\n          item.node.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n            .replace(PRIMARY, (item.primaryPos = dim.primaryPos))\n            .replace(SECONDARY, (item.secondaryPos = dim.secondaryPos));\n        }\n        if (item.secondarySize !== dim.secondarySize || item.primarySize !== dim.primarySize) {\n          item.node.style.cssText = item.node.style.cssText\n            .replace(WIDTH_HEIGHT_REGEX, WIDTH_HEIGHT_TEMPLATE_STR\n              //TODO fix item.primarySize + 1 hack\n              .replace(PRIMARY, (item.primarySize = dim.primarySize) + 1)\n              .replace(SECONDARY, (item.secondarySize = dim.secondarySize))\n            );\n        }\n\n      }\n\n      // If we reach the end of the list, render the afterItemsNode - this contains all the\n      // elements the developer placed after the collection-repeat\n      if (renderEndIndex === data.length - 1) {\n        dim = view.getDimensions(data.length - 1) || EMPTY_DIMENSION;\n        afterItemsNode.style[ionic.CSS.TRANSFORM] = TRANSLATE_TEMPLATE_STR\n          .replace(PRIMARY, dim.primaryPos + dim.primarySize)\n          .replace(SECONDARY, 0);\n      }\n\n      while (itemsLeaving.length) {\n        item = itemsLeaving.pop();\n        item.scope.$broadcast('$collectionRepeatLeave');\n        ionic.Utils.disconnectScope(item.scope);\n        itemsPool.push(item);\n        item.node.style[ionic.CSS.TRANSFORM] = 'translate3d(-9999px,-9999px,0)';\n        item.primaryPos = item.secondaryPos = null;\n      }\n\n      if (forceRefreshImages) {\n        for (i = 0, ii = itemsEntering.length; i < ii && (item = itemsEntering[i]); i++) {\n          if (!item.images) continue;\n          for (var j = 0, jj = item.images.length, img; j < jj && (img = item.images[j]); j++) {\n            var src = img.src;\n            img.src = ONE_PX_TRANSPARENT_IMG_SRC;\n            img.src = src;\n          }\n        }\n      }\n      if (forceRerender) {\n        var rootScopePhase = $rootScope.$$phase;\n        while (itemsEntering.length) {\n          item = itemsEntering.pop();\n          if (!rootScopePhase) item.scope.$digest();\n        }\n      } else {\n        digestEnteringItems();\n      }\n    }\n\n    function digestEnteringItems() {\n      var item;\n      if (digestEnteringItems.running) return;\n      digestEnteringItems.running = true;\n\n      $$rAF(function process() {\n        var rootScopePhase = $rootScope.$$phase;\n        while (itemsEntering.length) {\n          item = itemsEntering.pop();\n          if (item.isShown) {\n            if (!rootScopePhase) item.scope.$digest();\n          }\n        }\n        digestEnteringItems.running = false;\n      });\n    }\n\n    function RepeatItem() {\n      var self = this;\n      this.scope = scope.$new();\n      this.id = 'item' + (nextItemId++);\n      transclude(this.scope, function(clone) {\n        self.element = clone;\n        self.element.data('$$collectionRepeatItem', self);\n        // TODO destroy\n        self.node = clone[0];\n        // Batch style setting to lower repaints\n        self.node.style[ionic.CSS.TRANSFORM] = 'translate3d(-9999px,-9999px,0)';\n        self.node.style.cssText += ' height: 0px; width: 0px;';\n        ionic.Utils.disconnectScope(self.scope);\n        containerNode.appendChild(self.node);\n        self.images = clone[0].getElementsByTagName('img');\n      });\n    }\n\n    function VerticalViewType() {\n      this.getItemPrimarySize = heightGetter;\n      this.getItemSecondarySize = widthGetter;\n\n      this.getScrollValue = function() {\n        return Math.max(0, Math.min(scrollView.__scrollTop - repeaterBeforeSize,\n          scrollView.__maxScrollTop - repeaterBeforeSize - repeaterAfterSize));\n      };\n\n      this.refreshDirection = function() {\n        this.scrollPrimarySize = scrollView.__clientHeight;\n        this.scrollSecondarySize = scrollView.__clientWidth;\n\n        this.estimatedPrimarySize = estimatedHeight;\n        this.estimatedSecondarySize = estimatedWidth;\n        this.estimatedItemsAcross = isGridView &&\n          Math.floor(scrollView.__clientWidth / estimatedWidth) ||\n          1;\n      };\n    }\n    function HorizontalViewType() {\n      this.getItemPrimarySize = widthGetter;\n      this.getItemSecondarySize = heightGetter;\n\n      this.getScrollValue = function() {\n        return Math.max(0, Math.min(scrollView.__scrollLeft - repeaterBeforeSize,\n          scrollView.__maxScrollLeft - repeaterBeforeSize - repeaterAfterSize));\n      };\n\n      this.refreshDirection = function() {\n        this.scrollPrimarySize = scrollView.__clientWidth;\n        this.scrollSecondarySize = scrollView.__clientHeight;\n\n        this.estimatedPrimarySize = estimatedWidth;\n        this.estimatedSecondarySize = estimatedHeight;\n        this.estimatedItemsAcross = isGridView &&\n          Math.floor(scrollView.__clientHeight / estimatedHeight) ||\n          1;\n      };\n    }\n\n    function GridViewType() {\n      this.getEstimatedSecondaryPos = function(index) {\n        return (index % this.estimatedItemsAcross) * this.estimatedSecondarySize;\n      };\n      this.getEstimatedPrimaryPos = function(index) {\n        return Math.floor(index / this.estimatedItemsAcross) * this.estimatedPrimarySize;\n      };\n      this.getEstimatedIndex = function(scrollValue) {\n        return Math.floor(scrollValue / this.estimatedPrimarySize) *\n          this.estimatedItemsAcross;\n      };\n    }\n\n    function ListViewType() {\n      this.getEstimatedSecondaryPos = function() {\n        return 0;\n      };\n      this.getEstimatedPrimaryPos = function(index) {\n        return index * this.estimatedPrimarySize;\n      };\n      this.getEstimatedIndex = function(scrollValue) {\n        return Math.floor((scrollValue) / this.estimatedPrimarySize);\n      };\n    }\n\n    function StaticViewType() {\n      this.getContentSize = function() {\n        return this.getEstimatedPrimaryPos(data.length - 1) + this.estimatedPrimarySize +\n          repeaterBeforeSize + repeaterAfterSize;\n      };\n      // static view always returns the same object for getDimensions, to avoid memory allocation\n      // while scrolling. This could be dangerous if this was a public function, but it's not.\n      // Only we use it.\n      var dim = {};\n      this.getDimensions = function(index) {\n        dim.primaryPos = this.getEstimatedPrimaryPos(index);\n        dim.secondaryPos = this.getEstimatedSecondaryPos(index);\n        dim.primarySize = this.estimatedPrimarySize;\n        dim.secondarySize = this.estimatedSecondarySize;\n        return dim;\n      };\n      this.updateRenderRange = function(scrollValue, scrollValueEnd) {\n        renderStartIndex = Math.max(0, this.getEstimatedIndex(scrollValue));\n\n        // Make sure the renderEndIndex takes into account all the items on the row\n        renderEndIndex = Math.min(data.length - 1,\n          this.getEstimatedIndex(scrollValueEnd) + this.estimatedItemsAcross - 1);\n\n        renderBeforeBoundary = Math.max(0,\n          this.getEstimatedPrimaryPos(renderStartIndex));\n        renderAfterBoundary = this.getEstimatedPrimaryPos(renderEndIndex) +\n          this.estimatedPrimarySize;\n      };\n    }\n\n    function DynamicViewType() {\n      var self = this;\n      var debouncedScrollViewSetDimensions = ionic.debounce(scrollViewSetDimensions, 25, true);\n      var calculateDimensions = isGridView ? calculateDimensionsGrid : calculateDimensionsList;\n      var dimensionsIndex;\n      var dimensions = [];\n\n\n      // Get the dimensions at index. {width, height, left, top}.\n      // We start with no dimensions calculated, then any time dimensions are asked for at an\n      // index we calculate dimensions up to there.\n      function calculateDimensionsList(toIndex) {\n        var i, prevDimension, dim;\n        for (i = Math.max(0, dimensionsIndex); i <= toIndex && (dim = dimensions[i]); i++) {\n          prevDimension = dimensions[i - 1] || EMPTY_DIMENSION;\n          dim.primarySize = self.getItemPrimarySize(i, data[i]);\n          dim.secondarySize = self.scrollSecondarySize;\n          dim.primaryPos = prevDimension.primaryPos + prevDimension.primarySize;\n          dim.secondaryPos = 0;\n        }\n      }\n      function calculateDimensionsGrid(toIndex) {\n        var i, prevDimension, dim;\n        for (i = Math.max(dimensionsIndex, 0); i <= toIndex && (dim = dimensions[i]); i++) {\n          prevDimension = dimensions[i - 1] || EMPTY_DIMENSION;\n          dim.secondarySize = Math.min(\n            self.getItemSecondarySize(i, data[i]),\n            self.scrollSecondarySize\n          );\n          dim.secondaryPos = prevDimension.secondaryPos + prevDimension.secondarySize;\n\n          if (i === 0 || dim.secondaryPos + dim.secondarySize > self.scrollSecondarySize) {\n            dim.secondaryPos = 0;\n            dim.primarySize = self.getItemPrimarySize(i, data[i]);\n            dim.primaryPos = prevDimension.primaryPos + prevDimension.rowPrimarySize;\n\n            dim.rowStartIndex = i;\n            dim.rowPrimarySize = dim.primarySize;\n          } else {\n            dim.primarySize = self.getItemPrimarySize(i, data[i]);\n            dim.primaryPos = prevDimension.primaryPos;\n            dim.rowStartIndex = prevDimension.rowStartIndex;\n\n            dimensions[dim.rowStartIndex].rowPrimarySize = dim.rowPrimarySize = Math.max(\n              dimensions[dim.rowStartIndex].rowPrimarySize,\n              dim.primarySize\n            );\n            dim.rowPrimarySize = Math.max(dim.primarySize, dim.rowPrimarySize);\n          }\n        }\n      }\n\n      this.getContentSize = function() {\n        var dim = dimensions[dimensionsIndex] || EMPTY_DIMENSION;\n        return ((dim.primaryPos + dim.primarySize) || 0) +\n          this.getEstimatedPrimaryPos(data.length - dimensionsIndex - 1) +\n          repeaterBeforeSize + repeaterAfterSize;\n      };\n      this.onDestroy = function() {\n        dimensions.length = 0;\n      };\n\n      this.onRefreshData = function() {\n        var i;\n        var ii;\n        // Make sure dimensions has as many items as data.length.\n        // This is to be sure we don't have to allocate objects while scrolling.\n        for (i = dimensions.length, ii = data.length; i < ii; i++) {\n          dimensions.push({});\n        }\n        dimensionsIndex = -1;\n      };\n      this.onRefreshLayout = function() {\n        dimensionsIndex = -1;\n      };\n      this.getDimensions = function(index) {\n        index = Math.min(index, data.length - 1);\n\n        if (dimensionsIndex < index) {\n          // Once we start asking for dimensions near the end of the list, go ahead and calculate\n          // everything. This is to make sure when the user gets to the end of the list, the\n          // scroll height of the list is 100% accurate (not estimated anymore).\n          if (index > data.length * 0.9) {\n            calculateDimensions(data.length - 1);\n            dimensionsIndex = data.length - 1;\n            scrollViewSetDimensions();\n          } else {\n            calculateDimensions(index);\n            dimensionsIndex = index;\n            debouncedScrollViewSetDimensions();\n          }\n\n        }\n        return dimensions[index];\n      };\n\n      var oldRenderStartIndex = -1;\n      var oldScrollValue = -1;\n      this.updateRenderRange = function(scrollValue, scrollValueEnd) {\n        var i;\n        var len;\n        var dim;\n\n        // Calculate more dimensions than we estimate we'll need, to be sure.\n        this.getDimensions( this.getEstimatedIndex(scrollValueEnd) * 2 );\n\n        // -- Calculate renderStartIndex\n        // base case: start at 0\n        if (oldRenderStartIndex === -1 || scrollValue === 0) {\n          i = 0;\n        // scrolling down\n        } else if (scrollValue >= oldScrollValue) {\n          for (i = oldRenderStartIndex, len = data.length; i < len; i++) {\n            if ((dim = this.getDimensions(i)) && dim.primaryPos + dim.rowPrimarySize >= scrollValue) {\n              break;\n            }\n          }\n        // scrolling up\n        } else {\n          for (i = oldRenderStartIndex; i >= 0; i--) {\n            if ((dim = this.getDimensions(i)) && dim.primaryPos <= scrollValue) {\n              // when grid view, make sure the render starts at the beginning of a row.\n              i = isGridView ? dim.rowStartIndex : i;\n              break;\n            }\n          }\n        }\n\n        renderStartIndex = Math.min(Math.max(0, i), data.length - 1);\n        renderBeforeBoundary = renderStartIndex !== -1 ? this.getDimensions(renderStartIndex).primaryPos : -1;\n\n        // -- Calculate renderEndIndex\n        var lastRowDim;\n        for (i = renderStartIndex + 1, len = data.length; i < len; i++) {\n          if ((dim = this.getDimensions(i)) && dim.primaryPos + dim.rowPrimarySize > scrollValueEnd) {\n\n            // Go all the way to the end of the row if we're in a grid\n            if (isGridView) {\n              lastRowDim = dim;\n              while (i < len - 1 &&\n                    (dim = this.getDimensions(i + 1)).primaryPos === lastRowDim.primaryPos) {\n                i++;\n              }\n            }\n            break;\n          }\n        }\n\n        renderEndIndex = Math.min(i, data.length - 1);\n        renderAfterBoundary = renderEndIndex !== -1 ?\n          ((dim = this.getDimensions(renderEndIndex)).primaryPos + (dim.rowPrimarySize || dim.primarySize)) :\n          -1;\n\n        oldScrollValue = scrollValue;\n        oldRenderStartIndex = renderStartIndex;\n      };\n    }\n\n\n  };\n\n}\n\n/**\n * @ngdoc directive\n * @name ionContent\n * @module ionic\n * @delegate ionic.service:$ionicScrollDelegate\n * @restrict E\n *\n * @description\n * The ionContent directive provides an easy to use content area that can be configured\n * to use Ionic's custom Scroll View, or the built in overflow scrolling of the browser.\n *\n * While we recommend using the custom Scroll features in Ionic in most cases, sometimes\n * (for performance reasons) only the browser's native overflow scrolling will suffice,\n * and so we've made it easy to toggle between the Ionic scroll implementation and\n * overflow scrolling.\n *\n * You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher}\n * directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll}\n * directive.\n *\n * If there is any dynamic content inside the ion-content, be sure to call `.resize()` with {@link ionic.service:$ionicScrollDelegate}\n * after the content has been added.\n *\n * Be aware that this directive gets its own child scope. If you do not understand why this\n * is important, you can read [https://docs.angularjs.org/guide/scope](https://docs.angularjs.org/guide/scope).\n *\n * @param {string=} delegate-handle The handle used to identify this scrollView\n * with {@link ionic.service:$ionicScrollDelegate}.\n * @param {string=} direction Which way to scroll. 'x' or 'y' or 'xy'. Default 'y'.\n * @param {boolean=} locking Whether to lock scrolling in one direction at a time. Useful to set to false when zoomed in or scrolling in two directions. Default true.\n * @param {boolean=} padding Whether to add padding to the content.\n * of the content.  Defaults to true on iOS, false on Android.\n * @param {boolean=} scroll Whether to allow scrolling of content.  Defaults to true.\n * @param {boolean=} overflow-scroll Whether to use overflow-scrolling instead of\n * Ionic scroll. See {@link ionic.provider:$ionicConfigProvider} to set this as the global default.\n * @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default true.\n * @param {boolean=} scrollbar-y Whether to show the vertical scrollbar. Default true.\n * @param {string=} start-x Initial horizontal scroll position. Default 0.\n * @param {string=} start-y Initial vertical scroll position. Default 0.\n * @param {expression=} on-scroll Expression to evaluate when the content is scrolled.\n * @param {expression=} on-scroll-complete Expression to evaluate when a scroll action completes. Has access to 'scrollLeft' and 'scrollTop' locals.\n * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges\n * of the content.  Defaults to true on iOS, false on Android.\n * @param {number=} scroll-event-interval Number of milliseconds between each firing of the 'on-scroll' expression. Default 10.\n */\nIonicModule\n.directive('ionContent', [\n  '$timeout',\n  '$controller',\n  '$ionicBind',\n  '$ionicConfig',\nfunction($timeout, $controller, $ionicBind, $ionicConfig) {\n  return {\n    restrict: 'E',\n    require: '^?ionNavView',\n    scope: true,\n    priority: 800,\n    compile: function(element, attr) {\n      var innerElement;\n      var scrollCtrl;\n\n      element.addClass('scroll-content ionic-scroll');\n\n      if (attr.scroll != 'false') {\n        //We cannot use normal transclude here because it breaks element.data()\n        //inheritance on compile\n        innerElement = jqLite('<div class=\"scroll\"></div>');\n        innerElement.append(element.contents());\n        element.append(innerElement);\n      } else {\n        element.addClass('scroll-content-false');\n      }\n\n      var nativeScrolling = attr.overflowScroll === \"true\" || !$ionicConfig.scrolling.jsScrolling();\n\n      // collection-repeat requires JS scrolling\n      if (nativeScrolling) {\n        nativeScrolling = !element[0].querySelector('[collection-repeat]');\n      }\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr) {\n        var parentScope = $scope.$parent;\n        $scope.$watch(function() {\n          return (parentScope.$hasHeader ? ' has-header' : '') +\n            (parentScope.$hasSubheader ? ' has-subheader' : '') +\n            (parentScope.$hasFooter ? ' has-footer' : '') +\n            (parentScope.$hasSubfooter ? ' has-subfooter' : '') +\n            (parentScope.$hasTabs ? ' has-tabs' : '') +\n            (parentScope.$hasTabsTop ? ' has-tabs-top' : '');\n        }, function(className, oldClassName) {\n          $element.removeClass(oldClassName);\n          $element.addClass(className);\n        });\n\n        //Only this ionContent should use these variables from parent scopes\n        $scope.$hasHeader = $scope.$hasSubheader =\n          $scope.$hasFooter = $scope.$hasSubfooter =\n          $scope.$hasTabs = $scope.$hasTabsTop =\n          false;\n        $ionicBind($scope, $attr, {\n          $onScroll: '&onScroll',\n          $onScrollComplete: '&onScrollComplete',\n          hasBouncing: '@',\n          padding: '@',\n          direction: '@',\n          scrollbarX: '@',\n          scrollbarY: '@',\n          startX: '@',\n          startY: '@',\n          scrollEventInterval: '@'\n        });\n        $scope.direction = $scope.direction || 'y';\n\n        if (isDefined($attr.padding)) {\n          $scope.$watch($attr.padding, function(newVal) {\n              (innerElement || $element).toggleClass('padding', !!newVal);\n          });\n        }\n\n        if ($attr.scroll === \"false\") {\n          //do nothing\n        } else {\n          var scrollViewOptions = {};\n\n          // determined in compile phase above\n          if (nativeScrolling) {\n            // use native scrolling\n            $element.addClass('overflow-scroll');\n\n            scrollViewOptions = {\n              el: $element[0],\n              delegateHandle: attr.delegateHandle,\n              startX: $scope.$eval($scope.startX) || 0,\n              startY: $scope.$eval($scope.startY) || 0,\n              nativeScrolling: true\n            };\n\n          } else {\n            // Use JS scrolling\n            scrollViewOptions = {\n              el: $element[0],\n              delegateHandle: attr.delegateHandle,\n              locking: (attr.locking || 'true') === 'true',\n              bouncing: $scope.$eval($scope.hasBouncing),\n              startX: $scope.$eval($scope.startX) || 0,\n              startY: $scope.$eval($scope.startY) || 0,\n              scrollbarX: $scope.$eval($scope.scrollbarX) !== false,\n              scrollbarY: $scope.$eval($scope.scrollbarY) !== false,\n              scrollingX: $scope.direction.indexOf('x') >= 0,\n              scrollingY: $scope.direction.indexOf('y') >= 0,\n              scrollEventInterval: parseInt($scope.scrollEventInterval, 10) || 10,\n              scrollingComplete: onScrollComplete\n            };\n          }\n\n          // init scroll controller with appropriate options\n          scrollCtrl = $controller('$ionicScroll', {\n            $scope: $scope,\n            scrollViewOptions: scrollViewOptions\n          });\n\n          $scope.$on('$destroy', function() {\n            if (scrollViewOptions) {\n              scrollViewOptions.scrollingComplete = noop;\n              delete scrollViewOptions.el;\n            }\n            innerElement = null;\n            $element = null;\n            attr.$$element = null;\n          });\n        }\n\n        function onScrollComplete() {\n          $scope.$onScrollComplete({\n            scrollTop: scrollCtrl.scrollView.__scrollTop,\n            scrollLeft: scrollCtrl.scrollView.__scrollLeft\n          });\n        }\n\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name exposeAsideWhen\n * @module ionic\n * @restrict A\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * It is common for a tablet application to hide a menu when in portrait mode, but to show the\n * same menu on the left side when the tablet is in landscape mode. The `exposeAsideWhen` attribute\n * directive can be used to accomplish a similar interface.\n *\n * By default, side menus are hidden underneath its side menu content, and can be opened by either\n * swiping the content left or right, or toggling a button to show the side menu. However, by adding the\n * `exposeAsideWhen` attribute directive to an {@link ionic.directive:ionSideMenu} element directive,\n * a side menu can be given instructions on \"when\" the menu should be exposed (always viewable). For\n * example, the `expose-aside-when=\"large\"` attribute will keep the side menu hidden when the viewport's\n * width is less than `768px`, but when the viewport's width is `768px` or greater, the menu will then\n * always be shown and can no longer be opened or closed like it could when it was hidden for smaller\n * viewports.\n *\n * Using `large` as the attribute's value is a shortcut value to `(min-width:768px)` since it is\n * the most common use-case. However, for added flexibility, any valid media query could be added\n * as the value, such as `(min-width:600px)` or even multiple queries such as\n * `(min-width:750px) and (max-width:1200px)`.\n\n * @usage\n * ```html\n * <ion-side-menus>\n *   <!-- Center content -->\n *   <ion-side-menu-content>\n *   </ion-side-menu-content>\n *\n *   <!-- Left menu -->\n *   <ion-side-menu expose-aside-when=\"large\">\n *   </ion-side-menu>\n * </ion-side-menus>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n */\nIonicModule.directive('exposeAsideWhen', ['$window', function($window) {\n  return {\n    restrict: 'A',\n    require: '^ionSideMenus',\n    link: function($scope, $element, $attr, sideMenuCtrl) {\n\n      function checkAsideExpose() {\n        var mq = $attr.exposeAsideWhen == 'large' ? '(min-width:768px)' : $attr.exposeAsideWhen;\n        sideMenuCtrl.exposeAside($window.matchMedia(mq).matches);\n        sideMenuCtrl.activeAsideResizing(false);\n      }\n\n      function onResize() {\n        sideMenuCtrl.activeAsideResizing(true);\n        debouncedCheck();\n      }\n\n      var debouncedCheck = ionic.debounce(function() {\n        $scope.$apply(checkAsideExpose);\n      }, 300, false);\n\n      $scope.$evalAsync(checkAsideExpose);\n\n      ionic.on('resize', onResize, $window);\n\n      $scope.$on('$destroy', function() {\n        ionic.off('resize', onResize, $window);\n      });\n\n    }\n  };\n}]);\n\n\nvar GESTURE_DIRECTIVES = 'onHold onTap onDoubleTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' ');\n\nGESTURE_DIRECTIVES.forEach(function(name) {\n  IonicModule.directive(name, gestureDirective(name));\n});\n\n\n/**\n * @ngdoc directive\n * @name onHold\n * @module ionic\n * @restrict A\n *\n * @description\n * Touch stays at the same location for 500ms. Similar to long touch events available for AngularJS and jQuery.\n *\n * @usage\n * ```html\n * <button on-hold=\"onHold()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onTap\n * @module ionic\n * @restrict A\n *\n * @description\n * Quick touch at a location. If the duration of the touch goes\n * longer than 250ms it is no longer a tap gesture.\n *\n * @usage\n * ```html\n * <button on-tap=\"onTap()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDoubleTap\n * @module ionic\n * @restrict A\n *\n * @description\n * Double tap touch at a location.\n *\n * @usage\n * ```html\n * <button on-double-tap=\"onDoubleTap()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onTouch\n * @module ionic\n * @restrict A\n *\n * @description\n * Called immediately when the user first begins a touch. This\n * gesture does not wait for a touchend/mouseup.\n *\n * @usage\n * ```html\n * <button on-touch=\"onTouch()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onRelease\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the user ends a touch.\n *\n * @usage\n * ```html\n * <button on-release=\"onRelease()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDrag\n * @module ionic\n * @restrict A\n *\n * @description\n * Move with one touch around on the page. Blocking the scrolling when\n * moving left and right is a good practice. When all the drag events are\n * blocking you disable scrolling on that area.\n *\n * @usage\n * ```html\n * <button on-drag=\"onDrag()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragUp\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged up.\n *\n * @usage\n * ```html\n * <button on-drag-up=\"onDragUp()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragRight\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged to the right.\n *\n * @usage\n * ```html\n * <button on-drag-right=\"onDragRight()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragDown\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged down.\n *\n * @usage\n * ```html\n * <button on-drag-down=\"onDragDown()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onDragLeft\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when the element is dragged to the left.\n *\n * @usage\n * ```html\n * <button on-drag-left=\"onDragLeft()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipe\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity in any direction.\n *\n * @usage\n * ```html\n * <button on-swipe=\"onSwipe()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeUp\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving up.\n *\n * @usage\n * ```html\n * <button on-swipe-up=\"onSwipeUp()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeRight\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving to the right.\n *\n * @usage\n * ```html\n * <button on-swipe-right=\"onSwipeRight()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeDown\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving down.\n *\n * @usage\n * ```html\n * <button on-swipe-down=\"onSwipeDown()\" class=\"button\">Test</button>\n * ```\n */\n\n\n/**\n * @ngdoc directive\n * @name onSwipeLeft\n * @module ionic\n * @restrict A\n *\n * @description\n * Called when a moving touch has a high velocity moving to the left.\n *\n * @usage\n * ```html\n * <button on-swipe-left=\"onSwipeLeft()\" class=\"button\">Test</button>\n * ```\n */\n\n\nfunction gestureDirective(directiveName) {\n  return ['$ionicGesture', '$parse', function($ionicGesture, $parse) {\n    var eventType = directiveName.substr(2).toLowerCase();\n\n    return function(scope, element, attr) {\n      var fn = $parse( attr[directiveName] );\n\n      var listener = function(ev) {\n        scope.$apply(function() {\n          fn(scope, {\n            $event: ev\n          });\n        });\n      };\n\n      var gesture = $ionicGesture.on(eventType, listener, element);\n\n      scope.$on('$destroy', function() {\n        $ionicGesture.off(gesture, eventType, listener);\n      });\n    };\n  }];\n}\n\n\nIonicModule\n.directive('ionHeaderBar', tapScrollToTopDirective())\n\n/**\n * @ngdoc directive\n * @name ionHeaderBar\n * @module ionic\n * @restrict E\n *\n * @description\n * Adds a fixed header bar above some content.\n *\n * Can also be a subheader (lower down) if the 'bar-subheader' class is applied.\n * See [the header CSS docs](/docs/components/#subheader).\n *\n * @param {string=} align-title How to align the title. By default the title\n * will be aligned the same as how the platform aligns its titles (iOS centers\n * titles, Android aligns them left).\n * Available: 'left', 'right', or 'center'.  Defaults to the same as the platform.\n * @param {boolean=} no-tap-scroll By default, the header bar will scroll the\n * content to the top when tapped.  Set no-tap-scroll to true to disable this\n * behavior.\n * Available: true or false.  Defaults to false.\n *\n * @usage\n * ```html\n * <ion-header-bar align-title=\"left\" class=\"bar-positive\">\n *   <div class=\"buttons\">\n *     <button class=\"button\" ng-click=\"doSomething()\">Left Button</button>\n *   </div>\n *   <h1 class=\"title\">Title!</h1>\n *   <div class=\"buttons\">\n *     <button class=\"button\">Right Button</button>\n *   </div>\n * </ion-header-bar>\n * <ion-content>\n *   Some content!\n * </ion-content>\n * ```\n */\n.directive('ionHeaderBar', headerFooterBarDirective(true))\n\n/**\n * @ngdoc directive\n * @name ionFooterBar\n * @module ionic\n * @restrict E\n *\n * @description\n * Adds a fixed footer bar below some content.\n *\n * Can also be a subfooter (higher up) if the 'bar-subfooter' class is applied.\n * See [the footer CSS docs](/docs/components/#footer).\n *\n * Note: If you use ionFooterBar in combination with ng-if, the surrounding content\n * will not align correctly.  This will be fixed soon.\n *\n * @param {string=} align-title Where to align the title.\n * Available: 'left', 'right', or 'center'.  Defaults to 'center'.\n *\n * @usage\n * ```html\n * <ion-content>\n *   Some content!\n * </ion-content>\n * <ion-footer-bar align-title=\"left\" class=\"bar-assertive\">\n *   <div class=\"buttons\">\n *     <button class=\"button\">Left Button</button>\n *   </div>\n *   <h1 class=\"title\">Title!</h1>\n *   <div class=\"buttons\" ng-click=\"doSomething()\">\n *     <button class=\"button\">Right Button</button>\n *   </div>\n * </ion-footer-bar>\n * ```\n */\n.directive('ionFooterBar', headerFooterBarDirective(false));\n\nfunction tapScrollToTopDirective() {\n  return ['$ionicScrollDelegate', function($ionicScrollDelegate) {\n    return {\n      restrict: 'E',\n      link: function($scope, $element, $attr) {\n        if ($attr.noTapScroll == 'true') {\n          return;\n        }\n        ionic.on('tap', onTap, $element[0]);\n        $scope.$on('$destroy', function() {\n          ionic.off('tap', onTap, $element[0]);\n        });\n\n        function onTap(e) {\n          var depth = 3;\n          var current = e.target;\n          //Don't scroll to top in certain cases\n          while (depth-- && current) {\n            if (current.classList.contains('button') ||\n                current.tagName.match(/input|textarea|select/i) ||\n                current.isContentEditable) {\n              return;\n            }\n            current = current.parentNode;\n          }\n          var touch = e.gesture && e.gesture.touches[0] || e.detail.touches[0];\n          var bounds = $element[0].getBoundingClientRect();\n          if (ionic.DomUtil.rectContains(\n            touch.pageX, touch.pageY,\n            bounds.left, bounds.top - 20,\n            bounds.left + bounds.width, bounds.top + bounds.height\n          )) {\n            $ionicScrollDelegate.scrollTop(true);\n          }\n        }\n      }\n    };\n  }];\n}\n\nfunction headerFooterBarDirective(isHeader) {\n  return ['$document', '$timeout', function($document, $timeout) {\n    return {\n      restrict: 'E',\n      controller: '$ionicHeaderBar',\n      compile: function(tElement) {\n        tElement.addClass(isHeader ? 'bar bar-header' : 'bar bar-footer');\n        // top style tabs? if so, remove bottom border for seamless display\n        $timeout(function() {\n          if (isHeader && $document[0].getElementsByClassName('tabs-top').length) tElement.addClass('has-tabs-top');\n        });\n\n        return { pre: prelink };\n        function prelink($scope, $element, $attr, ctrl) {\n          if (isHeader) {\n            $scope.$watch(function() { return $element[0].className; }, function(value) {\n              var isShown = value.indexOf('ng-hide') === -1;\n              var isSubheader = value.indexOf('bar-subheader') !== -1;\n              $scope.$hasHeader = isShown && !isSubheader;\n              $scope.$hasSubheader = isShown && isSubheader;\n              $scope.$emit('$ionicSubheader', $scope.$hasSubheader);\n            });\n            $scope.$on('$destroy', function() {\n              delete $scope.$hasHeader;\n              delete $scope.$hasSubheader;\n            });\n            ctrl.align();\n            $scope.$on('$ionicHeader.align', function() {\n              ionic.requestAnimationFrame(function() {\n                ctrl.align();\n              });\n            });\n\n          } else {\n            $scope.$watch(function() { return $element[0].className; }, function(value) {\n              var isShown = value.indexOf('ng-hide') === -1;\n              var isSubfooter = value.indexOf('bar-subfooter') !== -1;\n              $scope.$hasFooter = isShown && !isSubfooter;\n              $scope.$hasSubfooter = isShown && isSubfooter;\n            });\n            $scope.$on('$destroy', function() {\n              delete $scope.$hasFooter;\n              delete $scope.$hasSubfooter;\n            });\n            $scope.$watch('$hasTabs', function(val) {\n              $element.toggleClass('has-tabs', !!val);\n            });\n          }\n        }\n      }\n    };\n  }];\n}\n\n/**\n * @ngdoc directive\n * @name ionInfiniteScroll\n * @module ionic\n * @parent ionic.directive:ionContent, ionic.directive:ionScroll\n * @restrict E\n *\n * @description\n * The ionInfiniteScroll directive allows you to call a function whenever\n * the user gets to the bottom of the page or near the bottom of the page.\n *\n * The expression you pass in for `on-infinite` is called when the user scrolls\n * greater than `distance` away from the bottom of the content.  Once `on-infinite`\n * is done loading new data, it should broadcast the `scroll.infiniteScrollComplete`\n * event from your controller (see below example).\n *\n * @param {expression} on-infinite What to call when the scroller reaches the\n * bottom.\n * @param {string=} distance The distance from the bottom that the scroll must\n * reach to trigger the on-infinite expression. Default: 1%.\n * @param {string=} spinner The {@link ionic.directive:ionSpinner} to show while loading. The SVG\n * {@link ionic.directive:ionSpinner} is now the default, replacing rotating font icons.\n * @param {string=} icon The icon to show while loading. Default: 'ion-load-d'.  This is depreicated\n * in favor of the SVG {@link ionic.directive:ionSpinner}.\n * @param {boolean=} immediate-check Whether to check the infinite scroll bounds immediately on load.\n *\n * @usage\n * ```html\n * <ion-content ng-controller=\"MyController\">\n *   <ion-list>\n *   ....\n *   ....\n *   </ion-list>\n *\n *   <ion-infinite-scroll\n *     on-infinite=\"loadMore()\"\n *     distance=\"1%\">\n *   </ion-infinite-scroll>\n * </ion-content>\n * ```\n * ```js\n * function MyController($scope, $http) {\n *   $scope.items = [];\n *   $scope.loadMore = function() {\n *     $http.get('/more-items').success(function(items) {\n *       useItems(items);\n *       $scope.$broadcast('scroll.infiniteScrollComplete');\n *     });\n *   };\n *\n *   $scope.$on('$stateChangeSuccess', function() {\n *     $scope.loadMore();\n *   });\n * }\n * ```\n *\n * An easy to way to stop infinite scroll once there is no more data to load\n * is to use angular's `ng-if` directive:\n *\n * ```html\n * <ion-infinite-scroll\n *   ng-if=\"moreDataCanBeLoaded()\"\n *   icon=\"ion-loading-c\"\n *   on-infinite=\"loadMoreData()\">\n * </ion-infinite-scroll>\n * ```\n */\nIonicModule\n.directive('ionInfiniteScroll', ['$timeout', function($timeout) {\n  return {\n    restrict: 'E',\n    require: ['?^$ionicScroll', 'ionInfiniteScroll'],\n    template: function($element, $attrs) {\n      if ($attrs.icon) return '<i class=\"icon {{icon()}} icon-refreshing {{scrollingType}}\"></i>';\n      return '<ion-spinner icon=\"{{spinner()}}\"></ion-spinner>';\n    },\n    scope: true,\n    controller: '$ionInfiniteScroll',\n    link: function($scope, $element, $attrs, ctrls) {\n      var infiniteScrollCtrl = ctrls[1];\n      var scrollCtrl = infiniteScrollCtrl.scrollCtrl = ctrls[0];\n      var jsScrolling = infiniteScrollCtrl.jsScrolling = !scrollCtrl.isNative();\n\n      // if this view is not beneath a scrollCtrl, it can't be injected, proceed w/ native scrolling\n      if (jsScrolling) {\n        infiniteScrollCtrl.scrollView = scrollCtrl.scrollView;\n        $scope.scrollingType = 'js-scrolling';\n        //bind to JS scroll events\n        scrollCtrl.$element.on('scroll', infiniteScrollCtrl.checkBounds);\n      } else {\n        // grabbing the scrollable element, to determine dimensions, and current scroll pos\n        var scrollEl = ionic.DomUtil.getParentOrSelfWithClass($element[0].parentNode, 'overflow-scroll');\n        infiniteScrollCtrl.scrollEl = scrollEl;\n        // if there's no scroll controller, and no overflow scroll div, infinite scroll wont work\n        if (!scrollEl) {\n          throw 'Infinite scroll must be used inside a scrollable div';\n        }\n        //bind to native scroll events\n        infiniteScrollCtrl.scrollEl.addEventListener('scroll', infiniteScrollCtrl.checkBounds);\n      }\n\n      // Optionally check bounds on start after scrollView is fully rendered\n      var doImmediateCheck = isDefined($attrs.immediateCheck) ? $scope.$eval($attrs.immediateCheck) : true;\n      if (doImmediateCheck) {\n        $timeout(function() { infiniteScrollCtrl.checkBounds(); });\n      }\n    }\n  };\n}]);\n\n/**\n* @ngdoc directive\n* @name ionItem\n* @parent ionic.directive:ionList\n* @module ionic\n* @restrict E\n* Creates a list-item that can easily be swiped,\n* deleted, reordered, edited, and more.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* Can be assigned any item class name. See the\n* [list CSS documentation](/docs/components/#list).\n*\n* @usage\n*\n* ```html\n* <ion-list>\n*   <ion-item>Hello!</ion-item>\n*   <ion-item href=\"#/detail\">\n*     Link to detail page\n*   </ion-item>\n* </ion-list>\n* ```\n*/\nIonicModule\n.directive('ionItem', ['$$rAF', function($$rAF) {\n  return {\n    restrict: 'E',\n    controller: ['$scope', '$element', function($scope, $element) {\n      this.$scope = $scope;\n      this.$element = $element;\n    }],\n    scope: true,\n    compile: function($element, $attrs) {\n      var isAnchor = isDefined($attrs.href) ||\n                     isDefined($attrs.ngHref) ||\n                     isDefined($attrs.uiSref);\n      var isComplexItem = isAnchor ||\n        //Lame way of testing, but we have to know at compile what to do with the element\n        /ion-(delete|option|reorder)-button/i.test($element.html());\n\n      if (isComplexItem) {\n        var innerElement = jqLite(isAnchor ? '<a></a>' : '<div></div>');\n        innerElement.addClass('item-content');\n\n        if (isDefined($attrs.href) || isDefined($attrs.ngHref)) {\n          innerElement.attr('ng-href', '{{$href()}}');\n          if (isDefined($attrs.target)) {\n            innerElement.attr('target', '{{$target()}}');\n          }\n        }\n\n        innerElement.append($element.contents());\n\n        $element.addClass('item item-complex')\n                .append(innerElement);\n      } else {\n        $element.addClass('item');\n      }\n\n      return function link($scope, $element, $attrs) {\n        $scope.$href = function() {\n          return $attrs.href || $attrs.ngHref;\n        };\n        $scope.$target = function() {\n          return $attrs.target;\n        };\n\n        var content = $element[0].querySelector('.item-content');\n        if (content) {\n          $scope.$on('$collectionRepeatLeave', function() {\n            if (content && content.$$ionicOptionsOpen) {\n              content.style[ionic.CSS.TRANSFORM] = '';\n              content.style[ionic.CSS.TRANSITION] = 'none';\n              $$rAF(function() {\n                content.style[ionic.CSS.TRANSITION] = '';\n              });\n              content.$$ionicOptionsOpen = false;\n            }\n          });\n        }\n      };\n\n    }\n  };\n}]);\n\nvar ITEM_TPL_DELETE_BUTTON =\n  '<div class=\"item-left-edit item-delete enable-pointer-events\">' +\n  '</div>';\n/**\n* @ngdoc directive\n* @name ionDeleteButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates a delete button inside a list item, that is visible when the\n* {@link ionic.directive:ionList ionList parent's} `show-delete` evaluates to true or\n* `$ionicListDelegate.showDelete(true)` is called.\n*\n* Takes any ionicon as a class.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* @usage\n*\n* ```html\n* <ion-list show-delete=\"shouldShowDelete\">\n*   <ion-item>\n*     <ion-delete-button class=\"ion-minus-circled\"></ion-delete-button>\n*     Hello, list item!\n*   </ion-item>\n* </ion-list>\n* <ion-toggle ng-model=\"shouldShowDelete\">\n*   Show Delete?\n* </ion-toggle>\n* ```\n*/\nIonicModule\n.directive('ionDeleteButton', function() {\n\n  function stopPropagation(ev) {\n    ev.stopPropagation();\n  }\n\n  return {\n    restrict: 'E',\n    require: ['^^ionItem', '^?ionList'],\n    //Run before anything else, so we can move it before other directives process\n    //its location (eg ngIf relies on the location of the directive in the dom)\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      //Add the classes we need during the compile phase, so that they stay\n      //even if something else like ngIf removes the element and re-addss it\n      $attr.$set('class', ($attr['class'] || '') + ' button icon button-icon', true);\n      return function($scope, $element, $attr, ctrls) {\n        var itemCtrl = ctrls[0];\n        var listCtrl = ctrls[1];\n        var container = jqLite(ITEM_TPL_DELETE_BUTTON);\n        container.append($element);\n        itemCtrl.$element.append(container).addClass('item-left-editable');\n\n        //Don't bubble click up to main .item\n        $element.on('click', stopPropagation);\n\n        init();\n        $scope.$on('$ionic.reconnectScope', init);\n        function init() {\n          listCtrl = listCtrl || $element.controller('ionList');\n          if (listCtrl && listCtrl.showDelete()) {\n            container.addClass('visible active');\n          }\n        }\n      };\n    }\n  };\n});\n\n\nIonicModule\n.directive('itemFloatingLabel', function() {\n  return {\n    restrict: 'C',\n    link: function(scope, element) {\n      var el = element[0];\n      var input = el.querySelector('input, textarea');\n      var inputLabel = el.querySelector('.input-label');\n\n      if (!input || !inputLabel) return;\n\n      var onInput = function() {\n        if (input.value) {\n          inputLabel.classList.add('has-input');\n        } else {\n          inputLabel.classList.remove('has-input');\n        }\n      };\n\n      input.addEventListener('input', onInput);\n\n      var ngModelCtrl = jqLite(input).controller('ngModel');\n      if (ngModelCtrl) {\n        ngModelCtrl.$render = function() {\n          input.value = ngModelCtrl.$viewValue || '';\n          onInput();\n        };\n      }\n\n      scope.$on('$destroy', function() {\n        input.removeEventListener('input', onInput);\n      });\n    }\n  };\n});\n\nvar ITEM_TPL_OPTION_BUTTONS =\n  '<div class=\"item-options invisible\">' +\n  '</div>';\n/**\n* @ngdoc directive\n* @name ionOptionButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates an option button inside a list item, that is visible when the item is swiped\n* to the left by the user.  Swiped open option buttons can be hidden with\n* {@link ionic.service:$ionicListDelegate#closeOptionButtons $ionicListDelegate#closeOptionButtons}.\n*\n* Can be assigned any button class.\n*\n* See {@link ionic.directive:ionList} for a complete example & explanation.\n*\n* @usage\n*\n* ```html\n* <ion-list>\n*   <ion-item>\n*     I love kittens!\n*     <ion-option-button class=\"button-positive\">Share</ion-option-button>\n*     <ion-option-button class=\"button-assertive\">Edit</ion-option-button>\n*   </ion-item>\n* </ion-list>\n* ```\n*/\nIonicModule.directive('ionOptionButton', [function() {\n  function stopPropagation(e) {\n    e.stopPropagation();\n  }\n  return {\n    restrict: 'E',\n    require: '^ionItem',\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      $attr.$set('class', ($attr['class'] || '') + ' button', true);\n      return function($scope, $element, $attr, itemCtrl) {\n        if (!itemCtrl.optionsContainer) {\n          itemCtrl.optionsContainer = jqLite(ITEM_TPL_OPTION_BUTTONS);\n          itemCtrl.$element.append(itemCtrl.optionsContainer);\n        }\n        itemCtrl.optionsContainer.append($element);\n\n        itemCtrl.$element.addClass('item-right-editable');\n\n        //Don't bubble click up to main .item\n        $element.on('click', stopPropagation);\n      };\n    }\n  };\n}]);\n\nvar ITEM_TPL_REORDER_BUTTON =\n  '<div data-prevent-scroll=\"true\" class=\"item-right-edit item-reorder enable-pointer-events\">' +\n  '</div>';\n\n/**\n* @ngdoc directive\n* @name ionReorderButton\n* @parent ionic.directive:ionItem\n* @module ionic\n* @restrict E\n* Creates a reorder button inside a list item, that is visible when the\n* {@link ionic.directive:ionList ionList parent's} `show-reorder` evaluates to true or\n* `$ionicListDelegate.showReorder(true)` is called.\n*\n* Can be dragged to reorder items in the list. Takes any ionicon class.\n*\n* Note: Reordering works best when used with `ng-repeat`.  Be sure that all `ion-item` children of an `ion-list` are part of the same `ng-repeat` expression.\n*\n* When an item reorder is complete, the expression given in the `on-reorder` attribute is called. The `on-reorder` expression is given two locals that can be used: `$fromIndex` and `$toIndex`.  See below for an example.\n*\n* Look at {@link ionic.directive:ionList} for more examples.\n*\n* @usage\n*\n* ```html\n* <ion-list ng-controller=\"MyCtrl\" show-reorder=\"true\">\n*   <ion-item ng-repeat=\"item in items\">\n*     Item {{item}}\n*     <ion-reorder-button class=\"ion-navicon\"\n*                         on-reorder=\"moveItem(item, $fromIndex, $toIndex)\">\n*     </ion-reorder-button>\n*   </ion-item>\n* </ion-list>\n* ```\n* ```js\n* function MyCtrl($scope) {\n*   $scope.items = [1, 2, 3, 4];\n*   $scope.moveItem = function(item, fromIndex, toIndex) {\n*     //Move the item in the array\n*     $scope.items.splice(fromIndex, 1);\n*     $scope.items.splice(toIndex, 0, item);\n*   };\n* }\n* ```\n*\n* @param {expression=} on-reorder Expression to call when an item is reordered.\n* Parameters given: $fromIndex, $toIndex.\n*/\nIonicModule\n.directive('ionReorderButton', ['$parse', function($parse) {\n  return {\n    restrict: 'E',\n    require: ['^ionItem', '^?ionList'],\n    priority: Number.MAX_VALUE,\n    compile: function($element, $attr) {\n      $attr.$set('class', ($attr['class'] || '') + ' button icon button-icon', true);\n      $element[0].setAttribute('data-prevent-scroll', true);\n      return function($scope, $element, $attr, ctrls) {\n        var itemCtrl = ctrls[0];\n        var listCtrl = ctrls[1];\n        var onReorderFn = $parse($attr.onReorder);\n\n        $scope.$onReorder = function(oldIndex, newIndex) {\n          onReorderFn($scope, {\n            $fromIndex: oldIndex,\n            $toIndex: newIndex\n          });\n        };\n\n        // prevent clicks from bubbling up to the item\n        if (!$attr.ngClick && !$attr.onClick && !$attr.onclick) {\n          $element[0].onclick = function(e) {\n            e.stopPropagation();\n            return false;\n          };\n        }\n\n        var container = jqLite(ITEM_TPL_REORDER_BUTTON);\n        container.append($element);\n        itemCtrl.$element.append(container).addClass('item-right-editable');\n\n        if (listCtrl && listCtrl.showReorder()) {\n          container.addClass('visible active');\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name keyboardAttach\n * @module ionic\n * @restrict A\n *\n * @description\n * keyboard-attach is an attribute directive which will cause an element to float above\n * the keyboard when the keyboard shows. Currently only supports the\n * [ion-footer-bar]({{ page.versionHref }}/api/directive/ionFooterBar/) directive.\n *\n * ### Notes\n * - This directive requires the\n * [Ionic Keyboard Plugin](https://github.com/driftyco/ionic-plugins-keyboard).\n * - On Android not in fullscreen mode, i.e. you have\n *   `<preference name=\"Fullscreen\" value=\"false\" />` or no preference in your `config.xml` file,\n *   this directive is unnecessary since it is the default behavior.\n * - On iOS, if there is an input in your footer, you will need to set\n *   `cordova.plugins.Keyboard.disableScroll(true)`.\n *\n * @usage\n *\n * ```html\n *  <ion-footer-bar align-title=\"left\" keyboard-attach class=\"bar-assertive\">\n *    <h1 class=\"title\">Title!</h1>\n *  </ion-footer-bar>\n * ```\n */\n\nIonicModule\n.directive('keyboardAttach', function() {\n  return function(scope, element) {\n    ionic.on('native.keyboardshow', onShow, window);\n    ionic.on('native.keyboardhide', onHide, window);\n\n    //deprecated\n    ionic.on('native.showkeyboard', onShow, window);\n    ionic.on('native.hidekeyboard', onHide, window);\n\n\n    var scrollCtrl;\n\n    function onShow(e) {\n      if (ionic.Platform.isAndroid() && !ionic.Platform.isFullScreen) {\n        return;\n      }\n\n      //for testing\n      var keyboardHeight = e.keyboardHeight || e.detail.keyboardHeight;\n      element.css('bottom', keyboardHeight + \"px\");\n      scrollCtrl = element.controller('$ionicScroll');\n      if (scrollCtrl) {\n        scrollCtrl.scrollView.__container.style.bottom = keyboardHeight + keyboardAttachGetClientHeight(element[0]) + \"px\";\n      }\n    }\n\n    function onHide() {\n      if (ionic.Platform.isAndroid() && !ionic.Platform.isFullScreen) {\n        return;\n      }\n\n      element.css('bottom', '');\n      if (scrollCtrl) {\n        scrollCtrl.scrollView.__container.style.bottom = '';\n      }\n    }\n\n    scope.$on('$destroy', function() {\n      ionic.off('native.keyboardshow', onShow, window);\n      ionic.off('native.keyboardhide', onHide, window);\n\n      //deprecated\n      ionic.off('native.showkeyboard', onShow, window);\n      ionic.off('native.hidekeyboard', onHide, window);\n    });\n  };\n});\n\nfunction keyboardAttachGetClientHeight(element) {\n  return element.clientHeight;\n}\n\n/**\n* @ngdoc directive\n* @name ionList\n* @module ionic\n* @delegate ionic.service:$ionicListDelegate\n* @codepen JsHjf\n* @restrict E\n* @description\n* The List is a widely used interface element in almost any mobile app, and can include\n* content ranging from basic text all the way to buttons, toggles, icons, and thumbnails.\n*\n* Both the list, which contains items, and the list items themselves can be any HTML\n* element. The containing element requires the `list` class and each list item requires\n* the `item` class.\n*\n* However, using the ionList and ionItem directives make it easy to support various\n* interaction modes such as swipe to edit, drag to reorder, and removing items.\n*\n* Related: {@link ionic.directive:ionItem}, {@link ionic.directive:ionOptionButton}\n* {@link ionic.directive:ionReorderButton}, {@link ionic.directive:ionDeleteButton}, [`list CSS documentation`](/docs/components/#list).\n*\n* @usage\n*\n* Basic Usage:\n*\n* ```html\n* <ion-list>\n*   <ion-item ng-repeat=\"item in items\">\n*     {% raw %}Hello, {{item}}!{% endraw %}\n*   </ion-item>\n* </ion-list>\n* ```\n*\n* Advanced Usage: Thumbnails, Delete buttons, Reordering, Swiping\n*\n* ```html\n* <ion-list ng-controller=\"MyCtrl\"\n*           show-delete=\"shouldShowDelete\"\n*           show-reorder=\"shouldShowReorder\"\n*           can-swipe=\"listCanSwipe\">\n*   <ion-item ng-repeat=\"item in items\"\n*             class=\"item-thumbnail-left\">\n*\n*     {% raw %}<img ng-src=\"{{item.img}}\">\n*     <h2>{{item.title}}</h2>\n*     <p>{{item.description}}</p>{% endraw %}\n*     <ion-option-button class=\"button-positive\"\n*                        ng-click=\"share(item)\">\n*       Share\n*     </ion-option-button>\n*     <ion-option-button class=\"button-info\"\n*                        ng-click=\"edit(item)\">\n*       Edit\n*     </ion-option-button>\n*     <ion-delete-button class=\"ion-minus-circled\"\n*                        ng-click=\"items.splice($index, 1)\">\n*     </ion-delete-button>\n*     <ion-reorder-button class=\"ion-navicon\"\n*                         on-reorder=\"reorderItem(item, $fromIndex, $toIndex)\">\n*     </ion-reorder-button>\n*\n*   </ion-item>\n* </ion-list>\n* ```\n*\n*```javascript\n* app.controller('MyCtrl', function($scope) {\n*  $scope.shouldShowDelete = false;\n*  $scope.shouldShowReorder = false;\n*  $scope.listCanSwipe = true\n* });\n*```\n*\n* @param {string=} delegate-handle The handle used to identify this list with\n* {@link ionic.service:$ionicListDelegate}.\n* @param type {string=} The type of list to use (list-inset or card)\n* @param show-delete {boolean=} Whether the delete buttons for the items in the list are\n* currently shown or hidden.\n* @param show-reorder {boolean=} Whether the reorder buttons for the items in the list are\n* currently shown or hidden.\n* @param can-swipe {boolean=} Whether the items in the list are allowed to be swiped to reveal\n* option buttons. Default: true.\n*/\nIonicModule\n.directive('ionList', [\n  '$timeout',\nfunction($timeout) {\n  return {\n    restrict: 'E',\n    require: ['ionList', '^?$ionicScroll'],\n    controller: '$ionicList',\n    compile: function($element, $attr) {\n      var listEl = jqLite('<div class=\"list\">')\n        .append($element.contents())\n        .addClass($attr.type);\n\n      $element.append(listEl);\n\n      return function($scope, $element, $attrs, ctrls) {\n        var listCtrl = ctrls[0];\n        var scrollCtrl = ctrls[1];\n\n        // Wait for child elements to render...\n        $timeout(init);\n\n        function init() {\n          var listView = listCtrl.listView = new ionic.views.ListView({\n            el: $element[0],\n            listEl: $element.children()[0],\n            scrollEl: scrollCtrl && scrollCtrl.element,\n            scrollView: scrollCtrl && scrollCtrl.scrollView,\n            onReorder: function(el, oldIndex, newIndex) {\n              var itemScope = jqLite(el).scope();\n              if (itemScope && itemScope.$onReorder) {\n                // Make sure onReorder is called in apply cycle,\n                // but also make sure it has no conflicts by doing\n                // $evalAsync\n                $timeout(function() {\n                  itemScope.$onReorder(oldIndex, newIndex);\n                });\n              }\n            },\n            canSwipe: function() {\n              return listCtrl.canSwipeItems();\n            }\n          });\n\n          $scope.$on('$destroy', function() {\n            if (listView) {\n              listView.deregister && listView.deregister();\n              listView = null;\n            }\n          });\n\n          if (isDefined($attr.canSwipe)) {\n            $scope.$watch('!!(' + $attr.canSwipe + ')', function(value) {\n              listCtrl.canSwipeItems(value);\n            });\n          }\n          if (isDefined($attr.showDelete)) {\n            $scope.$watch('!!(' + $attr.showDelete + ')', function(value) {\n              listCtrl.showDelete(value);\n            });\n          }\n          if (isDefined($attr.showReorder)) {\n            $scope.$watch('!!(' + $attr.showReorder + ')', function(value) {\n              listCtrl.showReorder(value);\n            });\n          }\n\n          $scope.$watch(function() {\n            return listCtrl.showDelete();\n          }, function(isShown, wasShown) {\n            //Only use isShown=false if it was already shown\n            if (!isShown && !wasShown) { return; }\n\n            if (isShown) listCtrl.closeOptionButtons();\n            listCtrl.canSwipeItems(!isShown);\n\n            $element.children().toggleClass('list-left-editing', isShown);\n            $element.toggleClass('disable-pointer-events', isShown);\n\n            var deleteButton = jqLite($element[0].getElementsByClassName('item-delete'));\n            setButtonShown(deleteButton, listCtrl.showDelete);\n          });\n\n          $scope.$watch(function() {\n            return listCtrl.showReorder();\n          }, function(isShown, wasShown) {\n            //Only use isShown=false if it was already shown\n            if (!isShown && !wasShown) { return; }\n\n            if (isShown) listCtrl.closeOptionButtons();\n            listCtrl.canSwipeItems(!isShown);\n\n            $element.children().toggleClass('list-right-editing', isShown);\n            $element.toggleClass('disable-pointer-events', isShown);\n\n            var reorderButton = jqLite($element[0].getElementsByClassName('item-reorder'));\n            setButtonShown(reorderButton, listCtrl.showReorder);\n          });\n\n          function setButtonShown(el, shown) {\n            shown() && el.addClass('visible') || el.removeClass('active');\n            ionic.requestAnimationFrame(function() {\n              shown() && el.addClass('active') || el.removeClass('visible');\n            });\n          }\n        }\n\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name menuClose\n * @module ionic\n * @restrict AC\n *\n * @description\n * `menu-close` is an attribute directive that closes a currently opened side menu.\n * Note that by default, navigation transitions will not animate between views when\n * the menu is open. Additionally, this directive will reset the entering view's\n * history stack, making the new page the root of the history stack. This is done\n * to replicate the user experience seen in most side menu implementations, which is\n * to not show the back button at the root of the stack and show only the\n * menu button. We recommend that you also use the `enable-menu-with-back-views=\"false\"`\n * {@link ionic.directive:ionSideMenus} attribute when using the menuClose directive.\n *\n * @usage\n * Below is an example of a link within a side menu. Tapping this link would\n * automatically close the currently opened menu.\n *\n * ```html\n * <a menu-close href=\"#/home\" class=\"item\">Home</a>\n * ```\n */\nIonicModule\n.directive('menuClose', ['$ionicHistory', function($ionicHistory) {\n  return {\n    restrict: 'AC',\n    link: function($scope, $element) {\n      $element.bind('click', function() {\n        var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n        if (sideMenuCtrl) {\n          $ionicHistory.nextViewOptions({\n            historyRoot: true,\n            disableAnimate: true,\n            expire: 300\n          });\n          sideMenuCtrl.close();\n        }\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name menuToggle\n * @module ionic\n * @restrict AC\n *\n * @description\n * Toggle a side menu on the given side.\n *\n * @usage\n * Below is an example of a link within a nav bar. Tapping this button\n * would open the given side menu, and tapping it again would close it.\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-buttons side=\"left\">\n *    <button menu-toggle=\"left\" class=\"button button-icon icon ion-navicon\"></button>\n *   </ion-nav-buttons>\n * </ion-nav-bar>\n * ```\n *\n * ### Button Hidden On Child Views\n * By default, the menu toggle button will only appear on a root\n * level side-menu page. Navigating in to child views will hide the menu-\n * toggle button. They can be made visible on child pages by setting the\n * enable-menu-with-back-views attribute of the {@link ionic.directive:ionSideMenus}\n * directive to true.\n *\n * ```html\n * <ion-side-menus enable-menu-with-back-views=\"true\">\n * ```\n */\nIonicModule\n.directive('menuToggle', function() {\n  return {\n    restrict: 'AC',\n    link: function($scope, $element, $attr) {\n      $scope.$on('$ionicView.beforeEnter', function(ev, viewData) {\n        if (viewData.enableBack) {\n          var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n          if (!sideMenuCtrl.enableMenuWithBackViews()) {\n            $element.addClass('hide');\n          }\n        } else {\n          $element.removeClass('hide');\n        }\n      });\n\n      $element.bind('click', function() {\n        var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');\n        sideMenuCtrl && sideMenuCtrl.toggle($attr.menuToggle);\n      });\n    }\n  };\n});\n\n/*\n * We don't document the ionModal directive, we instead document\n * the $ionicModal service\n */\nIonicModule\n.directive('ionModal', [function() {\n  return {\n    restrict: 'E',\n    transclude: true,\n    replace: true,\n    controller: [function() {}],\n    template: '<div class=\"modal-backdrop\">' +\n                '<div class=\"modal-backdrop-bg\"></div>' +\n                '<div class=\"modal-wrapper\" ng-transclude></div>' +\n              '</div>'\n  };\n}]);\n\nIonicModule\n.directive('ionModalView', function() {\n  return {\n    restrict: 'E',\n    compile: function(element) {\n      element.addClass('modal');\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionNavBackButton\n * @module ionic\n * @restrict E\n * @parent ionNavBar\n * @description\n * Creates a back button inside an {@link ionic.directive:ionNavBar}.\n *\n * The back button will appear when the user is able to go back in the current navigation stack. By\n * default, the markup of the back button is automatically built using platform-appropriate defaults\n * (iOS back button icon on iOS and Android icon on Android).\n *\n * Additionally, the button is automatically set to `$ionicGoBack()` on click/tap. By default, the\n * app will navigate back one view when the back button is clicked.  More advanced behavior is also\n * possible, as outlined below.\n *\n * @usage\n *\n * Recommended markup for default settings:\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-back-button>\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n *\n * With custom inner markup, and automatically adds a default click action:\n *\n * ```html\n * <ion-nav-bar>\n *   <ion-nav-back-button class=\"button-clear\">\n *     <i class=\"ion-arrow-left-c\"></i> Back\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n *\n * With custom inner markup and custom click action, using {@link ionic.service:$ionicHistory}:\n *\n * ```html\n * <ion-nav-bar ng-controller=\"MyCtrl\">\n *   <ion-nav-back-button class=\"button-clear\"\n *     ng-click=\"myGoBack()\">\n *     <i class=\"ion-arrow-left-c\"></i> Back\n *   </ion-nav-back-button>\n * </ion-nav-bar>\n * ```\n * ```js\n * function MyCtrl($scope, $ionicHistory) {\n *   $scope.myGoBack = function() {\n *     $ionicHistory.goBack();\n *   };\n * }\n * ```\n */\nIonicModule\n.directive('ionNavBackButton', ['$ionicConfig', '$document', function($ionicConfig, $document) {\n  return {\n    restrict: 'E',\n    require: '^ionNavBar',\n    compile: function(tElement, tAttrs) {\n\n      // clone the back button, but as a <div>\n      var buttonEle = $document[0].createElement('button');\n      for (var n in tAttrs.$attr) {\n        buttonEle.setAttribute(tAttrs.$attr[n], tAttrs[n]);\n      }\n\n      if (!tAttrs.ngClick) {\n        buttonEle.setAttribute('ng-click', '$ionicGoBack()');\n      }\n\n      buttonEle.className = 'button back-button hide buttons ' + (tElement.attr('class') || '');\n      buttonEle.innerHTML = tElement.html() || '';\n\n      var childNode;\n      var hasIcon = hasIconClass(tElement[0]);\n      var hasInnerText;\n      var hasButtonText;\n      var hasPreviousTitle;\n\n      for (var x = 0; x < tElement[0].childNodes.length; x++) {\n        childNode = tElement[0].childNodes[x];\n        if (childNode.nodeType === 1) {\n          if (hasIconClass(childNode)) {\n            hasIcon = true;\n          } else if (childNode.classList.contains('default-title')) {\n            hasButtonText = true;\n          } else if (childNode.classList.contains('previous-title')) {\n            hasPreviousTitle = true;\n          }\n        } else if (!hasInnerText && childNode.nodeType === 3) {\n          hasInnerText = !!childNode.nodeValue.trim();\n        }\n      }\n\n      function hasIconClass(ele) {\n        return /ion-|icon/.test(ele.className);\n      }\n\n      var defaultIcon = $ionicConfig.backButton.icon();\n      if (!hasIcon && defaultIcon && defaultIcon !== 'none') {\n        buttonEle.innerHTML = '<i class=\"icon ' + defaultIcon + '\"></i> ' + buttonEle.innerHTML;\n        buttonEle.className += ' button-clear';\n      }\n\n      if (!hasInnerText) {\n        var buttonTextEle = $document[0].createElement('span');\n        buttonTextEle.className = 'back-text';\n\n        if (!hasButtonText && $ionicConfig.backButton.text()) {\n          buttonTextEle.innerHTML += '<span class=\"default-title\">' + $ionicConfig.backButton.text() + '</span>';\n        }\n        if (!hasPreviousTitle && $ionicConfig.backButton.previousTitleText()) {\n          buttonTextEle.innerHTML += '<span class=\"previous-title\"></span>';\n        }\n        buttonEle.appendChild(buttonTextEle);\n\n      }\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attr, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n          navBarCtrl.navElement('backButton', buttonEle.outerHTML);\n          buttonEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionNavBar\n * @module ionic\n * @delegate ionic.service:$ionicNavBarDelegate\n * @restrict E\n *\n * @description\n * If we have an {@link ionic.directive:ionNavView} directive, we can also create an\n * `<ion-nav-bar>`, which will create a topbar that updates as the application state changes.\n *\n * We can add a back button by putting an {@link ionic.directive:ionNavBackButton} inside.\n *\n * We can add buttons depending on the currently visible view using\n * {@link ionic.directive:ionNavButtons}.\n *\n * Note that the ion-nav-bar element will only work correctly if your content has an\n * ionView around it.\n *\n * @usage\n *\n * ```html\n * <body ng-app=\"starter\">\n *   <!-- The nav bar that will be updated as we navigate -->\n *   <ion-nav-bar class=\"bar-positive\">\n *   </ion-nav-bar>\n *\n *   <!-- where the initial view template will be rendered -->\n *   <ion-nav-view>\n *     <ion-view>\n *       <ion-content>Hello!</ion-content>\n *     </ion-view>\n *   </ion-nav-view>\n * </body>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify this navBar\n * with {@link ionic.service:$ionicNavBarDelegate}.\n * @param align-title {string=} Where to align the title of the navbar.\n * Available: 'left', 'right', 'center'. Defaults to 'center'.\n * @param {boolean=} no-tap-scroll By default, the navbar will scroll the content\n * to the top when tapped.  Set no-tap-scroll to true to disable this behavior.\n *\n * </table><br/>\n */\nIonicModule\n.directive('ionNavBar', function() {\n  return {\n    restrict: 'E',\n    controller: '$ionicNavBar',\n    scope: true,\n    link: function($scope, $element, $attr, ctrl) {\n      ctrl.init();\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionNavButtons\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n * Use nav buttons to set the buttons on your {@link ionic.directive:ionNavBar}\n * from within an {@link ionic.directive:ionView}. This gives each\n * view template the ability to specify which buttons should show in the nav bar,\n * overriding any default buttons already placed in the nav bar.\n *\n * Any buttons you declare will be positioned on the navbar's corresponding side. Primary\n * buttons generally map to the left side of the header, and secondary buttons are\n * generally on the right side. However, their exact locations are platform-specific.\n * For example, in iOS, the primary buttons are on the far left of the header, and\n * secondary buttons are on the far right, with the header title centered between them.\n * For Android, however, both groups of buttons are on the far right of the header,\n * with the header title aligned left.\n *\n * We recommend always using `primary` and `secondary`, so the buttons correctly map\n * to the side familiar to users of each platform. However, in cases where buttons should\n * always be on an exact side, both `left` and `right` sides are still available. For\n * example, a toggle button for a left side menu should be on the left side; in this case,\n * we'd recommend using `side=\"left\"`, so it's always on the left, no matter the platform.\n *\n * ***Note*** that `ion-nav-buttons` must be immediate descendants of the `ion-view` or\n * `ion-nav-bar` element (basically, don't wrap it in another div).\n *\n * @usage\n * ```html\n * <ion-nav-bar>\n * </ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view>\n *     <ion-nav-buttons side=\"primary\">\n *       <button class=\"button\" ng-click=\"doSomething()\">\n *         I'm a button on the primary of the navbar!\n *       </button>\n *     </ion-nav-buttons>\n *     <ion-content>\n *       Some super content here!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n * @param {string} side The side to place the buttons in the\n * {@link ionic.directive:ionNavBar}. Available sides: `primary`, `secondary`, `left`, and `right`.\n */\nIonicModule\n.directive('ionNavButtons', ['$document', function($document) {\n  return {\n    require: '^ionNavBar',\n    restrict: 'E',\n    compile: function(tElement, tAttrs) {\n      var side = 'left';\n\n      if (/^primary|secondary|right$/i.test(tAttrs.side || '')) {\n        side = tAttrs.side.toLowerCase();\n      }\n\n      var spanEle = $document[0].createElement('span');\n      spanEle.className = side + '-buttons';\n      spanEle.innerHTML = tElement.html();\n\n      var navElementType = side + 'Buttons';\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attrs, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n\n          var parentViewCtrl = $element.parent().data('$ionViewController');\n          if (parentViewCtrl) {\n            // if the parent is an ion-view, then these are ion-nav-buttons for JUST this ion-view\n            parentViewCtrl.navElement(navElementType, spanEle.outerHTML);\n\n          } else {\n            // these are buttons for all views that do not have their own ion-nav-buttons\n            navBarCtrl.navElement(navElementType, spanEle.outerHTML);\n          }\n\n          spanEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name navDirection\n * @module ionic\n * @restrict A\n *\n * @description\n * The direction which the nav view transition should animate. Available options\n * are: `forward`, `back`, `enter`, `exit`, `swap`.\n *\n * @usage\n *\n * ```html\n * <a nav-direction=\"forward\" href=\"#/home\">Home</a>\n * ```\n */\nIonicModule\n.directive('navDirection', ['$ionicViewSwitcher', function($ionicViewSwitcher) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    link: function($scope, $element, $attr) {\n      $element.bind('click', function() {\n        $ionicViewSwitcher.nextDirection($attr.navDirection);\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionNavTitle\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n *\n * The nav title directive replaces an {@link ionic.directive:ionNavBar} title text with\n * custom HTML from within an {@link ionic.directive:ionView} template. This gives each\n * view the ability to specify its own custom title element, such as an image or any HTML,\n * rather than being text-only. Alternatively, text-only titles can be updated using the\n * `view-title` {@link ionic.directive:ionView} attribute.\n *\n * Note that `ion-nav-title` must be an immediate descendant of the `ion-view` or\n * `ion-nav-bar` element (basically don't wrap it in another div).\n *\n * @usage\n * ```html\n * <ion-nav-bar>\n * </ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view>\n *     <ion-nav-title>\n *       <img src=\"logo.svg\">\n *     </ion-nav-title>\n *     <ion-content>\n *       Some super content here!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n */\nIonicModule\n.directive('ionNavTitle', ['$document', function($document) {\n  return {\n    require: '^ionNavBar',\n    restrict: 'E',\n    compile: function(tElement, tAttrs) {\n      var navElementType = 'title';\n      var spanEle = $document[0].createElement('span');\n      for (var n in tAttrs.$attr) {\n        spanEle.setAttribute(tAttrs.$attr[n], tAttrs[n]);\n      }\n      spanEle.classList.add('nav-bar-title');\n      spanEle.innerHTML = tElement.html();\n\n      tElement.attr('class', 'hide');\n      tElement.empty();\n\n      return {\n        pre: function($scope, $element, $attrs, navBarCtrl) {\n          // only register the plain HTML, the navBarCtrl takes care of scope/compile/link\n\n          var parentViewCtrl = $element.parent().data('$ionViewController');\n          if (parentViewCtrl) {\n            // if the parent is an ion-view, then these are ion-nav-buttons for JUST this ion-view\n            parentViewCtrl.navElement(navElementType, spanEle.outerHTML);\n\n          } else {\n            // these are buttons for all views that do not have their own ion-nav-buttons\n            navBarCtrl.navElement(navElementType, spanEle.outerHTML);\n          }\n\n          spanEle = null;\n        }\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name navTransition\n * @module ionic\n * @restrict A\n *\n * @description\n * The transition type which the nav view transition should use when it animates.\n * Current, options are `ios`, `android`, and `none`. More options coming soon.\n *\n * @usage\n *\n * ```html\n * <a nav-transition=\"none\" href=\"#/home\">Home</a>\n * ```\n */\nIonicModule\n.directive('navTransition', ['$ionicViewSwitcher', function($ionicViewSwitcher) {\n  return {\n    restrict: 'A',\n    priority: 1000,\n    link: function($scope, $element, $attr) {\n      $element.bind('click', function() {\n        $ionicViewSwitcher.nextTransition($attr.navTransition);\n      });\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionNavView\n * @module ionic\n * @restrict E\n * @codepen odqCz\n *\n * @description\n * As a user navigates throughout your app, Ionic is able to keep track of their\n * navigation history. By knowing their history, transitions between views\n * correctly enter and exit using the platform's transition style. An additional\n * benefit to Ionic's navigation system is its ability to manage multiple\n * histories. For example, each tab can have it's own navigation history stack.\n *\n * Ionic uses the AngularUI Router module so app interfaces can be organized\n * into various \"states\". Like Angular's core $route service, URLs can be used\n * to control the views. However, the AngularUI Router provides a more powerful\n * state manager in that states are bound to named, nested, and parallel views,\n * allowing more than one template to be rendered on the same page.\n * Additionally, each state is not required to be bound to a URL, and data can\n * be pushed to each state which allows much flexibility.\n *\n * The ionNavView directive is used to render templates in your application. Each template\n * is part of a state. States are usually mapped to a url, and are defined programatically\n * using angular-ui-router (see [their docs](https://github.com/angular-ui/ui-router/wiki),\n * and remember to replace ui-view with ion-nav-view in examples).\n *\n * @usage\n * In this example, we will create a navigation view that contains our different states for the app.\n *\n * To do this, in our markup we use ionNavView top level directive. To display a header bar we use\n * the {@link ionic.directive:ionNavBar} directive that updates as we navigate through the\n * navigation stack.\n *\n * Next, we need to setup our states that will be rendered.\n *\n * ```js\n * var app = angular.module('myApp', ['ionic']);\n * app.config(function($stateProvider) {\n *   $stateProvider\n *   .state('index', {\n *     url: '/',\n *     templateUrl: 'home.html'\n *   })\n *   .state('music', {\n *     url: '/music',\n *     templateUrl: 'music.html'\n *   });\n * });\n * ```\n * Then on app start, $stateProvider will look at the url, see it matches the index state,\n * and then try to load home.html into the `<ion-nav-view>`.\n *\n * Pages are loaded by the URLs given. One simple way to create templates in Angular is to put\n * them directly into your HTML file and use the `<script type=\"text/ng-template\">` syntax.\n * So here is one way to put home.html into our app:\n *\n * ```html\n * <script id=\"home\" type=\"text/ng-template\">\n *   <!-- The title of the ion-view will be shown on the navbar -->\n *   <ion-view view-title=\"Home\">\n *     <ion-content ng-controller=\"HomeCtrl\">\n *       <!-- The content of the page -->\n *       <a href=\"#/music\">Go to music page!</a>\n *     </ion-content>\n *   </ion-view>\n * </script>\n * ```\n *\n * This is good to do because the template will be cached for very fast loading, instead of\n * having to fetch them from the network.\n *\n * ## Caching\n *\n * By default, views are cached to improve performance. When a view is navigated away from, its\n * element is left in the DOM, and its scope is disconnected from the `$watch` cycle. When\n * navigating to a view that is already cached, its scope is then reconnected, and the existing\n * element that was left in the DOM becomes the active view. This also allows for the scroll\n * position of previous views to be maintained.\n *\n * Caching can be disabled and enabled in multiple ways. By default, Ionic will cache a maximum of\n * 10 views, and not only can this be configured, but apps can also explicitly state which views\n * should and should not be cached.\n *\n * Note that because we are caching these views, *we aren’t destroying scopes*. Instead, scopes\n * are being disconnected from the watch cycle. Because scopes are not being destroyed and\n * recreated, controllers are not loading again on a subsequent viewing. If the app/controller\n * needs to know when a view has entered or has left, then view events emitted from the\n * {@link ionic.directive:ionView} scope, such as `$ionicView.enter`, may be useful.\n *\n * By default, when navigating back in the history, the \"forward\" views are removed from the cache.\n * If you navigate forward to the same view again, it'll create a new DOM element and controller\n * instance. Basically, any forward views are reset each time. This can be configured using the\n * {@link ionic.provider:$ionicConfigProvider}:\n *\n * ```js\n * $ionicConfigProvider.views.forwardCache(true);\n * ```\n *\n * #### Disable cache globally\n *\n * The {@link ionic.provider:$ionicConfigProvider} can be used to set the maximum allowable views\n * which can be cached, but this can also be use to disable all caching by setting it to 0.\n *\n * ```js\n * $ionicConfigProvider.views.maxCache(0);\n * ```\n *\n * #### Disable cache within state provider\n *\n * ```js\n * $stateProvider.state('myState', {\n *    cache: false,\n *    url : '/myUrl',\n *    templateUrl : 'my-template.html'\n * })\n * ```\n *\n * #### Disable cache with an attribute\n *\n * ```html\n * <ion-view cache-view=\"false\" view-title=\"My Title!\">\n *   ...\n * </ion-view>\n * ```\n *\n *\n * ## AngularUI Router\n *\n * Please visit [AngularUI Router's docs](https://github.com/angular-ui/ui-router/wiki) for\n * more info. Below is a great video by the AngularUI Router team that may help to explain\n * how it all works:\n *\n * <iframe width=\"560\" height=\"315\" src=\"//www.youtube.com/embed/dqJRoh8MnBo\"\n * frameborder=\"0\" allowfullscreen></iframe>\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states. For more\n * information, see ui-router's\n * [ui-view documentation](http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-view).\n */\nIonicModule\n.directive('ionNavView', [\n  '$state',\n  '$ionicConfig',\nfunction($state, $ionicConfig) {\n  // IONIC's fork of Angular UI Router, v0.2.10\n  // the navView handles registering views in the history and how to transition between them\n  return {\n    restrict: 'E',\n    terminal: true,\n    priority: 2000,\n    transclude: true,\n    controller: '$ionicNavView',\n    compile: function(tElement, tAttrs, transclude) {\n\n      // a nav view element is a container for numerous views\n      tElement.addClass('view-container');\n      ionic.DomUtil.cachedAttr(tElement, 'nav-view-transition', $ionicConfig.views.transition());\n\n      return function($scope, $element, $attr, navViewCtrl) {\n        var latestLocals;\n\n        // Put in the compiled initial view\n        transclude($scope, function(clone) {\n          $element.append(clone);\n        });\n\n        var viewData = navViewCtrl.init();\n\n        // listen for $stateChangeSuccess\n        $scope.$on('$stateChangeSuccess', function() {\n          updateView(false);\n        });\n        $scope.$on('$viewContentLoading', function() {\n          updateView(false);\n        });\n\n        // initial load, ready go\n        updateView(true);\n\n\n        function updateView(firstTime) {\n          // get the current local according to the $state\n          var viewLocals = $state.$current && $state.$current.locals[viewData.name];\n\n          // do not update THIS nav-view if its is not the container for the given state\n          // if the viewLocals are the same as THIS latestLocals, then nothing to do\n          if (!viewLocals || (!firstTime && viewLocals === latestLocals)) return;\n\n          // update the latestLocals\n          latestLocals = viewLocals;\n          viewData.state = viewLocals.$$state;\n\n          // register, update and transition to the new view\n          navViewCtrl.register(viewLocals);\n        }\n\n      };\n    }\n  };\n}]);\n\nIonicModule\n\n.config(['$provide', function($provide) {\n  $provide.decorator('ngClickDirective', ['$delegate', function($delegate) {\n    // drop the default ngClick directive\n    $delegate.shift();\n    return $delegate;\n  }]);\n}])\n\n/**\n * @private\n */\n.factory('$ionicNgClick', ['$parse', function($parse) {\n  return function(scope, element, clickExpr) {\n    var clickHandler = angular.isFunction(clickExpr) ?\n      clickExpr :\n      $parse(clickExpr);\n\n    element.on('click', function(event) {\n      scope.$apply(function() {\n        clickHandler(scope, {$event: (event)});\n      });\n    });\n\n    // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click\n    // something else nearby.\n    element.onclick = noop;\n  };\n}])\n\n.directive('ngClick', ['$ionicNgClick', function($ionicNgClick) {\n  return function(scope, element, attr) {\n    $ionicNgClick(scope, element, attr.ngClick);\n  };\n}])\n\n.directive('ionStopEvent', function() {\n  return {\n    restrict: 'A',\n    link: function(scope, element, attr) {\n      element.bind(attr.ionStopEvent, eventStopPropagation);\n    }\n  };\n});\nfunction eventStopPropagation(e) {\n  e.stopPropagation();\n}\n\n\n/**\n * @ngdoc directive\n * @name ionPane\n * @module ionic\n * @restrict E\n *\n * @description A simple container that fits content, with no side effects.  Adds the 'pane' class to the element.\n */\nIonicModule\n.directive('ionPane', function() {\n  return {\n    restrict: 'E',\n    link: function(scope, element) {\n      element.addClass('pane');\n    }\n  };\n});\n\n/*\n * We don't document the ionPopover directive, we instead document\n * the $ionicPopover service\n */\nIonicModule\n.directive('ionPopover', [function() {\n  return {\n    restrict: 'E',\n    transclude: true,\n    replace: true,\n    controller: [function() {}],\n    template: '<div class=\"popover-backdrop\">' +\n                '<div class=\"popover-wrapper\" ng-transclude></div>' +\n              '</div>'\n  };\n}]);\n\nIonicModule\n.directive('ionPopoverView', function() {\n  return {\n    restrict: 'E',\n    compile: function(element) {\n      element.append(jqLite('<div class=\"popover-arrow\">'));\n      element.addClass('popover');\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionRadio\n * @module ionic\n * @restrict E\n * @codepen saoBG\n * @description\n * The radio directive is no different than the HTML radio input, except it's styled differently.\n *\n * Radio behaves like any [AngularJS radio](http://docs.angularjs.org/api/ng/input/input[radio]).\n *\n * @usage\n * ```html\n * <ion-radio ng-model=\"choice\" ng-value=\"'A'\">Choose A</ion-radio>\n * <ion-radio ng-model=\"choice\" ng-value=\"'B'\">Choose B</ion-radio>\n * <ion-radio ng-model=\"choice\" ng-value=\"'C'\">Choose C</ion-radio>\n * ```\n *\n * @param {string=} name The name of the radio input.\n * @param {expression=} value The value of the radio input.\n * @param {boolean=} disabled The state of the radio input.\n * @param {string=} icon The icon to use when the radio input is selected.\n * @param {expression=} ng-value Angular equivalent of the value attribute.\n * @param {expression=} ng-model The angular model for the radio input.\n * @param {boolean=} ng-disabled Angular equivalent of the disabled attribute.\n * @param {expression=} ng-change Triggers given expression when radio input's model changes\n */\nIonicModule\n.directive('ionRadio', function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<label class=\"item item-radio\">' +\n        '<input type=\"radio\" name=\"radio-group\">' +\n        '<div class=\"item-content disable-pointer-events\" ng-transclude></div>' +\n        '<i class=\"radio-icon disable-pointer-events icon ion-checkmark\"></i>' +\n      '</label>',\n\n    compile: function(element, attr) {\n      if (attr.icon) {\n        element.children().eq(2).removeClass('ion-checkmark').addClass(attr.icon);\n      }\n\n      var input = element.find('input');\n      forEach({\n          'name': attr.name,\n          'value': attr.value,\n          'disabled': attr.disabled,\n          'ng-value': attr.ngValue,\n          'ng-model': attr.ngModel,\n          'ng-disabled': attr.ngDisabled,\n          'ng-change': attr.ngChange,\n          'ng-required': attr.ngRequired,\n          'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n            input.attr(name, value);\n          }\n      });\n\n      return function(scope, element, attr) {\n        scope.getValue = function() {\n          return scope.ngValue || attr.value;\n        };\n      };\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionRefresher\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionContent, ionic.directive:ionScroll\n * @description\n * Allows you to add pull-to-refresh to a scrollView.\n *\n * Place it as the first child of your {@link ionic.directive:ionContent} or\n * {@link ionic.directive:ionScroll} element.\n *\n * When refreshing is complete, $broadcast the 'scroll.refreshComplete' event\n * from your controller.\n *\n * @usage\n *\n * ```html\n * <ion-content ng-controller=\"MyController\">\n *   <ion-refresher\n *     pulling-text=\"Pull to refresh...\"\n *     on-refresh=\"doRefresh()\">\n *   </ion-refresher>\n *   <ion-list>\n *     <ion-item ng-repeat=\"item in items\"></ion-item>\n *   </ion-list>\n * </ion-content>\n * ```\n * ```js\n * angular.module('testApp', ['ionic'])\n * .controller('MyController', function($scope, $http) {\n *   $scope.items = [1,2,3];\n *   $scope.doRefresh = function() {\n *     $http.get('/new-items')\n *      .success(function(newItems) {\n *        $scope.items = newItems;\n *      })\n *      .finally(function() {\n *        // Stop the ion-refresher from spinning\n *        $scope.$broadcast('scroll.refreshComplete');\n *      });\n *   };\n * });\n * ```\n *\n * @param {expression=} on-refresh Called when the user pulls down enough and lets go\n * of the refresher.\n * @param {expression=} on-pulling Called when the user starts to pull down\n * on the refresher.\n * @param {string=} pulling-text The text to display while the user is pulling down.\n * @param {string=} pulling-icon The icon to display while the user is pulling down.\n * Default: 'ion-android-arrow-down'.\n * @param {string=} spinner The {@link ionic.directive:ionSpinner} icon to display\n * after user lets go of the refresher. The SVG {@link ionic.directive:ionSpinner}\n * is now the default, replacing rotating font icons. Set to `none` to disable both the\n * spinner and the icon.\n * @param {string=} refreshing-icon The font icon to display after user lets go of the\n * refresher. This is depreicated in favor of the SVG {@link ionic.directive:ionSpinner}.\n * @param {boolean=} disable-pulling-rotation Disables the rotation animation of the pulling\n * icon when it reaches its activated threshold. To be used with a custom `pulling-icon`.\n *\n */\nIonicModule\n.directive('ionRefresher', [function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: ['?^$ionicScroll', 'ionRefresher'],\n    controller: '$ionicRefresher',\n    template:\n    '<div class=\"scroll-refresher invisible\" collection-repeat-ignore>' +\n      '<div class=\"ionic-refresher-content\" ' +\n      'ng-class=\"{\\'ionic-refresher-with-text\\': pullingText || refreshingText}\">' +\n        '<div class=\"icon-pulling\" ng-class=\"{\\'pulling-rotation-disabled\\':disablePullingRotation}\">' +\n          '<i class=\"icon {{pullingIcon}}\"></i>' +\n        '</div>' +\n        '<div class=\"text-pulling\" ng-bind-html=\"pullingText\"></div>' +\n        '<div class=\"icon-refreshing\">' +\n          '<ion-spinner ng-if=\"showSpinner\" icon=\"{{spinner}}\"></ion-spinner>' +\n          '<i ng-if=\"showIcon\" class=\"icon {{refreshingIcon}}\"></i>' +\n        '</div>' +\n        '<div class=\"text-refreshing\" ng-bind-html=\"refreshingText\"></div>' +\n      '</div>' +\n    '</div>',\n    link: function($scope, $element, $attrs, ctrls) {\n\n      // JS Scrolling uses the scroll controller\n      var scrollCtrl = ctrls[0],\n          refresherCtrl = ctrls[1];\n      if (!scrollCtrl || scrollCtrl.isNative()) {\n        // Kick off native scrolling\n        refresherCtrl.init();\n      } else {\n        $element[0].classList.add('js-scrolling');\n        scrollCtrl._setRefresher(\n          $scope,\n          $element[0],\n          refresherCtrl.getRefresherDomMethods()\n        );\n\n        $scope.$on('scroll.refreshComplete', function() {\n          $scope.$evalAsync(function() {\n            scrollCtrl.scrollView.finishPullToRefresh();\n          });\n        });\n      }\n\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionScroll\n * @module ionic\n * @delegate ionic.service:$ionicScrollDelegate\n * @codepen mwFuh\n * @restrict E\n *\n * @description\n * Creates a scrollable container for all content inside.\n *\n * @usage\n *\n * Basic usage:\n *\n * ```html\n * <ion-scroll zooming=\"true\" direction=\"xy\" style=\"width: 500px; height: 500px\">\n *   <div style=\"width: 5000px; height: 5000px; background: url('https://upload.wikimedia.org/wikipedia/commons/a/ad/Europe_geological_map-en.jpg') repeat\"></div>\n *  </ion-scroll>\n * ```\n *\n * Note that it's important to set the height of the scroll box as well as the height of the inner\n * content to enable scrolling. This makes it possible to have full control over scrollable areas.\n *\n * If you'd just like to have a center content scrolling area, use {@link ionic.directive:ionContent} instead.\n *\n * @param {string=} delegate-handle The handle used to identify this scrollView\n * with {@link ionic.service:$ionicScrollDelegate}.\n * @param {string=} direction Which way to scroll. 'x' or 'y' or 'xy'. Default 'y'.\n * @param {boolean=} locking Whether to lock scrolling in one direction at a time. Useful to set to false when zoomed in or scrolling in two directions. Default true.\n * @param {boolean=} paging Whether to scroll with paging.\n * @param {expression=} on-refresh Called on pull-to-refresh, triggered by an {@link ionic.directive:ionRefresher}.\n * @param {expression=} on-scroll Called whenever the user scrolls.\n * @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default true.\n * @param {boolean=} scrollbar-y Whether to show the vertical scrollbar. Default true.\n * @param {boolean=} zooming Whether to support pinch-to-zoom\n * @param {integer=} min-zoom The smallest zoom amount allowed (default is 0.5)\n * @param {integer=} max-zoom The largest zoom amount allowed (default is 3)\n * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges\n * of the content.  Defaults to true on iOS, false on Android.\n */\nIonicModule\n.directive('ionScroll', [\n  '$timeout',\n  '$controller',\n  '$ionicBind',\nfunction($timeout, $controller, $ionicBind) {\n  return {\n    restrict: 'E',\n    scope: true,\n    controller: function() {},\n    compile: function(element) {\n      element.addClass('scroll-view ionic-scroll');\n\n      //We cannot transclude here because it breaks element.data() inheritance on compile\n      var innerElement = jqLite('<div class=\"scroll\"></div>');\n      innerElement.append(element.contents());\n      element.append(innerElement);\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr) {\n        $ionicBind($scope, $attr, {\n          direction: '@',\n          paging: '@',\n          $onScroll: '&onScroll',\n          scroll: '@',\n          scrollbarX: '@',\n          scrollbarY: '@',\n          zooming: '@',\n          minZoom: '@',\n          maxZoom: '@'\n        });\n        $scope.direction = $scope.direction || 'y';\n\n        if (isDefined($attr.padding)) {\n          $scope.$watch($attr.padding, function(newVal) {\n            innerElement.toggleClass('padding', !!newVal);\n          });\n        }\n        if ($scope.$eval($scope.paging) === true) {\n          innerElement.addClass('scroll-paging');\n        }\n\n        if (!$scope.direction) { $scope.direction = 'y'; }\n        var isPaging = $scope.$eval($scope.paging) === true;\n\n        var scrollViewOptions = {\n          el: $element[0],\n          delegateHandle: $attr.delegateHandle,\n          locking: ($attr.locking || 'true') === 'true',\n          bouncing: $scope.$eval($attr.hasBouncing),\n          paging: isPaging,\n          scrollbarX: $scope.$eval($scope.scrollbarX) !== false,\n          scrollbarY: $scope.$eval($scope.scrollbarY) !== false,\n          scrollingX: $scope.direction.indexOf('x') >= 0,\n          scrollingY: $scope.direction.indexOf('y') >= 0,\n          zooming: $scope.$eval($scope.zooming) === true,\n          maxZoom: $scope.$eval($scope.maxZoom) || 3,\n          minZoom: $scope.$eval($scope.minZoom) || 0.5,\n          preventDefault: true\n        };\n        if (isPaging) {\n          scrollViewOptions.speedMultiplier = 0.8;\n          scrollViewOptions.bouncing = false;\n        }\n\n        $controller('$ionicScroll', {\n          $scope: $scope,\n          scrollViewOptions: scrollViewOptions\n        });\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionSideMenu\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * A container for a side menu, sibling to an {@link ionic.directive:ionSideMenuContent} directive.\n *\n * @usage\n * ```html\n * <ion-side-menu\n *   side=\"left\"\n *   width=\"myWidthValue + 20\"\n *   is-enabled=\"shouldLeftSideMenuBeEnabled()\">\n * </ion-side-menu>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n *\n * @param {string} side Which side the side menu is currently on.  Allowed values: 'left' or 'right'.\n * @param {boolean=} is-enabled Whether this side menu is enabled.\n * @param {number=} width How many pixels wide the side menu should be.  Defaults to 275.\n */\nIonicModule\n.directive('ionSideMenu', function() {\n  return {\n    restrict: 'E',\n    require: '^ionSideMenus',\n    scope: true,\n    compile: function(element, attr) {\n      angular.isUndefined(attr.isEnabled) && attr.$set('isEnabled', 'true');\n      angular.isUndefined(attr.width) && attr.$set('width', '275');\n\n      element.addClass('menu menu-' + attr.side);\n\n      return function($scope, $element, $attr, sideMenuCtrl) {\n        $scope.side = $attr.side || 'left';\n\n        var sideMenu = sideMenuCtrl[$scope.side] = new ionic.views.SideMenu({\n          width: attr.width,\n          el: $element[0],\n          isEnabled: true\n        });\n\n        $scope.$watch($attr.width, function(val) {\n          var numberVal = +val;\n          if (numberVal && numberVal == val) {\n            sideMenu.setWidth(+val);\n          }\n        });\n        $scope.$watch($attr.isEnabled, function(val) {\n          sideMenu.setIsEnabled(!!val);\n        });\n      };\n    }\n  };\n});\n\n\n/**\n * @ngdoc directive\n * @name ionSideMenuContent\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionSideMenus\n *\n * @description\n * A container for the main visible content, sibling to one or more\n * {@link ionic.directive:ionSideMenu} directives.\n *\n * @usage\n * ```html\n * <ion-side-menu-content\n *   edge-drag-threshold=\"true\"\n *   drag-content=\"true\">\n * </ion-side-menu-content>\n * ```\n * For a complete side menu example, see the\n * {@link ionic.directive:ionSideMenus} documentation.\n *\n * @param {boolean=} drag-content Whether the content can be dragged. Default true.\n * @param {boolean|number=} edge-drag-threshold Whether the content drag can only start if it is below a certain threshold distance from the edge of the screen.  Default false. Accepts three types of values:\n   *  - If a non-zero number is given, that many pixels is used as the maximum allowed distance from the edge that starts dragging the side menu.\n   *  - If true is given, the default number of pixels (25) is used as the maximum allowed distance.\n   *  - If false or 0 is given, the edge drag threshold is disabled, and dragging from anywhere on the content is allowed.\n *\n */\nIonicModule\n.directive('ionSideMenuContent', [\n  '$timeout',\n  '$ionicGesture',\n  '$window',\nfunction($timeout, $ionicGesture, $window) {\n\n  return {\n    restrict: 'EA', //DEPRECATED 'A'\n    require: '^ionSideMenus',\n    scope: true,\n    compile: function(element, attr) {\n      element.addClass('menu-content pane');\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attr, sideMenuCtrl) {\n        var startCoord = null;\n        var primaryScrollAxis = null;\n\n        if (isDefined(attr.dragContent)) {\n          $scope.$watch(attr.dragContent, function(value) {\n            sideMenuCtrl.canDragContent(value);\n          });\n        } else {\n          sideMenuCtrl.canDragContent(true);\n        }\n\n        if (isDefined(attr.edgeDragThreshold)) {\n          $scope.$watch(attr.edgeDragThreshold, function(value) {\n            sideMenuCtrl.edgeDragThreshold(value);\n          });\n        }\n\n        // Listen for taps on the content to close the menu\n        function onContentTap(gestureEvt) {\n          if (sideMenuCtrl.getOpenAmount() !== 0) {\n            sideMenuCtrl.close();\n            gestureEvt.gesture.srcEvent.preventDefault();\n            startCoord = null;\n            primaryScrollAxis = null;\n          } else if (!startCoord) {\n            startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n          }\n        }\n\n        function onDragX(e) {\n          if (!sideMenuCtrl.isDraggableTarget(e)) return;\n\n          if (getPrimaryScrollAxis(e) == 'x') {\n            sideMenuCtrl._handleDrag(e);\n            e.gesture.srcEvent.preventDefault();\n          }\n        }\n\n        function onDragY(e) {\n          if (getPrimaryScrollAxis(e) == 'x') {\n            e.gesture.srcEvent.preventDefault();\n          }\n        }\n\n        function onDragRelease(e) {\n          sideMenuCtrl._endDrag(e);\n          startCoord = null;\n          primaryScrollAxis = null;\n        }\n\n        function getPrimaryScrollAxis(gestureEvt) {\n          // gets whether the user is primarily scrolling on the X or Y\n          // If a majority of the drag has been on the Y since the start of\n          // the drag, but the X has moved a little bit, it's still a Y drag\n\n          if (primaryScrollAxis) {\n            // we already figured out which way they're scrolling\n            return primaryScrollAxis;\n          }\n\n          if (gestureEvt && gestureEvt.gesture) {\n\n            if (!startCoord) {\n              // get the starting point\n              startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n\n            } else {\n              // we already have a starting point, figure out which direction they're going\n              var endCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n\n              var xDistance = Math.abs(endCoord.x - startCoord.x);\n              var yDistance = Math.abs(endCoord.y - startCoord.y);\n\n              var scrollAxis = (xDistance < yDistance ? 'y' : 'x');\n\n              if (Math.max(xDistance, yDistance) > 30) {\n                // ok, we pretty much know which way they're going\n                // let's lock it in\n                primaryScrollAxis = scrollAxis;\n              }\n\n              return scrollAxis;\n            }\n          }\n          return 'y';\n        }\n\n        var content = {\n          element: element[0],\n          onDrag: function() {},\n          endDrag: function() {},\n          getTranslateX: function() {\n            return $scope.sideMenuContentTranslateX || 0;\n          },\n          setTranslateX: ionic.animationFrameThrottle(function(amount) {\n            var xTransform = content.offsetX + amount;\n            $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(' + xTransform + 'px,0,0)';\n            $timeout(function() {\n              $scope.sideMenuContentTranslateX = amount;\n            });\n          }),\n          setMarginLeft: ionic.animationFrameThrottle(function(amount) {\n            if (amount) {\n              amount = parseInt(amount, 10);\n              $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(' + amount + 'px,0,0)';\n              $element[0].style.width = ($window.innerWidth - amount) + 'px';\n              content.offsetX = amount;\n            } else {\n              $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(0,0,0)';\n              $element[0].style.width = '';\n              content.offsetX = 0;\n            }\n          }),\n          setMarginRight: ionic.animationFrameThrottle(function(amount) {\n            if (amount) {\n              amount = parseInt(amount, 10);\n              $element[0].style.width = ($window.innerWidth - amount) + 'px';\n              content.offsetX = amount;\n            } else {\n              $element[0].style.width = '';\n              content.offsetX = 0;\n            }\n            // reset incase left gets grabby\n            $element[0].style[ionic.CSS.TRANSFORM] = 'translate3d(0,0,0)';\n          }),\n          enableAnimation: function() {\n            $scope.animationEnabled = true;\n            $element[0].classList.add('menu-animated');\n          },\n          disableAnimation: function() {\n            $scope.animationEnabled = false;\n            $element[0].classList.remove('menu-animated');\n          },\n          offsetX: 0\n        };\n\n        sideMenuCtrl.setContent(content);\n\n        // add gesture handlers\n        var gestureOpts = { stop_browser_behavior: false };\n        if (ionic.DomUtil.getParentOrSelfWithClass($element[0], 'overflow-scroll')) {\n          gestureOpts.prevent_default_directions = ['left', 'right'];\n        }\n        var contentTapGesture = $ionicGesture.on('tap', onContentTap, $element, gestureOpts);\n        var dragRightGesture = $ionicGesture.on('dragright', onDragX, $element, gestureOpts);\n        var dragLeftGesture = $ionicGesture.on('dragleft', onDragX, $element, gestureOpts);\n        var dragUpGesture = $ionicGesture.on('dragup', onDragY, $element, gestureOpts);\n        var dragDownGesture = $ionicGesture.on('dragdown', onDragY, $element, gestureOpts);\n        var releaseGesture = $ionicGesture.on('release', onDragRelease, $element, gestureOpts);\n\n        // Cleanup\n        $scope.$on('$destroy', function() {\n          if (content) {\n            content.element = null;\n            content = null;\n          }\n          $ionicGesture.off(dragLeftGesture, 'dragleft', onDragX);\n          $ionicGesture.off(dragRightGesture, 'dragright', onDragX);\n          $ionicGesture.off(dragUpGesture, 'dragup', onDragY);\n          $ionicGesture.off(dragDownGesture, 'dragdown', onDragY);\n          $ionicGesture.off(releaseGesture, 'release', onDragRelease);\n          $ionicGesture.off(contentTapGesture, 'tap', onContentTap);\n        });\n      }\n    }\n  };\n}]);\n\nIonicModule\n\n/**\n * @ngdoc directive\n * @name ionSideMenus\n * @module ionic\n * @delegate ionic.service:$ionicSideMenuDelegate\n * @restrict E\n *\n * @description\n * A container element for side menu(s) and the main content. Allows the left and/or right side menu\n * to be toggled by dragging the main content area side to side.\n *\n * To automatically close an opened menu, you can add the {@link ionic.directive:menuClose} attribute\n * directive. The `menu-close` attribute is usually added to links and buttons within\n * `ion-side-menu-content`, so that when the element is clicked, the opened side menu will\n * automatically close.\n *\n * \"Burger Icon\" toggles can be added to the header with the {@link ionic.directive:menuToggle}\n * attribute directive. Clicking the toggle will open and close the side menu like the `menu-close`\n * directive. The side menu will automatically hide on child pages, but can be overridden with the\n * enable-menu-with-back-views attribute mentioned below.\n *\n * By default, side menus are hidden underneath their side menu content and can be opened by swiping\n * the content left or right or by toggling a button to show the side menu. Additionally, by adding the\n * {@link ionic.directive:exposeAsideWhen} attribute directive to an\n * {@link ionic.directive:ionSideMenu} element directive, a side menu can be given instructions about\n * \"when\" the menu should be exposed (always viewable).\n *\n * ![Side Menu](http://ionicframework.com.s3.amazonaws.com/docs/controllers/sidemenu.gif)\n *\n * For more information on side menus, check out:\n *\n * - {@link ionic.directive:ionSideMenuContent}\n * - {@link ionic.directive:ionSideMenu}\n * - {@link ionic.directive:menuToggle}\n * - {@link ionic.directive:menuClose}\n * - {@link ionic.directive:exposeAsideWhen}\n *\n * @usage\n * To use side menus, add an `<ion-side-menus>` parent element. This will encompass all pages that have a\n * side menu, and have at least 2 child elements: 1 `<ion-side-menu-content>` for the center content,\n * and one or more `<ion-side-menu>` directives for each side menu(left/right) that you wish to place.\n *\n * ```html\n * <ion-side-menus>\n *   <!-- Center content -->\n *   <ion-side-menu-content ng-controller=\"ContentController\">\n *   </ion-side-menu-content>\n *\n *   <!-- Left menu -->\n *   <ion-side-menu side=\"left\">\n *   </ion-side-menu>\n *\n *   <!-- Right menu -->\n *   <ion-side-menu side=\"right\">\n *   </ion-side-menu>\n *\n *   <ion-side-menu-content>\n *   <!-- Main content, usually <ion-nav-view> -->\n *   </ion-side-menu-content>\n * </ion-side-menus>\n * ```\n * ```js\n * function ContentController($scope, $ionicSideMenuDelegate) {\n *   $scope.toggleLeft = function() {\n *     $ionicSideMenuDelegate.toggleLeft();\n *   };\n * }\n * ```\n *\n * @param {bool=} enable-menu-with-back-views Determines whether the side menu is enabled when the\n * back button is showing. When set to `false`, any {@link ionic.directive:menuToggle} will be hidden,\n * and the user cannot swipe to open the menu. When going back to the root page of the side menu (the\n * page without a back button visible), then any menuToggle buttons will show again, and menus will be\n * enabled again.\n * @param {string=} delegate-handle The handle used to identify this side menu\n * with {@link ionic.service:$ionicSideMenuDelegate}.\n *\n */\n.directive('ionSideMenus', ['$ionicBody', function($ionicBody) {\n  return {\n    restrict: 'ECA',\n    controller: '$ionicSideMenus',\n    compile: function(element, attr) {\n      attr.$set('class', (attr['class'] || '') + ' view');\n\n      return { pre: prelink };\n      function prelink($scope, $element, $attrs, ctrl) {\n\n        ctrl.enableMenuWithBackViews($scope.$eval($attrs.enableMenuWithBackViews));\n\n        $scope.$on('$ionicExposeAside', function(evt, isAsideExposed) {\n          if (!$scope.$exposeAside) $scope.$exposeAside = {};\n          $scope.$exposeAside.active = isAsideExposed;\n          $ionicBody.enableClass(isAsideExposed, 'aside-open');\n        });\n\n        $scope.$on('$ionicView.beforeEnter', function(ev, d) {\n          if (d.historyId) {\n            $scope.$activeHistoryId = d.historyId;\n          }\n        });\n\n        $scope.$on('$destroy', function() {\n          $ionicBody.removeClass('menu-open', 'aside-open');\n        });\n\n      }\n    }\n  };\n}]);\n\n\n/**\n * @ngdoc directive\n * @name ionSlideBox\n * @module ionic\n * @delegate ionic.service:$ionicSlideBoxDelegate\n * @restrict E\n * @description\n * The Slide Box is a multi-page container where each page can be swiped or dragged between:\n *\n * ![SlideBox](http://ionicframework.com.s3.amazonaws.com/docs/controllers/slideBox.gif)\n *\n * @usage\n * ```html\n * <ion-slide-box on-slide-changed=\"slideHasChanged($index)\">\n *   <ion-slide>\n *     <div class=\"box blue\"><h1>BLUE</h1></div>\n *   </ion-slide>\n *   <ion-slide>\n *     <div class=\"box yellow\"><h1>YELLOW</h1></div>\n *   </ion-slide>\n *   <ion-slide>\n *     <div class=\"box pink\"><h1>PINK</h1></div>\n *   </ion-slide>\n * </ion-slide-box>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify this slideBox\n * with {@link ionic.service:$ionicSlideBoxDelegate}.\n * @param {boolean=} does-continue Whether the slide box should loop.\n * @param {boolean=} auto-play Whether the slide box should automatically slide. Default true if does-continue is true.\n * @param {number=} slide-interval How many milliseconds to wait to change slides (if does-continue is true). Defaults to 4000.\n * @param {boolean=} show-pager Whether a pager should be shown for this slide box. Accepts expressions via `show-pager=\"{{shouldShow()}}\"`. Defaults to true.\n * @param {expression=} pager-click Expression to call when a pager is clicked (if show-pager is true). Is passed the 'index' variable.\n * @param {expression=} on-slide-changed Expression called whenever the slide is changed.  Is passed an '$index' variable.\n * @param {expression=} active-slide Model to bind the current slide to.\n */\nIonicModule\n.directive('ionSlideBox', [\n  '$timeout',\n  '$compile',\n  '$ionicSlideBoxDelegate',\n  '$ionicHistory',\n  '$ionicScrollDelegate',\nfunction($timeout, $compile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScrollDelegate) {\n  return {\n    restrict: 'E',\n    replace: true,\n    transclude: true,\n    scope: {\n      autoPlay: '=',\n      doesContinue: '@',\n      slideInterval: '@',\n      showPager: '@',\n      pagerClick: '&',\n      disableScroll: '@',\n      onSlideChanged: '&',\n      activeSlide: '=?'\n    },\n    controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {\n      var _this = this;\n\n      var continuous = $scope.$eval($scope.doesContinue) === true;\n      var shouldAutoPlay = isDefined($attrs.autoPlay) ? !!$scope.autoPlay : false;\n      var slideInterval = shouldAutoPlay ? $scope.$eval($scope.slideInterval) || 4000 : 0;\n\n      var slider = new ionic.views.Slider({\n        el: $element[0],\n        auto: slideInterval,\n        continuous: continuous,\n        startSlide: $scope.activeSlide,\n        slidesChanged: function() {\n          $scope.currentSlide = slider.currentIndex();\n\n          // Try to trigger a digest\n          $timeout(function() {});\n        },\n        callback: function(slideIndex) {\n          $scope.currentSlide = slideIndex;\n          $scope.onSlideChanged({ index: $scope.currentSlide, $index: $scope.currentSlide});\n          $scope.$parent.$broadcast('slideBox.slideChanged', slideIndex);\n          $scope.activeSlide = slideIndex;\n          // Try to trigger a digest\n          $timeout(function() {});\n        },\n        onDrag: function() {\n          freezeAllScrolls(true);\n        },\n        onDragEnd: function() {\n          freezeAllScrolls(false);\n        }\n      });\n\n      function freezeAllScrolls(shouldFreeze) {\n        if (shouldFreeze && !_this.isScrollFreeze) {\n          $ionicScrollDelegate.freezeAllScrolls(shouldFreeze);\n\n        } else if (!shouldFreeze && _this.isScrollFreeze) {\n          $ionicScrollDelegate.freezeAllScrolls(false);\n        }\n        _this.isScrollFreeze = shouldFreeze;\n      }\n\n      slider.enableSlide($scope.$eval($attrs.disableScroll) !== true);\n\n      $scope.$watch('activeSlide', function(nv) {\n        if (isDefined(nv)) {\n          slider.slide(nv);\n        }\n      });\n\n      $scope.$on('slideBox.nextSlide', function() {\n        slider.next();\n      });\n\n      $scope.$on('slideBox.prevSlide', function() {\n        slider.prev();\n      });\n\n      $scope.$on('slideBox.setSlide', function(e, index) {\n        slider.slide(index);\n      });\n\n      //Exposed for testing\n      this.__slider = slider;\n\n      var deregisterInstance = $ionicSlideBoxDelegate._registerInstance(\n        slider, $attrs.delegateHandle, function() {\n          return $ionicHistory.isActiveScope($scope);\n        }\n      );\n      $scope.$on('$destroy', function() {\n        deregisterInstance();\n        slider.kill();\n      });\n\n      this.slidesCount = function() {\n        return slider.slidesCount();\n      };\n\n      this.onPagerClick = function(index) {\n        void 0;\n        $scope.pagerClick({index: index});\n      };\n\n      $timeout(function() {\n        slider.load();\n      });\n    }],\n    template: '<div class=\"slider\">' +\n      '<div class=\"slider-slides\" ng-transclude>' +\n      '</div>' +\n    '</div>',\n\n    link: function($scope, $element, $attr) {\n      // if showPager is undefined, show the pager\n      if (!isDefined($attr.showPager)) {\n        $scope.showPager = true;\n        getPager().toggleClass('hide', !true);\n      }\n\n      $attr.$observe('showPager', function(show) {\n        show = $scope.$eval(show);\n        getPager().toggleClass('hide', !show);\n      });\n\n      var pager;\n      function getPager() {\n        if (!pager) {\n          var childScope = $scope.$new();\n          pager = jqLite('<ion-pager></ion-pager>');\n          $element.append(pager);\n          pager = $compile(pager)(childScope);\n        }\n        return pager;\n      }\n    }\n  };\n}])\n.directive('ionSlide', function() {\n  return {\n    restrict: 'E',\n    require: '^ionSlideBox',\n    compile: function(element) {\n      element.addClass('slider-slide');\n    }\n  };\n})\n\n.directive('ionPager', function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '^ionSlideBox',\n    template: '<div class=\"slider-pager\"><span class=\"slider-pager-page\" ng-repeat=\"slide in numSlides() track by $index\" ng-class=\"{active: $index == currentSlide}\" ng-click=\"pagerClick($index)\"><i class=\"icon ion-record\"></i></span></div>',\n    link: function($scope, $element, $attr, slideBox) {\n      var selectPage = function(index) {\n        var children = $element[0].children;\n        var length = children.length;\n        for (var i = 0; i < length; i++) {\n          if (i == index) {\n            children[i].classList.add('active');\n          } else {\n            children[i].classList.remove('active');\n          }\n        }\n      };\n\n      $scope.pagerClick = function(index) {\n        slideBox.onPagerClick(index);\n      };\n\n      $scope.numSlides = function() {\n        return new Array(slideBox.slidesCount());\n      };\n\n      $scope.$watch('currentSlide', function(v) {\n        selectPage(v);\n      });\n    }\n  };\n\n});\n\n/**\n* @ngdoc directive\n* @name ionSpinner\n* @module ionic\n* @restrict E\n *\n * @description\n * The `ionSpinner` directive provides a variety of animated spinners.\n * Spinners enables you to give your users feedback that the app is\n * processing/thinking/waiting/chillin' out, or whatever you'd like it to indicate.\n * By default, the {@link ionic.directive:ionRefresher} feature uses this spinner, rather\n * than rotating font icons (previously included in [ionicons](http://ionicons.com/)).\n * While font icons are great for simple or stationary graphics, they're not suited to\n * provide great animations, which is why Ionic uses SVG instead.\n *\n * Ionic offers ten spinners out of the box, and by default, it will use the appropriate spinner\n * for the platform on which it's running. Under the hood, the `ionSpinner` directive dynamically\n * builds the required SVG element, which allows Ionic to provide all ten of the animated SVGs\n * within 3KB.\n *\n * <style>\n * .spinner-table {\n *   max-width: 280px;\n * }\n * .spinner-table tbody > tr > th, .spinner-table tbody > tr > td {\n *   vertical-align: middle;\n *   width: 42px;\n *   height: 42px;\n * }\n * .spinner {\n *   stroke: #444;\n *   fill: #444; }\n *   .spinner svg {\n *     width: 28px;\n *     height: 28px; }\n *   .spinner.spinner-inverse {\n *     stroke: #fff;\n *     fill: #fff; }\n *\n * .spinner-android {\n *   stroke: #4b8bf4; }\n *\n * .spinner-ios, .spinner-ios-small {\n *   stroke: #69717d; }\n *\n * .spinner-spiral .stop1 {\n *   stop-color: #fff;\n *   stop-opacity: 0; }\n * .spinner-spiral.spinner-inverse .stop1 {\n *   stop-color: #000; }\n * .spinner-spiral.spinner-inverse .stop2 {\n *   stop-color: #fff; }\n * </style>\n *\n * <script src=\"http://code.ionicframework.com/nightly/js/ionic.bundle.min.js\"></script>\n * <table class=\"table spinner-table\" ng-app=\"ionic\">\n *  <tr>\n *    <th>\n *      <code>android</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"android\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ios</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ios\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ios-small</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ios-small\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>bubbles</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"bubbles\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>circles</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"circles\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>crescent</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"crescent\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>dots</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"dots\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>lines</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"lines\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>ripple</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"ripple\"></ion-spinner>\n *    </td>\n *  </tr>\n *  <tr>\n *    <th>\n *      <code>spiral</code>\n *    </th>\n *    <td>\n *      <ion-spinner icon=\"spiral\"></ion-spinner>\n *    </td>\n *  </tr>\n * </table>\n *\n * Each spinner uses SVG with SMIL animations, however, the Android spinner also uses JavaScript\n * so it also works on Android 4.0-4.3. Additionally, each spinner can be styled with CSS,\n * and scaled to any size.\n *\n *\n * @usage\n * The following code would use the default spinner for the platform it's running from. If it's neither\n * iOS or Android, it'll default to use `ios`.\n *\n * ```html\n * <ion-spinner></ion-spinner>\n * ```\n *\n * By setting the `icon` attribute, you can specify which spinner to use, no matter what\n * the platform is.\n *\n * ```html\n * <ion-spinner icon=\"spiral\"></ion-spinner>\n * ```\n *\n * ## Spinner Colors\n * Like with most of Ionic's other components, spinners can also be styled using\n * Ionic's standard color naming convention. For example:\n *\n * ```html\n * <ion-spinner class=\"spinner-energized\"></ion-spinner>\n * ```\n *\n *\n * ## Styling SVG with CSS\n * One cool thing about SVG is its ability to be styled with CSS! Some of the properties\n * have different names, for example, SVG uses the term `stroke` instead of `border`, and\n * `fill` instead of `background-color`.\n *\n * ```css\n * .spinner svg {\n *   width: 28px;\n *   height: 28px;\n *   stroke: #444;\n *   fill: #444;\n * }\n * ```\n *\n*/\nIonicModule\n.directive('ionSpinner', function() {\n  return {\n    restrict: 'E',\n    controller: '$ionicSpinner',\n    link: function($scope, $element, $attrs, ctrl) {\n      var spinnerName = ctrl.init();\n      $element.addClass('spinner spinner-' + spinnerName);\n    }\n  };\n});\n\n/**\n * @ngdoc directive\n * @name ionTab\n * @module ionic\n * @restrict E\n * @parent ionic.directive:ionTabs\n *\n * @description\n * Contains a tab's content.  The content only exists while the given tab is selected.\n *\n * Each ionTab has its own view history.\n *\n * @usage\n * ```html\n * <ion-tab\n *   title=\"Tab!\"\n *   icon=\"my-icon\"\n *   href=\"#/tab/tab-link\"\n *   on-select=\"onTabSelected()\"\n *   on-deselect=\"onTabDeselected()\">\n * </ion-tab>\n * ```\n * For a complete, working tab bar example, see the {@link ionic.directive:ionTabs} documentation.\n *\n * @param {string} title The title of the tab.\n * @param {string=} href The link that this tab will navigate to when tapped.\n * @param {string=} icon The icon of the tab. If given, this will become the default for icon-on and icon-off.\n * @param {string=} icon-on The icon of the tab while it is selected.\n * @param {string=} icon-off The icon of the tab while it is not selected.\n * @param {expression=} badge The badge to put on this tab (usually a number).\n * @param {expression=} badge-style The style of badge to put on this tab (eg: badge-positive).\n * @param {expression=} on-select Called when this tab is selected.\n * @param {expression=} on-deselect Called when this tab is deselected.\n * @param {expression=} ng-click By default, the tab will be selected on click. If ngClick is set, it will not.  You can explicitly switch tabs using {@link ionic.service:$ionicTabsDelegate#select $ionicTabsDelegate.select()}.\n * @param {expression=} hidden Whether the tab is to be hidden or not.\n * @param {expression=} disabled Whether the tab is to be disabled or not.\n */\nIonicModule\n.directive('ionTab', [\n  '$compile',\n  '$ionicConfig',\n  '$ionicBind',\n  '$ionicViewSwitcher',\nfunction($compile, $ionicConfig, $ionicBind, $ionicViewSwitcher) {\n\n  //Returns ' key=\"value\"' if value exists\n  function attrStr(k, v) {\n    return isDefined(v) ? ' ' + k + '=\"' + v + '\"' : '';\n  }\n  return {\n    restrict: 'E',\n    require: ['^ionTabs', 'ionTab'],\n    controller: '$ionicTab',\n    scope: true,\n    compile: function(element, attr) {\n\n      //We create the tabNavTemplate in the compile phase so that the\n      //attributes we pass down won't be interpolated yet - we want\n      //to pass down the 'raw' versions of the attributes\n      var tabNavTemplate = '<ion-tab-nav' +\n        attrStr('ng-click', attr.ngClick) +\n        attrStr('title', attr.title) +\n        attrStr('icon', attr.icon) +\n        attrStr('icon-on', attr.iconOn) +\n        attrStr('icon-off', attr.iconOff) +\n        attrStr('badge', attr.badge) +\n        attrStr('badge-style', attr.badgeStyle) +\n        attrStr('hidden', attr.hidden) +\n        attrStr('disabled', attr.disabled) +\n        attrStr('class', attr['class']) +\n        '></ion-tab-nav>';\n\n      //Remove the contents of the element so we can compile them later, if tab is selected\n      var tabContentEle = document.createElement('div');\n      for (var x = 0; x < element[0].children.length; x++) {\n        tabContentEle.appendChild(element[0].children[x].cloneNode(true));\n      }\n      var childElementCount = tabContentEle.childElementCount;\n      element.empty();\n\n      var navViewName, isNavView;\n      if (childElementCount) {\n        if (tabContentEle.children[0].tagName === 'ION-NAV-VIEW') {\n          // get the name if it's a nav-view\n          navViewName = tabContentEle.children[0].getAttribute('name');\n          tabContentEle.children[0].classList.add('view-container');\n          isNavView = true;\n        }\n        if (childElementCount === 1) {\n          // make the 1 child element the primary tab content container\n          tabContentEle = tabContentEle.children[0];\n        }\n        if (!isNavView) tabContentEle.classList.add('pane');\n        tabContentEle.classList.add('tab-content');\n      }\n\n      return function link($scope, $element, $attr, ctrls) {\n        var childScope;\n        var childElement;\n        var tabsCtrl = ctrls[0];\n        var tabCtrl = ctrls[1];\n        var isTabContentAttached = false;\n        $scope.$tabSelected = false;\n\n        $ionicBind($scope, $attr, {\n          onSelect: '&',\n          onDeselect: '&',\n          title: '@',\n          uiSref: '@',\n          href: '@'\n        });\n\n        tabsCtrl.add($scope);\n        $scope.$on('$destroy', function() {\n          if (!$scope.$tabsDestroy) {\n            // if the containing ionTabs directive is being destroyed\n            // then don't bother going through the controllers remove\n            // method, since remove will reset the active tab as each tab\n            // is being destroyed, causing unnecessary view loads and transitions\n            tabsCtrl.remove($scope);\n          }\n          tabNavElement.isolateScope().$destroy();\n          tabNavElement.remove();\n          tabNavElement = tabContentEle = childElement = null;\n        });\n\n        //Remove title attribute so browser-tooltip does not apear\n        $element[0].removeAttribute('title');\n\n        if (navViewName) {\n          tabCtrl.navViewName = $scope.navViewName = navViewName;\n        }\n        $scope.$on('$stateChangeSuccess', selectIfMatchesState);\n        selectIfMatchesState();\n        function selectIfMatchesState() {\n          if (tabCtrl.tabMatchesState()) {\n            tabsCtrl.select($scope, false);\n          }\n        }\n\n        var tabNavElement = jqLite(tabNavTemplate);\n        tabNavElement.data('$ionTabsController', tabsCtrl);\n        tabNavElement.data('$ionTabController', tabCtrl);\n        tabsCtrl.$tabsElement.append($compile(tabNavElement)($scope));\n\n\n        function tabSelected(isSelected) {\n          if (isSelected && childElementCount) {\n            // this tab is being selected\n\n            // check if the tab is already in the DOM\n            // only do this if the tab has child elements\n            if (!isTabContentAttached) {\n              // tab should be selected and is NOT in the DOM\n              // create a new scope and append it\n              childScope = $scope.$new();\n              childElement = jqLite(tabContentEle);\n              $ionicViewSwitcher.viewEleIsActive(childElement, true);\n              tabsCtrl.$element.append(childElement);\n              $compile(childElement)(childScope);\n              isTabContentAttached = true;\n            }\n\n            // remove the hide class so the tabs content shows up\n            $ionicViewSwitcher.viewEleIsActive(childElement, true);\n\n          } else if (isTabContentAttached && childElement) {\n            // this tab should NOT be selected, and it is already in the DOM\n\n            if ($ionicConfig.views.maxCache() > 0) {\n              // keep the tabs in the DOM, only css hide it\n              $ionicViewSwitcher.viewEleIsActive(childElement, false);\n\n            } else {\n              // do not keep tabs in the DOM\n              destroyTab();\n            }\n\n          }\n        }\n\n        function destroyTab() {\n          childScope && childScope.$destroy();\n          isTabContentAttached && childElement && childElement.remove();\n          tabContentEle.innerHTML = '';\n          isTabContentAttached = childScope = childElement = null;\n        }\n\n        $scope.$watch('$tabSelected', tabSelected);\n\n        $scope.$on('$ionicView.afterEnter', function() {\n          $ionicViewSwitcher.viewEleIsActive(childElement, $scope.$tabSelected);\n        });\n\n        $scope.$on('$ionicView.clearCache', function() {\n          if (!$scope.$tabSelected) {\n            destroyTab();\n          }\n        });\n\n      };\n    }\n  };\n}]);\n\nIonicModule\n.directive('ionTabNav', [function() {\n  return {\n    restrict: 'E',\n    replace: true,\n    require: ['^ionTabs', '^ionTab'],\n    template:\n    '<a ng-class=\"{\\'tab-item-active\\': isTabActive(), \\'has-badge\\':badge, \\'tab-hidden\\':isHidden()}\" ' +\n      ' ng-disabled=\"disabled()\" class=\"tab-item\">' +\n      '<span class=\"badge {{badgeStyle}}\" ng-if=\"badge\">{{badge}}</span>' +\n      '<i class=\"icon {{getIconOn()}}\" ng-if=\"getIconOn() && isTabActive()\"></i>' +\n      '<i class=\"icon {{getIconOff()}}\" ng-if=\"getIconOff() && !isTabActive()\"></i>' +\n      '<span class=\"tab-title\" ng-bind-html=\"title\"></span>' +\n    '</a>',\n    scope: {\n      title: '@',\n      icon: '@',\n      iconOn: '@',\n      iconOff: '@',\n      badge: '=',\n      hidden: '@',\n      disabled: '&',\n      badgeStyle: '@',\n      'class': '@'\n    },\n    link: function($scope, $element, $attrs, ctrls) {\n      var tabsCtrl = ctrls[0],\n        tabCtrl = ctrls[1];\n\n      //Remove title attribute so browser-tooltip does not apear\n      $element[0].removeAttribute('title');\n\n      $scope.selectTab = function(e) {\n        e.preventDefault();\n        tabsCtrl.select(tabCtrl.$scope, true);\n      };\n      if (!$attrs.ngClick) {\n        $element.on('click', function(event) {\n          $scope.$apply(function() {\n            $scope.selectTab(event);\n          });\n        });\n      }\n\n      $scope.isHidden = function() {\n        if ($attrs.hidden === 'true' || $attrs.hidden === true) return true;\n        return false;\n      };\n\n      $scope.getIconOn = function() {\n        return $scope.iconOn || $scope.icon;\n      };\n      $scope.getIconOff = function() {\n        return $scope.iconOff || $scope.icon;\n      };\n\n      $scope.isTabActive = function() {\n        return tabsCtrl.selectedTab() === tabCtrl.$scope;\n      };\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionTabs\n * @module ionic\n * @delegate ionic.service:$ionicTabsDelegate\n * @restrict E\n * @codepen odqCz\n *\n * @description\n * Powers a multi-tabbed interface with a Tab Bar and a set of \"pages\" that can be tabbed\n * through.\n *\n * Assign any [tabs class](/docs/components#tabs) to the element to define\n * its look and feel.\n *\n * For iOS, tabs will appear at the bottom of the screen. For Android, tabs will be at the top\n * of the screen, below the nav-bar. This follows each OS's design specification, but can be\n * configured with the {@link ionic.provider:$ionicConfigProvider}.\n *\n * See the {@link ionic.directive:ionTab} directive's documentation for more details on\n * individual tabs.\n *\n * Note: do not place ion-tabs inside of an ion-content element; it has been known to cause a\n * certain CSS bug.\n *\n * @usage\n * ```html\n * <ion-tabs class=\"tabs-positive tabs-icon-only\">\n *\n *   <ion-tab title=\"Home\" icon-on=\"ion-ios-filing\" icon-off=\"ion-ios-filing-outline\">\n *     <!-- Tab 1 content -->\n *   </ion-tab>\n *\n *   <ion-tab title=\"About\" icon-on=\"ion-ios-clock\" icon-off=\"ion-ios-clock-outline\">\n *     <!-- Tab 2 content -->\n *   </ion-tab>\n *\n *   <ion-tab title=\"Settings\" icon-on=\"ion-ios-gear\" icon-off=\"ion-ios-gear-outline\">\n *     <!-- Tab 3 content -->\n *   </ion-tab>\n *\n * </ion-tabs>\n * ```\n *\n * @param {string=} delegate-handle The handle used to identify these tabs\n * with {@link ionic.service:$ionicTabsDelegate}.\n */\n\nIonicModule\n.directive('ionTabs', [\n  '$ionicTabsDelegate',\n  '$ionicConfig',\nfunction($ionicTabsDelegate, $ionicConfig) {\n  return {\n    restrict: 'E',\n    scope: true,\n    controller: '$ionicTabs',\n    compile: function(tElement) {\n      //We cannot use regular transclude here because it breaks element.data()\n      //inheritance on compile\n      var innerElement = jqLite('<div class=\"tab-nav tabs\">');\n      innerElement.append(tElement.contents());\n\n      tElement.append(innerElement)\n              .addClass('tabs-' + $ionicConfig.tabs.position() + ' tabs-' + $ionicConfig.tabs.style());\n\n      return { pre: prelink, post: postLink };\n      function prelink($scope, $element, $attr, tabsCtrl) {\n        var deregisterInstance = $ionicTabsDelegate._registerInstance(\n          tabsCtrl, $attr.delegateHandle, tabsCtrl.hasActiveScope\n        );\n\n        tabsCtrl.$scope = $scope;\n        tabsCtrl.$element = $element;\n        tabsCtrl.$tabsElement = jqLite($element[0].querySelector('.tabs'));\n\n        $scope.$watch(function() { return $element[0].className; }, function(value) {\n          var isTabsTop = value.indexOf('tabs-top') !== -1;\n          var isHidden = value.indexOf('tabs-item-hide') !== -1;\n          $scope.$hasTabs = !isTabsTop && !isHidden;\n          $scope.$hasTabsTop = isTabsTop && !isHidden;\n          $scope.$emit('$ionicTabs.top', $scope.$hasTabsTop);\n        });\n\n        function emitLifecycleEvent(ev, data) {\n          ev.stopPropagation();\n          var previousSelectedTab = tabsCtrl.previousSelectedTab();\n          if (previousSelectedTab) {\n            previousSelectedTab.$broadcast(ev.name.replace('NavView', 'Tabs'), data);\n          }\n        }\n\n        $scope.$on('$ionicNavView.beforeLeave', emitLifecycleEvent);\n        $scope.$on('$ionicNavView.afterLeave', emitLifecycleEvent);\n        $scope.$on('$ionicNavView.leave', emitLifecycleEvent);\n\n        $scope.$on('$destroy', function() {\n          // variable to inform child tabs that they're all being blown away\n          // used so that while destorying an individual tab, each one\n          // doesn't select the next tab as the active one, which causes unnecessary\n          // loading of tab views when each will eventually all go away anyway\n          $scope.$tabsDestroy = true;\n          deregisterInstance();\n          tabsCtrl.$tabsElement = tabsCtrl.$element = tabsCtrl.$scope = innerElement = null;\n          delete $scope.$hasTabs;\n          delete $scope.$hasTabsTop;\n        });\n      }\n\n      function postLink($scope, $element, $attr, tabsCtrl) {\n        if (!tabsCtrl.selectedTab()) {\n          // all the tabs have been added\n          // but one hasn't been selected yet\n          tabsCtrl.select(0);\n        }\n      }\n    }\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionToggle\n * @module ionic\n * @codepen tfAzj\n * @restrict E\n *\n * @description\n * A toggle is an animated switch which binds a given model to a boolean.\n *\n * Allows dragging of the switch's nub.\n *\n * The toggle behaves like any [AngularJS checkbox](http://docs.angularjs.org/api/ng/input/input[checkbox]) otherwise.\n *\n * @param toggle-class {string=} Sets the CSS class on the inner `label.toggle` element created by the directive.\n *\n * @usage\n * Below is an example of a toggle directive which is wired up to the `airplaneMode` model\n * and has the `toggle-calm` CSS class assigned to the inner element.\n *\n * ```html\n * <ion-toggle ng-model=\"airplaneMode\" toggle-class=\"toggle-calm\">Airplane Mode</ion-toggle>\n * ```\n */\nIonicModule\n.directive('ionToggle', [\n  '$timeout',\n  '$ionicConfig',\nfunction($timeout, $ionicConfig) {\n\n  return {\n    restrict: 'E',\n    replace: true,\n    require: '?ngModel',\n    transclude: true,\n    template:\n      '<div class=\"item item-toggle\">' +\n        '<div ng-transclude></div>' +\n        '<label class=\"toggle\">' +\n          '<input type=\"checkbox\">' +\n          '<div class=\"track\">' +\n            '<div class=\"handle\"></div>' +\n          '</div>' +\n        '</label>' +\n      '</div>',\n\n    compile: function(element, attr) {\n      var input = element.find('input');\n      forEach({\n        'name': attr.name,\n        'ng-value': attr.ngValue,\n        'ng-model': attr.ngModel,\n        'ng-checked': attr.ngChecked,\n        'ng-disabled': attr.ngDisabled,\n        'ng-true-value': attr.ngTrueValue,\n        'ng-false-value': attr.ngFalseValue,\n        'ng-change': attr.ngChange,\n        'ng-required': attr.ngRequired,\n        'required': attr.required\n      }, function(value, name) {\n        if (isDefined(value)) {\n          input.attr(name, value);\n        }\n      });\n\n      if (attr.toggleClass) {\n        element[0].getElementsByTagName('label')[0].classList.add(attr.toggleClass);\n      }\n\n      element.addClass('toggle-' + $ionicConfig.form.toggle());\n\n      return function($scope, $element) {\n        var el = $element[0].getElementsByTagName('label')[0];\n        var checkbox = el.children[0];\n        var track = el.children[1];\n        var handle = track.children[0];\n\n        var ngModelController = jqLite(checkbox).controller('ngModel');\n\n        $scope.toggle = new ionic.views.Toggle({\n          el: el,\n          track: track,\n          checkbox: checkbox,\n          handle: handle,\n          onChange: function() {\n            if (ngModelController) {\n              ngModelController.$setViewValue(checkbox.checked);\n              $scope.$apply();\n            }\n          }\n        });\n\n        $scope.$on('$destroy', function() {\n          $scope.toggle.destroy();\n        });\n      };\n    }\n\n  };\n}]);\n\n/**\n * @ngdoc directive\n * @name ionView\n * @module ionic\n * @restrict E\n * @parent ionNavView\n *\n * @description\n * A container for view content and any navigational and header bar information. When a view\n * enters and exits its parent {@link ionic.directive:ionNavView}, the view also emits view\n * information, such as its title, whether the back button should be displayed or not, whether the\n * corresponding {@link ionic.directive:ionNavBar} should be displayed or not, which transition the view\n * should use to animate, and which direction to animate.\n *\n * *Views are cached to improve performance.* When a view is navigated away from, its element is\n * left in the DOM, and its scope is disconnected from the `$watch` cycle. When navigating to a\n * view that is already cached, its scope is reconnected, and the existing element, which was\n * left in the DOM, becomes active again. This can be disabled, or the maximum number of cached\n * views changed in {@link ionic.provider:$ionicConfigProvider}, in the view's `$state` configuration, or\n * as an attribute on the view itself (see below).\n *\n * @usage\n * Below is an example where our page will load with a {@link ionic.directive:ionNavBar} containing\n * \"My Page\" as the title.\n *\n * ```html\n * <ion-nav-bar></ion-nav-bar>\n * <ion-nav-view>\n *   <ion-view view-title=\"My Page\">\n *     <ion-content>\n *       Hello!\n *     </ion-content>\n *   </ion-view>\n * </ion-nav-view>\n * ```\n *\n * ## View LifeCycle and Events\n *\n * Views can be cached, which means ***controllers normally only load once***, which may\n * affect your controller logic. To know when a view has entered or left, events\n * have been added that are emitted from the view's scope. These events also\n * contain data about the view, such as the title and whether the back button should\n * show. Also contained is transition data, such as the transition type and\n * direction that will be or was used.\n *\n * <table class=\"table\">\n *  <tr>\n *   <td><code>$ionicView.loaded</code></td>\n *   <td>The view has loaded. This event only happens once per\n * view being created and added to the DOM. If a view leaves but is cached,\n * then this event will not fire again on a subsequent viewing. The loaded event\n * is good place to put your setup code for the view; however, it is not the\n * recommended event to listen to when a view becomes active.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.enter</code></td>\n *   <td>The view has fully entered and is now the active view.\n * This event will fire, whether it was the first load or a cached view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.leave</code></td>\n *   <td>The view has finished leaving and is no longer the\n * active view. This event will fire, whether it is cached or destroyed.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.beforeEnter</code></td>\n *   <td>The view is about to enter and become the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.beforeLeave</code></td>\n *   <td>The view is about to leave and no longer be the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.afterEnter</code></td>\n *   <td>The view has fully entered and is now the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.afterLeave</code></td>\n *   <td>The view has finished leaving and is no longer the active view.</td>\n *  </tr>\n *  <tr>\n *   <td><code>$ionicView.unloaded</code></td>\n *   <td>The view's controller has been destroyed and its element has been\n * removed from the DOM.</td>\n *  </tr>\n * </table>\n *\n * ## Caching\n *\n * Caching can be disabled and enabled in multiple ways. By default, Ionic will\n * cache a maximum of 10 views. You can optionally choose to disable caching at\n * either an individual view basis, or by global configuration. Please see the\n * _Caching_ section in {@link ionic.directive:ionNavView} for more info.\n *\n * @param {string=} view-title A text-only title to display on the parent {@link ionic.directive:ionNavBar}.\n * For an HTML title, such as an image, see {@link ionic.directive:ionNavTitle} instead.\n * @param {boolean=} cache-view If this view should be allowed to be cached or not.\n * Please see the _Caching_ section in {@link ionic.directive:ionNavView} for\n * more info. Default `true`\n * @param {boolean=} can-swipe-back If this view should be allowed to use the swipe to go back gesture or not.\n * This does not enable the swipe to go back feature if it is not available for the platform it's running\n * from, or there isn't a previous view. Default `true`\n * @param {boolean=} hide-back-button Whether to hide the back button on the parent\n * {@link ionic.directive:ionNavBar} by default.\n * @param {boolean=} hide-nav-bar Whether to hide the parent\n * {@link ionic.directive:ionNavBar} by default.\n */\nIonicModule\n.directive('ionView', function() {\n  return {\n    restrict: 'EA',\n    priority: 1000,\n    controller: '$ionicView',\n    compile: function(tElement) {\n      tElement.addClass('pane');\n      tElement[0].removeAttribute('title');\n      return function link($scope, $element, $attrs, viewCtrl) {\n        viewCtrl.init();\n      };\n    }\n  };\n});\n\n})();"
  },
  {
    "path": "www/lib/ionic/js/ionic.js",
    "content": "/*!\n * Copyright 2014 Drifty Co.\n * http://drifty.com/\n *\n * Ionic, v1.0.0\n * A powerful HTML5 mobile app framework.\n * http://ionicframework.com/\n *\n * By @maxlynch, @benjsperry, @adamdbradley <3\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n\n(function() {\n\n// Create global ionic obj and its namespaces\n// build processes may have already created an ionic obj\nwindow.ionic = window.ionic || {};\nwindow.ionic.views = {};\nwindow.ionic.version = '1.0.0';\n\n(function (ionic) {\n\n  ionic.DelegateService = function(methodNames) {\n\n    if (methodNames.indexOf('$getByHandle') > -1) {\n      throw new Error(\"Method '$getByHandle' is implicitly added to each delegate service. Do not list it as a method.\");\n    }\n\n    function trueFn() { return true; }\n\n    return ['$log', function($log) {\n\n      /*\n       * Creates a new object that will have all the methodNames given,\n       * and call them on the given the controller instance matching given\n       * handle.\n       * The reason we don't just let $getByHandle return the controller instance\n       * itself is that the controller instance might not exist yet.\n       *\n       * We want people to be able to do\n       * `var instance = $ionicScrollDelegate.$getByHandle('foo')` on controller\n       * instantiation, but on controller instantiation a child directive\n       * may not have been compiled yet!\n       *\n       * So this is our way of solving this problem: we create an object\n       * that will only try to fetch the controller with given handle\n       * once the methods are actually called.\n       */\n      function DelegateInstance(instances, handle) {\n        this._instances = instances;\n        this.handle = handle;\n      }\n      methodNames.forEach(function(methodName) {\n        DelegateInstance.prototype[methodName] = instanceMethodCaller(methodName);\n      });\n\n\n      /**\n       * The delegate service (eg $ionicNavBarDelegate) is just an instance\n       * with a non-defined handle, a couple extra methods for registering\n       * and narrowing down to a specific handle.\n       */\n      function DelegateService() {\n        this._instances = [];\n      }\n      DelegateService.prototype = DelegateInstance.prototype;\n      DelegateService.prototype._registerInstance = function(instance, handle, filterFn) {\n        var instances = this._instances;\n        instance.$$delegateHandle = handle;\n        instance.$$filterFn = filterFn || trueFn;\n        instances.push(instance);\n\n        return function deregister() {\n          var index = instances.indexOf(instance);\n          if (index !== -1) {\n            instances.splice(index, 1);\n          }\n        };\n      };\n      DelegateService.prototype.$getByHandle = function(handle) {\n        return new DelegateInstance(this._instances, handle);\n      };\n\n      return new DelegateService();\n\n      function instanceMethodCaller(methodName) {\n        return function caller() {\n          var handle = this.handle;\n          var args = arguments;\n          var foundInstancesCount = 0;\n          var returnValue;\n\n          this._instances.forEach(function(instance) {\n            if ((!handle || handle == instance.$$delegateHandle) && instance.$$filterFn(instance)) {\n              foundInstancesCount++;\n              var ret = instance[methodName].apply(instance, args);\n              //Only return the value from the first call\n              if (foundInstancesCount === 1) {\n                returnValue = ret;\n              }\n            }\n          });\n\n          if (!foundInstancesCount && handle) {\n            return $log.warn(\n              'Delegate for handle \"' + handle + '\" could not find a ' +\n              'corresponding element with delegate-handle=\"' + handle + '\"! ' +\n              methodName + '() was not called!\\n' +\n              'Possible cause: If you are calling ' + methodName + '() immediately, and ' +\n              'your element with delegate-handle=\"' + handle + '\" is a child of your ' +\n              'controller, then your element may not be compiled yet. Put a $timeout ' +\n              'around your call to ' + methodName + '() and try again.'\n            );\n          }\n          return returnValue;\n        };\n      }\n\n    }];\n  };\n\n})(window.ionic);\n\n(function(window, document, ionic) {\n\n  var readyCallbacks = [];\n  var isDomReady = document.readyState === 'complete' || document.readyState === 'interactive';\n\n  function domReady() {\n    isDomReady = true;\n    for (var x = 0; x < readyCallbacks.length; x++) {\n      ionic.requestAnimationFrame(readyCallbacks[x]);\n    }\n    readyCallbacks = [];\n    document.removeEventListener('DOMContentLoaded', domReady);\n  }\n  if (!isDomReady) {\n    document.addEventListener('DOMContentLoaded', domReady);\n  }\n\n\n  // From the man himself, Mr. Paul Irish.\n  // The requestAnimationFrame polyfill\n  // Put it on window just to preserve its context\n  // without having to use .call\n  window._rAF = (function() {\n    return window.requestAnimationFrame ||\n           window.webkitRequestAnimationFrame ||\n           window.mozRequestAnimationFrame ||\n           function(callback) {\n             window.setTimeout(callback, 16);\n           };\n  })();\n\n  var cancelAnimationFrame = window.cancelAnimationFrame ||\n    window.webkitCancelAnimationFrame ||\n    window.mozCancelAnimationFrame ||\n    window.webkitCancelRequestAnimationFrame;\n\n  /**\n  * @ngdoc utility\n  * @name ionic.DomUtil\n  * @module ionic\n  */\n  ionic.DomUtil = {\n    //Call with proper context\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#requestAnimationFrame\n     * @alias ionic.requestAnimationFrame\n     * @description Calls [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame), or a polyfill if not available.\n     * @param {function} callback The function to call when the next frame\n     * happens.\n     */\n    requestAnimationFrame: function(cb) {\n      return window._rAF(cb);\n    },\n\n    cancelAnimationFrame: function(requestId) {\n      cancelAnimationFrame(requestId);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#animationFrameThrottle\n     * @alias ionic.animationFrameThrottle\n     * @description\n     * When given a callback, if that callback is called 100 times between\n     * animation frames, adding Throttle will make it only run the last of\n     * the 100 calls.\n     *\n     * @param {function} callback a function which will be throttled to\n     * requestAnimationFrame\n     * @returns {function} A function which will then call the passed in callback.\n     * The passed in callback will receive the context the returned function is\n     * called with.\n     */\n    animationFrameThrottle: function(cb) {\n      var args, isQueued, context;\n      return function() {\n        args = arguments;\n        context = this;\n        if (!isQueued) {\n          isQueued = true;\n          ionic.requestAnimationFrame(function() {\n            cb.apply(context, args);\n            isQueued = false;\n          });\n        }\n      };\n    },\n\n    contains: function(parentNode, otherNode) {\n      var current = otherNode;\n      while (current) {\n        if (current === parentNode) return true;\n        current = current.parentNode;\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getPositionInParent\n     * @description\n     * Find an element's scroll offset within its container.\n     * @param {DOMElement} element The element to find the offset of.\n     * @returns {object} A position object with the following properties:\n     *   - `{number}` `left` The left offset of the element.\n     *   - `{number}` `top` The top offset of the element.\n     */\n    getPositionInParent: function(el) {\n      return {\n        left: el.offsetLeft,\n        top: el.offsetTop\n      };\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#ready\n     * @description\n     * Call a function when the DOM is ready, or if it is already ready\n     * call the function immediately.\n     * @param {function} callback The function to be called.\n     */\n    ready: function(cb) {\n      if (isDomReady) {\n        ionic.requestAnimationFrame(cb);\n      } else {\n        readyCallbacks.push(cb);\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getTextBounds\n     * @description\n     * Get a rect representing the bounds of the given textNode.\n     * @param {DOMElement} textNode The textNode to find the bounds of.\n     * @returns {object} An object representing the bounds of the node. Properties:\n     *   - `{number}` `left` The left position of the textNode.\n     *   - `{number}` `right` The right position of the textNode.\n     *   - `{number}` `top` The top position of the textNode.\n     *   - `{number}` `bottom` The bottom position of the textNode.\n     *   - `{number}` `width` The width of the textNode.\n     *   - `{number}` `height` The height of the textNode.\n     */\n    getTextBounds: function(textNode) {\n      if (document.createRange) {\n        var range = document.createRange();\n        range.selectNodeContents(textNode);\n        if (range.getBoundingClientRect) {\n          var rect = range.getBoundingClientRect();\n          if (rect) {\n            var sx = window.scrollX;\n            var sy = window.scrollY;\n\n            return {\n              top: rect.top + sy,\n              left: rect.left + sx,\n              right: rect.left + sx + rect.width,\n              bottom: rect.top + sy + rect.height,\n              width: rect.width,\n              height: rect.height\n            };\n          }\n        }\n      }\n      return null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getChildIndex\n     * @description\n     * Get the first index of a child node within the given element of the\n     * specified type.\n     * @param {DOMElement} element The element to find the index of.\n     * @param {string} type The nodeName to match children of element against.\n     * @returns {number} The index, or -1, of a child with nodeName matching type.\n     */\n    getChildIndex: function(element, type) {\n      if (type) {\n        var ch = element.parentNode.children;\n        var c;\n        for (var i = 0, k = 0, j = ch.length; i < j; i++) {\n          c = ch[i];\n          if (c.nodeName && c.nodeName.toLowerCase() == type) {\n            if (c == element) {\n              return k;\n            }\n            k++;\n          }\n        }\n      }\n      return Array.prototype.slice.call(element.parentNode.children).indexOf(element);\n    },\n\n    /**\n     * @private\n     */\n    swapNodes: function(src, dest) {\n      dest.parentNode.insertBefore(src, dest);\n    },\n\n    elementIsDescendant: function(el, parent, stopAt) {\n      var current = el;\n      do {\n        if (current === parent) return true;\n        current = current.parentNode;\n      } while (current && current !== stopAt);\n      return false;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getParentWithClass\n     * @param {DOMElement} element\n     * @param {string} className\n     * @returns {DOMElement} The closest parent of element matching the\n     * className, or null.\n     */\n    getParentWithClass: function(e, className, depth) {\n      depth = depth || 10;\n      while (e.parentNode && depth--) {\n        if (e.parentNode.classList && e.parentNode.classList.contains(className)) {\n          return e.parentNode;\n        }\n        e = e.parentNode;\n      }\n      return null;\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#getParentOrSelfWithClass\n     * @param {DOMElement} element\n     * @param {string} className\n     * @returns {DOMElement} The closest parent or self matching the\n     * className, or null.\n     */\n    getParentOrSelfWithClass: function(e, className, depth) {\n      depth = depth || 10;\n      while (e && depth--) {\n        if (e.classList && e.classList.contains(className)) {\n          return e;\n        }\n        e = e.parentNode;\n      }\n      return null;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#rectContains\n     * @param {number} x\n     * @param {number} y\n     * @param {number} x1\n     * @param {number} y1\n     * @param {number} x2\n     * @param {number} y2\n     * @returns {boolean} Whether {x,y} fits within the rectangle defined by\n     * {x1,y1,x2,y2}.\n     */\n    rectContains: function(x, y, x1, y1, x2, y2) {\n      if (x < x1 || x > x2) return false;\n      if (y < y1 || y > y2) return false;\n      return true;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.DomUtil#blurAll\n     * @description\n     * Blurs any currently focused input element\n     * @returns {DOMElement} The element blurred or null\n     */\n    blurAll: function() {\n      if (document.activeElement && document.activeElement != document.body) {\n        document.activeElement.blur();\n        return document.activeElement;\n      }\n      return null;\n    },\n\n    cachedAttr: function(ele, key, value) {\n      ele = ele && ele.length && ele[0] || ele;\n      if (ele && ele.setAttribute) {\n        var dataKey = '$attr-' + key;\n        if (arguments.length > 2) {\n          if (ele[dataKey] !== value) {\n            ele.setAttribute(key, value);\n            ele[dataKey] = value;\n          }\n        } else if (typeof ele[dataKey] == 'undefined') {\n          ele[dataKey] = ele.getAttribute(key);\n        }\n        return ele[dataKey];\n      }\n    },\n\n    cachedStyles: function(ele, styles) {\n      ele = ele && ele.length && ele[0] || ele;\n      if (ele && ele.style) {\n        for (var prop in styles) {\n          if (ele['$style-' + prop] !== styles[prop]) {\n            ele.style[prop] = ele['$style-' + prop] = styles[prop];\n          }\n        }\n      }\n    }\n\n  };\n\n  //Shortcuts\n  ionic.requestAnimationFrame = ionic.DomUtil.requestAnimationFrame;\n  ionic.cancelAnimationFrame = ionic.DomUtil.cancelAnimationFrame;\n  ionic.animationFrameThrottle = ionic.DomUtil.animationFrameThrottle;\n\n})(window, document, ionic);\n\n/**\n * ion-events.js\n *\n * Author: Max Lynch <max@drifty.com>\n *\n * Framework events handles various mobile browser events, and\n * detects special events like tap/swipe/etc. and emits them\n * as custom events that can be used in an app.\n *\n * Portions lovingly adapted from github.com/maker/ratchet and github.com/alexgibson/tap.js - thanks guys!\n */\n\n(function(ionic) {\n\n  // Custom event polyfill\n  ionic.CustomEvent = (function() {\n    if( typeof window.CustomEvent === 'function' ) return CustomEvent;\n\n    var customEvent = function(event, params) {\n      var evt;\n      params = params || {\n        bubbles: false,\n        cancelable: false,\n        detail: undefined\n      };\n      try {\n        evt = document.createEvent(\"CustomEvent\");\n        evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n      } catch (error) {\n        // fallback for browsers that don't support createEvent('CustomEvent')\n        evt = document.createEvent(\"Event\");\n        for (var param in params) {\n          evt[param] = params[param];\n        }\n        evt.initEvent(event, params.bubbles, params.cancelable);\n      }\n      return evt;\n    };\n    customEvent.prototype = window.Event.prototype;\n    return customEvent;\n  })();\n\n\n  /**\n   * @ngdoc utility\n   * @name ionic.EventController\n   * @module ionic\n   */\n  ionic.EventController = {\n    VIRTUALIZED_EVENTS: ['tap', 'swipe', 'swiperight', 'swipeleft', 'drag', 'hold', 'release'],\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#trigger\n     * @alias ionic.trigger\n     * @param {string} eventType The event to trigger.\n     * @param {object} data The data for the event. Hint: pass in\n     * `{target: targetElement}`\n     * @param {boolean=} bubbles Whether the event should bubble up the DOM.\n     * @param {boolean=} cancelable Whether the event should be cancelable.\n     */\n    // Trigger a new event\n    trigger: function(eventType, data, bubbles, cancelable) {\n      var event = new ionic.CustomEvent(eventType, {\n        detail: data,\n        bubbles: !!bubbles,\n        cancelable: !!cancelable\n      });\n\n      // Make sure to trigger the event on the given target, or dispatch it from\n      // the window if we don't have an event target\n      data && data.target && data.target.dispatchEvent && data.target.dispatchEvent(event) || window.dispatchEvent(event);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#on\n     * @alias ionic.on\n     * @description Listen to an event on an element.\n     * @param {string} type The event to listen for.\n     * @param {function} callback The listener to be called.\n     * @param {DOMElement} element The element to listen for the event on.\n     */\n    on: function(type, callback, element) {\n      var e = element || window;\n\n      // Bind a gesture if it's a virtual event\n      for(var i = 0, j = this.VIRTUALIZED_EVENTS.length; i < j; i++) {\n        if(type == this.VIRTUALIZED_EVENTS[i]) {\n          var gesture = new ionic.Gesture(element);\n          gesture.on(type, callback);\n          return gesture;\n        }\n      }\n\n      // Otherwise bind a normal event\n      e.addEventListener(type, callback);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#off\n     * @alias ionic.off\n     * @description Remove an event listener.\n     * @param {string} type\n     * @param {function} callback\n     * @param {DOMElement} element\n     */\n    off: function(type, callback, element) {\n      element.removeEventListener(type, callback);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#onGesture\n     * @alias ionic.onGesture\n     * @description Add an event listener for a gesture on an element.\n     *\n     * Available eventTypes (from [hammer.js](http://eightmedia.github.io/hammer.js/)):\n     *\n     * `hold`, `tap`, `doubletap`, `drag`, `dragstart`, `dragend`, `dragup`, `dragdown`, <br/>\n     * `dragleft`, `dragright`, `swipe`, `swipeup`, `swipedown`, `swipeleft`, `swiperight`, <br/>\n     * `transform`, `transformstart`, `transformend`, `rotate`, `pinch`, `pinchin`, `pinchout`, </br>\n     * `touch`, `release`\n     *\n     * @param {string} eventType The gesture event to listen for.\n     * @param {function(e)} callback The function to call when the gesture\n     * happens.\n     * @param {DOMElement} element The angular element to listen for the event on.\n     * @param {object} options object.\n     * @returns {ionic.Gesture} The gesture object (use this to remove the gesture later on).\n     */\n    onGesture: function(type, callback, element, options) {\n      var gesture = new ionic.Gesture(element, options);\n      gesture.on(type, callback);\n      return gesture;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.EventController#offGesture\n     * @alias ionic.offGesture\n     * @description Remove an event listener for a gesture created on an element.\n     * @param {ionic.Gesture} gesture The gesture that should be removed.\n     * @param {string} eventType The gesture event to remove the listener for.\n     * @param {function(e)} callback The listener to remove.\n\n     */\n    offGesture: function(gesture, type, callback) {\n      gesture && gesture.off(type, callback);\n    },\n\n    handlePopState: function() {}\n  };\n\n\n  // Map some convenient top-level functions for event handling\n  ionic.on = function() { ionic.EventController.on.apply(ionic.EventController, arguments); };\n  ionic.off = function() { ionic.EventController.off.apply(ionic.EventController, arguments); };\n  ionic.trigger = ionic.EventController.trigger;//function() { ionic.EventController.trigger.apply(ionic.EventController.trigger, arguments); };\n  ionic.onGesture = function() { return ionic.EventController.onGesture.apply(ionic.EventController.onGesture, arguments); };\n  ionic.offGesture = function() { return ionic.EventController.offGesture.apply(ionic.EventController.offGesture, arguments); };\n\n})(window.ionic);\n\n/* eslint camelcase:0 */\n/**\n  * Simple gesture controllers with some common gestures that emit\n  * gesture events.\n  *\n  * Ported from github.com/EightMedia/hammer.js Gestures - thanks!\n  */\n(function(ionic) {\n\n  /**\n   * ionic.Gestures\n   * use this to create instances\n   * @param   {HTMLElement}   element\n   * @param   {Object}        options\n   * @returns {ionic.Gestures.Instance}\n   * @constructor\n   */\n  ionic.Gesture = function(element, options) {\n    return new ionic.Gestures.Instance(element, options || {});\n  };\n\n  ionic.Gestures = {};\n\n  // default settings\n  ionic.Gestures.defaults = {\n    // add css to the element to prevent the browser from doing\n    // its native behavior. this doesnt prevent the scrolling,\n    // but cancels the contextmenu, tap highlighting etc\n    // set to false to disable this\n    stop_browser_behavior: 'disable-user-behavior'\n  };\n\n  // detect touchevents\n  ionic.Gestures.HAS_POINTEREVENTS = window.navigator.pointerEnabled || window.navigator.msPointerEnabled;\n  ionic.Gestures.HAS_TOUCHEVENTS = ('ontouchstart' in window);\n\n  // dont use mouseevents on mobile devices\n  ionic.Gestures.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android|silk/i;\n  ionic.Gestures.NO_MOUSEEVENTS = ionic.Gestures.HAS_TOUCHEVENTS && window.navigator.userAgent.match(ionic.Gestures.MOBILE_REGEX);\n\n  // eventtypes per touchevent (start, move, end)\n  // are filled by ionic.Gestures.event.determineEventTypes on setup\n  ionic.Gestures.EVENT_TYPES = {};\n\n  // direction defines\n  ionic.Gestures.DIRECTION_DOWN = 'down';\n  ionic.Gestures.DIRECTION_LEFT = 'left';\n  ionic.Gestures.DIRECTION_UP = 'up';\n  ionic.Gestures.DIRECTION_RIGHT = 'right';\n\n  // pointer type\n  ionic.Gestures.POINTER_MOUSE = 'mouse';\n  ionic.Gestures.POINTER_TOUCH = 'touch';\n  ionic.Gestures.POINTER_PEN = 'pen';\n\n  // touch event defines\n  ionic.Gestures.EVENT_START = 'start';\n  ionic.Gestures.EVENT_MOVE = 'move';\n  ionic.Gestures.EVENT_END = 'end';\n\n  // hammer document where the base events are added at\n  ionic.Gestures.DOCUMENT = window.document;\n\n  // plugins namespace\n  ionic.Gestures.plugins = {};\n\n  // if the window events are set...\n  ionic.Gestures.READY = false;\n\n  /**\n   * setup events to detect gestures on the document\n   */\n  function setup() {\n    if(ionic.Gestures.READY) {\n      return;\n    }\n\n    // find what eventtypes we add listeners to\n    ionic.Gestures.event.determineEventTypes();\n\n    // Register all gestures inside ionic.Gestures.gestures\n    for(var name in ionic.Gestures.gestures) {\n      if(ionic.Gestures.gestures.hasOwnProperty(name)) {\n        ionic.Gestures.detection.register(ionic.Gestures.gestures[name]);\n      }\n    }\n\n    // Add touch events on the document\n    ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_MOVE, ionic.Gestures.detection.detect);\n    ionic.Gestures.event.onTouch(ionic.Gestures.DOCUMENT, ionic.Gestures.EVENT_END, ionic.Gestures.detection.detect);\n\n    // ionic.Gestures is ready...!\n    ionic.Gestures.READY = true;\n  }\n\n  /**\n   * create new hammer instance\n   * all methods should return the instance itself, so it is chainable.\n   * @param   {HTMLElement}       element\n   * @param   {Object}            [options={}]\n   * @returns {ionic.Gestures.Instance}\n   * @name Gesture.Instance\n   * @constructor\n   */\n  ionic.Gestures.Instance = function(element, options) {\n    var self = this;\n\n    // A null element was passed into the instance, which means\n    // whatever lookup was done to find this element failed to find it\n    // so we can't listen for events on it.\n    if(element === null) {\n      void 0;\n      return this;\n    }\n\n    // setup ionic.GesturesJS window events and register all gestures\n    // this also sets up the default options\n    setup();\n\n    this.element = element;\n\n    // start/stop detection option\n    this.enabled = true;\n\n    // merge options\n    this.options = ionic.Gestures.utils.extend(\n        ionic.Gestures.utils.extend({}, ionic.Gestures.defaults),\n        options || {});\n\n    // add some css to the element to prevent the browser from doing its native behavoir\n    if(this.options.stop_browser_behavior) {\n      ionic.Gestures.utils.stopDefaultBrowserBehavior(this.element, this.options.stop_browser_behavior);\n    }\n\n    // start detection on touchstart\n    ionic.Gestures.event.onTouch(element, ionic.Gestures.EVENT_START, function(ev) {\n      if(self.enabled) {\n        ionic.Gestures.detection.startDetect(self, ev);\n      }\n    });\n\n    // return instance\n    return this;\n  };\n\n\n  ionic.Gestures.Instance.prototype = {\n    /**\n     * bind events to the instance\n     * @param   {String}      gesture\n     * @param   {Function}    handler\n     * @returns {ionic.Gestures.Instance}\n     */\n    on: function onEvent(gesture, handler){\n      var gestures = gesture.split(' ');\n      for(var t = 0; t < gestures.length; t++) {\n        this.element.addEventListener(gestures[t], handler, false);\n      }\n      return this;\n    },\n\n\n    /**\n     * unbind events to the instance\n     * @param   {String}      gesture\n     * @param   {Function}    handler\n     * @returns {ionic.Gestures.Instance}\n     */\n    off: function offEvent(gesture, handler){\n      var gestures = gesture.split(' ');\n      for(var t = 0; t < gestures.length; t++) {\n        this.element.removeEventListener(gestures[t], handler, false);\n      }\n      return this;\n    },\n\n\n    /**\n     * trigger gesture event\n     * @param   {String}      gesture\n     * @param   {Object}      eventData\n     * @returns {ionic.Gestures.Instance}\n     */\n    trigger: function triggerEvent(gesture, eventData){\n      // create DOM event\n      var event = ionic.Gestures.DOCUMENT.createEvent('Event');\n      event.initEvent(gesture, true, true);\n      event.gesture = eventData;\n\n      // trigger on the target if it is in the instance element,\n      // this is for event delegation tricks\n      var element = this.element;\n      if(ionic.Gestures.utils.hasParent(eventData.target, element)) {\n        element = eventData.target;\n      }\n\n      element.dispatchEvent(event);\n      return this;\n    },\n\n\n    /**\n     * enable of disable hammer.js detection\n     * @param   {Boolean}   state\n     * @returns {ionic.Gestures.Instance}\n     */\n    enable: function enable(state) {\n      this.enabled = state;\n      return this;\n    }\n  };\n\n  /**\n   * this holds the last move event,\n   * used to fix empty touchend issue\n   * see the onTouch event for an explanation\n   * type {Object}\n   */\n  var last_move_event = null;\n\n\n  /**\n   * when the mouse is hold down, this is true\n   * type {Boolean}\n   */\n  var enable_detect = false;\n\n\n  /**\n   * when touch events have been fired, this is true\n   * type {Boolean}\n   */\n  var touch_triggered = false;\n\n\n  ionic.Gestures.event = {\n    /**\n     * simple addEventListener\n     * @param   {HTMLElement}   element\n     * @param   {String}        type\n     * @param   {Function}      handler\n     */\n    bindDom: function(element, type, handler) {\n      var types = type.split(' ');\n      for(var t = 0; t < types.length; t++) {\n        element.addEventListener(types[t], handler, false);\n      }\n    },\n\n\n    /**\n     * touch events with mouse fallback\n     * @param   {HTMLElement}   element\n     * @param   {String}        eventType        like ionic.Gestures.EVENT_MOVE\n     * @param   {Function}      handler\n     */\n    onTouch: function onTouch(element, eventType, handler) {\n      var self = this;\n\n      this.bindDom(element, ionic.Gestures.EVENT_TYPES[eventType], function bindDomOnTouch(ev) {\n        var sourceEventType = ev.type.toLowerCase();\n\n        // onmouseup, but when touchend has been fired we do nothing.\n        // this is for touchdevices which also fire a mouseup on touchend\n        if(sourceEventType.match(/mouse/) && touch_triggered) {\n          return;\n        }\n\n        // mousebutton must be down or a touch event\n        else if( sourceEventType.match(/touch/) ||   // touch events are always on screen\n          sourceEventType.match(/pointerdown/) || // pointerevents touch\n          (sourceEventType.match(/mouse/) && ev.which === 1)   // mouse is pressed\n          ){\n            enable_detect = true;\n          }\n\n        // mouse isn't pressed\n        else if(sourceEventType.match(/mouse/) && ev.which !== 1) {\n          enable_detect = false;\n        }\n\n\n        // we are in a touch event, set the touch triggered bool to true,\n        // this for the conflicts that may occur on ios and android\n        if(sourceEventType.match(/touch|pointer/)) {\n          touch_triggered = true;\n        }\n\n        // count the total touches on the screen\n        var count_touches = 0;\n\n        // when touch has been triggered in this detection session\n        // and we are now handling a mouse event, we stop that to prevent conflicts\n        if(enable_detect) {\n          // update pointerevent\n          if(ionic.Gestures.HAS_POINTEREVENTS && eventType != ionic.Gestures.EVENT_END) {\n            count_touches = ionic.Gestures.PointerEvent.updatePointer(eventType, ev);\n          }\n          // touch\n          else if(sourceEventType.match(/touch/)) {\n            count_touches = ev.touches.length;\n          }\n          // mouse\n          else if(!touch_triggered) {\n            count_touches = sourceEventType.match(/up/) ? 0 : 1;\n          }\n\n          // if we are in a end event, but when we remove one touch and\n          // we still have enough, set eventType to move\n          if(count_touches > 0 && eventType == ionic.Gestures.EVENT_END) {\n            eventType = ionic.Gestures.EVENT_MOVE;\n          }\n          // no touches, force the end event\n          else if(!count_touches) {\n            eventType = ionic.Gestures.EVENT_END;\n          }\n\n          // store the last move event\n          if(count_touches || last_move_event === null) {\n            last_move_event = ev;\n          }\n\n          // trigger the handler\n          handler.call(ionic.Gestures.detection, self.collectEventData(element, eventType, self.getTouchList(last_move_event, eventType), ev));\n\n          // remove pointerevent from list\n          if(ionic.Gestures.HAS_POINTEREVENTS && eventType == ionic.Gestures.EVENT_END) {\n            count_touches = ionic.Gestures.PointerEvent.updatePointer(eventType, ev);\n          }\n        }\n\n        //debug(sourceEventType +\" \"+ eventType);\n\n        // on the end we reset everything\n        if(!count_touches) {\n          last_move_event = null;\n          enable_detect = false;\n          touch_triggered = false;\n          ionic.Gestures.PointerEvent.reset();\n        }\n      });\n    },\n\n\n    /**\n     * we have different events for each device/browser\n     * determine what we need and set them in the ionic.Gestures.EVENT_TYPES constant\n     */\n    determineEventTypes: function determineEventTypes() {\n      // determine the eventtype we want to set\n      var types;\n\n      // pointerEvents magic\n      if(ionic.Gestures.HAS_POINTEREVENTS) {\n        types = ionic.Gestures.PointerEvent.getEvents();\n      }\n      // on Android, iOS, blackberry, windows mobile we dont want any mouseevents\n      else if(ionic.Gestures.NO_MOUSEEVENTS) {\n        types = [\n          'touchstart',\n          'touchmove',\n          'touchend touchcancel'];\n      }\n      // for non pointer events browsers and mixed browsers,\n      // like chrome on windows8 touch laptop\n      else {\n        types = [\n          'touchstart mousedown',\n          'touchmove mousemove',\n          'touchend touchcancel mouseup'];\n      }\n\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_START] = types[0];\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_MOVE] = types[1];\n      ionic.Gestures.EVENT_TYPES[ionic.Gestures.EVENT_END] = types[2];\n    },\n\n\n    /**\n     * create touchlist depending on the event\n     * @param   {Object}    ev\n     * @param   {String}    eventType   used by the fakemultitouch plugin\n     */\n    getTouchList: function getTouchList(ev/*, eventType*/) {\n      // get the fake pointerEvent touchlist\n      if(ionic.Gestures.HAS_POINTEREVENTS) {\n        return ionic.Gestures.PointerEvent.getTouchList();\n      }\n      // get the touchlist\n      else if(ev.touches) {\n        return ev.touches;\n      }\n      // make fake touchlist from mouse position\n      else {\n        ev.identifier = 1;\n        return [ev];\n      }\n    },\n\n\n    /**\n     * collect event data for ionic.Gestures js\n     * @param   {HTMLElement}   element\n     * @param   {String}        eventType        like ionic.Gestures.EVENT_MOVE\n     * @param   {Object}        eventData\n     */\n    collectEventData: function collectEventData(element, eventType, touches, ev) {\n\n      // find out pointerType\n      var pointerType = ionic.Gestures.POINTER_TOUCH;\n      if(ev.type.match(/mouse/) || ionic.Gestures.PointerEvent.matchType(ionic.Gestures.POINTER_MOUSE, ev)) {\n        pointerType = ionic.Gestures.POINTER_MOUSE;\n      }\n\n      return {\n        center: ionic.Gestures.utils.getCenter(touches),\n        timeStamp: new Date().getTime(),\n        target: ev.target,\n        touches: touches,\n        eventType: eventType,\n        pointerType: pointerType,\n        srcEvent: ev,\n\n        /**\n         * prevent the browser default actions\n         * mostly used to disable scrolling of the browser\n         */\n        preventDefault: function() {\n          if(this.srcEvent.preventManipulation) {\n            this.srcEvent.preventManipulation();\n          }\n\n          if(this.srcEvent.preventDefault) {\n            // this.srcEvent.preventDefault();\n          }\n        },\n\n        /**\n         * stop bubbling the event up to its parents\n         */\n        stopPropagation: function() {\n          this.srcEvent.stopPropagation();\n        },\n\n        /**\n         * immediately stop gesture detection\n         * might be useful after a swipe was detected\n         * @return {*}\n         */\n        stopDetect: function() {\n          return ionic.Gestures.detection.stopDetect();\n        }\n      };\n    }\n  };\n\n  ionic.Gestures.PointerEvent = {\n    /**\n     * holds all pointers\n     * type {Object}\n     */\n    pointers: {},\n\n    /**\n     * get a list of pointers\n     * @returns {Array}     touchlist\n     */\n    getTouchList: function() {\n      var self = this;\n      var touchlist = [];\n\n      // we can use forEach since pointerEvents only is in IE10\n      Object.keys(self.pointers).sort().forEach(function(id) {\n        touchlist.push(self.pointers[id]);\n      });\n      return touchlist;\n    },\n\n    /**\n     * update the position of a pointer\n     * @param   {String}   type             ionic.Gestures.EVENT_END\n     * @param   {Object}   pointerEvent\n     */\n    updatePointer: function(type, pointerEvent) {\n      if(type == ionic.Gestures.EVENT_END) {\n        this.pointers = {};\n      }\n      else {\n        pointerEvent.identifier = pointerEvent.pointerId;\n        this.pointers[pointerEvent.pointerId] = pointerEvent;\n      }\n\n      return Object.keys(this.pointers).length;\n    },\n\n    /**\n     * check if ev matches pointertype\n     * @param   {String}        pointerType     ionic.Gestures.POINTER_MOUSE\n     * @param   {PointerEvent}  ev\n     */\n    matchType: function(pointerType, ev) {\n      if(!ev.pointerType) {\n        return false;\n      }\n\n      var types = {};\n      types[ionic.Gestures.POINTER_MOUSE] = (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE || ev.pointerType == ionic.Gestures.POINTER_MOUSE);\n      types[ionic.Gestures.POINTER_TOUCH] = (ev.pointerType == ev.MSPOINTER_TYPE_TOUCH || ev.pointerType == ionic.Gestures.POINTER_TOUCH);\n      types[ionic.Gestures.POINTER_PEN] = (ev.pointerType == ev.MSPOINTER_TYPE_PEN || ev.pointerType == ionic.Gestures.POINTER_PEN);\n      return types[pointerType];\n    },\n\n\n    /**\n     * get events\n     */\n    getEvents: function() {\n      return [\n        'pointerdown MSPointerDown',\n      'pointermove MSPointerMove',\n      'pointerup pointercancel MSPointerUp MSPointerCancel'\n        ];\n    },\n\n    /**\n     * reset the list\n     */\n    reset: function() {\n      this.pointers = {};\n    }\n  };\n\n\n  ionic.Gestures.utils = {\n    /**\n     * extend method,\n     * also used for cloning when dest is an empty object\n     * @param   {Object}    dest\n     * @param   {Object}    src\n     * @param\t{Boolean}\tmerge\t\tdo a merge\n     * @returns {Object}    dest\n     */\n    extend: function extend(dest, src, merge) {\n      for (var key in src) {\n        if(dest[key] !== undefined && merge) {\n          continue;\n        }\n        dest[key] = src[key];\n      }\n      return dest;\n    },\n\n\n    /**\n     * find if a node is in the given parent\n     * used for event delegation tricks\n     * @param   {HTMLElement}   node\n     * @param   {HTMLElement}   parent\n     * @returns {boolean}       has_parent\n     */\n    hasParent: function(node, parent) {\n      while(node){\n        if(node == parent) {\n          return true;\n        }\n        node = node.parentNode;\n      }\n      return false;\n    },\n\n\n    /**\n     * get the center of all the touches\n     * @param   {Array}     touches\n     * @returns {Object}    center\n     */\n    getCenter: function getCenter(touches) {\n      var valuesX = [], valuesY = [];\n\n      for(var t = 0, len = touches.length; t < len; t++) {\n        valuesX.push(touches[t].pageX);\n        valuesY.push(touches[t].pageY);\n      }\n\n      return {\n        pageX: ((Math.min.apply(Math, valuesX) + Math.max.apply(Math, valuesX)) / 2),\n          pageY: ((Math.min.apply(Math, valuesY) + Math.max.apply(Math, valuesY)) / 2)\n      };\n    },\n\n\n    /**\n     * calculate the velocity between two points\n     * @param   {Number}    delta_time\n     * @param   {Number}    delta_x\n     * @param   {Number}    delta_y\n     * @returns {Object}    velocity\n     */\n    getVelocity: function getVelocity(delta_time, delta_x, delta_y) {\n      return {\n        x: Math.abs(delta_x / delta_time) || 0,\n        y: Math.abs(delta_y / delta_time) || 0\n      };\n    },\n\n\n    /**\n     * calculate the angle between two coordinates\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {Number}    angle\n     */\n    getAngle: function getAngle(touch1, touch2) {\n      var y = touch2.pageY - touch1.pageY,\n      x = touch2.pageX - touch1.pageX;\n      return Math.atan2(y, x) * 180 / Math.PI;\n    },\n\n\n    /**\n     * angle to direction define\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {String}    direction constant, like ionic.Gestures.DIRECTION_LEFT\n     */\n    getDirection: function getDirection(touch1, touch2) {\n      var x = Math.abs(touch1.pageX - touch2.pageX),\n      y = Math.abs(touch1.pageY - touch2.pageY);\n\n      if(x >= y) {\n        return touch1.pageX - touch2.pageX > 0 ? ionic.Gestures.DIRECTION_LEFT : ionic.Gestures.DIRECTION_RIGHT;\n      }\n      else {\n        return touch1.pageY - touch2.pageY > 0 ? ionic.Gestures.DIRECTION_UP : ionic.Gestures.DIRECTION_DOWN;\n      }\n    },\n\n\n    /**\n     * calculate the distance between two touches\n     * @param   {Touch}     touch1\n     * @param   {Touch}     touch2\n     * @returns {Number}    distance\n     */\n    getDistance: function getDistance(touch1, touch2) {\n      var x = touch2.pageX - touch1.pageX,\n      y = touch2.pageY - touch1.pageY;\n      return Math.sqrt((x * x) + (y * y));\n    },\n\n\n    /**\n     * calculate the scale factor between two touchLists (fingers)\n     * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n     * @param   {Array}     start\n     * @param   {Array}     end\n     * @returns {Number}    scale\n     */\n    getScale: function getScale(start, end) {\n      // need two fingers...\n      if(start.length >= 2 && end.length >= 2) {\n        return this.getDistance(end[0], end[1]) /\n          this.getDistance(start[0], start[1]);\n      }\n      return 1;\n    },\n\n\n    /**\n     * calculate the rotation degrees between two touchLists (fingers)\n     * @param   {Array}     start\n     * @param   {Array}     end\n     * @returns {Number}    rotation\n     */\n    getRotation: function getRotation(start, end) {\n      // need two fingers\n      if(start.length >= 2 && end.length >= 2) {\n        return this.getAngle(end[1], end[0]) -\n          this.getAngle(start[1], start[0]);\n      }\n      return 0;\n    },\n\n\n    /**\n     * boolean if the direction is vertical\n     * @param    {String}    direction\n     * @returns  {Boolean}   is_vertical\n     */\n    isVertical: function isVertical(direction) {\n      return (direction == ionic.Gestures.DIRECTION_UP || direction == ionic.Gestures.DIRECTION_DOWN);\n    },\n\n\n    /**\n     * stop browser default behavior with css class\n     * @param   {HtmlElement}   element\n     * @param   {Object}        css_class\n     */\n    stopDefaultBrowserBehavior: function stopDefaultBrowserBehavior(element, css_class) {\n      // changed from making many style changes to just adding a preset classname\n      // less DOM manipulations, less code, and easier to control in the CSS side of things\n      // hammer.js doesn't come with CSS, but ionic does, which is why we prefer this method\n      if(element && element.classList) {\n        element.classList.add(css_class);\n        element.onselectstart = function() {\n          return false;\n        };\n      }\n    }\n  };\n\n\n  ionic.Gestures.detection = {\n    // contains all registred ionic.Gestures.gestures in the correct order\n    gestures: [],\n\n    // data of the current ionic.Gestures.gesture detection session\n    current: null,\n\n    // the previous ionic.Gestures.gesture session data\n    // is a full clone of the previous gesture.current object\n    previous: null,\n\n    // when this becomes true, no gestures are fired\n    stopped: false,\n\n\n    /**\n     * start ionic.Gestures.gesture detection\n     * @param   {ionic.Gestures.Instance}   inst\n     * @param   {Object}            eventData\n     */\n    startDetect: function startDetect(inst, eventData) {\n      // already busy with a ionic.Gestures.gesture detection on an element\n      if(this.current) {\n        return;\n      }\n\n      this.stopped = false;\n\n      this.current = {\n        inst: inst, // reference to ionic.GesturesInstance we're working for\n        startEvent: ionic.Gestures.utils.extend({}, eventData), // start eventData for distances, timing etc\n        lastEvent: false, // last eventData\n        name: '' // current gesture we're in/detected, can be 'tap', 'hold' etc\n      };\n\n      this.detect(eventData);\n    },\n\n\n    /**\n     * ionic.Gestures.gesture detection\n     * @param   {Object}    eventData\n     */\n    detect: function detect(eventData) {\n      if(!this.current || this.stopped) {\n        return null;\n      }\n\n      // extend event data with calculations about scale, distance etc\n      eventData = this.extendEventData(eventData);\n\n      // instance options\n      var inst_options = this.current.inst.options;\n\n      // call ionic.Gestures.gesture handlers\n      for(var g = 0, len = this.gestures.length; g < len; g++) {\n        var gesture = this.gestures[g];\n\n        // only when the instance options have enabled this gesture\n        if(!this.stopped && inst_options[gesture.name] !== false) {\n          // if a handler returns false, we stop with the detection\n          if(gesture.handler.call(gesture, eventData, this.current.inst) === false) {\n            this.stopDetect();\n            break;\n          }\n        }\n      }\n\n      // store as previous event event\n      if(this.current) {\n        this.current.lastEvent = eventData;\n      }\n\n      // endevent, but not the last touch, so dont stop\n      if(eventData.eventType == ionic.Gestures.EVENT_END && !eventData.touches.length - 1) {\n        this.stopDetect();\n      }\n\n      return eventData;\n    },\n\n\n    /**\n     * clear the ionic.Gestures.gesture vars\n     * this is called on endDetect, but can also be used when a final ionic.Gestures.gesture has been detected\n     * to stop other ionic.Gestures.gestures from being fired\n     */\n    stopDetect: function stopDetect() {\n      // clone current data to the store as the previous gesture\n      // used for the double tap gesture, since this is an other gesture detect session\n      this.previous = ionic.Gestures.utils.extend({}, this.current);\n\n      // reset the current\n      this.current = null;\n\n      // stopped!\n      this.stopped = true;\n    },\n\n\n    /**\n     * extend eventData for ionic.Gestures.gestures\n     * @param   {Object}   ev\n     * @returns {Object}   ev\n     */\n    extendEventData: function extendEventData(ev) {\n      var startEv = this.current.startEvent;\n\n      // if the touches change, set the new touches over the startEvent touches\n      // this because touchevents don't have all the touches on touchstart, or the\n      // user must place his fingers at the EXACT same time on the screen, which is not realistic\n      // but, sometimes it happens that both fingers are touching at the EXACT same time\n      if(startEv && (ev.touches.length != startEv.touches.length || ev.touches === startEv.touches)) {\n        // extend 1 level deep to get the touchlist with the touch objects\n        startEv.touches = [];\n        for(var i = 0, len = ev.touches.length; i < len; i++) {\n          startEv.touches.push(ionic.Gestures.utils.extend({}, ev.touches[i]));\n        }\n      }\n\n      var delta_time = ev.timeStamp - startEv.timeStamp,\n          delta_x = ev.center.pageX - startEv.center.pageX,\n          delta_y = ev.center.pageY - startEv.center.pageY,\n          velocity = ionic.Gestures.utils.getVelocity(delta_time, delta_x, delta_y);\n\n      ionic.Gestures.utils.extend(ev, {\n        deltaTime: delta_time,\n        deltaX: delta_x,\n        deltaY: delta_y,\n\n        velocityX: velocity.x,\n        velocityY: velocity.y,\n\n        distance: ionic.Gestures.utils.getDistance(startEv.center, ev.center),\n        angle: ionic.Gestures.utils.getAngle(startEv.center, ev.center),\n        direction: ionic.Gestures.utils.getDirection(startEv.center, ev.center),\n\n        scale: ionic.Gestures.utils.getScale(startEv.touches, ev.touches),\n        rotation: ionic.Gestures.utils.getRotation(startEv.touches, ev.touches),\n\n        startEvent: startEv\n      });\n\n      return ev;\n    },\n\n\n    /**\n     * register new gesture\n     * @param   {Object}    gesture object, see gestures.js for documentation\n     * @returns {Array}     gestures\n     */\n    register: function register(gesture) {\n      // add an enable gesture options if there is no given\n      var options = gesture.defaults || {};\n      if(options[gesture.name] === undefined) {\n        options[gesture.name] = true;\n      }\n\n      // extend ionic.Gestures default options with the ionic.Gestures.gesture options\n      ionic.Gestures.utils.extend(ionic.Gestures.defaults, options, true);\n\n      // set its index\n      gesture.index = gesture.index || 1000;\n\n      // add ionic.Gestures.gesture to the list\n      this.gestures.push(gesture);\n\n      // sort the list by index\n      this.gestures.sort(function(a, b) {\n        if (a.index < b.index) {\n          return -1;\n        }\n        if (a.index > b.index) {\n          return 1;\n        }\n        return 0;\n      });\n\n      return this.gestures;\n    }\n  };\n\n\n  ionic.Gestures.gestures = ionic.Gestures.gestures || {};\n\n  /**\n   * Custom gestures\n   * ==============================\n   *\n   * Gesture object\n   * --------------------\n   * The object structure of a gesture:\n   *\n   * { name: 'mygesture',\n   *   index: 1337,\n   *   defaults: {\n   *     mygesture_option: true\n   *   }\n   *   handler: function(type, ev, inst) {\n   *     // trigger gesture event\n   *     inst.trigger(this.name, ev);\n   *   }\n   * }\n\n   * @param   {String}    name\n   * this should be the name of the gesture, lowercase\n   * it is also being used to disable/enable the gesture per instance config.\n   *\n   * @param   {Number}    [index=1000]\n   * the index of the gesture, where it is going to be in the stack of gestures detection\n   * like when you build an gesture that depends on the drag gesture, it is a good\n   * idea to place it after the index of the drag gesture.\n   *\n   * @param   {Object}    [defaults={}]\n   * the default settings of the gesture. these are added to the instance settings,\n   * and can be overruled per instance. you can also add the name of the gesture,\n   * but this is also added by default (and set to true).\n   *\n   * @param   {Function}  handler\n   * this handles the gesture detection of your custom gesture and receives the\n   * following arguments:\n   *\n   *      @param  {Object}    eventData\n   *      event data containing the following properties:\n   *          timeStamp   {Number}        time the event occurred\n   *          target      {HTMLElement}   target element\n   *          touches     {Array}         touches (fingers, pointers, mouse) on the screen\n   *          pointerType {String}        kind of pointer that was used. matches ionic.Gestures.POINTER_MOUSE|TOUCH\n   *          center      {Object}        center position of the touches. contains pageX and pageY\n   *          deltaTime   {Number}        the total time of the touches in the screen\n   *          deltaX      {Number}        the delta on x axis we haved moved\n   *          deltaY      {Number}        the delta on y axis we haved moved\n   *          velocityX   {Number}        the velocity on the x\n   *          velocityY   {Number}        the velocity on y\n   *          angle       {Number}        the angle we are moving\n   *          direction   {String}        the direction we are moving. matches ionic.Gestures.DIRECTION_UP|DOWN|LEFT|RIGHT\n   *          distance    {Number}        the distance we haved moved\n   *          scale       {Number}        scaling of the touches, needs 2 touches\n   *          rotation    {Number}        rotation of the touches, needs 2 touches *\n   *          eventType   {String}        matches ionic.Gestures.EVENT_START|MOVE|END\n   *          srcEvent    {Object}        the source event, like TouchStart or MouseDown *\n   *          startEvent  {Object}        contains the same properties as above,\n   *                                      but from the first touch. this is used to calculate\n   *                                      distances, deltaTime, scaling etc\n   *\n   *      @param  {ionic.Gestures.Instance}    inst\n   *      the instance we are doing the detection for. you can get the options from\n   *      the inst.options object and trigger the gesture event by calling inst.trigger\n   *\n   *\n   * Handle gestures\n   * --------------------\n   * inside the handler you can get/set ionic.Gestures.detectionic.current. This is the current\n   * detection sessionic. It has the following properties\n   *      @param  {String}    name\n   *      contains the name of the gesture we have detected. it has not a real function,\n   *      only to check in other gestures if something is detected.\n   *      like in the drag gesture we set it to 'drag' and in the swipe gesture we can\n   *      check if the current gesture is 'drag' by accessing ionic.Gestures.detectionic.current.name\n   *\n   *      readonly\n   *      @param  {ionic.Gestures.Instance}    inst\n   *      the instance we do the detection for\n   *\n   *      readonly\n   *      @param  {Object}    startEvent\n   *      contains the properties of the first gesture detection in this sessionic.\n   *      Used for calculations about timing, distance, etc.\n   *\n   *      readonly\n   *      @param  {Object}    lastEvent\n   *      contains all the properties of the last gesture detect in this sessionic.\n   *\n   * after the gesture detection session has been completed (user has released the screen)\n   * the ionic.Gestures.detectionic.current object is copied into ionic.Gestures.detectionic.previous,\n   * this is usefull for gestures like doubletap, where you need to know if the\n   * previous gesture was a tap\n   *\n   * options that have been set by the instance can be received by calling inst.options\n   *\n   * You can trigger a gesture event by calling inst.trigger(\"mygesture\", event).\n   * The first param is the name of your gesture, the second the event argument\n   *\n   *\n   * Register gestures\n   * --------------------\n   * When an gesture is added to the ionic.Gestures.gestures object, it is auto registered\n   * at the setup of the first ionic.Gestures instance. You can also call ionic.Gestures.detectionic.register\n   * manually and pass your gesture object as a param\n   *\n   */\n\n  /**\n   * Hold\n   * Touch stays at the same place for x time\n   * events  hold\n   */\n  ionic.Gestures.gestures.Hold = {\n    name: 'hold',\n    index: 10,\n    defaults: {\n      hold_timeout: 500,\n      hold_threshold: 1\n    },\n    timer: null,\n    handler: function holdGesture(ev, inst) {\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          // clear any running timers\n          clearTimeout(this.timer);\n\n          // set the gesture so we can check in the timeout if it still is\n          ionic.Gestures.detection.current.name = this.name;\n\n          // set timer and if after the timeout it still is hold,\n          // we trigger the hold event\n          this.timer = setTimeout(function() {\n            if(ionic.Gestures.detection.current.name == 'hold') {\n              ionic.tap.cancelClick();\n              inst.trigger('hold', ev);\n            }\n          }, inst.options.hold_timeout);\n          break;\n\n          // when you move or end we clear the timer\n        case ionic.Gestures.EVENT_MOVE:\n          if(ev.distance > inst.options.hold_threshold) {\n            clearTimeout(this.timer);\n          }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          clearTimeout(this.timer);\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Tap/DoubleTap\n   * Quick touch at a place or double at the same place\n   * events  tap, doubletap\n   */\n  ionic.Gestures.gestures.Tap = {\n    name: 'tap',\n    index: 100,\n    defaults: {\n      tap_max_touchtime: 250,\n      tap_max_distance: 10,\n      tap_always: true,\n      doubletap_distance: 20,\n      doubletap_interval: 300\n    },\n    handler: function tapGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END && ev.srcEvent.type != 'touchcancel') {\n        // previous gesture, for the double tap since these are two different gesture detections\n        var prev = ionic.Gestures.detection.previous,\n        did_doubletap = false;\n\n        // when the touchtime is higher then the max touch time\n        // or when the moving distance is too much\n        if(ev.deltaTime > inst.options.tap_max_touchtime ||\n            ev.distance > inst.options.tap_max_distance) {\n              return;\n            }\n\n        // check if double tap\n        if(prev && prev.name == 'tap' &&\n            (ev.timeStamp - prev.lastEvent.timeStamp) < inst.options.doubletap_interval &&\n            ev.distance < inst.options.doubletap_distance) {\n              inst.trigger('doubletap', ev);\n              did_doubletap = true;\n            }\n\n        // do a single tap\n        if(!did_doubletap || inst.options.tap_always) {\n          ionic.Gestures.detection.current.name = 'tap';\n          inst.trigger('tap', ev);\n        }\n      }\n    }\n  };\n\n\n  /**\n   * Swipe\n   * triggers swipe events when the end velocity is above the threshold\n   * events  swipe, swipeleft, swiperight, swipeup, swipedown\n   */\n  ionic.Gestures.gestures.Swipe = {\n    name: 'swipe',\n    index: 40,\n    defaults: {\n      // set 0 for unlimited, but this can conflict with transform\n      swipe_max_touches: 1,\n      swipe_velocity: 0.4\n    },\n    handler: function swipeGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END) {\n        // max touches\n        if(inst.options.swipe_max_touches > 0 &&\n            ev.touches.length > inst.options.swipe_max_touches) {\n              return;\n            }\n\n        // when the distance we moved is too small we skip this gesture\n        // or we can be already in dragging\n        if(ev.velocityX > inst.options.swipe_velocity ||\n            ev.velocityY > inst.options.swipe_velocity) {\n              // trigger swipe events\n              inst.trigger(this.name, ev);\n              inst.trigger(this.name + ev.direction, ev);\n            }\n      }\n    }\n  };\n\n\n  /**\n   * Drag\n   * Move with x fingers (default 1) around on the page. Blocking the scrolling when\n   * moving left and right is a good practice. When all the drag events are blocking\n   * you disable scrolling on that area.\n   * events  drag, drapleft, dragright, dragup, dragdown\n   */\n  ionic.Gestures.gestures.Drag = {\n    name: 'drag',\n    index: 50,\n    defaults: {\n      drag_min_distance: 10,\n      // Set correct_for_drag_min_distance to true to make the starting point of the drag\n      // be calculated from where the drag was triggered, not from where the touch started.\n      // Useful to avoid a jerk-starting drag, which can make fine-adjustments\n      // through dragging difficult, and be visually unappealing.\n      correct_for_drag_min_distance: true,\n      // set 0 for unlimited, but this can conflict with transform\n      drag_max_touches: 1,\n      // prevent default browser behavior when dragging occurs\n      // be careful with it, it makes the element a blocking element\n      // when you are using the drag gesture, it is a good practice to set this true\n      drag_block_horizontal: true,\n      drag_block_vertical: true,\n      // drag_lock_to_axis keeps the drag gesture on the axis that it started on,\n      // It disallows vertical directions if the initial direction was horizontal, and vice versa.\n      drag_lock_to_axis: false,\n      // drag lock only kicks in when distance > drag_lock_min_distance\n      // This way, locking occurs only when the distance has become large enough to reliably determine the direction\n      drag_lock_min_distance: 25,\n      // prevent default if the gesture is going the given direction\n      prevent_default_directions: []\n    },\n    triggered: false,\n    handler: function dragGesture(ev, inst) {\n      if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {\n        this.preventedFirstMove = false;\n\n      } else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {\n        if (inst.options.prevent_default_directions.indexOf(ev.direction) != -1) {\n          ev.srcEvent.preventDefault();\n        }\n        this.preventedFirstMove = true;\n      }\n\n      // current gesture isnt drag, but dragged is true\n      // this means an other gesture is busy. now call dragend\n      if(ionic.Gestures.detection.current.name != this.name && this.triggered) {\n        inst.trigger(this.name + 'end', ev);\n        this.triggered = false;\n        return;\n      }\n\n      // max touches\n      if(inst.options.drag_max_touches > 0 &&\n          ev.touches.length > inst.options.drag_max_touches) {\n            return;\n          }\n\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          this.triggered = false;\n          break;\n\n        case ionic.Gestures.EVENT_MOVE:\n          // when the distance we moved is too small we skip this gesture\n          // or we can be already in dragging\n          if(ev.distance < inst.options.drag_min_distance &&\n              ionic.Gestures.detection.current.name != this.name) {\n                return;\n              }\n\n          // we are dragging!\n          if(ionic.Gestures.detection.current.name != this.name) {\n            ionic.Gestures.detection.current.name = this.name;\n            if (inst.options.correct_for_drag_min_distance) {\n              // When a drag is triggered, set the event center to drag_min_distance pixels from the original event center.\n              // Without this correction, the dragged distance would jumpstart at drag_min_distance pixels instead of at 0.\n              // It might be useful to save the original start point somewhere\n              var factor = Math.abs(inst.options.drag_min_distance / ev.distance);\n              ionic.Gestures.detection.current.startEvent.center.pageX += ev.deltaX * factor;\n              ionic.Gestures.detection.current.startEvent.center.pageY += ev.deltaY * factor;\n\n              // recalculate event data using new start point\n              ev = ionic.Gestures.detection.extendEventData(ev);\n            }\n          }\n\n          // lock drag to axis?\n          if(ionic.Gestures.detection.current.lastEvent.drag_locked_to_axis || (inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance <= ev.distance)) {\n            ev.drag_locked_to_axis = true;\n          }\n          var last_direction = ionic.Gestures.detection.current.lastEvent.direction;\n          if(ev.drag_locked_to_axis && last_direction !== ev.direction) {\n            // keep direction on the axis that the drag gesture started on\n            if(ionic.Gestures.utils.isVertical(last_direction)) {\n              ev.direction = (ev.deltaY < 0) ? ionic.Gestures.DIRECTION_UP : ionic.Gestures.DIRECTION_DOWN;\n            }\n            else {\n              ev.direction = (ev.deltaX < 0) ? ionic.Gestures.DIRECTION_LEFT : ionic.Gestures.DIRECTION_RIGHT;\n            }\n          }\n\n          // first time, trigger dragstart event\n          if(!this.triggered) {\n            inst.trigger(this.name + 'start', ev);\n            this.triggered = true;\n          }\n\n          // trigger normal event\n          inst.trigger(this.name, ev);\n\n          // direction event, like dragdown\n          inst.trigger(this.name + ev.direction, ev);\n\n          // block the browser events\n          if( (inst.options.drag_block_vertical && ionic.Gestures.utils.isVertical(ev.direction)) ||\n              (inst.options.drag_block_horizontal && !ionic.Gestures.utils.isVertical(ev.direction))) {\n                ev.preventDefault();\n              }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          // trigger dragend\n          if(this.triggered) {\n            inst.trigger(this.name + 'end', ev);\n          }\n\n          this.triggered = false;\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Transform\n   * User want to scale or rotate with 2 fingers\n   * events  transform, pinch, pinchin, pinchout, rotate\n   */\n  ionic.Gestures.gestures.Transform = {\n    name: 'transform',\n    index: 45,\n    defaults: {\n      // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1\n      transform_min_scale: 0.01,\n      // rotation in degrees\n      transform_min_rotation: 1,\n      // prevent default browser behavior when two touches are on the screen\n      // but it makes the element a blocking element\n      // when you are using the transform gesture, it is a good practice to set this true\n      transform_always_block: false\n    },\n    triggered: false,\n    handler: function transformGesture(ev, inst) {\n      // current gesture isnt drag, but dragged is true\n      // this means an other gesture is busy. now call dragend\n      if(ionic.Gestures.detection.current.name != this.name && this.triggered) {\n        inst.trigger(this.name + 'end', ev);\n        this.triggered = false;\n        return;\n      }\n\n      // atleast multitouch\n      if(ev.touches.length < 2) {\n        return;\n      }\n\n      // prevent default when two fingers are on the screen\n      if(inst.options.transform_always_block) {\n        ev.preventDefault();\n      }\n\n      switch(ev.eventType) {\n        case ionic.Gestures.EVENT_START:\n          this.triggered = false;\n          break;\n\n        case ionic.Gestures.EVENT_MOVE:\n          var scale_threshold = Math.abs(1 - ev.scale);\n          var rotation_threshold = Math.abs(ev.rotation);\n\n          // when the distance we moved is too small we skip this gesture\n          // or we can be already in dragging\n          if(scale_threshold < inst.options.transform_min_scale &&\n              rotation_threshold < inst.options.transform_min_rotation) {\n                return;\n              }\n\n          // we are transforming!\n          ionic.Gestures.detection.current.name = this.name;\n\n          // first time, trigger dragstart event\n          if(!this.triggered) {\n            inst.trigger(this.name + 'start', ev);\n            this.triggered = true;\n          }\n\n          inst.trigger(this.name, ev); // basic transform event\n\n          // trigger rotate event\n          if(rotation_threshold > inst.options.transform_min_rotation) {\n            inst.trigger('rotate', ev);\n          }\n\n          // trigger pinch event\n          if(scale_threshold > inst.options.transform_min_scale) {\n            inst.trigger('pinch', ev);\n            inst.trigger('pinch' + ((ev.scale < 1) ? 'in' : 'out'), ev);\n          }\n          break;\n\n        case ionic.Gestures.EVENT_END:\n          // trigger dragend\n          if(this.triggered) {\n            inst.trigger(this.name + 'end', ev);\n          }\n\n          this.triggered = false;\n          break;\n      }\n    }\n  };\n\n\n  /**\n   * Touch\n   * Called as first, tells the user has touched the screen\n   * events  touch\n   */\n  ionic.Gestures.gestures.Touch = {\n    name: 'touch',\n    index: -Infinity,\n    defaults: {\n      // call preventDefault at touchstart, and makes the element blocking by\n      // disabling the scrolling of the page, but it improves gestures like\n      // transforming and dragging.\n      // be careful with using this, it can be very annoying for users to be stuck\n      // on the page\n      prevent_default: false,\n\n      // disable mouse events, so only touch (or pen!) input triggers events\n      prevent_mouseevents: false\n    },\n    handler: function touchGesture(ev, inst) {\n      if(inst.options.prevent_mouseevents && ev.pointerType == ionic.Gestures.POINTER_MOUSE) {\n        ev.stopDetect();\n        return;\n      }\n\n      if(inst.options.prevent_default) {\n        ev.preventDefault();\n      }\n\n      if(ev.eventType == ionic.Gestures.EVENT_START) {\n        inst.trigger(this.name, ev);\n      }\n    }\n  };\n\n\n  /**\n   * Release\n   * Called as last, tells the user has released the screen\n   * events  release\n   */\n  ionic.Gestures.gestures.Release = {\n    name: 'release',\n    index: Infinity,\n    handler: function releaseGesture(ev, inst) {\n      if(ev.eventType == ionic.Gestures.EVENT_END) {\n        inst.trigger(this.name, ev);\n      }\n    }\n  };\n})(window.ionic);\n\n(function(window, document, ionic) {\n\n  function getParameterByName(name) {\n    name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n    var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n    results = regex.exec(location.search);\n    return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n  }\n\n  var IOS = 'ios';\n  var ANDROID = 'android';\n  var WINDOWS_PHONE = 'windowsphone';\n  var requestAnimationFrame = ionic.requestAnimationFrame;\n\n  /**\n   * @ngdoc utility\n   * @name ionic.Platform\n   * @module ionic\n   * @description\n   * A set of utility methods that can be used to retrieve the device ready state and\n   * various other information such as what kind of platform the app is currently installed on.\n   *\n   * @usage\n   * ```js\n   * angular.module('PlatformApp', ['ionic'])\n   * .controller('PlatformCtrl', function($scope) {\n   *\n   *   ionic.Platform.ready(function(){\n   *     // will execute when device is ready, or immediately if the device is already ready.\n   *   });\n   *\n   *   var deviceInformation = ionic.Platform.device();\n   *\n   *   var isWebView = ionic.Platform.isWebView();\n   *   var isIPad = ionic.Platform.isIPad();\n   *   var isIOS = ionic.Platform.isIOS();\n   *   var isAndroid = ionic.Platform.isAndroid();\n   *   var isWindowsPhone = ionic.Platform.isWindowsPhone();\n   *\n   *   var currentPlatform = ionic.Platform.platform();\n   *   var currentPlatformVersion = ionic.Platform.version();\n   *\n   *   ionic.Platform.exitApp(); // stops the app\n   * });\n   * ```\n   */\n  var self = ionic.Platform = {\n\n    // Put navigator on platform so it can be mocked and set\n    // the browser does not allow window.navigator to be set\n    navigator: window.navigator,\n\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#isReady\n     * @returns {boolean} Whether the device is ready.\n     */\n    isReady: false,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#isFullScreen\n     * @returns {boolean} Whether the device is fullscreen.\n     */\n    isFullScreen: false,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#platforms\n     * @returns {Array(string)} An array of all platforms found.\n     */\n    platforms: null,\n    /**\n     * @ngdoc property\n     * @name ionic.Platform#grade\n     * @returns {string} What grade the current platform is.\n     */\n    grade: null,\n    ua: navigator.userAgent,\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#ready\n     * @description\n     * Trigger a callback once the device is ready, or immediately\n     * if the device is already ready. This method can be run from\n     * anywhere and does not need to be wrapped by any additonal methods.\n     * When the app is within a WebView (Cordova), it'll fire\n     * the callback once the device is ready. If the app is within\n     * a web browser, it'll fire the callback after `window.load`.\n     * Please remember that Cordova features (Camera, FileSystem, etc) still\n     * will not work in a web browser.\n     * @param {function} callback The function to call.\n     */\n    ready: function(cb) {\n      // run through tasks to complete now that the device is ready\n      if (self.isReady) {\n        cb();\n      } else {\n        // the platform isn't ready yet, add it to this array\n        // which will be called once the platform is ready\n        readyCallbacks.push(cb);\n      }\n    },\n\n    /**\n     * @private\n     */\n    detect: function() {\n      self._checkPlatforms();\n\n      requestAnimationFrame(function() {\n        // only add to the body class if we got platform info\n        for (var i = 0; i < self.platforms.length; i++) {\n          document.body.classList.add('platform-' + self.platforms[i]);\n        }\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#setGrade\n     * @description Set the grade of the device: 'a', 'b', or 'c'. 'a' is the best\n     * (most css features enabled), 'c' is the worst.  By default, sets the grade\n     * depending on the current device.\n     * @param {string} grade The new grade to set.\n     */\n    setGrade: function(grade) {\n      var oldGrade = self.grade;\n      self.grade = grade;\n      requestAnimationFrame(function() {\n        if (oldGrade) {\n          document.body.classList.remove('grade-' + oldGrade);\n        }\n        document.body.classList.add('grade-' + grade);\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#device\n     * @description Return the current device (given by cordova).\n     * @returns {object} The device object.\n     */\n    device: function() {\n      return window.device || {};\n    },\n\n    _checkPlatforms: function() {\n      self.platforms = [];\n      var grade = 'a';\n\n      if (self.isWebView()) {\n        self.platforms.push('webview');\n        if (!(!window.cordova && !window.PhoneGap && !window.phonegap)) {\n          self.platforms.push('cordova');\n        } else if (window.forge) {\n          self.platforms.push('trigger');\n        }\n      } else {\n        self.platforms.push('browser');\n      }\n      if (self.isIPad()) self.platforms.push('ipad');\n\n      var platform = self.platform();\n      if (platform) {\n        self.platforms.push(platform);\n\n        var version = self.version();\n        if (version) {\n          var v = version.toString();\n          if (v.indexOf('.') > 0) {\n            v = v.replace('.', '_');\n          } else {\n            v += '_0';\n          }\n          self.platforms.push(platform + v.split('_')[0]);\n          self.platforms.push(platform + v);\n\n          if (self.isAndroid() && version < 4.4) {\n            grade = (version < 4 ? 'c' : 'b');\n          } else if (self.isWindowsPhone()) {\n            grade = 'b';\n          }\n        }\n      }\n\n      self.setGrade(grade);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isWebView\n     * @returns {boolean} Check if we are running within a WebView (such as Cordova).\n     */\n    isWebView: function() {\n      return !(!window.cordova && !window.PhoneGap && !window.phonegap && !window.forge);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isIPad\n     * @returns {boolean} Whether we are running on iPad.\n     */\n    isIPad: function() {\n      if (/iPad/i.test(self.navigator.platform)) {\n        return true;\n      }\n      return /iPad/i.test(self.ua);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isIOS\n     * @returns {boolean} Whether we are running on iOS.\n     */\n    isIOS: function() {\n      return self.is(IOS);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isAndroid\n     * @returns {boolean} Whether we are running on Android.\n     */\n    isAndroid: function() {\n      return self.is(ANDROID);\n    },\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#isWindowsPhone\n     * @returns {boolean} Whether we are running on Windows Phone.\n     */\n    isWindowsPhone: function() {\n      return self.is(WINDOWS_PHONE);\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#platform\n     * @returns {string} The name of the current platform.\n     */\n    platform: function() {\n      // singleton to get the platform name\n      if (platformName === null) self.setPlatform(self.device().platform);\n      return platformName;\n    },\n\n    /**\n     * @private\n     */\n    setPlatform: function(n) {\n      if (typeof n != 'undefined' && n !== null && n.length) {\n        platformName = n.toLowerCase();\n      } else if (getParameterByName('ionicplatform')) {\n        platformName = getParameterByName('ionicplatform');\n      } else if (self.ua.indexOf('Android') > 0) {\n        platformName = ANDROID;\n      } else if (/iPhone|iPad|iPod/.test(self.ua)) {\n        platformName = IOS;\n      } else if (self.ua.indexOf('Windows Phone') > -1) {\n        platformName = WINDOWS_PHONE;\n      } else {\n        platformName = self.navigator.platform && navigator.platform.toLowerCase().split(' ')[0] || '';\n      }\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#version\n     * @returns {number} The version of the current device platform.\n     */\n    version: function() {\n      // singleton to get the platform version\n      if (platformVersion === null) self.setVersion(self.device().version);\n      return platformVersion;\n    },\n\n    /**\n     * @private\n     */\n    setVersion: function(v) {\n      if (typeof v != 'undefined' && v !== null) {\n        v = v.split('.');\n        v = parseFloat(v[0] + '.' + (v.length > 1 ? v[1] : 0));\n        if (!isNaN(v)) {\n          platformVersion = v;\n          return;\n        }\n      }\n\n      platformVersion = 0;\n\n      // fallback to user-agent checking\n      var pName = self.platform();\n      var versionMatch = {\n        'android': /Android (\\d+).(\\d+)?/,\n        'ios': /OS (\\d+)_(\\d+)?/,\n        'windowsphone': /Windows Phone (\\d+).(\\d+)?/\n      };\n      if (versionMatch[pName]) {\n        v = self.ua.match(versionMatch[pName]);\n        if (v && v.length > 2) {\n          platformVersion = parseFloat(v[1] + '.' + v[2]);\n        }\n      }\n    },\n\n    // Check if the platform is the one detected by cordova\n    is: function(type) {\n      type = type.toLowerCase();\n      // check if it has an array of platforms\n      if (self.platforms) {\n        for (var x = 0; x < self.platforms.length; x++) {\n          if (self.platforms[x] === type) return true;\n        }\n      }\n      // exact match\n      var pName = self.platform();\n      if (pName) {\n        return pName === type.toLowerCase();\n      }\n\n      // A quick hack for to check userAgent\n      return self.ua.toLowerCase().indexOf(type) >= 0;\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#exitApp\n     * @description Exit the app.\n     */\n    exitApp: function() {\n      self.ready(function() {\n        navigator.app && navigator.app.exitApp && navigator.app.exitApp();\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#showStatusBar\n     * @description Shows or hides the device status bar (in Cordova). Requires `cordova plugin add org.apache.cordova.statusbar`\n     * @param {boolean} shouldShow Whether or not to show the status bar.\n     */\n    showStatusBar: function(val) {\n      // Only useful when run within cordova\n      self._showStatusBar = val;\n      self.ready(function() {\n        // run this only when or if the platform (cordova) is ready\n        requestAnimationFrame(function() {\n          if (self._showStatusBar) {\n            // they do not want it to be full screen\n            window.StatusBar && window.StatusBar.show();\n            document.body.classList.remove('status-bar-hide');\n          } else {\n            // it should be full screen\n            window.StatusBar && window.StatusBar.hide();\n            document.body.classList.add('status-bar-hide');\n          }\n        });\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name ionic.Platform#fullScreen\n     * @description\n     * Sets whether the app is fullscreen or not (in Cordova).\n     * @param {boolean=} showFullScreen Whether or not to set the app to fullscreen. Defaults to true. Requires `cordova plugin add org.apache.cordova.statusbar`\n     * @param {boolean=} showStatusBar Whether or not to show the device's status bar. Defaults to false.\n     */\n    fullScreen: function(showFullScreen, showStatusBar) {\n      // showFullScreen: default is true if no param provided\n      self.isFullScreen = (showFullScreen !== false);\n\n      // add/remove the fullscreen classname to the body\n      ionic.DomUtil.ready(function() {\n        // run this only when or if the DOM is ready\n        requestAnimationFrame(function() {\n          if (self.isFullScreen) {\n            document.body.classList.add('fullscreen');\n          } else {\n            document.body.classList.remove('fullscreen');\n          }\n        });\n        // showStatusBar: default is false if no param provided\n        self.showStatusBar((showStatusBar === true));\n      });\n    }\n\n  };\n\n  var platformName = null, // just the name, like iOS or Android\n  platformVersion = null, // a float of the major and minor, like 7.1\n  readyCallbacks = [],\n  windowLoadListenderAttached;\n\n  // setup listeners to know when the device is ready to go\n  function onWindowLoad() {\n    if (self.isWebView()) {\n      // the window and scripts are fully loaded, and a cordova/phonegap\n      // object exists then let's listen for the deviceready\n      document.addEventListener(\"deviceready\", onPlatformReady, false);\n    } else {\n      // the window and scripts are fully loaded, but the window object doesn't have the\n      // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n      onPlatformReady();\n    }\n    if (windowLoadListenderAttached) {\n      window.removeEventListener(\"load\", onWindowLoad, false);\n    }\n  }\n  if (document.readyState === 'complete') {\n    onWindowLoad();\n  } else {\n    windowLoadListenderAttached = true;\n    window.addEventListener(\"load\", onWindowLoad, false);\n  }\n\n  function onPlatformReady() {\n    // the device is all set to go, init our own stuff then fire off our event\n    self.isReady = true;\n    self.detect();\n    for (var x = 0; x < readyCallbacks.length; x++) {\n      // fire off all the callbacks that were added before the platform was ready\n      readyCallbacks[x]();\n    }\n    readyCallbacks = [];\n    ionic.trigger('platformready', { target: document });\n\n    requestAnimationFrame(function() {\n      document.body.classList.add('platform-ready');\n    });\n  }\n\n})(this, document, ionic);\n\n(function(document, ionic) {\n  'use strict';\n\n  // Ionic CSS polyfills\n  ionic.CSS = {};\n\n  (function() {\n\n    // transform\n    var i, keys = ['webkitTransform', 'transform', '-webkit-transform', 'webkit-transform',\n                   '-moz-transform', 'moz-transform', 'MozTransform', 'mozTransform', 'msTransform'];\n\n    for (i = 0; i < keys.length; i++) {\n      if (document.documentElement.style[keys[i]] !== undefined) {\n        ionic.CSS.TRANSFORM = keys[i];\n        break;\n      }\n    }\n\n    // transition\n    keys = ['webkitTransition', 'mozTransition', 'msTransition', 'transition'];\n    for (i = 0; i < keys.length; i++) {\n      if (document.documentElement.style[keys[i]] !== undefined) {\n        ionic.CSS.TRANSITION = keys[i];\n        break;\n      }\n    }\n\n    // The only prefix we care about is webkit for transitions.\n    var isWebkit = ionic.CSS.TRANSITION.indexOf('webkit') > -1;\n\n    // transition duration\n    ionic.CSS.TRANSITION_DURATION = (isWebkit ? '-webkit-' : '') + 'transition-duration';\n\n    // To be sure transitionend works everywhere, include *both* the webkit and non-webkit events\n    ionic.CSS.TRANSITIONEND = (isWebkit ? 'webkitTransitionEnd ' : '') + 'transitionend';\n  })();\n\n  // classList polyfill for them older Androids\n  // https://gist.github.com/devongovett/1381839\n  if (!(\"classList\" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {\n    Object.defineProperty(HTMLElement.prototype, 'classList', {\n      get: function() {\n        var self = this;\n        function update(fn) {\n          return function() {\n            var x, classes = self.className.split(/\\s+/);\n\n            for (x = 0; x < arguments.length; x++) {\n              fn(classes, classes.indexOf(arguments[x]), arguments[x]);\n            }\n\n            self.className = classes.join(\" \");\n          };\n        }\n\n        return {\n          add: update(function(classes, index, value) {\n            ~index || classes.push(value);\n          }),\n\n          remove: update(function(classes, index) {\n            ~index && classes.splice(index, 1);\n          }),\n\n          toggle: update(function(classes, index, value) {\n            ~index ? classes.splice(index, 1) : classes.push(value);\n          }),\n\n          contains: function(value) {\n            return !!~self.className.split(/\\s+/).indexOf(value);\n          },\n\n          item: function(i) {\n            return self.className.split(/\\s+/)[i] || null;\n          }\n        };\n\n      }\n    });\n  }\n\n})(document, ionic);\n\n\n/**\n * @ngdoc page\n * @name tap\n * @module ionic\n * @description\n * On touch devices such as a phone or tablet, some browsers implement a 300ms delay between\n * the time the user stops touching the display and the moment the browser executes the\n * click. This delay was initially introduced so the browser can know whether the user wants to\n * double-tap to zoom in on the webpage.  Basically, the browser waits roughly 300ms to see if\n * the user is double-tapping, or just tapping on the display once.\n *\n * Out of the box, Ionic automatically removes the 300ms delay in order to make Ionic apps\n * feel more \"native\" like. Resultingly, other solutions such as\n * [fastclick](https://github.com/ftlabs/fastclick) and Angular's\n * [ngTouch](https://docs.angularjs.org/api/ngTouch) should not be included, to avoid conflicts.\n *\n * Some browsers already remove the delay with certain settings, such as the CSS property\n * `touch-events: none` or with specific meta tag viewport values. However, each of these\n * browsers still handle clicks differently, such as when to fire off or cancel the event\n * (like scrolling when the target is a button, or holding a button down).\n * For browsers that already remove the 300ms delay, consider Ionic's tap system as a way to\n * normalize how clicks are handled across the various devices so there's an expected response\n * no matter what the device, platform or version. Additionally, Ionic will prevent\n * ghostclicks which even browsers that remove the delay still experience.\n *\n * In some cases, third-party libraries may also be working with touch events which can interfere\n * with the tap system. For example, mapping libraries like Google or Leaflet Maps often implement\n * a touch detection system which conflicts with Ionic's tap system.\n *\n * ### Disabling the tap system\n *\n * To disable the tap for an element and all of its children elements,\n * add the attribute `data-tap-disabled=\"true\"`.\n *\n * ```html\n * <div data-tap-disabled=\"true\">\n *     <div id=\"google-map\"></div>\n * </div>\n * ```\n *\n * ### Additional Notes:\n *\n * - Ionic tap  works with Ionic's JavaScript scrolling\n * - Elements can come and go from the DOM and Ionic tap doesn't keep adding and removing\n *   listeners\n * - No \"tap delay\" after the first \"tap\" (you can tap as fast as you want, they all click)\n * - Minimal events listeners, only being added to document\n * - Correct focus in/out on each input type (select, textearea, range) on each platform/device\n * - Shows and hides virtual keyboard correctly for each platform/device\n * - Works with labels surrounding inputs\n * - Does not fire off a click if the user moves the pointer too far\n * - Adds and removes an 'activated' css class\n * - Multiple [unit tests](https://github.com/driftyco/ionic/blob/master/test/unit/utils/tap.unit.js) for each scenario\n *\n */\n/*\n\n IONIC TAP\n ---------------\n - Both touch and mouse events are added to the document.body on DOM ready\n - If a touch event happens, it does not use mouse event listeners\n - On touchend, if the distance between start and end was small, trigger a click\n - In the triggered click event, add a 'isIonicTap' property\n - The triggered click receives the same x,y coordinates as as the end event\n - On document.body click listener (with useCapture=true), only allow clicks with 'isIonicTap'\n - Triggering clicks with mouse events work the same as touch, except with mousedown/mouseup\n - Tapping inputs is disabled during scrolling\n*/\n\nvar tapDoc; // the element which the listeners are on (document.body)\nvar tapActiveEle; // the element which is active (probably has focus)\nvar tapEnabledTouchEvents;\nvar tapMouseResetTimer;\nvar tapPointerMoved;\nvar tapPointerStart;\nvar tapTouchFocusedInput;\nvar tapLastTouchTarget;\nvar tapTouchMoveListener = 'touchmove';\n\n// how much the coordinates can be off between start/end, but still a click\nvar TAP_RELEASE_TOLERANCE = 12; // default tolerance\nvar TAP_RELEASE_BUTTON_TOLERANCE = 50; // button elements should have a larger tolerance\n\nvar tapEventListeners = {\n  'click': tapClickGateKeeper,\n\n  'mousedown': tapMouseDown,\n  'mouseup': tapMouseUp,\n  'mousemove': tapMouseMove,\n\n  'touchstart': tapTouchStart,\n  'touchend': tapTouchEnd,\n  'touchcancel': tapTouchCancel,\n  'touchmove': tapTouchMove,\n\n  'pointerdown': tapTouchStart,\n  'pointerup': tapTouchEnd,\n  'pointercancel': tapTouchCancel,\n  'pointermove': tapTouchMove,\n\n  'MSPointerDown': tapTouchStart,\n  'MSPointerUp': tapTouchEnd,\n  'MSPointerCancel': tapTouchCancel,\n  'MSPointerMove': tapTouchMove,\n\n  'focusin': tapFocusIn,\n  'focusout': tapFocusOut\n};\n\nionic.tap = {\n\n  register: function(ele) {\n    tapDoc = ele;\n\n    tapEventListener('click', true, true);\n    tapEventListener('mouseup');\n    tapEventListener('mousedown');\n\n    if (window.navigator.pointerEnabled) {\n      tapEventListener('pointerdown');\n      tapEventListener('pointerup');\n      tapEventListener('pointcancel');\n      tapTouchMoveListener = 'pointermove';\n\n    } else if (window.navigator.msPointerEnabled) {\n      tapEventListener('MSPointerDown');\n      tapEventListener('MSPointerUp');\n      tapEventListener('MSPointerCancel');\n      tapTouchMoveListener = 'MSPointerMove';\n\n    } else {\n      tapEventListener('touchstart');\n      tapEventListener('touchend');\n      tapEventListener('touchcancel');\n    }\n\n    tapEventListener('focusin');\n    tapEventListener('focusout');\n\n    return function() {\n      for (var type in tapEventListeners) {\n        tapEventListener(type, false);\n      }\n      tapDoc = null;\n      tapActiveEle = null;\n      tapEnabledTouchEvents = false;\n      tapPointerMoved = false;\n      tapPointerStart = null;\n    };\n  },\n\n  ignoreScrollStart: function(e) {\n    return (e.defaultPrevented) ||  // defaultPrevented has been assigned by another component handling the event\n           (/^(file|range)$/i).test(e.target.type) ||\n           (e.target.dataset ? e.target.dataset.preventScroll : e.target.getAttribute('data-prevent-scroll')) == 'true' || // manually set within an elements attributes\n           (!!(/^(object|embed)$/i).test(e.target.tagName)) ||  // flash/movie/object touches should not try to scroll\n           ionic.tap.isElementTapDisabled(e.target); // check if this element, or an ancestor, has `data-tap-disabled` attribute\n  },\n\n  isTextInput: function(ele) {\n    return !!ele &&\n           (ele.tagName == 'TEXTAREA' ||\n            ele.contentEditable === 'true' ||\n            (ele.tagName == 'INPUT' && !(/^(radio|checkbox|range|file|submit|reset|color|image|button)$/i).test(ele.type)));\n  },\n\n  isDateInput: function(ele) {\n    return !!ele &&\n            (ele.tagName == 'INPUT' && (/^(date|time|datetime-local|month|week)$/i).test(ele.type));\n  },\n\n  isKeyboardElement: function(ele) {\n    if ( !ionic.Platform.isIOS() || ionic.Platform.isIPad() ) {\n      return ionic.tap.isTextInput(ele) && !ionic.tap.isDateInput(ele);\n    } else {\n      return ionic.tap.isTextInput(ele) || ( !!ele && ele.tagName == \"SELECT\");\n    }\n  },\n\n  isLabelWithTextInput: function(ele) {\n    var container = tapContainingElement(ele, false);\n\n    return !!container &&\n           ionic.tap.isTextInput(tapTargetElement(container));\n  },\n\n  containsOrIsTextInput: function(ele) {\n    return ionic.tap.isTextInput(ele) || ionic.tap.isLabelWithTextInput(ele);\n  },\n\n  cloneFocusedInput: function(container) {\n    if (ionic.tap.hasCheckedClone) return;\n    ionic.tap.hasCheckedClone = true;\n\n    ionic.requestAnimationFrame(function() {\n      var focusInput = container.querySelector(':focus');\n      if (ionic.tap.isTextInput(focusInput)) {\n        var clonedInput = focusInput.cloneNode(true);\n\n        clonedInput.value = focusInput.value;\n        clonedInput.classList.add('cloned-text-input');\n        clonedInput.readOnly = true;\n        if (focusInput.isContentEditable) {\n          clonedInput.contentEditable = focusInput.contentEditable;\n          clonedInput.innerHTML = focusInput.innerHTML;\n        }\n        focusInput.parentElement.insertBefore(clonedInput, focusInput);\n        focusInput.classList.add('previous-input-focus');\n\n        clonedInput.scrollTop = focusInput.scrollTop;\n      }\n    });\n  },\n\n  hasCheckedClone: false,\n\n  removeClonedInputs: function(container) {\n    ionic.tap.hasCheckedClone = false;\n\n    ionic.requestAnimationFrame(function() {\n      var clonedInputs = container.querySelectorAll('.cloned-text-input');\n      var previousInputFocus = container.querySelectorAll('.previous-input-focus');\n      var x;\n\n      for (x = 0; x < clonedInputs.length; x++) {\n        clonedInputs[x].parentElement.removeChild(clonedInputs[x]);\n      }\n\n      for (x = 0; x < previousInputFocus.length; x++) {\n        previousInputFocus[x].classList.remove('previous-input-focus');\n        previousInputFocus[x].style.top = '';\n        if ( ionic.keyboard.isOpen && !ionic.keyboard.isClosing ) previousInputFocus[x].focus();\n      }\n    });\n  },\n\n  requiresNativeClick: function(ele) {\n    if (!ele || ele.disabled || (/^(file|range)$/i).test(ele.type) || (/^(object|video)$/i).test(ele.tagName) || ionic.tap.isLabelContainingFileInput(ele)) {\n      return true;\n    }\n    return ionic.tap.isElementTapDisabled(ele);\n  },\n\n  isLabelContainingFileInput: function(ele) {\n    var lbl = tapContainingElement(ele);\n    if (lbl.tagName !== 'LABEL') return false;\n    var fileInput = lbl.querySelector('input[type=file]');\n    if (fileInput && fileInput.disabled === false) return true;\n    return false;\n  },\n\n  isElementTapDisabled: function(ele) {\n    if (ele && ele.nodeType === 1) {\n      var element = ele;\n      while (element) {\n        if ((element.dataset ? element.dataset.tapDisabled : element.getAttribute('data-tap-disabled')) == 'true') {\n          return true;\n        }\n        element = element.parentElement;\n      }\n    }\n    return false;\n  },\n\n  setTolerance: function(releaseTolerance, releaseButtonTolerance) {\n    TAP_RELEASE_TOLERANCE = releaseTolerance;\n    TAP_RELEASE_BUTTON_TOLERANCE = releaseButtonTolerance;\n  },\n\n  cancelClick: function() {\n    // used to cancel any simulated clicks which may happen on a touchend/mouseup\n    // gestures uses this method within its tap and hold events\n    tapPointerMoved = true;\n  },\n\n  pointerCoord: function(event) {\n    // This method can get coordinates for both a mouse click\n    // or a touch depending on the given event\n    var c = { x: 0, y: 0 };\n    if (event) {\n      var touches = event.touches && event.touches.length ? event.touches : [event];\n      var e = (event.changedTouches && event.changedTouches[0]) || touches[0];\n      if (e) {\n        c.x = e.clientX || e.pageX || 0;\n        c.y = e.clientY || e.pageY || 0;\n      }\n    }\n    return c;\n  }\n\n};\n\nfunction tapEventListener(type, enable, useCapture) {\n  if (enable !== false) {\n    tapDoc.addEventListener(type, tapEventListeners[type], useCapture);\n  } else {\n    tapDoc.removeEventListener(type, tapEventListeners[type]);\n  }\n}\n\nfunction tapClick(e) {\n  // simulate a normal click by running the element's click method then focus on it\n  var container = tapContainingElement(e.target);\n  var ele = tapTargetElement(container);\n\n  if (ionic.tap.requiresNativeClick(ele) || tapPointerMoved) return false;\n\n  var c = ionic.tap.pointerCoord(e);\n\n  //console.log('tapClick', e.type, ele.tagName, '('+c.x+','+c.y+')');\n  triggerMouseEvent('click', ele, c.x, c.y);\n\n  // if it's an input, focus in on the target, otherwise blur\n  tapHandleFocus(ele);\n}\n\nfunction triggerMouseEvent(type, ele, x, y) {\n  // using initMouseEvent instead of MouseEvent for our Android friends\n  var clickEvent = document.createEvent(\"MouseEvents\");\n  clickEvent.initMouseEvent(type, true, true, window, 1, 0, 0, x, y, false, false, false, false, 0, null);\n  clickEvent.isIonicTap = true;\n  ele.dispatchEvent(clickEvent);\n}\n\nfunction tapClickGateKeeper(e) {\n  //console.log('click ' + Date.now() + ' isIonicTap: ' + (e.isIonicTap ? true : false));\n  if (e.target.type == 'submit' && e.detail === 0) {\n    // do not prevent click if it came from an \"Enter\" or \"Go\" keypress submit\n    return null;\n  }\n\n  // do not allow through any click events that were not created by ionic.tap\n  if ((ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) ||\n      (!e.isIonicTap && !ionic.tap.requiresNativeClick(e.target))) {\n    //console.log('clickPrevent', e.target.tagName);\n    e.stopPropagation();\n\n    if (!ionic.tap.isLabelWithTextInput(e.target)) {\n      // labels clicks from native should not preventDefault othersize keyboard will not show on input focus\n      e.preventDefault();\n    }\n    return false;\n  }\n}\n\n// MOUSE\nfunction tapMouseDown(e) {\n  //console.log('mousedown ' + Date.now());\n  if (e.isIonicTap || tapIgnoreEvent(e)) return null;\n\n  if (tapEnabledTouchEvents) {\n    void 0;\n    e.stopPropagation();\n\n    if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName)) {\n      // If you preventDefault on a text input then you cannot move its text caret/cursor.\n      // Allow through only the text input default. However, without preventDefault on an\n      // input the 300ms delay can change focus on inputs after the keyboard shows up.\n      // The focusin event handles the chance of focus changing after the keyboard shows.\n      e.preventDefault();\n    }\n\n    return false;\n  }\n\n  tapPointerMoved = false;\n  tapPointerStart = ionic.tap.pointerCoord(e);\n\n  tapEventListener('mousemove');\n  ionic.activator.start(e);\n}\n\nfunction tapMouseUp(e) {\n  //console.log(\"mouseup \" + Date.now());\n  if (tapEnabledTouchEvents) {\n    e.stopPropagation();\n    e.preventDefault();\n    return false;\n  }\n\n  if (tapIgnoreEvent(e) || (/^(select|option)$/i).test(e.target.tagName)) return false;\n\n  if (!tapHasPointerMoved(e)) {\n    tapClick(e);\n  }\n  tapEventListener('mousemove', false);\n  ionic.activator.end();\n  tapPointerMoved = false;\n}\n\nfunction tapMouseMove(e) {\n  if (tapHasPointerMoved(e)) {\n    tapEventListener('mousemove', false);\n    ionic.activator.end();\n    tapPointerMoved = true;\n    return false;\n  }\n}\n\n\n// TOUCH\nfunction tapTouchStart(e) {\n  //console.log(\"touchstart \" + Date.now());\n  if (tapIgnoreEvent(e)) return;\n\n  tapPointerMoved = false;\n\n  tapEnableTouchEvents();\n  tapPointerStart = ionic.tap.pointerCoord(e);\n\n  tapEventListener(tapTouchMoveListener);\n  ionic.activator.start(e);\n\n  if (ionic.Platform.isIOS() && ionic.tap.isLabelWithTextInput(e.target)) {\n    // if the tapped element is a label, which has a child input\n    // then preventDefault so iOS doesn't ugly auto scroll to the input\n    // but do not prevent default on Android or else you cannot move the text caret\n    // and do not prevent default on Android or else no virtual keyboard shows up\n\n    var textInput = tapTargetElement(tapContainingElement(e.target));\n    if (textInput !== tapActiveEle) {\n      // don't preventDefault on an already focused input or else iOS's text caret isn't usable\n      e.preventDefault();\n    }\n  }\n}\n\nfunction tapTouchEnd(e) {\n  //console.log('touchend ' + Date.now());\n  if (tapIgnoreEvent(e)) return;\n\n  tapEnableTouchEvents();\n  if (!tapHasPointerMoved(e)) {\n    tapClick(e);\n\n    if ((/^(select|option)$/i).test(e.target.tagName)) {\n      e.preventDefault();\n    }\n  }\n\n  tapLastTouchTarget = e.target;\n  tapTouchCancel();\n}\n\nfunction tapTouchMove(e) {\n  if (tapHasPointerMoved(e)) {\n    tapPointerMoved = true;\n    tapEventListener(tapTouchMoveListener, false);\n    ionic.activator.end();\n    return false;\n  }\n}\n\nfunction tapTouchCancel() {\n  tapEventListener(tapTouchMoveListener, false);\n  ionic.activator.end();\n  tapPointerMoved = false;\n}\n\nfunction tapEnableTouchEvents() {\n  tapEnabledTouchEvents = true;\n  clearTimeout(tapMouseResetTimer);\n  tapMouseResetTimer = setTimeout(function() {\n    tapEnabledTouchEvents = false;\n  }, 600);\n}\n\nfunction tapIgnoreEvent(e) {\n  if (e.isTapHandled) return true;\n  e.isTapHandled = true;\n\n  if (ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) {\n    e.preventDefault();\n    return true;\n  }\n}\n\nfunction tapHandleFocus(ele) {\n  tapTouchFocusedInput = null;\n\n  var triggerFocusIn = false;\n\n  if (ele.tagName == 'SELECT') {\n    // trick to force Android options to show up\n    triggerMouseEvent('mousedown', ele, 0, 0);\n    ele.focus && ele.focus();\n    triggerFocusIn = true;\n\n  } else if (tapActiveElement() === ele) {\n    // already is the active element and has focus\n    triggerFocusIn = true;\n\n  } else if ((/^(input|textarea)$/i).test(ele.tagName) || ele.isContentEditable) {\n    triggerFocusIn = true;\n    ele.focus && ele.focus();\n    ele.value = ele.value;\n    if (tapEnabledTouchEvents) {\n      tapTouchFocusedInput = ele;\n    }\n\n  } else {\n    tapFocusOutActive();\n  }\n\n  if (triggerFocusIn) {\n    tapActiveElement(ele);\n    ionic.trigger('ionic.focusin', {\n      target: ele\n    }, true);\n  }\n}\n\nfunction tapFocusOutActive() {\n  var ele = tapActiveElement();\n  if (ele && ((/^(input|textarea|select)$/i).test(ele.tagName) || ele.isContentEditable)) {\n    void 0;\n    ele.blur();\n  }\n  tapActiveElement(null);\n}\n\nfunction tapFocusIn(e) {\n  //console.log('focusin ' + Date.now());\n  // Because a text input doesn't preventDefault (so the caret still works) there's a chance\n  // that its mousedown event 300ms later will change the focus to another element after\n  // the keyboard shows up.\n\n  if (tapEnabledTouchEvents &&\n      ionic.tap.isTextInput(tapActiveElement()) &&\n      ionic.tap.isTextInput(tapTouchFocusedInput) &&\n      tapTouchFocusedInput !== e.target) {\n\n    // 1) The pointer is from touch events\n    // 2) There is an active element which is a text input\n    // 3) A text input was just set to be focused on by a touch event\n    // 4) A new focus has been set, however the target isn't the one the touch event wanted\n    void 0;\n    tapTouchFocusedInput.focus();\n    tapTouchFocusedInput = null;\n  }\n  ionic.scroll.isScrolling = false;\n}\n\nfunction tapFocusOut() {\n  //console.log(\"focusout\");\n  tapActiveElement(null);\n}\n\nfunction tapActiveElement(ele) {\n  if (arguments.length) {\n    tapActiveEle = ele;\n  }\n  return tapActiveEle || document.activeElement;\n}\n\nfunction tapHasPointerMoved(endEvent) {\n  if (!endEvent || endEvent.target.nodeType !== 1 || !tapPointerStart || (tapPointerStart.x === 0 && tapPointerStart.y === 0)) {\n    return false;\n  }\n  var endCoordinates = ionic.tap.pointerCoord(endEvent);\n\n  var hasClassList = !!(endEvent.target.classList && endEvent.target.classList.contains &&\n    typeof endEvent.target.classList.contains === 'function');\n  var releaseTolerance = hasClassList && endEvent.target.classList.contains('button') ?\n    TAP_RELEASE_BUTTON_TOLERANCE :\n    TAP_RELEASE_TOLERANCE;\n\n  return Math.abs(tapPointerStart.x - endCoordinates.x) > releaseTolerance ||\n         Math.abs(tapPointerStart.y - endCoordinates.y) > releaseTolerance;\n}\n\nfunction tapContainingElement(ele, allowSelf) {\n  var climbEle = ele;\n  for (var x = 0; x < 6; x++) {\n    if (!climbEle) break;\n    if (climbEle.tagName === 'LABEL') return climbEle;\n    climbEle = climbEle.parentElement;\n  }\n  if (allowSelf !== false) return ele;\n}\n\nfunction tapTargetElement(ele) {\n  if (ele && ele.tagName === 'LABEL') {\n    if (ele.control) return ele.control;\n\n    // older devices do not support the \"control\" property\n    if (ele.querySelector) {\n      var control = ele.querySelector('input,textarea,select');\n      if (control) return control;\n    }\n  }\n  return ele;\n}\n\nionic.DomUtil.ready(function() {\n  var ng = typeof angular !== 'undefined' ? angular : null;\n  //do nothing for e2e tests\n  if (!ng || (ng && !ng.scenario)) {\n    ionic.tap.register(document);\n  }\n});\n\n(function(document, ionic) {\n  'use strict';\n\n  var queueElements = {};   // elements that should get an active state in XX milliseconds\n  var activeElements = {};  // elements that are currently active\n  var keyId = 0;            // a counter for unique keys for the above ojects\n  var ACTIVATED_CLASS = 'activated';\n\n  ionic.activator = {\n\n    start: function(e) {\n      var hitX = ionic.tap.pointerCoord(e).x;\n      if (hitX > 0 && hitX < 30) {\n        return;\n      }\n\n      // when an element is touched/clicked, it climbs up a few\n      // parents to see if it is an .item or .button element\n      ionic.requestAnimationFrame(function() {\n        if ((ionic.scroll && ionic.scroll.isScrolling) || ionic.tap.requiresNativeClick(e.target)) return;\n        var ele = e.target;\n        var eleToActivate;\n\n        for (var x = 0; x < 6; x++) {\n          if (!ele || ele.nodeType !== 1) break;\n          if (eleToActivate && ele.classList && ele.classList.contains('item')) {\n            eleToActivate = ele;\n            break;\n          }\n          if (ele.tagName == 'A' || ele.tagName == 'BUTTON' || ele.hasAttribute('ng-click')) {\n            eleToActivate = ele;\n            break;\n          }\n          if (ele.classList.contains('button')) {\n            eleToActivate = ele;\n            break;\n          }\n          // no sense climbing past these\n          if (ele.tagName == 'ION-CONTENT' || (ele.classList && ele.classList.contains('pane')) || ele.tagName == 'BODY') {\n            break;\n          }\n          ele = ele.parentElement;\n        }\n\n        if (eleToActivate) {\n          // queue that this element should be set to active\n          queueElements[keyId] = eleToActivate;\n\n          // on the next frame, set the queued elements to active\n          ionic.requestAnimationFrame(activateElements);\n\n          keyId = (keyId > 29 ? 0 : keyId + 1);\n        }\n\n      });\n    },\n\n    end: function() {\n      // clear out any active/queued elements after XX milliseconds\n      setTimeout(clear, 200);\n    }\n\n  };\n\n  function clear() {\n    // clear out any elements that are queued to be set to active\n    queueElements = {};\n\n    // in the next frame, remove the active class from all active elements\n    ionic.requestAnimationFrame(deactivateElements);\n  }\n\n  function activateElements() {\n    // activate all elements in the queue\n    for (var key in queueElements) {\n      if (queueElements[key]) {\n        queueElements[key].classList.add(ACTIVATED_CLASS);\n        activeElements[key] = queueElements[key];\n      }\n    }\n    queueElements = {};\n  }\n\n  function deactivateElements() {\n    if (ionic.transition && ionic.transition.isActive) {\n      setTimeout(deactivateElements, 400);\n      return;\n    }\n\n    for (var key in activeElements) {\n      if (activeElements[key]) {\n        activeElements[key].classList.remove(ACTIVATED_CLASS);\n        delete activeElements[key];\n      }\n    }\n  }\n\n})(document, ionic);\n\n(function(ionic) {\n  /* for nextUid function below */\n  var nextId = 0;\n\n  /**\n   * Various utilities used throughout Ionic\n   *\n   * Some of these are adopted from underscore.js and backbone.js, both also MIT licensed.\n   */\n  ionic.Utils = {\n\n    arrayMove: function(arr, oldIndex, newIndex) {\n      if (newIndex >= arr.length) {\n        var k = newIndex - arr.length;\n        while ((k--) + 1) {\n          arr.push(undefined);\n        }\n      }\n      arr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]);\n      return arr;\n    },\n\n    /**\n     * Return a function that will be called with the given context\n     */\n    proxy: function(func, context) {\n      var args = Array.prototype.slice.call(arguments, 2);\n      return function() {\n        return func.apply(context, args.concat(Array.prototype.slice.call(arguments)));\n      };\n    },\n\n    /**\n     * Only call a function once in the given interval.\n     *\n     * @param func {Function} the function to call\n     * @param wait {int} how long to wait before/after to allow function calls\n     * @param immediate {boolean} whether to call immediately or after the wait interval\n     */\n     debounce: function(func, wait, immediate) {\n      var timeout, args, context, timestamp, result;\n      return function() {\n        context = this;\n        args = arguments;\n        timestamp = new Date();\n        var later = function() {\n          var last = (new Date()) - timestamp;\n          if (last < wait) {\n            timeout = setTimeout(later, wait - last);\n          } else {\n            timeout = null;\n            if (!immediate) result = func.apply(context, args);\n          }\n        };\n        var callNow = immediate && !timeout;\n        if (!timeout) {\n          timeout = setTimeout(later, wait);\n        }\n        if (callNow) result = func.apply(context, args);\n        return result;\n      };\n    },\n\n    /**\n     * Throttle the given fun, only allowing it to be\n     * called at most every `wait` ms.\n     */\n    throttle: function(func, wait, options) {\n      var context, args, result;\n      var timeout = null;\n      var previous = 0;\n      options || (options = {});\n      var later = function() {\n        previous = options.leading === false ? 0 : Date.now();\n        timeout = null;\n        result = func.apply(context, args);\n      };\n      return function() {\n        var now = Date.now();\n        if (!previous && options.leading === false) previous = now;\n        var remaining = wait - (now - previous);\n        context = this;\n        args = arguments;\n        if (remaining <= 0) {\n          clearTimeout(timeout);\n          timeout = null;\n          previous = now;\n          result = func.apply(context, args);\n        } else if (!timeout && options.trailing !== false) {\n          timeout = setTimeout(later, remaining);\n        }\n        return result;\n      };\n    },\n     // Borrowed from Backbone.js's extend\n     // Helper function to correctly set up the prototype chain, for subclasses.\n     // Similar to `goog.inherits`, but uses a hash of prototype properties and\n     // class properties to be extended.\n    inherit: function(protoProps, staticProps) {\n      var parent = this;\n      var child;\n\n      // The constructor function for the new subclass is either defined by you\n      // (the \"constructor\" property in your `extend` definition), or defaulted\n      // by us to simply call the parent's constructor.\n      if (protoProps && protoProps.hasOwnProperty('constructor')) {\n        child = protoProps.constructor;\n      } else {\n        child = function() { return parent.apply(this, arguments); };\n      }\n\n      // Add static properties to the constructor function, if supplied.\n      ionic.extend(child, parent, staticProps);\n\n      // Set the prototype chain to inherit from `parent`, without calling\n      // `parent`'s constructor function.\n      var Surrogate = function() { this.constructor = child; };\n      Surrogate.prototype = parent.prototype;\n      child.prototype = new Surrogate();\n\n      // Add prototype properties (instance properties) to the subclass,\n      // if supplied.\n      if (protoProps) ionic.extend(child.prototype, protoProps);\n\n      // Set a convenience property in case the parent's prototype is needed\n      // later.\n      child.__super__ = parent.prototype;\n\n      return child;\n    },\n\n    // Extend adapted from Underscore.js\n    extend: function(obj) {\n       var args = Array.prototype.slice.call(arguments, 1);\n       for (var i = 0; i < args.length; i++) {\n         var source = args[i];\n         if (source) {\n           for (var prop in source) {\n             obj[prop] = source[prop];\n           }\n         }\n       }\n       return obj;\n    },\n\n    nextUid: function() {\n      return 'ion' + (nextId++);\n    },\n\n    disconnectScope: function disconnectScope(scope) {\n      if (!scope) return;\n\n      if (scope.$root === scope) {\n        return; // we can't disconnect the root node;\n      }\n      var parent = scope.$parent;\n      scope.$$disconnected = true;\n      scope.$broadcast('$ionic.disconnectScope', scope);\n\n      // See Scope.$destroy\n      if (parent.$$childHead === scope) {\n        parent.$$childHead = scope.$$nextSibling;\n      }\n      if (parent.$$childTail === scope) {\n        parent.$$childTail = scope.$$prevSibling;\n      }\n      if (scope.$$prevSibling) {\n        scope.$$prevSibling.$$nextSibling = scope.$$nextSibling;\n      }\n      if (scope.$$nextSibling) {\n        scope.$$nextSibling.$$prevSibling = scope.$$prevSibling;\n      }\n      scope.$$nextSibling = scope.$$prevSibling = null;\n    },\n\n    reconnectScope: function reconnectScope(scope) {\n      if (!scope) return;\n\n      if (scope.$root === scope) {\n        return; // we can't disconnect the root node;\n      }\n      if (!scope.$$disconnected) {\n        return;\n      }\n      var parent = scope.$parent;\n      scope.$$disconnected = false;\n      scope.$broadcast('$ionic.reconnectScope', scope);\n      // See Scope.$new for this logic...\n      scope.$$prevSibling = parent.$$childTail;\n      if (parent.$$childHead) {\n        parent.$$childTail.$$nextSibling = scope;\n        parent.$$childTail = scope;\n      } else {\n        parent.$$childHead = parent.$$childTail = scope;\n      }\n    },\n\n    isScopeDisconnected: function(scope) {\n      var climbScope = scope;\n      while (climbScope) {\n        if (climbScope.$$disconnected) return true;\n        climbScope = climbScope.$parent;\n      }\n      return false;\n    }\n  };\n\n  // Bind a few of the most useful functions to the ionic scope\n  ionic.inherit = ionic.Utils.inherit;\n  ionic.extend = ionic.Utils.extend;\n  ionic.throttle = ionic.Utils.throttle;\n  ionic.proxy = ionic.Utils.proxy;\n  ionic.debounce = ionic.Utils.debounce;\n\n})(window.ionic);\n\n/**\n * @ngdoc page\n * @name keyboard\n * @module ionic\n * @description\n * On both Android and iOS, Ionic will attempt to prevent the keyboard from\n * obscuring inputs and focusable elements when it appears by scrolling them\n * into view.  In order for this to work, any focusable elements must be within\n * a [Scroll View](http://ionicframework.com/docs/api/directive/ionScroll/)\n * or a directive such as [Content](http://ionicframework.com/docs/api/directive/ionContent/)\n * that has a Scroll View.\n *\n * It will also attempt to prevent the native overflow scrolling on focus,\n * which can cause layout issues such as pushing headers up and out of view.\n *\n * The keyboard fixes work best in conjunction with the\n * [Ionic Keyboard Plugin](https://github.com/driftyco/ionic-plugins-keyboard),\n * although it will perform reasonably well without.  However, if you are using\n * Cordova there is no reason not to use the plugin.\n *\n * ### Hide when keyboard shows\n *\n * To hide an element when the keyboard is open, add the class `hide-on-keyboard-open`.\n *\n * ```html\n * <div class=\"hide-on-keyboard-open\">\n *   <div id=\"google-map\"></div>\n * </div>\n * ```\n * ----------\n *\n * ### Plugin Usage\n * Information on using the plugin can be found at\n * [https://github.com/driftyco/ionic-plugins-keyboard](https://github.com/driftyco/ionic-plugins-keyboard).\n *\n * ----------\n *\n * ### Android Notes\n * - If your app is running in fullscreen, i.e. you have\n *   `<preference name=\"Fullscreen\" value=\"true\" />` in your `config.xml` file\n *   you will need to set `ionic.Platform.isFullScreen = true` manually.\n *\n * - You can configure the behavior of the web view when the keyboard shows by setting\n *   [android:windowSoftInputMode](http://developer.android.com/reference/android/R.attr.html#windowSoftInputMode)\n *   to either `adjustPan`, `adjustResize` or `adjustNothing` in your app's\n *   activity in `AndroidManifest.xml`. `adjustResize` is the recommended setting\n *   for Ionic, but if for some reason you do use `adjustPan` you will need to\n *   set `ionic.Platform.isFullScreen = true`.\n *\n *   ```xml\n *   <activity android:windowSoftInputMode=\"adjustResize\">\n *\n *   ```\n *\n * ### iOS Notes\n * - If the content of your app (including the header) is being pushed up and\n *   out of view on input focus, try setting `cordova.plugins.Keyboard.disableScroll(true)`.\n *   This does **not** disable scrolling in the Ionic scroll view, rather it\n *   disables the native overflow scrolling that happens automatically as a\n *   result of focusing on inputs below the keyboard.\n *\n */\n\n/**\n * The current viewport height.\n */\nvar keyboardCurrentViewportHeight = 0;\n\n/**\n * The viewport height when in portrait orientation.\n */\nvar keyboardPortraitViewportHeight = 0;\n\n/**\n * The viewport height when in landscape orientation.\n */\nvar keyboardLandscapeViewportHeight = 0;\n\n/**\n * The currently focused input.\n */\nvar keyboardActiveElement;\n\n/**\n * The scroll view containing the currently focused input.\n */\nvar scrollView;\n\n/**\n * Timer for the setInterval that polls window.innerHeight to determine whether\n * the layout has updated for the keyboard showing/hiding.\n */\nvar waitForResizeTimer;\n\n/**\n * Sometimes when switching inputs or orientations, focusout will fire before\n * focusin, so this timer is for the small setTimeout to determine if we should\n * really focusout/hide the keyboard.\n */\nvar keyboardFocusOutTimer;\n\n/**\n * on Android, orientationchange will fire before the keyboard plugin notifies\n * the browser that the keyboard will show/is showing, so this flag indicates\n * to nativeShow that there was an orientationChange and we should update\n * the viewport height with an accurate keyboard height value\n */\nvar wasOrientationChange = false;\n\n/**\n * CSS class added to the body indicating the keyboard is open.\n */\nvar KEYBOARD_OPEN_CSS = 'keyboard-open';\n\n/**\n * CSS class that indicates a scroll container.\n */\nvar SCROLL_CONTAINER_CSS = 'scroll-content';\n\n/**\n * Debounced keyboardFocusIn function\n */\nvar debouncedKeyboardFocusIn = ionic.debounce(keyboardFocusIn, 200, true);\n\n/**\n * Debounced keyboardNativeShow function\n */\nvar debouncedKeyboardNativeShow = ionic.debounce(keyboardNativeShow, 100, true);\n\n/**\n * Ionic keyboard namespace.\n * @namespace keyboard\n */\nionic.keyboard = {\n\n  /**\n   * Whether the keyboard is open or not.\n   */\n  isOpen: false,\n\n  /**\n   * Whether the keyboard is closing or not.\n   */\n  isClosing: false,\n\n  /**\n   * Whether the keyboard is opening or not.\n   */\n  isOpening: false,\n\n  /**\n   * The height of the keyboard in pixels, as reported by the keyboard plugin.\n   * If the plugin is not available, calculated as the difference in\n   * window.innerHeight after the keyboard has shown.\n   */\n  height: 0,\n\n  /**\n   * Whether the device is in landscape orientation or not.\n   */\n  isLandscape: false,\n\n  /**\n   * Whether the keyboard event listeners have been added or not\n   */\n  isInitialized: false,\n\n  /**\n   * Hide the keyboard, if it is open.\n   */\n  hide: function() {\n    if (keyboardHasPlugin()) {\n      cordova.plugins.Keyboard.close();\n    }\n    keyboardActiveElement && keyboardActiveElement.blur();\n  },\n\n  /**\n   * An alias for cordova.plugins.Keyboard.show(). If the keyboard plugin\n   * is installed, show the keyboard.\n   */\n  show: function() {\n    if (keyboardHasPlugin()) {\n      cordova.plugins.Keyboard.show();\n    }\n  },\n\n  /**\n   * Remove all keyboard related event listeners, effectively disabling Ionic's\n   * keyboard adjustments.\n   */\n  disable: function() {\n    if (keyboardHasPlugin()) {\n      window.removeEventListener('native.keyboardshow', debouncedKeyboardNativeShow );\n      window.removeEventListener('native.keyboardhide', keyboardFocusOut);\n    } else {\n      document.body.removeEventListener('focusout', keyboardFocusOut);\n    }\n\n    document.body.removeEventListener('ionic.focusin', debouncedKeyboardFocusIn);\n    document.body.removeEventListener('focusin', debouncedKeyboardFocusIn);\n\n    window.removeEventListener('orientationchange', keyboardOrientationChange);\n\n    if ( window.navigator.msPointerEnabled ) {\n      document.removeEventListener(\"MSPointerDown\", keyboardInit);\n    } else {\n      document.removeEventListener('touchstart', keyboardInit);\n    }\n    ionic.keyboard.isInitialized = false;\n  },\n\n  /**\n   * Alias for keyboardInit, initialize all keyboard related event listeners.\n   */\n  enable: function() {\n    keyboardInit();\n  }\n};\n\n// Initialize the viewport height (after ionic.keyboard.height has been\n// defined).\nkeyboardCurrentViewportHeight = getViewportHeight();\n\n\n                             /* Event handlers */\n/* ------------------------------------------------------------------------- */\n\n/**\n * Event handler for first touch event, initializes all event listeners\n * for keyboard related events. Also aliased by ionic.keyboard.enable.\n */\nfunction keyboardInit() {\n\n  if (ionic.keyboard.isInitialized) return;\n\n  if (keyboardHasPlugin()) {\n    window.addEventListener('native.keyboardshow', debouncedKeyboardNativeShow);\n    window.addEventListener('native.keyboardhide', keyboardFocusOut);\n  } else {\n    document.body.addEventListener('focusout', keyboardFocusOut);\n  }\n\n  document.body.addEventListener('ionic.focusin', debouncedKeyboardFocusIn);\n  document.body.addEventListener('focusin', debouncedKeyboardFocusIn);\n\n  if (window.navigator.msPointerEnabled) {\n    document.removeEventListener(\"MSPointerDown\", keyboardInit);\n  } else {\n    document.removeEventListener('touchstart', keyboardInit);\n  }\n\n  ionic.keyboard.isInitialized = true;\n}\n\n/**\n * Event handler for 'native.keyboardshow' event, sets keyboard.height to the\n * reported height and keyboard.isOpening to true. Then calls\n * keyboardWaitForResize with keyboardShow or keyboardUpdateViewportHeight as\n * the callback depending on whether the event was triggered by a focusin or\n * an orientationchange.\n */\nfunction keyboardNativeShow(e) {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardNativeShow fired at: \" + Date.now());\n  //console.log(\"keyboardNativeshow window.innerHeight: \" + window.innerHeight);\n\n  if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n    ionic.keyboard.isOpening = true;\n    ionic.keyboard.isClosing = false;\n  }\n\n  ionic.keyboard.height = e.keyboardHeight;\n  //console.log('nativeshow keyboard height:' + e.keyboardHeight);\n\n  if (wasOrientationChange) {\n    keyboardWaitForResize(keyboardUpdateViewportHeight, true);\n  } else {\n    keyboardWaitForResize(keyboardShow, true);\n  }\n}\n\n/**\n * Event handler for 'focusin' and 'ionic.focusin' events. Initializes\n * keyboard state (keyboardActiveElement and keyboard.isOpening) for the\n * appropriate adjustments once the window has resized.  If not using the\n * keyboard plugin, calls keyboardWaitForResize with keyboardShow as the\n * callback or keyboardShow right away if the keyboard is already open.  If\n * using the keyboard plugin does nothing and lets keyboardNativeShow handle\n * adjustments with a more accurate keyboard height.\n */\nfunction keyboardFocusIn(e) {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardFocusIn from: \" + e.type + \" at: \" + Date.now());\n\n  if (!e.target ||\n      e.target.readOnly ||\n      !ionic.tap.isKeyboardElement(e.target) ||\n      !(scrollView = inputScrollView(e.target))) {\n    keyboardActiveElement = null;\n    return;\n  }\n\n  keyboardActiveElement = e.target;\n\n  // if using JS scrolling, undo the effects of native overflow scroll so the\n  // scroll view is positioned correctly\n  document.body.scrollTop = 0;\n  scrollView.scrollTop = 0;\n  ionic.requestAnimationFrame(function(){\n    document.body.scrollTop = 0;\n    scrollView.scrollTop = 0;\n  });\n\n  if (!ionic.keyboard.isOpen || ionic.keyboard.isClosing) {\n    ionic.keyboard.isOpening = true;\n    ionic.keyboard.isClosing = false;\n  }\n\n  // attempt to prevent browser from natively scrolling input into view while\n  // we are trying to do the same (while we are scrolling) if the user taps the\n  // keyboard\n  document.addEventListener('keydown', keyboardOnKeyDown, false);\n\n  // any showing part of the document that isn't within the scroll the user\n  // could touchmove and cause some ugly changes to the app, so disable\n  // any touchmove events while the keyboard is open using e.preventDefault()\n  if (window.navigator.msPointerEnabled) {\n    document.addEventListener(\"MSPointerMove\", keyboardPreventDefault, false);\n  } else {\n    document.addEventListener('touchmove', keyboardPreventDefault, false);\n  }\n\n  // if we aren't using the plugin and the keyboard isn't open yet, wait for the\n  // window to resize so we can get an accurate estimate of the keyboard size,\n  // otherwise we do nothing and let nativeShow call keyboardShow once we have\n  // an exact keyboard height\n  // if the keyboard is already open, go ahead and scroll the input into view\n  // if necessary\n  if (!ionic.keyboard.isOpen && !keyboardHasPlugin()) {\n    keyboardWaitForResize(keyboardShow, true);\n\n  } else if (ionic.keyboard.isOpen) {\n    keyboardShow();\n  }\n}\n\n/**\n * Event handler for 'focusout' events. Sets keyboard.isClosing to true and\n * calls keyboardWaitForResize with keyboardHide as the callback after a small\n * timeout.\n */\nfunction keyboardFocusOut() {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardFocusOut fired at: \" + Date.now());\n  //console.log(\"keyboardFocusOut event type: \" + e.type);\n\n  if (ionic.keyboard.isOpen || ionic.keyboard.isOpening) {\n    ionic.keyboard.isClosing = true;\n    ionic.keyboard.isOpening = false;\n  }\n\n  // Call keyboardHide with a slight delay because sometimes on focus or\n  // orientation change focusin is called immediately after, so we give it time\n  // to cancel keyboardHide\n  keyboardFocusOutTimer = setTimeout(function() {\n    ionic.requestAnimationFrame(function() {\n      // focusOut during or right after an orientationchange, so we didn't get\n      // a chance to update the viewport height yet, do it and keyboardHide\n      //console.log(\"focusOut, wasOrientationChange: \" + wasOrientationChange);\n      if (wasOrientationChange) {\n        keyboardWaitForResize(function(){\n          keyboardUpdateViewportHeight();\n          keyboardHide();\n        }, false);\n      } else {\n        keyboardWaitForResize(keyboardHide, false);\n      }\n    });\n  }, 50);\n}\n\n/**\n * Event handler for 'orientationchange' events. If using the keyboard plugin\n * and the keyboard is open on Android, sets wasOrientationChange to true so\n * nativeShow can update the viewport height with an accurate keyboard height.\n * If the keyboard isn't open or keyboard plugin isn't being used,\n * waits for the window to resize before updating the viewport height.\n *\n * On iOS, where orientationchange fires after the keyboard has already shown,\n * updates the viewport immediately, regardless of if the keyboard is already\n * open.\n */\nfunction keyboardOrientationChange() {\n  //console.log(\"orientationchange fired at: \" + Date.now());\n  //console.log(\"orientation was: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n  // toggle orientation\n  ionic.keyboard.isLandscape = !ionic.keyboard.isLandscape;\n  // //console.log(\"now orientation is: \" + (ionic.keyboard.isLandscape ? \"landscape\" : \"portrait\"));\n\n  // no need to wait for resizing on iOS, and orientationchange always fires\n  // after the keyboard has opened, so it doesn't matter if it's open or not\n  if (ionic.Platform.isIOS()) {\n    keyboardUpdateViewportHeight();\n  }\n\n  // On Android, if the keyboard isn't open or we aren't using the keyboard\n  // plugin, update the viewport height once everything has resized. If the\n  // keyboard is open and we are using the keyboard plugin do nothing and let\n  // nativeShow handle it using an accurate keyboard height.\n  if ( ionic.Platform.isAndroid()) {\n    if (!ionic.keyboard.isOpen || !keyboardHasPlugin()) {\n      keyboardWaitForResize(keyboardUpdateViewportHeight, false);\n    } else {\n      wasOrientationChange = true;\n    }\n  }\n}\n\n/**\n * Event handler for 'keydown' event. Tries to prevent browser from natively\n * scrolling an input into view when a user taps the keyboard while we are\n * scrolling the input into view ourselves with JS.\n */\nfunction keyboardOnKeyDown(e) {\n  if (ionic.scroll.isScrolling) {\n    keyboardPreventDefault(e);\n  }\n}\n\n/**\n * Event for 'touchmove' or 'MSPointerMove'. Prevents native scrolling on\n * elements outside the scroll view while the keyboard is open.\n */\nfunction keyboardPreventDefault(e) {\n  if (e.target.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n  }\n}\n\n                              /* Private API */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Polls window.innerHeight until it has updated to an expected value (or\n * sufficient time has passed) before calling the specified callback function.\n * Only necessary for non-fullscreen Android which sometimes reports multiple\n * window.innerHeight values during interim layouts while it is resizing.\n *\n * On iOS, the window.innerHeight will already be updated, but we use the 50ms\n * delay as essentially a timeout so that scroll view adjustments happen after\n * the keyboard has shown so there isn't a white flash from us resizing too\n * quickly.\n *\n * @param {Function} callback the function to call once the window has resized\n * @param {boolean} isOpening whether the resize is from the keyboard opening\n * or not\n */\nfunction keyboardWaitForResize(callback, isOpening) {\n  clearInterval(waitForResizeTimer);\n  var count = 0;\n  var maxCount;\n  var initialHeight = getViewportHeight();\n  var viewportHeight = initialHeight;\n\n  //console.log(\"waitForResize initial viewport height: \" + viewportHeight);\n  //var start = Date.now();\n  //console.log(\"start: \" + start);\n\n  // want to fail relatively quickly on modern android devices, since it's much\n  // more likely we just have a bad keyboard height\n  if (ionic.Platform.isAndroid() && ionic.Platform.version() < 4.4) {\n    maxCount = 30;\n  } else if (ionic.Platform.isAndroid()) {\n    maxCount = 10;\n  } else {\n    maxCount = 1;\n  }\n\n  // poll timer\n  waitForResizeTimer = setInterval(function(){\n    viewportHeight = getViewportHeight();\n\n    // height hasn't updated yet, try again in 50ms\n    // if not using plugin, wait for maxCount to ensure we have waited long enough\n    // to get an accurate keyboard height\n    if (++count < maxCount &&\n        ((!isPortraitViewportHeight(viewportHeight) &&\n         !isLandscapeViewportHeight(viewportHeight)) ||\n         !ionic.keyboard.height)) {\n      return;\n    }\n\n    // infer the keyboard height from the resize if not using the keyboard plugin\n    if (!keyboardHasPlugin()) {\n      ionic.keyboard.height = Math.abs(initialHeight - window.innerHeight);\n    }\n\n    // set to true if we were waiting for the keyboard to open\n    ionic.keyboard.isOpen = isOpening;\n\n    clearInterval(waitForResizeTimer);\n    //var end = Date.now();\n    //console.log(\"waitForResize count: \" + count);\n    //console.log(\"end: \" + end);\n    //console.log(\"difference: \" + ( end - start ) + \"ms\");\n\n    //console.log(\"callback: \" + callback.name);\n    callback();\n\n  }, 50);\n\n  return maxCount; //for tests\n}\n\n/**\n * On keyboard close sets keyboard state to closed, resets the scroll view,\n * removes CSS from body indicating keyboard was open, removes any event\n * listeners for when the keyboard is open and on Android blurs the active\n * element (which in some cases will still have focus even if the keyboard\n * is closed and can cause it to reappear on subsequent taps).\n */\nfunction keyboardHide() {\n  clearTimeout(keyboardFocusOutTimer);\n  //console.log(\"keyboardHide\");\n\n  ionic.keyboard.isOpen = false;\n  ionic.keyboard.isClosing = false;\n\n  if (keyboardActiveElement) {\n    ionic.trigger('resetScrollView', {\n      target: keyboardActiveElement\n    }, true);\n  }\n\n  ionic.requestAnimationFrame(function(){\n    document.body.classList.remove(KEYBOARD_OPEN_CSS);\n  });\n\n  // the keyboard is gone now, remove the touchmove that disables native scroll\n  if (window.navigator.msPointerEnabled) {\n    document.removeEventListener(\"MSPointerMove\", keyboardPreventDefault);\n  } else {\n    document.removeEventListener('touchmove', keyboardPreventDefault);\n  }\n  document.removeEventListener('keydown', keyboardOnKeyDown);\n\n  if (ionic.Platform.isAndroid()) {\n    // on android closing the keyboard with the back/dismiss button won't remove\n    // focus and keyboard can re-appear on subsequent taps (like scrolling)\n    if (keyboardHasPlugin()) cordova.plugins.Keyboard.close();\n    keyboardActiveElement && keyboardActiveElement.blur();\n  }\n\n  keyboardActiveElement = null;\n}\n\n/**\n * On keyboard open sets keyboard state to open, adds CSS to the body\n * indicating the keyboard is open and tells the scroll view to resize and\n * the currently focused input into view if necessary.\n */\nfunction keyboardShow() {\n\n  ionic.keyboard.isOpen = true;\n  ionic.keyboard.isOpening = false;\n\n  var details = {\n    keyboardHeight: keyboardGetHeight(),\n    viewportHeight: keyboardCurrentViewportHeight\n  };\n\n  if (keyboardActiveElement) {\n    details.target = keyboardActiveElement;\n\n    var elementBounds = keyboardActiveElement.getBoundingClientRect();\n\n    details.elementTop = Math.round(elementBounds.top);\n    details.elementBottom = Math.round(elementBounds.bottom);\n\n    details.windowHeight = details.viewportHeight - details.keyboardHeight;\n    //console.log(\"keyboardShow viewportHeight: \" + details.viewportHeight +\n    //\", windowHeight: \" + details.windowHeight +\n    //\", keyboardHeight: \" + details.keyboardHeight);\n\n    // figure out if the element is under the keyboard\n    details.isElementUnderKeyboard = (details.elementBottom > details.windowHeight);\n    //console.log(\"isUnderKeyboard: \" + details.isElementUnderKeyboard);\n    //console.log(\"elementBottom: \" + details.elementBottom);\n\n    // send event so the scroll view adjusts\n    ionic.trigger('scrollChildIntoView', details, true);\n  }\n\n  setTimeout(function(){\n    document.body.classList.add(KEYBOARD_OPEN_CSS);\n  }, 400);\n\n  return details; //for testing\n}\n\n/* eslint no-unused-vars:0 */\nfunction keyboardGetHeight() {\n  // check if we already have a keyboard height from the plugin or resize calculations\n  if (ionic.keyboard.height) {\n    return ionic.keyboard.height;\n  }\n\n  if (ionic.Platform.isAndroid()) {\n    // should be using the plugin, no way to know how big the keyboard is, so guess\n    if ( ionic.Platform.isFullScreen ) {\n      return 275;\n    }\n    // otherwise just calculate it\n    var contentHeight = window.innerHeight;\n    if (contentHeight < keyboardCurrentViewportHeight) {\n      return keyboardCurrentViewportHeight - contentHeight;\n    } else {\n      return 0;\n    }\n  }\n\n  // fallback for when it's the webview without the plugin\n  // or for just the standard web browser\n  // TODO: have these be based on device\n  if (ionic.Platform.isIOS()) {\n    if (ionic.keyboard.isLandscape) {\n      return 206;\n    }\n\n    if (!ionic.Platform.isWebView()) {\n      return 216;\n    }\n\n    return 260;\n  }\n\n  // safe guess\n  return 275;\n}\n\nfunction isPortraitViewportHeight(viewportHeight) {\n  return !!(!ionic.keyboard.isLandscape &&\n         keyboardPortraitViewportHeight &&\n         (Math.abs(keyboardPortraitViewportHeight - viewportHeight) < 2));\n}\n\nfunction isLandscapeViewportHeight(viewportHeight) {\n  return !!(ionic.keyboard.isLandscape &&\n         keyboardLandscapeViewportHeight &&\n         (Math.abs(keyboardLandscapeViewportHeight - viewportHeight) < 2));\n}\n\nfunction keyboardUpdateViewportHeight() {\n  wasOrientationChange = false;\n  keyboardCurrentViewportHeight = getViewportHeight();\n\n  if (ionic.keyboard.isLandscape && !keyboardLandscapeViewportHeight) {\n    //console.log(\"saved landscape: \" + keyboardCurrentViewportHeight);\n    keyboardLandscapeViewportHeight = keyboardCurrentViewportHeight;\n\n  } else if (!ionic.keyboard.isLandscape && !keyboardPortraitViewportHeight) {\n    //console.log(\"saved portrait: \" + keyboardCurrentViewportHeight);\n    keyboardPortraitViewportHeight = keyboardCurrentViewportHeight;\n  }\n\n  if (keyboardActiveElement) {\n    ionic.trigger('resetScrollView', {\n      target: keyboardActiveElement\n    }, true);\n  }\n\n  if (ionic.keyboard.isOpen && ionic.tap.isTextInput(keyboardActiveElement)) {\n    keyboardShow();\n  }\n}\n\nfunction keyboardInitViewportHeight() {\n  var viewportHeight = getViewportHeight();\n  //console.log(\"Keyboard init VP: \" + viewportHeight + \" \" + window.innerWidth);\n  // can't just use window.innerHeight in case the keyboard is opened immediately\n  if ((viewportHeight / window.innerWidth) < 1) {\n    ionic.keyboard.isLandscape = true;\n  }\n  //console.log(\"ionic.keyboard.isLandscape is: \" + ionic.keyboard.isLandscape);\n\n  // initialize or update the current viewport height values\n  keyboardCurrentViewportHeight = viewportHeight;\n  if (ionic.keyboard.isLandscape && !keyboardLandscapeViewportHeight) {\n    keyboardLandscapeViewportHeight = keyboardCurrentViewportHeight;\n  } else if (!ionic.keyboard.isLandscape && !keyboardPortraitViewportHeight) {\n    keyboardPortraitViewportHeight = keyboardCurrentViewportHeight;\n  }\n}\n\nfunction getViewportHeight() {\n  var windowHeight = window.innerHeight;\n  //console.log('window.innerHeight is: ' + windowHeight);\n  //console.log('kb height is: ' + ionic.keyboard.height);\n  //console.log('kb isOpen: ' + ionic.keyboard.isOpen);\n\n  //TODO: add iPad undocked/split kb once kb plugin supports it\n  // the keyboard overlays the window on Android fullscreen\n  if (!(ionic.Platform.isAndroid() && ionic.Platform.isFullScreen) &&\n      (ionic.keyboard.isOpen || ionic.keyboard.isOpening) &&\n      !ionic.keyboard.isClosing) {\n\n     return windowHeight + keyboardGetHeight();\n  }\n  return windowHeight;\n}\n\nfunction inputScrollView(ele) {\n  while(ele) {\n    if (ele.classList.contains(SCROLL_CONTAINER_CSS)) {\n      return ele;\n    }\n    ele = ele.parentElement;\n  }\n  return null;\n}\n\nfunction keyboardHasPlugin() {\n  return !!(window.cordova && cordova.plugins && cordova.plugins.Keyboard);\n}\n\nionic.Platform.ready(function() {\n  keyboardInitViewportHeight();\n\n  window.addEventListener('orientationchange', keyboardOrientationChange);\n\n  // if orientation changes while app is in background, update on resuming\n  /*\n  if ( ionic.Platform.isWebView() ) {\n    document.addEventListener('resume', keyboardInitViewportHeight);\n\n    if (ionic.Platform.isAndroid()) {\n      //TODO: onbackpressed to detect keyboard close without focusout or plugin\n    }\n  }\n  */\n\n  // if orientation changes while app is in background, update on resuming\n/*  if ( ionic.Platform.isWebView() ) {\n    document.addEventListener('pause', function() {\n      window.removeEventListener('orientationchange', keyboardOrientationChange);\n    })\n    document.addEventListener('resume', function() {\n      keyboardInitViewportHeight();\n      window.addEventListener('orientationchange', keyboardOrientationChange)\n    });\n  }*/\n\n  // Android sometimes reports bad innerHeight on window.load\n  // try it again in a lil bit to play it safe\n  setTimeout(keyboardInitViewportHeight, 999);\n\n  // only initialize the adjustments for the virtual keyboard\n  // if a touchstart event happens\n  if (window.navigator.msPointerEnabled) {\n    document.addEventListener(\"MSPointerDown\", keyboardInit, false);\n  } else {\n    document.addEventListener('touchstart', keyboardInit, false);\n  }\n});\n\n\n\nvar viewportTag;\nvar viewportProperties = {};\n\nionic.viewport = {\n  orientation: function() {\n    // 0 = Portrait\n    // 90 = Landscape\n    // not using window.orientation because each device has a different implementation\n    return (window.innerWidth > window.innerHeight ? 90 : 0);\n  }\n};\n\nfunction viewportLoadTag() {\n  var x;\n\n  for (x = 0; x < document.head.children.length; x++) {\n    if (document.head.children[x].name == 'viewport') {\n      viewportTag = document.head.children[x];\n      break;\n    }\n  }\n\n  if (viewportTag) {\n    var props = viewportTag.content.toLowerCase().replace(/\\s+/g, '').split(',');\n    var keyValue;\n    for (x = 0; x < props.length; x++) {\n      if (props[x]) {\n        keyValue = props[x].split('=');\n        viewportProperties[ keyValue[0] ] = (keyValue.length > 1 ? keyValue[1] : '_');\n      }\n    }\n    viewportUpdate();\n  }\n}\n\nfunction viewportUpdate() {\n  // unit tests in viewport.unit.js\n\n  var initWidth = viewportProperties.width;\n  var initHeight = viewportProperties.height;\n  var p = ionic.Platform;\n  var version = p.version();\n  var DEVICE_WIDTH = 'device-width';\n  var DEVICE_HEIGHT = 'device-height';\n  var orientation = ionic.viewport.orientation();\n\n  // Most times we're removing the height and adding the width\n  // So this is the default to start with, then modify per platform/version/oreintation\n  delete viewportProperties.height;\n  viewportProperties.width = DEVICE_WIDTH;\n\n  if (p.isIPad()) {\n    // iPad\n\n    if (version > 7) {\n      // iPad >= 7.1\n      // https://issues.apache.org/jira/browse/CB-4323\n      delete viewportProperties.width;\n\n    } else {\n      // iPad <= 7.0\n\n      if (p.isWebView()) {\n        // iPad <= 7.0 WebView\n\n        if (orientation == 90) {\n          // iPad <= 7.0 WebView Landscape\n          viewportProperties.height = '0';\n\n        } else if (version == 7) {\n          // iPad <= 7.0 WebView Portait\n          viewportProperties.height = DEVICE_HEIGHT;\n        }\n      } else {\n        // iPad <= 6.1 Browser\n        if (version < 7) {\n          viewportProperties.height = '0';\n        }\n      }\n    }\n\n  } else if (p.isIOS()) {\n    // iPhone\n\n    if (p.isWebView()) {\n      // iPhone WebView\n\n      if (version > 7) {\n        // iPhone >= 7.1 WebView\n        delete viewportProperties.width;\n\n      } else if (version < 7) {\n        // iPhone <= 6.1 WebView\n        // if height was set it needs to get removed with this hack for <= 6.1\n        if (initHeight) viewportProperties.height = '0';\n\n      } else if (version == 7) {\n        //iPhone == 7.0 WebView\n        viewportProperties.height = DEVICE_HEIGHT;\n      }\n\n    } else {\n      // iPhone Browser\n\n      if (version < 7) {\n        // iPhone <= 6.1 Browser\n        // if height was set it needs to get removed with this hack for <= 6.1\n        if (initHeight) viewportProperties.height = '0';\n      }\n    }\n\n  }\n\n  // only update the viewport tag if there was a change\n  if (initWidth !== viewportProperties.width || initHeight !== viewportProperties.height) {\n    viewportTagUpdate();\n  }\n}\n\nfunction viewportTagUpdate() {\n  var key, props = [];\n  for (key in viewportProperties) {\n    if (viewportProperties[key]) {\n      props.push(key + (viewportProperties[key] == '_' ? '' : '=' + viewportProperties[key]));\n    }\n  }\n\n  viewportTag.content = props.join(', ');\n}\n\nionic.Platform.ready(function() {\n  viewportLoadTag();\n\n  window.addEventListener(\"orientationchange\", function() {\n    setTimeout(viewportUpdate, 1000);\n  }, false);\n});\n\n(function(ionic) {\n'use strict';\n  ionic.views.View = function() {\n    this.initialize.apply(this, arguments);\n  };\n\n  ionic.views.View.inherit = ionic.inherit;\n\n  ionic.extend(ionic.views.View.prototype, {\n    initialize: function() {}\n  });\n\n})(window.ionic);\n\n/*\n * Scroller\n * http://github.com/zynga/scroller\n *\n * Copyright 2011, Zynga Inc.\n * Licensed under the MIT License.\n * https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt\n *\n * Based on the work of: Unify Project (unify-project.org)\n * http://unify-project.org\n * Copyright 2011, Deutsche Telekom AG\n * License: MIT + Apache (V2)\n */\n\n/* jshint eqnull: true */\n\n/**\n * Generic animation class with support for dropped frames both optional easing and duration.\n *\n * Optional duration is useful when the lifetime is defined by another condition than time\n * e.g. speed of an animating object, etc.\n *\n * Dropped frame logic allows to keep using the same updater logic independent from the actual\n * rendering. This eases a lot of cases where it might be pretty complex to break down a state\n * based on the pure time difference.\n */\nvar zyngaCore = { effect: {} };\n(function(global) {\n  var time = Date.now || function() {\n    return +new Date();\n  };\n  var desiredFrames = 60;\n  var millisecondsPerSecond = 1000;\n  var running = {};\n  var counter = 1;\n\n  zyngaCore.effect.Animate = {\n\n    /**\n     * A requestAnimationFrame wrapper / polyfill.\n     *\n     * @param callback {Function} The callback to be invoked before the next repaint.\n     * @param root {HTMLElement} The root element for the repaint\n     */\n    requestAnimationFrame: (function() {\n\n      // Check for request animation Frame support\n      var requestFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame;\n      var isNative = !!requestFrame;\n\n      if (requestFrame && !/requestAnimationFrame\\(\\)\\s*\\{\\s*\\[native code\\]\\s*\\}/i.test(requestFrame.toString())) {\n        isNative = false;\n      }\n\n      if (isNative) {\n        return function(callback, root) {\n          requestFrame(callback, root);\n        };\n      }\n\n      var TARGET_FPS = 60;\n      var requests = {};\n      var requestCount = 0;\n      var rafHandle = 1;\n      var intervalHandle = null;\n      var lastActive = +new Date();\n\n      return function(callback) {\n        var callbackHandle = rafHandle++;\n\n        // Store callback\n        requests[callbackHandle] = callback;\n        requestCount++;\n\n        // Create timeout at first request\n        if (intervalHandle === null) {\n\n          intervalHandle = setInterval(function() {\n\n            var time = +new Date();\n            var currentRequests = requests;\n\n            // Reset data structure before executing callbacks\n            requests = {};\n            requestCount = 0;\n\n            for(var key in currentRequests) {\n              if (currentRequests.hasOwnProperty(key)) {\n                currentRequests[key](time);\n                lastActive = time;\n              }\n            }\n\n            // Disable the timeout when nothing happens for a certain\n            // period of time\n            if (time - lastActive > 2500) {\n              clearInterval(intervalHandle);\n              intervalHandle = null;\n            }\n\n          }, 1000 / TARGET_FPS);\n        }\n\n        return callbackHandle;\n      };\n\n    })(),\n\n\n    /**\n     * Stops the given animation.\n     *\n     * @param id {Integer} Unique animation ID\n     * @return {Boolean} Whether the animation was stopped (aka, was running before)\n     */\n    stop: function(id) {\n      var cleared = running[id] != null;\n      if (cleared) {\n        running[id] = null;\n      }\n\n      return cleared;\n    },\n\n\n    /**\n     * Whether the given animation is still running.\n     *\n     * @param id {Integer} Unique animation ID\n     * @return {Boolean} Whether the animation is still running\n     */\n    isRunning: function(id) {\n      return running[id] != null;\n    },\n\n\n    /**\n     * Start the animation.\n     *\n     * @param stepCallback {Function} Pointer to function which is executed on every step.\n     *   Signature of the method should be `function(percent, now, virtual) { return continueWithAnimation; }`\n     * @param verifyCallback {Function} Executed before every animation step.\n     *   Signature of the method should be `function() { return continueWithAnimation; }`\n     * @param completedCallback {Function}\n     *   Signature of the method should be `function(droppedFrames, finishedAnimation) {}`\n     * @param duration {Integer} Milliseconds to run the animation\n     * @param easingMethod {Function} Pointer to easing function\n     *   Signature of the method should be `function(percent) { return modifiedValue; }`\n     * @param root {Element} Render root, when available. Used for internal\n     *   usage of requestAnimationFrame.\n     * @return {Integer} Identifier of animation. Can be used to stop it any time.\n     */\n    start: function(stepCallback, verifyCallback, completedCallback, duration, easingMethod, root) {\n\n      var start = time();\n      var lastFrame = start;\n      var percent = 0;\n      var dropCounter = 0;\n      var id = counter++;\n\n      if (!root) {\n        root = document.body;\n      }\n\n      // Compacting running db automatically every few new animations\n      if (id % 20 === 0) {\n        var newRunning = {};\n        for (var usedId in running) {\n          newRunning[usedId] = true;\n        }\n        running = newRunning;\n      }\n\n      // This is the internal step method which is called every few milliseconds\n      var step = function(virtual) {\n\n        // Normalize virtual value\n        var render = virtual !== true;\n\n        // Get current time\n        var now = time();\n\n        // Verification is executed before next animation step\n        if (!running[id] || (verifyCallback && !verifyCallback(id))) {\n\n          running[id] = null;\n          completedCallback && completedCallback(desiredFrames - (dropCounter / ((now - start) / millisecondsPerSecond)), id, false);\n          return;\n\n        }\n\n        // For the current rendering to apply let's update omitted steps in memory.\n        // This is important to bring internal state variables up-to-date with progress in time.\n        if (render) {\n\n          var droppedFrames = Math.round((now - lastFrame) / (millisecondsPerSecond / desiredFrames)) - 1;\n          for (var j = 0; j < Math.min(droppedFrames, 4); j++) {\n            step(true);\n            dropCounter++;\n          }\n\n        }\n\n        // Compute percent value\n        if (duration) {\n          percent = (now - start) / duration;\n          if (percent > 1) {\n            percent = 1;\n          }\n        }\n\n        // Execute step callback, then...\n        var value = easingMethod ? easingMethod(percent) : percent;\n        if ((stepCallback(value, now, render) === false || percent === 1) && render) {\n          running[id] = null;\n          completedCallback && completedCallback(desiredFrames - (dropCounter / ((now - start) / millisecondsPerSecond)), id, percent === 1 || duration == null);\n        } else if (render) {\n          lastFrame = now;\n          zyngaCore.effect.Animate.requestAnimationFrame(step, root);\n        }\n      };\n\n      // Mark as running\n      running[id] = true;\n\n      // Init first step\n      zyngaCore.effect.Animate.requestAnimationFrame(step, root);\n\n      // Return unique animation ID\n      return id;\n    }\n  };\n})(this);\n\n/*\n * Scroller\n * http://github.com/zynga/scroller\n *\n * Copyright 2011, Zynga Inc.\n * Licensed under the MIT License.\n * https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt\n *\n * Based on the work of: Unify Project (unify-project.org)\n * http://unify-project.org\n * Copyright 2011, Deutsche Telekom AG\n * License: MIT + Apache (V2)\n */\n\n(function(ionic) {\n  var NOOP = function(){};\n\n  // Easing Equations (c) 2003 Robert Penner, all rights reserved.\n  // Open source under the BSD License.\n\n  /**\n   * @param pos {Number} position between 0 (start of effect) and 1 (end of effect)\n  **/\n  var easeOutCubic = function(pos) {\n    return (Math.pow((pos - 1), 3) + 1);\n  };\n\n  /**\n   * @param pos {Number} position between 0 (start of effect) and 1 (end of effect)\n  **/\n  var easeInOutCubic = function(pos) {\n    if ((pos /= 0.5) < 1) {\n      return 0.5 * Math.pow(pos, 3);\n    }\n\n    return 0.5 * (Math.pow((pos - 2), 3) + 2);\n  };\n\n\n/**\n * ionic.views.Scroll\n * A powerful scroll view with support for bouncing, pull to refresh, and paging.\n * @param   {Object}        options options for the scroll view\n * @class A scroll view system\n * @memberof ionic.views\n */\nionic.views.Scroll = ionic.views.View.inherit({\n  initialize: function(options) {\n    var self = this;\n\n    self.__container = options.el;\n    self.__content = options.el.firstElementChild;\n\n    //Remove any scrollTop attached to these elements; they are virtual scroll now\n    //This also stops on-load-scroll-to-window.location.hash that the browser does\n    setTimeout(function() {\n      if (self.__container && self.__content) {\n        self.__container.scrollTop = 0;\n        self.__content.scrollTop = 0;\n      }\n    });\n\n    self.options = {\n\n      /** Disable scrolling on x-axis by default */\n      scrollingX: false,\n      scrollbarX: true,\n\n      /** Enable scrolling on y-axis */\n      scrollingY: true,\n      scrollbarY: true,\n\n      startX: 0,\n      startY: 0,\n\n      /** The amount to dampen mousewheel events */\n      wheelDampen: 6,\n\n      /** The minimum size the scrollbars scale to while scrolling */\n      minScrollbarSizeX: 5,\n      minScrollbarSizeY: 5,\n\n      /** Scrollbar fading after scrolling */\n      scrollbarsFade: true,\n      scrollbarFadeDelay: 300,\n      /** The initial fade delay when the pane is resized or initialized */\n      scrollbarResizeFadeDelay: 1000,\n\n      /** Enable animations for deceleration, snap back, zooming and scrolling */\n      animating: true,\n\n      /** duration for animations triggered by scrollTo/zoomTo */\n      animationDuration: 250,\n\n      /** The velocity required to make the scroll view \"slide\" after touchend */\n      decelVelocityThreshold: 4,\n\n      /** The velocity required to make the scroll view \"slide\" after touchend when using paging */\n      decelVelocityThresholdPaging: 4,\n\n      /** Enable bouncing (content can be slowly moved outside and jumps back after releasing) */\n      bouncing: true,\n\n      /** Enable locking to the main axis if user moves only slightly on one of them at start */\n      locking: true,\n\n      /** Enable pagination mode (switching between full page content panes) */\n      paging: false,\n\n      /** Enable snapping of content to a configured pixel grid */\n      snapping: false,\n\n      /** Enable zooming of content via API, fingers and mouse wheel */\n      zooming: false,\n\n      /** Minimum zoom level */\n      minZoom: 0.5,\n\n      /** Maximum zoom level */\n      maxZoom: 3,\n\n      /** Multiply or decrease scrolling speed **/\n      speedMultiplier: 1,\n\n      deceleration: 0.97,\n\n      /** Whether to prevent default on a scroll operation to capture drag events **/\n      preventDefault: false,\n\n      /** Callback that is fired on the later of touch end or deceleration end,\n        provided that another scrolling action has not begun. Used to know\n        when to fade out a scrollbar. */\n      scrollingComplete: NOOP,\n\n      /** This configures the amount of change applied to deceleration when reaching boundaries  **/\n      penetrationDeceleration: 0.03,\n\n      /** This configures the amount of change applied to acceleration when reaching boundaries  **/\n      penetrationAcceleration: 0.08,\n\n      // The ms interval for triggering scroll events\n      scrollEventInterval: 10,\n\n      freeze: false,\n\n      getContentWidth: function() {\n        return Math.max(self.__content.scrollWidth, self.__content.offsetWidth);\n      },\n      getContentHeight: function() {\n        return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));\n      }\n    };\n\n    for (var key in options) {\n      self.options[key] = options[key];\n    }\n\n    self.hintResize = ionic.debounce(function() {\n      self.resize();\n    }, 1000, true);\n\n    self.onScroll = function() {\n\n      if (!ionic.scroll.isScrolling) {\n        setTimeout(self.setScrollStart, 50);\n      } else {\n        clearTimeout(self.scrollTimer);\n        self.scrollTimer = setTimeout(self.setScrollStop, 80);\n      }\n\n    };\n\n    self.freeze = function(shouldFreeze) {\n      if (arguments.length) {\n        self.options.freeze = shouldFreeze;\n      }\n      return self.options.freeze;\n    };\n\n    self.setScrollStart = function() {\n      ionic.scroll.isScrolling = Math.abs(ionic.scroll.lastTop - self.__scrollTop) > 1;\n      clearTimeout(self.scrollTimer);\n      self.scrollTimer = setTimeout(self.setScrollStop, 80);\n    };\n\n    self.setScrollStop = function() {\n      ionic.scroll.isScrolling = false;\n      ionic.scroll.lastTop = self.__scrollTop;\n    };\n\n    self.triggerScrollEvent = ionic.throttle(function() {\n      self.onScroll();\n      ionic.trigger('scroll', {\n        scrollTop: self.__scrollTop,\n        scrollLeft: self.__scrollLeft,\n        target: self.__container\n      });\n    }, self.options.scrollEventInterval);\n\n    self.triggerScrollEndEvent = function() {\n      ionic.trigger('scrollend', {\n        scrollTop: self.__scrollTop,\n        scrollLeft: self.__scrollLeft,\n        target: self.__container\n      });\n    };\n\n    self.__scrollLeft = self.options.startX;\n    self.__scrollTop = self.options.startY;\n\n    // Get the render update function, initialize event handlers,\n    // and calculate the size of the scroll container\n    self.__callback = self.getRenderFn();\n    self.__initEventHandlers();\n    self.__createScrollbars();\n\n  },\n\n  run: function() {\n    this.resize();\n\n    // Fade them out\n    this.__fadeScrollbars('out', this.options.scrollbarResizeFadeDelay);\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: STATUS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Whether only a single finger is used in touch handling */\n  __isSingleTouch: false,\n\n  /** Whether a touch event sequence is in progress */\n  __isTracking: false,\n\n  /** Whether a deceleration animation went to completion. */\n  __didDecelerationComplete: false,\n\n  /**\n   * Whether a gesture zoom/rotate event is in progress. Activates when\n   * a gesturestart event happens. This has higher priority than dragging.\n   */\n  __isGesturing: false,\n\n  /**\n   * Whether the user has moved by such a distance that we have enabled\n   * dragging mode. Hint: It's only enabled after some pixels of movement to\n   * not interrupt with clicks etc.\n   */\n  __isDragging: false,\n\n  /**\n   * Not touching and dragging anymore, and smoothly animating the\n   * touch sequence using deceleration.\n   */\n  __isDecelerating: false,\n\n  /**\n   * Smoothly animating the currently configured change\n   */\n  __isAnimating: false,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: DIMENSIONS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Available outer left position (from document perspective) */\n  __clientLeft: 0,\n\n  /** Available outer top position (from document perspective) */\n  __clientTop: 0,\n\n  /** Available outer width */\n  __clientWidth: 0,\n\n  /** Available outer height */\n  __clientHeight: 0,\n\n  /** Outer width of content */\n  __contentWidth: 0,\n\n  /** Outer height of content */\n  __contentHeight: 0,\n\n  /** Snapping width for content */\n  __snapWidth: 100,\n\n  /** Snapping height for content */\n  __snapHeight: 100,\n\n  /** Height to assign to refresh area */\n  __refreshHeight: null,\n\n  /** Whether the refresh process is enabled when the event is released now */\n  __refreshActive: false,\n\n  /** Callback to execute on activation. This is for signalling the user about a refresh is about to happen when he release */\n  __refreshActivate: null,\n\n  /** Callback to execute on deactivation. This is for signalling the user about the refresh being cancelled */\n  __refreshDeactivate: null,\n\n  /** Callback to execute to start the actual refresh. Call {@link #refreshFinish} when done */\n  __refreshStart: null,\n\n  /** Zoom level */\n  __zoomLevel: 1,\n\n  /** Scroll position on x-axis */\n  __scrollLeft: 0,\n\n  /** Scroll position on y-axis */\n  __scrollTop: 0,\n\n  /** Maximum allowed scroll position on x-axis */\n  __maxScrollLeft: 0,\n\n  /** Maximum allowed scroll position on y-axis */\n  __maxScrollTop: 0,\n\n  /* Scheduled left position (final position when animating) */\n  __scheduledLeft: 0,\n\n  /* Scheduled top position (final position when animating) */\n  __scheduledTop: 0,\n\n  /* Scheduled zoom level (final scale when animating) */\n  __scheduledZoom: 0,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: LAST POSITIONS\n  ---------------------------------------------------------------------------\n  */\n\n  /** Left position of finger at start */\n  __lastTouchLeft: null,\n\n  /** Top position of finger at start */\n  __lastTouchTop: null,\n\n  /** Timestamp of last move of finger. Used to limit tracking range for deceleration speed. */\n  __lastTouchMove: null,\n\n  /** List of positions, uses three indexes for each state: left, top, timestamp */\n  __positions: null,\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    INTERNAL FIELDS :: DECELERATION SUPPORT\n  ---------------------------------------------------------------------------\n  */\n\n  /** Minimum left scroll position during deceleration */\n  __minDecelerationScrollLeft: null,\n\n  /** Minimum top scroll position during deceleration */\n  __minDecelerationScrollTop: null,\n\n  /** Maximum left scroll position during deceleration */\n  __maxDecelerationScrollLeft: null,\n\n  /** Maximum top scroll position during deceleration */\n  __maxDecelerationScrollTop: null,\n\n  /** Current factor to modify horizontal scroll position with on every step */\n  __decelerationVelocityX: null,\n\n  /** Current factor to modify vertical scroll position with on every step */\n  __decelerationVelocityY: null,\n\n\n  /** the browser-specific property to use for transforms */\n  __transformProperty: null,\n  __perspectiveProperty: null,\n\n  /** scrollbar indicators */\n  __indicatorX: null,\n  __indicatorY: null,\n\n  /** Timeout for scrollbar fading */\n  __scrollbarFadeTimeout: null,\n\n  /** whether we've tried to wait for size already */\n  __didWaitForSize: null,\n  __sizerTimeout: null,\n\n  __initEventHandlers: function() {\n    var self = this;\n\n    // Event Handler\n    var container = self.__container;\n\n    // save height when scroll view is shrunk so we don't need to reflow\n    var scrollViewOffsetHeight;\n\n    /**\n     * Shrink the scroll view when the keyboard is up if necessary and if the\n     * focused input is below the bottom of the shrunk scroll view, scroll it\n     * into view.\n     */\n    self.scrollChildIntoView = function(e) {\n      //console.log(\"scrollChildIntoView at: \" + Date.now());\n\n      // D\n      var scrollBottomOffsetToTop = container.getBoundingClientRect().bottom;\n      // D - A\n      scrollViewOffsetHeight = container.offsetHeight;\n      var alreadyShrunk = self.isShrunkForKeyboard;\n\n      var isModal = container.parentNode.classList.contains('modal');\n      // 680px is when the media query for 60% modal width kicks in\n      var isInsetModal = isModal && window.innerWidth >= 680;\n\n     /*\n      *  _______\n      * |---A---| <- top of scroll view\n      * |       |\n      * |---B---| <- keyboard\n      * |   C   | <- input\n      * |---D---| <- initial bottom of scroll view\n      * |___E___| <- bottom of viewport\n      *\n      *  All commented calculations relative to the top of the viewport (ie E\n      *  is the viewport height, not 0)\n      */\n      if (!alreadyShrunk) {\n        // shrink scrollview so we can actually scroll if the input is hidden\n        // if it isn't shrink so we can scroll to inputs under the keyboard\n        // inset modals won't shrink on Android on their own when the keyboard appears\n        if ( ionic.Platform.isIOS() || ionic.Platform.isFullScreen || isInsetModal ) {\n          // if there are things below the scroll view account for them and\n          // subtract them from the keyboard height when resizing\n          // E - D                         E                         D\n          var scrollBottomOffsetToBottom = e.detail.viewportHeight - scrollBottomOffsetToTop;\n\n          // 0 or D - B if D > B           E - B                     E - D\n          var keyboardOffset = Math.max(0, e.detail.keyboardHeight - scrollBottomOffsetToBottom);\n\n          ionic.requestAnimationFrame(function(){\n            // D - A or B - A if D > B       D - A             max(0, D - B)\n            scrollViewOffsetHeight = scrollViewOffsetHeight - keyboardOffset;\n            container.style.height = scrollViewOffsetHeight + \"px\";\n            container.style.overflow = \"visible\";\n\n            //update scroll view\n            self.resize();\n          });\n        }\n\n        self.isShrunkForKeyboard = true;\n      }\n\n      /*\n       *  _______\n       * |---A---| <- top of scroll view\n       * |   *   | <- where we want to scroll to\n       * |--B-D--| <- keyboard, bottom of scroll view\n       * |   C   | <- input\n       * |       |\n       * |___E___| <- bottom of viewport\n       *\n       *  All commented calculations relative to the top of the viewport (ie E\n       *  is the viewport height, not 0)\n       */\n      // if the element is positioned under the keyboard scroll it into view\n      if (e.detail.isElementUnderKeyboard) {\n\n        ionic.requestAnimationFrame(function(){\n          container.scrollTop = 0;\n          // update D if we shrunk\n          if (self.isShrunkForKeyboard && !alreadyShrunk) {\n            scrollBottomOffsetToTop = container.getBoundingClientRect().bottom;\n          }\n\n          // middle of the scrollview, this is where we want to scroll to\n          // (D - A) / 2\n          var scrollMidpointOffset = scrollViewOffsetHeight * 0.5;\n          //console.log(\"container.offsetHeight: \" + scrollViewOffsetHeight);\n\n          // middle of the input we want to scroll into view\n          // C\n          var inputMidpoint = ((e.detail.elementBottom + e.detail.elementTop) / 2);\n\n          // distance from middle of input to the bottom of the scroll view\n          // C - D                                C               D\n          var inputMidpointOffsetToScrollBottom = inputMidpoint - scrollBottomOffsetToTop;\n\n          //C - D + (D - A)/2          C - D                     (D - A)/ 2\n          var scrollTop = inputMidpointOffsetToScrollBottom + scrollMidpointOffset;\n\n          if ( scrollTop > 0) {\n            if (ionic.Platform.isIOS()) ionic.tap.cloneFocusedInput(container, self);\n            self.scrollBy(0, scrollTop, true);\n            self.onScroll();\n          }\n        });\n      }\n\n      // Only the first scrollView parent of the element that broadcasted this event\n      // (the active element that needs to be shown) should receive this event\n      e.stopPropagation();\n    };\n\n    self.resetScrollView = function() {\n      //return scrollview to original height once keyboard has hidden\n      if ( self.isShrunkForKeyboard ) {\n        self.isShrunkForKeyboard = false;\n        container.style.height = \"\";\n        container.style.overflow = \"\";\n      }\n      self.resize();\n    };\n\n    //Broadcasted when keyboard is shown on some platforms.\n    //See js/utils/keyboard.js\n    container.addEventListener('scrollChildIntoView', self.scrollChildIntoView);\n\n    // Listen on document because container may not have had the last\n    // keyboardActiveElement, for example after closing a modal with a focused\n    // input and returning to a previously resized scroll view in an ion-content.\n    // Since we can only resize scroll views that are currently visible, just resize\n    // the current scroll view when the keyboard is closed.\n    document.addEventListener('resetScrollView', self.resetScrollView);\n\n    function getEventTouches(e) {\n      return e.touches && e.touches.length ? e.touches : [{\n        pageX: e.pageX,\n        pageY: e.pageY\n      }];\n    }\n\n    self.touchStart = function(e) {\n      self.startCoordinates = ionic.tap.pointerCoord(e);\n\n      if ( ionic.tap.ignoreScrollStart(e) ) {\n        return;\n      }\n\n      self.__isDown = true;\n\n      if ( ionic.tap.containsOrIsTextInput(e.target) || e.target.tagName === 'SELECT' ) {\n        // do not start if the target is a text input\n        // if there is a touchmove on this input, then we can start the scroll\n        self.__hasStarted = false;\n        return;\n      }\n\n      self.__isSelectable = true;\n      self.__enableScrollY = true;\n      self.__hasStarted = true;\n      self.doTouchStart(getEventTouches(e), e.timeStamp);\n      e.preventDefault();\n    };\n\n    self.touchMove = function(e) {\n      if (self.options.freeze || !self.__isDown ||\n        (!self.__isDown && e.defaultPrevented) ||\n        (e.target.tagName === 'TEXTAREA' && e.target.parentElement.querySelector(':focus')) ) {\n        return;\n      }\n\n      if ( !self.__hasStarted && ( ionic.tap.containsOrIsTextInput(e.target) || e.target.tagName === 'SELECT' ) ) {\n        // the target is a text input and scroll has started\n        // since the text input doesn't start on touchStart, do it here\n        self.__hasStarted = true;\n        self.doTouchStart(getEventTouches(e), e.timeStamp);\n        e.preventDefault();\n        return;\n      }\n\n      if (self.startCoordinates) {\n        // we have start coordinates, so get this touch move's current coordinates\n        var currentCoordinates = ionic.tap.pointerCoord(e);\n\n        if ( self.__isSelectable &&\n            ionic.tap.isTextInput(e.target) &&\n            Math.abs(self.startCoordinates.x - currentCoordinates.x) > 20 ) {\n          // user slid the text input's caret on its x axis, disable any future y scrolling\n          self.__enableScrollY = false;\n          self.__isSelectable = true;\n        }\n\n        if ( self.__enableScrollY && Math.abs(self.startCoordinates.y - currentCoordinates.y) > 10 ) {\n          // user scrolled the entire view on the y axis\n          // disabled being able to select text on an input\n          // hide the input which has focus, and show a cloned one that doesn't have focus\n          self.__isSelectable = false;\n          ionic.tap.cloneFocusedInput(container, self);\n        }\n      }\n\n      self.doTouchMove(getEventTouches(e), e.timeStamp, e.scale);\n      self.__isDown = true;\n    };\n\n    self.touchMoveBubble = function(e) {\n      if(self.__isDown && self.options.preventDefault) {\n        e.preventDefault();\n      }\n    };\n\n    self.touchEnd = function(e) {\n      if (!self.__isDown) return;\n\n      self.doTouchEnd(e, e.timeStamp);\n      self.__isDown = false;\n      self.__hasStarted = false;\n      self.__isSelectable = true;\n      self.__enableScrollY = true;\n\n      if ( !self.__isDragging && !self.__isDecelerating && !self.__isAnimating ) {\n        ionic.tap.removeClonedInputs(container, self);\n      }\n    };\n\n    self.mouseWheel = ionic.animationFrameThrottle(function(e) {\n      var scrollParent = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'ionic-scroll');\n      if (!self.options.freeze && scrollParent === self.__container) {\n\n        self.hintResize();\n        self.scrollBy(\n          (e.wheelDeltaX || e.deltaX || 0) / self.options.wheelDampen,\n          (-e.wheelDeltaY || e.deltaY || 0) / self.options.wheelDampen\n        );\n\n        self.__fadeScrollbars('in');\n        clearTimeout(self.__wheelHideBarTimeout);\n        self.__wheelHideBarTimeout = setTimeout(function() {\n          self.__fadeScrollbars('out');\n        }, 100);\n      }\n    });\n\n    if ('ontouchstart' in window) {\n      // Touch Events\n      container.addEventListener(\"touchstart\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"touchmove\", self.touchMoveBubble, false);\n      document.addEventListener(\"touchmove\", self.touchMove, false);\n      document.addEventListener(\"touchend\", self.touchEnd, false);\n      document.addEventListener(\"touchcancel\", self.touchEnd, false);\n\n    } else if (window.navigator.pointerEnabled) {\n      // Pointer Events\n      container.addEventListener(\"pointerdown\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"pointermove\", self.touchMoveBubble, false);\n      document.addEventListener(\"pointermove\", self.touchMove, false);\n      document.addEventListener(\"pointerup\", self.touchEnd, false);\n      document.addEventListener(\"pointercancel\", self.touchEnd, false);\n      document.addEventListener(\"wheel\", self.mouseWheel, false);\n\n    } else if (window.navigator.msPointerEnabled) {\n      // IE10, WP8 (Pointer Events)\n      container.addEventListener(\"MSPointerDown\", self.touchStart, false);\n      if(self.options.preventDefault) container.addEventListener(\"MSPointerMove\", self.touchMoveBubble, false);\n      document.addEventListener(\"MSPointerMove\", self.touchMove, false);\n      document.addEventListener(\"MSPointerUp\", self.touchEnd, false);\n      document.addEventListener(\"MSPointerCancel\", self.touchEnd, false);\n      document.addEventListener(\"wheel\", self.mouseWheel, false);\n\n    } else {\n      // Mouse Events\n      var mousedown = false;\n\n      self.mouseDown = function(e) {\n        if ( ionic.tap.ignoreScrollStart(e) || e.target.tagName === 'SELECT' ) {\n          return;\n        }\n        self.doTouchStart(getEventTouches(e), e.timeStamp);\n\n        if ( !ionic.tap.isTextInput(e.target) ) {\n          e.preventDefault();\n        }\n        mousedown = true;\n      };\n\n      self.mouseMove = function(e) {\n        if (self.options.freeze || !mousedown || (!mousedown && e.defaultPrevented)) {\n          return;\n        }\n\n        self.doTouchMove(getEventTouches(e), e.timeStamp);\n\n        mousedown = true;\n      };\n\n      self.mouseMoveBubble = function(e) {\n        if (mousedown && self.options.preventDefault) {\n          e.preventDefault();\n        }\n      };\n\n      self.mouseUp = function(e) {\n        if (!mousedown) {\n          return;\n        }\n\n        self.doTouchEnd(e, e.timeStamp);\n\n        mousedown = false;\n      };\n\n      container.addEventListener(\"mousedown\", self.mouseDown, false);\n      if(self.options.preventDefault) container.addEventListener(\"mousemove\", self.mouseMoveBubble, false);\n      document.addEventListener(\"mousemove\", self.mouseMove, false);\n      document.addEventListener(\"mouseup\", self.mouseUp, false);\n      document.addEventListener('mousewheel', self.mouseWheel, false);\n      document.addEventListener('wheel', self.mouseWheel, false);\n    }\n  },\n\n  __cleanup: function() {\n    var self = this;\n    var container = self.__container;\n\n    container.removeEventListener('touchstart', self.touchStart);\n    container.removeEventListener('touchmove', self.touchMoveBubble);\n    document.removeEventListener('touchmove', self.touchMove);\n    document.removeEventListener('touchend', self.touchEnd);\n    document.removeEventListener('touchcancel', self.touchCancel);\n\n    container.removeEventListener(\"pointerdown\", self.touchStart);\n    container.removeEventListener(\"pointermove\", self.touchMoveBubble);\n    document.removeEventListener(\"pointermove\", self.touchMove);\n    document.removeEventListener(\"pointerup\", self.touchEnd);\n    document.removeEventListener(\"pointercancel\", self.touchEnd);\n\n    container.removeEventListener(\"MSPointerDown\", self.touchStart);\n    container.removeEventListener(\"MSPointerMove\", self.touchMoveBubble);\n    document.removeEventListener(\"MSPointerMove\", self.touchMove);\n    document.removeEventListener(\"MSPointerUp\", self.touchEnd);\n    document.removeEventListener(\"MSPointerCancel\", self.touchEnd);\n\n    container.removeEventListener(\"mousedown\", self.mouseDown);\n    container.removeEventListener(\"mousemove\", self.mouseMoveBubble);\n    document.removeEventListener(\"mousemove\", self.mouseMove);\n    document.removeEventListener(\"mouseup\", self.mouseUp);\n    document.removeEventListener('mousewheel', self.mouseWheel);\n    document.removeEventListener('wheel', self.mouseWheel);\n\n    container.removeEventListener('scrollChildIntoView', self.scrollChildIntoView);\n    document.removeEventListener('resetScrollView', self.resetScrollView);\n\n    ionic.tap.removeClonedInputs(container, self);\n\n    delete self.__container;\n    delete self.__content;\n    delete self.__indicatorX;\n    delete self.__indicatorY;\n    delete self.options.el;\n\n    self.__callback = self.scrollChildIntoView = self.resetScrollView = NOOP;\n\n    self.mouseMove = self.mouseDown = self.mouseUp = self.mouseWheel =\n      self.touchStart = self.touchMove = self.touchEnd = self.touchCancel = NOOP;\n\n    self.resize = self.scrollTo = self.zoomTo =\n      self.__scrollingComplete = NOOP;\n    container = null;\n  },\n\n  /** Create a scroll bar div with the given direction **/\n  __createScrollbar: function(direction) {\n    var bar = document.createElement('div'),\n      indicator = document.createElement('div');\n\n    indicator.className = 'scroll-bar-indicator scroll-bar-fade-out';\n\n    if (direction == 'h') {\n      bar.className = 'scroll-bar scroll-bar-h';\n    } else {\n      bar.className = 'scroll-bar scroll-bar-v';\n    }\n\n    bar.appendChild(indicator);\n    return bar;\n  },\n\n  __createScrollbars: function() {\n    var self = this;\n    var indicatorX, indicatorY;\n\n    if (self.options.scrollingX) {\n      indicatorX = {\n        el: self.__createScrollbar('h'),\n        sizeRatio: 1\n      };\n      indicatorX.indicator = indicatorX.el.children[0];\n\n      if (self.options.scrollbarX) {\n        self.__container.appendChild(indicatorX.el);\n      }\n      self.__indicatorX = indicatorX;\n    }\n\n    if (self.options.scrollingY) {\n      indicatorY = {\n        el: self.__createScrollbar('v'),\n        sizeRatio: 1\n      };\n      indicatorY.indicator = indicatorY.el.children[0];\n\n      if (self.options.scrollbarY) {\n        self.__container.appendChild(indicatorY.el);\n      }\n      self.__indicatorY = indicatorY;\n    }\n  },\n\n  __resizeScrollbars: function() {\n    var self = this;\n\n    // Update horiz bar\n    if (self.__indicatorX) {\n      var width = Math.max(Math.round(self.__clientWidth * self.__clientWidth / (self.__contentWidth)), 20);\n      if (width > self.__contentWidth) {\n        width = 0;\n      }\n      if (width !== self.__indicatorX.size) {\n        ionic.requestAnimationFrame(function(){\n          self.__indicatorX.indicator.style.width = width + 'px';\n        });\n      }\n      self.__indicatorX.size = width;\n      self.__indicatorX.minScale = self.options.minScrollbarSizeX / width;\n      self.__indicatorX.maxPos = self.__clientWidth - width;\n      self.__indicatorX.sizeRatio = self.__maxScrollLeft ? self.__indicatorX.maxPos / self.__maxScrollLeft : 1;\n    }\n\n    // Update vert bar\n    if (self.__indicatorY) {\n      var height = Math.max(Math.round(self.__clientHeight * self.__clientHeight / (self.__contentHeight)), 20);\n      if (height > self.__contentHeight) {\n        height = 0;\n      }\n      if (height !== self.__indicatorY.size) {\n        ionic.requestAnimationFrame(function(){\n          self.__indicatorY && (self.__indicatorY.indicator.style.height = height + 'px');\n        });\n      }\n      self.__indicatorY.size = height;\n      self.__indicatorY.minScale = self.options.minScrollbarSizeY / height;\n      self.__indicatorY.maxPos = self.__clientHeight - height;\n      self.__indicatorY.sizeRatio = self.__maxScrollTop ? self.__indicatorY.maxPos / self.__maxScrollTop : 1;\n    }\n  },\n\n  /**\n   * Move and scale the scrollbars as the page scrolls.\n   */\n  __repositionScrollbars: function() {\n    var self = this,\n        heightScale, widthScale,\n        widthDiff, heightDiff,\n        x, y,\n        xstop = 0, ystop = 0;\n\n    if (self.__indicatorX) {\n      // Handle the X scrollbar\n\n      // Don't go all the way to the right if we have a vertical scrollbar as well\n      if (self.__indicatorY) xstop = 10;\n\n      x = Math.round(self.__indicatorX.sizeRatio * self.__scrollLeft) || 0;\n\n      // The the difference between the last content X position, and our overscrolled one\n      widthDiff = self.__scrollLeft - (self.__maxScrollLeft - xstop);\n\n      if (self.__scrollLeft < 0) {\n\n        widthScale = Math.max(self.__indicatorX.minScale,\n            (self.__indicatorX.size - Math.abs(self.__scrollLeft)) / self.__indicatorX.size);\n\n        // Stay at left\n        x = 0;\n\n        // Make sure scale is transformed from the left/center origin point\n        self.__indicatorX.indicator.style[self.__transformOriginProperty] = 'left center';\n      } else if (widthDiff > 0) {\n\n        widthScale = Math.max(self.__indicatorX.minScale,\n            (self.__indicatorX.size - widthDiff) / self.__indicatorX.size);\n\n        // Stay at the furthest x for the scrollable viewport\n        x = self.__indicatorX.maxPos - xstop;\n\n        // Make sure scale is transformed from the right/center origin point\n        self.__indicatorX.indicator.style[self.__transformOriginProperty] = 'right center';\n\n      } else {\n\n        // Normal motion\n        x = Math.min(self.__maxScrollLeft, Math.max(0, x));\n        widthScale = 1;\n\n      }\n\n      var translate3dX = 'translate3d(' + x + 'px, 0, 0) scaleX(' + widthScale + ')';\n      if (self.__indicatorX.transformProp !== translate3dX) {\n        self.__indicatorX.indicator.style[self.__transformProperty] = translate3dX;\n        self.__indicatorX.transformProp = translate3dX;\n      }\n    }\n\n    if (self.__indicatorY) {\n\n      y = Math.round(self.__indicatorY.sizeRatio * self.__scrollTop) || 0;\n\n      // Don't go all the way to the right if we have a vertical scrollbar as well\n      if (self.__indicatorX) ystop = 10;\n\n      heightDiff = self.__scrollTop - (self.__maxScrollTop - ystop);\n\n      if (self.__scrollTop < 0) {\n\n        heightScale = Math.max(self.__indicatorY.minScale, (self.__indicatorY.size - Math.abs(self.__scrollTop)) / self.__indicatorY.size);\n\n        // Stay at top\n        y = 0;\n\n        // Make sure scale is transformed from the center/top origin point\n        if (self.__indicatorY.originProp !== 'center top') {\n          self.__indicatorY.indicator.style[self.__transformOriginProperty] = 'center top';\n          self.__indicatorY.originProp = 'center top';\n        }\n\n      } else if (heightDiff > 0) {\n\n        heightScale = Math.max(self.__indicatorY.minScale, (self.__indicatorY.size - heightDiff) / self.__indicatorY.size);\n\n        // Stay at bottom of scrollable viewport\n        y = self.__indicatorY.maxPos - ystop;\n\n        // Make sure scale is transformed from the center/bottom origin point\n        if (self.__indicatorY.originProp !== 'center bottom') {\n          self.__indicatorY.indicator.style[self.__transformOriginProperty] = 'center bottom';\n          self.__indicatorY.originProp = 'center bottom';\n        }\n\n      } else {\n\n        // Normal motion\n        y = Math.min(self.__maxScrollTop, Math.max(0, y));\n        heightScale = 1;\n\n      }\n\n      var translate3dY = 'translate3d(0,' + y + 'px, 0) scaleY(' + heightScale + ')';\n      if (self.__indicatorY.transformProp !== translate3dY) {\n        self.__indicatorY.indicator.style[self.__transformProperty] = translate3dY;\n        self.__indicatorY.transformProp = translate3dY;\n      }\n    }\n  },\n\n  __fadeScrollbars: function(direction, delay) {\n    var self = this;\n\n    if (!self.options.scrollbarsFade) {\n      return;\n    }\n\n    var className = 'scroll-bar-fade-out';\n\n    if (self.options.scrollbarsFade === true) {\n      clearTimeout(self.__scrollbarFadeTimeout);\n\n      if (direction == 'in') {\n        if (self.__indicatorX) { self.__indicatorX.indicator.classList.remove(className); }\n        if (self.__indicatorY) { self.__indicatorY.indicator.classList.remove(className); }\n      } else {\n        self.__scrollbarFadeTimeout = setTimeout(function() {\n          if (self.__indicatorX) { self.__indicatorX.indicator.classList.add(className); }\n          if (self.__indicatorY) { self.__indicatorY.indicator.classList.add(className); }\n        }, delay || self.options.scrollbarFadeDelay);\n      }\n    }\n  },\n\n  __scrollingComplete: function() {\n    this.options.scrollingComplete();\n    ionic.tap.removeClonedInputs(this.__container, this);\n    this.__fadeScrollbars('out');\n  },\n\n  resize: function(continueScrolling) {\n    var self = this;\n    if (!self.__container || !self.options) return;\n\n    // Update Scroller dimensions for changed content\n    // Add padding to bottom of content\n    self.setDimensions(\n      self.__container.clientWidth,\n      self.__container.clientHeight,\n      self.options.getContentWidth(),\n      self.options.getContentHeight(),\n      continueScrolling\n    );\n  },\n  /*\n  ---------------------------------------------------------------------------\n    PUBLIC API\n  ---------------------------------------------------------------------------\n  */\n\n  getRenderFn: function() {\n    var self = this;\n\n    var content = self.__content;\n\n    var docStyle = document.documentElement.style;\n\n    var engine;\n    if ('MozAppearance' in docStyle) {\n      engine = 'gecko';\n    } else if ('WebkitAppearance' in docStyle) {\n      engine = 'webkit';\n    } else if (typeof navigator.cpuClass === 'string') {\n      engine = 'trident';\n    }\n\n    var vendorPrefix = {\n      trident: 'ms',\n      gecko: 'Moz',\n      webkit: 'Webkit',\n      presto: 'O'\n    }[engine];\n\n    var helperElem = document.createElement(\"div\");\n    var undef;\n\n    var perspectiveProperty = vendorPrefix + \"Perspective\";\n    var transformProperty = vendorPrefix + \"Transform\";\n    var transformOriginProperty = vendorPrefix + 'TransformOrigin';\n\n    self.__perspectiveProperty = transformProperty;\n    self.__transformProperty = transformProperty;\n    self.__transformOriginProperty = transformOriginProperty;\n\n    if (helperElem.style[perspectiveProperty] !== undef) {\n\n      return function(left, top, zoom, wasResize) {\n        var translate3d = 'translate3d(' + (-left) + 'px,' + (-top) + 'px,0) scale(' + zoom + ')';\n        if (translate3d !== self.contentTransform) {\n          content.style[transformProperty] = translate3d;\n          self.contentTransform = translate3d;\n        }\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    } else if (helperElem.style[transformProperty] !== undef) {\n\n      return function(left, top, zoom, wasResize) {\n        content.style[transformProperty] = 'translate(' + (-left) + 'px,' + (-top) + 'px) scale(' + zoom + ')';\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    } else {\n\n      return function(left, top, zoom, wasResize) {\n        content.style.marginLeft = left ? (-left / zoom) + 'px' : '';\n        content.style.marginTop = top ? (-top / zoom) + 'px' : '';\n        content.style.zoom = zoom || '';\n        self.__repositionScrollbars();\n        if (!wasResize) {\n          self.triggerScrollEvent();\n        }\n      };\n\n    }\n  },\n\n\n  /**\n   * Configures the dimensions of the client (outer) and content (inner) elements.\n   * Requires the available space for the outer element and the outer size of the inner element.\n   * All values which are falsy (null or zero etc.) are ignored and the old value is kept.\n   *\n   * @param clientWidth {Integer} Inner width of outer element\n   * @param clientHeight {Integer} Inner height of outer element\n   * @param contentWidth {Integer} Outer width of inner element\n   * @param contentHeight {Integer} Outer height of inner element\n   */\n  setDimensions: function(clientWidth, clientHeight, contentWidth, contentHeight, continueScrolling) {\n    var self = this;\n\n    if (!clientWidth && !clientHeight && !contentWidth && !contentHeight) {\n      // this scrollview isn't rendered, don't bother\n      return;\n    }\n\n    // Only update values which are defined\n    if (clientWidth === +clientWidth) {\n      self.__clientWidth = clientWidth;\n    }\n\n    if (clientHeight === +clientHeight) {\n      self.__clientHeight = clientHeight;\n    }\n\n    if (contentWidth === +contentWidth) {\n      self.__contentWidth = contentWidth;\n    }\n\n    if (contentHeight === +contentHeight) {\n      self.__contentHeight = contentHeight;\n    }\n\n    // Refresh maximums\n    self.__computeScrollMax();\n    self.__resizeScrollbars();\n\n    // Refresh scroll position\n    if (!continueScrolling) {\n      self.scrollTo(self.__scrollLeft, self.__scrollTop, true, null, true);\n    }\n\n  },\n\n\n  /**\n   * Sets the client coordinates in relation to the document.\n   *\n   * @param left {Integer} Left position of outer element\n   * @param top {Integer} Top position of outer element\n   */\n  setPosition: function(left, top) {\n    this.__clientLeft = left || 0;\n    this.__clientTop = top || 0;\n  },\n\n\n  /**\n   * Configures the snapping (when snapping is active)\n   *\n   * @param width {Integer} Snapping width\n   * @param height {Integer} Snapping height\n   */\n  setSnapSize: function(width, height) {\n    this.__snapWidth = width;\n    this.__snapHeight = height;\n  },\n\n\n  /**\n   * Activates pull-to-refresh. A special zone on the top of the list to start a list refresh whenever\n   * the user event is released during visibility of this zone. This was introduced by some apps on iOS like\n   * the official Twitter client.\n   *\n   * @param height {Integer} Height of pull-to-refresh zone on top of rendered list\n   * @param activateCallback {Function} Callback to execute on activation. This is for signalling the user about a refresh is about to happen when he release.\n   * @param deactivateCallback {Function} Callback to execute on deactivation. This is for signalling the user about the refresh being cancelled.\n   * @param startCallback {Function} Callback to execute to start the real async refresh action. Call {@link #finishPullToRefresh} after finish of refresh.\n   * @param showCallback {Function} Callback to execute when the refresher should be shown. This is for showing the refresher during a negative scrollTop.\n   * @param hideCallback {Function} Callback to execute when the refresher should be hidden. This is for hiding the refresher when it's behind the nav bar.\n   * @param tailCallback {Function} Callback to execute just before the refresher returns to it's original state. This is for zooming out the refresher.\n   * @param pullProgressCallback Callback to state the progress while pulling to refresh\n   */\n  activatePullToRefresh: function(height, refresherMethods) {\n    var self = this;\n\n    self.__refreshHeight = height;\n    self.__refreshActivate = function() { ionic.requestAnimationFrame(refresherMethods.activate); };\n    self.__refreshDeactivate = function() { ionic.requestAnimationFrame(refresherMethods.deactivate); };\n    self.__refreshStart = function() { ionic.requestAnimationFrame(refresherMethods.start); };\n    self.__refreshShow = function() { ionic.requestAnimationFrame(refresherMethods.show); };\n    self.__refreshHide = function() { ionic.requestAnimationFrame(refresherMethods.hide); };\n    self.__refreshTail = function() { ionic.requestAnimationFrame(refresherMethods.tail); };\n    self.__refreshTailTime = 100;\n    self.__minSpinTime = 600;\n  },\n\n\n  /**\n   * Starts pull-to-refresh manually.\n   */\n  triggerPullToRefresh: function() {\n    // Use publish instead of scrollTo to allow scrolling to out of boundary position\n    // We don't need to normalize scrollLeft, zoomLevel, etc. here because we only y-scrolling when pull-to-refresh is enabled\n    this.__publish(this.__scrollLeft, -this.__refreshHeight, this.__zoomLevel, true);\n\n    var d = new Date();\n    this.refreshStartTime = d.getTime();\n\n    if (this.__refreshStart) {\n      this.__refreshStart();\n    }\n  },\n\n\n  /**\n   * Signalizes that pull-to-refresh is finished.\n   */\n  finishPullToRefresh: function() {\n    var self = this;\n    // delay to make sure the spinner has a chance to spin for a split second before it's dismissed\n    var d = new Date();\n    var delay = 0;\n    if (self.refreshStartTime + self.__minSpinTime > d.getTime()) {\n      delay = self.refreshStartTime + self.__minSpinTime - d.getTime();\n    }\n    setTimeout(function() {\n      if (self.__refreshTail) {\n        self.__refreshTail();\n      }\n      setTimeout(function() {\n        self.__refreshActive = false;\n        if (self.__refreshDeactivate) {\n          self.__refreshDeactivate();\n        }\n        if (self.__refreshHide) {\n          self.__refreshHide();\n        }\n\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, true);\n      }, self.__refreshTailTime);\n    }, delay);\n  },\n\n\n  /**\n   * Returns the scroll position and zooming values\n   *\n   * @return {Map} `left` and `top` scroll position and `zoom` level\n   */\n  getValues: function() {\n    return {\n      left: this.__scrollLeft,\n      top: this.__scrollTop,\n      zoom: this.__zoomLevel\n    };\n  },\n\n\n  /**\n   * Returns the maximum scroll values\n   *\n   * @return {Map} `left` and `top` maximum scroll values\n   */\n  getScrollMax: function() {\n    return {\n      left: this.__maxScrollLeft,\n      top: this.__maxScrollTop\n    };\n  },\n\n\n  /**\n   * Zooms to the given level. Supports optional animation. Zooms\n   * the center when no coordinates are given.\n   *\n   * @param level {Number} Level to zoom to\n   * @param animate {Boolean} Whether to use animation\n   * @param originLeft {Number} Zoom in at given left coordinate\n   * @param originTop {Number} Zoom in at given top coordinate\n   */\n  zoomTo: function(level, animate, originLeft, originTop) {\n    var self = this;\n\n    if (!self.options.zooming) {\n      throw new Error(\"Zooming is not enabled!\");\n    }\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n    }\n\n    var oldLevel = self.__zoomLevel;\n\n    // Normalize input origin to center of viewport if not defined\n    if (originLeft == null) {\n      originLeft = self.__clientWidth / 2;\n    }\n\n    if (originTop == null) {\n      originTop = self.__clientHeight / 2;\n    }\n\n    // Limit level according to configuration\n    level = Math.max(Math.min(level, self.options.maxZoom), self.options.minZoom);\n\n    // Recompute maximum values while temporary tweaking maximum scroll ranges\n    self.__computeScrollMax(level);\n\n    // Recompute left and top coordinates based on new zoom level\n    var left = ((originLeft + self.__scrollLeft) * level / oldLevel) - originLeft;\n    var top = ((originTop + self.__scrollTop) * level / oldLevel) - originTop;\n\n    // Limit x-axis\n    if (left > self.__maxScrollLeft) {\n      left = self.__maxScrollLeft;\n    } else if (left < 0) {\n      left = 0;\n    }\n\n    // Limit y-axis\n    if (top > self.__maxScrollTop) {\n      top = self.__maxScrollTop;\n    } else if (top < 0) {\n      top = 0;\n    }\n\n    // Push values out\n    self.__publish(left, top, level, animate);\n\n  },\n\n\n  /**\n   * Zooms the content by the given factor.\n   *\n   * @param factor {Number} Zoom by given factor\n   * @param animate {Boolean} Whether to use animation\n   * @param originLeft {Number} Zoom in at given left coordinate\n   * @param originTop {Number} Zoom in at given top coordinate\n   */\n  zoomBy: function(factor, animate, originLeft, originTop) {\n    this.zoomTo(this.__zoomLevel * factor, animate, originLeft, originTop);\n  },\n\n\n  /**\n   * Scrolls to the given position. Respect limitations and snapping automatically.\n   *\n   * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n   * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n   * @param animate {Boolean} Whether the scrolling should happen using an animation\n   * @param zoom {Number} Zoom level to go to\n   */\n  scrollTo: function(left, top, animate, zoom, wasResize) {\n    var self = this;\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n    }\n\n    // Correct coordinates based on new zoom level\n    if (zoom != null && zoom !== self.__zoomLevel) {\n\n      if (!self.options.zooming) {\n        throw new Error(\"Zooming is not enabled!\");\n      }\n\n      left *= zoom;\n      top *= zoom;\n\n      // Recompute maximum values while temporary tweaking maximum scroll ranges\n      self.__computeScrollMax(zoom);\n\n    } else {\n\n      // Keep zoom when not defined\n      zoom = self.__zoomLevel;\n\n    }\n\n    if (!self.options.scrollingX) {\n\n      left = self.__scrollLeft;\n\n    } else {\n\n      if (self.options.paging) {\n        left = Math.round(left / self.__clientWidth) * self.__clientWidth;\n      } else if (self.options.snapping) {\n        left = Math.round(left / self.__snapWidth) * self.__snapWidth;\n      }\n\n    }\n\n    if (!self.options.scrollingY) {\n\n      top = self.__scrollTop;\n\n    } else {\n\n      if (self.options.paging) {\n        top = Math.round(top / self.__clientHeight) * self.__clientHeight;\n      } else if (self.options.snapping) {\n        top = Math.round(top / self.__snapHeight) * self.__snapHeight;\n      }\n\n    }\n\n    // Limit for allowed ranges\n    left = Math.max(Math.min(self.__maxScrollLeft, left), 0);\n    top = Math.max(Math.min(self.__maxScrollTop, top), 0);\n\n    // Don't animate when no change detected, still call publish to make sure\n    // that rendered position is really in-sync with internal data\n    if (left === self.__scrollLeft && top === self.__scrollTop) {\n      animate = false;\n    }\n\n    // Publish new values\n    self.__publish(left, top, zoom, animate, wasResize);\n\n  },\n\n\n  /**\n   * Scroll by the given offset\n   *\n   * @param left {Number} Scroll x-axis by given offset\n   * @param top {Number} Scroll y-axis by given offset\n   * @param animate {Boolean} Whether to animate the given change\n   */\n  scrollBy: function(left, top, animate) {\n    var self = this;\n\n    var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;\n    var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;\n\n    self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    EVENT CALLBACKS\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Mouse wheel handler for zooming support\n   */\n  doMouseZoom: function(wheelDelta, timeStamp, pageX, pageY) {\n    var change = wheelDelta > 0 ? 0.97 : 1.03;\n    return this.zoomTo(this.__zoomLevel * change, false, pageX - this.__clientLeft, pageY - this.__clientTop);\n  },\n\n  /**\n   * Touch start handler for scrolling support\n   */\n  doTouchStart: function(touches, timeStamp) {\n    var self = this;\n\n    // remember if the deceleration was just stopped\n    self.__decStopped = !!(self.__isDecelerating || self.__isAnimating);\n\n    self.hintResize();\n\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    // Reset interruptedAnimation flag\n    self.__interruptedAnimation = true;\n\n    // Stop deceleration\n    if (self.__isDecelerating) {\n      zyngaCore.effect.Animate.stop(self.__isDecelerating);\n      self.__isDecelerating = false;\n      self.__interruptedAnimation = true;\n    }\n\n    // Stop animation\n    if (self.__isAnimating) {\n      zyngaCore.effect.Animate.stop(self.__isAnimating);\n      self.__isAnimating = false;\n      self.__interruptedAnimation = true;\n    }\n\n    // Use center point when dealing with two fingers\n    var currentTouchLeft, currentTouchTop;\n    var isSingleTouch = touches.length === 1;\n    if (isSingleTouch) {\n      currentTouchLeft = touches[0].pageX;\n      currentTouchTop = touches[0].pageY;\n    } else {\n      currentTouchLeft = Math.abs(touches[0].pageX + touches[1].pageX) / 2;\n      currentTouchTop = Math.abs(touches[0].pageY + touches[1].pageY) / 2;\n    }\n\n    // Store initial positions\n    self.__initialTouchLeft = currentTouchLeft;\n    self.__initialTouchTop = currentTouchTop;\n\n    // Store initial touchList for scale calculation\n    self.__initialTouches = touches;\n\n    // Store current zoom level\n    self.__zoomLevelStart = self.__zoomLevel;\n\n    // Store initial touch positions\n    self.__lastTouchLeft = currentTouchLeft;\n    self.__lastTouchTop = currentTouchTop;\n\n    // Store initial move time stamp\n    self.__lastTouchMove = timeStamp;\n\n    // Reset initial scale\n    self.__lastScale = 1;\n\n    // Reset locking flags\n    self.__enableScrollX = !isSingleTouch && self.options.scrollingX;\n    self.__enableScrollY = !isSingleTouch && self.options.scrollingY;\n\n    // Reset tracking flag\n    self.__isTracking = true;\n\n    // Reset deceleration complete flag\n    self.__didDecelerationComplete = false;\n\n    // Dragging starts directly with two fingers, otherwise lazy with an offset\n    self.__isDragging = !isSingleTouch;\n\n    // Some features are disabled in multi touch scenarios\n    self.__isSingleTouch = isSingleTouch;\n\n    // Clearing data structure\n    self.__positions = [];\n\n  },\n\n\n  /**\n   * Touch move handler for scrolling support\n   */\n  doTouchMove: function(touches, timeStamp, scale) {\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    var self = this;\n\n    // Ignore event when tracking is not enabled (event might be outside of element)\n    if (!self.__isTracking) {\n      return;\n    }\n\n    var currentTouchLeft, currentTouchTop;\n\n    // Compute move based around of center of fingers\n    if (touches.length === 2) {\n      currentTouchLeft = Math.abs(touches[0].pageX + touches[1].pageX) / 2;\n      currentTouchTop = Math.abs(touches[0].pageY + touches[1].pageY) / 2;\n\n      // Calculate scale when not present and only when touches are used\n      if (!scale && self.options.zooming) {\n        scale = self.__getScale(self.__initialTouches, touches);\n      }\n    } else {\n      currentTouchLeft = touches[0].pageX;\n      currentTouchTop = touches[0].pageY;\n    }\n\n    var positions = self.__positions;\n\n    // Are we already is dragging mode?\n    if (self.__isDragging) {\n        self.__decStopped = false;\n\n      // Compute move distance\n      var moveX = currentTouchLeft - self.__lastTouchLeft;\n      var moveY = currentTouchTop - self.__lastTouchTop;\n\n      // Read previous scroll position and zooming\n      var scrollLeft = self.__scrollLeft;\n      var scrollTop = self.__scrollTop;\n      var level = self.__zoomLevel;\n\n      // Work with scaling\n      if (scale != null && self.options.zooming) {\n\n        var oldLevel = level;\n\n        // Recompute level based on previous scale and new scale\n        level = level / self.__lastScale * scale;\n\n        // Limit level according to configuration\n        level = Math.max(Math.min(level, self.options.maxZoom), self.options.minZoom);\n\n        // Only do further compution when change happened\n        if (oldLevel !== level) {\n\n          // Compute relative event position to container\n          var currentTouchLeftRel = currentTouchLeft - self.__clientLeft;\n          var currentTouchTopRel = currentTouchTop - self.__clientTop;\n\n          // Recompute left and top coordinates based on new zoom level\n          scrollLeft = ((currentTouchLeftRel + scrollLeft) * level / oldLevel) - currentTouchLeftRel;\n          scrollTop = ((currentTouchTopRel + scrollTop) * level / oldLevel) - currentTouchTopRel;\n\n          // Recompute max scroll values\n          self.__computeScrollMax(level);\n\n        }\n      }\n\n      if (self.__enableScrollX) {\n\n        scrollLeft -= moveX * self.options.speedMultiplier;\n        var maxScrollLeft = self.__maxScrollLeft;\n\n        if (scrollLeft > maxScrollLeft || scrollLeft < 0) {\n\n          // Slow down on the edges\n          if (self.options.bouncing) {\n\n            scrollLeft += (moveX / 2 * self.options.speedMultiplier);\n\n          } else if (scrollLeft > maxScrollLeft) {\n\n            scrollLeft = maxScrollLeft;\n\n          } else {\n\n            scrollLeft = 0;\n\n          }\n        }\n      }\n\n      // Compute new vertical scroll position\n      if (self.__enableScrollY) {\n\n        scrollTop -= moveY * self.options.speedMultiplier;\n        var maxScrollTop = self.__maxScrollTop;\n\n        if (scrollTop > maxScrollTop || scrollTop < 0) {\n\n          // Slow down on the edges\n          if (self.options.bouncing || (self.__refreshHeight && scrollTop < 0)) {\n\n            scrollTop += (moveY / 2 * self.options.speedMultiplier);\n\n            // Support pull-to-refresh (only when only y is scrollable)\n            if (!self.__enableScrollX && self.__refreshHeight != null) {\n\n              // hide the refresher when it's behind the header bar in case of header transparency\n              if (scrollTop < 0) {\n                self.__refreshHidden = false;\n                self.__refreshShow();\n              } else {\n                self.__refreshHide();\n                self.__refreshHidden = true;\n              }\n\n              if (!self.__refreshActive && scrollTop <= -self.__refreshHeight) {\n\n                self.__refreshActive = true;\n                if (self.__refreshActivate) {\n                  self.__refreshActivate();\n                }\n\n              } else if (self.__refreshActive && scrollTop > -self.__refreshHeight) {\n\n                self.__refreshActive = false;\n                if (self.__refreshDeactivate) {\n                  self.__refreshDeactivate();\n                }\n\n              }\n            }\n\n          } else if (scrollTop > maxScrollTop) {\n\n            scrollTop = maxScrollTop;\n\n          } else {\n\n            scrollTop = 0;\n\n          }\n        } else if (self.__refreshHeight && !self.__refreshHidden) {\n          // if a positive scroll value and the refresher is still not hidden, hide it\n          self.__refreshHide();\n          self.__refreshHidden = true;\n        }\n      }\n\n      // Keep list from growing infinitely (holding min 10, max 20 measure points)\n      if (positions.length > 60) {\n        positions.splice(0, 30);\n      }\n\n      // Track scroll movement for decleration\n      positions.push(scrollLeft, scrollTop, timeStamp);\n\n      // Sync scroll position\n      self.__publish(scrollLeft, scrollTop, level);\n\n    // Otherwise figure out whether we are switching into dragging mode now.\n    } else {\n\n      var minimumTrackingForScroll = self.options.locking ? 3 : 0;\n      var minimumTrackingForDrag = 5;\n\n      var distanceX = Math.abs(currentTouchLeft - self.__initialTouchLeft);\n      var distanceY = Math.abs(currentTouchTop - self.__initialTouchTop);\n\n      self.__enableScrollX = self.options.scrollingX && distanceX >= minimumTrackingForScroll;\n      self.__enableScrollY = self.options.scrollingY && distanceY >= minimumTrackingForScroll;\n\n      positions.push(self.__scrollLeft, self.__scrollTop, timeStamp);\n\n      self.__isDragging = (self.__enableScrollX || self.__enableScrollY) && (distanceX >= minimumTrackingForDrag || distanceY >= minimumTrackingForDrag);\n      if (self.__isDragging) {\n        self.__interruptedAnimation = false;\n        self.__fadeScrollbars('in');\n      }\n\n    }\n\n    // Update last touch positions and time stamp for next event\n    self.__lastTouchLeft = currentTouchLeft;\n    self.__lastTouchTop = currentTouchTop;\n    self.__lastTouchMove = timeStamp;\n    self.__lastScale = scale;\n\n  },\n\n\n  /**\n   * Touch end handler for scrolling support\n   */\n  doTouchEnd: function(e, timeStamp) {\n    if (timeStamp instanceof Date) {\n      timeStamp = timeStamp.valueOf();\n    }\n    if (typeof timeStamp !== \"number\") {\n      timeStamp = Date.now();\n    }\n\n    var self = this;\n\n    // Ignore event when tracking is not enabled (no touchstart event on element)\n    // This is required as this listener ('touchmove') sits on the document and not on the element itself.\n    if (!self.__isTracking) {\n      return;\n    }\n\n    // Not touching anymore (when two finger hit the screen there are two touch end events)\n    self.__isTracking = false;\n\n    // Be sure to reset the dragging flag now. Here we also detect whether\n    // the finger has moved fast enough to switch into a deceleration animation.\n    if (self.__isDragging) {\n\n      // Reset dragging flag\n      self.__isDragging = false;\n\n      // Start deceleration\n      // Verify that the last move detected was in some relevant time frame\n      if (self.__isSingleTouch && self.options.animating && (timeStamp - self.__lastTouchMove) <= 100) {\n\n        // Then figure out what the scroll position was about 100ms ago\n        var positions = self.__positions;\n        var endPos = positions.length - 1;\n        var startPos = endPos;\n\n        // Move pointer to position measured 100ms ago\n        for (var i = endPos; i > 0 && positions[i] > (self.__lastTouchMove - 100); i -= 3) {\n          startPos = i;\n        }\n\n        // If start and stop position is identical in a 100ms timeframe,\n        // we cannot compute any useful deceleration.\n        if (startPos !== endPos) {\n\n          // Compute relative movement between these two points\n          var timeOffset = positions[endPos] - positions[startPos];\n          var movedLeft = self.__scrollLeft - positions[startPos - 2];\n          var movedTop = self.__scrollTop - positions[startPos - 1];\n\n          // Based on 50ms compute the movement to apply for each render step\n          self.__decelerationVelocityX = movedLeft / timeOffset * (1000 / 60);\n          self.__decelerationVelocityY = movedTop / timeOffset * (1000 / 60);\n\n          // How much velocity is required to start the deceleration\n          var minVelocityToStartDeceleration = self.options.paging || self.options.snapping ? self.options.decelVelocityThresholdPaging : self.options.decelVelocityThreshold;\n\n          // Verify that we have enough velocity to start deceleration\n          if (Math.abs(self.__decelerationVelocityX) > minVelocityToStartDeceleration || Math.abs(self.__decelerationVelocityY) > minVelocityToStartDeceleration) {\n\n            // Deactivate pull-to-refresh when decelerating\n            if (!self.__refreshActive) {\n              self.__startDeceleration(timeStamp);\n            }\n          }\n        } else {\n          self.__scrollingComplete();\n        }\n      } else if ((timeStamp - self.__lastTouchMove) > 100) {\n        self.__scrollingComplete();\n      }\n\n    } else if (self.__decStopped) {\n      // the deceleration was stopped\n      // user flicked the scroll fast, and stop dragging, then did a touchstart to stop the srolling\n      // tell the touchend event code to do nothing, we don't want to actually send a click\n      e.isTapHandled = true;\n      self.__decStopped = false;\n    }\n\n    // If this was a slower move it is per default non decelerated, but this\n    // still means that we want snap back to the bounds which is done here.\n    // This is placed outside the condition above to improve edge case stability\n    // e.g. touchend fired without enabled dragging. This should normally do not\n    // have modified the scroll positions or even showed the scrollbars though.\n    if (!self.__isDecelerating) {\n\n      if (self.__refreshActive && self.__refreshStart) {\n\n        // Use publish instead of scrollTo to allow scrolling to out of boundary position\n        // We don't need to normalize scrollLeft, zoomLevel, etc. here because we only y-scrolling when pull-to-refresh is enabled\n        self.__publish(self.__scrollLeft, -self.__refreshHeight, self.__zoomLevel, true);\n\n        var d = new Date();\n        self.refreshStartTime = d.getTime();\n\n        if (self.__refreshStart) {\n          self.__refreshStart();\n        }\n        // for iOS-ey style scrolling\n        if (!ionic.Platform.isAndroid())self.__startDeceleration();\n      } else {\n\n        if (self.__interruptedAnimation || self.__isDragging) {\n          self.__scrollingComplete();\n        }\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, true, self.__zoomLevel);\n\n        // Directly signalize deactivation (nothing todo on refresh?)\n        if (self.__refreshActive) {\n\n          self.__refreshActive = false;\n          if (self.__refreshDeactivate) {\n            self.__refreshDeactivate();\n          }\n\n        }\n      }\n    }\n\n    // Fully cleanup list\n    self.__positions.length = 0;\n\n  },\n\n\n\n  /*\n  ---------------------------------------------------------------------------\n    PRIVATE API\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Applies the scroll position to the content element\n   *\n   * @param left {Number} Left scroll position\n   * @param top {Number} Top scroll position\n   * @param animate {Boolean} Whether animation should be used to move to the new coordinates\n   */\n  __publish: function(left, top, zoom, animate, wasResize) {\n\n    var self = this;\n\n    // Remember whether we had an animation, then we try to continue based on the current \"drive\" of the animation\n    var wasAnimating = self.__isAnimating;\n    if (wasAnimating) {\n      zyngaCore.effect.Animate.stop(wasAnimating);\n      self.__isAnimating = false;\n    }\n\n    if (animate && self.options.animating) {\n\n      // Keep scheduled positions for scrollBy/zoomBy functionality\n      self.__scheduledLeft = left;\n      self.__scheduledTop = top;\n      self.__scheduledZoom = zoom;\n\n      var oldLeft = self.__scrollLeft;\n      var oldTop = self.__scrollTop;\n      var oldZoom = self.__zoomLevel;\n\n      var diffLeft = left - oldLeft;\n      var diffTop = top - oldTop;\n      var diffZoom = zoom - oldZoom;\n\n      var step = function(percent, now, render) {\n\n        if (render) {\n\n          self.__scrollLeft = oldLeft + (diffLeft * percent);\n          self.__scrollTop = oldTop + (diffTop * percent);\n          self.__zoomLevel = oldZoom + (diffZoom * percent);\n\n          // Push values out\n          if (self.__callback) {\n            self.__callback(self.__scrollLeft, self.__scrollTop, self.__zoomLevel, wasResize);\n          }\n\n        }\n      };\n\n      var verify = function(id) {\n        return self.__isAnimating === id;\n      };\n\n      var completed = function(renderedFramesPerSecond, animationId, wasFinished) {\n        if (animationId === self.__isAnimating) {\n          self.__isAnimating = false;\n        }\n        if (self.__didDecelerationComplete || wasFinished) {\n          self.__scrollingComplete();\n        }\n\n        if (self.options.zooming) {\n          self.__computeScrollMax();\n        }\n      };\n\n      // When continuing based on previous animation we choose an ease-out animation instead of ease-in-out\n      self.__isAnimating = zyngaCore.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);\n\n    } else {\n\n      self.__scheduledLeft = self.__scrollLeft = left;\n      self.__scheduledTop = self.__scrollTop = top;\n      self.__scheduledZoom = self.__zoomLevel = zoom;\n\n      // Push values out\n      if (self.__callback) {\n        self.__callback(left, top, zoom, wasResize);\n      }\n\n      // Fix max scroll ranges\n      if (self.options.zooming) {\n        self.__computeScrollMax();\n      }\n    }\n  },\n\n\n  /**\n   * Recomputes scroll minimum values based on client dimensions and content dimensions.\n   */\n  __computeScrollMax: function(zoomLevel) {\n    var self = this;\n\n    if (zoomLevel == null) {\n      zoomLevel = self.__zoomLevel;\n    }\n\n    self.__maxScrollLeft = Math.max((self.__contentWidth * zoomLevel) - self.__clientWidth, 0);\n    self.__maxScrollTop = Math.max((self.__contentHeight * zoomLevel) - self.__clientHeight, 0);\n\n    if (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {\n      self.__didWaitForSize = true;\n      self.__waitForSize();\n    }\n  },\n\n\n  /**\n   * If the scroll view isn't sized correctly on start, wait until we have at least some size\n   */\n  __waitForSize: function() {\n    var self = this;\n\n    clearTimeout(self.__sizerTimeout);\n\n    var sizer = function() {\n      self.resize(true);\n    };\n\n    sizer();\n    self.__sizerTimeout = setTimeout(sizer, 500);\n  },\n\n  /*\n  ---------------------------------------------------------------------------\n    ANIMATION (DECELERATION) SUPPORT\n  ---------------------------------------------------------------------------\n  */\n\n  /**\n   * Called when a touch sequence end and the speed of the finger was high enough\n   * to switch into deceleration mode.\n   */\n  __startDeceleration: function() {\n    var self = this;\n\n    if (self.options.paging) {\n\n      var scrollLeft = Math.max(Math.min(self.__scrollLeft, self.__maxScrollLeft), 0);\n      var scrollTop = Math.max(Math.min(self.__scrollTop, self.__maxScrollTop), 0);\n      var clientWidth = self.__clientWidth;\n      var clientHeight = self.__clientHeight;\n\n      // We limit deceleration not to the min/max values of the allowed range, but to the size of the visible client area.\n      // Each page should have exactly the size of the client area.\n      self.__minDecelerationScrollLeft = Math.floor(scrollLeft / clientWidth) * clientWidth;\n      self.__minDecelerationScrollTop = Math.floor(scrollTop / clientHeight) * clientHeight;\n      self.__maxDecelerationScrollLeft = Math.ceil(scrollLeft / clientWidth) * clientWidth;\n      self.__maxDecelerationScrollTop = Math.ceil(scrollTop / clientHeight) * clientHeight;\n\n    } else {\n\n      self.__minDecelerationScrollLeft = 0;\n      self.__minDecelerationScrollTop = 0;\n      self.__maxDecelerationScrollLeft = self.__maxScrollLeft;\n      self.__maxDecelerationScrollTop = self.__maxScrollTop;\n      if (self.__refreshActive) self.__minDecelerationScrollTop = self.__refreshHeight * -1;\n    }\n\n    // Wrap class method\n    var step = function(percent, now, render) {\n      self.__stepThroughDeceleration(render);\n    };\n\n    // How much velocity is required to keep the deceleration running\n    self.__minVelocityToKeepDecelerating = self.options.snapping ? 4 : 0.1;\n\n    // Detect whether it's still worth to continue animating steps\n    // If we are already slow enough to not being user perceivable anymore, we stop the whole process here.\n    var verify = function() {\n      var shouldContinue = Math.abs(self.__decelerationVelocityX) >= self.__minVelocityToKeepDecelerating ||\n        Math.abs(self.__decelerationVelocityY) >= self.__minVelocityToKeepDecelerating;\n      if (!shouldContinue) {\n        self.__didDecelerationComplete = true;\n\n        //Make sure the scroll values are within the boundaries after a bounce,\n        //not below 0 or above maximum\n        if (self.options.bouncing && !self.__refreshActive) {\n          self.scrollTo(\n            Math.min( Math.max(self.__scrollLeft, 0), self.__maxScrollLeft ),\n            Math.min( Math.max(self.__scrollTop, 0), self.__maxScrollTop ),\n            self.__refreshActive\n          );\n        }\n      }\n      return shouldContinue;\n    };\n\n    var completed = function() {\n      self.__isDecelerating = false;\n      if (self.__didDecelerationComplete) {\n        self.__scrollingComplete();\n      }\n\n      // Animate to grid when snapping is active, otherwise just fix out-of-boundary positions\n      if (self.options.paging) {\n        self.scrollTo(self.__scrollLeft, self.__scrollTop, self.options.snapping);\n      }\n    };\n\n    // Start animation and switch on flag\n    self.__isDecelerating = zyngaCore.effect.Animate.start(step, verify, completed);\n\n  },\n\n\n  /**\n   * Called on every step of the animation\n   *\n   * @param inMemory {Boolean} Whether to not render the current step, but keep it in memory only. Used internally only!\n   */\n  __stepThroughDeceleration: function(render) {\n    var self = this;\n\n\n    //\n    // COMPUTE NEXT SCROLL POSITION\n    //\n\n    // Add deceleration to scroll position\n    var scrollLeft = self.__scrollLeft + self.__decelerationVelocityX;// * self.options.deceleration);\n    var scrollTop = self.__scrollTop + self.__decelerationVelocityY;// * self.options.deceleration);\n\n\n    //\n    // HARD LIMIT SCROLL POSITION FOR NON BOUNCING MODE\n    //\n\n    if (!self.options.bouncing) {\n\n      var scrollLeftFixed = Math.max(Math.min(self.__maxDecelerationScrollLeft, scrollLeft), self.__minDecelerationScrollLeft);\n      if (scrollLeftFixed !== scrollLeft) {\n        scrollLeft = scrollLeftFixed;\n        self.__decelerationVelocityX = 0;\n      }\n\n      var scrollTopFixed = Math.max(Math.min(self.__maxDecelerationScrollTop, scrollTop), self.__minDecelerationScrollTop);\n      if (scrollTopFixed !== scrollTop) {\n        scrollTop = scrollTopFixed;\n        self.__decelerationVelocityY = 0;\n      }\n\n    }\n\n\n    //\n    // UPDATE SCROLL POSITION\n    //\n\n    if (render) {\n\n      self.__publish(scrollLeft, scrollTop, self.__zoomLevel);\n\n    } else {\n\n      self.__scrollLeft = scrollLeft;\n      self.__scrollTop = scrollTop;\n\n    }\n\n\n    //\n    // SLOW DOWN\n    //\n\n    // Slow down velocity on every iteration\n    if (!self.options.paging) {\n\n      // This is the factor applied to every iteration of the animation\n      // to slow down the process. This should emulate natural behavior where\n      // objects slow down when the initiator of the movement is removed\n      var frictionFactor = self.options.deceleration;\n\n      self.__decelerationVelocityX *= frictionFactor;\n      self.__decelerationVelocityY *= frictionFactor;\n\n    }\n\n\n    //\n    // BOUNCING SUPPORT\n    //\n\n    if (self.options.bouncing) {\n\n      var scrollOutsideX = 0;\n      var scrollOutsideY = 0;\n\n      // This configures the amount of change applied to deceleration/acceleration when reaching boundaries\n      var penetrationDeceleration = self.options.penetrationDeceleration;\n      var penetrationAcceleration = self.options.penetrationAcceleration;\n\n      // Check limits\n      if (scrollLeft < self.__minDecelerationScrollLeft) {\n        scrollOutsideX = self.__minDecelerationScrollLeft - scrollLeft;\n      } else if (scrollLeft > self.__maxDecelerationScrollLeft) {\n        scrollOutsideX = self.__maxDecelerationScrollLeft - scrollLeft;\n      }\n\n      if (scrollTop < self.__minDecelerationScrollTop) {\n        scrollOutsideY = self.__minDecelerationScrollTop - scrollTop;\n      } else if (scrollTop > self.__maxDecelerationScrollTop) {\n        scrollOutsideY = self.__maxDecelerationScrollTop - scrollTop;\n      }\n\n      // Slow down until slow enough, then flip back to snap position\n      if (scrollOutsideX !== 0) {\n        var isHeadingOutwardsX = scrollOutsideX * self.__decelerationVelocityX <= self.__minDecelerationScrollLeft;\n        if (isHeadingOutwardsX) {\n          self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;\n        }\n        var isStoppedX = Math.abs(self.__decelerationVelocityX) <= self.__minVelocityToKeepDecelerating;\n        //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds\n        if (!isHeadingOutwardsX || isStoppedX) {\n          self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;\n        }\n      }\n\n      if (scrollOutsideY !== 0) {\n        var isHeadingOutwardsY = scrollOutsideY * self.__decelerationVelocityY <= self.__minDecelerationScrollTop;\n        if (isHeadingOutwardsY) {\n          self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;\n        }\n        var isStoppedY = Math.abs(self.__decelerationVelocityY) <= self.__minVelocityToKeepDecelerating;\n        //If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds\n        if (!isHeadingOutwardsY || isStoppedY) {\n          self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;\n        }\n      }\n    }\n  },\n\n\n  /**\n   * calculate the distance between two touches\n   * @param   {Touch}     touch1\n   * @param   {Touch}     touch2\n   * @returns {Number}    distance\n   */\n  __getDistance: function getDistance(touch1, touch2) {\n    var x = touch2.pageX - touch1.pageX,\n    y = touch2.pageY - touch1.pageY;\n    return Math.sqrt((x * x) + (y * y));\n  },\n\n\n  /**\n   * calculate the scale factor between two touchLists (fingers)\n   * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n   * @param   {Array}     start\n   * @param   {Array}     end\n   * @returns {Number}    scale\n   */\n  __getScale: function getScale(start, end) {\n    // need two fingers...\n    if (start.length >= 2 && end.length >= 2) {\n      return this.__getDistance(end[0], end[1]) /\n        this.__getDistance(start[0], start[1]);\n    }\n    return 1;\n  }\n});\n\nionic.scroll = {\n  isScrolling: false,\n  lastTop: 0\n};\n\n})(ionic);\n\n(function(ionic) {\n  var NOOP = function() {};\n  var depreciated = function(name) {\n    void 0;\n  };\n  ionic.views.ScrollNative = ionic.views.View.inherit({\n\n    initialize: function(options) {\n      var self = this;\n      self.__container = self.el = options.el;\n      self.__content = options.el.firstElementChild;\n      self.isNative = true;\n\n      self.__scrollTop = self.el.scrollTop;\n      self.__scrollLeft = self.el.scrollLeft;\n      self.__clientHeight = self.__content.clientHeight;\n      self.__clientWidth = self.__content.clientWidth;\n      self.__maxScrollTop = Math.max((self.__contentHeight) - self.__clientHeight, 0);\n      self.__maxScrollLeft = Math.max((self.__contentWidth) - self.__clientWidth, 0);\n\n      self.options = {\n\n        freeze: false,\n\n        getContentWidth: function() {\n          return Math.max(self.__content.scrollWidth, self.__content.offsetWidth);\n        },\n\n        getContentHeight: function() {\n          return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));\n        }\n\n      };\n\n      for (var key in options) {\n        self.options[key] = options[key];\n      }\n\n      /**\n       * Sets isScrolling to true, and automatically deactivates if not called again in 80ms.\n       */\n      self.onScroll = function() {\n        if (!ionic.scroll.isScrolling) {\n          ionic.scroll.isScrolling = true;\n        }\n\n        clearTimeout(self.scrollTimer);\n        self.scrollTimer = setTimeout(function() {\n          ionic.scroll.isScrolling = false;\n        }, 80);\n      };\n\n      self.freeze = NOOP;\n\n      self.__initEventHandlers();\n    },\n\n    /**  Methods not used in native scrolling */\n    __callback: function() { depreciated('__callback'); },\n    zoomTo: function() { depreciated('zoomTo'); },\n    zoomBy: function() { depreciated('zoomBy'); },\n    activatePullToRefresh: function() { depreciated('activatePullToRefresh'); },\n\n    /**\n     * Returns the scroll position and zooming values\n     *\n     * @return {Map} `left` and `top` scroll position and `zoom` level\n     */\n    resize: function(continueScrolling) {\n      var self = this;\n      if (!self.__container || !self.options) return;\n\n      // Update Scroller dimensions for changed content\n      // Add padding to bottom of content\n      self.setDimensions(\n        self.__container.clientWidth,\n        self.__container.clientHeight,\n        self.options.getContentWidth(),\n        self.options.getContentHeight(),\n        continueScrolling\n      );\n    },\n\n    /**\n     * Initialize the scrollview\n     * In native scrolling, this only means we need to gather size information\n     */\n    run: function() {\n      this.resize();\n    },\n\n    /**\n     * Returns the scroll position and zooming values\n     *\n     * @return {Map} `left` and `top` scroll position and `zoom` level\n     */\n    getValues: function() {\n      var self = this;\n      self.update();\n      return {\n        left: self.__scrollLeft,\n        top: self.__scrollTop,\n        zoom: 1\n      };\n    },\n\n    /**\n     * Updates the __scrollLeft and __scrollTop values to el's current value\n     */\n    update: function() {\n      var self = this;\n      self.__scrollLeft = self.el.scrollLeft;\n      self.__scrollTop = self.el.scrollTop;\n    },\n\n    /**\n     * Configures the dimensions of the client (outer) and content (inner) elements.\n     * Requires the available space for the outer element and the outer size of the inner element.\n     * All values which are falsy (null or zero etc.) are ignored and the old value is kept.\n     *\n     * @param clientWidth {Integer} Inner width of outer element\n     * @param clientHeight {Integer} Inner height of outer element\n     * @param contentWidth {Integer} Outer width of inner element\n     * @param contentHeight {Integer} Outer height of inner element\n     */\n    setDimensions: function(clientWidth, clientHeight, contentWidth, contentHeight) {\n      var self = this;\n\n      if (!clientWidth && !clientHeight && !contentWidth && !contentHeight) {\n        // this scrollview isn't rendered, don't bother\n        return;\n      }\n\n      // Only update values which are defined\n      if (clientWidth === +clientWidth) {\n        self.__clientWidth = clientWidth;\n      }\n\n      if (clientHeight === +clientHeight) {\n        self.__clientHeight = clientHeight;\n      }\n\n      if (contentWidth === +contentWidth) {\n        self.__contentWidth = contentWidth;\n      }\n\n      if (contentHeight === +contentHeight) {\n        self.__contentHeight = contentHeight;\n      }\n\n      // Refresh maximums\n      self.__computeScrollMax();\n    },\n\n    /**\n     * Returns the maximum scroll values\n     *\n     * @return {Map} `left` and `top` maximum scroll values\n     */\n    getScrollMax: function() {\n      return {\n        left: this.__maxScrollLeft,\n        top: this.__maxScrollTop\n      };\n    },\n\n    /**\n     * Scrolls by the given amount in px.\n     *\n     * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n     * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n     * @param animate {Boolean} Whether the scrolling should happen using an animation\n     */\n\n    scrollBy: function(left, top, animate) {\n      var self = this;\n\n      // update scroll vars before refferencing them\n      self.update();\n\n      var startLeft = self.__isAnimating ? self.__scheduledLeft : self.__scrollLeft;\n      var startTop = self.__isAnimating ? self.__scheduledTop : self.__scrollTop;\n\n      self.scrollTo(startLeft + (left || 0), startTop + (top || 0), animate);\n    },\n\n    /**\n     * Scrolls to the given position in px.\n     *\n     * @param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>\n     * @param top {Number} Vertical scroll position, keeps current if value is <code>null</code>\n     * @param animate {Boolean} Whether the scrolling should happen using an animation\n     */\n    scrollTo: function(left, top, animate) {\n      var self = this;\n      if (!animate) {\n        self.el.scrollTop = top;\n        self.el.scrollLeft = left;\n        self.resize();\n        return;\n      }\n      animateScroll(top, left);\n\n      function animateScroll(Y, X) {\n        // scroll animation loop w/ easing\n        // credit https://gist.github.com/dezinezync/5487119\n        var start = Date.now(),\n          duration = 1000, //milliseconds\n          fromY = self.el.scrollTop,\n          fromX = self.el.scrollLeft;\n\n        if (fromY === Y && fromX === X) {\n          self.resize();\n          return; /* Prevent scrolling to the Y point if already there */\n        }\n\n        // decelerating to zero velocity\n        function easeOutCubic(t) {\n          return (--t) * t * t + 1;\n        }\n\n        // scroll loop\n        function animateScrollStep() {\n          var currentTime = Date.now(),\n            time = Math.min(1, ((currentTime - start) / duration)),\n          // where .5 would be 50% of time on a linear scale easedT gives a\n          // fraction based on the easing method\n            easedT = easeOutCubic(time);\n\n          if (fromY != Y) {\n            self.el.scrollTop = parseInt((easedT * (Y - fromY)) + fromY, 10);\n          }\n          if (fromX != X) {\n            self.el.scrollLeft = parseInt((easedT * (X - fromX)) + fromX, 10);\n          }\n\n          if (time < 1) {\n            ionic.requestAnimationFrame(animateScrollStep);\n\n          } else {\n            // done\n            self.resize();\n          }\n        }\n\n        // start scroll loop\n        ionic.requestAnimationFrame(animateScrollStep);\n      }\n    },\n\n\n\n    /*\n     ---------------------------------------------------------------------------\n     PRIVATE API\n     ---------------------------------------------------------------------------\n     */\n\n    /**\n     * If the scroll view isn't sized correctly on start, wait until we have at least some size\n     */\n    __waitForSize: function() {\n      var self = this;\n\n      clearTimeout(self.__sizerTimeout);\n\n      var sizer = function() {\n        self.resize(true);\n      };\n\n      sizer();\n      self.__sizerTimeout = setTimeout(sizer, 500);\n    },\n\n\n    /**\n     * Recomputes scroll minimum values based on client dimensions and content dimensions.\n     */\n    __computeScrollMax: function() {\n      var self = this;\n\n      self.__maxScrollLeft = Math.max((self.__contentWidth) - self.__clientWidth, 0);\n      self.__maxScrollTop = Math.max((self.__contentHeight) - self.__clientHeight, 0);\n\n      if (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {\n        self.__didWaitForSize = true;\n        self.__waitForSize();\n      }\n    },\n\n    __initEventHandlers: function() {\n      var self = this;\n\n      // Event Handler\n      var container = self.__container;\n\n      // should be unnecessary in native scrolling, but keep in case bugs show up\n      self.scrollChildIntoView = NOOP;\n\n      self.resetScrollView = function() {\n        //return scrollview to original height once keyboard has hidden\n        if (self.isScrolledIntoView) {\n          self.isScrolledIntoView = false;\n          container.style.height = \"\";\n          container.style.overflow = \"\";\n          self.resize();\n          ionic.scroll.isScrolling = false;\n        }\n      };\n\n      container.addEventListener('resetScrollView', self.resetScrollView);\n      container.addEventListener('scroll', self.onScroll);\n\n      //Broadcasted when keyboard is shown on some platforms.\n      //See js/utils/keyboard.js\n      container.addEventListener('scrollChildIntoView', self.scrollChildIntoView);\n      container.addEventListener('resetScrollView', self.resetScrollView);\n    },\n\n    __cleanup: function() {\n      var self = this;\n      var container = self.__container;\n\n      container.removeEventListener('resetScrollView', self.resetScrollView);\n      container.removeEventListener('scroll', self.onScroll);\n\n      container.removeEventListener('scrollChildIntoView', self.scrollChildIntoView);\n      container.removeEventListener('resetScrollView', self.resetScrollView);\n\n      ionic.tap.removeClonedInputs(container, self);\n\n      delete self.__container;\n      delete self.__content;\n      delete self.__indicatorX;\n      delete self.__indicatorY;\n      delete self.options.el;\n\n      self.resize = self.scrollTo = self.onScroll = self.resetScrollView = NOOP;\n      container = null;\n    }\n  });\n\n})(ionic);\n\n\n(function(ionic) {\n'use strict';\n\n  var ITEM_CLASS = 'item';\n  var ITEM_CONTENT_CLASS = 'item-content';\n  var ITEM_SLIDING_CLASS = 'item-sliding';\n  var ITEM_OPTIONS_CLASS = 'item-options';\n  var ITEM_PLACEHOLDER_CLASS = 'item-placeholder';\n  var ITEM_REORDERING_CLASS = 'item-reordering';\n  var ITEM_REORDER_BTN_CLASS = 'item-reorder';\n\n  var DragOp = function() {};\n  DragOp.prototype = {\n    start: function(){},\n    drag: function(){},\n    end: function(){},\n    isSameItem: function() {\n      return false;\n    }\n  };\n\n  var SlideDrag = function(opts) {\n    this.dragThresholdX = opts.dragThresholdX || 10;\n    this.el = opts.el;\n    this.item = opts.item;\n    this.canSwipe = opts.canSwipe;\n  };\n\n  SlideDrag.prototype = new DragOp();\n\n  SlideDrag.prototype.start = function(e) {\n    var content, buttons, offsetX, buttonsWidth;\n\n    if (!this.canSwipe()) {\n      return;\n    }\n\n    if (e.target.classList.contains(ITEM_CONTENT_CLASS)) {\n      content = e.target;\n    } else if (e.target.classList.contains(ITEM_CLASS)) {\n      content = e.target.querySelector('.' + ITEM_CONTENT_CLASS);\n    } else {\n      content = ionic.DomUtil.getParentWithClass(e.target, ITEM_CONTENT_CLASS);\n    }\n\n    // If we don't have a content area as one of our children (or ourselves), skip\n    if (!content) {\n      return;\n    }\n\n    // Make sure we aren't animating as we slide\n    content.classList.remove(ITEM_SLIDING_CLASS);\n\n    // Grab the starting X point for the item (for example, so we can tell whether it is open or closed to start)\n    offsetX = parseFloat(content.style[ionic.CSS.TRANSFORM].replace('translate3d(', '').split(',')[0]) || 0;\n\n    // Grab the buttons\n    buttons = content.parentNode.querySelector('.' + ITEM_OPTIONS_CLASS);\n    if (!buttons) {\n      return;\n    }\n    buttons.classList.remove('invisible');\n\n    buttonsWidth = buttons.offsetWidth;\n\n    this._currentDrag = {\n      buttons: buttons,\n      buttonsWidth: buttonsWidth,\n      content: content,\n      startOffsetX: offsetX\n    };\n  };\n\n  /**\n   * Check if this is the same item that was previously dragged.\n   */\n  SlideDrag.prototype.isSameItem = function(op) {\n    if (op._lastDrag && this._currentDrag) {\n      return this._currentDrag.content == op._lastDrag.content;\n    }\n    return false;\n  };\n\n  SlideDrag.prototype.clean = function(isInstant) {\n    var lastDrag = this._lastDrag;\n\n    if (!lastDrag || !lastDrag.content) return;\n\n    lastDrag.content.style[ionic.CSS.TRANSITION] = '';\n    lastDrag.content.style[ionic.CSS.TRANSFORM] = '';\n    if (isInstant) {\n      lastDrag.content.style[ionic.CSS.TRANSITION] = 'none';\n      makeInvisible();\n      ionic.requestAnimationFrame(function() {\n        lastDrag.content.style[ionic.CSS.TRANSITION] = '';\n      });\n    } else {\n      ionic.requestAnimationFrame(function() {\n        setTimeout(makeInvisible, 250);\n      });\n    }\n    function makeInvisible() {\n      lastDrag.buttons && lastDrag.buttons.classList.add('invisible');\n    }\n  };\n\n  SlideDrag.prototype.drag = ionic.animationFrameThrottle(function(e) {\n    var buttonsWidth;\n\n    // We really aren't dragging\n    if (!this._currentDrag) {\n      return;\n    }\n\n    // Check if we should start dragging. Check if we've dragged past the threshold,\n    // or we are starting from the open state.\n    if (!this._isDragging &&\n        ((Math.abs(e.gesture.deltaX) > this.dragThresholdX) ||\n        (Math.abs(this._currentDrag.startOffsetX) > 0))) {\n      this._isDragging = true;\n    }\n\n    if (this._isDragging) {\n      buttonsWidth = this._currentDrag.buttonsWidth;\n\n      // Grab the new X point, capping it at zero\n      var newX = Math.min(0, this._currentDrag.startOffsetX + e.gesture.deltaX);\n\n      // If the new X position is past the buttons, we need to slow down the drag (rubber band style)\n      if (newX < -buttonsWidth) {\n        // Calculate the new X position, capped at the top of the buttons\n        newX = Math.min(-buttonsWidth, -buttonsWidth + (((e.gesture.deltaX + buttonsWidth) * 0.4)));\n      }\n\n      this._currentDrag.content.$$ionicOptionsOpen = newX !== 0;\n\n      this._currentDrag.content.style[ionic.CSS.TRANSFORM] = 'translate3d(' + newX + 'px, 0, 0)';\n      this._currentDrag.content.style[ionic.CSS.TRANSITION] = 'none';\n    }\n  });\n\n  SlideDrag.prototype.end = function(e, doneCallback) {\n    var self = this;\n\n    // There is no drag, just end immediately\n    if (!self._currentDrag) {\n      doneCallback && doneCallback();\n      return;\n    }\n\n    // If we are currently dragging, we want to snap back into place\n    // The final resting point X will be the width of the exposed buttons\n    var restingPoint = -self._currentDrag.buttonsWidth;\n\n    // Check if the drag didn't clear the buttons mid-point\n    // and we aren't moving fast enough to swipe open\n    if (e.gesture.deltaX > -(self._currentDrag.buttonsWidth / 2)) {\n\n      // If we are going left but too slow, or going right, go back to resting\n      if (e.gesture.direction == \"left\" && Math.abs(e.gesture.velocityX) < 0.3) {\n        restingPoint = 0;\n\n      } else if (e.gesture.direction == \"right\") {\n        restingPoint = 0;\n      }\n\n    }\n\n    ionic.requestAnimationFrame(function() {\n      if (restingPoint === 0) {\n        self._currentDrag.content.style[ionic.CSS.TRANSFORM] = '';\n        var buttons = self._currentDrag.buttons;\n        setTimeout(function() {\n          buttons && buttons.classList.add('invisible');\n        }, 250);\n      } else {\n        self._currentDrag.content.style[ionic.CSS.TRANSFORM] = 'translate3d(' + restingPoint + 'px,0,0)';\n      }\n      self._currentDrag.content.style[ionic.CSS.TRANSITION] = '';\n\n\n      // Kill the current drag\n      if (!self._lastDrag) {\n        self._lastDrag = {};\n      }\n      ionic.extend(self._lastDrag, self._currentDrag);\n      if (self._currentDrag) {\n        self._currentDrag.buttons = null;\n        self._currentDrag.content = null;\n      }\n      self._currentDrag = null;\n\n      // We are done, notify caller\n      doneCallback && doneCallback();\n    });\n  };\n\n  var ReorderDrag = function(opts) {\n    var self = this;\n\n    self.dragThresholdY = opts.dragThresholdY || 0;\n    self.onReorder = opts.onReorder;\n    self.listEl = opts.listEl;\n    self.el = self.item = opts.el;\n    self.scrollEl = opts.scrollEl;\n    self.scrollView = opts.scrollView;\n    // Get the True Top of the list el http://www.quirksmode.org/js/findpos.html\n    self.listElTrueTop = 0;\n    if (self.listEl.offsetParent) {\n      var obj = self.listEl;\n      do {\n        self.listElTrueTop += obj.offsetTop;\n        obj = obj.offsetParent;\n      } while (obj);\n    }\n  };\n\n  ReorderDrag.prototype = new DragOp();\n\n  ReorderDrag.prototype._moveElement = function(e) {\n    var y = e.gesture.center.pageY +\n      this.scrollView.getValues().top -\n      (this._currentDrag.elementHeight / 2) -\n      this.listElTrueTop;\n    this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, ' + y + 'px, 0)';\n  };\n\n  ReorderDrag.prototype.deregister = function() {\n    this.listEl = this.el = this.scrollEl = this.scrollView = null;\n  };\n\n  ReorderDrag.prototype.start = function(e) {\n\n    var startIndex = ionic.DomUtil.getChildIndex(this.el, this.el.nodeName.toLowerCase());\n    var elementHeight = this.el.scrollHeight;\n    var placeholder = this.el.cloneNode(true);\n\n    placeholder.classList.add(ITEM_PLACEHOLDER_CLASS);\n\n    this.el.parentNode.insertBefore(placeholder, this.el);\n    this.el.classList.add(ITEM_REORDERING_CLASS);\n\n    this._currentDrag = {\n      elementHeight: elementHeight,\n      startIndex: startIndex,\n      placeholder: placeholder,\n      scrollHeight: scroll,\n      list: placeholder.parentNode\n    };\n\n    this._moveElement(e);\n  };\n\n  ReorderDrag.prototype.drag = ionic.animationFrameThrottle(function(e) {\n    // We really aren't dragging\n    var self = this;\n    if (!this._currentDrag) {\n      return;\n    }\n\n    var scrollY = 0;\n    var pageY = e.gesture.center.pageY;\n    var offset = this.listElTrueTop;\n\n    //If we have a scrollView, check scroll boundaries for dragged element and scroll if necessary\n    if (this.scrollView) {\n\n      var container = this.scrollView.__container;\n      scrollY = this.scrollView.getValues().top;\n\n      var containerTop = container.offsetTop;\n      var pixelsPastTop = containerTop - pageY + this._currentDrag.elementHeight / 2;\n      var pixelsPastBottom = pageY + this._currentDrag.elementHeight / 2 - containerTop - container.offsetHeight;\n\n      if (e.gesture.deltaY < 0 && pixelsPastTop > 0 && scrollY > 0) {\n        this.scrollView.scrollBy(null, -pixelsPastTop);\n        //Trigger another drag so the scrolling keeps going\n        ionic.requestAnimationFrame(function() {\n          self.drag(e);\n        });\n      }\n      if (e.gesture.deltaY > 0 && pixelsPastBottom > 0) {\n        if (scrollY < this.scrollView.getScrollMax().top) {\n          this.scrollView.scrollBy(null, pixelsPastBottom);\n          //Trigger another drag so the scrolling keeps going\n          ionic.requestAnimationFrame(function() {\n            self.drag(e);\n          });\n        }\n      }\n    }\n\n    // Check if we should start dragging. Check if we've dragged past the threshold,\n    // or we are starting from the open state.\n    if (!this._isDragging && Math.abs(e.gesture.deltaY) > this.dragThresholdY) {\n      this._isDragging = true;\n    }\n\n    if (this._isDragging) {\n      this._moveElement(e);\n\n      this._currentDrag.currentY = scrollY + pageY - offset;\n\n      // this._reorderItems();\n    }\n  });\n\n  // When an item is dragged, we need to reorder any items for sorting purposes\n  ReorderDrag.prototype._getReorderIndex = function() {\n    var self = this;\n\n    var siblings = Array.prototype.slice.call(self._currentDrag.placeholder.parentNode.children)\n      .filter(function(el) {\n        return el.nodeName === self.el.nodeName && el !== self.el;\n      });\n\n    var dragOffsetTop = self._currentDrag.currentY;\n    var el;\n    for (var i = 0, len = siblings.length; i < len; i++) {\n      el = siblings[i];\n      if (i === len - 1) {\n        if (dragOffsetTop > el.offsetTop) {\n          return i;\n        }\n      } else if (i === 0) {\n        if (dragOffsetTop < el.offsetTop + el.offsetHeight) {\n          return i;\n        }\n      } else if (dragOffsetTop > el.offsetTop - el.offsetHeight / 2 &&\n                 dragOffsetTop < el.offsetTop + el.offsetHeight) {\n        return i;\n      }\n    }\n    return self._currentDrag.startIndex;\n  };\n\n  ReorderDrag.prototype.end = function(e, doneCallback) {\n    if (!this._currentDrag) {\n      doneCallback && doneCallback();\n      return;\n    }\n\n    var placeholder = this._currentDrag.placeholder;\n    var finalIndex = this._getReorderIndex();\n\n    // Reposition the element\n    this.el.classList.remove(ITEM_REORDERING_CLASS);\n    this.el.style[ionic.CSS.TRANSFORM] = '';\n\n    placeholder.parentNode.insertBefore(this.el, placeholder);\n    placeholder.parentNode.removeChild(placeholder);\n\n    this.onReorder && this.onReorder(this.el, this._currentDrag.startIndex, finalIndex);\n\n    this._currentDrag = {\n      placeholder: null,\n      content: null\n    };\n    this._currentDrag = null;\n    doneCallback && doneCallback();\n  };\n\n\n\n  /**\n   * The ListView handles a list of items. It will process drag animations, edit mode,\n   * and other operations that are common on mobile lists or table views.\n   */\n  ionic.views.ListView = ionic.views.View.inherit({\n    initialize: function(opts) {\n      var self = this;\n\n      opts = ionic.extend({\n        onReorder: function() {},\n        virtualRemoveThreshold: -200,\n        virtualAddThreshold: 200,\n        canSwipe: function() {\n          return true;\n        }\n      }, opts);\n\n      ionic.extend(self, opts);\n\n      if (!self.itemHeight && self.listEl) {\n        self.itemHeight = self.listEl.children[0] && parseInt(self.listEl.children[0].style.height, 10);\n      }\n\n      self.onRefresh = opts.onRefresh || function() {};\n      self.onRefreshOpening = opts.onRefreshOpening || function() {};\n      self.onRefreshHolding = opts.onRefreshHolding || function() {};\n\n      var gestureOpts = {};\n      // don't prevent native scrolling\n      if (ionic.DomUtil.getParentOrSelfWithClass(self.el, 'overflow-scroll')) {\n        gestureOpts.prevent_default_directions = ['left', 'right'];\n      }\n\n      window.ionic.onGesture('release', function(e) {\n        self._handleEndDrag(e);\n      }, self.el, gestureOpts);\n\n      window.ionic.onGesture('drag', function(e) {\n        self._handleDrag(e);\n      }, self.el, gestureOpts);\n      // Start the drag states\n      self._initDrag();\n    },\n\n    /**\n     * Be sure to cleanup references.\n     */\n    deregister: function() {\n      this.el = this.listEl = this.scrollEl = this.scrollView = null;\n\n      // ensure no scrolls have been left frozen\n      if (this.isScrollFreeze) {\n        self.scrollView.freeze(false);\n      }\n    },\n\n    /**\n     * Called to tell the list to stop refreshing. This is useful\n     * if you are refreshing the list and are done with refreshing.\n     */\n    stopRefreshing: function() {\n      var refresher = this.el.querySelector('.list-refresher');\n      refresher.style.height = '0';\n    },\n\n    /**\n     * If we scrolled and have virtual mode enabled, compute the window\n     * of active elements in order to figure out the viewport to render.\n     */\n    didScroll: function(e) {\n      var self = this;\n\n      if (self.isVirtual) {\n        var itemHeight = self.itemHeight;\n\n        // Grab the total height of the list\n        var scrollHeight = e.target.scrollHeight;\n\n        // Get the viewport height\n        var viewportHeight = self.el.parentNode.offsetHeight;\n\n        // High water is the pixel position of the first element to include (everything before\n        // that will be removed)\n        var highWater = Math.max(0, e.scrollTop + self.virtualRemoveThreshold);\n\n        // Low water is the pixel position of the last element to include (everything after\n        // that will be removed)\n        var lowWater = Math.min(scrollHeight, Math.abs(e.scrollTop) + viewportHeight + self.virtualAddThreshold);\n\n        // Get the first and last elements in the list based on how many can fit\n        // between the pixel range of lowWater and highWater\n        var first = parseInt(Math.abs(highWater / itemHeight), 10);\n        var last = parseInt(Math.abs(lowWater / itemHeight), 10);\n\n        // Get the items we need to remove\n        self._virtualItemsToRemove = Array.prototype.slice.call(self.listEl.children, 0, first);\n\n        self.renderViewport && self.renderViewport(highWater, lowWater, first, last);\n      }\n    },\n\n    didStopScrolling: function() {\n      if (this.isVirtual) {\n        for (var i = 0; i < this._virtualItemsToRemove.length; i++) {\n          //el.parentNode.removeChild(el);\n          this.didHideItem && this.didHideItem(i);\n        }\n        // Once scrolling stops, check if we need to remove old items\n\n      }\n    },\n\n    /**\n     * Clear any active drag effects on the list.\n     */\n    clearDragEffects: function(isInstant) {\n      if (this._lastDragOp) {\n        this._lastDragOp.clean && this._lastDragOp.clean(isInstant);\n        this._lastDragOp.deregister && this._lastDragOp.deregister();\n        this._lastDragOp = null;\n      }\n    },\n\n    _initDrag: function() {\n      // Store the last one\n      if (this._lastDragOp) {\n        this._lastDragOp.deregister && this._lastDragOp.deregister();\n      }\n      this._lastDragOp = this._dragOp;\n\n      this._dragOp = null;\n    },\n\n    // Return the list item from the given target\n    _getItem: function(target) {\n      while (target) {\n        if (target.classList && target.classList.contains(ITEM_CLASS)) {\n          return target;\n        }\n        target = target.parentNode;\n      }\n      return null;\n    },\n\n\n    _startDrag: function(e) {\n      var self = this;\n\n      self._isDragging = false;\n\n      var lastDragOp = self._lastDragOp;\n      var item;\n\n      // If we have an open SlideDrag and we're scrolling the list. Clear it.\n      if (self._didDragUpOrDown && lastDragOp instanceof SlideDrag) {\n          lastDragOp.clean && lastDragOp.clean();\n      }\n\n      // Check if this is a reorder drag\n      if (ionic.DomUtil.getParentOrSelfWithClass(e.target, ITEM_REORDER_BTN_CLASS) && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {\n        item = self._getItem(e.target);\n\n        if (item) {\n          self._dragOp = new ReorderDrag({\n            listEl: self.el,\n            el: item,\n            scrollEl: self.scrollEl,\n            scrollView: self.scrollView,\n            onReorder: function(el, start, end) {\n              self.onReorder && self.onReorder(el, start, end);\n            }\n          });\n          self._dragOp.start(e);\n          e.preventDefault();\n        }\n      }\n\n      // Or check if this is a swipe to the side drag\n      else if (!self._didDragUpOrDown && (e.gesture.direction == 'left' || e.gesture.direction == 'right') && Math.abs(e.gesture.deltaX) > 5) {\n\n        // Make sure this is an item with buttons\n        item = self._getItem(e.target);\n        if (item && item.querySelector('.item-options')) {\n          self._dragOp = new SlideDrag({\n            el: self.el,\n            item: item,\n            canSwipe: self.canSwipe\n          });\n          self._dragOp.start(e);\n          e.preventDefault();\n          self.isScrollFreeze = self.scrollView.freeze(true);\n        }\n      }\n\n      // If we had a last drag operation and this is a new one on a different item, clean that last one\n      if (lastDragOp && self._dragOp && !self._dragOp.isSameItem(lastDragOp) && e.defaultPrevented) {\n        lastDragOp.clean && lastDragOp.clean();\n      }\n    },\n\n\n    _handleEndDrag: function(e) {\n      var self = this;\n\n      if (self.scrollView) {\n        self.isScrollFreeze = self.scrollView.freeze(false);\n      }\n\n      self._didDragUpOrDown = false;\n\n      if (!self._dragOp) {\n        return;\n      }\n\n      self._dragOp.end(e, function() {\n        self._initDrag();\n      });\n    },\n\n    /**\n     * Process the drag event to move the item to the left or right.\n     */\n    _handleDrag: function(e) {\n      var self = this;\n\n      if (Math.abs(e.gesture.deltaY) > 5) {\n        self._didDragUpOrDown = true;\n      }\n\n      // If we get a drag event, make sure we aren't in another drag, then check if we should\n      // start one\n      if (!self.isDragging && !self._dragOp) {\n        self._startDrag(e);\n      }\n\n      // No drag still, pass it up\n      if (!self._dragOp) {\n        return;\n      }\n\n      e.gesture.srcEvent.preventDefault();\n      self._dragOp.drag(e);\n    }\n\n  });\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  ionic.views.Modal = ionic.views.View.inherit({\n    initialize: function(opts) {\n      opts = ionic.extend({\n        focusFirstInput: false,\n        unfocusOnHide: true,\n        focusFirstDelay: 600,\n        backdropClickToClose: true,\n        hardwareBackButtonClose: true,\n      }, opts);\n\n      ionic.extend(this, opts);\n\n      this.el = opts.el;\n    },\n    show: function() {\n      var self = this;\n\n      if(self.focusFirstInput) {\n        // Let any animations run first\n        window.setTimeout(function() {\n          var input = self.el.querySelector('input, textarea');\n          input && input.focus && input.focus();\n        }, self.focusFirstDelay);\n      }\n    },\n    hide: function() {\n      // Unfocus all elements\n      if(this.unfocusOnHide) {\n        var inputs = this.el.querySelectorAll('input, textarea');\n        // Let any animations run first\n        window.setTimeout(function() {\n          for(var i = 0; i < inputs.length; i++) {\n            inputs[i].blur && inputs[i].blur();\n          }\n        });\n      }\n    }\n  });\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  /**\n   * The side menu view handles one of the side menu's in a Side Menu Controller\n   * configuration.\n   * It takes a DOM reference to that side menu element.\n   */\n  ionic.views.SideMenu = ionic.views.View.inherit({\n    initialize: function(opts) {\n      this.el = opts.el;\n      this.isEnabled = (typeof opts.isEnabled === 'undefined') ? true : opts.isEnabled;\n      this.setWidth(opts.width);\n    },\n    getFullWidth: function() {\n      return this.width;\n    },\n    setWidth: function(width) {\n      this.width = width;\n      this.el.style.width = width + 'px';\n    },\n    setIsEnabled: function(isEnabled) {\n      this.isEnabled = isEnabled;\n    },\n    bringUp: function() {\n      if(this.el.style.zIndex !== '0') {\n        this.el.style.zIndex = '0';\n      }\n    },\n    pushDown: function() {\n      if(this.el.style.zIndex !== '-1') {\n        this.el.style.zIndex = '-1';\n      }\n    }\n  });\n\n  ionic.views.SideMenuContent = ionic.views.View.inherit({\n    initialize: function(opts) {\n      ionic.extend(this, {\n        animationClass: 'menu-animated',\n        onDrag: function() {},\n        onEndDrag: function() {}\n      }, opts);\n\n      ionic.onGesture('drag', ionic.proxy(this._onDrag, this), this.el);\n      ionic.onGesture('release', ionic.proxy(this._onEndDrag, this), this.el);\n    },\n    _onDrag: function(e) {\n      this.onDrag && this.onDrag(e);\n    },\n    _onEndDrag: function(e) {\n      this.onEndDrag && this.onEndDrag(e);\n    },\n    disableAnimation: function() {\n      this.el.classList.remove(this.animationClass);\n    },\n    enableAnimation: function() {\n      this.el.classList.add(this.animationClass);\n    },\n    getTranslateX: function() {\n      return parseFloat(this.el.style[ionic.CSS.TRANSFORM].replace('translate3d(', '').split(',')[0]);\n    },\n    setTranslateX: ionic.animationFrameThrottle(function(x) {\n      this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(' + x + 'px, 0, 0)';\n    })\n  });\n\n})(ionic);\n\n/*\n * Adapted from Swipe.js 2.0\n *\n * Brad Birdsall\n * Copyright 2013, MIT License\n *\n*/\n\n(function(ionic) {\n'use strict';\n\nionic.views.Slider = ionic.views.View.inherit({\n  initialize: function (options) {\n    var slider = this;\n\n    // utilities\n    var noop = function() {}; // simple no operation function\n    var offloadFn = function(fn) { setTimeout(fn || noop, 0); }; // offload a functions execution\n\n    // check browser capabilities\n    var browser = {\n      addEventListener: !!window.addEventListener,\n      touch: ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,\n      transitions: (function(temp) {\n        var props = ['transitionProperty', 'WebkitTransition', 'MozTransition', 'OTransition', 'msTransition'];\n        for ( var i in props ) if (temp.style[ props[i] ] !== undefined) return true;\n        return false;\n      })(document.createElement('swipe'))\n    };\n\n\n    var container = options.el;\n\n    // quit if no root element\n    if (!container) return;\n    var element = container.children[0];\n    var slides, slidePos, width, length;\n    options = options || {};\n    var index = parseInt(options.startSlide, 10) || 0;\n    var speed = options.speed || 300;\n    options.continuous = options.continuous !== undefined ? options.continuous : true;\n\n    function setup() {\n\n      // do not setup if the container has no width\n      if (!container.offsetWidth) {\n        return;\n      }\n\n      // cache slides\n      slides = element.children;\n      length = slides.length;\n\n      // set continuous to false if only one slide\n      if (slides.length < 2) options.continuous = false;\n\n      //special case if two slides\n      if (browser.transitions && options.continuous && slides.length < 3) {\n        element.appendChild(slides[0].cloneNode(true));\n        element.appendChild(element.children[1].cloneNode(true));\n        slides = element.children;\n      }\n\n      // create an array to store current positions of each slide\n      slidePos = new Array(slides.length);\n\n      // determine width of each slide\n      width = container.offsetWidth || container.getBoundingClientRect().width;\n\n      element.style.width = (slides.length * width) + 'px';\n\n      // stack elements\n      var pos = slides.length;\n      while(pos--) {\n\n        var slide = slides[pos];\n\n        slide.style.width = width + 'px';\n        slide.setAttribute('data-index', pos);\n\n        if (browser.transitions) {\n          slide.style.left = (pos * -width) + 'px';\n          move(pos, index > pos ? -width : (index < pos ? width : 0), 0);\n        }\n\n      }\n\n      // reposition elements before and after index\n      if (options.continuous && browser.transitions) {\n        move(circle(index - 1), -width, 0);\n        move(circle(index + 1), width, 0);\n      }\n\n      if (!browser.transitions) element.style.left = (index * -width) + 'px';\n\n      container.style.visibility = 'visible';\n\n      options.slidesChanged && options.slidesChanged();\n    }\n\n    function prev(slideSpeed) {\n\n      if (options.continuous) slide(index - 1, slideSpeed);\n      else if (index) slide(index - 1, slideSpeed);\n\n    }\n\n    function next(slideSpeed) {\n\n      if (options.continuous) slide(index + 1, slideSpeed);\n      else if (index < slides.length - 1) slide(index + 1, slideSpeed);\n\n    }\n\n    function circle(index) {\n\n      // a simple positive modulo using slides.length\n      return (slides.length + (index % slides.length)) % slides.length;\n\n    }\n\n    function slide(to, slideSpeed) {\n\n      // do nothing if already on requested slide\n      if (index == to) return;\n\n      if (browser.transitions) {\n\n        var direction = Math.abs(index - to) / (index - to); // 1: backward, -1: forward\n\n        // get the actual position of the slide\n        if (options.continuous) {\n          var naturalDirection = direction;\n          direction = -slidePos[circle(to)] / width;\n\n          // if going forward but to < index, use to = slides.length + to\n          // if going backward but to > index, use to = -slides.length + to\n          if (direction !== naturalDirection) to = -direction * slides.length + to;\n\n        }\n\n        var diff = Math.abs(index - to) - 1;\n\n        // move all the slides between index and to in the right direction\n        while (diff--) move( circle((to > index ? to : index) - diff - 1), width * direction, 0);\n\n        to = circle(to);\n\n        move(index, width * direction, slideSpeed || speed);\n        move(to, 0, slideSpeed || speed);\n\n        if (options.continuous) move(circle(to - direction), -(width * direction), 0); // we need to get the next in place\n\n      } else {\n\n        to = circle(to);\n        animate(index * -width, to * -width, slideSpeed || speed);\n        //no fallback for a circular continuous if the browser does not accept transitions\n      }\n\n      index = to;\n      offloadFn(options.callback && options.callback(index, slides[index]));\n    }\n\n    function move(index, dist, speed) {\n\n      translate(index, dist, speed);\n      slidePos[index] = dist;\n\n    }\n\n    function translate(index, dist, speed) {\n\n      var slide = slides[index];\n      var style = slide && slide.style;\n\n      if (!style) return;\n\n      style.webkitTransitionDuration =\n      style.MozTransitionDuration =\n      style.msTransitionDuration =\n      style.OTransitionDuration =\n      style.transitionDuration = speed + 'ms';\n\n      style.webkitTransform = 'translate(' + dist + 'px,0)' + 'translateZ(0)';\n      style.msTransform =\n      style.MozTransform =\n      style.OTransform = 'translateX(' + dist + 'px)';\n\n    }\n\n    function animate(from, to, speed) {\n\n      // if not an animation, just reposition\n      if (!speed) {\n\n        element.style.left = to + 'px';\n        return;\n\n      }\n\n      var start = +new Date();\n\n      var timer = setInterval(function() {\n\n        var timeElap = +new Date() - start;\n\n        if (timeElap > speed) {\n\n          element.style.left = to + 'px';\n\n          if (delay) begin();\n\n          options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);\n\n          clearInterval(timer);\n          return;\n\n        }\n\n        element.style.left = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';\n\n      }, 4);\n\n    }\n\n    // setup auto slideshow\n    var delay = options.auto || 0;\n    var interval;\n\n    function begin() {\n\n      interval = setTimeout(next, delay);\n\n    }\n\n    function stop() {\n\n      delay = options.auto || 0;\n      clearTimeout(interval);\n\n    }\n\n\n    // setup initial vars\n    var start = {};\n    var delta = {};\n    var isScrolling;\n\n    // setup event capturing\n    var events = {\n\n      handleEvent: function(event) {\n        if(event.type == 'mousedown' || event.type == 'mouseup' || event.type == 'mousemove') {\n          event.touches = [{\n            pageX: event.pageX,\n            pageY: event.pageY\n          }];\n        }\n\n        switch (event.type) {\n          case 'mousedown': this.start(event); break;\n          case 'touchstart': this.start(event); break;\n          case 'touchmove': this.touchmove(event); break;\n          case 'mousemove': this.touchmove(event); break;\n          case 'touchend': offloadFn(this.end(event)); break;\n          case 'mouseup': offloadFn(this.end(event)); break;\n          case 'webkitTransitionEnd':\n          case 'msTransitionEnd':\n          case 'oTransitionEnd':\n          case 'otransitionend':\n          case 'transitionend': offloadFn(this.transitionEnd(event)); break;\n          case 'resize': offloadFn(setup); break;\n        }\n\n        if (options.stopPropagation) event.stopPropagation();\n\n      },\n      start: function(event) {\n\n        var touches = event.touches[0];\n\n        // measure start values\n        start = {\n\n          // get initial touch coords\n          x: touches.pageX,\n          y: touches.pageY,\n\n          // store time to determine touch duration\n          time: +new Date()\n\n        };\n\n        // used for testing first move event\n        isScrolling = undefined;\n\n        // reset delta and end measurements\n        delta = {};\n\n        // attach touchmove and touchend listeners\n        if(browser.touch) {\n          element.addEventListener('touchmove', this, false);\n          element.addEventListener('touchend', this, false);\n        } else {\n          element.addEventListener('mousemove', this, false);\n          element.addEventListener('mouseup', this, false);\n          document.addEventListener('mouseup', this, false);\n        }\n      },\n      touchmove: function(event) {\n\n        // ensure swiping with one touch and not pinching\n        // ensure sliding is enabled\n        if (event.touches.length > 1 ||\n            event.scale && event.scale !== 1 ||\n            slider.slideIsDisabled) {\n          return;\n        }\n\n        if (options.disableScroll) event.preventDefault();\n\n        var touches = event.touches[0];\n\n        // measure change in x and y\n        delta = {\n          x: touches.pageX - start.x,\n          y: touches.pageY - start.y\n        };\n\n        // determine if scrolling test has run - one time test\n        if ( typeof isScrolling == 'undefined') {\n          isScrolling = !!( isScrolling || Math.abs(delta.x) < Math.abs(delta.y) );\n        }\n\n        // if user is not trying to scroll vertically\n        if (!isScrolling) {\n\n          // prevent native scrolling\n          event.preventDefault();\n\n          // stop slideshow\n          stop();\n\n          // increase resistance if first or last slide\n          if (options.continuous) { // we don't add resistance at the end\n\n            translate(circle(index - 1), delta.x + slidePos[circle(index - 1)], 0);\n            translate(index, delta.x + slidePos[index], 0);\n            translate(circle(index + 1), delta.x + slidePos[circle(index + 1)], 0);\n\n          } else {\n\n            delta.x =\n              delta.x /\n                ( (!index && delta.x > 0 ||         // if first slide and sliding left\n                  index == slides.length - 1 &&     // or if last slide and sliding right\n                  delta.x < 0                       // and if sliding at all\n                ) ?\n                ( Math.abs(delta.x) / width + 1 )      // determine resistance level\n                : 1 );                                 // no resistance if false\n\n            // translate 1:1\n            translate(index - 1, delta.x + slidePos[index - 1], 0);\n            translate(index, delta.x + slidePos[index], 0);\n            translate(index + 1, delta.x + slidePos[index + 1], 0);\n          }\n\n          options.onDrag && options.onDrag();\n        }\n\n      },\n      end: function() {\n\n        // measure duration\n        var duration = +new Date() - start.time;\n\n        // determine if slide attempt triggers next/prev slide\n        var isValidSlide =\n              Number(duration) < 250 &&         // if slide duration is less than 250ms\n              Math.abs(delta.x) > 20 ||         // and if slide amt is greater than 20px\n              Math.abs(delta.x) > width / 2;      // or if slide amt is greater than half the width\n\n        // determine if slide attempt is past start and end\n        var isPastBounds = (!index && delta.x > 0) ||      // if first slide and slide amt is greater than 0\n              (index == slides.length - 1 && delta.x < 0); // or if last slide and slide amt is less than 0\n\n        if (options.continuous) isPastBounds = false;\n\n        // determine direction of swipe (true:right, false:left)\n        var direction = delta.x < 0;\n\n        // if not scrolling vertically\n        if (!isScrolling) {\n\n          if (isValidSlide && !isPastBounds) {\n\n            if (direction) {\n\n              if (options.continuous) { // we need to get the next in this direction in place\n\n                move(circle(index - 1), -width, 0);\n                move(circle(index + 2), width, 0);\n\n              } else {\n                move(index - 1, -width, 0);\n              }\n\n              move(index, slidePos[index] - width, speed);\n              move(circle(index + 1), slidePos[circle(index + 1)] - width, speed);\n              index = circle(index + 1);\n\n            } else {\n              if (options.continuous) { // we need to get the next in this direction in place\n\n                move(circle(index + 1), width, 0);\n                move(circle(index - 2), -width, 0);\n\n              } else {\n                move(index + 1, width, 0);\n              }\n\n              move(index, slidePos[index] + width, speed);\n              move(circle(index - 1), slidePos[circle(index - 1)] + width, speed);\n              index = circle(index - 1);\n\n            }\n\n            options.callback && options.callback(index, slides[index]);\n\n          } else {\n\n            if (options.continuous) {\n\n              move(circle(index - 1), -width, speed);\n              move(index, 0, speed);\n              move(circle(index + 1), width, speed);\n\n            } else {\n\n              move(index - 1, -width, speed);\n              move(index, 0, speed);\n              move(index + 1, width, speed);\n            }\n\n          }\n\n        }\n\n        // kill touchmove and touchend event listeners until touchstart called again\n        if(browser.touch) {\n          element.removeEventListener('touchmove', events, false);\n          element.removeEventListener('touchend', events, false);\n        } else {\n          element.removeEventListener('mousemove', events, false);\n          element.removeEventListener('mouseup', events, false);\n          document.removeEventListener('mouseup', events, false);\n        }\n\n        options.onDragEnd && options.onDragEnd();\n      },\n      transitionEnd: function(event) {\n\n        if (parseInt(event.target.getAttribute('data-index'), 10) == index) {\n\n          if (delay) begin();\n\n          options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);\n\n        }\n\n      }\n\n    };\n\n    // Public API\n    this.update = function() {\n      setTimeout(setup);\n    };\n    this.setup = function() {\n      setup();\n    };\n\n    this.loop = function(value) {\n      if (arguments.length) options.continuous = !!value;\n      return options.continuous;\n    };\n\n    this.enableSlide = function(shouldEnable) {\n      if (arguments.length) {\n        this.slideIsDisabled = !shouldEnable;\n      }\n      return !this.slideIsDisabled;\n    };\n\n    this.slide = this.select = function(to, speed) {\n      // cancel slideshow\n      stop();\n\n      slide(to, speed);\n    };\n\n    this.prev = this.previous = function() {\n      // cancel slideshow\n      stop();\n\n      prev();\n    };\n\n    this.next = function() {\n      // cancel slideshow\n      stop();\n\n      next();\n    };\n\n    this.stop = function() {\n      // cancel slideshow\n      stop();\n    };\n\n    this.start = function() {\n      begin();\n    };\n\n    this.autoPlay = function(newDelay) {\n      if (!delay || delay < 0) {\n        stop();\n      } else {\n        delay = newDelay;\n        begin();\n      }\n    };\n\n    this.currentIndex = this.selected = function() {\n      // return current index position\n      return index;\n    };\n\n    this.slidesCount = this.count = function() {\n      // return total number of slides\n      return length;\n    };\n\n    this.kill = function() {\n      // cancel slideshow\n      stop();\n\n      // reset element\n      element.style.width = '';\n      element.style.left = '';\n\n      // reset slides so no refs are held on to\n      slides && (slides = []);\n\n      // removed event listeners\n      if (browser.addEventListener) {\n\n        // remove current event listeners\n        element.removeEventListener('touchstart', events, false);\n        element.removeEventListener('webkitTransitionEnd', events, false);\n        element.removeEventListener('msTransitionEnd', events, false);\n        element.removeEventListener('oTransitionEnd', events, false);\n        element.removeEventListener('otransitionend', events, false);\n        element.removeEventListener('transitionend', events, false);\n        window.removeEventListener('resize', events, false);\n\n      }\n      else {\n\n        window.onresize = null;\n\n      }\n    };\n\n    this.load = function() {\n      // trigger setup\n      setup();\n\n      // start auto slideshow if applicable\n      if (delay) begin();\n\n\n      // add event listeners\n      if (browser.addEventListener) {\n\n        // set touchstart event on element\n        if (browser.touch) {\n          element.addEventListener('touchstart', events, false);\n        } else {\n          element.addEventListener('mousedown', events, false);\n        }\n\n        if (browser.transitions) {\n          element.addEventListener('webkitTransitionEnd', events, false);\n          element.addEventListener('msTransitionEnd', events, false);\n          element.addEventListener('oTransitionEnd', events, false);\n          element.addEventListener('otransitionend', events, false);\n          element.addEventListener('transitionend', events, false);\n        }\n\n        // set resize event on window\n        window.addEventListener('resize', events, false);\n\n      } else {\n\n        window.onresize = function () { setup(); }; // to play nice with old IE\n\n      }\n    };\n\n  }\n});\n\n})(ionic);\n\n(function(ionic) {\n'use strict';\n\n  ionic.views.Toggle = ionic.views.View.inherit({\n    initialize: function(opts) {\n      var self = this;\n\n      this.el = opts.el;\n      this.checkbox = opts.checkbox;\n      this.track = opts.track;\n      this.handle = opts.handle;\n      this.openPercent = -1;\n      this.onChange = opts.onChange || function() {};\n\n      this.triggerThreshold = opts.triggerThreshold || 20;\n\n      this.dragStartHandler = function(e) {\n        self.dragStart(e);\n      };\n      this.dragHandler = function(e) {\n        self.drag(e);\n      };\n      this.holdHandler = function(e) {\n        self.hold(e);\n      };\n      this.releaseHandler = function(e) {\n        self.release(e);\n      };\n\n      this.dragStartGesture = ionic.onGesture('dragstart', this.dragStartHandler, this.el);\n      this.dragGesture = ionic.onGesture('drag', this.dragHandler, this.el);\n      this.dragHoldGesture = ionic.onGesture('hold', this.holdHandler, this.el);\n      this.dragReleaseGesture = ionic.onGesture('release', this.releaseHandler, this.el);\n    },\n\n    destroy: function() {\n      ionic.offGesture(this.dragStartGesture, 'dragstart', this.dragStartGesture);\n      ionic.offGesture(this.dragGesture, 'drag', this.dragGesture);\n      ionic.offGesture(this.dragHoldGesture, 'hold', this.holdHandler);\n      ionic.offGesture(this.dragReleaseGesture, 'release', this.releaseHandler);\n    },\n\n    tap: function() {\n      if(this.el.getAttribute('disabled') !== 'disabled') {\n        this.val( !this.checkbox.checked );\n      }\n    },\n\n    dragStart: function(e) {\n      if(this.checkbox.disabled) return;\n\n      this._dragInfo = {\n        width: this.el.offsetWidth,\n        left: this.el.offsetLeft,\n        right: this.el.offsetLeft + this.el.offsetWidth,\n        triggerX: this.el.offsetWidth / 2,\n        initialState: this.checkbox.checked\n      };\n\n      // Stop any parent dragging\n      e.gesture.srcEvent.preventDefault();\n\n      // Trigger hold styles\n      this.hold(e);\n    },\n\n    drag: function(e) {\n      var self = this;\n      if(!this._dragInfo) { return; }\n\n      // Stop any parent dragging\n      e.gesture.srcEvent.preventDefault();\n\n      ionic.requestAnimationFrame(function () {\n        if (!self._dragInfo) { return; }\n\n        var px = e.gesture.touches[0].pageX - self._dragInfo.left;\n        var mx = self._dragInfo.width - self.triggerThreshold;\n\n        // The initial state was on, so \"tend towards\" on\n        if(self._dragInfo.initialState) {\n          if(px < self.triggerThreshold) {\n            self.setOpenPercent(0);\n          } else if(px > self._dragInfo.triggerX) {\n            self.setOpenPercent(100);\n          }\n        } else {\n          // The initial state was off, so \"tend towards\" off\n          if(px < self._dragInfo.triggerX) {\n            self.setOpenPercent(0);\n          } else if(px > mx) {\n            self.setOpenPercent(100);\n          }\n        }\n      });\n    },\n\n    endDrag: function() {\n      this._dragInfo = null;\n    },\n\n    hold: function() {\n      this.el.classList.add('dragging');\n    },\n    release: function(e) {\n      this.el.classList.remove('dragging');\n      this.endDrag(e);\n    },\n\n\n    setOpenPercent: function(openPercent) {\n      // only make a change if the new open percent has changed\n      if(this.openPercent < 0 || (openPercent < (this.openPercent - 3) || openPercent > (this.openPercent + 3) ) ) {\n        this.openPercent = openPercent;\n\n        if(openPercent === 0) {\n          this.val(false);\n        } else if(openPercent === 100) {\n          this.val(true);\n        } else {\n          var openPixel = Math.round( (openPercent / 100) * this.track.offsetWidth - (this.handle.offsetWidth) );\n          openPixel = (openPixel < 1 ? 0 : openPixel);\n          this.handle.style[ionic.CSS.TRANSFORM] = 'translate3d(' + openPixel + 'px,0,0)';\n        }\n      }\n    },\n\n    val: function(value) {\n      if(value === true || value === false) {\n        if(this.handle.style[ionic.CSS.TRANSFORM] !== \"\") {\n          this.handle.style[ionic.CSS.TRANSFORM] = \"\";\n        }\n        this.checkbox.checked = value;\n        this.openPercent = (value ? 100 : 0);\n        this.onChange && this.onChange();\n      }\n      return this.checkbox.checked;\n    }\n\n  });\n\n})(ionic);\n\n})();"
  },
  {
    "path": "www/lib/ionic/scss/_action-sheet.scss",
    "content": "/**\n * Action Sheets\n * --------------------------------------------------\n */\n\n.action-sheet-backdrop {\n  @include transition(background-color 150ms ease-in-out);\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: $z-index-action-sheet;\n  width: 100%;\n  height: 100%;\n  background-color: rgba(0,0,0,0);\n\n  &.active {\n    background-color: rgba(0,0,0,0.4);\n  }\n}\n\n.action-sheet-wrapper {\n  @include translate3d(0, 100%, 0);\n  @include transition(all cubic-bezier(.36, .66, .04, 1) 500ms);\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  width: 100%;\n  max-width: 500px;\n  margin: auto;\n}\n\n.action-sheet-up {\n  @include translate3d(0, 0, 0);\n}\n\n.action-sheet {\n  margin-left: $sheet-margin;\n  margin-right: $sheet-margin;\n  width: auto;\n  z-index: $z-index-action-sheet;\n  overflow: hidden;\n\n  .button {\n    display: block;\n    padding: 1px;\n    width: 100%;\n    border-radius: 0;\n    border-color: $sheet-options-border-color;\n    background-color: transparent;\n\n    color: $sheet-options-text-color;\n    font-size: 21px;\n\n    &:hover {\n      color: $sheet-options-text-color;\n    }\n    &.destructive {\n      color: #ff3b30;\n      &:hover {\n        color: #ff3b30;\n      }\n    }\n  }\n\n  .button.active, .button.activated {\n    box-shadow: none;\n    border-color: $sheet-options-border-color;\n    color: $sheet-options-text-color;\n    background: $sheet-options-bg-active-color;\n  }\n}\n\n.action-sheet-has-icons .icon {\n  position: absolute;\n  left: 16px;\n}\n\n.action-sheet-title {\n  padding: $sheet-margin * 2;\n  color: #8f8f8f;\n  text-align: center;\n  font-size: 13px;\n}\n\n.action-sheet-group {\n  margin-bottom: $sheet-margin;\n  border-radius: $sheet-border-radius;\n  background-color: #fff;\n  overflow: hidden;\n\n  .button {\n    border-width: 1px 0px 0px 0px;\n  }\n  .button:first-child:last-child {\n    border-width: 0;\n  }\n}\n\n.action-sheet-options {\n  background: $sheet-options-bg-color;\n}\n\n.action-sheet-cancel {\n  .button {\n    font-weight: 500;\n  }\n}\n\n.action-sheet-open {\n  pointer-events: none;\n\n  &.modal-open .modal {\n    pointer-events: none;\n  }\n\n  .action-sheet-backdrop {\n    pointer-events: auto;\n  }\n}\n\n\n.platform-android {\n\n  .action-sheet-backdrop.active {\n    background-color: rgba(0,0,0,0.2);\n  }\n\n  .action-sheet {\n    margin: 0;\n\n    .action-sheet-title,\n    .button {\n      text-align: left;\n      border-color: transparent;\n      font-size: 16px;\n      color: inherit;\n    }\n\n    .action-sheet-title {\n      font-size: 14px;\n      padding: 16px;\n      color: #666;\n    }\n\n    .button.active,\n    .button.activated {\n      background: #e8e8e8;\n    }\n  }\n\n  .action-sheet-group {\n    margin: 0;\n    border-radius: 0;\n    background-color: #fafafa;\n  }\n\n  .action-sheet-cancel {\n    display: none;\n  }\n\n  .action-sheet-has-icons {\n\n    .button {\n      padding-left: 56px;\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_animations.scss",
    "content": "\n// Slide up from the bottom, used for modals\n// -------------------------------\n\n.slide-in-up {\n  @include translate3d(0, 100%, 0);\n}\n.slide-in-up.ng-enter,\n.slide-in-up > .ng-enter {\n  @include transition(all cubic-bezier(.1, .7, .1, 1) 400ms);\n}\n.slide-in-up.ng-enter-active,\n.slide-in-up > .ng-enter-active {\n  @include translate3d(0, 0, 0);\n}\n\n.slide-in-up.ng-leave,\n.slide-in-up > .ng-leave {\n  @include transition(all ease-in-out 250ms);\n}\n\n\n// Scale Out\n// Scale from hero (1 in this case) to zero\n// -------------------------------\n\n@-webkit-keyframes scaleOut {\n  from { -webkit-transform: scale(1); opacity: 1; }\n  to { -webkit-transform: scale(0.8); opacity: 0; }\n}\n@keyframes scaleOut {\n  from { transform: scale(1); opacity: 1; }\n  to { transform: scale(0.8); opacity: 0; }\n}\n\n\n// Super Scale In\n// Scale from super (1.x) to duper (1 in this case)\n// -------------------------------\n\n@-webkit-keyframes superScaleIn {\n  from { -webkit-transform: scale(1.2); opacity: 0; }\n  to { -webkit-transform: scale(1); opacity: 1 }\n}\n@keyframes superScaleIn {\n  from { transform: scale(1.2); opacity: 0; }\n  to { transform: scale(1); opacity: 1; }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_backdrop.scss",
    "content": "\n.backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: $z-index-backdrop;\n\n  width: 100%;\n  height: 100%;\n\n  background-color: $loading-backdrop-bg-color;\n\n  visibility: hidden;\n  opacity: 0;\n\n  &.visible {\n    visibility: visible;\n  }\n  &.active {\n    opacity: 1;\n  }\n\n  @include transition($loading-backdrop-fadein-duration opacity linear);\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_badge.scss",
    "content": "\n/**\n * Badges\n * --------------------------------------------------\n */\n\n.badge {\n  @include badge-style($badge-default-bg, $badge-default-text);\n  z-index: $z-index-badge;\n  display: inline-block;\n  padding: 3px 8px;\n  min-width: 10px;\n  border-radius: $badge-border-radius;\n  vertical-align: baseline;\n  text-align: center;\n  white-space: nowrap;\n  font-weight: $badge-font-weight;\n  font-size: $badge-font-size;\n  line-height: $badge-line-height;\n\n  &:empty {\n    display: none;\n  }\n}\n\n//Be sure to override specificity of rule that 'badge color matches tab color by default'\n.tabs .tab-item .badge,\n.badge {\n  &.badge-light {\n    @include badge-style($badge-light-bg, $badge-light-text);\n  }\n  &.badge-stable {\n    @include badge-style($badge-stable-bg, $badge-stable-text);\n  }\n  &.badge-positive {\n    @include badge-style($badge-positive-bg, $badge-positive-text);\n  }\n  &.badge-calm {\n    @include badge-style($badge-calm-bg, $badge-calm-text);\n  }\n  &.badge-assertive {\n    @include badge-style($badge-assertive-bg, $badge-assertive-text);\n  }\n  &.badge-balanced {\n    @include badge-style($badge-balanced-bg, $badge-balanced-text);\n  }\n  &.badge-energized {\n    @include badge-style($badge-energized-bg, $badge-energized-text);\n  }\n  &.badge-royal {\n    @include badge-style($badge-royal-bg, $badge-royal-text);\n  }\n  &.badge-dark {\n    @include badge-style($badge-dark-bg, $badge-dark-text);\n  }\n}\n\n// Quick fix for labels/badges in buttons\n.button .badge {\n  position: relative;\n  top: -1px;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_bar.scss",
    "content": "\n/**\n * Bar (Headers and Footers)\n * --------------------------------------------------\n */\n\n.bar {\n  @include display-flex();\n  @include translate3d(0,0,0);\n  @include user-select(none);\n  position: absolute;\n  right: 0;\n  left: 0;\n  z-index: $z-index-bar;\n\n  box-sizing: border-box;\n  padding: $bar-padding-portrait;\n\n  width: 100%;\n  height: $bar-height;\n  border-width: 0;\n  border-style: solid;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid $bar-default-border;\n\n  background-color: $bar-default-bg;\n\n  /* border-width: 1px will actually create 2 device pixels on retina */\n  /* this nifty trick sets an actual 1px border on hi-res displays */\n  background-size: 0;\n  @media (min--moz-device-pixel-ratio: 1.5),\n         (-webkit-min-device-pixel-ratio: 1.5),\n         (min-device-pixel-ratio: 1.5),\n         (min-resolution: 144dpi),\n         (min-resolution: 1.5dppx) {\n    border: none;\n    background-image: linear-gradient(0deg, $bar-default-border, $bar-default-border 50%, transparent 50%);\n    background-position: bottom;\n    background-size: 100% 1px;\n    background-repeat: no-repeat;\n  }\n\n  &.bar-clear {\n    border: none;\n    background: none;\n    color: #fff;\n\n    .button {\n      color: #fff;\n    }\n    .title {\n      color: #fff;\n    }\n  }\n\n  &.item-input-inset {\n    .item-input-wrapper {\n      margin-top: -1px;\n\n      input {\n        padding-left: 8px;\n        width: 94%;\n        height: 28px;\n        background: transparent;\n      }\n    }\n  }\n\n  &.bar-light {\n    @include bar-style($bar-light-bg, $bar-light-border, $bar-light-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-light-border, $bar-light-border 50%, transparent 50%);\n    }\n  }\n  &.bar-stable {\n    @include bar-style($bar-stable-bg, $bar-stable-border, $bar-stable-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-stable-border, $bar-stable-border 50%, transparent 50%);\n    }\n  }\n  &.bar-positive {\n    @include bar-style($bar-positive-bg, $bar-positive-border, $bar-positive-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-positive-border, $bar-positive-border 50%, transparent 50%);\n    }\n  }\n  &.bar-calm {\n    @include bar-style($bar-calm-bg, $bar-calm-border, $bar-calm-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-calm-border, $bar-calm-border 50%, transparent 50%);\n    }\n  }\n  &.bar-assertive {\n    @include bar-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-assertive-border, $bar-assertive-border 50%, transparent 50%);\n    }\n  }\n  &.bar-balanced {\n    @include bar-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-balanced-border, $bar-positive-border 50%, transparent 50%);\n    }\n  }\n  &.bar-energized {\n    @include bar-style($bar-energized-bg, $bar-energized-border, $bar-energized-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-energized-border, $bar-energized-border 50%, transparent 50%);\n    }\n  }\n  &.bar-royal {\n    @include bar-style($bar-royal-bg, $bar-royal-border, $bar-royal-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-royal-border, $bar-royal-border 50%, transparent 50%);\n    }\n  }\n  &.bar-dark {\n    @include bar-style($bar-dark-bg, $bar-dark-border, $bar-dark-text);\n    &.bar-footer{\n      background-image: linear-gradient(180deg, $bar-dark-border, $bar-dark-border 50%, transparent 50%);\n    }\n  }\n\n  // Title inside of a bar is centered\n  .title {\n    position: absolute;\n\n    top: 0;\n    right: 0;\n    left: 0;\n    z-index: $z-index-bar-title;\n    overflow: hidden;\n\n    margin: 0 10px;\n\n    min-width: 30px;\n    height: $bar-height - 1;\n\n    text-align: center;\n\n    // Go into ellipsis if too small\n    text-overflow: ellipsis;\n    white-space: nowrap;\n\n    font-size: $bar-title-font-size;\n    font-weight: $headings-font-weight;\n\n    line-height: $bar-height;\n\n    &.title-left {\n      text-align: left;\n    }\n    &.title-right {\n      text-align: right;\n    }\n  }\n\n  .title a {\n    color: inherit;\n  }\n\n  .button {\n    z-index: $z-index-bar-button;\n    padding: 0 $button-bar-button-padding;\n    min-width: initial;\n    min-height: $button-bar-button-height - 1;\n    font-weight: 400;\n    font-size: $button-bar-button-font-size;\n    line-height: $button-bar-button-height;\n\n    &.button-icon:before,\n    .icon:before,\n    &.icon:before,\n    &.icon-left:before,\n    &.icon-right:before {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-size: $button-bar-button-icon-size;\n      line-height: $button-bar-button-height;\n    }\n\n    &.button-icon {\n      font-size: $bar-title-font-size;\n      .icon:before,\n      &:before,\n      &.icon-left:before,\n      &.icon-right:before {\n        vertical-align: top;\n        font-size: $button-large-icon-size;\n        line-height: $button-bar-button-height;\n      }\n    }\n    &.button-clear {\n      padding-right: 2px;\n      padding-left: 2px;\n      font-weight: 300;\n      font-size: $bar-title-font-size;\n\n      .icon:before,\n      &.icon:before,\n      &.icon-left:before,\n      &.icon-right:before {\n        font-size: $button-large-icon-size;\n        line-height: $button-bar-button-height;\n      }\n    }\n\n    &.back-button {\n      display: block;\n      margin-right: 5px;\n      padding: 0;\n      white-space: nowrap;\n      font-weight: 400;\n    }\n\n    &.back-button.active,\n    &.back-button.activated {\n      opacity: 0.2;\n    }\n  }\n\n  .button-bar > .button,\n  .buttons > .button {\n    min-height: $button-bar-button-height - 1;\n    line-height: $button-bar-button-height;\n  }\n\n  .button-bar + .button,\n  .button + .button-bar {\n    margin-left: 5px;\n  }\n\n  // Android 4.4 messes with the display property\n  .buttons,\n  .buttons.primary-buttons,\n  .buttons.secondary-buttons {\n    display: inherit;\n  }\n  .buttons span {\n    display: inline-block;\n  }\n  .buttons-left span {\n    margin-right: 5px;\n    display: inherit;\n  }\n  .buttons-right span {\n    margin-left: 5px;\n    display: inherit;\n  }\n\n  // Place the last button in a bar on the right of the bar\n  .title + .button:last-child,\n  > .button + .button:last-child,\n  > .button.pull-right,\n  .buttons.pull-right,\n  .title + .buttons {\n    position: absolute;\n    top: 5px;\n    right: 5px;\n    bottom: 5px;\n  }\n\n}\n\n.platform-android {\n\n  .nav-bar-has-subheader .bar {\n    background-image: none;\n  }\n\n  .bar {\n\n    .back-button .icon:before {\n      font-size: 24px;\n    }\n\n    .title {\n      font-size: 19px;\n      line-height: $bar-height;\n    }\n  }\n\n}\n\n// Default styles for buttons inside of styled bars\n.bar-light {\n  .button {\n    @include button-style($bar-light-bg, $bar-light-border, $bar-light-active-bg, $bar-light-active-border, $bar-light-text);\n    @include button-clear($bar-light-text, $bar-title-font-size);\n  }\n}\n.bar-stable {\n  .button {\n    @include button-style($bar-stable-bg, $bar-stable-border, $bar-stable-active-bg, $bar-stable-active-border, $bar-stable-text);\n    @include button-clear($bar-stable-text, $bar-title-font-size);\n  }\n}\n.bar-positive {\n  .button {\n    @include button-style($bar-positive-bg, $bar-positive-border, $bar-positive-active-bg, $bar-positive-active-border, $bar-positive-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-calm {\n  .button {\n    @include button-style($bar-calm-bg, $bar-calm-border, $bar-calm-active-bg, $bar-calm-active-border, $bar-calm-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-assertive {\n  .button {\n    @include button-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-active-bg, $bar-assertive-active-border, $bar-assertive-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-balanced {\n  .button {\n    @include button-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-active-bg, $bar-balanced-active-border, $bar-balanced-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-energized {\n  .button {\n    @include button-style($bar-energized-bg, $bar-energized-border, $bar-energized-active-bg, $bar-energized-active-border, $bar-energized-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-royal {\n  .button {\n    @include button-style($bar-royal-bg, $bar-royal-border, $bar-royal-active-bg, $bar-royal-active-border, $bar-royal-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n.bar-dark {\n  .button {\n    @include button-style($bar-dark-bg, $bar-dark-border, $bar-dark-active-bg, $bar-dark-active-border, $bar-dark-text);\n    @include button-clear(#fff, $bar-title-font-size);\n  }\n}\n\n// Header at top\n.bar-header {\n  top: 0;\n  border-top-width: 0;\n  border-bottom-width: 1px;\n  &.has-tabs-top{\n    border-bottom-width: 0px;\n    background-image: none;\n  }\n}\n.tabs-top .bar-header{\n  border-bottom-width: 0px;\n  background-image: none;\n}\n\n// Footer at bottom\n.bar-footer {\n  bottom: 0;\n  border-top-width: 1px;\n  border-bottom-width: 0;\n  background-position: top;\n\n  height: $bar-footer-height;\n\n  &.item-input-inset {\n    position: absolute;\n  }\n}\n\n// Don't render padding if the bar is just for tabs\n.bar-tabs {\n  padding: 0;\n}\n\n.bar-subheader {\n  top: $bar-height;\n  display: block;\n\n  height: $bar-subheader-height;\n}\n.bar-subfooter {\n  bottom: $bar-footer-height;\n  display: block;\n\n  height: $bar-subfooter-height;\n}\n\n.nav-bar-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  left: 0;\n  z-index: $z-index-bar;\n}\n\n.bar .back-button.hide,\n.bar .buttons .hide {\n  display: none;\n}\n\n.nav-bar-tabs-top .bar {\n  background-image: none;\n}\n\n"
  },
  {
    "path": "www/lib/ionic/scss/_button-bar.scss",
    "content": "\n/**\n * Button Bar\n * --------------------------------------------------\n */\n\n.button-bar {\n  @include display-flex();\n  @include flex(1);\n  width: 100%;\n\n  &.button-bar-inline {\n    display: block;\n    width: auto;\n\n    @include clearfix();\n\n    > .button {\n      width: auto;\n      display: inline-block;\n      float: left;\n    }\n  }\n}\n\n.button-bar > .button {\n  @include flex(1);\n  display: block;\n  \n  overflow: hidden;\n\n  padding: 0 16px;\n\n  width: 0;\n\n  border-width: 1px 0px 1px 1px;\n  border-radius: 0;\n  text-align: center;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n\n  &:before,\n  .icon:before {\n    line-height: 44px;\n  }\n\n  &:first-child {\n    border-radius: $button-border-radius 0px 0px $button-border-radius;\n  }\n  &:last-child {\n    border-right-width: 1px;\n    border-radius: 0px $button-border-radius $button-border-radius 0px;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_button.scss",
    "content": "\n/**\n * Buttons\n * --------------------------------------------------\n */\n\n.button {\n  // set the color defaults\n  @include button-style($button-default-bg, $button-default-border, $button-default-active-bg, $button-default-active-border, $button-default-text);\n\n  position: relative;\n  display: inline-block;\n  margin: 0;\n  padding: 0 $button-padding;\n\n  min-width: ($button-padding * 3) + $button-font-size;\n  min-height: $button-height + 5px;\n\n  border-width: $button-border-width;\n  border-style: solid;\n  border-radius: $button-border-radius;\n\n  vertical-align: top;\n  text-align: center;\n\n  text-overflow: ellipsis;\n  font-size: $button-font-size;\n  line-height: $button-height - $button-border-width + 1px;\n\n  cursor: pointer;\n\n  &:after {\n    // used to create a larger button \"hit\" area\n    position: absolute;\n    top: -6px;\n    right: -6px;\n    bottom: -6px;\n    left: -6px;\n    content: ' ';\n  }\n\n  .icon {\n    vertical-align: top;\n    pointer-events: none;\n  }\n\n  .icon:before,\n  &.icon:before,\n  &.icon-left:before,\n  &.icon-right:before {\n    display: inline-block;\n    padding: 0 0 $button-border-width 0;\n    vertical-align: inherit;\n    font-size: $button-icon-size;\n    line-height: $button-height - $button-border-width;\n    pointer-events: none;\n  }\n  &.icon-left:before {\n    float: left;\n    padding-right: .2em;\n    padding-left: 0;\n  }\n  &.icon-right:before {\n    float: right;\n    padding-right: 0;\n    padding-left: .2em;\n  }\n\n  &.button-block, &.button-full {\n    margin-top: $button-block-margin;\n    margin-bottom: $button-block-margin;\n  }\n\n  &.button-light {\n    @include button-style($button-light-bg, $button-light-border, $button-light-active-bg, $button-light-active-border, $button-light-text);\n    @include button-clear($button-light-border);\n    @include button-outline($button-light-border);\n  }\n\n  &.button-stable {\n    @include button-style($button-stable-bg, $button-stable-border, $button-stable-active-bg, $button-stable-active-border, $button-stable-text);\n    @include button-clear($button-stable-border);\n    @include button-outline($button-stable-border);\n  }\n\n  &.button-positive {\n    @include button-style($button-positive-bg, $button-positive-border, $button-positive-active-bg, $button-positive-active-border, $button-positive-text);\n    @include button-clear($button-positive-bg);\n    @include button-outline($button-positive-bg);\n  }\n\n  &.button-calm {\n    @include button-style($button-calm-bg, $button-calm-border, $button-calm-active-bg, $button-calm-active-border, $button-calm-text);\n    @include button-clear($button-calm-bg);\n    @include button-outline($button-calm-bg);\n  }\n\n  &.button-assertive {\n    @include button-style($button-assertive-bg, $button-assertive-border, $button-assertive-active-bg, $button-assertive-active-border, $button-assertive-text);\n    @include button-clear($button-assertive-bg);\n    @include button-outline($button-assertive-bg);\n  }\n\n  &.button-balanced {\n    @include button-style($button-balanced-bg, $button-balanced-border, $button-balanced-active-bg, $button-balanced-active-border, $button-balanced-text);\n    @include button-clear($button-balanced-bg);\n    @include button-outline($button-balanced-bg);\n  }\n\n  &.button-energized {\n    @include button-style($button-energized-bg, $button-energized-border, $button-energized-active-bg, $button-energized-active-border, $button-energized-text);\n    @include button-clear($button-energized-bg);\n    @include button-outline($button-energized-bg);\n  }\n\n  &.button-royal {\n    @include button-style($button-royal-bg, $button-royal-border, $button-royal-active-bg, $button-royal-active-border, $button-royal-text);\n    @include button-clear($button-royal-bg);\n    @include button-outline($button-royal-bg);\n  }\n\n  &.button-dark {\n    @include button-style($button-dark-bg, $button-dark-border, $button-dark-active-bg, $button-dark-active-border, $button-dark-text);\n    @include button-clear($button-dark-bg);\n    @include button-outline($button-dark-bg);\n  }\n}\n\n.button-small {\n  padding: 2px $button-small-padding 1px;\n  min-width: $button-small-height;\n  min-height: $button-small-height + 2;\n  font-size: $button-small-font-size;\n  line-height: $button-small-height - $button-border-width - 1;\n\n  .icon:before,\n  &.icon:before,\n  &.icon-left:before,\n  &.icon-right:before {\n    font-size: $button-small-icon-size;\n    line-height: $button-small-icon-size + 3;\n    margin-top: 3px;\n  }\n}\n\n.button-large {\n  padding: 0 $button-large-padding;\n  min-width: ($button-large-padding * 3) + $button-large-font-size;\n  min-height: $button-large-height + 5;\n  font-size: $button-large-font-size;\n  line-height: $button-large-height - $button-border-width;\n\n  .icon:before,\n  &.icon:before,\n  &.icon-left:before,\n  &.icon-right:before {\n    padding-bottom: ($button-border-width * 2);\n    font-size: $button-large-icon-size;\n    line-height: $button-large-height - ($button-border-width * 2) - 1;\n  }\n}\n\n.button-icon {\n  @include transition(opacity .1s);\n  padding: 0 6px;\n  min-width: initial;\n  border-color: transparent;\n  background: none;\n\n  &.button.active,\n  &.button.activated {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    opacity: 0.3;\n  }\n\n  .icon:before,\n  &.icon:before {\n    font-size: $button-large-icon-size;\n  }\n}\n\n.button-clear {\n  @include button-clear($button-default-border);\n  @include transition(opacity .1s);\n  padding: 0 $button-clear-padding;\n  max-height: $button-height;\n  border-color: transparent;\n  background: none;\n  box-shadow: none;\n\n  &.active,\n  &.activated {\n    opacity: 0.3;\n  }\n}\n\n.button-outline {\n  @include button-outline($button-default-border);\n  @include transition(opacity .1s);\n  background: none;\n  box-shadow: none;\n}\n\n.padding > .button.button-block:first-child {\n  margin-top: 0;\n}\n\n.button-block {\n  display: block;\n  clear: both;\n\n  &:after {\n    clear: both;\n  }\n}\n\n.button-full,\n.button-full > .button {\n  display: block;\n  margin-right: 0;\n  margin-left: 0;\n  border-right-width: 0;\n  border-left-width: 0;\n  border-radius: 0;\n}\n\nbutton.button-block,\nbutton.button-full,\n.button-full > button.button,\ninput.button.button-block  {\n  width: 100%;\n}\n\na.button {\n  text-decoration: none;\n\n  .icon:before,\n  &.icon:before,\n  &.icon-left:before,\n  &.icon-right:before {\n    margin-top: 2px;\n  }\n}\n\n.button.disabled,\n.button[disabled] {\n  opacity: .4;\n  cursor: default !important;\n  pointer-events: none;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_checkbox.scss",
    "content": "\n/**\n * Checkbox\n * --------------------------------------------------\n */\n\n.checkbox {\n  // set the color defaults\n  @include checkbox-style($checkbox-off-border-default, $checkbox-on-bg-default, $checkbox-on-border-default);\n\n  position: relative;\n  display: inline-block;\n  padding: ($checkbox-height / 4) ($checkbox-width / 4);\n  cursor: pointer;\n}\n.checkbox-light  {\n  @include checkbox-style($checkbox-off-border-light, $checkbox-on-bg-light, $checkbox-off-border-light);\n}\n.checkbox-stable  {\n  @include checkbox-style($checkbox-off-border-stable, $checkbox-on-bg-stable, $checkbox-off-border-stable);\n}\n.checkbox-positive  {\n  @include checkbox-style($checkbox-off-border-positive, $checkbox-on-bg-positive, $checkbox-off-border-positive);\n}\n.checkbox-calm  {\n  @include checkbox-style($checkbox-off-border-calm, $checkbox-on-bg-calm, $checkbox-off-border-calm);\n}\n.checkbox-assertive  {\n  @include checkbox-style($checkbox-off-border-assertive, $checkbox-on-bg-assertive, $checkbox-off-border-assertive);\n}\n.checkbox-balanced  {\n  @include checkbox-style($checkbox-off-border-balanced, $checkbox-on-bg-balanced, $checkbox-off-border-balanced);\n}\n.checkbox-energized{\n  @include checkbox-style($checkbox-off-border-energized, $checkbox-on-bg-energized, $checkbox-off-border-energized);\n}\n.checkbox-royal  {\n  @include checkbox-style($checkbox-off-border-royal, $checkbox-on-bg-royal, $checkbox-off-border-royal);\n}\n.checkbox-dark  {\n  @include checkbox-style($checkbox-off-border-dark, $checkbox-on-bg-dark, $checkbox-off-border-dark);\n}\n\n.checkbox input:disabled:before,\n.checkbox input:disabled + .checkbox-icon:before {\n  border-color: $checkbox-off-border-light;\n}\n\n.checkbox input:disabled:checked:before,\n.checkbox input:disabled:checked + .checkbox-icon:before {\n  background: $checkbox-on-bg-light;\n}\n\n\n.checkbox.checkbox-input-hidden input {\n  display: none !important;\n}\n\n.checkbox input,\n.checkbox-icon {\n  position: relative;\n  width: $checkbox-width;\n  height: $checkbox-height;\n  display: block;\n  border: 0;\n  background: transparent;\n  cursor: pointer;\n  -webkit-appearance: none;\n\n  &:before {\n    // what the checkbox looks like when its not checked\n    display: table;\n    width: 100%;\n    height: 100%;\n    border-width: $checkbox-border-width;\n    border-style: solid;\n    border-radius: $checkbox-border-radius;\n    background: $checkbox-off-bg-color;\n    content: ' ';\n    @include transition(background-color 20ms ease-in-out);\n  }\n}\n\n.checkbox input:checked:before,\ninput:checked + .checkbox-icon:before {\n  border-width: $checkbox-border-width + 1;\n}\n\n// the checkmark within the box\n.checkbox input:after,\n.checkbox-icon:after {\n  @include transition(opacity .05s ease-in-out);\n  @include rotate(-45deg);\n  position: absolute;\n  top: 33%;\n  left: 25%;\n  display: table;\n  width: ($checkbox-width / 2);\n  height: ($checkbox-width / 4) - 1;\n  border: $checkbox-check-width solid $checkbox-check-color;\n  border-top: 0;\n  border-right: 0;\n  content: ' ';\n  opacity: 0;\n}\n\n.platform-android .checkbox-platform input:before,\n.platform-android .checkbox-platform .checkbox-icon:before,\n.checkbox-square input:before,\n.checkbox-square .checkbox-icon:before {\n  border-radius: 2px;\n  width: 72%;\n  height: 72%;\n  margin-top: 14%;\n  margin-left: 14%;\n  border-width: 2px;\n}\n\n.platform-android .checkbox-platform input:after,\n.platform-android .checkbox-platform .checkbox-icon:after,\n.checkbox-square input:after,\n.checkbox-square .checkbox-icon:after {\n  border-width: 2px;\n  top: 19%;\n  left: 25%;\n  width: ($checkbox-width / 2) - 1;\n  height: 7px;\n}\n\n.grade-c .checkbox input:after,\n.grade-c .checkbox-icon:after {\n  @include rotate(0);\n  top: 3px;\n  left: 4px;\n  border: none;\n  color: $checkbox-check-color;\n  content: '\\2713';\n  font-weight: bold;\n  font-size: 20px;\n}\n\n// what the checkmark looks like when its checked\n.checkbox input:checked:after,\ninput:checked + .checkbox-icon:after {\n  opacity: 1;\n}\n\n// make sure item content have enough padding on left to fit the checkbox\n.item-checkbox {\n  padding-left: ($item-padding * 2) + $checkbox-width;\n\n  &.active {\n    box-shadow: none;\n  }\n}\n\n// position the checkbox to the left within an item\n.item-checkbox .checkbox {\n  position: absolute;\n  top: 50%;\n  right: $item-padding / 2;\n  left: $item-padding / 2;\n  z-index: $z-index-item-checkbox;\n  margin-top: (($checkbox-height + ($checkbox-height / 2)) / 2) * -1;\n}\n\n\n.item-checkbox.item-checkbox-right {\n  padding-right: ($item-padding * 2) + $checkbox-width;\n  padding-left: $item-padding;\n}\n\n.item-checkbox-right .checkbox input,\n.item-checkbox-right .checkbox-icon {\n  float: right;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_form.scss",
    "content": "/**\n * Forms\n * --------------------------------------------------\n */\n\n// Make all forms have space below them\nform {\n  margin: 0 0 $line-height-base;\n}\n\n// Groups of fields with labels on top (legends)\nlegend {\n  display: block;\n  margin-bottom: $line-height-base;\n  padding: 0;\n  width: 100%;\n  border: $input-border-width solid $input-border;\n  color: $dark;\n  font-size: $font-size-base * 1.5;\n  line-height: $line-height-base * 2;\n\n  small {\n    color: $stable;\n    font-size: $line-height-base * .75;\n  }\n}\n\n// Set font for forms\nlabel,\ninput,\nbutton,\nselect,\ntextarea {\n  @include font-shorthand($font-size-base, normal, $line-height-base); // Set size, weight, line-height here\n}\ninput,\nbutton,\nselect,\ntextarea {\n  font-family: $font-family-base; // And only set font-family here for those that need it (note the missing label element)\n}\n\n\n// Input List\n// -------------------------------\n\n.item-input {\n  @include display-flex();\n  @include align-items(center);\n  position: relative;\n  overflow: hidden;\n  padding: 6px 0 5px 16px;\n\n  input {\n    @include border-radius(0);\n    @include flex(1, 220px);\n    @include appearance(none);\n    margin: 0;\n    padding-right: 24px;\n    background-color: transparent;\n  }\n\n  .button .icon {\n    @include flex(0, 0, 24px);\n    position: static;\n    display: inline-block;\n    height: auto;\n    text-align: center;\n    font-size: 16px;\n  }\n\n  .button-bar {\n    @include border-radius(0);\n    @include flex(1, 0, 220px);\n    @include appearance(none);\n  }\n\n  .icon {\n    min-width: 14px;\n  }\n}\n// prevent flex-shrink on WP\n.platform-windowsphone .item-input input{\n  flex-shrink: 1;\n}\n\n.item-input-inset {\n  @include display-flex();\n  @include align-items(center);\n  position: relative;\n  overflow: hidden;\n  padding: ($item-padding / 3) * 2;\n}\n\n.item-input-wrapper {\n  @include display-flex();\n  @include flex(1, 0);\n  @include align-items(center);\n  @include border-radius(4px);\n  padding-right: 8px;\n  padding-left: 8px;\n  background: #eee;\n}\n\n.item-input-inset .item-input-wrapper input {\n  padding-left: 4px;\n  height: 29px;\n  background: transparent;\n  line-height: 18px;\n}\n\n.item-input-wrapper ~ .button {\n  margin-left: ($item-padding / 3) * 2;\n}\n\n.input-label {\n  display: table;\n  padding: 7px 10px 7px 0px;\n  max-width: 200px;\n  width: 35%;\n  color: $input-label-color;\n  font-size: 16px;\n}\n\n.placeholder-icon {\n  color: #aaa;\n  &:first-child {\n    padding-right: 6px;\n  }\n  &:last-child {\n    padding-left: 6px;\n  }\n}\n\n.item-stacked-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none;\n\n  .input-label, .icon {\n    display: inline-block;\n    padding: 4px 0 0 0px;\n    vertical-align: middle;\n  }\n}\n\n.item-stacked-label input,\n.item-stacked-label textarea {\n  @include border-radius(2px);\n  padding: 4px 8px 3px 0;\n  border: none;\n  background-color: $input-bg;\n}\n.item-stacked-label input {\n  overflow: hidden;\n  height: $line-height-computed + $font-size-base + 12px;\n}\n\n.item-floating-label {\n  display: block;\n  background-color: transparent;\n  box-shadow: none;\n\n  .input-label {\n    position: relative;\n    padding: 5px 0 0 0;\n    opacity: 0;\n    top: 10px;\n    @include transition(opacity .15s ease-in, top .2s linear);\n\n    &.has-input {\n      opacity: 1;\n      top: 0;\n      @include transition(opacity .15s ease-in, top .2s linear);\n    }\n  }\n}\n\n\n// Form Controls\n// -------------------------------\n\n// Shared size and type resets\ntextarea,\ninput[type=\"text\"],\ninput[type=\"password\"],\ninput[type=\"datetime\"],\ninput[type=\"datetime-local\"],\ninput[type=\"date\"],\ninput[type=\"month\"],\ninput[type=\"time\"],\ninput[type=\"week\"],\ninput[type=\"number\"],\ninput[type=\"email\"],\ninput[type=\"url\"],\ninput[type=\"search\"],\ninput[type=\"tel\"],\ninput[type=\"color\"] {\n  display: block;\n  padding-top: 2px;\n  padding-left: 0;\n  height: $line-height-computed + $font-size-base;\n  color: $input-color;\n  vertical-align: middle;\n  font-size: $font-size-base;\n  line-height: $font-size-base + 2;\n}\n\n.platform-ios,\n.platform-android {\n  input[type=\"datetime-local\"],\n  input[type=\"date\"],\n  input[type=\"month\"],\n  input[type=\"time\"],\n  input[type=\"week\"] {\n    padding-top: 8px;\n  }\n}\n\n.item-input {\n  input,\n  textarea {\n    width: 100%;\n  }\n}\n\ntextarea {\n  padding-left: 0;\n  @include placeholder($input-color-placeholder, -3px);\n}\n\n// Reset height since textareas have rows\ntextarea {\n  height: auto;\n}\n\n// Everything else\ntextarea,\ninput[type=\"text\"],\ninput[type=\"password\"],\ninput[type=\"datetime\"],\ninput[type=\"datetime-local\"],\ninput[type=\"date\"],\ninput[type=\"month\"],\ninput[type=\"time\"],\ninput[type=\"week\"],\ninput[type=\"number\"],\ninput[type=\"email\"],\ninput[type=\"url\"],\ninput[type=\"search\"],\ninput[type=\"tel\"],\ninput[type=\"color\"] {\n  border: 0;\n}\n\n// Position radios and checkboxes better\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n  margin: 0;\n  line-height: normal;\n}\n\n// Reset width of input images, buttons, radios, checkboxes\n.item-input {\n  input[type=\"file\"],\n  input[type=\"image\"],\n  input[type=\"submit\"],\n  input[type=\"reset\"],\n  input[type=\"button\"],\n  input[type=\"radio\"],\n  input[type=\"checkbox\"] {\n    width: auto; // Override of generic input selector\n  }\n}\n\n// Set the height of file to match text inputs\ninput[type=\"file\"] {\n  line-height: $input-height-base;\n}\n\n// Text input classes to hide text caret during scroll\n.previous-input-focus,\n.cloned-text-input + input,\n.cloned-text-input + textarea {\n  position: absolute !important;\n  left: -9999px;\n  width: 200px;\n}\n\n\n// Placeholder\n// -------------------------------\ninput,\ntextarea {\n  @include placeholder();\n}\n\n\n// DISABLED STATE\n// -------------------------------\n\n// Disabled and read-only inputs\ninput[disabled],\nselect[disabled],\ntextarea[disabled],\ninput[readonly]:not(.cloned-text-input),\ntextarea[readonly]:not(.cloned-text-input),\nselect[readonly] {\n  background-color: $input-bg-disabled;\n  cursor: not-allowed;\n}\n// Explicitly reset the colors here\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"][readonly],\ninput[type=\"checkbox\"][readonly] {\n  background-color: transparent;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_grid.scss",
    "content": "/**\n * Grid\n * --------------------------------------------------\n * Using flexbox for the grid, inspired by Philip Walton:\n * http://philipwalton.github.io/solved-by-flexbox/demos/grids/\n * By default each .col within a .row will evenly take up\n * available width, and the height of each .col with take\n * up the height of the tallest .col in the same .row.\n */\n\n.row {\n  @include display-flex();\n  padding: ($grid-padding-width / 2);\n  width: 100%;\n}\n\n.row-wrap {\n  @include flex-wrap(wrap);\n}\n\n.row-no-padding {\n  padding: 0;\n\n  > .col {\n    padding: 0;\n  }\n}\n\n.row + .row {\n  margin-top: ($grid-padding-width / 2) * -1;\n  padding-top: 0;\n}\n\n.col {\n  @include flex(1);\n  display: block;\n  padding: ($grid-padding-width / 2);\n  width: 100%;\n}\n\n\n/* Vertically Align Columns */\n/* .row-* vertically aligns every .col in the .row */\n.row-top {\n  @include align-items(flex-start);\n}\n.row-bottom {\n  @include align-items(flex-end);\n}\n.row-center {\n  @include align-items(center);\n}\n.row-stretch {\n  @include align-items(stretch);\n}\n.row-baseline {\n  @include align-items(baseline);\n}\n\n/* .col-* vertically aligns an individual .col */\n.col-top {\n  @include align-self(flex-start);\n}\n.col-bottom {\n  @include align-self(flex-end);\n}\n.col-center {\n  @include align-self(center);\n}\n\n/* Column Offsets */\n.col-offset-10 {\n  margin-left: 10%;\n}\n.col-offset-20 {\n  margin-left: 20%;\n}\n.col-offset-25 {\n  margin-left: 25%;\n}\n.col-offset-33, .col-offset-34 {\n  margin-left: 33.3333%;\n}\n.col-offset-50 {\n  margin-left: 50%;\n}\n.col-offset-66, .col-offset-67 {\n  margin-left: 66.6666%;\n}\n.col-offset-75 {\n  margin-left: 75%;\n}\n.col-offset-80 {\n  margin-left: 80%;\n}\n.col-offset-90 {\n  margin-left: 90%;\n}\n\n\n/* Explicit Column Percent Sizes */\n/* By default each grid column will evenly distribute */\n/* across the grid. However, you can specify individual */\n/* columns to take up a certain size of the available area */\n.col-10 {\n  @include flex(0, 0, 10%);\n  max-width: 10%;\n}\n.col-20 {\n  @include flex(0, 0, 20%);\n  max-width: 20%;\n}\n.col-25 {\n  @include flex(0, 0, 25%);\n  max-width: 25%;\n}\n.col-33, .col-34 {\n  @include flex(0, 0, 33.3333%);\n  max-width: 33.3333%;\n}\n.col-50 {\n  @include flex(0, 0, 50%);\n  max-width: 50%;\n}\n.col-66, .col-67 {\n  @include flex(0, 0, 66.6666%);\n  max-width: 66.6666%;\n}\n.col-75 {\n  @include flex(0, 0, 75%);\n  max-width: 75%;\n}\n.col-80 {\n  @include flex(0, 0, 80%);\n  max-width: 80%;\n}\n.col-90 {\n  @include flex(0, 0, 90%);\n  max-width: 90%;\n}\n\n\n/* Responsive Grid Classes */\n/* Adding a class of responsive-X to a row */\n/* will trigger the flex-direction to */\n/* change to column and add some margin */\n/* to any columns in the row for clearity */\n\n@include responsive-grid-break('.responsive-sm', $grid-responsive-sm-break);\n@include responsive-grid-break('.responsive-md', $grid-responsive-md-break);\n@include responsive-grid-break('.responsive-lg', $grid-responsive-lg-break);\n"
  },
  {
    "path": "www/lib/ionic/scss/_items.scss",
    "content": "/**\n * Items\n * --------------------------------------------------\n */\n\n.item {\n  @include item-style($item-default-bg, $item-default-border, $item-default-text);\n\n  position: relative;\n  z-index: $z-index-item; // Make sure the borders and stuff don't get hidden by children\n  display: block;\n\n  margin: $item-border-width * -1;\n  padding: $item-padding;\n\n  border-width: $item-border-width;\n  border-style: solid;\n  font-size: $item-font-size;\n\n  h2 {\n    margin: 0 0 2px 0;\n    font-size: 16px;\n    font-weight: normal;\n  }\n  h3 {\n    margin: 0 0 4px 0;\n    font-size: 14px;\n  }\n  h4 {\n    margin: 0 0 4px 0;\n    font-size: 12px;\n  }\n  h5, h6 {\n    margin: 0 0 3px 0;\n    font-size: 10px;\n  }\n  p {\n    color: #666;\n    font-size: 14px;\n    margin-bottom: 2px;\n  }\n\n  h1:last-child,\n  h2:last-child,\n  h3:last-child,\n  h4:last-child,\n  h5:last-child,\n  h6:last-child,\n  p:last-child {\n    margin-bottom: 0;\n  }\n\n  // Align badges within items\n  .badge {\n    @include display-flex();\n    position: absolute;\n    top: $item-padding;\n    right: ($item-padding * 2);\n  }\n  &.item-button-right .badge {\n    right: ($item-padding * 2) + 35;\n  }\n  &.item-divider .badge {\n    top: ceil($item-padding / 2);\n  }\n  .badge + .badge {\n    margin-right: 5px;\n  }\n\n  // Different themes for items\n  &.item-light {\n    @include item-style($item-light-bg, $item-light-border, $item-light-text);\n  }\n  &.item-stable {\n    @include item-style($item-stable-bg, $item-stable-border, $item-stable-text);\n  }\n  &.item-positive {\n    @include item-style($item-positive-bg, $item-positive-border, $item-positive-text);\n  }\n  &.item-calm {\n    @include item-style($item-calm-bg, $item-calm-border, $item-calm-text);\n  }\n  &.item-assertive {\n    @include item-style($item-assertive-bg, $item-assertive-border, $item-assertive-text);\n  }\n  &.item-balanced {\n    @include item-style($item-balanced-bg, $item-balanced-border, $item-balanced-text);\n  }\n  &.item-energized {\n    @include item-style($item-energized-bg, $item-energized-border, $item-energized-text);\n  }\n  &.item-royal {\n    @include item-style($item-royal-bg, $item-royal-border, $item-royal-text);\n  }\n  &.item-dark {\n    @include item-style($item-dark-bg, $item-dark-border, $item-dark-text);\n  }\n\n  &[ng-click]:hover {\n    cursor: pointer;\n  }\n\n}\n\n.list-borderless .item,\n.item-borderless {\n  border-width: 0;\n}\n\n// Link and Button Active States\n.item.active,\n.item.activated,\n.item-complex.active .item-content,\n.item-complex.activated .item-content,\n.item .item-content.active,\n.item .item-content.activated {\n  @include item-active-style($item-default-active-bg, $item-default-active-border);\n\n  // Different active themes for <a> and <button> items\n  &.item-light {\n    @include item-active-style($item-light-active-bg, $item-light-active-border);\n  }\n  &.item-stable {\n    @include item-active-style($item-stable-active-bg, $item-stable-active-border);\n  }\n  &.item-positive {\n    @include item-active-style($item-positive-active-bg, $item-positive-active-border);\n  }\n  &.item-calm {\n    @include item-active-style($item-calm-active-bg, $item-calm-active-border);\n  }\n  &.item-assertive {\n    @include item-active-style($item-assertive-active-bg, $item-assertive-active-border);\n  }\n  &.item-balanced {\n    @include item-active-style($item-balanced-active-bg, $item-balanced-active-border);\n  }\n  &.item-energized {\n    @include item-active-style($item-energized-active-bg, $item-energized-active-border);\n  }\n  &.item-royal {\n    @include item-active-style($item-royal-active-bg, $item-royal-active-border);\n  }\n  &.item-dark {\n    @include item-active-style($item-dark-active-bg, $item-dark-active-border);\n  }\n}\n\n// Handle text overflow\n.item,\n.item h1,\n.item h2,\n.item h3,\n.item h4,\n.item h5,\n.item h6,\n.item p,\n.item-content,\n.item-content h1,\n.item-content h2,\n.item-content h3,\n.item-content h4,\n.item-content h5,\n.item-content h6,\n.item-content p {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n// Linked list items\na.item {\n  color: inherit;\n  text-decoration: none;\n\n  &:hover,\n  &:focus {\n    text-decoration: none;\n  }\n}\n\n\n/**\n * Complex Items\n * --------------------------------------------------\n * Adding .item-complex allows the .item to be slidable and\n * have options underneath the button, but also requires an\n * additional .item-content element inside .item.\n * Basically .item-complex removes any default settings which\n * .item added, so that .item-content looks them as just .item.\n */\n\n.item-complex,\na.item.item-complex,\nbutton.item.item-complex {\n  padding: 0;\n}\n.item-complex .item-content,\n.item-radio .item-content {\n  position: relative;\n  z-index: $z-index-item;\n  padding: $item-padding (ceil( ($item-padding * 3) + ($item-padding / 3) ) - 5) $item-padding $item-padding;\n  border: none;\n  background-color: white;\n}\n\na.item-content {\n  display: block;\n  color: inherit;\n  text-decoration: none;\n}\n\n.item-text-wrap .item,\n.item-text-wrap .item-content,\n.item-text-wrap,\n.item-text-wrap h1,\n.item-text-wrap h2,\n.item-text-wrap h3,\n.item-text-wrap h4,\n.item-text-wrap h5,\n.item-text-wrap h6,\n.item-text-wrap p,\n.item-complex.item-text-wrap .item-content,\n.item-body h1,\n.item-body h2,\n.item-body h3,\n.item-body h4,\n.item-body h5,\n.item-body h6,\n.item-body p {\n  overflow: visible;\n  white-space: normal;\n}\n.item-complex.item-text-wrap,\n.item-complex.item-text-wrap h1,\n.item-complex.item-text-wrap h2,\n.item-complex.item-text-wrap h3,\n.item-complex.item-text-wrap h4,\n.item-complex.item-text-wrap h5,\n.item-complex.item-text-wrap h6,\n.item-complex.item-text-wrap p {\n  overflow: visible;\n  white-space: normal;\n}\n\n// Link and Button Active States\n\n.item-complex{\n  // Stylized items\n  &.item-light > .item-content{\n    @include item-style($item-light-bg, $item-light-border, $item-light-text);\n    &.active, &:active {\n      @include item-active-style($item-light-active-bg, $item-light-active-border);\n    }\n  }\n  &.item-stable > .item-content{\n    @include item-style($item-stable-bg, $item-stable-border, $item-stable-text);\n    &.active, &:active {\n      @include item-active-style($item-stable-active-bg, $item-stable-active-border);\n    }\n  }\n  &.item-positive > .item-content{\n    @include item-style($item-positive-bg, $item-positive-border, $item-positive-text);\n    &.active, &:active {\n      @include item-active-style($item-positive-active-bg, $item-positive-active-border);\n    }\n  }\n  &.item-calm > .item-content{\n    @include item-style($item-calm-bg, $item-calm-border, $item-calm-text);\n    &.active, &:active {\n      @include item-active-style($item-calm-active-bg, $item-calm-active-border);\n    }\n  }\n  &.item-assertive > .item-content{\n    @include item-style($item-assertive-bg, $item-assertive-border, $item-assertive-text);\n    &.active, &:active {\n      @include item-active-style($item-assertive-active-bg, $item-assertive-active-border);\n    }\n  }\n  &.item-balanced > .item-content{\n    @include item-style($item-balanced-bg, $item-balanced-border, $item-balanced-text);\n    &.active, &:active {\n      @include item-active-style($item-balanced-active-bg, $item-balanced-active-border);\n    }\n  }\n  &.item-energized > .item-content{\n    @include item-style($item-energized-bg, $item-energized-border, $item-energized-text);\n    &.active, &:active {\n      @include item-active-style($item-energized-active-bg, $item-energized-active-border);\n    }\n  }\n  &.item-royal > .item-content{\n    @include item-style($item-royal-bg, $item-royal-border, $item-royal-text);\n    &.active, &:active {\n      @include item-active-style($item-royal-active-bg, $item-royal-active-border);\n    }\n  }\n  &.item-dark > .item-content{\n    @include item-style($item-dark-bg, $item-dark-border, $item-dark-text);\n    &.active, &:active {\n      @include item-active-style($item-dark-active-bg, $item-dark-active-border);\n    }\n  }\n}\n\n\n/**\n * Item Icons\n * --------------------------------------------------\n */\n\n.item-icon-left .icon,\n.item-icon-right .icon {\n  @include display-flex();\n  @include align-items(center);\n  position: absolute;\n  top: 0;\n  height: 100%;\n  font-size: $item-icon-font-size;\n\n  &:before {\n    display: block;\n    width: $item-icon-font-size;\n    text-align: center;\n  }\n}\n\n.item .fill-icon {\n  min-width: $item-icon-fill-font-size + 2;\n  min-height: $item-icon-fill-font-size + 2;\n  font-size: $item-icon-fill-font-size;\n}\n\n.item-icon-left {\n  padding-left: ceil( ($item-padding * 3) + ($item-padding / 3) );\n\n  .icon {\n    left: ceil( ($item-padding / 3) * 2);\n  }\n}\n.item-complex.item-icon-left {\n  padding-left: 0;\n\n  .item-content {\n    padding-left: ceil( ($item-padding * 3) + ($item-padding / 3) );\n  }\n}\n\n.item-icon-right {\n  padding-right: ceil( ($item-padding * 3) + ($item-padding / 3) );\n\n  .icon {\n    right: ceil( ($item-padding / 3) * 2);\n  }\n}\n.item-complex.item-icon-right {\n  padding-right: 0;\n\n  .item-content {\n    padding-right: ceil( ($item-padding * 3) + ($item-padding / 3) );\n  }\n}\n\n.item-icon-left.item-icon-right .icon:first-child {\n  right: auto;\n}\n.item-icon-left.item-icon-right .icon:last-child,\n.item-icon-left .item-delete .icon {\n  left: auto;\n}\n\n.item-icon-left .icon-accessory,\n.item-icon-right .icon-accessory {\n  color: $item-icon-accessory-color;\n  font-size: $item-icon-accessory-font-size;\n}\n.item-icon-left .icon-accessory {\n  left: floor($item-padding / 5);\n}\n.item-icon-right .icon-accessory {\n  right: floor($item-padding / 5);\n}\n\n\n/**\n * Item Button\n * --------------------------------------------------\n * An item button is a child button inside an .item (not the entire .item)\n */\n\n.item-button-left {\n  padding-left: ceil($item-padding * 4.5);\n}\n\n.item-button-left > .button,\n.item-button-left .item-content > .button {\n  @include display-flex();\n  @include align-items(center);\n  position: absolute;\n  top: ceil($item-padding / 2);\n  left: ceil( ($item-padding / 3) * 2);\n  min-width: $item-icon-font-size + ($button-border-width * 2);\n  min-height: $item-icon-font-size + ($button-border-width * 2);\n  font-size: $item-button-font-size;\n  line-height: $item-button-line-height;\n\n  .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: $item-icon-font-size - 1;\n  }\n\n  > .button {\n    margin: 0px 2px;\n    min-height: $item-icon-font-size + ($button-border-width * 2);\n    font-size: $item-button-font-size;\n    line-height: $item-button-line-height;\n  }\n}\n\n.item-button-right,\na.item.item-button-right,\nbutton.item.item-button-right {\n  padding-right: $item-padding * 5;\n}\n\n.item-button-right > .button,\n.item-button-right .item-content > .button,\n.item-button-right > .buttons,\n.item-button-right .item-content > .buttons {\n  @include display-flex();\n  @include align-items(center);\n  position: absolute;\n  top: ceil($item-padding / 2);\n  right: $item-padding;\n  min-width: $item-icon-font-size + ($button-border-width * 2);\n  min-height: $item-icon-font-size + ($button-border-width * 2);\n  font-size: $item-button-font-size;\n  line-height: $item-button-line-height;\n\n  .icon:before {\n    position: relative;\n    left: auto;\n    width: auto;\n    line-height: $item-icon-font-size - 1;\n  }\n\n  > .button {\n    margin: 0px 2px;\n    min-width: $item-icon-font-size + ($button-border-width * 2);\n    min-height: $item-icon-font-size + ($button-border-width * 2);\n    font-size: $item-button-font-size;\n    line-height: $item-button-line-height;\n  }\n}\n\n\n// Item Avatar\n// -------------------------------\n\n.item-avatar,\n.item-avatar .item-content,\n.item-avatar-left,\n.item-avatar-left .item-content {\n  padding-left: $item-avatar-width + ($item-padding * 2);\n  min-height: $item-avatar-width + ($item-padding * 2);\n\n  > img:first-child,\n  .item-image {\n    position: absolute;\n    top: $item-padding;\n    left: $item-padding;\n    max-width: $item-avatar-width;\n    max-height: $item-avatar-height;\n    width: 100%;\n    height: 100%;\n    border-radius: $item-avatar-border-radius;\n  }\n}\n\n.item-avatar-right,\n.item-avatar-right .item-content {\n  padding-right: $item-avatar-width + ($item-padding * 2);\n  min-height: $item-avatar-width + ($item-padding * 2);\n\n  > img:first-child,\n  .item-image {\n    position: absolute;\n    top: $item-padding;\n    right: $item-padding;\n    max-width: $item-avatar-width;\n    max-height: $item-avatar-height;\n    width: 100%;\n    height: 100%;\n    border-radius: $item-avatar-border-radius;\n  }\n}\n\n\n// Item Thumbnails\n// -------------------------------\n\n.item-thumbnail-left,\n.item-thumbnail-left .item-content {\n  padding-top: $item-padding / 2;\n  padding-left: $item-thumbnail-width + $item-thumbnail-margin + $item-padding;\n  min-height: $item-thumbnail-height + ($item-thumbnail-margin * 2);\n\n  > img:first-child,\n  .item-image {\n    position: absolute;\n    top: $item-thumbnail-margin;\n    left: $item-thumbnail-margin;\n    max-width: $item-thumbnail-width;\n    max-height: $item-thumbnail-height;\n    width: 100%;\n    height: 100%;\n  }\n}\n.item-avatar.item-complex,\n.item-avatar-left.item-complex,\n.item-thumbnail-left.item-complex {\n  padding-top: 0;\n  padding-left: 0;\n}\n\n.item-thumbnail-right,\n.item-thumbnail-right .item-content {\n  padding-top: $item-padding / 2;\n  padding-right: $item-thumbnail-width + $item-thumbnail-margin + $item-padding;\n  min-height: $item-thumbnail-height + ($item-thumbnail-margin * 2);\n\n  > img:first-child,\n  .item-image {\n    position: absolute;\n    top: $item-thumbnail-margin;\n    right: $item-thumbnail-margin;\n    max-width: $item-thumbnail-width;\n    max-height: $item-thumbnail-height;\n    width: 100%;\n    height: 100%;\n  }\n}\n.item-avatar-right.item-complex,\n.item-thumbnail-right.item-complex {\n  padding-top: 0;\n  padding-right: 0;\n}\n\n\n// Item Image\n// -------------------------------\n\n.item-image {\n  padding: 0;\n  text-align: center;\n\n  img:first-child, .list-img {\n    width: 100%;\n    vertical-align: middle;\n  }\n}\n\n\n// Item Body\n// -------------------------------\n\n.item-body {\n  overflow: auto;\n  padding: $item-padding;\n  text-overflow: inherit;\n  white-space: normal;\n\n  h1, h2, h3, h4, h5, h6, p {\n    margin-top: $item-padding;\n    margin-bottom: $item-padding;\n  }\n}\n\n\n// Item Divider\n// -------------------------------\n\n.item-divider {\n  padding-top: ceil($item-padding / 2);\n  padding-bottom: ceil($item-padding / 2);\n  min-height: 30px;\n  background-color: $item-divider-bg;\n  color: $item-divider-color;\n  font-weight: 500;\n}\n\n.platform-ios .item-divider-platform,\n.item-divider-ios {\n  padding-top: 26px;\n  text-transform: uppercase;\n  font-weight: 300;\n  font-size: 13px;\n  background-color: #efeff4;\n  color: #555;\n}\n\n.platform-android .item-divider-platform,\n.item-divider-android {\n  font-weight: 300;\n  font-size: 13px;\n}\n\n\n// Item Note\n// -------------------------------\n\n.item-note {\n  float: right;\n  color: #aaa;\n  font-size: 14px;\n}\n\n\n// Item Editing\n// -------------------------------\n\n.item-left-editable .item-content,\n.item-right-editable .item-content {\n  // setup standard transition settings\n  @include transition-duration( $item-edit-transition-duration );\n  @include transition-timing-function( $item-edit-transition-function );\n  -webkit-transition-property: -webkit-transform;\n     -moz-transition-property: -moz-transform;\n          transition-property: transform;\n}\n\n.list-left-editing .item-left-editable .item-content,\n.item-left-editing.item-left-editable .item-content {\n  // actively editing the left side of the item\n  @include translate3d($item-left-edit-open-width, 0, 0);\n}\n\n.item-remove-animate {\n  &.ng-leave {\n    @include transition-duration( $item-remove-transition-duration );\n  }\n  &.ng-leave .item-content,\n  &.ng-leave:last-of-type {\n    @include transition-duration( $item-remove-transition-duration );\n    @include transition-timing-function( $item-remove-transition-function );\n    @include transition-property( all );\n  }\n\n  &.ng-leave.ng-leave-active .item-content {\n    opacity:0;\n    -webkit-transform: translate3d(-100%, 0, 0) !important;\n    transform: translate3d(-100%, 0, 0) !important;\n  }\n  &.ng-leave.ng-leave-active:last-of-type {\n    opacity: 0;\n  }\n\n  &.ng-leave.ng-leave-active ~ ion-item:not(.ng-leave) {\n    -webkit-transform: translate3d(0, unquote('-webkit-calc(-100% + 1px)'), 0);\n    transform: translate3d(0, calc(-100% + 1px), 0);\n    @include transition-duration( $item-remove-transition-duration );\n    @include transition-timing-function( $item-remove-descendents-transition-function );\n    @include transition-property( all );\n  }\n}\n\n\n\n// Item Left Edit Button\n// -------------------------------\n\n.item-left-edit {\n  @include transition(all $item-edit-transition-function $item-edit-transition-duration / 2);\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: $z-index-item-edit;\n  width: $item-left-edit-open-width;\n  height: 100%;\n  line-height: 100%;\n\n  .button {\n    height: 100%;\n\n    &.icon {\n      @include display-flex();\n      @include align-items(center);\n      position: absolute;\n      top: 0;\n      height: 100%;\n    }\n  }\n\n  display: none;\n  opacity: 0;\n  @include translate3d( ($item-left-edit-left - $item-left-edit-open-width) / 2, 0, 0);\n  &.visible {\n    display: block;\n    &.active {\n      opacity: 1;\n      @include translate3d($item-left-edit-left, 0, 0);\n    }\n  }\n}\n.list-left-editing .item-left-edit {\n  @include transition-delay($item-edit-transition-duration / 2);\n}\n\n// Item Delete (Left side edit button)\n// -------------------------------\n\n.item-delete .button.icon {\n  color: $item-delete-icon-color;\n  font-size: $item-delete-icon-size;\n\n  &:hover {\n    opacity: .7;\n  }\n}\n\n\n// Item Right Edit Button\n// -------------------------------\n\n.item-right-edit {\n  @include transition(all $item-edit-transition-function $item-edit-transition-duration);\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: $z-index-item-reorder;\n  width: $item-right-edit-open-width *  1.5;\n  height: 100%;\n  background: inherit;\n  padding-left: 20px;\n\n  .button {\n    min-width: $item-right-edit-open-width;\n    height: 100%;\n\n    &.icon {\n      @include display-flex();\n      @include align-items(center);\n      position: absolute;\n      top: 0;\n      height: 100%;\n      font-size: $item-reorder-icon-size;\n    }\n  }\n\n  display: block;\n  opacity: 0;\n  @include translate3d($item-right-edit-open-width *  1.5, 0, 0);\n  &.visible {\n    display: block;\n    &.active {\n      opacity: 1;\n      @include translate3d(0, 0, 0);\n    }\n  }\n}\n\n\n// Item Reordering (Right side edit button)\n// -------------------------------\n\n.item-reorder .button.icon {\n  color: $item-reorder-icon-color;\n  font-size: $item-reorder-icon-size;\n}\n\n.item-reordering {\n  // item is actively being reordered\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: $z-index-item-reordering;\n  width: 100%;\n  box-shadow: 0px 0px 10px 0px #aaa;\n\n  .item-reorder {\n    z-index: $z-index-item-reordering;\n  }\n}\n\n.item-placeholder {\n  // placeholder for the item that's being reordered\n  opacity: 0.7;\n}\n\n\n/**\n * The hidden right-side buttons that can be exposed under a list item\n * with dragging.\n */\n.item-options {\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: $z-index-item-options;\n  height: 100%;\n\n  .button {\n    height: 100%;\n    border: none;\n    border-radius: 0;\n    @include display-inline-flex();\n    @include align-items(center);\n\n    &:before{\n      margin: 0 auto;\n    }\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_list.scss",
    "content": "\n/**\n * Lists\n * --------------------------------------------------\n */\n\n.list {\n  position: relative;\n  padding-top: $item-border-width;\n  padding-bottom: $item-border-width;\n  padding-left: 0; // reset padding because ul and ol\n  margin-bottom: 20px;\n}\n.list:last-child {\n  margin-bottom: 0px;\n  &.card{\n    margin-bottom:40px;\n  }\n}\n\n\n/**\n * List Header\n * --------------------------------------------------\n */\n\n.list-header {\n  margin-top: $list-header-margin-top;\n  padding: $list-header-padding;\n  background-color: $list-header-bg;\n  color: $list-header-color;\n  font-weight: bold;\n}\n\n// when its a card make sure it doesn't duplicate top and bottom borders\n.card.list .list-item {\n  padding-right: 1px;\n  padding-left: 1px;\n}\n\n\n/**\n * Cards and Inset Lists\n * --------------------------------------------------\n * A card and list-inset are close to the same thing, except a card as a box shadow.\n */\n\n.card,\n.list-inset {\n  overflow: hidden;\n  margin: ($content-padding * 2) $content-padding;\n  border-radius: $card-border-radius;\n  background-color: $card-body-bg;\n}\n\n.card {\n  padding-top: $item-border-width;\n  padding-bottom: $item-border-width;\n  box-shadow: $card-box-shadow;\n\n  .item {\n    border-left: 0;\n    border-right: 0;\n  }\n  .item:first-child {\n    border-top: 0;\n  }\n  .item:last-child {\n    border-bottom: 0;\n  }\n}\n\n.padding {\n  .card, .list-inset {\n    margin-left: 0;\n    margin-right: 0;\n  }\n}\n\n.card .item,\n.list-inset .item,\n.padding > .list .item\n{\n  &:first-child {\n    border-top-left-radius: $card-border-radius;\n    border-top-right-radius: $card-border-radius;\n\n    .item-content {\n      border-top-left-radius: $card-border-radius;\n      border-top-right-radius: $card-border-radius;\n    }\n  }\n  &:last-child {\n    border-bottom-right-radius: $card-border-radius;\n    border-bottom-left-radius: $card-border-radius;\n\n    .item-content {\n      border-bottom-right-radius: $card-border-radius;\n      border-bottom-left-radius: $card-border-radius;\n    }\n  }\n}\n\n.card .item:last-child,\n.list-inset .item:last-child {\n  margin-bottom: $item-border-width * -1;\n}\n\n.card .item,\n.list-inset .item,\n.padding > .list .item,\n.padding-horizontal > .list .item {\n  margin-right: 0;\n  margin-left: 0;\n\n  &.item-input input {\n    padding-right: 44px;\n  }\n}\n.padding-left > .list .item {\n  margin-left: 0;\n}\n.padding-right > .list .item {\n  margin-right: 0;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_loaders.scss",
    "content": "/**\n * Loaders (Spinners)\n * --------------------------------------------------\n */\n\nsvg.loader {\n  width: 28px;\n  height: 28px;\n  stroke: #333;\n  fill: #333;\n}\n\n.loader-ios,\n.loader-ios-small {\n\n  line {\n    stroke: #69717d;\n  }\n\n}\n\n.loader-android {\n\n  circle {\n    stroke: #4b8bf4;\n  }\n\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_loading.scss",
    "content": "\n/**\n * Loading\n * --------------------------------------------------\n */\n\n.loading-container {\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  bottom: 0;\n\n  z-index: $z-index-loading;\n\n  @include display-flex();\n  @include justify-content(center);\n  @include align-items(center);\n\n  @include transition(0.2s opacity linear);\n  visibility: hidden;\n  opacity: 0;\n\n  &:not(.visible) .icon {\n    display: none;\n  }\n  &.visible {\n    visibility: visible;\n  }\n  &.active {\n    opacity: 1;\n  }\n\n  .loading {\n    padding: $loading-padding;\n\n    border-radius: $loading-border-radius;\n    background-color: $loading-bg-color;\n\n    color: $loading-text-color;\n\n    text-align: center;\n    text-overflow: ellipsis;\n    font-size: $loading-font-size;\n\n    h1, h2, h3, h4, h5, h6 {\n      color: $loading-text-color;\n    }\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_menu.scss",
    "content": "\n/**\n * Menus\n * --------------------------------------------------\n * Side panel structure\n */\n\n.menu {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  z-index: $z-index-menu;\n  overflow: hidden;\n\n  min-height: 100%;\n  max-height: 100%;\n  width: $menu-width;\n\n  background-color: $menu-bg;\n\n  .scroll-content {\n    z-index: $z-index-menu-scroll-content;\n  }\n\n  .bar-header {\n    z-index: $z-index-menu-bar-header;\n  }\n}\n\n.menu-content {\n  @include transform(none);\n  box-shadow: $menu-side-shadow;\n}\n\n.menu-open .menu-content .pane,\n.menu-open .menu-content .scroll-content {\n  pointer-events: none;\n}\n\n.grade-b .menu-content,\n.grade-c .menu-content {\n  @include box-sizing(content-box);\n  right: -1px;\n  left: -1px;\n  border-right: 1px solid #ccc;\n  border-left: 1px solid #ccc;\n  box-shadow: none;\n}\n\n.menu-left {\n  left: 0;\n}\n\n.menu-right {\n  right: 0;\n}\n\n.aside-open.aside-resizing .menu-right {\n  display: none;\n}\n\n.menu-animated {\n  @include transition-transform($menu-animation-speed ease);\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_mixins.scss",
    "content": "\n// Button Mixins\n// --------------------------------------------------\n\n@mixin button-style($bg-color, $border-color, $active-bg-color, $active-border-color, $color) {\n  border-color: $border-color;\n  background-color: $bg-color;\n  color: $color;\n\n  // Give desktop users something to play with\n  &:hover {\n    color: $color;\n    text-decoration: none;\n  }\n  &.active,\n  &.activated {\n    border-color: $active-border-color;\n    background-color: $active-bg-color;\n    box-shadow: inset 0 1px 4px rgba(0,0,0,0.1);\n  }\n}\n\n@mixin button-clear($color, $font-size:\"\") {\n  &.button-clear {\n    border-color: transparent;\n    background: none;\n    box-shadow: none;\n    color: $color;\n\n    @if $font-size != \"\" {\n      font-size: $font-size;\n    }\n  }\n  &.button-icon {\n    border-color: transparent;\n    background: none;\n  }\n}\n\n@mixin button-outline($color, $text-color:\"\") {\n  &.button-outline {\n    border-color: $color;\n    background: transparent;\n    @if $text-color == \"\" {\n      $text-color: $color;\n    }\n    color: $text-color;\n    &.active,\n    &.activated {\n      background-color: $color;\n      box-shadow: none;\n      color: #fff;\n    }\n  }\n}\n\n\n// Bar Mixins\n// --------------------------------------------------\n\n@mixin bar-style($bg-color, $border-color, $color) {\n  border-color: $border-color;\n  background-color: $bg-color;\n  background-image: linear-gradient(0deg, $border-color, $border-color 50%, transparent 50%);\n  color: $color;\n\n  .title {\n    color: $color;\n  }\n}\n\n\n// Tab Mixins\n// --------------------------------------------------\n\n@mixin tab-style($bg-color, $border-color, $color) {\n  border-color: $border-color;\n  background-color: $bg-color;\n  background-image: linear-gradient(0deg, $border-color, $border-color 50%, transparent 50%);\n  color: $color;\n}\n\n@mixin tab-badge-style($bg-color, $color) {\n  .tab-item .badge {\n    background-color: $bg-color;\n    color: $color;\n  }\n}\n\n\n// Item Mixins\n// --------------------------------------------------\n\n@mixin item-style($bg-color, $border-color, $color) {\n  border-color: $border-color;\n  background-color: $bg-color;\n  color: $color;\n}\n\n@mixin item-active-style($active-bg-color, $active-border-color) {\n  border-color: $active-border-color;\n  background-color: $active-bg-color;\n}\n\n\n// Badge Mixins\n// --------------------------------------------------\n\n@mixin badge-style($bg-color, $color) {\n  background-color: $bg-color;\n  color: $color;\n}\n\n\n// Range Mixins\n// --------------------------------------------------\n\n@mixin range-style($track-bg-color) {\n  &::-webkit-slider-thumb:before {\n    background: $track-bg-color;\n  }\n  &::-ms-fill-lower{\n    background: $track-bg-color;\n  }\n}\n\n\n// Checkbox Mixins\n// --------------------------------------------------\n\n@mixin checkbox-style($off-border-color, $on-bg-color, $on-border-color) {\n  & input:before,\n  & .checkbox-icon:before {\n    border-color: $off-border-color;\n  }\n\n  // what the background looks like when its checked\n  & input:checked:before,\n  & input:checked + .checkbox-icon:before {\n    background: $on-bg-color;\n    border-color: $on-border-color;\n  }\n}\n\n\n// Toggle Mixins\n// --------------------------------------------------\n\n@mixin toggle-style($on-border-color, $on-bg-color) {\n  // the track when the toggle is \"on\"\n  & input:checked + .track {\n    border-color: $on-border-color;\n    background-color: $on-bg-color;\n  }\n}\n@mixin toggle-small-style($on-bg-color) {\n  // the track when the toggle is \"on\"\n  & input:checked + .track {\n    background-color: rgba($on-bg-color, .5);\n  }\n  & input:checked + .track .handle {\n    background-color: $on-bg-color;\n  }\n}\n\n\n// Clearfix\n// --------------------------------------------------\n\n@mixin clearfix {\n  *zoom: 1;\n  &:before,\n  &:after {\n    display: table;\n    content: \"\";\n    line-height: 0;\n  }\n  &:after {\n    clear: both;\n  }\n}\n\n\n// Placeholder text\n// --------------------------------------------------\n\n@mixin placeholder($color: $input-color-placeholder, $text-indent: 0) {\n  &::-moz-placeholder { // Firefox 19+\n    color: $color;\n  }\n  &:-ms-input-placeholder {\n    color: $color;\n  }\n  &::-webkit-input-placeholder {\n    color: $color;\n    // Safari placeholder margin issue\n    text-indent: $text-indent;\n  }\n}\n\n\n// Text Mixins\n// --------------------------------------------------\n\n@mixin text-size-adjust($value: none) {\n  -webkit-text-size-adjust: $value;\n     -moz-text-size-adjust: $value;\n          text-size-adjust: $value;\n}\n@mixin tap-highlight-transparent() {\n  -webkit-tap-highlight-color: rgba(0,0,0,0);\n  -webkit-tap-highlight-color: transparent; // For some Androids\n}\n@mixin touch-callout($value: none) {\n  -webkit-touch-callout: $value;\n}\n\n\n// Font Mixins\n// --------------------------------------------------\n\n@mixin font-family-serif() {\n  font-family: $serif-font-family;\n}\n@mixin font-family-sans-serif() {\n  font-family: $sans-font-family;\n}\n@mixin font-family-monospace() {\n  font-family: $mono-font-family;\n}\n@mixin font-shorthand($size: $base-font-size, $weight: normal, $line-height: $base-line-height) {\n  font-weight: $weight;\n  font-size: $size;\n  line-height: $line-height;\n}\n@mixin font-serif($size: $base-font-size, $weight: normal, $line-height: $base-line-height) {\n  @include font-family-serif();\n  @include font-shorthand($size, $weight, $line-height);\n}\n@mixin font-sans-serif($size: $base-font-size, $weight: normal, $line-height: $base-line-height) {\n  @include font-family-sans-serif();\n  @include font-shorthand($size, $weight, $line-height);\n}\n@mixin font-monospace($size: $base-font-size, $weight: normal, $line-height: $base-line-height) {\n  @include font-family-monospace();\n  @include font-shorthand($size, $weight, $line-height);\n}\n@mixin font-smoothing($font-smoothing) {\n  -webkit-font-smoothing: $font-smoothing;\n          font-smoothing: $font-smoothing;\n}\n\n\n// Appearance\n// --------------------------------------------------\n\n@mixin appearance($val) {\n  -webkit-appearance: $val;\n     -moz-appearance: $val;\n          appearance: $val;\n}\n\n\n// Border Radius Mixins\n// --------------------------------------------------\n\n@mixin border-radius($radius) {\n  -webkit-border-radius: $radius;\n          border-radius: $radius;\n}\n\n// Single Corner Border Radius\n@mixin border-top-left-radius($radius) {\n  -webkit-border-top-left-radius: $radius;\n          border-top-left-radius: $radius;\n}\n@mixin border-top-right-radius($radius) {\n  -webkit-border-top-right-radius: $radius;\n          border-top-right-radius: $radius;\n}\n@mixin border-bottom-right-radius($radius) {\n  -webkit-border-bottom-right-radius: $radius;\n          border-bottom-right-radius: $radius;\n}\n@mixin border-bottom-left-radius($radius) {\n  -webkit-border-bottom-left-radius: $radius;\n          border-bottom-left-radius: $radius;\n}\n\n// Single Side Border Radius\n@mixin border-top-radius($radius) {\n  @include border-top-right-radius($radius);\n  @include border-top-left-radius($radius);\n}\n@mixin border-right-radius($radius) {\n  @include border-top-right-radius($radius);\n  @include border-bottom-right-radius($radius);\n}\n@mixin border-bottom-radius($radius) {\n  @include border-bottom-right-radius($radius);\n  @include border-bottom-left-radius($radius);\n}\n@mixin border-left-radius($radius) {\n  @include border-top-left-radius($radius);\n  @include border-bottom-left-radius($radius);\n}\n\n\n// Box shadows\n// --------------------------------------------------\n\n@mixin box-shadow($shadow...) {\n  -webkit-box-shadow: $shadow;\n          box-shadow: $shadow;\n}\n\n\n// Transition Mixins\n// --------------------------------------------------\n\n@mixin transition($transition...) {\n  -webkit-transition: $transition;\n          transition: $transition;\n}\n@mixin transition-delay($transition-delay) {\n  -webkit-transition-delay: $transition-delay;\n          transition-delay: $transition-delay;\n}\n@mixin transition-duration($transition-duration) {\n  -webkit-transition-duration: $transition-duration;\n          transition-duration: $transition-duration;\n}\n@mixin transition-timing-function($transition-timing) {\n   -webkit-transition-timing-function: $transition-timing;\n           transition-timing-function: $transition-timing;\n }\n @mixin transition-property($property) {\n  -webkit-transition-property: $property;\n          transition-property: $property;\n}\n@mixin transition-transform($properties...) {\n  // special case cuz of transform vendor prefixes\n  -webkit-transition: -webkit-transform $properties;\n          transition: transform $properties;\n}\n\n\n// Animation Mixins\n// --------------------------------------------------\n\n@mixin animation($animation) {\n -webkit-animation: $animation;\n         animation: $animation;\n}\n@mixin animation-duration($duration) {\n -webkit-animation-duration: $duration;\n         animation-duration: $duration;\n}\n@mixin animation-direction($direction) {\n -webkit-animation-direction: $direction;\n         animation-direction: $direction;\n}\n@mixin animation-timing-function($animation-timing) {\n -webkit-animation-timing-function: $animation-timing;\n         animation-timing-function: $animation-timing;\n}\n@mixin animation-fill-mode($fill-mode) {\n -webkit-animation-fill-mode: $fill-mode;\n         animation-fill-mode: $fill-mode;\n}\n@mixin animation-name($name...) {\n -webkit-animation-name: $name;\n         animation-name: $name;\n}\n@mixin animation-iteration-count($count) {\n -webkit-animation-iteration-count: $count;\n         animation-iteration-count: $count;\n}\n\n\n// Transformation Mixins\n// --------------------------------------------------\n\n@mixin rotate($degrees) {\n  @include transform( rotate($degrees) );\n}\n@mixin scale($ratio) {\n  @include transform( scale($ratio) );\n}\n@mixin translate($x, $y) {\n  @include transform( translate($x, $y) );\n}\n@mixin skew($x, $y) {\n  @include transform( skew($x, $y) );\n  -webkit-backface-visibility: hidden;\n}\n@mixin translate3d($x, $y, $z) {\n  @include transform( translate3d($x, $y, $z) );\n}\n@mixin translateZ($z) {\n  @include transform( translateZ($z) );\n}\n@mixin transform($val) {\n  -webkit-transform: $val;\n          transform: $val;\n}\n\n@mixin transform-origin($left, $top) {\n  -webkit-transform-origin: $left $top;\n          transform-origin: $left $top;\n}\n\n\n// Backface visibility\n// --------------------------------------------------\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden\n\n@mixin backface-visibility($visibility){\n  -webkit-backface-visibility: $visibility;\n          backface-visibility: $visibility;\n}\n\n\n// Background clipping\n// --------------------------------------------------\n\n@mixin background-clip($clip) {\n  -webkit-background-clip: $clip;\n          background-clip: $clip;\n}\n\n\n// Background sizing\n// --------------------------------------------------\n\n@mixin background-size($size) {\n  -webkit-background-size: $size;\n          background-size: $size;\n}\n\n\n// Box sizing\n// --------------------------------------------------\n\n@mixin box-sizing($boxmodel) {\n  -webkit-box-sizing: $boxmodel;\n     -moz-box-sizing: $boxmodel;\n          box-sizing: $boxmodel;\n}\n\n\n// User select\n// --------------------------------------------------\n\n@mixin user-select($select) {\n  -webkit-user-select: $select;\n     -moz-user-select: $select;\n      -ms-user-select: $select;\n          user-select: $select;\n}\n\n\n// Content Columns\n// --------------------------------------------------\n\n@mixin content-columns($columnCount, $columnGap: $grid-gutter-width) {\n  -webkit-column-count: $columnCount;\n     -moz-column-count: $columnCount;\n          column-count: $columnCount;\n  -webkit-column-gap: $columnGap;\n     -moz-column-gap: $columnGap;\n          column-gap: $columnGap;\n}\n\n\n// Flexbox Mixins\n// --------------------------------------------------\n// http://philipwalton.github.io/solved-by-flexbox/\n// https://github.com/philipwalton/solved-by-flexbox\n\n@mixin display-flex {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -moz-box;\n  display: -moz-flex;\n  display: -ms-flexbox;\n  display: flex;\n}\n\n@mixin display-inline-flex {\n  display: -webkit-inline-box;\n  display: -webkit-inline-flex;\n  display: -moz-inline-flex;\n  display: -ms-inline-flexbox;\n  display: inline-flex;\n}\n\n@mixin flex-direction($value: row) {\n  @if $value == row-reverse {\n    -webkit-box-direction: reverse;\n    -webkit-box-orient: horizontal;\n  } @else if $value == column {\n    -webkit-box-direction: normal;\n    -webkit-box-orient: vertical;\n  } @else if $value == column-reverse {\n    -webkit-box-direction: reverse;\n    -webkit-box-orient: vertical;\n  } @else {\n    -webkit-box-direction: normal;\n    -webkit-box-orient: horizontal;\n  }\n  -webkit-flex-direction: $value;\n  -moz-flex-direction: $value;\n  -ms-flex-direction: $value;\n  flex-direction: $value;\n}\n\n@mixin flex-wrap($value: nowrap) {\n  // No Webkit Box fallback.\n  -webkit-flex-wrap: $value;\n  -moz-flex-wrap: $value;\n  @if $value == nowrap {\n      -ms-flex-wrap: none;\n  } @else {\n      -ms-flex-wrap: $value;\n  }\n  flex-wrap: $value;\n}\n\n@mixin flex($fg: 1, $fs: null, $fb: null) {\n  -webkit-box-flex: $fg;\n  -webkit-flex: $fg $fs $fb;\n  -moz-box-flex: $fg;\n  -moz-flex: $fg $fs $fb;\n  -ms-flex: $fg $fs $fb;\n  flex: $fg $fs $fb;\n}\n\n@mixin flex-flow($values: (row nowrap)) {\n  // No Webkit Box fallback.\n  -webkit-flex-flow: $values;\n  -moz-flex-flow: $values;\n  -ms-flex-flow: $values;\n  flex-flow: $values;\n}\n\n@mixin align-items($value: stretch) {\n  @if $value == flex-start {\n    -webkit-box-align: start;\n    -ms-flex-align: start;\n  } @else if $value == flex-end {\n    -webkit-box-align: end;\n    -ms-flex-align: end;\n  } @else {\n    -webkit-box-align: $value;\n    -ms-flex-align: $value;\n  }\n  -webkit-align-items: $value;\n  -moz-align-items: $value;\n  align-items: $value;\n}\n\n@mixin align-self($value: auto) {\n  -webkit-align-self: $value;\n  -moz-align-self: $value;\n  @if $value == flex-start {\n    -ms-flex-item-align: start;\n  } @else if $value == flex-end {\n    -ms-flex-item-align: end;\n  } @else {\n    -ms-flex-item-align: $value;\n  }\n  align-self: $value;\n}\n\n@mixin align-content($value: stretch) {\n  -webkit-align-content: $value;\n  -moz-align-content: $value;\n  @if $value == flex-start {\n    -ms-flex-line-pack: start;\n  } @else if $value == flex-end {\n    -ms-flex-line-pack: end;\n  } @else {\n    -ms-flex-line-pack: $value;\n  }\n  align-content: $value;\n}\n\n@mixin justify-content($value: stretch) {\n  @if $value == flex-start {\n    -webkit-box-pack: start;\n    -ms-flex-pack: start;\n  } @else if $value == flex-end {\n    -webkit-box-pack: end;\n    -ms-flex-pack: end;\n  } @else if $value == space-between {\n    -webkit-box-pack: justify;\n    -ms-flex-pack: justify;\n  } @else {\n    -webkit-box-pack: $value;\n    -ms-flex-pack: $value;\n  }\n  -webkit-justify-content: $value;\n  -moz-justify-content: $value;\n  justify-content: $value;\n}\n\n@mixin flex-order($n) {\n  -webkit-order: $n;\n  -ms-flex-order: $n;\n  order: $n;\n  -webkit-box-ordinal-group: $n;\n}\n\n@mixin responsive-grid-break($selector, $max-width) {\n  @media (max-width: $max-width) {\n    #{$selector} {\n      -webkit-box-direction: normal;\n      -moz-box-direction: normal;\n      -webkit-box-orient: vertical;\n      -moz-box-orient: vertical;\n      -webkit-flex-direction: column;\n      -ms-flex-direction: column;\n      flex-direction: column;\n\n      .col, .col-10, .col-20, .col-25, .col-33, .col-34, .col-50, .col-66, .col-67, .col-75, .col-80, .col-90 {\n        @include flex(1);\n        margin-bottom: ($grid-padding-width * 3) / 2;\n        margin-left: 0;\n        max-width: 100%;\n        width: 100%;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_modal.scss",
    "content": "\n/**\n * Modals\n * --------------------------------------------------\n * Modals are independent windows that slide in from off-screen.\n */\n\n.modal-backdrop,\n.modal-backdrop-bg {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: $z-index-modal;\n  width: 100%;\n  height: 100%;\n}\n\n.modal-backdrop-bg {\n  pointer-events: none;\n}\n\n.modal {\n  display: block;\n  position: absolute;\n  top: 0;\n  z-index: $z-index-modal;\n  overflow: hidden;\n  min-height: 100%;\n  width: 100%;\n  background-color: $modal-bg-color;\n}\n\n@media (min-width: $modal-inset-mode-break-point) {\n  // inset mode is when the modal doesn't fill the entire\n  // display but instead is centered within a large display\n  .modal {\n    top: $modal-inset-mode-top;\n    right: $modal-inset-mode-right;\n    bottom: $modal-inset-mode-bottom;\n    left: $modal-inset-mode-left;\n    min-height: $modal-inset-mode-min-height;\n    width: (100% - $modal-inset-mode-left - $modal-inset-mode-right);\n  }\n\n  .modal.ng-leave-active {\n    bottom: 0;\n  }\n\n  // remove ios header padding from inset header\n  .platform-ios.platform-cordova .modal-wrapper .modal {\n    .bar-header:not(.bar-subheader) {\n      height: $bar-height;\n      > * {\n        margin-top: 0;\n      }\n    }\n    .tabs-top > .tabs,\n    .tabs.tabs-top {\n      top: $bar-height;\n    }\n    .has-header,\n    .bar-subheader {\n      top: $bar-height;\n    }\n    .has-subheader {\n      top: $bar-height + $bar-subheader-height;\n    }\n    .has-header.has-tabs-top {\n      top: $bar-height + $tabs-height;\n    }\n    .has-header.has-subheader.has-tabs-top {\n      top: $bar-height + $bar-subheader-height + $tabs-height;\n    }\n  }\n\n  .modal-backdrop-bg {\n    @include transition(opacity 300ms ease-in-out);\n    background-color: $modal-backdrop-bg-active;\n    opacity: 0;\n  }\n\n  .active .modal-backdrop-bg {\n    opacity: 0.5;\n  }\n}\n\n// disable clicks on all but the modal\n.modal-open {\n  pointer-events: none;\n\n  .modal,\n  .modal-backdrop {\n    pointer-events: auto;\n  }\n  // prevent clicks on modal when loading overlay is active though\n  &.loading-active {\n    .modal,\n    .modal-backdrop {\n      pointer-events: none;\n    }\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_platform.scss",
    "content": "\n/**\n * Platform\n * --------------------------------------------------\n * Platform specific tweaks\n */\n\n.platform-ios.platform-cordova {\n  // iOS has a status bar which sits on top of the header.\n  // Bump down everything to make room for it. However, if\n  // if its in Cordova, and set to fullscreen, then disregard the bump.\n  &:not(.fullscreen) {\n    .bar-header:not(.bar-subheader) {\n      height: $bar-height + $ios-statusbar-height;\n\n      &.item-input-inset .item-input-wrapper {\n        margin-top: 19px !important;\n      }\n\n      > * {\n        margin-top: $ios-statusbar-height;\n      }\n    }\n    .tabs-top > .tabs,\n    .tabs.tabs-top {\n      top: $bar-height + $ios-statusbar-height;\n    }\n\n    .has-header,\n    .bar-subheader {\n      top: $bar-height + $ios-statusbar-height;\n    }\n    .has-subheader {\n      top: $bar-height + $bar-subheader-height + $ios-statusbar-height;\n    }\n    .has-header.has-tabs-top {\n      top: $bar-height + $tabs-height + $ios-statusbar-height;\n    }\n    .has-header.has-subheader.has-tabs-top {\n      top: $bar-height + $bar-subheader-height + $tabs-height + $ios-statusbar-height;\n    }\n  }\n  &.status-bar-hide {\n    // Cordova doesn't adjust the body height correctly, this makes up for it\n    margin-bottom: 20px;\n  }\n}\n\n@media (orientation:landscape) {\n  .platform-ios.platform-browser.platform-ipad {\n    position: fixed; // required for iPad 7 Safari\n  }\n}\n\n.platform-c:not(.enable-transitions) * {\n  // disable transitions on grade-c devices (Android 2)\n  -webkit-transition: none !important;\n  transition: none !important;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_popover.scss",
    "content": "\n/**\n * Popovers\n * --------------------------------------------------\n * Popovers are independent views which float over content\n */\n\n.popover-backdrop {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: $z-index-popover;\n  width: 100%;\n  height: 100%;\n  background-color: $popover-backdrop-bg-inactive;\n\n  &.active {\n    background-color: $popover-backdrop-bg-active;\n  }\n}\n\n.popover {\n  position: absolute;\n  top: 25%;\n  left: 50%;\n  z-index: $z-index-popover;\n  display: block;\n  margin-top: 12px;\n  margin-left: -$popover-width / 2;\n  height: $popover-height;\n  width: $popover-width;\n  background-color: $popover-bg-color;\n  box-shadow: $popover-box-shadow;\n  opacity: 0;\n\n  .item:first-child {\n    border-top: 0;\n  }\n\n  .item:last-child {\n    border-bottom: 0;\n  }\n\n  &.popover-bottom {\n    margin-top: -12px;\n  }\n}\n\n\n// Set popover border-radius\n.popover,\n.popover .bar-header {\n  border-radius: $popover-border-radius;\n}\n.popover .scroll-content {\n  z-index: 1;\n  margin: 2px 0;\n}\n.popover .bar-header {\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0;\n}\n.popover .has-header {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n}\n.popover-arrow {\n  display: none;\n}\n\n\n// iOS Popover\n.platform-ios {\n\n  .popover {\n    box-shadow: $popover-box-shadow-ios;\n    border-radius: $popover-border-radius-ios;\n  }\n  .popover .bar-header {\n    @include border-top-radius($popover-border-radius-ios);\n  }\n  .popover .scroll-content {\n    margin: 8px 0;\n    border-radius: $popover-border-radius-ios;\n  }\n  .popover .scroll-content.has-header {\n    margin-top: 0;\n  }\n  .popover-arrow {\n    position: absolute;\n    display: block;\n    top: -17px;\n    width: 30px;\n    height: 19px;\n    overflow: hidden;\n\n    &:after {\n      position: absolute;\n      top: 12px;\n      left: 5px;\n      width: 20px;\n      height: 20px;\n      background-color: $popover-bg-color;\n      border-radius: 3px;\n      content: '';\n      @include rotate(-45deg);\n    }\n  }\n  .popover-bottom .popover-arrow {\n    top: auto;\n    bottom: -10px;\n    &:after {\n      top: -6px;\n    }\n  }\n}\n\n\n// Android Popover\n.platform-android {\n\n  .popover {\n    margin-top: -32px;\n    background-color: $popover-bg-color-android;\n    box-shadow: $popover-box-shadow-android;\n\n    .item {\n      border-color: $popover-bg-color-android;\n      background-color: $popover-bg-color-android;\n      color: #4d4d4d;\n    }\n    &.popover-bottom {\n      margin-top: 32px;\n    }\n  }\n\n  .popover-backdrop,\n  .popover-backdrop.active {\n    background-color: transparent;\n  }\n}\n\n\n// disable clicks on all but the popover\n.popover-open {\n  pointer-events: none;\n\n  .popover,\n  .popover-backdrop {\n    pointer-events: auto;\n  }\n  // prevent clicks on popover when loading overlay is active though\n  &.loading-active {\n    .popover,\n    .popover-backdrop {\n      pointer-events: none;\n    }\n  }\n}\n\n\n// wider popover on larger viewports\n@media (min-width: $popover-large-break-point) {\n  .popover {\n    width: $popover-large-width;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_popup.scss",
    "content": "\n/**\n * Popups\n * --------------------------------------------------\n */\n\n.popup-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  background: rgba(0,0,0,0);\n\n  @include display-flex();\n  @include justify-content(center);\n  @include align-items(center);\n\n  z-index: $z-index-popup;\n\n  // Start hidden\n  visibility: hidden;\n  &.popup-showing {\n    visibility: visible;\n  }\n\n  &.popup-hidden .popup {\n    @include animation-name(scaleOut);\n    @include animation-duration($popup-leave-animation-duration);\n    @include animation-timing-function(ease-in-out);\n    @include animation-fill-mode(both);\n  }\n\n  &.active .popup {\n    @include animation-name(superScaleIn);\n    @include animation-duration($popup-enter-animation-duration);\n    @include animation-timing-function(ease-in-out);\n    @include animation-fill-mode(both);\n  }\n\n  .popup {\n    width: $popup-width;\n    max-width: 100%;\n    max-height: 90%;\n\n    border-radius: $popup-border-radius;\n    background-color: $popup-background-color;\n\n    @include display-flex();\n    @include flex-direction(column);\n  }\n\n  input,\n  textarea {\n    width: 100%;\n  }\n}\n\n.popup-head {\n  padding: 15px 10px;\n  border-bottom: 1px solid #eee;\n  text-align: center;\n}\n.popup-title {\n  margin: 0;\n  padding: 0;\n  font-size: 15px;\n}\n.popup-sub-title {\n  margin: 5px 0 0 0;\n  padding: 0;\n  font-weight: normal;\n  font-size: 11px;\n}\n.popup-body {\n  padding: 10px;\n  overflow: auto;\n}\n\n.popup-buttons {\n  @include display-flex();\n  @include flex-direction(row);\n  padding: 10px;\n  min-height: $popup-button-min-height + 20;\n\n  .button {\n    @include flex(1);\n    display: block;\n    min-height: $popup-button-min-height;\n    border-radius: $popup-button-border-radius;\n    line-height: $popup-button-line-height;\n\n    margin-right: 5px;\n    &:last-child {\n      margin-right: 0px;\n    }\n  }\n}\n\n.popup-open {\n  pointer-events: none;\n\n  &.modal-open .modal {\n    pointer-events: none;\n  }\n\n  .popup-backdrop, .popup {\n    pointer-events: auto;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_progress.scss",
    "content": "\n/**\n * Progress\n * --------------------------------------------------\n */\n\nprogress {\n  display: block;\n  margin: $progress-margin;\n  width: $progress-width;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_radio.scss",
    "content": "\n/**\n * Radio Button Inputs\n * --------------------------------------------------\n */\n\n.item-radio {\n  padding: 0;\n\n  &:hover {\n    cursor: pointer;\n  }\n}\n\n.item-radio .item-content {\n  /* give some room to the right for the checkmark icon */\n  padding-right: $item-padding * 4;\n}\n\n.item-radio .radio-icon {\n  /* checkmark icon will be hidden by default */\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: $z-index-item-radio;\n  visibility: hidden;\n  padding: $item-padding - 2;\n  height: 100%;\n  font-size: 24px;\n}\n\n.item-radio input {\n  /* hide any radio button inputs elements (the ugly circles) */\n  position: absolute;\n  left: -9999px;\n\n  &:checked ~ .item-content {\n    /* style the item content when its checked */\n    background: #f7f7f7;\n  }\n\n  &:checked ~ .radio-icon {\n    /* show the checkmark icon when its checked */\n    visibility: visible;\n  }\n}\n\n// Hack for Android to correctly display the checked item\n// http://timpietrusky.com/advanced-checkbox-hack\n.platform-android.grade-b .item-radio,\n.platform-android.grade-c .item-radio {\n  -webkit-animation: androidCheckedbugfix infinite 1s;\n}\n@-webkit-keyframes androidCheckedbugfix {\n  from { padding: 0; }\n  to { padding: 0; }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_range.scss",
    "content": "\n/**\n * Range\n * --------------------------------------------------\n */\n\n .range input{\n  display: inline-block;\n  overflow: hidden;\n  margin-top: 5px;\n  margin-bottom: 5px;\n  padding-right: 2px;\n  padding-left: 1px;\n  width: auto;\n  height: $range-slider-height + 15;\n  outline: none;\n  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $range-default-track-bg), color-stop(100%, $range-default-track-bg));\n  background: linear-gradient(to right, $range-default-track-bg 0%, $range-default-track-bg 100%);\n  background-position: center;\n  background-size: 99% $range-track-height;\n  background-repeat: no-repeat;\n  -webkit-appearance: none;\n\n  &::-webkit-slider-thumb {\n    position: relative;\n    width: $range-slider-width;\n    height: $range-slider-height;\n    border-radius: $range-slider-border-radius;\n    background-color: $toggle-handle-off-bg-color;\n    box-shadow: $range-slider-box-shadow;\n    cursor: pointer;\n    -webkit-appearance: none;\n    border: 0;\n  }\n\n  &::-webkit-slider-thumb:before{\n    /* what creates the colorful line on the left side of the slider */\n    position: absolute;\n    top: ($range-slider-height / 2) - ($range-track-height / 2);\n    left: -2001px;\n    width: 2000px;\n    height: $range-track-height;\n    background: $dark;\n    content: ' ';\n  }\n\n  &::-webkit-slider-thumb:after {\n    /* create a larger (but hidden) hit area */\n    position: absolute;\n    top: -15px;\n    left: -15px;\n    padding: 30px;\n    content: ' ';\n    //background: red;\n    //opacity: .5;\n  }\n   &::-ms-track{\n     background: transparent;\n     border-color: transparent;\n     border-width: 11px 0 16px;\n     color:transparent;\n     margin-top:20px;\n   }\n   &::-ms-thumb {\n     width: $range-slider-width;\n     height: $range-slider-height;\n     border-radius: $range-slider-border-radius;\n     background-color: $toggle-handle-off-bg-color;\n     border-color:$toggle-handle-off-bg-color;\n     box-shadow: $range-slider-box-shadow;\n     margin-left:1px;\n     margin-right:1px;\n     outline:none;\n   }\n   &::-ms-fill-lower{\n     height: $range-track-height;\n     background:$dark;\n   }\n   &::-ms-fill-upper {\n     height: $range-track-height;\n     background:$range-default-track-bg;\n   }\n}\n\n.range {\n  @include display-flex();\n  @include align-items(center);\n  padding: 2px 11px;\n\n  &.range-light {\n    input { @include range-style($range-light-track-bg); }\n  }\n  &.range-stable {\n    input { @include range-style($range-stable-track-bg); }\n  }\n  &.range-positive {\n    input { @include range-style($range-positive-track-bg); }\n  }\n  &.range-calm {\n    input { @include range-style($range-calm-track-bg); }\n  }\n  &.range-balanced {\n    input { @include range-style($range-balanced-track-bg); }\n  }\n  &.range-assertive {\n    input { @include range-style($range-assertive-track-bg); }\n  }\n  &.range-energized {\n    input { @include range-style($range-energized-track-bg); }\n  }\n  &.range-royal {\n    input { @include range-style($range-royal-track-bg); }\n  }\n  &.range-dark {\n    input { @include range-style($range-dark-track-bg); }\n  }\n}\n\n.range .icon {\n  @include flex(0);\n  display: block;\n  min-width: $range-icon-size;\n  text-align: center;\n  font-size: $range-icon-size;\n}\n\n.range input {\n  @include flex(1);\n  display: block;\n  margin-right: 10px;\n  margin-left: 10px;\n}\n\n.range-label {\n  @include flex(0, 0, auto);\n  display: block;\n  white-space: nowrap;\n}\n\n.range-label:first-child {\n  padding-left: 5px;\n}\n.range input + .range-label {\n  padding-right: 5px;\n  padding-left: 0;\n}\n\n// WP range height must be auto\n.platform-windowsphone{\n  .range input{\n    height:auto;\n  }\n}"
  },
  {
    "path": "www/lib/ionic/scss/_refresher.scss",
    "content": "\n// Scroll refresher (for pull to refresh)\n.scroll-refresher {\n  position: absolute;\n  top: -60px;\n  right: 0;\n  left: 0;\n  overflow: hidden;\n  margin: auto;\n  height: 60px;\n  .ionic-refresher-content {\n    position: absolute;\n    bottom: 15px;\n    left: 0;\n    width: 100%;\n    color: $scroll-refresh-icon-color;\n    text-align: center;\n\n    font-size: 30px;\n\n    .text-refreshing,\n    .text-pulling {\n      font-size: 16px;\n      line-height: 16px;\n    }\n    &.ionic-refresher-with-text {\n      bottom: 10px;\n    }\n  }\n\n  .icon-refreshing,\n  .icon-pulling {\n    width: 100%;\n    -webkit-backface-visibility: hidden;\n    backface-visibility: hidden;\n    -webkit-transform-style: preserve-3d;\n    transform-style: preserve-3d;\n  }\n  .icon-pulling {\n    @include animation-name(refresh-spin-back);\n    @include animation-duration(200ms);\n    @include animation-timing-function(linear);\n    @include animation-fill-mode(none);\n    -webkit-transform: translate3d(0,0,0) rotate(0deg);\n    transform: translate3d(0,0,0) rotate(0deg);\n  }\n  .icon-refreshing,\n  .text-refreshing {\n    display: none;\n  }\n  .icon-refreshing {\n    @include animation-duration(1.5s);\n  }\n\n  &.active {\n    .icon-pulling:not(.pulling-rotation-disabled) {\n      @include animation-name(refresh-spin);\n      -webkit-transform: translate3d(0,0,0) rotate(-180deg);\n      transform: translate3d(0,0,0) rotate(-180deg);\n    }\n    &.refreshing {\n      @include transition(-webkit-transform .2s);\n      @include transition(transform .2s);\n      -webkit-transform: scale(1,1);\n      transform: scale(1,1);\n\n      .icon-pulling,\n      .text-pulling {\n        display: none;\n      }\n      .icon-refreshing,\n      .text-refreshing {\n        display: block;\n      }\n      &.refreshing-tail {\n        -webkit-transform: scale(0,0);\n        transform: scale(0,0);\n      }\n    }\n  }\n}\n.overflow-scroll > .scroll{\n  &.overscroll{\n    position:fixed;\n  }\n  -webkit-overflow-scrolling:touch;\n  width:100%;\n}\n\n@-webkit-keyframes refresh-spin {\n  0%   { -webkit-transform: translate3d(0,0,0) rotate(0); }\n  100% { -webkit-transform: translate3d(0,0,0) rotate(180deg); }\n}\n\n@keyframes refresh-spin {\n  0%   { transform: translate3d(0,0,0) rotate(0); }\n  100% { transform: translate3d(0,0,0) rotate(180deg); }\n}\n\n@-webkit-keyframes refresh-spin-back {\n  0%   { -webkit-transform: translate3d(0,0,0) rotate(180deg); }\n  100% { -webkit-transform: translate3d(0,0,0) rotate(0); }\n}\n\n@keyframes refresh-spin-back {\n  0%   { transform: translate3d(0,0,0) rotate(180deg); }\n  100% { transform: translate3d(0,0,0) rotate(0); }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_reset.scss",
    "content": "\n/**\n * Resets\n * --------------------------------------------------\n * Adapted from normalize.css and some reset.css. We don't care even one\n * bit about old IE, so we don't need any hacks for that in here.\n *\n * There are probably other things we could remove here, as well.\n *\n * normalize.css v2.1.2 | MIT License | git.io/normalize\n\n * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)\n * http://cssreset.com\n */\n\nhtml, body, div, span, applet, object, iframe,\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\na, abbr, acronym, address, big, cite, code,\ndel, dfn, em, img, ins, kbd, q, s, samp,\nsmall, strike, strong, sub, sup, tt, var,\nb, i, u, center,\ndl, dt, dd, ol, ul, li,\nfieldset, form, label, legend,\ntable, caption, tbody, tfoot, thead, tr, th, td,\narticle, aside, canvas, details, embed, fieldset,\nfigure, figcaption, footer, header, hgroup,\nmenu, nav, output, ruby, section, summary,\ntime, mark, audio, video {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  vertical-align: baseline;\n  font: inherit;\n  font-size: 100%;\n}\n\nol, ul {\n  list-style: none;\n}\nblockquote, q {\n  quotes: none;\n}\nblockquote:before, blockquote:after,\nq:before, q:after {\n  content: '';\n  content: none;\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n\n/**\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n\n[hidden],\ntemplate {\n  display: none;\n}\n\nscript {\n  display: none !important;\n}\n\n/* ==========================================================================\n   Base\n   ========================================================================== */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *  user zoom.\n */\n\nhtml {\n  @include user-select(none);\n  font-family: sans-serif; /* 1 */\n  -webkit-text-size-adjust: 100%;\n  -ms-text-size-adjust: 100%; /* 2 */\n  -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n  margin: 0;\n  line-height: 1;\n}\n\n\n/**\n * Remove default outlines.\n */\na,\nbutton,\n:focus,\na:focus,\nbutton:focus,\na:active,\na:hover {\n  outline: 0;\n}\n\n/* *\n * Remove tap highlight color\n */\n\na {\n  -webkit-user-drag: none;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n  -webkit-tap-highlight-color: transparent;\n\n  &[href]:hover {\n    cursor: pointer;\n  }\n}\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\n\nb,\nstrong {\n  font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\n\ndfn {\n  font-style: italic;\n}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0;\n}\n\n\n/**\n * Correct font family set oddly in Safari 5 and Chrome.\n */\n\ncode,\nkbd,\npre,\nsamp {\n  font-size: 1em;\n  font-family: monospace, serif;\n}\n\n/**\n * Improve readability of pre-formatted text in all browsers.\n */\n\npre {\n  white-space: pre-wrap;\n}\n\n/**\n * Set consistent quote types.\n */\n\nq {\n  quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\";\n}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n  font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n  position: relative;\n  vertical-align: baseline;\n  font-size: 75%;\n  line-height: 0;\n}\n\nsup {\n  top: -0.5em;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\n/**\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n  border: 1px solid #c0c0c0;\n}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n  padding: 0; /* 2 */\n  border: 0; /* 1 */\n}\n\n/**\n * 1. Correct font family not being inherited in all browsers.\n * 2. Correct font size not being inherited in all browsers.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n * 4. Remove any default :focus styles\n * 5. Make sure webkit font smoothing is being inherited\n * 6. Remove default gradient in Android Firefox / FirefoxOS\n */\n\nbutton,\ninput,\nselect,\ntextarea {\n  margin: 0; /* 3 */\n  font-size: 100%; /* 2 */\n  font-family: inherit; /* 1 */\n  outline-offset: 0; /* 4 */\n  outline-style: none; /* 4 */\n  outline-width: 0; /* 4 */\n  -webkit-font-smoothing: inherit; /* 5 */\n  background-image: none; /* 6 */\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `importnt` in\n * the UA stylesheet.\n */\n\nbutton,\ninput {\n  line-height: normal;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.\n * Correct `select` style inheritance in Firefox 4+ and Opera.\n */\n\nbutton,\nselect {\n  text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *  and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *  `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  cursor: pointer; /* 3 */\n  -webkit-appearance: button; /* 2 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n *  (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n  -webkit-box-sizing: content-box; /* 2 */\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  -webkit-appearance: textfield; /* 1 */\n}\n\n/**\n * Remove inner padding and search cancel button in Safari 5 and Chrome\n * on OS X.\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  padding: 0;\n  border: 0;\n}\n\n/**\n * 1. Remove default vertical scrollbar in IE 8/9.\n * 2. Improve readability and alignment in all browsers.\n */\n\ntextarea {\n  overflow: auto; /* 1 */\n  vertical-align: top; /* 2 */\n}\n\n\nimg {\n  -webkit-user-drag: none;\n}\n\n/* ==========================================================================\n   Tables\n   ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n  border-spacing: 0;\n  border-collapse: collapse;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_scaffolding.scss",
    "content": "\n/**\n * Scaffolding\n * --------------------------------------------------\n */\n\n*,\n*:before,\n*:after {\n  @include box-sizing(border-box);\n}\n\nhtml {\n  overflow: hidden;\n  -ms-touch-action: pan-y;\n  touch-action: pan-y;\n}\n\nbody,\n.ionic-body {\n  @include touch-callout(none);\n  @include font-smoothing(antialiased);\n  @include text-size-adjust(none);\n  @include tap-highlight-transparent();\n  @include user-select(none);\n\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n\n  margin: 0;\n  padding: 0;\n\n  color: $base-color;\n  word-wrap: break-word;\n  font-size: $font-size-base;\n  font-family: $font-family-base;\n  line-height: $line-height-computed;\n  text-rendering: optimizeLegibility;\n  -webkit-backface-visibility: hidden;\n  -webkit-user-drag: none;\n  -ms-content-zooming: none;\n}\n\nbody.grade-b,\nbody.grade-c {\n  // disable optimizeLegibility for low end devices\n  text-rendering: auto;\n}\n\n.content {\n  // used for content areas not using the content directive\n  position: relative;\n}\n\n.scroll-content {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n\n  // Hide the top border if any\n  margin-top: -1px;\n\n  // Prevents any distortion of lines\n  padding-top: 1px;\n  margin-bottom: -1px;\n\n  width: auto;\n  height: auto;\n}\n\n.menu .scroll-content.scroll-content-false{\n  z-index: $z-index-scroll-content-false;\n}\n\n.scroll-view {\n  position: relative;\n  display: block;\n  overflow: hidden;\n\n  // Hide the top border if any\n  margin-top: -1px;\n}\n\n/**\n * Scroll is the scroll view component available for complex and custom\n * scroll view functionality.\n */\n.scroll {\n  @include user-select(none);\n  @include touch-callout(none);\n  @include text-size-adjust(none);\n  @include transform-origin(left, top);\n}\n/**\n * Set ms-viewport to prevent MS \"page squish\" and allow fluid scrolling\n * https://msdn.microsoft.com/en-us/library/ie/hh869615(v=vs.85).aspx\n */\n@-ms-viewport { width: device-width; }\n\n// Scroll bar styles\n.scroll-bar {\n  position: absolute;\n  z-index: $z-index-scroll-bar;\n}\n// hide the scroll-bar during animations\n.ng-animate .scroll-bar {\n  visibility: hidden;\n}\n.scroll-bar-h {\n  right: 2px;\n  bottom: 3px;\n  left: 2px;\n  height: 3px;\n\n  .scroll-bar-indicator {\n    height: 100%;\n  }\n}\n\n.scroll-bar-v {\n  top: 2px;\n  right: 3px;\n  bottom: 2px;\n  width: 3px;\n\n  .scroll-bar-indicator {\n    width: 100%;\n  }\n}\n.scroll-bar-indicator {\n  position: absolute;\n  border-radius: 4px;\n  background: rgba(0,0,0,0.3);\n  opacity: 1;\n  @include transition(opacity .3s linear);\n\n  &.scroll-bar-fade-out {\n    opacity: 0;\n  }\n}\n.platform-android .scroll-bar-indicator {\n  // android doesn't have rounded ends on scrollbar\n  border-radius: 0;\n}\n.grade-b .scroll-bar-indicator,\n.grade-c .scroll-bar-indicator {\n  // disable rgba background and border radius for low end devices\n  background: #aaa;\n\n  &.scroll-bar-fade-out {\n    @include transition(none);\n  }\n}\n\nion-infinite-scroll {\n  height: 60px;\n  width: 100%;\n  display: block;\n\n  @include display-flex();\n  @include flex-direction(row);\n  @include justify-content(center);\n  @include align-items(center);\n\n  .icon {\n    color: #666666;\n    font-size: 30px;\n    color: $scroll-refresh-icon-color;\n  }\n  .icon:before,\n  .spinner{\n    -webkit-transform: translate3d(0,0,0);\n    transform: translate3d(0,0,0);\n  }\n  &:not(.active){\n    .spinner,\n    .icon:before{\n      -webkit-transform: translate3d(-1000px,0,0);\n      transform: translate3d(-1000px,0,0);\n    }\n  }\n}\n\n.overflow-scroll {\n  overflow-x: hidden;\n  overflow-y: scroll;\n  -webkit-overflow-scrolling: touch;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  position: absolute;\n\n  .scroll {\n    position: static;\n    height: 100%;\n    -webkit-transform: translate3d(0, 0, 0);   // fix iOS bug where relative children of scroller disapear while scrolling.  see: http://stackoverflow.com/questions/9807620/ipad-safari-scrolling-causes-html-elements-to-disappear-and-reappear-with-a-dela\n  }\n}\n\n\n// Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.\n// Note: For these to work, content must come after both bars in the markup\n/* If you change these, change platform.scss as well */\n.has-header {\n  top: $bar-height;\n}\n// Force no header\n.no-header {\n  top: 0;\n}\n\n.has-subheader {\n  top: $bar-height + $bar-subheader-height;\n}\n.has-tabs-top {\n  top: $bar-height + $tabs-height;\n}\n.has-header.has-subheader.has-tabs-top {\n  top: $bar-height + $bar-subheader-height + $tabs-height;\n}\n\n.has-footer {\n  bottom: $bar-footer-height;\n}\n.has-subfooter {\n  bottom: $bar-footer-height + $bar-subfooter-height;\n}\n\n.has-tabs,\n.bar-footer.has-tabs {\n  bottom: $tabs-height;\n  &.pane{\n    bottom: $tabs-height;\n    height:auto;\n  }\n}\n\n.has-footer.has-tabs {\n  bottom: $tabs-height + $bar-footer-height;\n}\n\n// A full screen section with a solid background\n.pane {\n  @include translate3d(0,0,0);\n  @include transition-duration(0);\n  z-index: $z-index-pane;\n}\n.view {\n  z-index: $z-index-view;\n}\n.pane,\n.view {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  background-color: $base-background-color;\n  overflow: hidden;\n}\n.view-container {\n  position: absolute;\n  display: block;\n  width: 100%;\n  height: 100%;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_select.scss",
    "content": "\n/**\n * Select\n * --------------------------------------------------\n */\n\n.item-select {\n  position: relative;\n\n  select {\n    @include appearance(none);\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    padding: ($item-padding - 2) ($item-padding * 3) ($item-padding) $item-padding;\n    max-width: 65%;\n\n    border: none;\n    background: $item-default-bg;\n    color: #333;\n\n    // hack to hide default dropdown arrow in FF\n    text-indent: .01px;\n    text-overflow: '';\n\n    white-space: nowrap;\n    font-size: $font-size-base;\n\n    cursor: pointer;\n    direction: rtl; // right align the select text\n  }\n\n  select::-ms-expand {\n    // hide default dropdown arrow in IE\n    display: none;\n  }\n\n  option {\n    direction: ltr;\n  }\n\n  &:after {\n    position: absolute;\n    top: 50%;\n    right: $item-padding;\n    margin-top: -3px;\n    width: 0;\n    height: 0;\n    border-top: 5px solid;\n    border-right: 5px solid rgba(0, 0, 0, 0);\n    border-left: 5px solid rgba(0, 0, 0, 0);\n    color: #999;\n    content: \"\";\n    pointer-events: none;\n  }\n  &.item-light {\n    select{\n      background:$item-light-bg;\n      color:$item-light-text;\n    }\n  }\n  &.item-stable {\n    select{\n      background:$item-stable-bg;\n      color:$item-stable-text;\n    }\n    &:after, .input-label{\n      color:darken($item-stable-border,30%);\n    }\n  }\n  &.item-positive {\n    select{\n      background:$item-positive-bg;\n      color:$item-positive-text;\n    }\n    &:after, .input-label{\n      color:$item-positive-text;\n    }\n  }\n  &.item-calm {\n    select{\n      background:$item-calm-bg;\n      color:$item-calm-text;\n    }\n    &:after, .input-label{\n      color:$item-calm-text;\n    }\n  }\n  &.item-assertive {\n    select{\n      background:$item-assertive-bg;\n      color:$item-assertive-text;\n    }\n    &:after, .input-label{\n      color:$item-assertive-text;\n    }\n  }\n  &.item-balanced {\n    select{\n      background:$item-balanced-bg;\n      color:$item-balanced-text;\n    }\n    &:after, .input-label{\n      color:$item-balanced-text;\n    }\n  }\n  &.item-energized  {\n    select{\n      background:$item-energized-bg;\n      color:$item-energized-text;\n    }\n    &:after, .input-label{\n      color:$item-energized-text;\n    }\n  }\n  &.item-royal {\n    select{\n      background:$item-royal-bg;\n      color:$item-royal-text;\n    }\n    &:after, .input-label{\n      color:$item-royal-text;\n    }\n  }\n  &.item-dark  {\n    select{\n      background:$item-dark-bg;\n      color:$item-dark-text;\n    }\n    &:after, .input-label{\n      color:$item-dark-text;\n    }\n  }\n}\n\nselect {\n  &[multiple],\n  &[size] {\n    height: auto;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_slide-box.scss",
    "content": "\n/**\n * Slide Box\n * --------------------------------------------------\n */\n\n.slider {\n  position: relative;\n  visibility: hidden;\n  // Make sure items don't scroll over ever\n  overflow: hidden;\n}\n\n.slider-slides {\n  position: relative;\n  height: 100%;\n}\n\n.slider-slide {\n  position: relative;\n  display: block;\n  float: left;\n  width: 100%;\n  height: 100%;\n  vertical-align: top;\n}\n\n.slider-slide-image {\n  > img {\n    width: 100%;\n  }\n}\n\n.slider-pager {\n  position: absolute;\n  bottom: 20px;\n  z-index: $z-index-slider-pager;\n  width: 100%;\n  height: 15px;\n  text-align: center;\n\n  .slider-pager-page {\n    display: inline-block;\n    margin: 0px 3px;\n    width: 15px;\n    color: #000;\n    text-decoration: none;\n\n    opacity: 0.3;\n\n    &.active {\n      @include transition(opacity 0.4s ease-in);\n      opacity: 1;\n    }\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_spinner.scss",
    "content": "/**\n * Spinners\n * --------------------------------------------------\n */\n\n.spinner {\n  svg {\n    width: $spinner-width;\n    height: $spinner-height;\n  }\n\n  stroke: $spinner-default-stroke;\n  fill: $spinner-default-fill;\n\n  &.spinner-light {\n    stroke: $spinner-light-stroke;\n    fill: $spinner-light-fill;\n  }\n  &.spinner-stable {\n    stroke: $spinner-stable-stroke;\n    fill: $spinner-stable-fill;\n  }\n  &.spinner-positive {\n    stroke: $spinner-positive-stroke;\n    fill: $spinner-positive-fill;\n  }\n  &.spinner-calm {\n    stroke: $spinner-calm-stroke;\n    fill: $spinner-calm-fill;\n  }\n  &.spinner-balanced {\n    stroke: $spinner-balanced-stroke;\n    fill: $spinner-balanced-fill;\n  }\n  &.spinner-assertive {\n    stroke: $spinner-assertive-stroke;\n    fill: $spinner-assertive-fill;\n  }\n  &.spinner-energized {\n    stroke: $spinner-energized-stroke;\n    fill: $spinner-energized-fill;\n  }\n  &.spinner-royal {\n    stroke: $spinner-royal-stroke;\n    fill: $spinner-royal-fill;\n  }\n  &.spinner-dark {\n    stroke: $spinner-dark-stroke;\n    fill: $spinner-dark-fill;\n  }\n}\n\n.spinner-android {\n  stroke: #4b8bf4;\n}\n\n.spinner-ios,\n.spinner-ios-small {\n  stroke: #69717d;\n}\n\n.spinner-spiral {\n  .stop1 {\n    stop-color: $spinner-light-fill;\n    stop-opacity: 0;\n  }\n\n  &.spinner-light {\n    .stop1 {\n      stop-color: $spinner-default-fill;\n    }\n    .stop2 {\n      stop-color: $spinner-light-fill;\n    }\n  }\n  &.spinner-stable .stop2 {\n    stop-color: $spinner-stable-fill;\n  }\n  &.spinner-positive .stop2 {\n    stop-color: $spinner-positive-fill;\n  }\n  &.spinner-calm .stop2 {\n    stop-color: $spinner-calm-fill;\n  }\n  &.spinner-balanced .stop2 {\n    stop-color: $spinner-balanced-fill;\n  }\n  &.spinner-assertive .stop2 {\n    stop-color: $spinner-assertive-fill;\n  }\n  &.spinner-energized .stop2 {\n    stop-color: $spinner-energized-fill;\n  }\n  &.spinner-royal .stop2 {\n    stop-color: $spinner-royal-fill;\n  }\n  &.spinner-dark .stop2 {\n    stop-color: $spinner-dark-fill;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_split-pane.scss",
    "content": "\n/**\n * Split Pane\n * --------------------------------------------------\n */\n\n.split-pane {\n  @include display-flex();\n  @include align-items(stretch);\n  width: 100%;\n  height: 100%;\n}\n\n.split-pane-menu {\n  @include flex(0, 0, $split-pane-menu-width);\n\n  overflow-y: auto;\n  width: $split-pane-menu-width;\n  height: 100%;\n  border-right: 1px solid $split-pane-menu-border-color;\n\n  @media all and (max-width: 568px) {\n    border-right: none;\n  }\n}\n\n.split-pane-content {\n  @include flex(1, 0, auto);\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_tabs.scss",
    "content": "/**\n * Tabs\n * --------------------------------------------------\n * A navigation bar with any number of tab items supported.\n */\n\n.tabs {\n  @include display-flex();\n  @include flex-direction(horizontal);\n  @include justify-content(center);\n  @include translate3d(0,0,0);\n\n  @include tab-style($tabs-default-bg, $tabs-default-border, $tabs-default-text);\n  @include tab-badge-style($tabs-default-text, $tabs-default-bg);\n\n  position: absolute;\n  bottom: 0;\n\n  z-index: $z-index-tabs;\n\n  width: 100%;\n  height: $tabs-height;\n\n  border-style: solid;\n  border-top-width: 1px;\n\n  background-size: 0;\n  line-height: $tabs-height;\n\n  @media (min--moz-device-pixel-ratio: 1.5),\n         (-webkit-min-device-pixel-ratio: 1.5),\n         (min-device-pixel-ratio: 1.5),\n         (min-resolution: 144dpi),\n         (min-resolution: 1.5dppx) {\n    padding-top: 2px;\n    border-top: none !important;\n    border-bottom: none;\n    background-position: top;\n    background-size: 100% 1px;\n    background-repeat: no-repeat;\n  }\n\n}\n/* Allow parent element of tabs to define color, or just the tab itself */\n.tabs-light > .tabs,\n.tabs.tabs-light {\n  @include tab-style($tabs-light-bg, $tabs-light-border, $tabs-light-text);\n  @include tab-badge-style($tabs-light-text, $tabs-light-bg);\n}\n.tabs-stable > .tabs,\n.tabs.tabs-stable {\n  @include tab-style($tabs-stable-bg, $tabs-stable-border, $tabs-stable-text);\n  @include tab-badge-style($tabs-stable-text, $tabs-stable-bg);\n}\n.tabs-positive > .tabs,\n.tabs.tabs-positive {\n  @include tab-style($tabs-positive-bg, $tabs-positive-border, $tabs-positive-text);\n  @include tab-badge-style($tabs-positive-text, $tabs-positive-bg);\n}\n.tabs-calm > .tabs,\n.tabs.tabs-calm {\n  @include tab-style($tabs-calm-bg, $tabs-calm-border, $tabs-calm-text);\n  @include tab-badge-style($tabs-calm-text, $tabs-calm-bg);\n}\n.tabs-assertive > .tabs,\n.tabs.tabs-assertive {\n  @include tab-style($tabs-assertive-bg, $tabs-assertive-border, $tabs-assertive-text);\n  @include tab-badge-style($tabs-assertive-text, $tabs-assertive-bg);\n}\n.tabs-balanced > .tabs,\n.tabs.tabs-balanced {\n  @include tab-style($tabs-balanced-bg, $tabs-balanced-border, $tabs-balanced-text);\n  @include tab-badge-style($tabs-balanced-text, $tabs-balanced-bg);\n}\n.tabs-energized > .tabs,\n.tabs.tabs-energized {\n  @include tab-style($tabs-energized-bg, $tabs-energized-border, $tabs-energized-text);\n  @include tab-badge-style($tabs-energized-text, $tabs-energized-bg);\n}\n.tabs-royal > .tabs,\n.tabs.tabs-royal {\n  @include tab-style($tabs-royal-bg, $tabs-royal-border, $tabs-royal-text);\n  @include tab-badge-style($tabs-royal-text, $tabs-royal-bg);\n}\n.tabs-dark > .tabs,\n.tabs.tabs-dark {\n  @include tab-style($tabs-dark-bg, $tabs-dark-border, $tabs-dark-text);\n  @include tab-badge-style($tabs-dark-text, $tabs-dark-bg);\n}\n\n@mixin tabs-striped($style, $color, $background) {\n  &.#{$style} {\n    .tabs{\n      background-color: $background;\n    }\n    .tab-item {\n      color: rgba($color, $tabs-striped-off-opacity);\n      opacity: 1;\n      .badge{\n        opacity:$tabs-striped-off-opacity;\n      }\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        margin-top: -$tabs-striped-border-width;\n        color: $color;\n        border-style: solid;\n        border-width: $tabs-striped-border-width 0 0 0;\n        border-color: $color;\n      }\n    }\n  }\n  &.tabs-top{\n    .tab-item {\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        .badge {\n          top: 4%;\n        }\n      }\n    }\n  }\n}\n\n@mixin tabs-background($style, $color, $border-color) {\n  .#{$style} {\n    .tabs,\n    &> .tabs{\n      background-color: $color;\n      background-image: linear-gradient(0deg, $border-color, $border-color 50%, transparent 50%);\n      border-color: $border-color;\n    }\n  }\n}\n\n@mixin tabs-striped-background($style, $color) {\n  &.#{$style} {\n    .tabs {\n      background-color: $color;\n      background-image:none;\n    }\n  }\n}\n\n@mixin tabs-color($style, $color) {\n  .#{$style} {\n    .tab-item {\n      color: rgba($color, $tabs-off-opacity);\n      opacity: 1;\n      .badge{\n        opacity:$tabs-off-opacity;\n      }\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        color: $color;\n        border: 0 solid $color;\n        .badge{\n          opacity: 1;\n        }\n      }\n    }\n  }\n}\n\n@mixin tabs-striped-color($style, $color) {\n  &.#{$style} {\n    .tab-item {\n      color: rgba($color, $tabs-striped-off-opacity);\n      opacity: 1;\n      .badge{\n        opacity:$tabs-striped-off-opacity;\n      }\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        margin-top: -$tabs-striped-border-width;\n        color: $color;\n        border: 0 solid $color;\n        border-top-width: $tabs-striped-border-width;\n        .badge{\n          top:$tabs-striped-border-width;\n          opacity: 1;\n        }\n      }\n    }\n  }\n}\n\n.tabs-striped {\n  .tabs {\n    background-color: white;\n    background-image: none;\n    border: none;\n    border-bottom: 1px solid #ddd;\n    padding-top: $tabs-striped-border-width;\n  }\n  .tab-item {\n    // default android tab style\n    &.tab-item-active,\n    &.active,\n    &.activated {\n      margin-top: -$tabs-striped-border-width;\n      border-style: solid;\n      border-width: $tabs-striped-border-width 0 0 0;\n      border-color: $dark;\n      .badge{\n        top:$tabs-striped-border-width;\n        opacity: 1;\n      }\n    }\n  }\n  @include tabs-striped('tabs-light', $dark, $light);\n  @include tabs-striped('tabs-stable', $dark, $stable);\n  @include tabs-striped('tabs-positive', $light, $positive);\n  @include tabs-striped('tabs-calm', $light, $calm);\n  @include tabs-striped('tabs-assertive', $light, $assertive);\n  @include tabs-striped('tabs-balanced', $light, $balanced);\n  @include tabs-striped('tabs-energized', $light, $energized);\n  @include tabs-striped('tabs-royal', $light, $royal);\n  @include tabs-striped('tabs-dark', $light, $dark);\n\n  // doing this twice so striped tabs styles don't override specific bg and color vals\n  @include tabs-striped-background('tabs-background-light', $light);\n  @include tabs-striped-background('tabs-background-stable', $stable);\n  @include tabs-striped-background('tabs-background-positive', $positive);\n  @include tabs-striped-background('tabs-background-calm', $calm);\n  @include tabs-striped-background('tabs-background-assertive', $assertive);\n  @include tabs-striped-background('tabs-background-balanced', $balanced);\n  @include tabs-striped-background('tabs-background-energized',$energized);\n  @include tabs-striped-background('tabs-background-royal', $royal);\n  @include tabs-striped-background('tabs-background-dark', $dark);\n\n  @include tabs-striped-color('tabs-color-light', $light);\n  @include tabs-striped-color('tabs-color-stable', $stable);\n  @include tabs-striped-color('tabs-color-positive', $positive);\n  @include tabs-striped-color('tabs-color-calm', $calm);\n  @include tabs-striped-color('tabs-color-assertive', $assertive);\n  @include tabs-striped-color('tabs-color-balanced', $balanced);\n  @include tabs-striped-color('tabs-color-energized',$energized);\n  @include tabs-striped-color('tabs-color-royal', $royal);\n  @include tabs-striped-color('tabs-color-dark', $dark);\n\n}\n\n@include tabs-background('tabs-background-light', $light, $bar-light-border);\n@include tabs-background('tabs-background-stable', $stable, $bar-stable-border);\n@include tabs-background('tabs-background-positive', $positive, $bar-positive-border);\n@include tabs-background('tabs-background-calm', $calm, $bar-calm-border);\n@include tabs-background('tabs-background-assertive', $assertive, $bar-assertive-border);\n@include tabs-background('tabs-background-balanced', $balanced, $bar-balanced-border);\n@include tabs-background('tabs-background-energized',$energized, $bar-energized-border);\n@include tabs-background('tabs-background-royal', $royal, $bar-royal-border);\n@include tabs-background('tabs-background-dark', $dark, $bar-dark-border);\n\n@include tabs-color('tabs-color-light', $light);\n@include tabs-color('tabs-color-stable', $stable);\n@include tabs-color('tabs-color-positive', $positive);\n@include tabs-color('tabs-color-calm', $calm);\n@include tabs-color('tabs-color-assertive', $assertive);\n@include tabs-color('tabs-color-balanced', $balanced);\n@include tabs-color('tabs-color-energized',$energized);\n@include tabs-color('tabs-color-royal', $royal);\n@include tabs-color('tabs-color-dark', $dark);\n\n@mixin tabs-standard-color($style, $color, $off-color:$dark) {\n  &.#{$style} {\n    .tab-item {\n      color: $off-color;\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        color: $color;\n      }\n    }\n  }\n}\n\nion-tabs {\n  @include tabs-standard-color('tabs-color-active-light', $light, $dark);\n  @include tabs-standard-color('tabs-color-active-stable', $stable, $dark);\n  @include tabs-standard-color('tabs-color-active-positive', $positive, $dark);\n  @include tabs-standard-color('tabs-color-active-calm', $calm, $dark);\n  @include tabs-standard-color('tabs-color-active-assertive', $assertive, $dark);\n  @include tabs-standard-color('tabs-color-active-balanced', $balanced, $dark);\n  @include tabs-standard-color('tabs-color-active-energized',$energized, $dark);\n  @include tabs-standard-color('tabs-color-active-royal', $royal, $dark);\n  @include tabs-standard-color('tabs-color-active-dark', $dark, $light);\n}\n\n.tabs-top {\n  &.tabs-striped {\n    padding-bottom:0;\n    .tab-item{\n      background: transparent;\n      // animate the top bar, leave bottom for platform consistency\n      -webkit-transition: color .1s ease;\n      -moz-transition: color .1s ease;\n      -ms-transition: color .1s ease;\n      -o-transition: color .1s ease;\n      transition: color .1s ease;\n      &.tab-item-active,\n      &.active,\n      &.activated {\n        margin-top: $tabs-striped-border-width - 1px;\n        border-width: 0px 0px $tabs-striped-border-width 0px !important;\n        border-style: solid;\n        > .badge, > i{\n          margin-top: -$tabs-striped-border-width + 1px;\n        }\n      }\n      .badge{\n        -webkit-transition: color .2s ease;\n        -moz-transition: color .2s ease;\n        -ms-transition: color .2s ease;\n        -o-transition: color .2s ease;\n        transition: color .2s ease;\n      }\n    }\n  }\n}\n\n/* Allow parent element to have tabs-top */\n/* If you change this, change platform.scss as well */\n.tabs-top > .tabs,\n.tabs.tabs-top {\n  top: $bar-height;\n  padding-top: 0;\n  background-position: bottom;\n  border-top-width: 0;\n  border-bottom-width: 1px;\n  .tab-item {\n    &.tab-item-active,\n    &.active,\n    &.activated {\n      .badge {\n        top: 4%;\n      }\n    }\n  }\n}\n.tabs-top ~ .bar-header {\n  border-bottom-width: 0;\n}\n\n.tab-item {\n  @include flex(1);\n  display: block;\n  overflow: hidden;\n\n  max-width: $tab-item-max-width;\n  height: 100%;\n\n  color: inherit;\n  text-align: center;\n  text-decoration: none;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n\n  font-weight: 400;\n  font-size: $tabs-text-font-size;\n  font-family: $font-family-sans-serif;\n\n  opacity: 0.7;\n\n  &:hover {\n    cursor: pointer;\n  }\n  &.tab-hidden{\n    display:none;\n  }\n}\n\n.tabs-item-hide > .tabs,\n.tabs.tabs-item-hide {\n  display: none;\n}\n\n.tabs-icon-top > .tabs .tab-item,\n.tabs-icon-top.tabs .tab-item,\n.tabs-icon-bottom > .tabs .tab-item,\n.tabs-icon-bottom.tabs .tab-item {\n  font-size: $tabs-text-font-size-side-icon;\n  line-height: $tabs-text-font-size;\n}\n\n.tab-item .icon {\n  display: block;\n  margin: 0 auto;\n  height: $tabs-icon-size;\n  font-size: $tabs-icon-size;\n}\n\n.tabs-icon-left.tabs .tab-item,\n.tabs-icon-left > .tabs .tab-item,\n.tabs-icon-right.tabs .tab-item,\n.tabs-icon-right > .tabs .tab-item {\n  font-size: $tabs-text-font-size-side-icon;\n\n  .icon {\n    display: inline-block;\n    vertical-align: top;\n    margin-top: -.1em;\n\n    &:before {\n    font-size: $tabs-icon-size - 8;\n    line-height: $tabs-height;\n    }\n  }\n}\n\n.tabs-icon-left > .tabs .tab-item .icon,\n.tabs-icon-left.tabs .tab-item .icon {\n  padding-right: 3px;\n}\n\n.tabs-icon-right > .tabs .tab-item .icon,\n.tabs-icon-right.tabs .tab-item .icon {\n  padding-left: 3px;\n}\n\n.tabs-icon-only > .tabs .icon,\n.tabs-icon-only.tabs .icon {\n  line-height: inherit;\n}\n\n\n.tab-item.has-badge {\n  position: relative;\n}\n\n.tab-item .badge {\n  position: absolute;\n  top: 4%;\n  right: 33%; // fallback\n  right: calc(50% - 26px);\n  padding: $tabs-badge-padding;\n  height: auto;\n  font-size: $tabs-badge-font-size;\n  line-height: $tabs-badge-font-size + 4;\n}\n\n\n/* Navigational tab */\n\n/* Active state for tab */\n.tab-item.tab-item-active,\n.tab-item.active,\n.tab-item.activated {\n  opacity: 1;\n\n  &.tab-item-light {\n    color: $light;\n  }\n  &.tab-item-stable {\n    color: $stable;\n  }\n  &.tab-item-positive {\n    color: $positive;\n  }\n  &.tab-item-calm {\n    color: $calm;\n  }\n  &.tab-item-assertive {\n    color: $assertive;\n  }\n  &.tab-item-balanced {\n    color: $balanced;\n  }\n  &.tab-item-energized {\n    color: $energized;\n  }\n  &.tab-item-royal {\n    color: $royal;\n  }\n  &.tab-item-dark {\n    color: $dark;\n  }\n}\n\n.item.tabs {\n  @include display-flex();\n  padding: 0;\n\n  .icon:before {\n    position: relative;\n  }\n}\n\n.tab-item.disabled,\n.tab-item[disabled] {\n  opacity: .4;\n  cursor: default;\n  pointer-events: none;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_toggle.scss",
    "content": "\n/**\n * Toggle\n * --------------------------------------------------\n */\n\n.item-toggle {\n  pointer-events: none;\n}\n\n.toggle {\n  // set the color defaults\n  @include toggle-style($toggle-on-default-border, $toggle-on-default-bg);\n\n  position: relative;\n  display: inline-block;\n  pointer-events: auto;\n  margin: -$toggle-hit-area-expansion;\n  padding: $toggle-hit-area-expansion;\n\n  &.dragging {\n    .handle {\n      background-color: $toggle-handle-dragging-bg-color !important;\n    }\n  }\n\n}\n\n.toggle {\n  &.toggle-light  {\n    @include toggle-style($toggle-on-light-border, $toggle-on-light-bg);\n  }\n  &.toggle-stable  {\n    @include toggle-style($toggle-on-stable-border, $toggle-on-stable-bg);\n  }\n  &.toggle-positive  {\n    @include toggle-style($toggle-on-positive-border, $toggle-on-positive-bg);\n  }\n  &.toggle-calm  {\n    @include toggle-style($toggle-on-calm-border, $toggle-on-calm-bg);\n  }\n  &.toggle-assertive  {\n    @include toggle-style($toggle-on-assertive-border, $toggle-on-assertive-bg);\n  }\n  &.toggle-balanced  {\n    @include toggle-style($toggle-on-balanced-border, $toggle-on-balanced-bg);\n  }\n  &.toggle-energized  {\n    @include toggle-style($toggle-on-energized-border, $toggle-on-energized-bg);\n  }\n  &.toggle-royal  {\n    @include toggle-style($toggle-on-royal-border, $toggle-on-royal-bg);\n  }\n  &.toggle-dark  {\n    @include toggle-style($toggle-on-dark-border, $toggle-on-dark-bg);\n  }\n}\n\n.toggle input {\n  // hide the actual input checkbox\n  display: none;\n}\n\n/* the track appearance when the toggle is \"off\" */\n.toggle .track {\n  @include transition-timing-function(ease-in-out);\n  @include transition-duration($toggle-transition-duration);\n  @include transition-property((background-color, border));\n\n  display: inline-block;\n  box-sizing: border-box;\n  width: $toggle-width;\n  height: $toggle-height;\n  border: solid $toggle-border-width $toggle-off-border-color;\n  border-radius: $toggle-border-radius;\n  background-color: $toggle-off-bg-color;\n  content: ' ';\n  cursor: pointer;\n  pointer-events: none;\n}\n\n/* Fix to avoid background color bleeding */\n/* (occured on (at least) Android 4.2, Asus MeMO Pad HD7 ME173X) */\n.platform-android4_2 .toggle .track {\n  -webkit-background-clip: padding-box;\n}\n\n/* the handle (circle) thats inside the toggle's track area */\n/* also the handle's appearance when it is \"off\" */\n.toggle .handle {\n  @include transition($toggle-transition-duration cubic-bezier(0, 1.1, 1, 1.1));\n  @include transition-property((background-color, transform));\n  position: absolute;\n  display: block;\n  width: $toggle-handle-width;\n  height: $toggle-handle-height;\n  border-radius: $toggle-handle-radius;\n  background-color: $toggle-handle-off-bg-color;\n  top: $toggle-border-width + $toggle-hit-area-expansion;\n  left: $toggle-border-width + $toggle-hit-area-expansion;\n  box-shadow: 0 2px 7px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.15);\n\n  &:before {\n    // used to create a larger (but hidden) hit area to slide the handle\n    position: absolute;\n    top: -4px;\n    left: ( ($toggle-handle-width / 2) * -1) - 8;\n    padding: ($toggle-handle-height / 2) + 5 ($toggle-handle-width + 7);\n    content: \" \";\n  }\n}\n\n.toggle input:checked + .track .handle {\n  // the handle when the toggle is \"on\"\n  @include translate3d($toggle-width - $toggle-handle-width - ($toggle-border-width * 2), 0, 0);\n  background-color: $toggle-handle-on-bg-color;\n}\n\n.item-toggle.active {\n  box-shadow: none;\n}\n\n.item-toggle,\n.item-toggle.item-complex .item-content {\n  // make sure list item content have enough padding on right to fit the toggle\n  padding-right: ($item-padding * 3) + $toggle-width;\n}\n\n.item-toggle.item-complex {\n  padding-right: 0;\n}\n\n.item-toggle .toggle {\n  // position the toggle to the right within a list item\n  position: absolute;\n  top: ($item-padding / 2) + 2;\n  right: $item-padding;\n  z-index: $z-index-item-toggle;\n}\n\n.toggle input:disabled + .track {\n  opacity: .6;\n}\n\n.toggle-small {\n\n  .track {\n    border: 0;\n    width: 34px;\n    height: 15px;\n    background: #9e9e9e;\n  }\n  input:checked + .track {\n    background: rgba(0,150,137,.5);\n  }\n  .handle {\n    top: 2px;\n    left: 4px;\n    width: 21px;\n    height: 21px;\n    box-shadow: 0 2px 5px rgba(0,0,0,.25);\n  }\n  input:checked + .track .handle {\n    @include translate3d(16px, 0, 0);\n    background: rgb(0,150,137);\n  }\n  &.item-toggle .toggle {\n    top: 19px;\n  }\n\n  .toggle-light  {\n    @include toggle-small-style($toggle-on-light-bg);\n  }\n  .toggle-stable  {\n    @include toggle-small-style($toggle-on-stable-bg);\n  }\n  .toggle-positive  {\n    @include toggle-small-style($toggle-on-positive-bg);\n  }\n  .toggle-calm  {\n    @include toggle-small-style($toggle-on-calm-bg);\n  }\n  .toggle-assertive  {\n    @include toggle-small-style($toggle-on-assertive-bg);\n  }\n  .toggle-balanced  {\n    @include toggle-small-style($toggle-on-balanced-bg);\n  }\n  .toggle-energized  {\n    @include toggle-small-style($toggle-on-energized-bg);\n  }\n  .toggle-royal  {\n    @include toggle-small-style($toggle-on-royal-bg);\n  }\n  .toggle-dark  {\n    @include toggle-small-style($toggle-on-dark-bg);\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_transitions.scss",
    "content": "\n// iOS View Transitions\n// -------------------------------\n\n$ios-transition-duration:              500ms !default;\n$ios-transition-timing-function:       cubic-bezier(.36, .66, .04, 1) !default;\n$ios-transition-container-bg-color:    #000 !default;\n\n\n[nav-view-transition=\"ios\"] {\n\n  [nav-view=\"entering\"],\n  [nav-view=\"leaving\"] {\n    @include transition-duration( $ios-transition-duration );\n    @include transition-timing-function( $ios-transition-timing-function );\n    -webkit-transition-property: opacity, -webkit-transform, box-shadow;\n            transition-property: opacity, transform, box-shadow;\n  }\n\n  &[nav-view-direction=\"forward\"],\n  &[nav-view-direction=\"back\"] {\n    background-color: $ios-transition-container-bg-color;\n  }\n\n  [nav-view=\"active\"],\n  &[nav-view-direction=\"forward\"] [nav-view=\"entering\"],\n  &[nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n    z-index: $z-index-view-above;\n  }\n\n  &[nav-view-direction=\"back\"] [nav-view=\"entering\"],\n  &[nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n    z-index: $z-index-view-below;\n  }\n\n}\n\n\n\n// iOS Nav Bar Transitions\n// -------------------------------\n\n[nav-bar-transition=\"ios\"] {\n\n  .title,\n  .buttons,\n  .back-text {\n    @include transition-duration( $ios-transition-duration );\n    @include transition-timing-function( $ios-transition-timing-function );\n    -webkit-transition-property: opacity, -webkit-transform;\n            transition-property: opacity, transform;\n  }\n\n  [nav-bar=\"active\"],\n  [nav-bar=\"entering\"] {\n    z-index: $z-index-bar-above;\n\n   .bar {\n      background: transparent;\n    }\n  }\n\n  [nav-bar=\"cached\"] {\n    display: block;\n\n    .header-item {\n      display: none;\n    }\n  }\n\n}\n\n\n\n// Android View Transitions\n// -------------------------------\n\n$android-transition-duration:             200ms !default;\n$android-transition-timing-function:      cubic-bezier(0.4, 0.6, 0.2, 1) !default;\n\n\n[nav-view-transition=\"android\"] {\n\n  [nav-view=\"entering\"],\n  [nav-view=\"leaving\"] {\n    @include transition-duration( $android-transition-duration );\n    @include transition-timing-function( $android-transition-timing-function );\n    -webkit-transition-property: -webkit-transform;\n            transition-property: transform;\n  }\n\n  [nav-view=\"active\"],\n  &[nav-view-direction=\"forward\"] [nav-view=\"entering\"],\n  &[nav-view-direction=\"back\"] [nav-view=\"leaving\"] {\n    z-index: $z-index-view-above;\n  }\n\n  &[nav-view-direction=\"back\"] [nav-view=\"entering\"],\n  &[nav-view-direction=\"forward\"] [nav-view=\"leaving\"] {\n    z-index: $z-index-view-below;\n  }\n\n}\n\n\n\n// Android Nav Bar Transitions\n// -------------------------------\n\n[nav-bar-transition=\"android\"] {\n\n  .title,\n  .buttons {\n    @include transition-duration( $android-transition-duration );\n    @include transition-timing-function( $android-transition-timing-function );\n    -webkit-transition-property: opacity;\n            transition-property: opacity;\n  }\n\n  [nav-bar=\"active\"],\n  [nav-bar=\"entering\"] {\n    z-index: $z-index-bar-above;\n\n   .bar {\n      background: transparent;\n    }\n  }\n\n  [nav-bar=\"cached\"] {\n    display: block;\n\n    .header-item {\n      display: none;\n    }\n  }\n\n}\n\n\n\n// Nav Swipe\n// -------------------------------\n\n[nav-swipe=\"fast\"] {\n  [nav-view],\n  .title,\n  .buttons,\n  .back-text {\n    @include transition-duration(50ms);\n    @include transition-timing-function(linear);\n  }\n}\n\n[nav-swipe=\"slow\"] {\n  [nav-view],\n  .title,\n  .buttons,\n  .back-text {\n    @include transition-duration(160ms);\n    @include transition-timing-function(linear);\n  }\n}\n\n\n\n// Transition Settings\n// -------------------------------\n\n[nav-view=\"cached\"],\n[nav-bar=\"cached\"] {\n  display: none;\n}\n\n[nav-view=\"stage\"] {\n  opacity: 0;\n  @include transition-duration( 0 );\n}\n\n[nav-bar=\"stage\"] {\n  .title,\n  .buttons,\n  .back-text {\n    position: absolute;\n    opacity: 0;\n    @include transition-duration(0s);\n  }\n}\n\n"
  },
  {
    "path": "www/lib/ionic/scss/_type.scss",
    "content": "\n/**\n * Typography\n * --------------------------------------------------\n */\n\n\n// Body text\n// -------------------------\n\np {\n  margin: 0 0 ($line-height-computed / 2);\n}\n\n\n// Emphasis & misc\n// -------------------------\n\nsmall   { font-size: 85%; }\ncite    { font-style: normal; }\n\n\n// Alignment\n// -------------------------\n\n.text-left           { text-align: left; }\n.text-right          { text-align: right; }\n.text-center         { text-align: center; }\n\n\n// Headings\n// -------------------------\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n  color: $base-color;\n  font-weight: $headings-font-weight;\n  font-family: $headings-font-family;\n  line-height: $headings-line-height;\n\n  small {\n    font-weight: normal;\n    line-height: 1;\n  }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n  margin-top: $line-height-computed;\n  margin-bottom: ($line-height-computed / 2);\n\n  &:first-child {\n    margin-top: 0;\n  }\n\n  + h1, + .h1,\n  + h2, + .h2,\n  + h3, + .h3 {\n    margin-top: ($line-height-computed / 2);\n  }\n}\n\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n  margin-top: ($line-height-computed / 2);\n  margin-bottom: ($line-height-computed / 2);\n}\n\nh1, .h1 { font-size: floor($font-size-base * 2.60); } // ~36px\nh2, .h2 { font-size: floor($font-size-base * 2.15); } // ~30px\nh3, .h3 { font-size: ceil($font-size-base * 1.70); } // ~24px\nh4, .h4 { font-size: ceil($font-size-base * 1.25); } // ~18px\nh5, .h5 { font-size:  $font-size-base; }\nh6, .h6 { font-size: ceil($font-size-base * 0.85); } // ~12px\n\nh1 small, .h1 small { font-size: ceil($font-size-base * 1.70); } // ~24px\nh2 small, .h2 small { font-size: ceil($font-size-base * 1.25); } // ~18px\nh3 small, .h3 small,\nh4 small, .h4 small { font-size: $font-size-base; }\n\n\n// Description Lists\n// -------------------------\n\ndl {\n  margin-bottom: $line-height-computed;\n}\ndt,\ndd {\n  line-height: $line-height-base;\n}\ndt {\n  font-weight: bold;\n}\n\n\n// Blockquotes\n// -------------------------\n\nblockquote {\n  margin: 0 0 $line-height-computed;\n  padding: ($line-height-computed / 2) $line-height-computed;\n  border-left: 5px solid gray;\n  \n  p {\n    font-weight: 300;\n    font-size: ($font-size-base * 1.25);\n    line-height: 1.25;\n  }\n  \n  p:last-child {\n    margin-bottom: 0;\n  }\n\n  small {\n    display: block;\n    line-height: $line-height-base;\n    &:before {\n      content: '\\2014 \\00A0';// EM DASH, NBSP;\n    }\n  }\n}\n\n\n// Quotes\n// -------------------------\n\nq:before,\nq:after,\nblockquote:before,\nblockquote:after {\n  content: \"\";\n}\n\n\n// Addresses\n// -------------------------\n\naddress {\n  display: block;\n  margin-bottom: $line-height-computed;\n  font-style: normal;\n  line-height: $line-height-base;\n}\n\n\n// Links\n// -------------------------\n\na.subdued {\n  padding-right: 10px;\n  color: #888;\n  text-decoration: none;\n\n  &:hover {\n    text-decoration: none;\n  }\n  &:last-child {\n    padding-right: 0;\n  }\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/_util.scss",
    "content": "\n/**\n * Utility Classes\n * --------------------------------------------------\n */\n\n.hide {\n  display: none;\n}\n.opacity-hide {\n  opacity: 0;\n}\n.grade-b .opacity-hide,\n.grade-c .opacity-hide {\n  opacity: 1;\n  display: none;\n}\n.show {\n  display: block;\n}\n.opacity-show {\n  opacity: 1;\n}\n.invisible {\n  visibility: hidden;\n}\n\n.keyboard-open .hide-on-keyboard-open {\n  display: none;\n}\n\n.keyboard-open .tabs.hide-on-keyboard-open + .pane .has-tabs,\n.keyboard-open .bar-footer.hide-on-keyboard-open + .pane .has-footer {\n  bottom: 0;\n}\n\n.inline {\n  display: inline-block;\n}\n\n.disable-pointer-events {\n  pointer-events: none;\n}\n\n.enable-pointer-events {\n  pointer-events: auto;\n}\n\n.disable-user-behavior {\n  // used to prevent the browser from doing its native behavior. this doesnt\n  // prevent the scrolling, but cancels the contextmenu, tap highlighting, etc\n\n  @include user-select(none);\n  @include touch-callout(none);\n  @include tap-highlight-transparent();\n\n  -webkit-user-drag: none;\n\n  -ms-touch-action: none;\n  -ms-content-zooming: none;\n}\n\n// Fill the screen to block clicks (a better pointer-events: none) for the body\n// to avoid full-page reflows and paints which can cause flickers\n.click-block {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  opacity: 0;\n  z-index: $z-index-click-block;\n  @include translate3d(0, 0, 0);\n  overflow: hidden;\n}\n.click-block-hide {\n  @include translate3d(-9999px, 0, 0);\n}\n\n.no-resize {\n  resize: none;\n}\n\n.block {\n  display: block;\n  clear: both;\n  &:after {\n    display: block;\n    visibility: hidden;\n    clear: both;\n    height: 0;\n    content: \".\";\n  }\n}\n\n.full-image {\n  width: 100%;\n}\n\n.clearfix {\n  *zoom: 1;\n  &:before,\n  &:after {\n    display: table;\n    content: \"\";\n    // Fixes Opera/contenteditable bug:\n    // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952\n    line-height: 0;\n  }\n  &:after {\n    clear: both;\n  }\n}\n\n/**\n * Content Padding\n * --------------------------------------------------\n */\n\n.padding {\n  padding: $content-padding;\n}\n\n.padding-top,\n.padding-vertical {\n  padding-top: $content-padding;\n}\n\n.padding-right,\n.padding-horizontal {\n  padding-right: $content-padding;\n}\n\n.padding-bottom,\n.padding-vertical {\n  padding-bottom: $content-padding;\n}\n\n.padding-left,\n.padding-horizontal {\n  padding-left: $content-padding;\n}\n\n\n/**\n * Scrollable iFrames\n * --------------------------------------------------\n */\n\n.iframe-wrapper {\n  position: fixed;\n  -webkit-overflow-scrolling: touch;\n  overflow: scroll;\n\n  iframe {\n    height: 100%;\n    width: 100%;\n  }\n}\n\n\n/**\n * Rounded\n * --------------------------------------------------\n */\n\n.rounded {\n  border-radius: $border-radius-base;\n}\n\n\n/**\n * Utility Colors\n * --------------------------------------------------\n * Utility colors are added to help set a naming convention. You'll\n * notice we purposely do not use words like \"red\" or \"blue\", but\n * instead have colors which represent an emotion or generic theme.\n */\n\n.light, a.light {\n  color: $light;\n}\n.light-bg {\n  background-color: $light;\n}\n.light-border {\n  border-color: $button-light-border;\n}\n\n.stable, a.stable {\n  color: $stable;\n}\n.stable-bg {\n  background-color: $stable;\n}\n.stable-border {\n  border-color: $button-stable-border;\n}\n\n.positive, a.positive {\n  color: $positive;\n}\n.positive-bg {\n  background-color: $positive;\n}\n.positive-border {\n  border-color: $button-positive-border;\n}\n\n.calm, a.calm {\n  color: $calm;\n}\n.calm-bg {\n  background-color: $calm;\n}\n.calm-border {\n  border-color: $button-calm-border;\n}\n\n.assertive, a.assertive {\n  color: $assertive;\n}\n.assertive-bg {\n  background-color: $assertive;\n}\n.assertive-border {\n  border-color: $button-assertive-border;\n}\n\n.balanced, a.balanced {\n  color: $balanced;\n}\n.balanced-bg {\n  background-color: $balanced;\n}\n.balanced-border {\n  border-color: $button-balanced-border;\n}\n\n.energized, a.energized {\n  color: $energized;\n}\n.energized-bg {\n  background-color: $energized;\n}\n.energized-border {\n  border-color: $button-energized-border;\n}\n\n.royal, a.royal {\n  color: $royal;\n}\n.royal-bg {\n  background-color: $royal;\n}\n.royal-border {\n  border-color: $button-royal-border;\n}\n\n.dark, a.dark {\n  color: $dark;\n}\n.dark-bg {\n  background-color: $dark;\n}\n.dark-border {\n  border-color: $button-dark-border;\n}\n\n[collection-repeat] {\n  /* Position is set by transforms */\n  left: 0 !important;\n  top: 0 !important;\n  position: absolute !important;\n  z-index: 1;\n}\n.collection-repeat-container {\n  position: relative;\n  z-index: 1; //make sure it's above the after-container\n}\n.collection-repeat-after-container {\n  z-index: 0;\n  display: block;\n\n  /* when scrolling horizontally, make sure the after container doesn't take up 100% width */\n  &.horizontal {\n    display: inline-block;\n  }\n}\n\n// ng-show fix for windows phone\n// https://www.hoessl.eu/2014/12/on-using-the-ionic-framework-for-windows-phone-8-1-apps/\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak,\n.x-ng-cloak, .ng-hide:not(.ng-hide-animate) {\n  display: none !important;\n}"
  },
  {
    "path": "www/lib/ionic/scss/_variables.scss",
    "content": "\n// Colors\n// -------------------------------\n\n$light:                           #fff !default;\n$stable:                          #f8f8f8 !default;\n$positive:                        #387ef5 !default;\n$calm:                            #11c1f3 !default;\n$balanced:                        #33cd5f !default;\n$energized:                       #ffc900 !default;\n$assertive:                       #ef473a !default;\n$royal:                           #886aea !default;\n$dark:                            #444 !default;\n\n\n// Base\n// -------------------------------\n\n$font-family-sans-serif:          \"Helvetica Neue\", \"Roboto\", \"Segoe UI\", sans-serif !default;\n$font-family-light-sans-serif:    \"HelveticaNeue-Light\", \"Roboto-Light\", \"Segoe UI-Light\", sans-serif-light !default;\n$font-family-serif:               serif !default;\n$font-family-monospace:           monospace !default;\n\n$font-family-base:                $font-family-sans-serif !default;\n$font-size-base:                  14px !default;\n$font-size-large:                 18px !default;\n$font-size-small:                 11px !default;\n\n$line-height-base:                1.428571429 !default; // 20/14\n$line-height-computed:            floor($font-size-base * $line-height-base) !default; // ~20px\n$line-height-large:               1.33 !default;\n$line-height-small:               1.5 !default;\n\n$headings-font-family:            $font-family-base !default;\n$headings-font-weight:            500 !default;\n$headings-line-height:            1.2 !default;\n\n$base-background-color:           #fff !default;\n$base-color:                      #000 !default;\n\n$link-color:                      $positive !default;\n$link-hover-color:                darken($link-color, 15%) !default;\n\n$content-padding:                 10px !default;\n\n$padding-base-vertical:           6px !default;\n$padding-base-horizontal:         12px !default;\n\n$padding-large-vertical:          10px !default;\n$padding-large-horizontal:        16px !default;\n\n$padding-small-vertical:          5px !default;\n$padding-small-horizontal:        10px !default;\n\n$border-radius-base:              4px !default;\n$border-radius-large:             6px !default;\n$border-radius-small:             3px !default;\n\n\n// Content\n// -------------------------------\n\n$scroll-refresh-icon-color:       #666666 !default;\n\n\n// Buttons\n// -------------------------------\n\n$button-color:                    #222 !default;\n$button-block-margin:             10px !default;\n$button-clear-padding:            6px !default;\n$button-border-radius:            2px !default;\n$button-border-width:             1px !default;\n\n$button-font-size:                16px !default;\n$button-height:                   42px !default;\n$button-padding:                  12px !default;\n$button-icon-size:                24px !default;\n\n$button-large-font-size:          20px !default;\n$button-large-height:             54px !default;\n$button-large-padding:            16px !default;\n$button-large-icon-size:          32px !default;\n\n$button-small-font-size:          12px !default;\n$button-small-height:             28px !default;\n$button-small-padding:            4px !default;\n$button-small-icon-size:          16px !default;\n\n$button-bar-button-font-size:     13px !default;\n$button-bar-button-height:        32px !default;\n$button-bar-button-padding:       8px !default;\n$button-bar-button-icon-size:     20px !default;\n\n$button-light-bg:                 $light !default;\n$button-light-text:               #444 !default;\n$button-light-border:             #ddd !default;\n$button-light-active-bg:          #fafafa !default;\n$button-light-active-border:      #ccc !default;\n\n$button-stable-bg:                $stable !default;\n$button-stable-text:              #444 !default;\n$button-stable-border:            #b2b2b2 !default;\n$button-stable-active-bg:         #e5e5e5 !default;\n$button-stable-active-border:     #a2a2a2 !default;\n\n$button-positive-bg:              $positive !default;\n$button-positive-text:            #fff !default;\n$button-positive-border:          darken($positive, 10%) !default;\n$button-positive-active-bg:       darken($positive, 10%) !default;\n$button-positive-active-border:   darken($positive, 10%) !default;\n\n$button-calm-bg:                  $calm !default;\n$button-calm-text:                #fff !default;\n$button-calm-border:              darken($calm, 10%) !default;\n$button-calm-active-bg:           darken($calm, 10%) !default;\n$button-calm-active-border:       darken($calm, 10%) !default;\n\n$button-assertive-bg:             $assertive !default;\n$button-assertive-text:           #fff !default;\n$button-assertive-border:         darken($assertive, 10%) !default;\n$button-assertive-active-bg:      darken($assertive, 10%) !default;\n$button-assertive-active-border:  darken($assertive, 10%) !default;\n\n$button-balanced-bg:              $balanced !default;\n$button-balanced-text:            #fff !default;\n$button-balanced-border:          darken($balanced, 10%) !default;\n$button-balanced-active-bg:       darken($balanced, 10%) !default;\n$button-balanced-active-border:   darken($balanced, 10%) !default;\n\n$button-energized-bg:             $energized !default;\n$button-energized-text:           #fff !default;\n$button-energized-border:         darken($energized, 5%) !default;\n$button-energized-active-bg:      darken($energized, 5%) !default;\n$button-energized-active-border:  darken($energized, 5%) !default;\n\n$button-royal-bg:                 $royal !default;\n$button-royal-text:               #fff !default;\n$button-royal-border:             darken($royal, 8%) !default;\n$button-royal-active-bg:          darken($royal, 8%) !default;\n$button-royal-active-border:      darken($royal, 8%) !default;\n\n$button-dark-bg:                  $dark !default;\n$button-dark-text:                #fff !default;\n$button-dark-border:              #111 !default;\n$button-dark-active-bg:           #262626 !default;\n$button-dark-active-border:       #000 !default;\n\n$button-default-bg:               $button-stable-bg !default;\n$button-default-text:             $button-stable-text !default;\n$button-default-border:           $button-stable-border !default;\n$button-default-active-bg:        $button-stable-active-bg !default;\n$button-default-active-border:    $button-stable-active-border !default;\n\n\n// Bars\n// -------------------------------\n\n$bar-height:                      44px !default;\n$bar-title-font-size:             17px !default;\n$bar-padding-portrait:            5px !default;\n$bar-padding-landscape:           5px !default;\n$bar-transparency:                1 !default;\n\n$bar-footer-height:               $bar-height !default;\n$bar-subheader-height:            $bar-height !default;\n$bar-subfooter-height:            $bar-height !default;\n\n$bar-light-bg:                    rgba($button-light-bg, $bar-transparency) !default;\n$bar-light-text:                  $button-light-text !default;\n$bar-light-border:                $button-light-border !default;\n$bar-light-active-bg:             $button-light-active-bg !default;\n$bar-light-active-border:         $button-light-active-border !default;\n\n$bar-stable-bg:                   rgba($button-stable-bg, $bar-transparency) !default;\n$bar-stable-text:                 $button-stable-text !default;\n$bar-stable-border:               $button-stable-border !default;\n$bar-stable-active-bg:            $button-stable-active-bg !default;\n$bar-stable-active-border:        $button-stable-active-border !default;\n\n$bar-positive-bg:                 rgba($button-positive-bg, $bar-transparency) !default;\n$bar-positive-text:               $button-positive-text !default;\n$bar-positive-border:             $button-positive-border !default;\n$bar-positive-active-bg:          $button-positive-active-bg !default;\n$bar-positive-active-border:      $button-positive-active-border !default;\n\n$bar-calm-bg:                     rgba($button-calm-bg, $bar-transparency) !default;\n$bar-calm-text:                   $button-calm-text !default;\n$bar-calm-border:                 $button-calm-border !default;\n$bar-calm-active-bg:              $button-calm-active-bg !default;\n$bar-calm-active-border:          $button-calm-active-border !default;\n\n$bar-assertive-bg:                rgba($button-assertive-bg, $bar-transparency) !default;\n$bar-assertive-text:              $button-assertive-text !default;\n$bar-assertive-border:            $button-assertive-border !default;\n$bar-assertive-active-bg:         $button-assertive-active-bg !default;\n$bar-assertive-active-border:     $button-assertive-active-border !default;\n\n$bar-balanced-bg:                 rgba($button-balanced-bg, $bar-transparency) !default;\n$bar-balanced-text:               $button-balanced-text !default;\n$bar-balanced-border:             $button-balanced-border !default;\n$bar-balanced-active-bg:          $button-balanced-active-bg !default;\n$bar-balanced-active-border:      $button-balanced-active-border !default;\n\n$bar-energized-bg:                rgba($button-energized-bg, $bar-transparency) !default;\n$bar-energized-text:              $button-energized-text !default;\n$bar-energized-border:            $button-energized-border !default;\n$bar-energized-active-bg:         $button-energized-active-bg !default;\n$bar-energized-active-border:     $button-energized-active-border !default;\n\n$bar-royal-bg:                    rgba($button-royal-bg, $bar-transparency) !default;\n$bar-royal-text:                  $button-royal-text !default;\n$bar-royal-border:                $button-royal-border !default;\n$bar-royal-active-bg:             $button-royal-active-bg !default;\n$bar-royal-active-border:         $button-royal-active-border !default;\n\n$bar-dark-bg:                     rgba($button-dark-bg, $bar-transparency) !default;\n$bar-dark-text:                   $button-dark-text !default;\n$bar-dark-border:                 $button-dark-border !default;\n$bar-dark-active-bg:              $button-dark-active-bg !default;\n$bar-dark-active-border:          $button-dark-active-border !default;\n\n$bar-default-bg:                  $bar-light-bg !default;\n$bar-default-text:                $bar-light-text !default;\n$bar-default-border:              $bar-light-border !default;\n$bar-default-active-bg:           $bar-light-active-bg !default;\n$bar-default-active-border:       $bar-light-active-border !default;\n\n\n// Tabs\n// -------------------------------\n\n$tabs-height:                     49px !default;\n$tabs-text-font-size:             14px !default;\n$tabs-text-font-size-side-icon:   10px !default;\n$tabs-icon-size:                  32px !default;\n$tabs-badge-padding:              1px 6px !default;\n$tabs-badge-font-size:            12px !default;\n\n$tabs-light-bg:                   $button-light-bg !default;\n$tabs-light-border:               $button-light-border !default;\n$tabs-light-text:                 $button-light-text !default;\n\n$tabs-stable-bg:                  $button-stable-bg !default;\n$tabs-stable-border:              $button-stable-border !default;\n$tabs-stable-text:                $button-stable-text !default;\n\n$tabs-positive-bg:                $button-positive-bg !default;\n$tabs-positive-border:            $button-positive-border !default;\n$tabs-positive-text:              $button-positive-text !default;\n\n$tabs-calm-bg:                    $button-calm-bg !default;\n$tabs-calm-border:                $button-calm-border !default;\n$tabs-calm-text:                  $button-calm-text !default;\n\n$tabs-assertive-bg:               $button-assertive-bg !default;\n$tabs-assertive-border:           $button-assertive-border !default;\n$tabs-assertive-text:             $button-assertive-text !default;\n\n$tabs-balanced-bg:                $button-balanced-bg !default;\n$tabs-balanced-border:            $button-balanced-border !default;\n$tabs-balanced-text:              $button-balanced-text !default;\n\n$tabs-energized-bg:               $button-energized-bg !default;\n$tabs-energized-border:           $button-energized-border !default;\n$tabs-energized-text:             $button-energized-text !default;\n\n$tabs-royal-bg:                   $button-royal-bg !default;\n$tabs-royal-border:               $button-royal-border !default;\n$tabs-royal-text:                 $button-royal-text !default;\n\n$tabs-dark-bg:                    $button-dark-bg !default;\n$tabs-dark-border:                $button-dark-border !default;\n$tabs-dark-text:                  $button-dark-text !default;\n\n$tabs-default-bg:                 $tabs-stable-bg !default;\n$tabs-default-border:             $tabs-stable-border !default;\n$tabs-default-text:               $tabs-stable-text !default;\n\n$tab-item-max-width:              150px !default;\n\n$tabs-off-opacity:                0.4 !default;\n$tabs-striped-off-opacity:        $tabs-off-opacity !default;\n$tabs-striped-off-color:          #000 !default;\n$tabs-striped-border-width:       2px !default;\n\n\n// Items\n// -------------------------------\n\n$item-font-size:                  16px !default;\n$item-border-width:               1px !default;\n$item-padding:                    16px !default;\n\n$item-button-font-size:           18px !default;\n$item-button-line-height:         32px !default;\n$item-icon-font-size:             32px !default;\n$item-icon-fill-font-size:        28px !default;\n\n$item-icon-accessory-color:       #ccc !default;\n$item-icon-accessory-font-size:   16px !default;\n\n$item-avatar-width:               40px !default;\n$item-avatar-height:              40px !default;\n$item-avatar-border-radius:       50% !default;\n\n$item-thumbnail-width:            80px !default;\n$item-thumbnail-height:           80px !default;\n$item-thumbnail-margin:           10px !default;\n\n$item-divider-bg:                 #f5f5f5 !default;\n$item-divider-color:              #222 !default;\n$item-divider-padding:            5px 15px !default;\n\n$item-light-bg:                   $button-light-bg !default;\n$item-light-border:               $button-light-border !default;\n$item-light-text:                 $button-light-text !default;\n$item-light-active-bg:            $button-light-active-bg !default;\n$item-light-active-border:        $button-light-active-border !default;\n\n$item-stable-bg:                  $button-stable-bg !default;\n$item-stable-border:              $button-stable-border !default;\n$item-stable-text:                $button-stable-text !default;\n$item-stable-active-bg:           $button-stable-active-bg !default;\n$item-stable-active-border:       $button-stable-active-border !default;\n\n$item-positive-bg:                $button-positive-bg !default;\n$item-positive-border:            $button-positive-border !default;\n$item-positive-text:              $button-positive-text !default;\n$item-positive-active-bg:         $button-positive-active-bg !default;\n$item-positive-active-border:     $button-positive-active-border !default;\n\n$item-calm-bg:                    $button-calm-bg !default;\n$item-calm-border:                $button-calm-border !default;\n$item-calm-text:                  $button-calm-text !default;\n$item-calm-active-bg:             $button-calm-active-bg !default;\n$item-calm-active-border:         $button-calm-active-border !default;\n\n$item-assertive-bg:               $button-assertive-bg !default;\n$item-assertive-border:           $button-assertive-border !default;\n$item-assertive-text:             $button-assertive-text !default;\n$item-assertive-active-bg:        $button-assertive-active-bg !default;\n$item-assertive-active-border:    $button-assertive-active-border !default;\n\n$item-balanced-bg:                $button-balanced-bg !default;\n$item-balanced-border:            $button-balanced-border !default;\n$item-balanced-text:              $button-balanced-text !default;\n$item-balanced-active-bg:         $button-balanced-active-bg !default;\n$item-balanced-active-border:     $button-balanced-active-border !default;\n\n$item-energized-bg:               $button-energized-bg !default;\n$item-energized-border:           $button-energized-border !default;\n$item-energized-text:             $button-energized-text !default;\n$item-energized-active-bg:        $button-energized-active-bg !default;\n$item-energized-active-border:    $button-energized-active-border !default;\n\n$item-royal-bg:                   $button-royal-bg !default;\n$item-royal-border:               $button-royal-border !default;\n$item-royal-text:                 $button-royal-text !default;\n$item-royal-active-bg:            $button-royal-active-bg !default;\n$item-royal-active-border:        $button-royal-active-border !default;\n\n$item-dark-bg:                    $button-dark-bg !default;\n$item-dark-border:                $button-dark-border !default;\n$item-dark-text:                  $button-dark-text !default;\n$item-dark-active-bg:             $button-dark-active-bg !default;\n$item-dark-active-border:         $button-dark-active-border !default;\n\n$item-default-bg:                 $item-light-bg !default;\n$item-default-border:             $item-light-border !default;\n$item-default-text:               $item-light-text !default;\n$item-default-active-bg:          #D9D9D9 !default;\n$item-default-active-border:      $item-light-active-border !default;\n\n\n// Item Editing\n// -------------------------------\n\n$item-edit-transition-duration:   250ms !default;\n$item-edit-transition-function:   ease-in-out !default;\n\n$item-remove-transition-duration:   300ms !default;\n$item-remove-transition-function:   ease-in !default;\n$item-remove-descendents-transition-function:  cubic-bezier(.25,.81,.24,1) !default;\n\n$item-left-edit-left:             8px !default;  // item's left side edit's \"left\" property\n\n$item-right-edit-open-width:      50px !default;\n$item-left-edit-open-width:       50px !default;\n\n$item-delete-icon-size:           24px !default;\n$item-delete-icon-color:          $assertive !default;\n\n$item-reorder-icon-size:          32px !default;\n$item-reorder-icon-color:         $dark !default;\n\n\n// Lists\n// -------------------------------\n\n$list-header-bg:                  transparent !default;\n$list-header-color:               #222 !default;\n$list-header-padding:             5px 15px !default;\n$list-header-margin-top:          20px !default;\n\n\n// Cards\n// -------------------------------\n\n$card-header-bg:                  #F5F5F5 !default;\n$card-body-bg:                    #fff !default;\n$card-footer-bg:                  #F5F5F5 !default;\n\n$card-padding:                    10px !default;\n$card-border-width:               1px !default;\n\n$card-border-color:               #ccc !default;\n$card-border-radius:              2px !default;\n$card-box-shadow:                 0 1px 3px rgba(0, 0, 0, .3) !default;\n\n\n// Forms\n// -------------------------------\n\n$input-height-base:               ($line-height-computed + ($padding-base-vertical * 2) + 2) !default;\n$input-height-large:              (floor($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default;\n$input-height-small:              (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default;\n\n$input-bg:                        $light !default;\n$input-bg-disabled:               $stable !default;\n\n$input-color:                     #111 !default;\n$input-border:                    $item-default-border !default;\n$input-border-width:              $item-border-width !default;\n$input-label-color:               $dark !default;\n$input-color-placeholder:         lighten($dark, 40%) !default;\n\n\n// Progress\n// -------------------------------\n\n$progress-width:                  100% !default;\n$progress-margin:                 15px auto !default;\n\n\n// Toggle\n// -------------------------------\n\n$toggle-width:                    51px !default;\n$toggle-height:                   31px !default;\n$toggle-border-width:             2px !default;\n$toggle-border-radius:            20px !default;\n\n$toggle-handle-width:             $toggle-height - ($toggle-border-width * 2) !default;\n$toggle-handle-height:            $toggle-handle-width !default;\n$toggle-handle-radius:            $toggle-handle-width !default;\n$toggle-handle-dragging-bg-color: darken(#fff, 5%) !default;\n\n$toggle-off-bg-color:             #fff !default;\n$toggle-off-border-color:         #e6e6e6 !default;\n\n$toggle-on-light-bg:              $button-light-border !default;\n$toggle-on-light-border:          $toggle-on-light-bg !default;\n$toggle-on-stable-bg:             $button-stable-border !default;\n$toggle-on-stable-border:         $toggle-on-stable-bg !default;\n$toggle-on-positive-bg:           $positive !default;\n$toggle-on-positive-border:       $toggle-on-positive-bg !default;\n$toggle-on-calm-bg:               $calm !default;\n$toggle-on-calm-border:           $toggle-on-calm-bg !default;\n$toggle-on-assertive-bg:          $assertive !default;\n$toggle-on-assertive-border:      $toggle-on-assertive-bg !default;\n$toggle-on-balanced-bg:           $balanced !default;\n$toggle-on-balanced-border:       $toggle-on-balanced-bg !default;\n$toggle-on-energized-bg:          $energized !default;\n$toggle-on-energized-border:      $toggle-on-energized-bg !default;\n$toggle-on-royal-bg:              $royal !default;\n$toggle-on-royal-border:          $toggle-on-royal-bg !default;\n$toggle-on-dark-bg:               $dark !default;\n$toggle-on-dark-border:           $toggle-on-dark-bg !default;\n$toggle-on-default-bg:            #4cd964 !default;\n$toggle-on-default-border:        $toggle-on-default-bg !default;\n\n$toggle-handle-off-bg-color:      $light !default;\n$toggle-handle-on-bg-color:       $toggle-handle-off-bg-color !default;\n\n$toggle-transition-duration:      .3s !default;\n\n$toggle-hit-area-expansion:   5px;\n\n\n// Checkbox\n// -------------------------------\n\n$checkbox-width:                  28px !default;\n$checkbox-height:                 28px !default;\n$checkbox-border-radius:          $checkbox-width !default;\n$checkbox-border-width:           1px !default;\n\n$checkbox-off-bg-color:           #fff !default;\n$checkbox-off-border-light:       $button-light-border !default;\n$checkbox-on-bg-light:            $button-light-border !default;\n$checkbox-off-border-stable:      $button-stable-border !default;\n$checkbox-on-bg-stable:           $button-stable-border !default;\n$checkbox-off-border-positive:    $positive !default;\n$checkbox-on-bg-positive:         $positive !default;\n$checkbox-off-border-calm:        $calm !default;\n$checkbox-on-bg-calm:             $calm !default;\n$checkbox-off-border-assertive:   $assertive !default;\n$checkbox-on-bg-assertive:        $assertive !default;\n$checkbox-off-border-balanced:    $balanced !default;\n$checkbox-on-bg-balanced:         $balanced !default;\n$checkbox-off-border-energized:   $energized !default;\n$checkbox-on-bg-energized:        $energized !default;\n$checkbox-off-border-royal:       $royal !default;\n$checkbox-on-bg-royal:            $royal !default;\n$checkbox-off-border-dark:        $dark !default;\n$checkbox-on-bg-dark:             $dark !default;\n$checkbox-off-border-default:     $button-light-border !default;\n$checkbox-on-bg-default:          $positive !default;\n$checkbox-on-border-default:      $positive !default;\n\n$checkbox-check-width:            1px !default;\n$checkbox-check-color:            #fff !default;\n\n\n// Range\n// -------------------------------\n\n$range-track-height:              2px !default;\n$range-slider-width:              28px !default;\n$range-slider-height:             28px !default;\n$range-slider-border-radius:      50% !default;\n$range-icon-size:                 24px !default;\n$range-slider-box-shadow:         0 0 2px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,0.2) !default;\n\n$range-light-track-bg:            $button-light-border !default;\n$range-stable-track-bg:           $button-stable-border !default;\n$range-positive-track-bg:         $button-positive-bg !default;\n$range-calm-track-bg:             $button-calm-bg !default;\n$range-balanced-track-bg:         $button-balanced-bg !default;\n$range-assertive-track-bg:        $button-assertive-bg !default;\n$range-energized-track-bg:        $button-energized-bg !default;\n$range-royal-track-bg:            $button-royal-bg !default;\n$range-dark-track-bg:             $button-dark-bg !default;\n$range-default-track-bg:          #ccc !default;\n\n\n// Menus\n// -------------------------------\n\n$menu-bg:                         #fff !default;\n$menu-width:                      275px !default;\n$menu-animation-speed:            200ms !default;\n\n$menu-side-shadow:                -1px 0px 2px rgba(0, 0, 0, 0.2), 1px 0px 2px rgba(0,0,0,0.2) !default;\n\n\n// Modals\n// -------------------------------\n\n$modal-bg-color:                  #fff !default;\n$modal-backdrop-bg-active:        #000 !default;\n$modal-backdrop-bg-inactive:      rgba(0,0,0,0) !default;\n\n$modal-inset-mode-break-point:    680px !default;  // @media min-width\n$modal-inset-mode-top:            20% !default;\n$modal-inset-mode-right:          20% !default;\n$modal-inset-mode-bottom:         20% !default;\n$modal-inset-mode-left:           20% !default;\n$modal-inset-mode-min-height:     240px !default;\n\n\n// Popovers\n// -------------------------------\n\n$popover-bg-color:                $light !default;\n$popover-backdrop-bg-active:      rgba(0,0,0,0.1) !default;\n$popover-backdrop-bg-inactive:    rgba(0,0,0,0) !default;\n$popover-width:                   220px !default;\n$popover-height:                  280px !default;\n$popover-large-break-point:       680px !default;\n$popover-large-width:             360px !default;\n\n$popover-box-shadow:              0 1px 3px rgba(0,0,0,0.4) !default;\n$popover-border-radius:           2px !default;\n\n$popover-box-shadow-ios:          0 0 40px rgba(0,0,0,0.08) !default;\n$popover-border-radius-ios:       10px !default;\n\n$popover-bg-color-android:        #fafafa !default;\n$popover-box-shadow-android:      0 2px 6px rgba(0,0,0,0.35) !default;\n\n\n// Grids\n// -------------------------------\n\n$grid-padding-width:              10px !default;\n$grid-responsive-sm-break:        567px !default;  // smaller than landscape phone\n$grid-responsive-md-break:        767px !default;  // smaller than portrait tablet\n$grid-responsive-lg-break:        1023px !default; // smaller than landscape tablet\n\n\n// Action Sheets\n// -------------------------------\n\n$sheet-margin:                    8px !default;\n$sheet-border-radius:             4px !default;\n\n$sheet-options-bg-color:          #f1f2f3 !default;\n$sheet-options-bg-active-color:   #e4e5e7 !default;\n$sheet-options-text-color:        #007aff !default;\n$sheet-options-border-color:      #d1d3d6 !default;\n\n\n// Popups\n// -------------------------------\n\n$popup-width:                     250px !default;\n$popup-enter-animation:           superScaleIn !default;\n$popup-enter-animation-duration:  0.2s !default;\n$popup-leave-animation-duration:  0.1s !default;\n\n$popup-border-radius:             0px !default;\n$popup-background-color:          rgba(255,255,255,0.9) !default;\n\n$popup-button-border-radius:      2px !default;\n$popup-button-line-height:        20px !default;\n$popup-button-min-height:         45px !default;\n\n\n// Loading\n// -------------------------------\n\n$loading-text-color:              #fff !default;\n$loading-bg-color:                rgba(0,0,0,0.7) !default;\n$loading-padding:                 20px !default;\n$loading-border-radius:           5px !default;\n$loading-font-size:               15px !default;\n\n$loading-backdrop-fadein-duration:0.1s !default;\n$loading-backdrop-bg-color:       rgba(0,0,0,0.4) !default;\n\n\n// Badges\n// -------------------------------\n\n$badge-font-size:                 14px !default;\n$badge-line-height:               16px !default;\n$badge-font-weight:               bold !default;\n$badge-border-radius:             10px !default;\n\n$badge-light-bg:                  $button-light-bg !default;\n$badge-light-text:                $button-light-text !default;\n\n$badge-stable-bg:                 $button-stable-bg !default;\n$badge-stable-text:               $button-stable-text !default;\n\n$badge-positive-bg:               $button-positive-bg !default;\n$badge-positive-text:             $button-positive-text !default;\n\n$badge-calm-bg:                   $button-calm-bg !default;\n$badge-calm-text:                 $button-calm-text !default;\n\n$badge-balanced-bg:               $button-balanced-bg !default;\n$badge-balanced-text:             $button-balanced-text !default;\n\n$badge-assertive-bg:              $button-assertive-bg !default;\n$badge-assertive-text:            $button-assertive-text !default;\n\n$badge-energized-bg:              $button-energized-bg !default;\n$badge-energized-text:            $button-energized-text !default;\n\n$badge-royal-bg:                  $button-royal-bg !default;\n$badge-royal-text:                $button-royal-text !default;\n\n$badge-dark-bg:                   $button-dark-bg !default;\n$badge-dark-text:                 $button-dark-text !default;\n\n$badge-default-bg:                transparent !default;\n$badge-default-text:              #AAAAAA !default;\n\n\n// Spinners\n// -------------------------------\n\n$spinner-width:                   28px !default;\n$spinner-height:                  28px !default;\n\n$spinner-light-stroke:            $light !default;\n$spinner-light-fill:              $light !default;\n\n$spinner-stable-stroke:           $stable !default;\n$spinner-stable-fill:             $stable !default;\n\n$spinner-positive-stroke:         $positive !default;\n$spinner-positive-fill:           $positive !default;\n\n$spinner-calm-stroke:             $calm !default;\n$spinner-calm-fill:               $calm !default;\n\n$spinner-balanced-stroke:         $balanced !default;\n$spinner-balanced-fill:           $balanced !default;\n\n$spinner-assertive-stroke:        $assertive !default;\n$spinner-assertive-fill:          $assertive !default;\n\n$spinner-energized-stroke:        $energized !default;\n$spinner-energized-fill:          $energized !default;\n\n$spinner-royal-stroke:            $royal !default;\n$spinner-royal-fill:              $royal !default;\n\n$spinner-dark-stroke:             $dark !default;\n$spinner-dark-fill:               $dark !default;\n\n$spinner-default-stroke:          $dark !default;\n$spinner-default-fill:            $dark !default;\n\n\n// Z-Indexes\n// -------------------------------\n\n$z-index-bar-title:               0 !default;\n$z-index-item-drag:               0 !default;\n$z-index-item-edit:               0 !default;\n$z-index-menu:                    0 !default;\n$z-index-badge:                   1 !default;\n$z-index-bar-button:              1 !default;\n$z-index-item-options:            1 !default;\n$z-index-pane:                    1 !default;\n$z-index-slider-pager:            1 !default;\n$z-index-view:                    1 !default;\n$z-index-view-below:              2 !default;\n$z-index-item:                    2 !default;\n$z-index-item-checkbox:           3 !default;\n$z-index-item-radio:              3 !default;\n$z-index-item-reorder:            3 !default;\n$z-index-item-toggle:             3 !default;\n$z-index-view-above:              3 !default;\n$z-index-tabs:                    5 !default;\n$z-index-item-reordering:         9 !default;\n$z-index-bar:                     9 !default;\n$z-index-bar-above:               10 !default;\n$z-index-menu-scroll-content:     10 !default;\n$z-index-modal:                   10 !default;\n$z-index-popover:                 10 !default;\n$z-index-action-sheet:            11 !default;\n$z-index-backdrop:                11 !default;\n$z-index-menu-bar-header:         11 !default;\n$z-index-scroll-content-false:    11 !default;\n$z-index-popup:                   12 !default;\n$z-index-loading:                 13 !default;\n$z-index-scroll-bar:              9999 !default;\n$z-index-click-block:             99999 !default;\n\n\n// Platform\n// -------------------------------\n\n$ios-statusbar-height:           20px !default;\n"
  },
  {
    "path": "www/lib/ionic/scss/ionic.scss",
    "content": "@charset \"UTF-8\";\n\n@import\n  // Ionicons\n  \"ionicons/ionicons.scss\",\n\n  // Variables\n  \"mixins\",\n  \"variables\",\n\n  // Base\n  \"reset\",\n  \"scaffolding\",\n  \"type\",\n\n  // Components\n  \"action-sheet\",\n  \"backdrop\",\n  \"bar\",\n  \"tabs\",\n  \"menu\",\n  \"modal\",\n  \"popover\",\n  \"popup\",\n  \"loading\",\n  \"items\",\n  \"list\",\n  \"badge\",\n  \"slide-box\",\n  \"refresher\",\n  \"spinner\",\n\n  // Forms\n  \"form\",\n  \"checkbox\",\n  \"toggle\",\n  \"radio\",\n  \"range\",\n  \"select\",\n  \"progress\",\n\n  // Buttons\n  \"button\",\n  \"button-bar\",\n\n  // Util\n  \"grid\",\n  \"util\",\n  \"platform\",\n\n  // Animations\n  \"animations\",\n  \"transitions\";\n"
  },
  {
    "path": "www/lib/ionic/scss/ionicons/_ionicons-animation.scss",
    "content": "// Animation Icons\n// --------------------------\n\n.#{$ionicons-prefix}spin {\n  -webkit-animation: spin 1s infinite linear;\n  -moz-animation: spin 1s infinite linear;\n  -o-animation: spin 1s infinite linear;\n  animation: spin 1s infinite linear;\n}\n\n@-moz-keyframes spin {\n  0% { -moz-transform: rotate(0deg); }\n  100% { -moz-transform: rotate(359deg); }\n}\n@-webkit-keyframes spin {\n  0% { -webkit-transform: rotate(0deg); }\n  100% { -webkit-transform: rotate(359deg); }\n}\n@-o-keyframes spin {\n  0% { -o-transform: rotate(0deg); }\n  100% { -o-transform: rotate(359deg); }\n}\n@-ms-keyframes spin {\n  0% { -ms-transform: rotate(0deg); }\n  100% { -ms-transform: rotate(359deg); }\n}\n@keyframes spin {\n  0% { transform: rotate(0deg); }\n  100% { transform: rotate(359deg); }\n}\n\n\n.#{$ionicons-prefix}loading-a,\n.#{$ionicons-prefix}loading-b,\n.#{$ionicons-prefix}loading-c,\n.#{$ionicons-prefix}loading-d,\n.#{$ionicons-prefix}looping,\n.#{$ionicons-prefix}refreshing,\n.#{$ionicons-prefix}ios7-reloading {\n  @extend .ion;\n  // must spin entire element for android 4.3 and below\n  @extend .#{$ionicons-prefix}spin;\n}\n\n.#{$ionicons-prefix}loading-a {\n  -webkit-animation-timing-function: steps(8, start);\n  -moz-animation-timing-function: steps(8, start);\n  animation-timing-function: steps(8, start);\n}\n\n.#{$ionicons-prefix}loading-a:before { \n  @extend .#{$ionicons-prefix}load-a:before;\n}\n\n.#{$ionicons-prefix}loading-b:before { \n  @extend .#{$ionicons-prefix}load-b:before;\n}\n\n.#{$ionicons-prefix}loading-c:before { \n  @extend .#{$ionicons-prefix}load-c:before;\n}\n\n.#{$ionicons-prefix}loading-d:before { \n  @extend .#{$ionicons-prefix}load-d:before;\n}\n\n.#{$ionicons-prefix}looping:before { \n  @extend .#{$ionicons-prefix}loop:before;\n}\n\n.#{$ionicons-prefix}refreshing:before { \n  @extend .#{$ionicons-prefix}refresh:before;\n}\n\n.#{$ionicons-prefix}ios7-reloading:before { \n  @extend .#{$ionicons-prefix}ios7-reload:before;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/ionicons/_ionicons-font.scss",
    "content": "// Ionicons Font Path\n// --------------------------\n\n@font-face {\n font-family: $ionicons-font-family;\n src:url(\"#{$ionicons-font-path}/ionicons.eot?v=#{$ionicons-version}\");\n src:url(\"#{$ionicons-font-path}/ionicons.eot?v=#{$ionicons-version}#iefix\") format(\"embedded-opentype\"),\n  url(\"#{$ionicons-font-path}/ionicons.ttf?v=#{$ionicons-version}\") format(\"truetype\"),\n  url(\"#{$ionicons-font-path}/ionicons.woff?v=#{$ionicons-version}\") format(\"woff\"),\n  url(\"#{$ionicons-font-path}/ionicons.woff\") format(\"woff\"), /* for WP8 */\n  url(\"#{$ionicons-font-path}/ionicons.svg?v=#{$ionicons-version}#Ionicons\") format(\"svg\");\n font-weight: normal;\n font-style: normal;\n}\n\n.ion {\n  display: inline-block;\n  font-family: $ionicons-font-family;\n  speak: none;\n  font-style: normal;\n  font-weight: normal;\n  font-variant: normal;\n  text-transform: none;\n  text-rendering: auto;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n"
  },
  {
    "path": "www/lib/ionic/scss/ionicons/_ionicons-icons.scss",
    "content": "// Ionicons Icons\n// --------------------------\n\n.ionicons,\n.#{$ionicons-prefix}alert:before,\n.#{$ionicons-prefix}alert-circled:before,\n.#{$ionicons-prefix}android-add:before,\n.#{$ionicons-prefix}android-add-circle:before,\n.#{$ionicons-prefix}android-alarm-clock:before,\n.#{$ionicons-prefix}android-alert:before,\n.#{$ionicons-prefix}android-apps:before,\n.#{$ionicons-prefix}android-archive:before,\n.#{$ionicons-prefix}android-arrow-back:before,\n.#{$ionicons-prefix}android-arrow-down:before,\n.#{$ionicons-prefix}android-arrow-dropdown:before,\n.#{$ionicons-prefix}android-arrow-dropdown-circle:before,\n.#{$ionicons-prefix}android-arrow-dropleft:before,\n.#{$ionicons-prefix}android-arrow-dropleft-circle:before,\n.#{$ionicons-prefix}android-arrow-dropright:before,\n.#{$ionicons-prefix}android-arrow-dropright-circle:before,\n.#{$ionicons-prefix}android-arrow-dropup:before,\n.#{$ionicons-prefix}android-arrow-dropup-circle:before,\n.#{$ionicons-prefix}android-arrow-forward:before,\n.#{$ionicons-prefix}android-arrow-up:before,\n.#{$ionicons-prefix}android-attach:before,\n.#{$ionicons-prefix}android-bar:before,\n.#{$ionicons-prefix}android-bicycle:before,\n.#{$ionicons-prefix}android-boat:before,\n.#{$ionicons-prefix}android-bookmark:before,\n.#{$ionicons-prefix}android-bulb:before,\n.#{$ionicons-prefix}android-bus:before,\n.#{$ionicons-prefix}android-calendar:before,\n.#{$ionicons-prefix}android-call:before,\n.#{$ionicons-prefix}android-camera:before,\n.#{$ionicons-prefix}android-cancel:before,\n.#{$ionicons-prefix}android-car:before,\n.#{$ionicons-prefix}android-cart:before,\n.#{$ionicons-prefix}android-chat:before,\n.#{$ionicons-prefix}android-checkbox:before,\n.#{$ionicons-prefix}android-checkbox-blank:before,\n.#{$ionicons-prefix}android-checkbox-outline:before,\n.#{$ionicons-prefix}android-checkbox-outline-blank:before,\n.#{$ionicons-prefix}android-checkmark-circle:before,\n.#{$ionicons-prefix}android-clipboard:before,\n.#{$ionicons-prefix}android-close:before,\n.#{$ionicons-prefix}android-cloud:before,\n.#{$ionicons-prefix}android-cloud-circle:before,\n.#{$ionicons-prefix}android-cloud-done:before,\n.#{$ionicons-prefix}android-cloud-outline:before,\n.#{$ionicons-prefix}android-color-palette:before,\n.#{$ionicons-prefix}android-compass:before,\n.#{$ionicons-prefix}android-contact:before,\n.#{$ionicons-prefix}android-contacts:before,\n.#{$ionicons-prefix}android-contract:before,\n.#{$ionicons-prefix}android-create:before,\n.#{$ionicons-prefix}android-delete:before,\n.#{$ionicons-prefix}android-desktop:before,\n.#{$ionicons-prefix}android-document:before,\n.#{$ionicons-prefix}android-done:before,\n.#{$ionicons-prefix}android-done-all:before,\n.#{$ionicons-prefix}android-download:before,\n.#{$ionicons-prefix}android-drafts:before,\n.#{$ionicons-prefix}android-exit:before,\n.#{$ionicons-prefix}android-expand:before,\n.#{$ionicons-prefix}android-favorite:before,\n.#{$ionicons-prefix}android-favorite-outline:before,\n.#{$ionicons-prefix}android-film:before,\n.#{$ionicons-prefix}android-folder:before,\n.#{$ionicons-prefix}android-folder-open:before,\n.#{$ionicons-prefix}android-funnel:before,\n.#{$ionicons-prefix}android-globe:before,\n.#{$ionicons-prefix}android-hand:before,\n.#{$ionicons-prefix}android-hangout:before,\n.#{$ionicons-prefix}android-happy:before,\n.#{$ionicons-prefix}android-home:before,\n.#{$ionicons-prefix}android-image:before,\n.#{$ionicons-prefix}android-laptop:before,\n.#{$ionicons-prefix}android-list:before,\n.#{$ionicons-prefix}android-locate:before,\n.#{$ionicons-prefix}android-lock:before,\n.#{$ionicons-prefix}android-mail:before,\n.#{$ionicons-prefix}android-map:before,\n.#{$ionicons-prefix}android-menu:before,\n.#{$ionicons-prefix}android-microphone:before,\n.#{$ionicons-prefix}android-microphone-off:before,\n.#{$ionicons-prefix}android-more-horizontal:before,\n.#{$ionicons-prefix}android-more-vertical:before,\n.#{$ionicons-prefix}android-navigate:before,\n.#{$ionicons-prefix}android-notifications:before,\n.#{$ionicons-prefix}android-notifications-none:before,\n.#{$ionicons-prefix}android-notifications-off:before,\n.#{$ionicons-prefix}android-open:before,\n.#{$ionicons-prefix}android-options:before,\n.#{$ionicons-prefix}android-people:before,\n.#{$ionicons-prefix}android-person:before,\n.#{$ionicons-prefix}android-person-add:before,\n.#{$ionicons-prefix}android-phone-landscape:before,\n.#{$ionicons-prefix}android-phone-portrait:before,\n.#{$ionicons-prefix}android-pin:before,\n.#{$ionicons-prefix}android-plane:before,\n.#{$ionicons-prefix}android-playstore:before,\n.#{$ionicons-prefix}android-print:before,\n.#{$ionicons-prefix}android-radio-button-off:before,\n.#{$ionicons-prefix}android-radio-button-on:before,\n.#{$ionicons-prefix}android-refresh:before,\n.#{$ionicons-prefix}android-remove:before,\n.#{$ionicons-prefix}android-remove-circle:before,\n.#{$ionicons-prefix}android-restaurant:before,\n.#{$ionicons-prefix}android-sad:before,\n.#{$ionicons-prefix}android-search:before,\n.#{$ionicons-prefix}android-send:before,\n.#{$ionicons-prefix}android-settings:before,\n.#{$ionicons-prefix}android-share:before,\n.#{$ionicons-prefix}android-share-alt:before,\n.#{$ionicons-prefix}android-star:before,\n.#{$ionicons-prefix}android-star-half:before,\n.#{$ionicons-prefix}android-star-outline:before,\n.#{$ionicons-prefix}android-stopwatch:before,\n.#{$ionicons-prefix}android-subway:before,\n.#{$ionicons-prefix}android-sunny:before,\n.#{$ionicons-prefix}android-sync:before,\n.#{$ionicons-prefix}android-textsms:before,\n.#{$ionicons-prefix}android-time:before,\n.#{$ionicons-prefix}android-train:before,\n.#{$ionicons-prefix}android-unlock:before,\n.#{$ionicons-prefix}android-upload:before,\n.#{$ionicons-prefix}android-volume-down:before,\n.#{$ionicons-prefix}android-volume-mute:before,\n.#{$ionicons-prefix}android-volume-off:before,\n.#{$ionicons-prefix}android-volume-up:before,\n.#{$ionicons-prefix}android-walk:before,\n.#{$ionicons-prefix}android-warning:before,\n.#{$ionicons-prefix}android-watch:before,\n.#{$ionicons-prefix}android-wifi:before,\n.#{$ionicons-prefix}aperture:before,\n.#{$ionicons-prefix}archive:before,\n.#{$ionicons-prefix}arrow-down-a:before,\n.#{$ionicons-prefix}arrow-down-b:before,\n.#{$ionicons-prefix}arrow-down-c:before,\n.#{$ionicons-prefix}arrow-expand:before,\n.#{$ionicons-prefix}arrow-graph-down-left:before,\n.#{$ionicons-prefix}arrow-graph-down-right:before,\n.#{$ionicons-prefix}arrow-graph-up-left:before,\n.#{$ionicons-prefix}arrow-graph-up-right:before,\n.#{$ionicons-prefix}arrow-left-a:before,\n.#{$ionicons-prefix}arrow-left-b:before,\n.#{$ionicons-prefix}arrow-left-c:before,\n.#{$ionicons-prefix}arrow-move:before,\n.#{$ionicons-prefix}arrow-resize:before,\n.#{$ionicons-prefix}arrow-return-left:before,\n.#{$ionicons-prefix}arrow-return-right:before,\n.#{$ionicons-prefix}arrow-right-a:before,\n.#{$ionicons-prefix}arrow-right-b:before,\n.#{$ionicons-prefix}arrow-right-c:before,\n.#{$ionicons-prefix}arrow-shrink:before,\n.#{$ionicons-prefix}arrow-swap:before,\n.#{$ionicons-prefix}arrow-up-a:before,\n.#{$ionicons-prefix}arrow-up-b:before,\n.#{$ionicons-prefix}arrow-up-c:before,\n.#{$ionicons-prefix}asterisk:before,\n.#{$ionicons-prefix}at:before,\n.#{$ionicons-prefix}backspace:before,\n.#{$ionicons-prefix}backspace-outline:before,\n.#{$ionicons-prefix}bag:before,\n.#{$ionicons-prefix}battery-charging:before,\n.#{$ionicons-prefix}battery-empty:before,\n.#{$ionicons-prefix}battery-full:before,\n.#{$ionicons-prefix}battery-half:before,\n.#{$ionicons-prefix}battery-low:before,\n.#{$ionicons-prefix}beaker:before,\n.#{$ionicons-prefix}beer:before,\n.#{$ionicons-prefix}bluetooth:before,\n.#{$ionicons-prefix}bonfire:before,\n.#{$ionicons-prefix}bookmark:before,\n.#{$ionicons-prefix}bowtie:before,\n.#{$ionicons-prefix}briefcase:before,\n.#{$ionicons-prefix}bug:before,\n.#{$ionicons-prefix}calculator:before,\n.#{$ionicons-prefix}calendar:before,\n.#{$ionicons-prefix}camera:before,\n.#{$ionicons-prefix}card:before,\n.#{$ionicons-prefix}cash:before,\n.#{$ionicons-prefix}chatbox:before,\n.#{$ionicons-prefix}chatbox-working:before,\n.#{$ionicons-prefix}chatboxes:before,\n.#{$ionicons-prefix}chatbubble:before,\n.#{$ionicons-prefix}chatbubble-working:before,\n.#{$ionicons-prefix}chatbubbles:before,\n.#{$ionicons-prefix}checkmark:before,\n.#{$ionicons-prefix}checkmark-circled:before,\n.#{$ionicons-prefix}checkmark-round:before,\n.#{$ionicons-prefix}chevron-down:before,\n.#{$ionicons-prefix}chevron-left:before,\n.#{$ionicons-prefix}chevron-right:before,\n.#{$ionicons-prefix}chevron-up:before,\n.#{$ionicons-prefix}clipboard:before,\n.#{$ionicons-prefix}clock:before,\n.#{$ionicons-prefix}close:before,\n.#{$ionicons-prefix}close-circled:before,\n.#{$ionicons-prefix}close-round:before,\n.#{$ionicons-prefix}closed-captioning:before,\n.#{$ionicons-prefix}cloud:before,\n.#{$ionicons-prefix}code:before,\n.#{$ionicons-prefix}code-download:before,\n.#{$ionicons-prefix}code-working:before,\n.#{$ionicons-prefix}coffee:before,\n.#{$ionicons-prefix}compass:before,\n.#{$ionicons-prefix}compose:before,\n.#{$ionicons-prefix}connection-bars:before,\n.#{$ionicons-prefix}contrast:before,\n.#{$ionicons-prefix}crop:before,\n.#{$ionicons-prefix}cube:before,\n.#{$ionicons-prefix}disc:before,\n.#{$ionicons-prefix}document:before,\n.#{$ionicons-prefix}document-text:before,\n.#{$ionicons-prefix}drag:before,\n.#{$ionicons-prefix}earth:before,\n.#{$ionicons-prefix}easel:before,\n.#{$ionicons-prefix}edit:before,\n.#{$ionicons-prefix}egg:before,\n.#{$ionicons-prefix}eject:before,\n.#{$ionicons-prefix}email:before,\n.#{$ionicons-prefix}email-unread:before,\n.#{$ionicons-prefix}erlenmeyer-flask:before,\n.#{$ionicons-prefix}erlenmeyer-flask-bubbles:before,\n.#{$ionicons-prefix}eye:before,\n.#{$ionicons-prefix}eye-disabled:before,\n.#{$ionicons-prefix}female:before,\n.#{$ionicons-prefix}filing:before,\n.#{$ionicons-prefix}film-marker:before,\n.#{$ionicons-prefix}fireball:before,\n.#{$ionicons-prefix}flag:before,\n.#{$ionicons-prefix}flame:before,\n.#{$ionicons-prefix}flash:before,\n.#{$ionicons-prefix}flash-off:before,\n.#{$ionicons-prefix}folder:before,\n.#{$ionicons-prefix}fork:before,\n.#{$ionicons-prefix}fork-repo:before,\n.#{$ionicons-prefix}forward:before,\n.#{$ionicons-prefix}funnel:before,\n.#{$ionicons-prefix}gear-a:before,\n.#{$ionicons-prefix}gear-b:before,\n.#{$ionicons-prefix}grid:before,\n.#{$ionicons-prefix}hammer:before,\n.#{$ionicons-prefix}happy:before,\n.#{$ionicons-prefix}happy-outline:before,\n.#{$ionicons-prefix}headphone:before,\n.#{$ionicons-prefix}heart:before,\n.#{$ionicons-prefix}heart-broken:before,\n.#{$ionicons-prefix}help:before,\n.#{$ionicons-prefix}help-buoy:before,\n.#{$ionicons-prefix}help-circled:before,\n.#{$ionicons-prefix}home:before,\n.#{$ionicons-prefix}icecream:before,\n.#{$ionicons-prefix}image:before,\n.#{$ionicons-prefix}images:before,\n.#{$ionicons-prefix}information:before,\n.#{$ionicons-prefix}information-circled:before,\n.#{$ionicons-prefix}ionic:before,\n.#{$ionicons-prefix}ios-alarm:before,\n.#{$ionicons-prefix}ios-alarm-outline:before,\n.#{$ionicons-prefix}ios-albums:before,\n.#{$ionicons-prefix}ios-albums-outline:before,\n.#{$ionicons-prefix}ios-americanfootball:before,\n.#{$ionicons-prefix}ios-americanfootball-outline:before,\n.#{$ionicons-prefix}ios-analytics:before,\n.#{$ionicons-prefix}ios-analytics-outline:before,\n.#{$ionicons-prefix}ios-arrow-back:before,\n.#{$ionicons-prefix}ios-arrow-down:before,\n.#{$ionicons-prefix}ios-arrow-forward:before,\n.#{$ionicons-prefix}ios-arrow-left:before,\n.#{$ionicons-prefix}ios-arrow-right:before,\n.#{$ionicons-prefix}ios-arrow-thin-down:before,\n.#{$ionicons-prefix}ios-arrow-thin-left:before,\n.#{$ionicons-prefix}ios-arrow-thin-right:before,\n.#{$ionicons-prefix}ios-arrow-thin-up:before,\n.#{$ionicons-prefix}ios-arrow-up:before,\n.#{$ionicons-prefix}ios-at:before,\n.#{$ionicons-prefix}ios-at-outline:before,\n.#{$ionicons-prefix}ios-barcode:before,\n.#{$ionicons-prefix}ios-barcode-outline:before,\n.#{$ionicons-prefix}ios-baseball:before,\n.#{$ionicons-prefix}ios-baseball-outline:before,\n.#{$ionicons-prefix}ios-basketball:before,\n.#{$ionicons-prefix}ios-basketball-outline:before,\n.#{$ionicons-prefix}ios-bell:before,\n.#{$ionicons-prefix}ios-bell-outline:before,\n.#{$ionicons-prefix}ios-body:before,\n.#{$ionicons-prefix}ios-body-outline:before,\n.#{$ionicons-prefix}ios-bolt:before,\n.#{$ionicons-prefix}ios-bolt-outline:before,\n.#{$ionicons-prefix}ios-book:before,\n.#{$ionicons-prefix}ios-book-outline:before,\n.#{$ionicons-prefix}ios-bookmarks:before,\n.#{$ionicons-prefix}ios-bookmarks-outline:before,\n.#{$ionicons-prefix}ios-box:before,\n.#{$ionicons-prefix}ios-box-outline:before,\n.#{$ionicons-prefix}ios-briefcase:before,\n.#{$ionicons-prefix}ios-briefcase-outline:before,\n.#{$ionicons-prefix}ios-browsers:before,\n.#{$ionicons-prefix}ios-browsers-outline:before,\n.#{$ionicons-prefix}ios-calculator:before,\n.#{$ionicons-prefix}ios-calculator-outline:before,\n.#{$ionicons-prefix}ios-calendar:before,\n.#{$ionicons-prefix}ios-calendar-outline:before,\n.#{$ionicons-prefix}ios-camera:before,\n.#{$ionicons-prefix}ios-camera-outline:before,\n.#{$ionicons-prefix}ios-cart:before,\n.#{$ionicons-prefix}ios-cart-outline:before,\n.#{$ionicons-prefix}ios-chatboxes:before,\n.#{$ionicons-prefix}ios-chatboxes-outline:before,\n.#{$ionicons-prefix}ios-chatbubble:before,\n.#{$ionicons-prefix}ios-chatbubble-outline:before,\n.#{$ionicons-prefix}ios-checkmark:before,\n.#{$ionicons-prefix}ios-checkmark-empty:before,\n.#{$ionicons-prefix}ios-checkmark-outline:before,\n.#{$ionicons-prefix}ios-circle-filled:before,\n.#{$ionicons-prefix}ios-circle-outline:before,\n.#{$ionicons-prefix}ios-clock:before,\n.#{$ionicons-prefix}ios-clock-outline:before,\n.#{$ionicons-prefix}ios-close:before,\n.#{$ionicons-prefix}ios-close-empty:before,\n.#{$ionicons-prefix}ios-close-outline:before,\n.#{$ionicons-prefix}ios-cloud:before,\n.#{$ionicons-prefix}ios-cloud-download:before,\n.#{$ionicons-prefix}ios-cloud-download-outline:before,\n.#{$ionicons-prefix}ios-cloud-outline:before,\n.#{$ionicons-prefix}ios-cloud-upload:before,\n.#{$ionicons-prefix}ios-cloud-upload-outline:before,\n.#{$ionicons-prefix}ios-cloudy:before,\n.#{$ionicons-prefix}ios-cloudy-night:before,\n.#{$ionicons-prefix}ios-cloudy-night-outline:before,\n.#{$ionicons-prefix}ios-cloudy-outline:before,\n.#{$ionicons-prefix}ios-cog:before,\n.#{$ionicons-prefix}ios-cog-outline:before,\n.#{$ionicons-prefix}ios-color-filter:before,\n.#{$ionicons-prefix}ios-color-filter-outline:before,\n.#{$ionicons-prefix}ios-color-wand:before,\n.#{$ionicons-prefix}ios-color-wand-outline:before,\n.#{$ionicons-prefix}ios-compose:before,\n.#{$ionicons-prefix}ios-compose-outline:before,\n.#{$ionicons-prefix}ios-contact:before,\n.#{$ionicons-prefix}ios-contact-outline:before,\n.#{$ionicons-prefix}ios-copy:before,\n.#{$ionicons-prefix}ios-copy-outline:before,\n.#{$ionicons-prefix}ios-crop:before,\n.#{$ionicons-prefix}ios-crop-strong:before,\n.#{$ionicons-prefix}ios-download:before,\n.#{$ionicons-prefix}ios-download-outline:before,\n.#{$ionicons-prefix}ios-drag:before,\n.#{$ionicons-prefix}ios-email:before,\n.#{$ionicons-prefix}ios-email-outline:before,\n.#{$ionicons-prefix}ios-eye:before,\n.#{$ionicons-prefix}ios-eye-outline:before,\n.#{$ionicons-prefix}ios-fastforward:before,\n.#{$ionicons-prefix}ios-fastforward-outline:before,\n.#{$ionicons-prefix}ios-filing:before,\n.#{$ionicons-prefix}ios-filing-outline:before,\n.#{$ionicons-prefix}ios-film:before,\n.#{$ionicons-prefix}ios-film-outline:before,\n.#{$ionicons-prefix}ios-flag:before,\n.#{$ionicons-prefix}ios-flag-outline:before,\n.#{$ionicons-prefix}ios-flame:before,\n.#{$ionicons-prefix}ios-flame-outline:before,\n.#{$ionicons-prefix}ios-flask:before,\n.#{$ionicons-prefix}ios-flask-outline:before,\n.#{$ionicons-prefix}ios-flower:before,\n.#{$ionicons-prefix}ios-flower-outline:before,\n.#{$ionicons-prefix}ios-folder:before,\n.#{$ionicons-prefix}ios-folder-outline:before,\n.#{$ionicons-prefix}ios-football:before,\n.#{$ionicons-prefix}ios-football-outline:before,\n.#{$ionicons-prefix}ios-game-controller-a:before,\n.#{$ionicons-prefix}ios-game-controller-a-outline:before,\n.#{$ionicons-prefix}ios-game-controller-b:before,\n.#{$ionicons-prefix}ios-game-controller-b-outline:before,\n.#{$ionicons-prefix}ios-gear:before,\n.#{$ionicons-prefix}ios-gear-outline:before,\n.#{$ionicons-prefix}ios-glasses:before,\n.#{$ionicons-prefix}ios-glasses-outline:before,\n.#{$ionicons-prefix}ios-grid-view:before,\n.#{$ionicons-prefix}ios-grid-view-outline:before,\n.#{$ionicons-prefix}ios-heart:before,\n.#{$ionicons-prefix}ios-heart-outline:before,\n.#{$ionicons-prefix}ios-help:before,\n.#{$ionicons-prefix}ios-help-empty:before,\n.#{$ionicons-prefix}ios-help-outline:before,\n.#{$ionicons-prefix}ios-home:before,\n.#{$ionicons-prefix}ios-home-outline:before,\n.#{$ionicons-prefix}ios-infinite:before,\n.#{$ionicons-prefix}ios-infinite-outline:before,\n.#{$ionicons-prefix}ios-information:before,\n.#{$ionicons-prefix}ios-information-empty:before,\n.#{$ionicons-prefix}ios-information-outline:before,\n.#{$ionicons-prefix}ios-ionic-outline:before,\n.#{$ionicons-prefix}ios-keypad:before,\n.#{$ionicons-prefix}ios-keypad-outline:before,\n.#{$ionicons-prefix}ios-lightbulb:before,\n.#{$ionicons-prefix}ios-lightbulb-outline:before,\n.#{$ionicons-prefix}ios-list:before,\n.#{$ionicons-prefix}ios-list-outline:before,\n.#{$ionicons-prefix}ios-location:before,\n.#{$ionicons-prefix}ios-location-outline:before,\n.#{$ionicons-prefix}ios-locked:before,\n.#{$ionicons-prefix}ios-locked-outline:before,\n.#{$ionicons-prefix}ios-loop:before,\n.#{$ionicons-prefix}ios-loop-strong:before,\n.#{$ionicons-prefix}ios-medical:before,\n.#{$ionicons-prefix}ios-medical-outline:before,\n.#{$ionicons-prefix}ios-medkit:before,\n.#{$ionicons-prefix}ios-medkit-outline:before,\n.#{$ionicons-prefix}ios-mic:before,\n.#{$ionicons-prefix}ios-mic-off:before,\n.#{$ionicons-prefix}ios-mic-outline:before,\n.#{$ionicons-prefix}ios-minus:before,\n.#{$ionicons-prefix}ios-minus-empty:before,\n.#{$ionicons-prefix}ios-minus-outline:before,\n.#{$ionicons-prefix}ios-monitor:before,\n.#{$ionicons-prefix}ios-monitor-outline:before,\n.#{$ionicons-prefix}ios-moon:before,\n.#{$ionicons-prefix}ios-moon-outline:before,\n.#{$ionicons-prefix}ios-more:before,\n.#{$ionicons-prefix}ios-more-outline:before,\n.#{$ionicons-prefix}ios-musical-note:before,\n.#{$ionicons-prefix}ios-musical-notes:before,\n.#{$ionicons-prefix}ios-navigate:before,\n.#{$ionicons-prefix}ios-navigate-outline:before,\n.#{$ionicons-prefix}ios-nutrition:before,\n.#{$ionicons-prefix}ios-nutrition-outline:before,\n.#{$ionicons-prefix}ios-paper:before,\n.#{$ionicons-prefix}ios-paper-outline:before,\n.#{$ionicons-prefix}ios-paperplane:before,\n.#{$ionicons-prefix}ios-paperplane-outline:before,\n.#{$ionicons-prefix}ios-partlysunny:before,\n.#{$ionicons-prefix}ios-partlysunny-outline:before,\n.#{$ionicons-prefix}ios-pause:before,\n.#{$ionicons-prefix}ios-pause-outline:before,\n.#{$ionicons-prefix}ios-paw:before,\n.#{$ionicons-prefix}ios-paw-outline:before,\n.#{$ionicons-prefix}ios-people:before,\n.#{$ionicons-prefix}ios-people-outline:before,\n.#{$ionicons-prefix}ios-person:before,\n.#{$ionicons-prefix}ios-person-outline:before,\n.#{$ionicons-prefix}ios-personadd:before,\n.#{$ionicons-prefix}ios-personadd-outline:before,\n.#{$ionicons-prefix}ios-photos:before,\n.#{$ionicons-prefix}ios-photos-outline:before,\n.#{$ionicons-prefix}ios-pie:before,\n.#{$ionicons-prefix}ios-pie-outline:before,\n.#{$ionicons-prefix}ios-pint:before,\n.#{$ionicons-prefix}ios-pint-outline:before,\n.#{$ionicons-prefix}ios-play:before,\n.#{$ionicons-prefix}ios-play-outline:before,\n.#{$ionicons-prefix}ios-plus:before,\n.#{$ionicons-prefix}ios-plus-empty:before,\n.#{$ionicons-prefix}ios-plus-outline:before,\n.#{$ionicons-prefix}ios-pricetag:before,\n.#{$ionicons-prefix}ios-pricetag-outline:before,\n.#{$ionicons-prefix}ios-pricetags:before,\n.#{$ionicons-prefix}ios-pricetags-outline:before,\n.#{$ionicons-prefix}ios-printer:before,\n.#{$ionicons-prefix}ios-printer-outline:before,\n.#{$ionicons-prefix}ios-pulse:before,\n.#{$ionicons-prefix}ios-pulse-strong:before,\n.#{$ionicons-prefix}ios-rainy:before,\n.#{$ionicons-prefix}ios-rainy-outline:before,\n.#{$ionicons-prefix}ios-recording:before,\n.#{$ionicons-prefix}ios-recording-outline:before,\n.#{$ionicons-prefix}ios-redo:before,\n.#{$ionicons-prefix}ios-redo-outline:before,\n.#{$ionicons-prefix}ios-refresh:before,\n.#{$ionicons-prefix}ios-refresh-empty:before,\n.#{$ionicons-prefix}ios-refresh-outline:before,\n.#{$ionicons-prefix}ios-reload:before,\n.#{$ionicons-prefix}ios-reverse-camera:before,\n.#{$ionicons-prefix}ios-reverse-camera-outline:before,\n.#{$ionicons-prefix}ios-rewind:before,\n.#{$ionicons-prefix}ios-rewind-outline:before,\n.#{$ionicons-prefix}ios-rose:before,\n.#{$ionicons-prefix}ios-rose-outline:before,\n.#{$ionicons-prefix}ios-search:before,\n.#{$ionicons-prefix}ios-search-strong:before,\n.#{$ionicons-prefix}ios-settings:before,\n.#{$ionicons-prefix}ios-settings-strong:before,\n.#{$ionicons-prefix}ios-shuffle:before,\n.#{$ionicons-prefix}ios-shuffle-strong:before,\n.#{$ionicons-prefix}ios-skipbackward:before,\n.#{$ionicons-prefix}ios-skipbackward-outline:before,\n.#{$ionicons-prefix}ios-skipforward:before,\n.#{$ionicons-prefix}ios-skipforward-outline:before,\n.#{$ionicons-prefix}ios-snowy:before,\n.#{$ionicons-prefix}ios-speedometer:before,\n.#{$ionicons-prefix}ios-speedometer-outline:before,\n.#{$ionicons-prefix}ios-star:before,\n.#{$ionicons-prefix}ios-star-half:before,\n.#{$ionicons-prefix}ios-star-outline:before,\n.#{$ionicons-prefix}ios-stopwatch:before,\n.#{$ionicons-prefix}ios-stopwatch-outline:before,\n.#{$ionicons-prefix}ios-sunny:before,\n.#{$ionicons-prefix}ios-sunny-outline:before,\n.#{$ionicons-prefix}ios-telephone:before,\n.#{$ionicons-prefix}ios-telephone-outline:before,\n.#{$ionicons-prefix}ios-tennisball:before,\n.#{$ionicons-prefix}ios-tennisball-outline:before,\n.#{$ionicons-prefix}ios-thunderstorm:before,\n.#{$ionicons-prefix}ios-thunderstorm-outline:before,\n.#{$ionicons-prefix}ios-time:before,\n.#{$ionicons-prefix}ios-time-outline:before,\n.#{$ionicons-prefix}ios-timer:before,\n.#{$ionicons-prefix}ios-timer-outline:before,\n.#{$ionicons-prefix}ios-toggle:before,\n.#{$ionicons-prefix}ios-toggle-outline:before,\n.#{$ionicons-prefix}ios-trash:before,\n.#{$ionicons-prefix}ios-trash-outline:before,\n.#{$ionicons-prefix}ios-undo:before,\n.#{$ionicons-prefix}ios-undo-outline:before,\n.#{$ionicons-prefix}ios-unlocked:before,\n.#{$ionicons-prefix}ios-unlocked-outline:before,\n.#{$ionicons-prefix}ios-upload:before,\n.#{$ionicons-prefix}ios-upload-outline:before,\n.#{$ionicons-prefix}ios-videocam:before,\n.#{$ionicons-prefix}ios-videocam-outline:before,\n.#{$ionicons-prefix}ios-volume-high:before,\n.#{$ionicons-prefix}ios-volume-low:before,\n.#{$ionicons-prefix}ios-wineglass:before,\n.#{$ionicons-prefix}ios-wineglass-outline:before,\n.#{$ionicons-prefix}ios-world:before,\n.#{$ionicons-prefix}ios-world-outline:before,\n.#{$ionicons-prefix}ipad:before,\n.#{$ionicons-prefix}iphone:before,\n.#{$ionicons-prefix}ipod:before,\n.#{$ionicons-prefix}jet:before,\n.#{$ionicons-prefix}key:before,\n.#{$ionicons-prefix}knife:before,\n.#{$ionicons-prefix}laptop:before,\n.#{$ionicons-prefix}leaf:before,\n.#{$ionicons-prefix}levels:before,\n.#{$ionicons-prefix}lightbulb:before,\n.#{$ionicons-prefix}link:before,\n.#{$ionicons-prefix}load-a:before,\n.#{$ionicons-prefix}load-b:before,\n.#{$ionicons-prefix}load-c:before,\n.#{$ionicons-prefix}load-d:before,\n.#{$ionicons-prefix}location:before,\n.#{$ionicons-prefix}lock-combination:before,\n.#{$ionicons-prefix}locked:before,\n.#{$ionicons-prefix}log-in:before,\n.#{$ionicons-prefix}log-out:before,\n.#{$ionicons-prefix}loop:before,\n.#{$ionicons-prefix}magnet:before,\n.#{$ionicons-prefix}male:before,\n.#{$ionicons-prefix}man:before,\n.#{$ionicons-prefix}map:before,\n.#{$ionicons-prefix}medkit:before,\n.#{$ionicons-prefix}merge:before,\n.#{$ionicons-prefix}mic-a:before,\n.#{$ionicons-prefix}mic-b:before,\n.#{$ionicons-prefix}mic-c:before,\n.#{$ionicons-prefix}minus:before,\n.#{$ionicons-prefix}minus-circled:before,\n.#{$ionicons-prefix}minus-round:before,\n.#{$ionicons-prefix}model-s:before,\n.#{$ionicons-prefix}monitor:before,\n.#{$ionicons-prefix}more:before,\n.#{$ionicons-prefix}mouse:before,\n.#{$ionicons-prefix}music-note:before,\n.#{$ionicons-prefix}navicon:before,\n.#{$ionicons-prefix}navicon-round:before,\n.#{$ionicons-prefix}navigate:before,\n.#{$ionicons-prefix}network:before,\n.#{$ionicons-prefix}no-smoking:before,\n.#{$ionicons-prefix}nuclear:before,\n.#{$ionicons-prefix}outlet:before,\n.#{$ionicons-prefix}paintbrush:before,\n.#{$ionicons-prefix}paintbucket:before,\n.#{$ionicons-prefix}paper-airplane:before,\n.#{$ionicons-prefix}paperclip:before,\n.#{$ionicons-prefix}pause:before,\n.#{$ionicons-prefix}person:before,\n.#{$ionicons-prefix}person-add:before,\n.#{$ionicons-prefix}person-stalker:before,\n.#{$ionicons-prefix}pie-graph:before,\n.#{$ionicons-prefix}pin:before,\n.#{$ionicons-prefix}pinpoint:before,\n.#{$ionicons-prefix}pizza:before,\n.#{$ionicons-prefix}plane:before,\n.#{$ionicons-prefix}planet:before,\n.#{$ionicons-prefix}play:before,\n.#{$ionicons-prefix}playstation:before,\n.#{$ionicons-prefix}plus:before,\n.#{$ionicons-prefix}plus-circled:before,\n.#{$ionicons-prefix}plus-round:before,\n.#{$ionicons-prefix}podium:before,\n.#{$ionicons-prefix}pound:before,\n.#{$ionicons-prefix}power:before,\n.#{$ionicons-prefix}pricetag:before,\n.#{$ionicons-prefix}pricetags:before,\n.#{$ionicons-prefix}printer:before,\n.#{$ionicons-prefix}pull-request:before,\n.#{$ionicons-prefix}qr-scanner:before,\n.#{$ionicons-prefix}quote:before,\n.#{$ionicons-prefix}radio-waves:before,\n.#{$ionicons-prefix}record:before,\n.#{$ionicons-prefix}refresh:before,\n.#{$ionicons-prefix}reply:before,\n.#{$ionicons-prefix}reply-all:before,\n.#{$ionicons-prefix}ribbon-a:before,\n.#{$ionicons-prefix}ribbon-b:before,\n.#{$ionicons-prefix}sad:before,\n.#{$ionicons-prefix}sad-outline:before,\n.#{$ionicons-prefix}scissors:before,\n.#{$ionicons-prefix}search:before,\n.#{$ionicons-prefix}settings:before,\n.#{$ionicons-prefix}share:before,\n.#{$ionicons-prefix}shuffle:before,\n.#{$ionicons-prefix}skip-backward:before,\n.#{$ionicons-prefix}skip-forward:before,\n.#{$ionicons-prefix}social-android:before,\n.#{$ionicons-prefix}social-android-outline:before,\n.#{$ionicons-prefix}social-angular:before,\n.#{$ionicons-prefix}social-angular-outline:before,\n.#{$ionicons-prefix}social-apple:before,\n.#{$ionicons-prefix}social-apple-outline:before,\n.#{$ionicons-prefix}social-bitcoin:before,\n.#{$ionicons-prefix}social-bitcoin-outline:before,\n.#{$ionicons-prefix}social-buffer:before,\n.#{$ionicons-prefix}social-buffer-outline:before,\n.#{$ionicons-prefix}social-chrome:before,\n.#{$ionicons-prefix}social-chrome-outline:before,\n.#{$ionicons-prefix}social-codepen:before,\n.#{$ionicons-prefix}social-codepen-outline:before,\n.#{$ionicons-prefix}social-css3:before,\n.#{$ionicons-prefix}social-css3-outline:before,\n.#{$ionicons-prefix}social-designernews:before,\n.#{$ionicons-prefix}social-designernews-outline:before,\n.#{$ionicons-prefix}social-dribbble:before,\n.#{$ionicons-prefix}social-dribbble-outline:before,\n.#{$ionicons-prefix}social-dropbox:before,\n.#{$ionicons-prefix}social-dropbox-outline:before,\n.#{$ionicons-prefix}social-euro:before,\n.#{$ionicons-prefix}social-euro-outline:before,\n.#{$ionicons-prefix}social-facebook:before,\n.#{$ionicons-prefix}social-facebook-outline:before,\n.#{$ionicons-prefix}social-foursquare:before,\n.#{$ionicons-prefix}social-foursquare-outline:before,\n.#{$ionicons-prefix}social-freebsd-devil:before,\n.#{$ionicons-prefix}social-github:before,\n.#{$ionicons-prefix}social-github-outline:before,\n.#{$ionicons-prefix}social-google:before,\n.#{$ionicons-prefix}social-google-outline:before,\n.#{$ionicons-prefix}social-googleplus:before,\n.#{$ionicons-prefix}social-googleplus-outline:before,\n.#{$ionicons-prefix}social-hackernews:before,\n.#{$ionicons-prefix}social-hackernews-outline:before,\n.#{$ionicons-prefix}social-html5:before,\n.#{$ionicons-prefix}social-html5-outline:before,\n.#{$ionicons-prefix}social-instagram:before,\n.#{$ionicons-prefix}social-instagram-outline:before,\n.#{$ionicons-prefix}social-javascript:before,\n.#{$ionicons-prefix}social-javascript-outline:before,\n.#{$ionicons-prefix}social-linkedin:before,\n.#{$ionicons-prefix}social-linkedin-outline:before,\n.#{$ionicons-prefix}social-markdown:before,\n.#{$ionicons-prefix}social-nodejs:before,\n.#{$ionicons-prefix}social-octocat:before,\n.#{$ionicons-prefix}social-pinterest:before,\n.#{$ionicons-prefix}social-pinterest-outline:before,\n.#{$ionicons-prefix}social-python:before,\n.#{$ionicons-prefix}social-reddit:before,\n.#{$ionicons-prefix}social-reddit-outline:before,\n.#{$ionicons-prefix}social-rss:before,\n.#{$ionicons-prefix}social-rss-outline:before,\n.#{$ionicons-prefix}social-sass:before,\n.#{$ionicons-prefix}social-skype:before,\n.#{$ionicons-prefix}social-skype-outline:before,\n.#{$ionicons-prefix}social-snapchat:before,\n.#{$ionicons-prefix}social-snapchat-outline:before,\n.#{$ionicons-prefix}social-tumblr:before,\n.#{$ionicons-prefix}social-tumblr-outline:before,\n.#{$ionicons-prefix}social-tux:before,\n.#{$ionicons-prefix}social-twitch:before,\n.#{$ionicons-prefix}social-twitch-outline:before,\n.#{$ionicons-prefix}social-twitter:before,\n.#{$ionicons-prefix}social-twitter-outline:before,\n.#{$ionicons-prefix}social-usd:before,\n.#{$ionicons-prefix}social-usd-outline:before,\n.#{$ionicons-prefix}social-vimeo:before,\n.#{$ionicons-prefix}social-vimeo-outline:before,\n.#{$ionicons-prefix}social-whatsapp:before,\n.#{$ionicons-prefix}social-whatsapp-outline:before,\n.#{$ionicons-prefix}social-windows:before,\n.#{$ionicons-prefix}social-windows-outline:before,\n.#{$ionicons-prefix}social-wordpress:before,\n.#{$ionicons-prefix}social-wordpress-outline:before,\n.#{$ionicons-prefix}social-yahoo:before,\n.#{$ionicons-prefix}social-yahoo-outline:before,\n.#{$ionicons-prefix}social-yen:before,\n.#{$ionicons-prefix}social-yen-outline:before,\n.#{$ionicons-prefix}social-youtube:before,\n.#{$ionicons-prefix}social-youtube-outline:before,\n.#{$ionicons-prefix}soup-can:before,\n.#{$ionicons-prefix}soup-can-outline:before,\n.#{$ionicons-prefix}speakerphone:before,\n.#{$ionicons-prefix}speedometer:before,\n.#{$ionicons-prefix}spoon:before,\n.#{$ionicons-prefix}star:before,\n.#{$ionicons-prefix}stats-bars:before,\n.#{$ionicons-prefix}steam:before,\n.#{$ionicons-prefix}stop:before,\n.#{$ionicons-prefix}thermometer:before,\n.#{$ionicons-prefix}thumbsdown:before,\n.#{$ionicons-prefix}thumbsup:before,\n.#{$ionicons-prefix}toggle:before,\n.#{$ionicons-prefix}toggle-filled:before,\n.#{$ionicons-prefix}transgender:before,\n.#{$ionicons-prefix}trash-a:before,\n.#{$ionicons-prefix}trash-b:before,\n.#{$ionicons-prefix}trophy:before,\n.#{$ionicons-prefix}tshirt:before,\n.#{$ionicons-prefix}tshirt-outline:before,\n.#{$ionicons-prefix}umbrella:before,\n.#{$ionicons-prefix}university:before,\n.#{$ionicons-prefix}unlocked:before,\n.#{$ionicons-prefix}upload:before,\n.#{$ionicons-prefix}usb:before,\n.#{$ionicons-prefix}videocamera:before,\n.#{$ionicons-prefix}volume-high:before,\n.#{$ionicons-prefix}volume-low:before,\n.#{$ionicons-prefix}volume-medium:before,\n.#{$ionicons-prefix}volume-mute:before,\n.#{$ionicons-prefix}wand:before,\n.#{$ionicons-prefix}waterdrop:before,\n.#{$ionicons-prefix}wifi:before,\n.#{$ionicons-prefix}wineglass:before,\n.#{$ionicons-prefix}woman:before,\n.#{$ionicons-prefix}wrench:before,\n.#{$ionicons-prefix}xbox:before\n{\n  @extend .ion;\n}\n.#{$ionicons-prefix}alert:before { content: $ionicon-var-alert; }\n.#{$ionicons-prefix}alert-circled:before { content: $ionicon-var-alert-circled; }\n.#{$ionicons-prefix}android-add:before { content: $ionicon-var-android-add; }\n.#{$ionicons-prefix}android-add-circle:before { content: $ionicon-var-android-add-circle; }\n.#{$ionicons-prefix}android-alarm-clock:before { content: $ionicon-var-android-alarm-clock; }\n.#{$ionicons-prefix}android-alert:before { content: $ionicon-var-android-alert; }\n.#{$ionicons-prefix}android-apps:before { content: $ionicon-var-android-apps; }\n.#{$ionicons-prefix}android-archive:before { content: $ionicon-var-android-archive; }\n.#{$ionicons-prefix}android-arrow-back:before { content: $ionicon-var-android-arrow-back; }\n.#{$ionicons-prefix}android-arrow-down:before { content: $ionicon-var-android-arrow-down; }\n.#{$ionicons-prefix}android-arrow-dropdown:before { content: $ionicon-var-android-arrow-dropdown; }\n.#{$ionicons-prefix}android-arrow-dropdown-circle:before { content: $ionicon-var-android-arrow-dropdown-circle; }\n.#{$ionicons-prefix}android-arrow-dropleft:before { content: $ionicon-var-android-arrow-dropleft; }\n.#{$ionicons-prefix}android-arrow-dropleft-circle:before { content: $ionicon-var-android-arrow-dropleft-circle; }\n.#{$ionicons-prefix}android-arrow-dropright:before { content: $ionicon-var-android-arrow-dropright; }\n.#{$ionicons-prefix}android-arrow-dropright-circle:before { content: $ionicon-var-android-arrow-dropright-circle; }\n.#{$ionicons-prefix}android-arrow-dropup:before { content: $ionicon-var-android-arrow-dropup; }\n.#{$ionicons-prefix}android-arrow-dropup-circle:before { content: $ionicon-var-android-arrow-dropup-circle; }\n.#{$ionicons-prefix}android-arrow-forward:before { content: $ionicon-var-android-arrow-forward; }\n.#{$ionicons-prefix}android-arrow-up:before { content: $ionicon-var-android-arrow-up; }\n.#{$ionicons-prefix}android-attach:before { content: $ionicon-var-android-attach; }\n.#{$ionicons-prefix}android-bar:before { content: $ionicon-var-android-bar; }\n.#{$ionicons-prefix}android-bicycle:before { content: $ionicon-var-android-bicycle; }\n.#{$ionicons-prefix}android-boat:before { content: $ionicon-var-android-boat; }\n.#{$ionicons-prefix}android-bookmark:before { content: $ionicon-var-android-bookmark; }\n.#{$ionicons-prefix}android-bulb:before { content: $ionicon-var-android-bulb; }\n.#{$ionicons-prefix}android-bus:before { content: $ionicon-var-android-bus; }\n.#{$ionicons-prefix}android-calendar:before { content: $ionicon-var-android-calendar; }\n.#{$ionicons-prefix}android-call:before { content: $ionicon-var-android-call; }\n.#{$ionicons-prefix}android-camera:before { content: $ionicon-var-android-camera; }\n.#{$ionicons-prefix}android-cancel:before { content: $ionicon-var-android-cancel; }\n.#{$ionicons-prefix}android-car:before { content: $ionicon-var-android-car; }\n.#{$ionicons-prefix}android-cart:before { content: $ionicon-var-android-cart; }\n.#{$ionicons-prefix}android-chat:before { content: $ionicon-var-android-chat; }\n.#{$ionicons-prefix}android-checkbox:before { content: $ionicon-var-android-checkbox; }\n.#{$ionicons-prefix}android-checkbox-blank:before { content: $ionicon-var-android-checkbox-blank; }\n.#{$ionicons-prefix}android-checkbox-outline:before { content: $ionicon-var-android-checkbox-outline; }\n.#{$ionicons-prefix}android-checkbox-outline-blank:before { content: $ionicon-var-android-checkbox-outline-blank; }\n.#{$ionicons-prefix}android-checkmark-circle:before { content: $ionicon-var-android-checkmark-circle; }\n.#{$ionicons-prefix}android-clipboard:before { content: $ionicon-var-android-clipboard; }\n.#{$ionicons-prefix}android-close:before { content: $ionicon-var-android-close; }\n.#{$ionicons-prefix}android-cloud:before { content: $ionicon-var-android-cloud; }\n.#{$ionicons-prefix}android-cloud-circle:before { content: $ionicon-var-android-cloud-circle; }\n.#{$ionicons-prefix}android-cloud-done:before { content: $ionicon-var-android-cloud-done; }\n.#{$ionicons-prefix}android-cloud-outline:before { content: $ionicon-var-android-cloud-outline; }\n.#{$ionicons-prefix}android-color-palette:before { content: $ionicon-var-android-color-palette; }\n.#{$ionicons-prefix}android-compass:before { content: $ionicon-var-android-compass; }\n.#{$ionicons-prefix}android-contact:before { content: $ionicon-var-android-contact; }\n.#{$ionicons-prefix}android-contacts:before { content: $ionicon-var-android-contacts; }\n.#{$ionicons-prefix}android-contract:before { content: $ionicon-var-android-contract; }\n.#{$ionicons-prefix}android-create:before { content: $ionicon-var-android-create; }\n.#{$ionicons-prefix}android-delete:before { content: $ionicon-var-android-delete; }\n.#{$ionicons-prefix}android-desktop:before { content: $ionicon-var-android-desktop; }\n.#{$ionicons-prefix}android-document:before { content: $ionicon-var-android-document; }\n.#{$ionicons-prefix}android-done:before { content: $ionicon-var-android-done; }\n.#{$ionicons-prefix}android-done-all:before { content: $ionicon-var-android-done-all; }\n.#{$ionicons-prefix}android-download:before { content: $ionicon-var-android-download; }\n.#{$ionicons-prefix}android-drafts:before { content: $ionicon-var-android-drafts; }\n.#{$ionicons-prefix}android-exit:before { content: $ionicon-var-android-exit; }\n.#{$ionicons-prefix}android-expand:before { content: $ionicon-var-android-expand; }\n.#{$ionicons-prefix}android-favorite:before { content: $ionicon-var-android-favorite; }\n.#{$ionicons-prefix}android-favorite-outline:before { content: $ionicon-var-android-favorite-outline; }\n.#{$ionicons-prefix}android-film:before { content: $ionicon-var-android-film; }\n.#{$ionicons-prefix}android-folder:before { content: $ionicon-var-android-folder; }\n.#{$ionicons-prefix}android-folder-open:before { content: $ionicon-var-android-folder-open; }\n.#{$ionicons-prefix}android-funnel:before { content: $ionicon-var-android-funnel; }\n.#{$ionicons-prefix}android-globe:before { content: $ionicon-var-android-globe; }\n.#{$ionicons-prefix}android-hand:before { content: $ionicon-var-android-hand; }\n.#{$ionicons-prefix}android-hangout:before { content: $ionicon-var-android-hangout; }\n.#{$ionicons-prefix}android-happy:before { content: $ionicon-var-android-happy; }\n.#{$ionicons-prefix}android-home:before { content: $ionicon-var-android-home; }\n.#{$ionicons-prefix}android-image:before { content: $ionicon-var-android-image; }\n.#{$ionicons-prefix}android-laptop:before { content: $ionicon-var-android-laptop; }\n.#{$ionicons-prefix}android-list:before { content: $ionicon-var-android-list; }\n.#{$ionicons-prefix}android-locate:before { content: $ionicon-var-android-locate; }\n.#{$ionicons-prefix}android-lock:before { content: $ionicon-var-android-lock; }\n.#{$ionicons-prefix}android-mail:before { content: $ionicon-var-android-mail; }\n.#{$ionicons-prefix}android-map:before { content: $ionicon-var-android-map; }\n.#{$ionicons-prefix}android-menu:before { content: $ionicon-var-android-menu; }\n.#{$ionicons-prefix}android-microphone:before { content: $ionicon-var-android-microphone; }\n.#{$ionicons-prefix}android-microphone-off:before { content: $ionicon-var-android-microphone-off; }\n.#{$ionicons-prefix}android-more-horizontal:before { content: $ionicon-var-android-more-horizontal; }\n.#{$ionicons-prefix}android-more-vertical:before { content: $ionicon-var-android-more-vertical; }\n.#{$ionicons-prefix}android-navigate:before { content: $ionicon-var-android-navigate; }\n.#{$ionicons-prefix}android-notifications:before { content: $ionicon-var-android-notifications; }\n.#{$ionicons-prefix}android-notifications-none:before { content: $ionicon-var-android-notifications-none; }\n.#{$ionicons-prefix}android-notifications-off:before { content: $ionicon-var-android-notifications-off; }\n.#{$ionicons-prefix}android-open:before { content: $ionicon-var-android-open; }\n.#{$ionicons-prefix}android-options:before { content: $ionicon-var-android-options; }\n.#{$ionicons-prefix}android-people:before { content: $ionicon-var-android-people; }\n.#{$ionicons-prefix}android-person:before { content: $ionicon-var-android-person; }\n.#{$ionicons-prefix}android-person-add:before { content: $ionicon-var-android-person-add; }\n.#{$ionicons-prefix}android-phone-landscape:before { content: $ionicon-var-android-phone-landscape; }\n.#{$ionicons-prefix}android-phone-portrait:before { content: $ionicon-var-android-phone-portrait; }\n.#{$ionicons-prefix}android-pin:before { content: $ionicon-var-android-pin; }\n.#{$ionicons-prefix}android-plane:before { content: $ionicon-var-android-plane; }\n.#{$ionicons-prefix}android-playstore:before { content: $ionicon-var-android-playstore; }\n.#{$ionicons-prefix}android-print:before { content: $ionicon-var-android-print; }\n.#{$ionicons-prefix}android-radio-button-off:before { content: $ionicon-var-android-radio-button-off; }\n.#{$ionicons-prefix}android-radio-button-on:before { content: $ionicon-var-android-radio-button-on; }\n.#{$ionicons-prefix}android-refresh:before { content: $ionicon-var-android-refresh; }\n.#{$ionicons-prefix}android-remove:before { content: $ionicon-var-android-remove; }\n.#{$ionicons-prefix}android-remove-circle:before { content: $ionicon-var-android-remove-circle; }\n.#{$ionicons-prefix}android-restaurant:before { content: $ionicon-var-android-restaurant; }\n.#{$ionicons-prefix}android-sad:before { content: $ionicon-var-android-sad; }\n.#{$ionicons-prefix}android-search:before { content: $ionicon-var-android-search; }\n.#{$ionicons-prefix}android-send:before { content: $ionicon-var-android-send; }\n.#{$ionicons-prefix}android-settings:before { content: $ionicon-var-android-settings; }\n.#{$ionicons-prefix}android-share:before { content: $ionicon-var-android-share; }\n.#{$ionicons-prefix}android-share-alt:before { content: $ionicon-var-android-share-alt; }\n.#{$ionicons-prefix}android-star:before { content: $ionicon-var-android-star; }\n.#{$ionicons-prefix}android-star-half:before { content: $ionicon-var-android-star-half; }\n.#{$ionicons-prefix}android-star-outline:before { content: $ionicon-var-android-star-outline; }\n.#{$ionicons-prefix}android-stopwatch:before { content: $ionicon-var-android-stopwatch; }\n.#{$ionicons-prefix}android-subway:before { content: $ionicon-var-android-subway; }\n.#{$ionicons-prefix}android-sunny:before { content: $ionicon-var-android-sunny; }\n.#{$ionicons-prefix}android-sync:before { content: $ionicon-var-android-sync; }\n.#{$ionicons-prefix}android-textsms:before { content: $ionicon-var-android-textsms; }\n.#{$ionicons-prefix}android-time:before { content: $ionicon-var-android-time; }\n.#{$ionicons-prefix}android-train:before { content: $ionicon-var-android-train; }\n.#{$ionicons-prefix}android-unlock:before { content: $ionicon-var-android-unlock; }\n.#{$ionicons-prefix}android-upload:before { content: $ionicon-var-android-upload; }\n.#{$ionicons-prefix}android-volume-down:before { content: $ionicon-var-android-volume-down; }\n.#{$ionicons-prefix}android-volume-mute:before { content: $ionicon-var-android-volume-mute; }\n.#{$ionicons-prefix}android-volume-off:before { content: $ionicon-var-android-volume-off; }\n.#{$ionicons-prefix}android-volume-up:before { content: $ionicon-var-android-volume-up; }\n.#{$ionicons-prefix}android-walk:before { content: $ionicon-var-android-walk; }\n.#{$ionicons-prefix}android-warning:before { content: $ionicon-var-android-warning; }\n.#{$ionicons-prefix}android-watch:before { content: $ionicon-var-android-watch; }\n.#{$ionicons-prefix}android-wifi:before { content: $ionicon-var-android-wifi; }\n.#{$ionicons-prefix}aperture:before { content: $ionicon-var-aperture; }\n.#{$ionicons-prefix}archive:before { content: $ionicon-var-archive; }\n.#{$ionicons-prefix}arrow-down-a:before { content: $ionicon-var-arrow-down-a; }\n.#{$ionicons-prefix}arrow-down-b:before { content: $ionicon-var-arrow-down-b; }\n.#{$ionicons-prefix}arrow-down-c:before { content: $ionicon-var-arrow-down-c; }\n.#{$ionicons-prefix}arrow-expand:before { content: $ionicon-var-arrow-expand; }\n.#{$ionicons-prefix}arrow-graph-down-left:before { content: $ionicon-var-arrow-graph-down-left; }\n.#{$ionicons-prefix}arrow-graph-down-right:before { content: $ionicon-var-arrow-graph-down-right; }\n.#{$ionicons-prefix}arrow-graph-up-left:before { content: $ionicon-var-arrow-graph-up-left; }\n.#{$ionicons-prefix}arrow-graph-up-right:before { content: $ionicon-var-arrow-graph-up-right; }\n.#{$ionicons-prefix}arrow-left-a:before { content: $ionicon-var-arrow-left-a; }\n.#{$ionicons-prefix}arrow-left-b:before { content: $ionicon-var-arrow-left-b; }\n.#{$ionicons-prefix}arrow-left-c:before { content: $ionicon-var-arrow-left-c; }\n.#{$ionicons-prefix}arrow-move:before { content: $ionicon-var-arrow-move; }\n.#{$ionicons-prefix}arrow-resize:before { content: $ionicon-var-arrow-resize; }\n.#{$ionicons-prefix}arrow-return-left:before { content: $ionicon-var-arrow-return-left; }\n.#{$ionicons-prefix}arrow-return-right:before { content: $ionicon-var-arrow-return-right; }\n.#{$ionicons-prefix}arrow-right-a:before { content: $ionicon-var-arrow-right-a; }\n.#{$ionicons-prefix}arrow-right-b:before { content: $ionicon-var-arrow-right-b; }\n.#{$ionicons-prefix}arrow-right-c:before { content: $ionicon-var-arrow-right-c; }\n.#{$ionicons-prefix}arrow-shrink:before { content: $ionicon-var-arrow-shrink; }\n.#{$ionicons-prefix}arrow-swap:before { content: $ionicon-var-arrow-swap; }\n.#{$ionicons-prefix}arrow-up-a:before { content: $ionicon-var-arrow-up-a; }\n.#{$ionicons-prefix}arrow-up-b:before { content: $ionicon-var-arrow-up-b; }\n.#{$ionicons-prefix}arrow-up-c:before { content: $ionicon-var-arrow-up-c; }\n.#{$ionicons-prefix}asterisk:before { content: $ionicon-var-asterisk; }\n.#{$ionicons-prefix}at:before { content: $ionicon-var-at; }\n.#{$ionicons-prefix}backspace:before { content: $ionicon-var-backspace; }\n.#{$ionicons-prefix}backspace-outline:before { content: $ionicon-var-backspace-outline; }\n.#{$ionicons-prefix}bag:before { content: $ionicon-var-bag; }\n.#{$ionicons-prefix}battery-charging:before { content: $ionicon-var-battery-charging; }\n.#{$ionicons-prefix}battery-empty:before { content: $ionicon-var-battery-empty; }\n.#{$ionicons-prefix}battery-full:before { content: $ionicon-var-battery-full; }\n.#{$ionicons-prefix}battery-half:before { content: $ionicon-var-battery-half; }\n.#{$ionicons-prefix}battery-low:before { content: $ionicon-var-battery-low; }\n.#{$ionicons-prefix}beaker:before { content: $ionicon-var-beaker; }\n.#{$ionicons-prefix}beer:before { content: $ionicon-var-beer; }\n.#{$ionicons-prefix}bluetooth:before { content: $ionicon-var-bluetooth; }\n.#{$ionicons-prefix}bonfire:before { content: $ionicon-var-bonfire; }\n.#{$ionicons-prefix}bookmark:before { content: $ionicon-var-bookmark; }\n.#{$ionicons-prefix}bowtie:before { content: $ionicon-var-bowtie; }\n.#{$ionicons-prefix}briefcase:before { content: $ionicon-var-briefcase; }\n.#{$ionicons-prefix}bug:before { content: $ionicon-var-bug; }\n.#{$ionicons-prefix}calculator:before { content: $ionicon-var-calculator; }\n.#{$ionicons-prefix}calendar:before { content: $ionicon-var-calendar; }\n.#{$ionicons-prefix}camera:before { content: $ionicon-var-camera; }\n.#{$ionicons-prefix}card:before { content: $ionicon-var-card; }\n.#{$ionicons-prefix}cash:before { content: $ionicon-var-cash; }\n.#{$ionicons-prefix}chatbox:before { content: $ionicon-var-chatbox; }\n.#{$ionicons-prefix}chatbox-working:before { content: $ionicon-var-chatbox-working; }\n.#{$ionicons-prefix}chatboxes:before { content: $ionicon-var-chatboxes; }\n.#{$ionicons-prefix}chatbubble:before { content: $ionicon-var-chatbubble; }\n.#{$ionicons-prefix}chatbubble-working:before { content: $ionicon-var-chatbubble-working; }\n.#{$ionicons-prefix}chatbubbles:before { content: $ionicon-var-chatbubbles; }\n.#{$ionicons-prefix}checkmark:before { content: $ionicon-var-checkmark; }\n.#{$ionicons-prefix}checkmark-circled:before { content: $ionicon-var-checkmark-circled; }\n.#{$ionicons-prefix}checkmark-round:before { content: $ionicon-var-checkmark-round; }\n.#{$ionicons-prefix}chevron-down:before { content: $ionicon-var-chevron-down; }\n.#{$ionicons-prefix}chevron-left:before { content: $ionicon-var-chevron-left; }\n.#{$ionicons-prefix}chevron-right:before { content: $ionicon-var-chevron-right; }\n.#{$ionicons-prefix}chevron-up:before { content: $ionicon-var-chevron-up; }\n.#{$ionicons-prefix}clipboard:before { content: $ionicon-var-clipboard; }\n.#{$ionicons-prefix}clock:before { content: $ionicon-var-clock; }\n.#{$ionicons-prefix}close:before { content: $ionicon-var-close; }\n.#{$ionicons-prefix}close-circled:before { content: $ionicon-var-close-circled; }\n.#{$ionicons-prefix}close-round:before { content: $ionicon-var-close-round; }\n.#{$ionicons-prefix}closed-captioning:before { content: $ionicon-var-closed-captioning; }\n.#{$ionicons-prefix}cloud:before { content: $ionicon-var-cloud; }\n.#{$ionicons-prefix}code:before { content: $ionicon-var-code; }\n.#{$ionicons-prefix}code-download:before { content: $ionicon-var-code-download; }\n.#{$ionicons-prefix}code-working:before { content: $ionicon-var-code-working; }\n.#{$ionicons-prefix}coffee:before { content: $ionicon-var-coffee; }\n.#{$ionicons-prefix}compass:before { content: $ionicon-var-compass; }\n.#{$ionicons-prefix}compose:before { content: $ionicon-var-compose; }\n.#{$ionicons-prefix}connection-bars:before { content: $ionicon-var-connection-bars; }\n.#{$ionicons-prefix}contrast:before { content: $ionicon-var-contrast; }\n.#{$ionicons-prefix}crop:before { content: $ionicon-var-crop; }\n.#{$ionicons-prefix}cube:before { content: $ionicon-var-cube; }\n.#{$ionicons-prefix}disc:before { content: $ionicon-var-disc; }\n.#{$ionicons-prefix}document:before { content: $ionicon-var-document; }\n.#{$ionicons-prefix}document-text:before { content: $ionicon-var-document-text; }\n.#{$ionicons-prefix}drag:before { content: $ionicon-var-drag; }\n.#{$ionicons-prefix}earth:before { content: $ionicon-var-earth; }\n.#{$ionicons-prefix}easel:before { content: $ionicon-var-easel; }\n.#{$ionicons-prefix}edit:before { content: $ionicon-var-edit; }\n.#{$ionicons-prefix}egg:before { content: $ionicon-var-egg; }\n.#{$ionicons-prefix}eject:before { content: $ionicon-var-eject; }\n.#{$ionicons-prefix}email:before { content: $ionicon-var-email; }\n.#{$ionicons-prefix}email-unread:before { content: $ionicon-var-email-unread; }\n.#{$ionicons-prefix}erlenmeyer-flask:before { content: $ionicon-var-erlenmeyer-flask; }\n.#{$ionicons-prefix}erlenmeyer-flask-bubbles:before { content: $ionicon-var-erlenmeyer-flask-bubbles; }\n.#{$ionicons-prefix}eye:before { content: $ionicon-var-eye; }\n.#{$ionicons-prefix}eye-disabled:before { content: $ionicon-var-eye-disabled; }\n.#{$ionicons-prefix}female:before { content: $ionicon-var-female; }\n.#{$ionicons-prefix}filing:before { content: $ionicon-var-filing; }\n.#{$ionicons-prefix}film-marker:before { content: $ionicon-var-film-marker; }\n.#{$ionicons-prefix}fireball:before { content: $ionicon-var-fireball; }\n.#{$ionicons-prefix}flag:before { content: $ionicon-var-flag; }\n.#{$ionicons-prefix}flame:before { content: $ionicon-var-flame; }\n.#{$ionicons-prefix}flash:before { content: $ionicon-var-flash; }\n.#{$ionicons-prefix}flash-off:before { content: $ionicon-var-flash-off; }\n.#{$ionicons-prefix}folder:before { content: $ionicon-var-folder; }\n.#{$ionicons-prefix}fork:before { content: $ionicon-var-fork; }\n.#{$ionicons-prefix}fork-repo:before { content: $ionicon-var-fork-repo; }\n.#{$ionicons-prefix}forward:before { content: $ionicon-var-forward; }\n.#{$ionicons-prefix}funnel:before { content: $ionicon-var-funnel; }\n.#{$ionicons-prefix}gear-a:before { content: $ionicon-var-gear-a; }\n.#{$ionicons-prefix}gear-b:before { content: $ionicon-var-gear-b; }\n.#{$ionicons-prefix}grid:before { content: $ionicon-var-grid; }\n.#{$ionicons-prefix}hammer:before { content: $ionicon-var-hammer; }\n.#{$ionicons-prefix}happy:before { content: $ionicon-var-happy; }\n.#{$ionicons-prefix}happy-outline:before { content: $ionicon-var-happy-outline; }\n.#{$ionicons-prefix}headphone:before { content: $ionicon-var-headphone; }\n.#{$ionicons-prefix}heart:before { content: $ionicon-var-heart; }\n.#{$ionicons-prefix}heart-broken:before { content: $ionicon-var-heart-broken; }\n.#{$ionicons-prefix}help:before { content: $ionicon-var-help; }\n.#{$ionicons-prefix}help-buoy:before { content: $ionicon-var-help-buoy; }\n.#{$ionicons-prefix}help-circled:before { content: $ionicon-var-help-circled; }\n.#{$ionicons-prefix}home:before { content: $ionicon-var-home; }\n.#{$ionicons-prefix}icecream:before { content: $ionicon-var-icecream; }\n.#{$ionicons-prefix}image:before { content: $ionicon-var-image; }\n.#{$ionicons-prefix}images:before { content: $ionicon-var-images; }\n.#{$ionicons-prefix}information:before { content: $ionicon-var-information; }\n.#{$ionicons-prefix}information-circled:before { content: $ionicon-var-information-circled; }\n.#{$ionicons-prefix}ionic:before { content: $ionicon-var-ionic; }\n.#{$ionicons-prefix}ios-alarm:before { content: $ionicon-var-ios-alarm; }\n.#{$ionicons-prefix}ios-alarm-outline:before { content: $ionicon-var-ios-alarm-outline; }\n.#{$ionicons-prefix}ios-albums:before { content: $ionicon-var-ios-albums; }\n.#{$ionicons-prefix}ios-albums-outline:before { content: $ionicon-var-ios-albums-outline; }\n.#{$ionicons-prefix}ios-americanfootball:before { content: $ionicon-var-ios-americanfootball; }\n.#{$ionicons-prefix}ios-americanfootball-outline:before { content: $ionicon-var-ios-americanfootball-outline; }\n.#{$ionicons-prefix}ios-analytics:before { content: $ionicon-var-ios-analytics; }\n.#{$ionicons-prefix}ios-analytics-outline:before { content: $ionicon-var-ios-analytics-outline; }\n.#{$ionicons-prefix}ios-arrow-back:before { content: $ionicon-var-ios-arrow-back; }\n.#{$ionicons-prefix}ios-arrow-down:before { content: $ionicon-var-ios-arrow-down; }\n.#{$ionicons-prefix}ios-arrow-forward:before { content: $ionicon-var-ios-arrow-forward; }\n.#{$ionicons-prefix}ios-arrow-left:before { content: $ionicon-var-ios-arrow-left; }\n.#{$ionicons-prefix}ios-arrow-right:before { content: $ionicon-var-ios-arrow-right; }\n.#{$ionicons-prefix}ios-arrow-thin-down:before { content: $ionicon-var-ios-arrow-thin-down; }\n.#{$ionicons-prefix}ios-arrow-thin-left:before { content: $ionicon-var-ios-arrow-thin-left; }\n.#{$ionicons-prefix}ios-arrow-thin-right:before { content: $ionicon-var-ios-arrow-thin-right; }\n.#{$ionicons-prefix}ios-arrow-thin-up:before { content: $ionicon-var-ios-arrow-thin-up; }\n.#{$ionicons-prefix}ios-arrow-up:before { content: $ionicon-var-ios-arrow-up; }\n.#{$ionicons-prefix}ios-at:before { content: $ionicon-var-ios-at; }\n.#{$ionicons-prefix}ios-at-outline:before { content: $ionicon-var-ios-at-outline; }\n.#{$ionicons-prefix}ios-barcode:before { content: $ionicon-var-ios-barcode; }\n.#{$ionicons-prefix}ios-barcode-outline:before { content: $ionicon-var-ios-barcode-outline; }\n.#{$ionicons-prefix}ios-baseball:before { content: $ionicon-var-ios-baseball; }\n.#{$ionicons-prefix}ios-baseball-outline:before { content: $ionicon-var-ios-baseball-outline; }\n.#{$ionicons-prefix}ios-basketball:before { content: $ionicon-var-ios-basketball; }\n.#{$ionicons-prefix}ios-basketball-outline:before { content: $ionicon-var-ios-basketball-outline; }\n.#{$ionicons-prefix}ios-bell:before { content: $ionicon-var-ios-bell; }\n.#{$ionicons-prefix}ios-bell-outline:before { content: $ionicon-var-ios-bell-outline; }\n.#{$ionicons-prefix}ios-body:before { content: $ionicon-var-ios-body; }\n.#{$ionicons-prefix}ios-body-outline:before { content: $ionicon-var-ios-body-outline; }\n.#{$ionicons-prefix}ios-bolt:before { content: $ionicon-var-ios-bolt; }\n.#{$ionicons-prefix}ios-bolt-outline:before { content: $ionicon-var-ios-bolt-outline; }\n.#{$ionicons-prefix}ios-book:before { content: $ionicon-var-ios-book; }\n.#{$ionicons-prefix}ios-book-outline:before { content: $ionicon-var-ios-book-outline; }\n.#{$ionicons-prefix}ios-bookmarks:before { content: $ionicon-var-ios-bookmarks; }\n.#{$ionicons-prefix}ios-bookmarks-outline:before { content: $ionicon-var-ios-bookmarks-outline; }\n.#{$ionicons-prefix}ios-box:before { content: $ionicon-var-ios-box; }\n.#{$ionicons-prefix}ios-box-outline:before { content: $ionicon-var-ios-box-outline; }\n.#{$ionicons-prefix}ios-briefcase:before { content: $ionicon-var-ios-briefcase; }\n.#{$ionicons-prefix}ios-briefcase-outline:before { content: $ionicon-var-ios-briefcase-outline; }\n.#{$ionicons-prefix}ios-browsers:before { content: $ionicon-var-ios-browsers; }\n.#{$ionicons-prefix}ios-browsers-outline:before { content: $ionicon-var-ios-browsers-outline; }\n.#{$ionicons-prefix}ios-calculator:before { content: $ionicon-var-ios-calculator; }\n.#{$ionicons-prefix}ios-calculator-outline:before { content: $ionicon-var-ios-calculator-outline; }\n.#{$ionicons-prefix}ios-calendar:before { content: $ionicon-var-ios-calendar; }\n.#{$ionicons-prefix}ios-calendar-outline:before { content: $ionicon-var-ios-calendar-outline; }\n.#{$ionicons-prefix}ios-camera:before { content: $ionicon-var-ios-camera; }\n.#{$ionicons-prefix}ios-camera-outline:before { content: $ionicon-var-ios-camera-outline; }\n.#{$ionicons-prefix}ios-cart:before { content: $ionicon-var-ios-cart; }\n.#{$ionicons-prefix}ios-cart-outline:before { content: $ionicon-var-ios-cart-outline; }\n.#{$ionicons-prefix}ios-chatboxes:before { content: $ionicon-var-ios-chatboxes; }\n.#{$ionicons-prefix}ios-chatboxes-outline:before { content: $ionicon-var-ios-chatboxes-outline; }\n.#{$ionicons-prefix}ios-chatbubble:before { content: $ionicon-var-ios-chatbubble; }\n.#{$ionicons-prefix}ios-chatbubble-outline:before { content: $ionicon-var-ios-chatbubble-outline; }\n.#{$ionicons-prefix}ios-checkmark:before { content: $ionicon-var-ios-checkmark; }\n.#{$ionicons-prefix}ios-checkmark-empty:before { content: $ionicon-var-ios-checkmark-empty; }\n.#{$ionicons-prefix}ios-checkmark-outline:before { content: $ionicon-var-ios-checkmark-outline; }\n.#{$ionicons-prefix}ios-circle-filled:before { content: $ionicon-var-ios-circle-filled; }\n.#{$ionicons-prefix}ios-circle-outline:before { content: $ionicon-var-ios-circle-outline; }\n.#{$ionicons-prefix}ios-clock:before { content: $ionicon-var-ios-clock; }\n.#{$ionicons-prefix}ios-clock-outline:before { content: $ionicon-var-ios-clock-outline; }\n.#{$ionicons-prefix}ios-close:before { content: $ionicon-var-ios-close; }\n.#{$ionicons-prefix}ios-close-empty:before { content: $ionicon-var-ios-close-empty; }\n.#{$ionicons-prefix}ios-close-outline:before { content: $ionicon-var-ios-close-outline; }\n.#{$ionicons-prefix}ios-cloud:before { content: $ionicon-var-ios-cloud; }\n.#{$ionicons-prefix}ios-cloud-download:before { content: $ionicon-var-ios-cloud-download; }\n.#{$ionicons-prefix}ios-cloud-download-outline:before { content: $ionicon-var-ios-cloud-download-outline; }\n.#{$ionicons-prefix}ios-cloud-outline:before { content: $ionicon-var-ios-cloud-outline; }\n.#{$ionicons-prefix}ios-cloud-upload:before { content: $ionicon-var-ios-cloud-upload; }\n.#{$ionicons-prefix}ios-cloud-upload-outline:before { content: $ionicon-var-ios-cloud-upload-outline; }\n.#{$ionicons-prefix}ios-cloudy:before { content: $ionicon-var-ios-cloudy; }\n.#{$ionicons-prefix}ios-cloudy-night:before { content: $ionicon-var-ios-cloudy-night; }\n.#{$ionicons-prefix}ios-cloudy-night-outline:before { content: $ionicon-var-ios-cloudy-night-outline; }\n.#{$ionicons-prefix}ios-cloudy-outline:before { content: $ionicon-var-ios-cloudy-outline; }\n.#{$ionicons-prefix}ios-cog:before { content: $ionicon-var-ios-cog; }\n.#{$ionicons-prefix}ios-cog-outline:before { content: $ionicon-var-ios-cog-outline; }\n.#{$ionicons-prefix}ios-color-filter:before { content: $ionicon-var-ios-color-filter; }\n.#{$ionicons-prefix}ios-color-filter-outline:before { content: $ionicon-var-ios-color-filter-outline; }\n.#{$ionicons-prefix}ios-color-wand:before { content: $ionicon-var-ios-color-wand; }\n.#{$ionicons-prefix}ios-color-wand-outline:before { content: $ionicon-var-ios-color-wand-outline; }\n.#{$ionicons-prefix}ios-compose:before { content: $ionicon-var-ios-compose; }\n.#{$ionicons-prefix}ios-compose-outline:before { content: $ionicon-var-ios-compose-outline; }\n.#{$ionicons-prefix}ios-contact:before { content: $ionicon-var-ios-contact; }\n.#{$ionicons-prefix}ios-contact-outline:before { content: $ionicon-var-ios-contact-outline; }\n.#{$ionicons-prefix}ios-copy:before { content: $ionicon-var-ios-copy; }\n.#{$ionicons-prefix}ios-copy-outline:before { content: $ionicon-var-ios-copy-outline; }\n.#{$ionicons-prefix}ios-crop:before { content: $ionicon-var-ios-crop; }\n.#{$ionicons-prefix}ios-crop-strong:before { content: $ionicon-var-ios-crop-strong; }\n.#{$ionicons-prefix}ios-download:before { content: $ionicon-var-ios-download; }\n.#{$ionicons-prefix}ios-download-outline:before { content: $ionicon-var-ios-download-outline; }\n.#{$ionicons-prefix}ios-drag:before { content: $ionicon-var-ios-drag; }\n.#{$ionicons-prefix}ios-email:before { content: $ionicon-var-ios-email; }\n.#{$ionicons-prefix}ios-email-outline:before { content: $ionicon-var-ios-email-outline; }\n.#{$ionicons-prefix}ios-eye:before { content: $ionicon-var-ios-eye; }\n.#{$ionicons-prefix}ios-eye-outline:before { content: $ionicon-var-ios-eye-outline; }\n.#{$ionicons-prefix}ios-fastforward:before { content: $ionicon-var-ios-fastforward; }\n.#{$ionicons-prefix}ios-fastforward-outline:before { content: $ionicon-var-ios-fastforward-outline; }\n.#{$ionicons-prefix}ios-filing:before { content: $ionicon-var-ios-filing; }\n.#{$ionicons-prefix}ios-filing-outline:before { content: $ionicon-var-ios-filing-outline; }\n.#{$ionicons-prefix}ios-film:before { content: $ionicon-var-ios-film; }\n.#{$ionicons-prefix}ios-film-outline:before { content: $ionicon-var-ios-film-outline; }\n.#{$ionicons-prefix}ios-flag:before { content: $ionicon-var-ios-flag; }\n.#{$ionicons-prefix}ios-flag-outline:before { content: $ionicon-var-ios-flag-outline; }\n.#{$ionicons-prefix}ios-flame:before { content: $ionicon-var-ios-flame; }\n.#{$ionicons-prefix}ios-flame-outline:before { content: $ionicon-var-ios-flame-outline; }\n.#{$ionicons-prefix}ios-flask:before { content: $ionicon-var-ios-flask; }\n.#{$ionicons-prefix}ios-flask-outline:before { content: $ionicon-var-ios-flask-outline; }\n.#{$ionicons-prefix}ios-flower:before { content: $ionicon-var-ios-flower; }\n.#{$ionicons-prefix}ios-flower-outline:before { content: $ionicon-var-ios-flower-outline; }\n.#{$ionicons-prefix}ios-folder:before { content: $ionicon-var-ios-folder; }\n.#{$ionicons-prefix}ios-folder-outline:before { content: $ionicon-var-ios-folder-outline; }\n.#{$ionicons-prefix}ios-football:before { content: $ionicon-var-ios-football; }\n.#{$ionicons-prefix}ios-football-outline:before { content: $ionicon-var-ios-football-outline; }\n.#{$ionicons-prefix}ios-game-controller-a:before { content: $ionicon-var-ios-game-controller-a; }\n.#{$ionicons-prefix}ios-game-controller-a-outline:before { content: $ionicon-var-ios-game-controller-a-outline; }\n.#{$ionicons-prefix}ios-game-controller-b:before { content: $ionicon-var-ios-game-controller-b; }\n.#{$ionicons-prefix}ios-game-controller-b-outline:before { content: $ionicon-var-ios-game-controller-b-outline; }\n.#{$ionicons-prefix}ios-gear:before { content: $ionicon-var-ios-gear; }\n.#{$ionicons-prefix}ios-gear-outline:before { content: $ionicon-var-ios-gear-outline; }\n.#{$ionicons-prefix}ios-glasses:before { content: $ionicon-var-ios-glasses; }\n.#{$ionicons-prefix}ios-glasses-outline:before { content: $ionicon-var-ios-glasses-outline; }\n.#{$ionicons-prefix}ios-grid-view:before { content: $ionicon-var-ios-grid-view; }\n.#{$ionicons-prefix}ios-grid-view-outline:before { content: $ionicon-var-ios-grid-view-outline; }\n.#{$ionicons-prefix}ios-heart:before { content: $ionicon-var-ios-heart; }\n.#{$ionicons-prefix}ios-heart-outline:before { content: $ionicon-var-ios-heart-outline; }\n.#{$ionicons-prefix}ios-help:before { content: $ionicon-var-ios-help; }\n.#{$ionicons-prefix}ios-help-empty:before { content: $ionicon-var-ios-help-empty; }\n.#{$ionicons-prefix}ios-help-outline:before { content: $ionicon-var-ios-help-outline; }\n.#{$ionicons-prefix}ios-home:before { content: $ionicon-var-ios-home; }\n.#{$ionicons-prefix}ios-home-outline:before { content: $ionicon-var-ios-home-outline; }\n.#{$ionicons-prefix}ios-infinite:before { content: $ionicon-var-ios-infinite; }\n.#{$ionicons-prefix}ios-infinite-outline:before { content: $ionicon-var-ios-infinite-outline; }\n.#{$ionicons-prefix}ios-information:before { content: $ionicon-var-ios-information; }\n.#{$ionicons-prefix}ios-information-empty:before { content: $ionicon-var-ios-information-empty; }\n.#{$ionicons-prefix}ios-information-outline:before { content: $ionicon-var-ios-information-outline; }\n.#{$ionicons-prefix}ios-ionic-outline:before { content: $ionicon-var-ios-ionic-outline; }\n.#{$ionicons-prefix}ios-keypad:before { content: $ionicon-var-ios-keypad; }\n.#{$ionicons-prefix}ios-keypad-outline:before { content: $ionicon-var-ios-keypad-outline; }\n.#{$ionicons-prefix}ios-lightbulb:before { content: $ionicon-var-ios-lightbulb; }\n.#{$ionicons-prefix}ios-lightbulb-outline:before { content: $ionicon-var-ios-lightbulb-outline; }\n.#{$ionicons-prefix}ios-list:before { content: $ionicon-var-ios-list; }\n.#{$ionicons-prefix}ios-list-outline:before { content: $ionicon-var-ios-list-outline; }\n.#{$ionicons-prefix}ios-location:before { content: $ionicon-var-ios-location; }\n.#{$ionicons-prefix}ios-location-outline:before { content: $ionicon-var-ios-location-outline; }\n.#{$ionicons-prefix}ios-locked:before { content: $ionicon-var-ios-locked; }\n.#{$ionicons-prefix}ios-locked-outline:before { content: $ionicon-var-ios-locked-outline; }\n.#{$ionicons-prefix}ios-loop:before { content: $ionicon-var-ios-loop; }\n.#{$ionicons-prefix}ios-loop-strong:before { content: $ionicon-var-ios-loop-strong; }\n.#{$ionicons-prefix}ios-medical:before { content: $ionicon-var-ios-medical; }\n.#{$ionicons-prefix}ios-medical-outline:before { content: $ionicon-var-ios-medical-outline; }\n.#{$ionicons-prefix}ios-medkit:before { content: $ionicon-var-ios-medkit; }\n.#{$ionicons-prefix}ios-medkit-outline:before { content: $ionicon-var-ios-medkit-outline; }\n.#{$ionicons-prefix}ios-mic:before { content: $ionicon-var-ios-mic; }\n.#{$ionicons-prefix}ios-mic-off:before { content: $ionicon-var-ios-mic-off; }\n.#{$ionicons-prefix}ios-mic-outline:before { content: $ionicon-var-ios-mic-outline; }\n.#{$ionicons-prefix}ios-minus:before { content: $ionicon-var-ios-minus; }\n.#{$ionicons-prefix}ios-minus-empty:before { content: $ionicon-var-ios-minus-empty; }\n.#{$ionicons-prefix}ios-minus-outline:before { content: $ionicon-var-ios-minus-outline; }\n.#{$ionicons-prefix}ios-monitor:before { content: $ionicon-var-ios-monitor; }\n.#{$ionicons-prefix}ios-monitor-outline:before { content: $ionicon-var-ios-monitor-outline; }\n.#{$ionicons-prefix}ios-moon:before { content: $ionicon-var-ios-moon; }\n.#{$ionicons-prefix}ios-moon-outline:before { content: $ionicon-var-ios-moon-outline; }\n.#{$ionicons-prefix}ios-more:before { content: $ionicon-var-ios-more; }\n.#{$ionicons-prefix}ios-more-outline:before { content: $ionicon-var-ios-more-outline; }\n.#{$ionicons-prefix}ios-musical-note:before { content: $ionicon-var-ios-musical-note; }\n.#{$ionicons-prefix}ios-musical-notes:before { content: $ionicon-var-ios-musical-notes; }\n.#{$ionicons-prefix}ios-navigate:before { content: $ionicon-var-ios-navigate; }\n.#{$ionicons-prefix}ios-navigate-outline:before { content: $ionicon-var-ios-navigate-outline; }\n.#{$ionicons-prefix}ios-nutrition:before { content: $ionicon-var-ios-nutrition; }\n.#{$ionicons-prefix}ios-nutrition-outline:before { content: $ionicon-var-ios-nutrition-outline; }\n.#{$ionicons-prefix}ios-paper:before { content: $ionicon-var-ios-paper; }\n.#{$ionicons-prefix}ios-paper-outline:before { content: $ionicon-var-ios-paper-outline; }\n.#{$ionicons-prefix}ios-paperplane:before { content: $ionicon-var-ios-paperplane; }\n.#{$ionicons-prefix}ios-paperplane-outline:before { content: $ionicon-var-ios-paperplane-outline; }\n.#{$ionicons-prefix}ios-partlysunny:before { content: $ionicon-var-ios-partlysunny; }\n.#{$ionicons-prefix}ios-partlysunny-outline:before { content: $ionicon-var-ios-partlysunny-outline; }\n.#{$ionicons-prefix}ios-pause:before { content: $ionicon-var-ios-pause; }\n.#{$ionicons-prefix}ios-pause-outline:before { content: $ionicon-var-ios-pause-outline; }\n.#{$ionicons-prefix}ios-paw:before { content: $ionicon-var-ios-paw; }\n.#{$ionicons-prefix}ios-paw-outline:before { content: $ionicon-var-ios-paw-outline; }\n.#{$ionicons-prefix}ios-people:before { content: $ionicon-var-ios-people; }\n.#{$ionicons-prefix}ios-people-outline:before { content: $ionicon-var-ios-people-outline; }\n.#{$ionicons-prefix}ios-person:before { content: $ionicon-var-ios-person; }\n.#{$ionicons-prefix}ios-person-outline:before { content: $ionicon-var-ios-person-outline; }\n.#{$ionicons-prefix}ios-personadd:before { content: $ionicon-var-ios-personadd; }\n.#{$ionicons-prefix}ios-personadd-outline:before { content: $ionicon-var-ios-personadd-outline; }\n.#{$ionicons-prefix}ios-photos:before { content: $ionicon-var-ios-photos; }\n.#{$ionicons-prefix}ios-photos-outline:before { content: $ionicon-var-ios-photos-outline; }\n.#{$ionicons-prefix}ios-pie:before { content: $ionicon-var-ios-pie; }\n.#{$ionicons-prefix}ios-pie-outline:before { content: $ionicon-var-ios-pie-outline; }\n.#{$ionicons-prefix}ios-pint:before { content: $ionicon-var-ios-pint; }\n.#{$ionicons-prefix}ios-pint-outline:before { content: $ionicon-var-ios-pint-outline; }\n.#{$ionicons-prefix}ios-play:before { content: $ionicon-var-ios-play; }\n.#{$ionicons-prefix}ios-play-outline:before { content: $ionicon-var-ios-play-outline; }\n.#{$ionicons-prefix}ios-plus:before { content: $ionicon-var-ios-plus; }\n.#{$ionicons-prefix}ios-plus-empty:before { content: $ionicon-var-ios-plus-empty; }\n.#{$ionicons-prefix}ios-plus-outline:before { content: $ionicon-var-ios-plus-outline; }\n.#{$ionicons-prefix}ios-pricetag:before { content: $ionicon-var-ios-pricetag; }\n.#{$ionicons-prefix}ios-pricetag-outline:before { content: $ionicon-var-ios-pricetag-outline; }\n.#{$ionicons-prefix}ios-pricetags:before { content: $ionicon-var-ios-pricetags; }\n.#{$ionicons-prefix}ios-pricetags-outline:before { content: $ionicon-var-ios-pricetags-outline; }\n.#{$ionicons-prefix}ios-printer:before { content: $ionicon-var-ios-printer; }\n.#{$ionicons-prefix}ios-printer-outline:before { content: $ionicon-var-ios-printer-outline; }\n.#{$ionicons-prefix}ios-pulse:before { content: $ionicon-var-ios-pulse; }\n.#{$ionicons-prefix}ios-pulse-strong:before { content: $ionicon-var-ios-pulse-strong; }\n.#{$ionicons-prefix}ios-rainy:before { content: $ionicon-var-ios-rainy; }\n.#{$ionicons-prefix}ios-rainy-outline:before { content: $ionicon-var-ios-rainy-outline; }\n.#{$ionicons-prefix}ios-recording:before { content: $ionicon-var-ios-recording; }\n.#{$ionicons-prefix}ios-recording-outline:before { content: $ionicon-var-ios-recording-outline; }\n.#{$ionicons-prefix}ios-redo:before { content: $ionicon-var-ios-redo; }\n.#{$ionicons-prefix}ios-redo-outline:before { content: $ionicon-var-ios-redo-outline; }\n.#{$ionicons-prefix}ios-refresh:before { content: $ionicon-var-ios-refresh; }\n.#{$ionicons-prefix}ios-refresh-empty:before { content: $ionicon-var-ios-refresh-empty; }\n.#{$ionicons-prefix}ios-refresh-outline:before { content: $ionicon-var-ios-refresh-outline; }\n.#{$ionicons-prefix}ios-reload:before { content: $ionicon-var-ios-reload; }\n.#{$ionicons-prefix}ios-reverse-camera:before { content: $ionicon-var-ios-reverse-camera; }\n.#{$ionicons-prefix}ios-reverse-camera-outline:before { content: $ionicon-var-ios-reverse-camera-outline; }\n.#{$ionicons-prefix}ios-rewind:before { content: $ionicon-var-ios-rewind; }\n.#{$ionicons-prefix}ios-rewind-outline:before { content: $ionicon-var-ios-rewind-outline; }\n.#{$ionicons-prefix}ios-rose:before { content: $ionicon-var-ios-rose; }\n.#{$ionicons-prefix}ios-rose-outline:before { content: $ionicon-var-ios-rose-outline; }\n.#{$ionicons-prefix}ios-search:before { content: $ionicon-var-ios-search; }\n.#{$ionicons-prefix}ios-search-strong:before { content: $ionicon-var-ios-search-strong; }\n.#{$ionicons-prefix}ios-settings:before { content: $ionicon-var-ios-settings; }\n.#{$ionicons-prefix}ios-settings-strong:before { content: $ionicon-var-ios-settings-strong; }\n.#{$ionicons-prefix}ios-shuffle:before { content: $ionicon-var-ios-shuffle; }\n.#{$ionicons-prefix}ios-shuffle-strong:before { content: $ionicon-var-ios-shuffle-strong; }\n.#{$ionicons-prefix}ios-skipbackward:before { content: $ionicon-var-ios-skipbackward; }\n.#{$ionicons-prefix}ios-skipbackward-outline:before { content: $ionicon-var-ios-skipbackward-outline; }\n.#{$ionicons-prefix}ios-skipforward:before { content: $ionicon-var-ios-skipforward; }\n.#{$ionicons-prefix}ios-skipforward-outline:before { content: $ionicon-var-ios-skipforward-outline; }\n.#{$ionicons-prefix}ios-snowy:before { content: $ionicon-var-ios-snowy; }\n.#{$ionicons-prefix}ios-speedometer:before { content: $ionicon-var-ios-speedometer; }\n.#{$ionicons-prefix}ios-speedometer-outline:before { content: $ionicon-var-ios-speedometer-outline; }\n.#{$ionicons-prefix}ios-star:before { content: $ionicon-var-ios-star; }\n.#{$ionicons-prefix}ios-star-half:before { content: $ionicon-var-ios-star-half; }\n.#{$ionicons-prefix}ios-star-outline:before { content: $ionicon-var-ios-star-outline; }\n.#{$ionicons-prefix}ios-stopwatch:before { content: $ionicon-var-ios-stopwatch; }\n.#{$ionicons-prefix}ios-stopwatch-outline:before { content: $ionicon-var-ios-stopwatch-outline; }\n.#{$ionicons-prefix}ios-sunny:before { content: $ionicon-var-ios-sunny; }\n.#{$ionicons-prefix}ios-sunny-outline:before { content: $ionicon-var-ios-sunny-outline; }\n.#{$ionicons-prefix}ios-telephone:before { content: $ionicon-var-ios-telephone; }\n.#{$ionicons-prefix}ios-telephone-outline:before { content: $ionicon-var-ios-telephone-outline; }\n.#{$ionicons-prefix}ios-tennisball:before { content: $ionicon-var-ios-tennisball; }\n.#{$ionicons-prefix}ios-tennisball-outline:before { content: $ionicon-var-ios-tennisball-outline; }\n.#{$ionicons-prefix}ios-thunderstorm:before { content: $ionicon-var-ios-thunderstorm; }\n.#{$ionicons-prefix}ios-thunderstorm-outline:before { content: $ionicon-var-ios-thunderstorm-outline; }\n.#{$ionicons-prefix}ios-time:before { content: $ionicon-var-ios-time; }\n.#{$ionicons-prefix}ios-time-outline:before { content: $ionicon-var-ios-time-outline; }\n.#{$ionicons-prefix}ios-timer:before { content: $ionicon-var-ios-timer; }\n.#{$ionicons-prefix}ios-timer-outline:before { content: $ionicon-var-ios-timer-outline; }\n.#{$ionicons-prefix}ios-toggle:before { content: $ionicon-var-ios-toggle; }\n.#{$ionicons-prefix}ios-toggle-outline:before { content: $ionicon-var-ios-toggle-outline; }\n.#{$ionicons-prefix}ios-trash:before { content: $ionicon-var-ios-trash; }\n.#{$ionicons-prefix}ios-trash-outline:before { content: $ionicon-var-ios-trash-outline; }\n.#{$ionicons-prefix}ios-undo:before { content: $ionicon-var-ios-undo; }\n.#{$ionicons-prefix}ios-undo-outline:before { content: $ionicon-var-ios-undo-outline; }\n.#{$ionicons-prefix}ios-unlocked:before { content: $ionicon-var-ios-unlocked; }\n.#{$ionicons-prefix}ios-unlocked-outline:before { content: $ionicon-var-ios-unlocked-outline; }\n.#{$ionicons-prefix}ios-upload:before { content: $ionicon-var-ios-upload; }\n.#{$ionicons-prefix}ios-upload-outline:before { content: $ionicon-var-ios-upload-outline; }\n.#{$ionicons-prefix}ios-videocam:before { content: $ionicon-var-ios-videocam; }\n.#{$ionicons-prefix}ios-videocam-outline:before { content: $ionicon-var-ios-videocam-outline; }\n.#{$ionicons-prefix}ios-volume-high:before { content: $ionicon-var-ios-volume-high; }\n.#{$ionicons-prefix}ios-volume-low:before { content: $ionicon-var-ios-volume-low; }\n.#{$ionicons-prefix}ios-wineglass:before { content: $ionicon-var-ios-wineglass; }\n.#{$ionicons-prefix}ios-wineglass-outline:before { content: $ionicon-var-ios-wineglass-outline; }\n.#{$ionicons-prefix}ios-world:before { content: $ionicon-var-ios-world; }\n.#{$ionicons-prefix}ios-world-outline:before { content: $ionicon-var-ios-world-outline; }\n.#{$ionicons-prefix}ipad:before { content: $ionicon-var-ipad; }\n.#{$ionicons-prefix}iphone:before { content: $ionicon-var-iphone; }\n.#{$ionicons-prefix}ipod:before { content: $ionicon-var-ipod; }\n.#{$ionicons-prefix}jet:before { content: $ionicon-var-jet; }\n.#{$ionicons-prefix}key:before { content: $ionicon-var-key; }\n.#{$ionicons-prefix}knife:before { content: $ionicon-var-knife; }\n.#{$ionicons-prefix}laptop:before { content: $ionicon-var-laptop; }\n.#{$ionicons-prefix}leaf:before { content: $ionicon-var-leaf; }\n.#{$ionicons-prefix}levels:before { content: $ionicon-var-levels; }\n.#{$ionicons-prefix}lightbulb:before { content: $ionicon-var-lightbulb; }\n.#{$ionicons-prefix}link:before { content: $ionicon-var-link; }\n.#{$ionicons-prefix}load-a:before { content: $ionicon-var-load-a; }\n.#{$ionicons-prefix}load-b:before { content: $ionicon-var-load-b; }\n.#{$ionicons-prefix}load-c:before { content: $ionicon-var-load-c; }\n.#{$ionicons-prefix}load-d:before { content: $ionicon-var-load-d; }\n.#{$ionicons-prefix}location:before { content: $ionicon-var-location; }\n.#{$ionicons-prefix}lock-combination:before { content: $ionicon-var-lock-combination; }\n.#{$ionicons-prefix}locked:before { content: $ionicon-var-locked; }\n.#{$ionicons-prefix}log-in:before { content: $ionicon-var-log-in; }\n.#{$ionicons-prefix}log-out:before { content: $ionicon-var-log-out; }\n.#{$ionicons-prefix}loop:before { content: $ionicon-var-loop; }\n.#{$ionicons-prefix}magnet:before { content: $ionicon-var-magnet; }\n.#{$ionicons-prefix}male:before { content: $ionicon-var-male; }\n.#{$ionicons-prefix}man:before { content: $ionicon-var-man; }\n.#{$ionicons-prefix}map:before { content: $ionicon-var-map; }\n.#{$ionicons-prefix}medkit:before { content: $ionicon-var-medkit; }\n.#{$ionicons-prefix}merge:before { content: $ionicon-var-merge; }\n.#{$ionicons-prefix}mic-a:before { content: $ionicon-var-mic-a; }\n.#{$ionicons-prefix}mic-b:before { content: $ionicon-var-mic-b; }\n.#{$ionicons-prefix}mic-c:before { content: $ionicon-var-mic-c; }\n.#{$ionicons-prefix}minus:before { content: $ionicon-var-minus; }\n.#{$ionicons-prefix}minus-circled:before { content: $ionicon-var-minus-circled; }\n.#{$ionicons-prefix}minus-round:before { content: $ionicon-var-minus-round; }\n.#{$ionicons-prefix}model-s:before { content: $ionicon-var-model-s; }\n.#{$ionicons-prefix}monitor:before { content: $ionicon-var-monitor; }\n.#{$ionicons-prefix}more:before { content: $ionicon-var-more; }\n.#{$ionicons-prefix}mouse:before { content: $ionicon-var-mouse; }\n.#{$ionicons-prefix}music-note:before { content: $ionicon-var-music-note; }\n.#{$ionicons-prefix}navicon:before { content: $ionicon-var-navicon; }\n.#{$ionicons-prefix}navicon-round:before { content: $ionicon-var-navicon-round; }\n.#{$ionicons-prefix}navigate:before { content: $ionicon-var-navigate; }\n.#{$ionicons-prefix}network:before { content: $ionicon-var-network; }\n.#{$ionicons-prefix}no-smoking:before { content: $ionicon-var-no-smoking; }\n.#{$ionicons-prefix}nuclear:before { content: $ionicon-var-nuclear; }\n.#{$ionicons-prefix}outlet:before { content: $ionicon-var-outlet; }\n.#{$ionicons-prefix}paintbrush:before { content: $ionicon-var-paintbrush; }\n.#{$ionicons-prefix}paintbucket:before { content: $ionicon-var-paintbucket; }\n.#{$ionicons-prefix}paper-airplane:before { content: $ionicon-var-paper-airplane; }\n.#{$ionicons-prefix}paperclip:before { content: $ionicon-var-paperclip; }\n.#{$ionicons-prefix}pause:before { content: $ionicon-var-pause; }\n.#{$ionicons-prefix}person:before { content: $ionicon-var-person; }\n.#{$ionicons-prefix}person-add:before { content: $ionicon-var-person-add; }\n.#{$ionicons-prefix}person-stalker:before { content: $ionicon-var-person-stalker; }\n.#{$ionicons-prefix}pie-graph:before { content: $ionicon-var-pie-graph; }\n.#{$ionicons-prefix}pin:before { content: $ionicon-var-pin; }\n.#{$ionicons-prefix}pinpoint:before { content: $ionicon-var-pinpoint; }\n.#{$ionicons-prefix}pizza:before { content: $ionicon-var-pizza; }\n.#{$ionicons-prefix}plane:before { content: $ionicon-var-plane; }\n.#{$ionicons-prefix}planet:before { content: $ionicon-var-planet; }\n.#{$ionicons-prefix}play:before { content: $ionicon-var-play; }\n.#{$ionicons-prefix}playstation:before { content: $ionicon-var-playstation; }\n.#{$ionicons-prefix}plus:before { content: $ionicon-var-plus; }\n.#{$ionicons-prefix}plus-circled:before { content: $ionicon-var-plus-circled; }\n.#{$ionicons-prefix}plus-round:before { content: $ionicon-var-plus-round; }\n.#{$ionicons-prefix}podium:before { content: $ionicon-var-podium; }\n.#{$ionicons-prefix}pound:before { content: $ionicon-var-pound; }\n.#{$ionicons-prefix}power:before { content: $ionicon-var-power; }\n.#{$ionicons-prefix}pricetag:before { content: $ionicon-var-pricetag; }\n.#{$ionicons-prefix}pricetags:before { content: $ionicon-var-pricetags; }\n.#{$ionicons-prefix}printer:before { content: $ionicon-var-printer; }\n.#{$ionicons-prefix}pull-request:before { content: $ionicon-var-pull-request; }\n.#{$ionicons-prefix}qr-scanner:before { content: $ionicon-var-qr-scanner; }\n.#{$ionicons-prefix}quote:before { content: $ionicon-var-quote; }\n.#{$ionicons-prefix}radio-waves:before { content: $ionicon-var-radio-waves; }\n.#{$ionicons-prefix}record:before { content: $ionicon-var-record; }\n.#{$ionicons-prefix}refresh:before { content: $ionicon-var-refresh; }\n.#{$ionicons-prefix}reply:before { content: $ionicon-var-reply; }\n.#{$ionicons-prefix}reply-all:before { content: $ionicon-var-reply-all; }\n.#{$ionicons-prefix}ribbon-a:before { content: $ionicon-var-ribbon-a; }\n.#{$ionicons-prefix}ribbon-b:before { content: $ionicon-var-ribbon-b; }\n.#{$ionicons-prefix}sad:before { content: $ionicon-var-sad; }\n.#{$ionicons-prefix}sad-outline:before { content: $ionicon-var-sad-outline; }\n.#{$ionicons-prefix}scissors:before { content: $ionicon-var-scissors; }\n.#{$ionicons-prefix}search:before { content: $ionicon-var-search; }\n.#{$ionicons-prefix}settings:before { content: $ionicon-var-settings; }\n.#{$ionicons-prefix}share:before { content: $ionicon-var-share; }\n.#{$ionicons-prefix}shuffle:before { content: $ionicon-var-shuffle; }\n.#{$ionicons-prefix}skip-backward:before { content: $ionicon-var-skip-backward; }\n.#{$ionicons-prefix}skip-forward:before { content: $ionicon-var-skip-forward; }\n.#{$ionicons-prefix}social-android:before { content: $ionicon-var-social-android; }\n.#{$ionicons-prefix}social-android-outline:before { content: $ionicon-var-social-android-outline; }\n.#{$ionicons-prefix}social-angular:before { content: $ionicon-var-social-angular; }\n.#{$ionicons-prefix}social-angular-outline:before { content: $ionicon-var-social-angular-outline; }\n.#{$ionicons-prefix}social-apple:before { content: $ionicon-var-social-apple; }\n.#{$ionicons-prefix}social-apple-outline:before { content: $ionicon-var-social-apple-outline; }\n.#{$ionicons-prefix}social-bitcoin:before { content: $ionicon-var-social-bitcoin; }\n.#{$ionicons-prefix}social-bitcoin-outline:before { content: $ionicon-var-social-bitcoin-outline; }\n.#{$ionicons-prefix}social-buffer:before { content: $ionicon-var-social-buffer; }\n.#{$ionicons-prefix}social-buffer-outline:before { content: $ionicon-var-social-buffer-outline; }\n.#{$ionicons-prefix}social-chrome:before { content: $ionicon-var-social-chrome; }\n.#{$ionicons-prefix}social-chrome-outline:before { content: $ionicon-var-social-chrome-outline; }\n.#{$ionicons-prefix}social-codepen:before { content: $ionicon-var-social-codepen; }\n.#{$ionicons-prefix}social-codepen-outline:before { content: $ionicon-var-social-codepen-outline; }\n.#{$ionicons-prefix}social-css3:before { content: $ionicon-var-social-css3; }\n.#{$ionicons-prefix}social-css3-outline:before { content: $ionicon-var-social-css3-outline; }\n.#{$ionicons-prefix}social-designernews:before { content: $ionicon-var-social-designernews; }\n.#{$ionicons-prefix}social-designernews-outline:before { content: $ionicon-var-social-designernews-outline; }\n.#{$ionicons-prefix}social-dribbble:before { content: $ionicon-var-social-dribbble; }\n.#{$ionicons-prefix}social-dribbble-outline:before { content: $ionicon-var-social-dribbble-outline; }\n.#{$ionicons-prefix}social-dropbox:before { content: $ionicon-var-social-dropbox; }\n.#{$ionicons-prefix}social-dropbox-outline:before { content: $ionicon-var-social-dropbox-outline; }\n.#{$ionicons-prefix}social-euro:before { content: $ionicon-var-social-euro; }\n.#{$ionicons-prefix}social-euro-outline:before { content: $ionicon-var-social-euro-outline; }\n.#{$ionicons-prefix}social-facebook:before { content: $ionicon-var-social-facebook; }\n.#{$ionicons-prefix}social-facebook-outline:before { content: $ionicon-var-social-facebook-outline; }\n.#{$ionicons-prefix}social-foursquare:before { content: $ionicon-var-social-foursquare; }\n.#{$ionicons-prefix}social-foursquare-outline:before { content: $ionicon-var-social-foursquare-outline; }\n.#{$ionicons-prefix}social-freebsd-devil:before { content: $ionicon-var-social-freebsd-devil; }\n.#{$ionicons-prefix}social-github:before { content: $ionicon-var-social-github; }\n.#{$ionicons-prefix}social-github-outline:before { content: $ionicon-var-social-github-outline; }\n.#{$ionicons-prefix}social-google:before { content: $ionicon-var-social-google; }\n.#{$ionicons-prefix}social-google-outline:before { content: $ionicon-var-social-google-outline; }\n.#{$ionicons-prefix}social-googleplus:before { content: $ionicon-var-social-googleplus; }\n.#{$ionicons-prefix}social-googleplus-outline:before { content: $ionicon-var-social-googleplus-outline; }\n.#{$ionicons-prefix}social-hackernews:before { content: $ionicon-var-social-hackernews; }\n.#{$ionicons-prefix}social-hackernews-outline:before { content: $ionicon-var-social-hackernews-outline; }\n.#{$ionicons-prefix}social-html5:before { content: $ionicon-var-social-html5; }\n.#{$ionicons-prefix}social-html5-outline:before { content: $ionicon-var-social-html5-outline; }\n.#{$ionicons-prefix}social-instagram:before { content: $ionicon-var-social-instagram; }\n.#{$ionicons-prefix}social-instagram-outline:before { content: $ionicon-var-social-instagram-outline; }\n.#{$ionicons-prefix}social-javascript:before { content: $ionicon-var-social-javascript; }\n.#{$ionicons-prefix}social-javascript-outline:before { content: $ionicon-var-social-javascript-outline; }\n.#{$ionicons-prefix}social-linkedin:before { content: $ionicon-var-social-linkedin; }\n.#{$ionicons-prefix}social-linkedin-outline:before { content: $ionicon-var-social-linkedin-outline; }\n.#{$ionicons-prefix}social-markdown:before { content: $ionicon-var-social-markdown; }\n.#{$ionicons-prefix}social-nodejs:before { content: $ionicon-var-social-nodejs; }\n.#{$ionicons-prefix}social-octocat:before { content: $ionicon-var-social-octocat; }\n.#{$ionicons-prefix}social-pinterest:before { content: $ionicon-var-social-pinterest; }\n.#{$ionicons-prefix}social-pinterest-outline:before { content: $ionicon-var-social-pinterest-outline; }\n.#{$ionicons-prefix}social-python:before { content: $ionicon-var-social-python; }\n.#{$ionicons-prefix}social-reddit:before { content: $ionicon-var-social-reddit; }\n.#{$ionicons-prefix}social-reddit-outline:before { content: $ionicon-var-social-reddit-outline; }\n.#{$ionicons-prefix}social-rss:before { content: $ionicon-var-social-rss; }\n.#{$ionicons-prefix}social-rss-outline:before { content: $ionicon-var-social-rss-outline; }\n.#{$ionicons-prefix}social-sass:before { content: $ionicon-var-social-sass; }\n.#{$ionicons-prefix}social-skype:before { content: $ionicon-var-social-skype; }\n.#{$ionicons-prefix}social-skype-outline:before { content: $ionicon-var-social-skype-outline; }\n.#{$ionicons-prefix}social-snapchat:before { content: $ionicon-var-social-snapchat; }\n.#{$ionicons-prefix}social-snapchat-outline:before { content: $ionicon-var-social-snapchat-outline; }\n.#{$ionicons-prefix}social-tumblr:before { content: $ionicon-var-social-tumblr; }\n.#{$ionicons-prefix}social-tumblr-outline:before { content: $ionicon-var-social-tumblr-outline; }\n.#{$ionicons-prefix}social-tux:before { content: $ionicon-var-social-tux; }\n.#{$ionicons-prefix}social-twitch:before { content: $ionicon-var-social-twitch; }\n.#{$ionicons-prefix}social-twitch-outline:before { content: $ionicon-var-social-twitch-outline; }\n.#{$ionicons-prefix}social-twitter:before { content: $ionicon-var-social-twitter; }\n.#{$ionicons-prefix}social-twitter-outline:before { content: $ionicon-var-social-twitter-outline; }\n.#{$ionicons-prefix}social-usd:before { content: $ionicon-var-social-usd; }\n.#{$ionicons-prefix}social-usd-outline:before { content: $ionicon-var-social-usd-outline; }\n.#{$ionicons-prefix}social-vimeo:before { content: $ionicon-var-social-vimeo; }\n.#{$ionicons-prefix}social-vimeo-outline:before { content: $ionicon-var-social-vimeo-outline; }\n.#{$ionicons-prefix}social-whatsapp:before { content: $ionicon-var-social-whatsapp; }\n.#{$ionicons-prefix}social-whatsapp-outline:before { content: $ionicon-var-social-whatsapp-outline; }\n.#{$ionicons-prefix}social-windows:before { content: $ionicon-var-social-windows; }\n.#{$ionicons-prefix}social-windows-outline:before { content: $ionicon-var-social-windows-outline; }\n.#{$ionicons-prefix}social-wordpress:before { content: $ionicon-var-social-wordpress; }\n.#{$ionicons-prefix}social-wordpress-outline:before { content: $ionicon-var-social-wordpress-outline; }\n.#{$ionicons-prefix}social-yahoo:before { content: $ionicon-var-social-yahoo; }\n.#{$ionicons-prefix}social-yahoo-outline:before { content: $ionicon-var-social-yahoo-outline; }\n.#{$ionicons-prefix}social-yen:before { content: $ionicon-var-social-yen; }\n.#{$ionicons-prefix}social-yen-outline:before { content: $ionicon-var-social-yen-outline; }\n.#{$ionicons-prefix}social-youtube:before { content: $ionicon-var-social-youtube; }\n.#{$ionicons-prefix}social-youtube-outline:before { content: $ionicon-var-social-youtube-outline; }\n.#{$ionicons-prefix}soup-can:before { content: $ionicon-var-soup-can; }\n.#{$ionicons-prefix}soup-can-outline:before { content: $ionicon-var-soup-can-outline; }\n.#{$ionicons-prefix}speakerphone:before { content: $ionicon-var-speakerphone; }\n.#{$ionicons-prefix}speedometer:before { content: $ionicon-var-speedometer; }\n.#{$ionicons-prefix}spoon:before { content: $ionicon-var-spoon; }\n.#{$ionicons-prefix}star:before { content: $ionicon-var-star; }\n.#{$ionicons-prefix}stats-bars:before { content: $ionicon-var-stats-bars; }\n.#{$ionicons-prefix}steam:before { content: $ionicon-var-steam; }\n.#{$ionicons-prefix}stop:before { content: $ionicon-var-stop; }\n.#{$ionicons-prefix}thermometer:before { content: $ionicon-var-thermometer; }\n.#{$ionicons-prefix}thumbsdown:before { content: $ionicon-var-thumbsdown; }\n.#{$ionicons-prefix}thumbsup:before { content: $ionicon-var-thumbsup; }\n.#{$ionicons-prefix}toggle:before { content: $ionicon-var-toggle; }\n.#{$ionicons-prefix}toggle-filled:before { content: $ionicon-var-toggle-filled; }\n.#{$ionicons-prefix}transgender:before { content: $ionicon-var-transgender; }\n.#{$ionicons-prefix}trash-a:before { content: $ionicon-var-trash-a; }\n.#{$ionicons-prefix}trash-b:before { content: $ionicon-var-trash-b; }\n.#{$ionicons-prefix}trophy:before { content: $ionicon-var-trophy; }\n.#{$ionicons-prefix}tshirt:before { content: $ionicon-var-tshirt; }\n.#{$ionicons-prefix}tshirt-outline:before { content: $ionicon-var-tshirt-outline; }\n.#{$ionicons-prefix}umbrella:before { content: $ionicon-var-umbrella; }\n.#{$ionicons-prefix}university:before { content: $ionicon-var-university; }\n.#{$ionicons-prefix}unlocked:before { content: $ionicon-var-unlocked; }\n.#{$ionicons-prefix}upload:before { content: $ionicon-var-upload; }\n.#{$ionicons-prefix}usb:before { content: $ionicon-var-usb; }\n.#{$ionicons-prefix}videocamera:before { content: $ionicon-var-videocamera; }\n.#{$ionicons-prefix}volume-high:before { content: $ionicon-var-volume-high; }\n.#{$ionicons-prefix}volume-low:before { content: $ionicon-var-volume-low; }\n.#{$ionicons-prefix}volume-medium:before { content: $ionicon-var-volume-medium; }\n.#{$ionicons-prefix}volume-mute:before { content: $ionicon-var-volume-mute; }\n.#{$ionicons-prefix}wand:before { content: $ionicon-var-wand; }\n.#{$ionicons-prefix}waterdrop:before { content: $ionicon-var-waterdrop; }\n.#{$ionicons-prefix}wifi:before { content: $ionicon-var-wifi; }\n.#{$ionicons-prefix}wineglass:before { content: $ionicon-var-wineglass; }\n.#{$ionicons-prefix}woman:before { content: $ionicon-var-woman; }\n.#{$ionicons-prefix}wrench:before { content: $ionicon-var-wrench; }\n.#{$ionicons-prefix}xbox:before { content: $ionicon-var-xbox; }"
  },
  {
    "path": "www/lib/ionic/scss/ionicons/_ionicons-variables.scss",
    "content": "// Ionicons Variables\n// --------------------------\n\n$ionicons-font-path: \"../fonts\" !default;\n$ionicons-font-family: \"Ionicons\" !default;\n$ionicons-version: \"2.0.1\" !default;\n$ionicons-prefix: ion- !default;\n\n$ionicon-var-alert: \"\\f101\";\n$ionicon-var-alert-circled: \"\\f100\";\n$ionicon-var-android-add: \"\\f2c7\";\n$ionicon-var-android-add-circle: \"\\f359\";\n$ionicon-var-android-alarm-clock: \"\\f35a\";\n$ionicon-var-android-alert: \"\\f35b\";\n$ionicon-var-android-apps: \"\\f35c\";\n$ionicon-var-android-archive: \"\\f2c9\";\n$ionicon-var-android-arrow-back: \"\\f2ca\";\n$ionicon-var-android-arrow-down: \"\\f35d\";\n$ionicon-var-android-arrow-dropdown: \"\\f35f\";\n$ionicon-var-android-arrow-dropdown-circle: \"\\f35e\";\n$ionicon-var-android-arrow-dropleft: \"\\f361\";\n$ionicon-var-android-arrow-dropleft-circle: \"\\f360\";\n$ionicon-var-android-arrow-dropright: \"\\f363\";\n$ionicon-var-android-arrow-dropright-circle: \"\\f362\";\n$ionicon-var-android-arrow-dropup: \"\\f365\";\n$ionicon-var-android-arrow-dropup-circle: \"\\f364\";\n$ionicon-var-android-arrow-forward: \"\\f30f\";\n$ionicon-var-android-arrow-up: \"\\f366\";\n$ionicon-var-android-attach: \"\\f367\";\n$ionicon-var-android-bar: \"\\f368\";\n$ionicon-var-android-bicycle: \"\\f369\";\n$ionicon-var-android-boat: \"\\f36a\";\n$ionicon-var-android-bookmark: \"\\f36b\";\n$ionicon-var-android-bulb: \"\\f36c\";\n$ionicon-var-android-bus: \"\\f36d\";\n$ionicon-var-android-calendar: \"\\f2d1\";\n$ionicon-var-android-call: \"\\f2d2\";\n$ionicon-var-android-camera: \"\\f2d3\";\n$ionicon-var-android-cancel: \"\\f36e\";\n$ionicon-var-android-car: \"\\f36f\";\n$ionicon-var-android-cart: \"\\f370\";\n$ionicon-var-android-chat: \"\\f2d4\";\n$ionicon-var-android-checkbox: \"\\f374\";\n$ionicon-var-android-checkbox-blank: \"\\f371\";\n$ionicon-var-android-checkbox-outline: \"\\f373\";\n$ionicon-var-android-checkbox-outline-blank: \"\\f372\";\n$ionicon-var-android-checkmark-circle: \"\\f375\";\n$ionicon-var-android-clipboard: \"\\f376\";\n$ionicon-var-android-close: \"\\f2d7\";\n$ionicon-var-android-cloud: \"\\f37a\";\n$ionicon-var-android-cloud-circle: \"\\f377\";\n$ionicon-var-android-cloud-done: \"\\f378\";\n$ionicon-var-android-cloud-outline: \"\\f379\";\n$ionicon-var-android-color-palette: \"\\f37b\";\n$ionicon-var-android-compass: \"\\f37c\";\n$ionicon-var-android-contact: \"\\f2d8\";\n$ionicon-var-android-contacts: \"\\f2d9\";\n$ionicon-var-android-contract: \"\\f37d\";\n$ionicon-var-android-create: \"\\f37e\";\n$ionicon-var-android-delete: \"\\f37f\";\n$ionicon-var-android-desktop: \"\\f380\";\n$ionicon-var-android-document: \"\\f381\";\n$ionicon-var-android-done: \"\\f383\";\n$ionicon-var-android-done-all: \"\\f382\";\n$ionicon-var-android-download: \"\\f2dd\";\n$ionicon-var-android-drafts: \"\\f384\";\n$ionicon-var-android-exit: \"\\f385\";\n$ionicon-var-android-expand: \"\\f386\";\n$ionicon-var-android-favorite: \"\\f388\";\n$ionicon-var-android-favorite-outline: \"\\f387\";\n$ionicon-var-android-film: \"\\f389\";\n$ionicon-var-android-folder: \"\\f2e0\";\n$ionicon-var-android-folder-open: \"\\f38a\";\n$ionicon-var-android-funnel: \"\\f38b\";\n$ionicon-var-android-globe: \"\\f38c\";\n$ionicon-var-android-hand: \"\\f2e3\";\n$ionicon-var-android-hangout: \"\\f38d\";\n$ionicon-var-android-happy: \"\\f38e\";\n$ionicon-var-android-home: \"\\f38f\";\n$ionicon-var-android-image: \"\\f2e4\";\n$ionicon-var-android-laptop: \"\\f390\";\n$ionicon-var-android-list: \"\\f391\";\n$ionicon-var-android-locate: \"\\f2e9\";\n$ionicon-var-android-lock: \"\\f392\";\n$ionicon-var-android-mail: \"\\f2eb\";\n$ionicon-var-android-map: \"\\f393\";\n$ionicon-var-android-menu: \"\\f394\";\n$ionicon-var-android-microphone: \"\\f2ec\";\n$ionicon-var-android-microphone-off: \"\\f395\";\n$ionicon-var-android-more-horizontal: \"\\f396\";\n$ionicon-var-android-more-vertical: \"\\f397\";\n$ionicon-var-android-navigate: \"\\f398\";\n$ionicon-var-android-notifications: \"\\f39b\";\n$ionicon-var-android-notifications-none: \"\\f399\";\n$ionicon-var-android-notifications-off: \"\\f39a\";\n$ionicon-var-android-open: \"\\f39c\";\n$ionicon-var-android-options: \"\\f39d\";\n$ionicon-var-android-people: \"\\f39e\";\n$ionicon-var-android-person: \"\\f3a0\";\n$ionicon-var-android-person-add: \"\\f39f\";\n$ionicon-var-android-phone-landscape: \"\\f3a1\";\n$ionicon-var-android-phone-portrait: \"\\f3a2\";\n$ionicon-var-android-pin: \"\\f3a3\";\n$ionicon-var-android-plane: \"\\f3a4\";\n$ionicon-var-android-playstore: \"\\f2f0\";\n$ionicon-var-android-print: \"\\f3a5\";\n$ionicon-var-android-radio-button-off: \"\\f3a6\";\n$ionicon-var-android-radio-button-on: \"\\f3a7\";\n$ionicon-var-android-refresh: \"\\f3a8\";\n$ionicon-var-android-remove: \"\\f2f4\";\n$ionicon-var-android-remove-circle: \"\\f3a9\";\n$ionicon-var-android-restaurant: \"\\f3aa\";\n$ionicon-var-android-sad: \"\\f3ab\";\n$ionicon-var-android-search: \"\\f2f5\";\n$ionicon-var-android-send: \"\\f2f6\";\n$ionicon-var-android-settings: \"\\f2f7\";\n$ionicon-var-android-share: \"\\f2f8\";\n$ionicon-var-android-share-alt: \"\\f3ac\";\n$ionicon-var-android-star: \"\\f2fc\";\n$ionicon-var-android-star-half: \"\\f3ad\";\n$ionicon-var-android-star-outline: \"\\f3ae\";\n$ionicon-var-android-stopwatch: \"\\f2fd\";\n$ionicon-var-android-subway: \"\\f3af\";\n$ionicon-var-android-sunny: \"\\f3b0\";\n$ionicon-var-android-sync: \"\\f3b1\";\n$ionicon-var-android-textsms: \"\\f3b2\";\n$ionicon-var-android-time: \"\\f3b3\";\n$ionicon-var-android-train: \"\\f3b4\";\n$ionicon-var-android-unlock: \"\\f3b5\";\n$ionicon-var-android-upload: \"\\f3b6\";\n$ionicon-var-android-volume-down: \"\\f3b7\";\n$ionicon-var-android-volume-mute: \"\\f3b8\";\n$ionicon-var-android-volume-off: \"\\f3b9\";\n$ionicon-var-android-volume-up: \"\\f3ba\";\n$ionicon-var-android-walk: \"\\f3bb\";\n$ionicon-var-android-warning: \"\\f3bc\";\n$ionicon-var-android-watch: \"\\f3bd\";\n$ionicon-var-android-wifi: \"\\f305\";\n$ionicon-var-aperture: \"\\f313\";\n$ionicon-var-archive: \"\\f102\";\n$ionicon-var-arrow-down-a: \"\\f103\";\n$ionicon-var-arrow-down-b: \"\\f104\";\n$ionicon-var-arrow-down-c: \"\\f105\";\n$ionicon-var-arrow-expand: \"\\f25e\";\n$ionicon-var-arrow-graph-down-left: \"\\f25f\";\n$ionicon-var-arrow-graph-down-right: \"\\f260\";\n$ionicon-var-arrow-graph-up-left: \"\\f261\";\n$ionicon-var-arrow-graph-up-right: \"\\f262\";\n$ionicon-var-arrow-left-a: \"\\f106\";\n$ionicon-var-arrow-left-b: \"\\f107\";\n$ionicon-var-arrow-left-c: \"\\f108\";\n$ionicon-var-arrow-move: \"\\f263\";\n$ionicon-var-arrow-resize: \"\\f264\";\n$ionicon-var-arrow-return-left: \"\\f265\";\n$ionicon-var-arrow-return-right: \"\\f266\";\n$ionicon-var-arrow-right-a: \"\\f109\";\n$ionicon-var-arrow-right-b: \"\\f10a\";\n$ionicon-var-arrow-right-c: \"\\f10b\";\n$ionicon-var-arrow-shrink: \"\\f267\";\n$ionicon-var-arrow-swap: \"\\f268\";\n$ionicon-var-arrow-up-a: \"\\f10c\";\n$ionicon-var-arrow-up-b: \"\\f10d\";\n$ionicon-var-arrow-up-c: \"\\f10e\";\n$ionicon-var-asterisk: \"\\f314\";\n$ionicon-var-at: \"\\f10f\";\n$ionicon-var-backspace: \"\\f3bf\";\n$ionicon-var-backspace-outline: \"\\f3be\";\n$ionicon-var-bag: \"\\f110\";\n$ionicon-var-battery-charging: \"\\f111\";\n$ionicon-var-battery-empty: \"\\f112\";\n$ionicon-var-battery-full: \"\\f113\";\n$ionicon-var-battery-half: \"\\f114\";\n$ionicon-var-battery-low: \"\\f115\";\n$ionicon-var-beaker: \"\\f269\";\n$ionicon-var-beer: \"\\f26a\";\n$ionicon-var-bluetooth: \"\\f116\";\n$ionicon-var-bonfire: \"\\f315\";\n$ionicon-var-bookmark: \"\\f26b\";\n$ionicon-var-bowtie: \"\\f3c0\";\n$ionicon-var-briefcase: \"\\f26c\";\n$ionicon-var-bug: \"\\f2be\";\n$ionicon-var-calculator: \"\\f26d\";\n$ionicon-var-calendar: \"\\f117\";\n$ionicon-var-camera: \"\\f118\";\n$ionicon-var-card: \"\\f119\";\n$ionicon-var-cash: \"\\f316\";\n$ionicon-var-chatbox: \"\\f11b\";\n$ionicon-var-chatbox-working: \"\\f11a\";\n$ionicon-var-chatboxes: \"\\f11c\";\n$ionicon-var-chatbubble: \"\\f11e\";\n$ionicon-var-chatbubble-working: \"\\f11d\";\n$ionicon-var-chatbubbles: \"\\f11f\";\n$ionicon-var-checkmark: \"\\f122\";\n$ionicon-var-checkmark-circled: \"\\f120\";\n$ionicon-var-checkmark-round: \"\\f121\";\n$ionicon-var-chevron-down: \"\\f123\";\n$ionicon-var-chevron-left: \"\\f124\";\n$ionicon-var-chevron-right: \"\\f125\";\n$ionicon-var-chevron-up: \"\\f126\";\n$ionicon-var-clipboard: \"\\f127\";\n$ionicon-var-clock: \"\\f26e\";\n$ionicon-var-close: \"\\f12a\";\n$ionicon-var-close-circled: \"\\f128\";\n$ionicon-var-close-round: \"\\f129\";\n$ionicon-var-closed-captioning: \"\\f317\";\n$ionicon-var-cloud: \"\\f12b\";\n$ionicon-var-code: \"\\f271\";\n$ionicon-var-code-download: \"\\f26f\";\n$ionicon-var-code-working: \"\\f270\";\n$ionicon-var-coffee: \"\\f272\";\n$ionicon-var-compass: \"\\f273\";\n$ionicon-var-compose: \"\\f12c\";\n$ionicon-var-connection-bars: \"\\f274\";\n$ionicon-var-contrast: \"\\f275\";\n$ionicon-var-crop: \"\\f3c1\";\n$ionicon-var-cube: \"\\f318\";\n$ionicon-var-disc: \"\\f12d\";\n$ionicon-var-document: \"\\f12f\";\n$ionicon-var-document-text: \"\\f12e\";\n$ionicon-var-drag: \"\\f130\";\n$ionicon-var-earth: \"\\f276\";\n$ionicon-var-easel: \"\\f3c2\";\n$ionicon-var-edit: \"\\f2bf\";\n$ionicon-var-egg: \"\\f277\";\n$ionicon-var-eject: \"\\f131\";\n$ionicon-var-email: \"\\f132\";\n$ionicon-var-email-unread: \"\\f3c3\";\n$ionicon-var-erlenmeyer-flask: \"\\f3c5\";\n$ionicon-var-erlenmeyer-flask-bubbles: \"\\f3c4\";\n$ionicon-var-eye: \"\\f133\";\n$ionicon-var-eye-disabled: \"\\f306\";\n$ionicon-var-female: \"\\f278\";\n$ionicon-var-filing: \"\\f134\";\n$ionicon-var-film-marker: \"\\f135\";\n$ionicon-var-fireball: \"\\f319\";\n$ionicon-var-flag: \"\\f279\";\n$ionicon-var-flame: \"\\f31a\";\n$ionicon-var-flash: \"\\f137\";\n$ionicon-var-flash-off: \"\\f136\";\n$ionicon-var-folder: \"\\f139\";\n$ionicon-var-fork: \"\\f27a\";\n$ionicon-var-fork-repo: \"\\f2c0\";\n$ionicon-var-forward: \"\\f13a\";\n$ionicon-var-funnel: \"\\f31b\";\n$ionicon-var-gear-a: \"\\f13d\";\n$ionicon-var-gear-b: \"\\f13e\";\n$ionicon-var-grid: \"\\f13f\";\n$ionicon-var-hammer: \"\\f27b\";\n$ionicon-var-happy: \"\\f31c\";\n$ionicon-var-happy-outline: \"\\f3c6\";\n$ionicon-var-headphone: \"\\f140\";\n$ionicon-var-heart: \"\\f141\";\n$ionicon-var-heart-broken: \"\\f31d\";\n$ionicon-var-help: \"\\f143\";\n$ionicon-var-help-buoy: \"\\f27c\";\n$ionicon-var-help-circled: \"\\f142\";\n$ionicon-var-home: \"\\f144\";\n$ionicon-var-icecream: \"\\f27d\";\n$ionicon-var-image: \"\\f147\";\n$ionicon-var-images: \"\\f148\";\n$ionicon-var-information: \"\\f14a\";\n$ionicon-var-information-circled: \"\\f149\";\n$ionicon-var-ionic: \"\\f14b\";\n$ionicon-var-ios-alarm: \"\\f3c8\";\n$ionicon-var-ios-alarm-outline: \"\\f3c7\";\n$ionicon-var-ios-albums: \"\\f3ca\";\n$ionicon-var-ios-albums-outline: \"\\f3c9\";\n$ionicon-var-ios-americanfootball: \"\\f3cc\";\n$ionicon-var-ios-americanfootball-outline: \"\\f3cb\";\n$ionicon-var-ios-analytics: \"\\f3ce\";\n$ionicon-var-ios-analytics-outline: \"\\f3cd\";\n$ionicon-var-ios-arrow-back: \"\\f3cf\";\n$ionicon-var-ios-arrow-down: \"\\f3d0\";\n$ionicon-var-ios-arrow-forward: \"\\f3d1\";\n$ionicon-var-ios-arrow-left: \"\\f3d2\";\n$ionicon-var-ios-arrow-right: \"\\f3d3\";\n$ionicon-var-ios-arrow-thin-down: \"\\f3d4\";\n$ionicon-var-ios-arrow-thin-left: \"\\f3d5\";\n$ionicon-var-ios-arrow-thin-right: \"\\f3d6\";\n$ionicon-var-ios-arrow-thin-up: \"\\f3d7\";\n$ionicon-var-ios-arrow-up: \"\\f3d8\";\n$ionicon-var-ios-at: \"\\f3da\";\n$ionicon-var-ios-at-outline: \"\\f3d9\";\n$ionicon-var-ios-barcode: \"\\f3dc\";\n$ionicon-var-ios-barcode-outline: \"\\f3db\";\n$ionicon-var-ios-baseball: \"\\f3de\";\n$ionicon-var-ios-baseball-outline: \"\\f3dd\";\n$ionicon-var-ios-basketball: \"\\f3e0\";\n$ionicon-var-ios-basketball-outline: \"\\f3df\";\n$ionicon-var-ios-bell: \"\\f3e2\";\n$ionicon-var-ios-bell-outline: \"\\f3e1\";\n$ionicon-var-ios-body: \"\\f3e4\";\n$ionicon-var-ios-body-outline: \"\\f3e3\";\n$ionicon-var-ios-bolt: \"\\f3e6\";\n$ionicon-var-ios-bolt-outline: \"\\f3e5\";\n$ionicon-var-ios-book: \"\\f3e8\";\n$ionicon-var-ios-book-outline: \"\\f3e7\";\n$ionicon-var-ios-bookmarks: \"\\f3ea\";\n$ionicon-var-ios-bookmarks-outline: \"\\f3e9\";\n$ionicon-var-ios-box: \"\\f3ec\";\n$ionicon-var-ios-box-outline: \"\\f3eb\";\n$ionicon-var-ios-briefcase: \"\\f3ee\";\n$ionicon-var-ios-briefcase-outline: \"\\f3ed\";\n$ionicon-var-ios-browsers: \"\\f3f0\";\n$ionicon-var-ios-browsers-outline: \"\\f3ef\";\n$ionicon-var-ios-calculator: \"\\f3f2\";\n$ionicon-var-ios-calculator-outline: \"\\f3f1\";\n$ionicon-var-ios-calendar: \"\\f3f4\";\n$ionicon-var-ios-calendar-outline: \"\\f3f3\";\n$ionicon-var-ios-camera: \"\\f3f6\";\n$ionicon-var-ios-camera-outline: \"\\f3f5\";\n$ionicon-var-ios-cart: \"\\f3f8\";\n$ionicon-var-ios-cart-outline: \"\\f3f7\";\n$ionicon-var-ios-chatboxes: \"\\f3fa\";\n$ionicon-var-ios-chatboxes-outline: \"\\f3f9\";\n$ionicon-var-ios-chatbubble: \"\\f3fc\";\n$ionicon-var-ios-chatbubble-outline: \"\\f3fb\";\n$ionicon-var-ios-checkmark: \"\\f3ff\";\n$ionicon-var-ios-checkmark-empty: \"\\f3fd\";\n$ionicon-var-ios-checkmark-outline: \"\\f3fe\";\n$ionicon-var-ios-circle-filled: \"\\f400\";\n$ionicon-var-ios-circle-outline: \"\\f401\";\n$ionicon-var-ios-clock: \"\\f403\";\n$ionicon-var-ios-clock-outline: \"\\f402\";\n$ionicon-var-ios-close: \"\\f406\";\n$ionicon-var-ios-close-empty: \"\\f404\";\n$ionicon-var-ios-close-outline: \"\\f405\";\n$ionicon-var-ios-cloud: \"\\f40c\";\n$ionicon-var-ios-cloud-download: \"\\f408\";\n$ionicon-var-ios-cloud-download-outline: \"\\f407\";\n$ionicon-var-ios-cloud-outline: \"\\f409\";\n$ionicon-var-ios-cloud-upload: \"\\f40b\";\n$ionicon-var-ios-cloud-upload-outline: \"\\f40a\";\n$ionicon-var-ios-cloudy: \"\\f410\";\n$ionicon-var-ios-cloudy-night: \"\\f40e\";\n$ionicon-var-ios-cloudy-night-outline: \"\\f40d\";\n$ionicon-var-ios-cloudy-outline: \"\\f40f\";\n$ionicon-var-ios-cog: \"\\f412\";\n$ionicon-var-ios-cog-outline: \"\\f411\";\n$ionicon-var-ios-color-filter: \"\\f414\";\n$ionicon-var-ios-color-filter-outline: \"\\f413\";\n$ionicon-var-ios-color-wand: \"\\f416\";\n$ionicon-var-ios-color-wand-outline: \"\\f415\";\n$ionicon-var-ios-compose: \"\\f418\";\n$ionicon-var-ios-compose-outline: \"\\f417\";\n$ionicon-var-ios-contact: \"\\f41a\";\n$ionicon-var-ios-contact-outline: \"\\f419\";\n$ionicon-var-ios-copy: \"\\f41c\";\n$ionicon-var-ios-copy-outline: \"\\f41b\";\n$ionicon-var-ios-crop: \"\\f41e\";\n$ionicon-var-ios-crop-strong: \"\\f41d\";\n$ionicon-var-ios-download: \"\\f420\";\n$ionicon-var-ios-download-outline: \"\\f41f\";\n$ionicon-var-ios-drag: \"\\f421\";\n$ionicon-var-ios-email: \"\\f423\";\n$ionicon-var-ios-email-outline: \"\\f422\";\n$ionicon-var-ios-eye: \"\\f425\";\n$ionicon-var-ios-eye-outline: \"\\f424\";\n$ionicon-var-ios-fastforward: \"\\f427\";\n$ionicon-var-ios-fastforward-outline: \"\\f426\";\n$ionicon-var-ios-filing: \"\\f429\";\n$ionicon-var-ios-filing-outline: \"\\f428\";\n$ionicon-var-ios-film: \"\\f42b\";\n$ionicon-var-ios-film-outline: \"\\f42a\";\n$ionicon-var-ios-flag: \"\\f42d\";\n$ionicon-var-ios-flag-outline: \"\\f42c\";\n$ionicon-var-ios-flame: \"\\f42f\";\n$ionicon-var-ios-flame-outline: \"\\f42e\";\n$ionicon-var-ios-flask: \"\\f431\";\n$ionicon-var-ios-flask-outline: \"\\f430\";\n$ionicon-var-ios-flower: \"\\f433\";\n$ionicon-var-ios-flower-outline: \"\\f432\";\n$ionicon-var-ios-folder: \"\\f435\";\n$ionicon-var-ios-folder-outline: \"\\f434\";\n$ionicon-var-ios-football: \"\\f437\";\n$ionicon-var-ios-football-outline: \"\\f436\";\n$ionicon-var-ios-game-controller-a: \"\\f439\";\n$ionicon-var-ios-game-controller-a-outline: \"\\f438\";\n$ionicon-var-ios-game-controller-b: \"\\f43b\";\n$ionicon-var-ios-game-controller-b-outline: \"\\f43a\";\n$ionicon-var-ios-gear: \"\\f43d\";\n$ionicon-var-ios-gear-outline: \"\\f43c\";\n$ionicon-var-ios-glasses: \"\\f43f\";\n$ionicon-var-ios-glasses-outline: \"\\f43e\";\n$ionicon-var-ios-grid-view: \"\\f441\";\n$ionicon-var-ios-grid-view-outline: \"\\f440\";\n$ionicon-var-ios-heart: \"\\f443\";\n$ionicon-var-ios-heart-outline: \"\\f442\";\n$ionicon-var-ios-help: \"\\f446\";\n$ionicon-var-ios-help-empty: \"\\f444\";\n$ionicon-var-ios-help-outline: \"\\f445\";\n$ionicon-var-ios-home: \"\\f448\";\n$ionicon-var-ios-home-outline: \"\\f447\";\n$ionicon-var-ios-infinite: \"\\f44a\";\n$ionicon-var-ios-infinite-outline: \"\\f449\";\n$ionicon-var-ios-information: \"\\f44d\";\n$ionicon-var-ios-information-empty: \"\\f44b\";\n$ionicon-var-ios-information-outline: \"\\f44c\";\n$ionicon-var-ios-ionic-outline: \"\\f44e\";\n$ionicon-var-ios-keypad: \"\\f450\";\n$ionicon-var-ios-keypad-outline: \"\\f44f\";\n$ionicon-var-ios-lightbulb: \"\\f452\";\n$ionicon-var-ios-lightbulb-outline: \"\\f451\";\n$ionicon-var-ios-list: \"\\f454\";\n$ionicon-var-ios-list-outline: \"\\f453\";\n$ionicon-var-ios-location: \"\\f456\";\n$ionicon-var-ios-location-outline: \"\\f455\";\n$ionicon-var-ios-locked: \"\\f458\";\n$ionicon-var-ios-locked-outline: \"\\f457\";\n$ionicon-var-ios-loop: \"\\f45a\";\n$ionicon-var-ios-loop-strong: \"\\f459\";\n$ionicon-var-ios-medical: \"\\f45c\";\n$ionicon-var-ios-medical-outline: \"\\f45b\";\n$ionicon-var-ios-medkit: \"\\f45e\";\n$ionicon-var-ios-medkit-outline: \"\\f45d\";\n$ionicon-var-ios-mic: \"\\f461\";\n$ionicon-var-ios-mic-off: \"\\f45f\";\n$ionicon-var-ios-mic-outline: \"\\f460\";\n$ionicon-var-ios-minus: \"\\f464\";\n$ionicon-var-ios-minus-empty: \"\\f462\";\n$ionicon-var-ios-minus-outline: \"\\f463\";\n$ionicon-var-ios-monitor: \"\\f466\";\n$ionicon-var-ios-monitor-outline: \"\\f465\";\n$ionicon-var-ios-moon: \"\\f468\";\n$ionicon-var-ios-moon-outline: \"\\f467\";\n$ionicon-var-ios-more: \"\\f46a\";\n$ionicon-var-ios-more-outline: \"\\f469\";\n$ionicon-var-ios-musical-note: \"\\f46b\";\n$ionicon-var-ios-musical-notes: \"\\f46c\";\n$ionicon-var-ios-navigate: \"\\f46e\";\n$ionicon-var-ios-navigate-outline: \"\\f46d\";\n$ionicon-var-ios-nutrition: \"\\f470\";\n$ionicon-var-ios-nutrition-outline: \"\\f46f\";\n$ionicon-var-ios-paper: \"\\f472\";\n$ionicon-var-ios-paper-outline: \"\\f471\";\n$ionicon-var-ios-paperplane: \"\\f474\";\n$ionicon-var-ios-paperplane-outline: \"\\f473\";\n$ionicon-var-ios-partlysunny: \"\\f476\";\n$ionicon-var-ios-partlysunny-outline: \"\\f475\";\n$ionicon-var-ios-pause: \"\\f478\";\n$ionicon-var-ios-pause-outline: \"\\f477\";\n$ionicon-var-ios-paw: \"\\f47a\";\n$ionicon-var-ios-paw-outline: \"\\f479\";\n$ionicon-var-ios-people: \"\\f47c\";\n$ionicon-var-ios-people-outline: \"\\f47b\";\n$ionicon-var-ios-person: \"\\f47e\";\n$ionicon-var-ios-person-outline: \"\\f47d\";\n$ionicon-var-ios-personadd: \"\\f480\";\n$ionicon-var-ios-personadd-outline: \"\\f47f\";\n$ionicon-var-ios-photos: \"\\f482\";\n$ionicon-var-ios-photos-outline: \"\\f481\";\n$ionicon-var-ios-pie: \"\\f484\";\n$ionicon-var-ios-pie-outline: \"\\f483\";\n$ionicon-var-ios-pint: \"\\f486\";\n$ionicon-var-ios-pint-outline: \"\\f485\";\n$ionicon-var-ios-play: \"\\f488\";\n$ionicon-var-ios-play-outline: \"\\f487\";\n$ionicon-var-ios-plus: \"\\f48b\";\n$ionicon-var-ios-plus-empty: \"\\f489\";\n$ionicon-var-ios-plus-outline: \"\\f48a\";\n$ionicon-var-ios-pricetag: \"\\f48d\";\n$ionicon-var-ios-pricetag-outline: \"\\f48c\";\n$ionicon-var-ios-pricetags: \"\\f48f\";\n$ionicon-var-ios-pricetags-outline: \"\\f48e\";\n$ionicon-var-ios-printer: \"\\f491\";\n$ionicon-var-ios-printer-outline: \"\\f490\";\n$ionicon-var-ios-pulse: \"\\f493\";\n$ionicon-var-ios-pulse-strong: \"\\f492\";\n$ionicon-var-ios-rainy: \"\\f495\";\n$ionicon-var-ios-rainy-outline: \"\\f494\";\n$ionicon-var-ios-recording: \"\\f497\";\n$ionicon-var-ios-recording-outline: \"\\f496\";\n$ionicon-var-ios-redo: \"\\f499\";\n$ionicon-var-ios-redo-outline: \"\\f498\";\n$ionicon-var-ios-refresh: \"\\f49c\";\n$ionicon-var-ios-refresh-empty: \"\\f49a\";\n$ionicon-var-ios-refresh-outline: \"\\f49b\";\n$ionicon-var-ios-reload: \"\\f49d\";\n$ionicon-var-ios-reverse-camera: \"\\f49f\";\n$ionicon-var-ios-reverse-camera-outline: \"\\f49e\";\n$ionicon-var-ios-rewind: \"\\f4a1\";\n$ionicon-var-ios-rewind-outline: \"\\f4a0\";\n$ionicon-var-ios-rose: \"\\f4a3\";\n$ionicon-var-ios-rose-outline: \"\\f4a2\";\n$ionicon-var-ios-search: \"\\f4a5\";\n$ionicon-var-ios-search-strong: \"\\f4a4\";\n$ionicon-var-ios-settings: \"\\f4a7\";\n$ionicon-var-ios-settings-strong: \"\\f4a6\";\n$ionicon-var-ios-shuffle: \"\\f4a9\";\n$ionicon-var-ios-shuffle-strong: \"\\f4a8\";\n$ionicon-var-ios-skipbackward: \"\\f4ab\";\n$ionicon-var-ios-skipbackward-outline: \"\\f4aa\";\n$ionicon-var-ios-skipforward: \"\\f4ad\";\n$ionicon-var-ios-skipforward-outline: \"\\f4ac\";\n$ionicon-var-ios-snowy: \"\\f4ae\";\n$ionicon-var-ios-speedometer: \"\\f4b0\";\n$ionicon-var-ios-speedometer-outline: \"\\f4af\";\n$ionicon-var-ios-star: \"\\f4b3\";\n$ionicon-var-ios-star-half: \"\\f4b1\";\n$ionicon-var-ios-star-outline: \"\\f4b2\";\n$ionicon-var-ios-stopwatch: \"\\f4b5\";\n$ionicon-var-ios-stopwatch-outline: \"\\f4b4\";\n$ionicon-var-ios-sunny: \"\\f4b7\";\n$ionicon-var-ios-sunny-outline: \"\\f4b6\";\n$ionicon-var-ios-telephone: \"\\f4b9\";\n$ionicon-var-ios-telephone-outline: \"\\f4b8\";\n$ionicon-var-ios-tennisball: \"\\f4bb\";\n$ionicon-var-ios-tennisball-outline: \"\\f4ba\";\n$ionicon-var-ios-thunderstorm: \"\\f4bd\";\n$ionicon-var-ios-thunderstorm-outline: \"\\f4bc\";\n$ionicon-var-ios-time: \"\\f4bf\";\n$ionicon-var-ios-time-outline: \"\\f4be\";\n$ionicon-var-ios-timer: \"\\f4c1\";\n$ionicon-var-ios-timer-outline: \"\\f4c0\";\n$ionicon-var-ios-toggle: \"\\f4c3\";\n$ionicon-var-ios-toggle-outline: \"\\f4c2\";\n$ionicon-var-ios-trash: \"\\f4c5\";\n$ionicon-var-ios-trash-outline: \"\\f4c4\";\n$ionicon-var-ios-undo: \"\\f4c7\";\n$ionicon-var-ios-undo-outline: \"\\f4c6\";\n$ionicon-var-ios-unlocked: \"\\f4c9\";\n$ionicon-var-ios-unlocked-outline: \"\\f4c8\";\n$ionicon-var-ios-upload: \"\\f4cb\";\n$ionicon-var-ios-upload-outline: \"\\f4ca\";\n$ionicon-var-ios-videocam: \"\\f4cd\";\n$ionicon-var-ios-videocam-outline: \"\\f4cc\";\n$ionicon-var-ios-volume-high: \"\\f4ce\";\n$ionicon-var-ios-volume-low: \"\\f4cf\";\n$ionicon-var-ios-wineglass: \"\\f4d1\";\n$ionicon-var-ios-wineglass-outline: \"\\f4d0\";\n$ionicon-var-ios-world: \"\\f4d3\";\n$ionicon-var-ios-world-outline: \"\\f4d2\";\n$ionicon-var-ipad: \"\\f1f9\";\n$ionicon-var-iphone: \"\\f1fa\";\n$ionicon-var-ipod: \"\\f1fb\";\n$ionicon-var-jet: \"\\f295\";\n$ionicon-var-key: \"\\f296\";\n$ionicon-var-knife: \"\\f297\";\n$ionicon-var-laptop: \"\\f1fc\";\n$ionicon-var-leaf: \"\\f1fd\";\n$ionicon-var-levels: \"\\f298\";\n$ionicon-var-lightbulb: \"\\f299\";\n$ionicon-var-link: \"\\f1fe\";\n$ionicon-var-load-a: \"\\f29a\";\n$ionicon-var-load-b: \"\\f29b\";\n$ionicon-var-load-c: \"\\f29c\";\n$ionicon-var-load-d: \"\\f29d\";\n$ionicon-var-location: \"\\f1ff\";\n$ionicon-var-lock-combination: \"\\f4d4\";\n$ionicon-var-locked: \"\\f200\";\n$ionicon-var-log-in: \"\\f29e\";\n$ionicon-var-log-out: \"\\f29f\";\n$ionicon-var-loop: \"\\f201\";\n$ionicon-var-magnet: \"\\f2a0\";\n$ionicon-var-male: \"\\f2a1\";\n$ionicon-var-man: \"\\f202\";\n$ionicon-var-map: \"\\f203\";\n$ionicon-var-medkit: \"\\f2a2\";\n$ionicon-var-merge: \"\\f33f\";\n$ionicon-var-mic-a: \"\\f204\";\n$ionicon-var-mic-b: \"\\f205\";\n$ionicon-var-mic-c: \"\\f206\";\n$ionicon-var-minus: \"\\f209\";\n$ionicon-var-minus-circled: \"\\f207\";\n$ionicon-var-minus-round: \"\\f208\";\n$ionicon-var-model-s: \"\\f2c1\";\n$ionicon-var-monitor: \"\\f20a\";\n$ionicon-var-more: \"\\f20b\";\n$ionicon-var-mouse: \"\\f340\";\n$ionicon-var-music-note: \"\\f20c\";\n$ionicon-var-navicon: \"\\f20e\";\n$ionicon-var-navicon-round: \"\\f20d\";\n$ionicon-var-navigate: \"\\f2a3\";\n$ionicon-var-network: \"\\f341\";\n$ionicon-var-no-smoking: \"\\f2c2\";\n$ionicon-var-nuclear: \"\\f2a4\";\n$ionicon-var-outlet: \"\\f342\";\n$ionicon-var-paintbrush: \"\\f4d5\";\n$ionicon-var-paintbucket: \"\\f4d6\";\n$ionicon-var-paper-airplane: \"\\f2c3\";\n$ionicon-var-paperclip: \"\\f20f\";\n$ionicon-var-pause: \"\\f210\";\n$ionicon-var-person: \"\\f213\";\n$ionicon-var-person-add: \"\\f211\";\n$ionicon-var-person-stalker: \"\\f212\";\n$ionicon-var-pie-graph: \"\\f2a5\";\n$ionicon-var-pin: \"\\f2a6\";\n$ionicon-var-pinpoint: \"\\f2a7\";\n$ionicon-var-pizza: \"\\f2a8\";\n$ionicon-var-plane: \"\\f214\";\n$ionicon-var-planet: \"\\f343\";\n$ionicon-var-play: \"\\f215\";\n$ionicon-var-playstation: \"\\f30a\";\n$ionicon-var-plus: \"\\f218\";\n$ionicon-var-plus-circled: \"\\f216\";\n$ionicon-var-plus-round: \"\\f217\";\n$ionicon-var-podium: \"\\f344\";\n$ionicon-var-pound: \"\\f219\";\n$ionicon-var-power: \"\\f2a9\";\n$ionicon-var-pricetag: \"\\f2aa\";\n$ionicon-var-pricetags: \"\\f2ab\";\n$ionicon-var-printer: \"\\f21a\";\n$ionicon-var-pull-request: \"\\f345\";\n$ionicon-var-qr-scanner: \"\\f346\";\n$ionicon-var-quote: \"\\f347\";\n$ionicon-var-radio-waves: \"\\f2ac\";\n$ionicon-var-record: \"\\f21b\";\n$ionicon-var-refresh: \"\\f21c\";\n$ionicon-var-reply: \"\\f21e\";\n$ionicon-var-reply-all: \"\\f21d\";\n$ionicon-var-ribbon-a: \"\\f348\";\n$ionicon-var-ribbon-b: \"\\f349\";\n$ionicon-var-sad: \"\\f34a\";\n$ionicon-var-sad-outline: \"\\f4d7\";\n$ionicon-var-scissors: \"\\f34b\";\n$ionicon-var-search: \"\\f21f\";\n$ionicon-var-settings: \"\\f2ad\";\n$ionicon-var-share: \"\\f220\";\n$ionicon-var-shuffle: \"\\f221\";\n$ionicon-var-skip-backward: \"\\f222\";\n$ionicon-var-skip-forward: \"\\f223\";\n$ionicon-var-social-android: \"\\f225\";\n$ionicon-var-social-android-outline: \"\\f224\";\n$ionicon-var-social-angular: \"\\f4d9\";\n$ionicon-var-social-angular-outline: \"\\f4d8\";\n$ionicon-var-social-apple: \"\\f227\";\n$ionicon-var-social-apple-outline: \"\\f226\";\n$ionicon-var-social-bitcoin: \"\\f2af\";\n$ionicon-var-social-bitcoin-outline: \"\\f2ae\";\n$ionicon-var-social-buffer: \"\\f229\";\n$ionicon-var-social-buffer-outline: \"\\f228\";\n$ionicon-var-social-chrome: \"\\f4db\";\n$ionicon-var-social-chrome-outline: \"\\f4da\";\n$ionicon-var-social-codepen: \"\\f4dd\";\n$ionicon-var-social-codepen-outline: \"\\f4dc\";\n$ionicon-var-social-css3: \"\\f4df\";\n$ionicon-var-social-css3-outline: \"\\f4de\";\n$ionicon-var-social-designernews: \"\\f22b\";\n$ionicon-var-social-designernews-outline: \"\\f22a\";\n$ionicon-var-social-dribbble: \"\\f22d\";\n$ionicon-var-social-dribbble-outline: \"\\f22c\";\n$ionicon-var-social-dropbox: \"\\f22f\";\n$ionicon-var-social-dropbox-outline: \"\\f22e\";\n$ionicon-var-social-euro: \"\\f4e1\";\n$ionicon-var-social-euro-outline: \"\\f4e0\";\n$ionicon-var-social-facebook: \"\\f231\";\n$ionicon-var-social-facebook-outline: \"\\f230\";\n$ionicon-var-social-foursquare: \"\\f34d\";\n$ionicon-var-social-foursquare-outline: \"\\f34c\";\n$ionicon-var-social-freebsd-devil: \"\\f2c4\";\n$ionicon-var-social-github: \"\\f233\";\n$ionicon-var-social-github-outline: \"\\f232\";\n$ionicon-var-social-google: \"\\f34f\";\n$ionicon-var-social-google-outline: \"\\f34e\";\n$ionicon-var-social-googleplus: \"\\f235\";\n$ionicon-var-social-googleplus-outline: \"\\f234\";\n$ionicon-var-social-hackernews: \"\\f237\";\n$ionicon-var-social-hackernews-outline: \"\\f236\";\n$ionicon-var-social-html5: \"\\f4e3\";\n$ionicon-var-social-html5-outline: \"\\f4e2\";\n$ionicon-var-social-instagram: \"\\f351\";\n$ionicon-var-social-instagram-outline: \"\\f350\";\n$ionicon-var-social-javascript: \"\\f4e5\";\n$ionicon-var-social-javascript-outline: \"\\f4e4\";\n$ionicon-var-social-linkedin: \"\\f239\";\n$ionicon-var-social-linkedin-outline: \"\\f238\";\n$ionicon-var-social-markdown: \"\\f4e6\";\n$ionicon-var-social-nodejs: \"\\f4e7\";\n$ionicon-var-social-octocat: \"\\f4e8\";\n$ionicon-var-social-pinterest: \"\\f2b1\";\n$ionicon-var-social-pinterest-outline: \"\\f2b0\";\n$ionicon-var-social-python: \"\\f4e9\";\n$ionicon-var-social-reddit: \"\\f23b\";\n$ionicon-var-social-reddit-outline: \"\\f23a\";\n$ionicon-var-social-rss: \"\\f23d\";\n$ionicon-var-social-rss-outline: \"\\f23c\";\n$ionicon-var-social-sass: \"\\f4ea\";\n$ionicon-var-social-skype: \"\\f23f\";\n$ionicon-var-social-skype-outline: \"\\f23e\";\n$ionicon-var-social-snapchat: \"\\f4ec\";\n$ionicon-var-social-snapchat-outline: \"\\f4eb\";\n$ionicon-var-social-tumblr: \"\\f241\";\n$ionicon-var-social-tumblr-outline: \"\\f240\";\n$ionicon-var-social-tux: \"\\f2c5\";\n$ionicon-var-social-twitch: \"\\f4ee\";\n$ionicon-var-social-twitch-outline: \"\\f4ed\";\n$ionicon-var-social-twitter: \"\\f243\";\n$ionicon-var-social-twitter-outline: \"\\f242\";\n$ionicon-var-social-usd: \"\\f353\";\n$ionicon-var-social-usd-outline: \"\\f352\";\n$ionicon-var-social-vimeo: \"\\f245\";\n$ionicon-var-social-vimeo-outline: \"\\f244\";\n$ionicon-var-social-whatsapp: \"\\f4f0\";\n$ionicon-var-social-whatsapp-outline: \"\\f4ef\";\n$ionicon-var-social-windows: \"\\f247\";\n$ionicon-var-social-windows-outline: \"\\f246\";\n$ionicon-var-social-wordpress: \"\\f249\";\n$ionicon-var-social-wordpress-outline: \"\\f248\";\n$ionicon-var-social-yahoo: \"\\f24b\";\n$ionicon-var-social-yahoo-outline: \"\\f24a\";\n$ionicon-var-social-yen: \"\\f4f2\";\n$ionicon-var-social-yen-outline: \"\\f4f1\";\n$ionicon-var-social-youtube: \"\\f24d\";\n$ionicon-var-social-youtube-outline: \"\\f24c\";\n$ionicon-var-soup-can: \"\\f4f4\";\n$ionicon-var-soup-can-outline: \"\\f4f3\";\n$ionicon-var-speakerphone: \"\\f2b2\";\n$ionicon-var-speedometer: \"\\f2b3\";\n$ionicon-var-spoon: \"\\f2b4\";\n$ionicon-var-star: \"\\f24e\";\n$ionicon-var-stats-bars: \"\\f2b5\";\n$ionicon-var-steam: \"\\f30b\";\n$ionicon-var-stop: \"\\f24f\";\n$ionicon-var-thermometer: \"\\f2b6\";\n$ionicon-var-thumbsdown: \"\\f250\";\n$ionicon-var-thumbsup: \"\\f251\";\n$ionicon-var-toggle: \"\\f355\";\n$ionicon-var-toggle-filled: \"\\f354\";\n$ionicon-var-transgender: \"\\f4f5\";\n$ionicon-var-trash-a: \"\\f252\";\n$ionicon-var-trash-b: \"\\f253\";\n$ionicon-var-trophy: \"\\f356\";\n$ionicon-var-tshirt: \"\\f4f7\";\n$ionicon-var-tshirt-outline: \"\\f4f6\";\n$ionicon-var-umbrella: \"\\f2b7\";\n$ionicon-var-university: \"\\f357\";\n$ionicon-var-unlocked: \"\\f254\";\n$ionicon-var-upload: \"\\f255\";\n$ionicon-var-usb: \"\\f2b8\";\n$ionicon-var-videocamera: \"\\f256\";\n$ionicon-var-volume-high: \"\\f257\";\n$ionicon-var-volume-low: \"\\f258\";\n$ionicon-var-volume-medium: \"\\f259\";\n$ionicon-var-volume-mute: \"\\f25a\";\n$ionicon-var-wand: \"\\f358\";\n$ionicon-var-waterdrop: \"\\f25b\";\n$ionicon-var-wifi: \"\\f25c\";\n$ionicon-var-wineglass: \"\\f2b9\";\n$ionicon-var-woman: \"\\f25d\";\n$ionicon-var-wrench: \"\\f2ba\";\n$ionicon-var-xbox: \"\\f30c\";"
  },
  {
    "path": "www/lib/ionic/scss/ionicons/ionicons.scss",
    "content": "@charset \"UTF-8\";\n@import \"ionicons-variables\";\n/*!\n  Ionicons, v2.0.1\n  Created by Ben Sperry for the Ionic Framework, http://ionicons.com/\n  https://twitter.com/benjsperry  https://twitter.com/ionicframework\n  MIT License: https://github.com/driftyco/ionicons\n\n  Android-style icons originally built by Google’s\n  Material Design Icons: https://github.com/google/material-design-icons\n  used under CC BY http://creativecommons.org/licenses/by/4.0/\n  Modified icons to fit ionicon’s grid from original.\n*/\n\n@import \"ionicons-font\";\n@import \"ionicons-icons\";\n"
  },
  {
    "path": "www/lib/moment/.bower.json",
    "content": "{\n  \"name\": \"moment\",\n  \"version\": \"2.10.2\",\n  \"main\": \"moment.js\",\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"test\",\n    \"tests\",\n    \"tasks\",\n    \"component.json\",\n    \"composer.json\",\n    \"CONTRIBUTING.md\",\n    \"ender.js\",\n    \"Gruntfile.js\",\n    \"package.js\",\n    \"package.json\"\n  ],\n  \"homepage\": \"https://github.com/moment/moment\",\n  \"_release\": \"2.10.2\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"2.10.2\",\n    \"commit\": \"b54fa78b74d55a1680293b5260a42bd2751c333c\"\n  },\n  \"_source\": \"git://github.com/moment/moment.git\",\n  \"_target\": \">=2.8.0 <2.11.0\",\n  \"_originalSource\": \"moment\"\n}"
  },
  {
    "path": "www/lib/moment/CHANGELOG.md",
    "content": "Changelog\n=========\n\n### 2.10.2\n\n* fixed moment-with-locales in browser env caused by esperanto change\n\n### 2.10.1\n\n* regression: Add moment.duration.fn back\n\n### 2.10.0\n\nPorted code to es6 modules.\n\n### 2.9.0 [See full changelog](https://gist.github.com/ichernev/0c9a9b49951111a27ce7)\n\nlanguages:\n* [2104](https://github.com/moment/moment/issues/2104) Frisian (fy) language file with unit test\n* [2097](https://github.com/moment/moment/issues/2097) add ar-tn locale\n\ndeprecations:\n* [2074](https://github.com/moment/moment/issues/2074) Implement `moment.fn.utcOffset`, deprecate `momen.fn.zone`\n\nfeatures:\n* [2088](https://github.com/moment/moment/issues/2088) add moment.fn.isBetween\n* [2054](https://github.com/moment/moment/issues/2054) Call updateOffset when creating moment (needed for default timezone in\n  moment-timezone)\n* [1893](https://github.com/moment/moment/issues/1893) Add moment.isDate method\n* [1825](https://github.com/moment/moment/issues/1825) Implement toJSON function on Duration\n* [1809](https://github.com/moment/moment/issues/1809) Allowing moment.set() to accept a hash of units\n* [2128](https://github.com/moment/moment/issues/2128) Add firstDayOfWeek, firstDayOfYear locale getters\n* [2131](https://github.com/moment/moment/issues/2131) Add quarter diff support\n\nSome bugfixes and language improvements -- [full changelog](https://gist.github.com/ichernev/0c9a9b49951111a27ce7)\n\n### 2.8.4 [See full changelog](https://gist.github.com/ichernev/a4fcb0a46d74e4b9b996)\n\nFeatures:\n\n* [#2000](https://github.com/moment/moment/issues/2000) Add LTS localised format that includes seconds\n* [#1960](https://github.com/moment/moment/issues/1960) added formatToken 'x' for unix offset in milliseconds #1938\n* [#1965](https://github.com/moment/moment/issues/1965) Support 24:00:00.000 to mean next day, at midnight.\n* [#2002](https://github.com/moment/moment/issues/2002) Accept 'date' key when creating moment with object\n* [#2009](https://github.com/moment/moment/issues/2009) Use native toISOString when we can\n\nSome bugfixes and language improvements -- [full changelog](https://gist.github.com/ichernev/a4fcb0a46d74e4b9b996)\n\n### 2.8.3\n\nBugfixes:\n\n* [#1801](https://github.com/moment/moment/issues/1801) proper pluralization for Arabic\n* [#1833](https://github.com/moment/moment/issues/1833) improve spm integration\n* [#1871](https://github.com/moment/moment/issues/1871) fix zone bug caused by Firefox 24\n* [#1882](https://github.com/moment/moment/issues/1882) Use hh:mm in Czech\n* [#1883](https://github.com/moment/moment/issues/1883) Fix 2.8.0 regression in duration as conversions\n* [#1890](https://github.com/moment/moment/issues/1890) Faster travis builds\n* [#1892](https://github.com/moment/moment/issues/1892) Faster isBefore/After/Same\n* [#1848](https://github.com/moment/moment/issues/1848) Fix flaky month diffs\n* [#1895](https://github.com/moment/moment/issues/1895) Fix 2.8.0 regression in moment.utc with format array\n* [#1896](https://github.com/moment/moment/issues/1896) Support setting invalid instance locale (noop)\n* [#1897](https://github.com/moment/moment/issues/1897) Support moment([str]) in addition to moment([int])\n\n### 2.8.2\n\nMinor bugfixes:\n\n* [#1874](https://github.com/moment/moment/issues/1874) use `Object.prototype.hasOwnProperty`\n  instead of `obj.hasOwnProperty` (ie8 bug)\n* [#1873](https://github.com/moment/moment/issues/1873) add `duration#toString()`\n* [#1859](https://github.com/moment/moment/issues/1859) better month/weekday names in norwegian\n* [#1812](https://github.com/moment/moment/issues/1812) meridiem parsing for greek\n* [#1804](https://github.com/moment/moment/issues/1804) spanish del -> de\n* [#1800](https://github.com/moment/moment/issues/1800) korean LT improvement\n\n### 2.8.1\n\n* bugfix [#1813](https://github.com/moment/moment/issues/1813): fix moment().lang([key]) incompatibility\n\n### 2.8.0 [See changelog](https://gist.github.com/ichernev/ac3899324a5fa6c8c9b4)\n\n* incompatible changes\n    * [#1761](https://github.com/moment/moment/issues/1761): moments created without a language are no longer following the global language, in case it changes. Only newly created moments take the global language by default. In case you're affected by this, wait, comment on [#1797](https://github.com/moment/moment/issues/1797) and wait for a proper reimplementation\n    * [#1642](https://github.com/moment/moment/issues/1642): 45 days is no longer \"a month\" according to humanize, cutoffs for month, and year have changed. Hopefully your code does not depend on a particular answer from humanize (which it shouldn't anyway)\n    * [#1784](https://github.com/moment/moment/issues/1784): if you use the human readable English datetime format in a weird way (like storing them in a database) that would break when the format changes you're at risk.\n\n* deprecations (old behavior will be dropped in 3.0)\n    * [#1761](https://github.com/moment/moment/issues/1761) `lang` is renamed to `locale`, `langData` -> `localeData`. Also there is now `defineLocale` that should be used when creating new locales\n    * [#1763](https://github.com/moment/moment/issues/1763) `add(unit, value)` and `subtract(unit, value)` are now deprecated. Use `add(value, unit)` and `subtract(value, unit)` instead.\n    * [#1759](https://github.com/moment/moment/issues/1759) rename `duration.toIsoString` to `duration.toISOString`. The js standard library and moment's `toISOString` follow that convention.\n\n* new locales\n    * [#1789](https://github.com/moment/moment/issues/1789) Tibetan (bo)\n    * [#1786](https://github.com/moment/moment/issues/1786) Africaans (af)\n    * [#1778](https://github.com/moment/moment/issues/1778) Burmese (my)\n    * [#1727](https://github.com/moment/moment/issues/1727) Belarusian (be)\n\n* bugfixes, locale bugfixes, performance improvements, features\n\n### 2.7.0 [See changelog](https://gist.github.com/ichernev/b0a3d456d5a84c9901d7)\n\n* new languages\n\n  * [#1678](https://github.com/moment/moment/issues/1678) Bengali (bn)\n  * [#1628](https://github.com/moment/moment/issues/1628) Azerbaijani (az)\n  * [#1633](https://github.com/moment/moment/issues/1633) Arabic, Saudi Arabia (ar-sa)\n  * [#1648](https://github.com/moment/moment/issues/1648) Austrian German (de-at)\n\n* features\n\n  * [#1663](https://github.com/moment/moment/issues/1663) configurable relative time thresholds\n  * [#1554](https://github.com/moment/moment/issues/1554) support anchor time in moment.calendar\n  * [#1693](https://github.com/moment/moment/issues/1693) support moment.ISO_8601 as parsing format\n  * [#1637](https://github.com/moment/moment/issues/1637) add moment.min and moment.max and deprecate min/max instance methods\n  * [#1704](https://github.com/moment/moment/issues/1704) support string value in add/subtract\n  * [#1647](https://github.com/moment/moment/issues/1647) add spm support (package manager)\n\n* bugfixes\n\n### 2.6.0 [See changelog](https://gist.github.com/ichernev/10544682)\n\n* languages\n  * [#1529](https://github.com/moment/moment/issues/1529) Serbian-Cyrillic (sr-cyr)\n  * [#1544](https://github.com/moment/moment/issues/1544), [#1546](https://github.com/moment/moment/issues/1546) Khmer Cambodia (km)\n\n* features\n    * [#1419](https://github.com/moment/moment/issues/1419), [#1468](https://github.com/moment/moment/issues/1468), [#1467](https://github.com/moment/moment/issues/1467), [#1546](https://github.com/moment/moment/issues/1546) better handling of timezone-d moments around DST\n    * [#1462](https://github.com/moment/moment/issues/1462) add weeksInYear and isoWeeksInYear\n    * [#1475](https://github.com/moment/moment/issues/1475) support ordinal parsing\n    * [#1499](https://github.com/moment/moment/issues/1499) composer support\n    * [#1577](https://github.com/moment/moment/issues/1577), [#1604](https://github.com/moment/moment/issues/1604) put Date parsing in moment.createFromInputFallback so it can be properly deprecated and controlled in the future\n    * [#1545](https://github.com/moment/moment/issues/1545) extract two-digit year parsing in moment.parseTwoDigitYear, so it can be overwritten\n    * [#1590](https://github.com/moment/moment/issues/1590) (see [#1574](https://github.com/moment/moment/issues/1574)) set AMD global before module definition to better support non AMD module dependencies used in AMD environment\n    * [#1589](https://github.com/moment/moment/issues/1589) remove global in Node.JS environment (was not working before, nobody complained, was scheduled for removal anyway)\n    * [#1586](https://github.com/moment/moment/issues/1586) support quarter setting and parsing\n\n* 18 bugs fixed\n\n### 2.5.1\n\n* languages\n  * [#1392](https://github.com/moment/moment/issues/1392) Armenian (hy-am)\n\n* bugfixes\n  * [#1429](https://github.com/moment/moment/issues/1429) fixes [#1423](https://github.com/moment/moment/issues/1423) weird chrome-32 bug with js object creation\n  * [#1421](https://github.com/moment/moment/issues/1421) remove html entities from Welsh\n  * [#1418](https://github.com/moment/moment/issues/1418) fixes [#1401](https://github.com/moment/moment/issues/1401) improved non-padded tokens in strict matching\n  * [#1417](https://github.com/moment/moment/issues/1417) fixes [#1404](https://github.com/moment/moment/issues/1404) handle buggy moment object created by property cloning\n  * [#1398](https://github.com/moment/moment/issues/1398) fixes [#1397](https://github.com/moment/moment/issues/1397) fix Arabic-like week number parsing\n  * [#1396](https://github.com/moment/moment/issues/1396) add leftZeroFill(4) to GGGG and gggg formats\n  * [#1373](https://github.com/moment/moment/issues/1373) use lowercase for months and days in Catalan\n\n* testing\n  * [#1374](https://github.com/moment/moment/issues/1374) run tests on multiple browser/os combos via SauceLabs and Travis\n\n### 2.5.0 [See changelog](https://gist.github.com/ichernev/8104451)\n\n* New languages\n  * Luxemburish (lb) [1247](https://github.com/moment/moment/issues/1247)\n  * Serbian (rs) [1319](https://github.com/moment/moment/issues/1319)\n  * Tamil (ta) [1324](https://github.com/moment/moment/issues/1324)\n  * Macedonian (mk) [1337](https://github.com/moment/moment/issues/1337)\n\n* Features\n  * [1311](https://github.com/moment/moment/issues/1311) Add quarter getter and format token `Q`\n  * [1303](https://github.com/moment/moment/issues/1303) strict parsing now respects number of digits per token (fix [1196](https://github.com/moment/moment/issues/1196))\n  * 0d30bb7 add jspm support\n  * [1347](https://github.com/moment/moment/issues/1347) improve zone parsing\n  * [1362](https://github.com/moment/moment/issues/1362) support merideam parsing in Korean\n\n* 22 bugfixes\n\n### 2.4.0\n\n* **Deprecate** globally exported moment, will be removed in next major\n* New languages\n  * Farose (fo) [#1206](https://github.com/moment/moment/issues/1206)\n  * Tagalog/Filipino (tl-ph) [#1197](https://github.com/moment/moment/issues/1197)\n  * Welsh (cy) [#1215](https://github.com/moment/moment/issues/1215)\n* Bugfixes\n  * properly handle Z at the end of iso RegExp [#1187](https://github.com/moment/moment/issues/1187)\n  * chinese meridian time improvements [#1076](https://github.com/moment/moment/issues/1076)\n  * fix language tests [#1177](https://github.com/moment/moment/issues/1177)\n  * remove some failing tests (that should have never existed :))\n    [#1185](https://github.com/moment/moment/issues/1185)\n    [#1183](https://github.com/moment/moment/issues/1183)\n  * handle russian noun cases in weird cases [#1195](https://github.com/moment/moment/issues/1195)\n\n### 2.3.1\n\nRemoved a trailing comma [1169] and fixed a bug with `months`, `weekdays` getters [#1171](https://github.com/moment/moment/issues/1171).\n\n### 2.3.0 [See changelog](https://gist.github.com/ichernev/6864354)\n\nChanged isValid, added strict parsing.\nWeek tokens parsing.\n\n### 2.2.1\n\nFixed bug in string prototype test.\nUpdated authors and contributors.\n\n### 2.2.0 [See changelog](https://gist.github.com/ichernev/00f837a9baf46a3565e4)\n\nAdded bower support.\n\nLanguage files now use UMD.\n\nCreating moment defaults to current date/month/year.\n\nAdded a bundle of moment and all language files.\n\n### 2.1.0 [See changelog](https://gist.github.com/timrwood/b8c2d90d528eddb53ab5)\n\nAdded better week support.\n\nAdded ability to set offset with `moment#zone`.\n\nAdded ability to set month or weekday from a string.\n\nAdded `moment#min` and `moment#max`\n\n### 2.0.0 [See changelog](https://gist.github.com/timrwood/e72f2eef320ed9e37c51)\n\nAdded short form localized tokens.\n\nAdded ability to define language a string should be parsed in.\n\nAdded support for reversed add/subtract arguments.\n\nAdded support for `endOf('week')` and `startOf('week')`.\n\nFixed the logic for `moment#diff(Moment, 'months')` and `moment#diff(Moment, 'years')`\n\n`moment#diff` now floors instead of rounds.\n\nNormalized `moment#toString`.\n\nAdded `isSame`, `isAfter`, and `isBefore` methods.\n\nAdded better week support.\n\nAdded `moment#toJSON`\n\nBugfix: Fixed parsing of first century dates\n\nBugfix: Parsing 10Sep2001 should work as expected\n\nBugfix: Fixed wierdness with `moment.utc()` parsing.\n\nChanged language ordinal method to return the number + ordinal instead of just the ordinal.\n\nChanged two digit year parsing cutoff to match strptime.\n\nRemoved `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`.\n\nRemoved `moment.humanizeDuration()` in favor of `moment.duration().humanize()`.\n\nRemoved the lang data objects from the top level namespace.\n\nDuplicate `Date` passed to `moment()` instead of referencing it.\n\n### 1.7.2 [See discussion](https://github.com/timrwood/moment/issues/456)\n\nBugfixes\n\n### 1.7.1 [See discussion](https://github.com/timrwood/moment/issues/384)\n\nBugfixes\n\n### 1.7.0 [See discussion](https://github.com/timrwood/moment/issues/288)\n\nAdded `moment.fn.endOf()` and `moment.fn.startOf()`.\n\nAdded validation via `moment.fn.isValid()`.\n\nMade formatting method 3x faster. http://jsperf.com/momentjs-cached-format-functions\n\nAdd support for month/weekday callbacks in `moment.fn.format()`\n\nAdded instance specific languages.\n\nAdded two letter weekday abbreviations with the formatting token `dd`.\n\nVarious language updates.\n\nVarious bugfixes.\n\n### 1.6.0 [See discussion](https://github.com/timrwood/moment/pull/268)\n\nAdded Durations.\n\nRevamped parser to support parsing non-separated strings (YYYYMMDD vs YYYY-MM-DD).\n\nAdded support for millisecond parsing and formatting tokens (S SS SSS)\n\nAdded a getter for `moment.lang()`\n\nVarious bugfixes.\n\nThere are a few things deprecated in the 1.6.0 release.\n\n1. The format tokens `z` and `zz` (timezone abbreviations like EST CST MST etc) will no longer be supported. Due to inconsistent browser support, we are unable to consistently produce this value. See [this issue](https://github.com/timrwood/moment/issues/162) for more background.\n\n2. The method `moment.fn.native` is deprecated in favor of `moment.fn.toDate`. There continue to be issues with Google Closure Compiler throwing errors when using `native`, even in valid instances.\n\n3. The way to customize am/pm strings is being changed. This would only affect you if you created a custom language file. For more information, see [this issue](https://github.com/timrwood/moment/pull/222).\n\n### 1.5.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=10&page=1&state=closed)\n\nAdded UTC mode.\n\nAdded automatic ISO8601 parsing.\n\nVarious bugfixes.\n\n### 1.4.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=8&state=closed)\n\nAdded `moment.fn.toDate` as a replacement for `moment.fn.native`.\n\nAdded `moment.fn.sod` and `moment.fn.eod` to get the start and end of day.\n\nVarious bugfixes.\n\n### 1.3.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=7&state=closed)\n\nAdded support for parsing month names in the current language.\n\nAdded escape blocks for parsing tokens.\n\nAdded `moment.fn.calendar` to format strings like 'Today 2:30 PM', 'Tomorrow 1:25 AM', and 'Last Sunday 4:30 AM'.\n\nAdded `moment.fn.day` as a setter.\n\nVarious bugfixes\n\n### 1.2.0 [See milestone](https://github.com/timrwood/moment/issues?milestone=4&state=closed)\n\nAdded timezones to parser and formatter.\n\nAdded `moment.fn.isDST`.\n\nAdded `moment.fn.zone` to get the timezone offset in minutes.\n\n### 1.1.2 [See milestone](https://github.com/timrwood/moment/issues?milestone=6&state=closed)\n\nVarious bugfixes\n\n### 1.1.1 [See milestone](https://github.com/timrwood/moment/issues?milestone=5&state=closed)\n\nAdded time specific diffs (months, days, hours, etc)\n\n### 1.1.0\n\nAdded `moment.fn.format` localized masks. 'L LL LLL LLLL' [issue 29](https://github.com/timrwood/moment/pull/29)\n\nFixed [issue 31](https://github.com/timrwood/moment/pull/31).\n\n### 1.0.1\n\nAdded `moment.version` to get the current version.\n\nRemoved `window !== undefined` when checking if module exists to support browserify. [issue 25](https://github.com/timrwood/moment/pull/25)\n\n### 1.0.0\n\nAdded convenience methods for getting and setting date parts.\n\nAdded better support for `moment.add()`.\n\nAdded better lang support in NodeJS.\n\nRenamed library from underscore.date to Moment.js\n\n### 0.6.1\n\nAdded Portuguese, Italian, and French language support\n\n### 0.6.0\n\nAdded _date.lang() support.\nAdded support for passing multiple formats to try to parse a date. _date(\"07-10-1986\", [\"MM-DD-YYYY\", \"YYYY-MM-DD\"]);\nMade parse from string and single format 25% faster.\n\n### 0.5.2\n\nBugfix for [issue 8](https://github.com/timrwood/underscore.date/pull/8) and [issue 9](https://github.com/timrwood/underscore.date/pull/9).\n\n### 0.5.1\n\nBugfix for [issue 5](https://github.com/timrwood/underscore.date/pull/5).\n\n### 0.5.0\n\nDropped the redundant `_date.date()` in favor of `_date()`.\nRemoved `_date.now()`, as it is a duplicate of `_date()` with no parameters.\nRemoved `_date.isLeapYear(yearNumber)`. Use `_date([yearNumber]).isLeapYear()` instead.\nExposed customization options through the `_date.relativeTime`, `_date.weekdays`, `_date.weekdaysShort`, `_date.months`, `_date.monthsShort`, and `_date.ordinal` variables instead of the `_date.customize()` function.\n\n### 0.4.1\n\nAdded date input formats for input strings.\n\n### 0.4.0\n\nAdded underscore.date to npm. Removed dependencies on underscore.\n\n### 0.3.2\n\nAdded `'z'` and `'zz'` to `_.date().format()`. Cleaned up some redundant code to trim off some bytes.\n\n### 0.3.1\n\nCleaned up the namespace. Moved all date manipulation and display functions to the _.date() object.\n\n### 0.3.0\n\nSwitched to the Underscore methodology of not mucking with the native objects' prototypes.\nMade chaining possible.\n\n### 0.2.1\n\nChanged date names to be a more pseudo standardized 'dddd, MMMM Do YYYY, h:mm:ss a'.\nAdded `Date.prototype` functions `add`, `subtract`, `isdst`, and `isleapyear`.\n\n### 0.2.0\n\nChanged function names to be more concise.\nChanged date format from php date format to custom format.\n\n### 0.1.0\n\nInitial release\n\n"
  },
  {
    "path": "www/lib/moment/LICENSE",
    "content": "Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "www/lib/moment/Moment.js.nuspec",
    "content": "<?xml version=\"1.0\"?>\r\n<package xmlns=\"http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd\">\r\n    <metadata>\r\n        <id>Moment.js</id>\r\n        <version>2.10.2</version>\r\n        <authors>Tim Wood</authors>\r\n        <owners>Cory Deppen, Iskren Chernev</owners>\r\n        <description>A lightweight javascript date library for parsing, manipulating, and formatting dates.</description>\r\n        <releaseNotes>\r\n            - Add LTS localised format that includes seconds\r\n            - Added formatToken 'x' for unix offset in milliseconds #1938\r\n            - Support 24:00:00.000 to mean next day, at midnight.\r\n            - Accept 'date' key when creating moment with object\r\n            - Use native toISOString when we can\r\n            - Some bugfixes and language improvements\r\n        </releaseNotes>\r\n        <projectUrl>http://momentjs.com/</projectUrl>\r\n        <iconUrl>http://pbs.twimg.com/profile_images/482670411402858496/Xrtdc94q_normal.png</iconUrl>\r\n        <licenseUrl>https://raw.github.com/timrwood/moment/master/LICENSE</licenseUrl>\r\n        <tags>JavaScript date time browser node.js</tags>\r\n  </metadata>\r\n  <files>\r\n      <file src=\"moment.js\" target=\"Content\\Scripts\" />\r\n      <file src=\"min/moment.min.js\" target=\"Content\\Scripts\" />\r\n      <file src=\"min/moment-with-locales.js\" target=\"Content\\Scripts\" />\r\n      <file src=\"min/moment-with-locales.min.js\" target=\"Content\\Scripts\" />\r\n  </files>\r\n</package>\r\n"
  },
  {
    "path": "www/lib/moment/README.md",
    "content": "[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]\n\nA lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.\n\n## [Documentation](http://momentjs.com/docs/)\n\n## Port to ES6 (version 2.10.0)\n\nMoment 2.10.0 does not bring any new features, but the code is now written in\nes6 modules and placed inside `src/`. Previously `moment.js`, `locale/*.js` and\n`test/moment/*.js`, `test/locale/*.js` contained the source of the project. Now\nthe source is in `src/`, temporary build (es5) files are placed under\n`build/umd/` (for running tests during development), and the `moment.js` and\n`locale/*.js` files are updated only on release.\n\nIf you want to use a particular revision of the code, make sure to run\n`grunt transpile update-index`, so `moment.js` and `locales/*.js` are synced\nwith `src/*`. We might place that in a commit hook in the future.\n\n## Upgrading to 2.0.0\n\nThere are a number of small backwards incompatible changes with version 2.0.0. [See the full descriptions here](https://gist.github.com/timrwood/e72f2eef320ed9e37c51#backwards-incompatible-changes)\n\n * Changed language ordinal method to return the number + ordinal instead of just the ordinal.\n\n * Changed two digit year parsing cutoff to match strptime.\n\n * Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`.\n\n * Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`.\n\n * Removed the lang data objects from the top level namespace.\n\n * Duplicate `Date` passed to `moment()` instead of referencing it.\n\n## [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)\n\n## [Contributing](https://github.com/moment/moment/blob/develop/CONTRIBUTING.md)\n\nWe're looking for co-maintainers! If you want to become a master of time please\nwrite to [ichernev](https://github.com/ichernev).\n\n## License\n\nMoment.js is freely distributable under the terms of the [MIT license](https://github.com/moment/moment/blob/develop/LICENSE).\n\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: LICENSE\n\n[npm-url]: https://npmjs.org/package/moment\n[npm-version-image]: http://img.shields.io/npm/v/moment.svg?style=flat\n[npm-downloads-image]: http://img.shields.io/npm/dm/moment.svg?style=flat\n\n[travis-url]: http://travis-ci.org/moment/moment\n[travis-image]: http://img.shields.io/travis/moment/moment/develop.svg?style=flat\n"
  },
  {
    "path": "www/lib/moment/benchmarks/clone.js",
    "content": "var Benchmark = require('benchmark'),\n    moment = require(\"./../moment.js\"),\n    base = moment('2013-05-25');\n\nmodule.exports = {\n  name: 'clone',\n  onComplete: function(){console.log('done');},\n  fn: function(){base.clone();},\n  async: true\n};\n"
  },
  {
    "path": "www/lib/moment/bower.json",
    "content": "{\n  \"name\": \"moment\",\n  \"version\": \"2.10.2\",\n  \"main\": \"moment.js\",\n  \"ignore\": [\n    \"**/.*\",\n    \"node_modules\",\n    \"bower_components\",\n    \"test\",\n    \"tests\",\n    \"tasks\",\n    \"component.json\",\n    \"composer.json\",\n    \"CONTRIBUTING.md\",\n    \"ender.js\",\n    \"Gruntfile.js\",\n    \"package.js\",\n    \"package.json\"\n  ]\n}\n"
  },
  {
    "path": "www/lib/moment/locale/af.js",
    "content": "//! moment.js locale configuration\n//! locale : afrikaans (af)\n//! author : Werner Mollentze : https://github.com/wernerm\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var af = moment.defineLocale('af', {\n        months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),\n        weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n        weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n        meridiemParse: /vm|nm/i,\n        isPM : function (input) {\n            return /^nm$/i.test(input);\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'vm' : 'VM';\n            } else {\n                return isLower ? 'nm' : 'NM';\n            }\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Vandag om] LT',\n            nextDay : '[Môre om] LT',\n            nextWeek : 'dddd [om] LT',\n            lastDay : '[Gister om] LT',\n            lastWeek : '[Laas] dddd [om] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'oor %s',\n            past : '%s gelede',\n            s : '\\'n paar sekondes',\n            m : '\\'n minuut',\n            mm : '%d minute',\n            h : '\\'n uur',\n            hh : '%d ure',\n            d : '\\'n dag',\n            dd : '%d dae',\n            M : '\\'n maand',\n            MM : '%d maande',\n            y : '\\'n jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter\n        },\n        week : {\n            dow : 1, // Maandag is die eerste dag van die week.\n            doy : 4  // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n        }\n    });\n\n    return af;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ar-ma.js",
    "content": "//! moment.js locale configuration\n//! locale : Moroccan Arabic (ar-ma)\n//! author : ElFadili Yassine : https://github.com/ElFadiliY\n//! author : Abdel Said : https://github.com/abdelsaid\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ar_ma = moment.defineLocale('ar-ma', {\n        months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ar_ma;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ar-sa.js",
    "content": "//! moment.js locale configuration\n//! locale : Arabic Saudi Arabia (ar-sa)\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    };\n\n    var ar_sa = moment.defineLocale('ar-sa', {\n        months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ar_sa;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ar-tn.js",
    "content": "//! moment.js locale configuration\n//! locale  : Tunisian Arabic (ar-tn)\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ar_tn = moment.defineLocale('ar-tn', {\n        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return ar_tn;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ar.js",
    "content": "//! moment.js locale configuration\n//! Locale: Arabic (ar)\n//! Author: Abdel Said: https://github.com/abdelsaid\n//! Changes in months, weekdays: Ahmed Elkhatib\n//! Native plural forms: forabi https://github.com/forabi\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    }, pluralForm = function (n) {\n        return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;\n    }, plurals = {\n        s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n        m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n        h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n        d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n        M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n        y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n    }, pluralize = function (u) {\n        return function (number, withoutSuffix, string, isFuture) {\n            var f = pluralForm(number),\n                str = plurals[u][pluralForm(number)];\n            if (f === 2) {\n                str = str[withoutSuffix ? 0 : 1];\n            }\n            return str.replace(/%d/i, number);\n        };\n    }, months = [\n        'كانون الثاني يناير',\n        'شباط فبراير',\n        'آذار مارس',\n        'نيسان أبريل',\n        'أيار مايو',\n        'حزيران يونيو',\n        'تموز يوليو',\n        'آب أغسطس',\n        'أيلول سبتمبر',\n        'تشرين الأول أكتوبر',\n        'تشرين الثاني نوفمبر',\n        'كانون الأول ديسمبر'\n    ];\n\n    var ar = moment.defineLocale('ar', {\n        months : months,\n        monthsShort : months,\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'بعد %s',\n            past : 'منذ %s',\n            s : pluralize('s'),\n            m : pluralize('m'),\n            mm : pluralize('m'),\n            h : pluralize('h'),\n            hh : pluralize('h'),\n            d : pluralize('d'),\n            dd : pluralize('d'),\n            M : pluralize('M'),\n            MM : pluralize('M'),\n            y : pluralize('y'),\n            yy : pluralize('y')\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ar;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/az.js",
    "content": "//! moment.js locale configuration\n//! locale : azerbaijani (az)\n//! author : topchiyev : https://github.com/topchiyev\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var suffixes = {\n        1: '-inci',\n        5: '-inci',\n        8: '-inci',\n        70: '-inci',\n        80: '-inci',\n        2: '-nci',\n        7: '-nci',\n        20: '-nci',\n        50: '-nci',\n        3: '-üncü',\n        4: '-üncü',\n        100: '-üncü',\n        6: '-ncı',\n        9: '-uncu',\n        10: '-uncu',\n        30: '-uncu',\n        60: '-ıncı',\n        90: '-ıncı'\n    };\n\n    var az = moment.defineLocale('az', {\n        months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),\n        monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n        weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),\n        weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n        weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[sabah saat] LT',\n            nextWeek : '[gələn həftə] dddd [saat] LT',\n            lastDay : '[dünən] LT',\n            lastWeek : '[keçən həftə] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s əvvəl',\n            s : 'birneçə saniyyə',\n            m : 'bir dəqiqə',\n            mm : '%d dəqiqə',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir il',\n            yy : '%d il'\n        },\n        meridiemParse: /gecə|səhər|gündüz|axşam/,\n        isPM : function (input) {\n            return /^(gündüz|axşam)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'gecə';\n            } else if (hour < 12) {\n                return 'səhər';\n            } else if (hour < 17) {\n                return 'gündüz';\n            } else {\n                return 'axşam';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '-ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return az;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/be.js",
    "content": "//! moment.js locale configuration\n//! locale : belarusian (be)\n//! author : Dmitry Demidov : https://github.com/demidov91\n//! author: Praleska: http://praleska.pro/\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n            'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n            'dd': 'дзень_дні_дзён',\n            'MM': 'месяц_месяцы_месяцаў',\n            'yy': 'год_гады_гадоў'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвіліна' : 'хвіліну';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'гадзіна' : 'гадзіну';\n        }\n        else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    function monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n            'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),\n            'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:мінулую|наступную)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var be = moment.defineLocale('be', {\n        months : monthsCaseReplace,\n        monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n        weekdays : weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сёння ў] LT',\n            nextDay: '[Заўтра ў] LT',\n            lastDay: '[Учора ў] LT',\n            nextWeek: function () {\n                return '[У] dddd [ў] LT';\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return '[У мінулую] dddd [ў] LT';\n                case 1:\n                case 2:\n                case 4:\n                    return '[У мінулы] dddd [ў] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'праз %s',\n            past : '%s таму',\n            s : 'некалькі секунд',\n            m : relativeTimeWithPlural,\n            mm : relativeTimeWithPlural,\n            h : relativeTimeWithPlural,\n            hh : relativeTimeWithPlural,\n            d : 'дзень',\n            dd : relativeTimeWithPlural,\n            M : 'месяц',\n            MM : relativeTimeWithPlural,\n            y : 'год',\n            yy : relativeTimeWithPlural\n        },\n        meridiemParse: /ночы|раніцы|дня|вечара/,\n        isPM : function (input) {\n            return /^(дня|вечара)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночы';\n            } else if (hour < 12) {\n                return 'раніцы';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечара';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(і|ы|га)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';\n            case 'D':\n                return number + '-га';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return be;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/bg.js",
    "content": "//! moment.js locale configuration\n//! locale : bulgarian (bg)\n//! author : Krasen Borisov : https://github.com/kraz\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var bg = moment.defineLocale('bg', {\n        months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Днес в] LT',\n            nextDay : '[Утре в] LT',\n            nextWeek : 'dddd [в] LT',\n            lastDay : '[Вчера в] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[В изминалата] dddd [в] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[В изминалия] dddd [в] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'след %s',\n            past : 'преди %s',\n            s : 'няколко секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дни',\n            M : 'месец',\n            MM : '%d месеца',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return bg;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/bn.js",
    "content": "//! moment.js locale configuration\n//! locale : Bengali (bn)\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '১',\n        '2': '২',\n        '3': '৩',\n        '4': '৪',\n        '5': '৫',\n        '6': '৬',\n        '7': '৭',\n        '8': '৮',\n        '9': '৯',\n        '0': '০'\n    },\n    numberMap = {\n        '১': '1',\n        '২': '2',\n        '৩': '3',\n        '৪': '4',\n        '৫': '5',\n        '৬': '6',\n        '৭': '7',\n        '৮': '8',\n        '৯': '9',\n        '০': '0'\n    };\n\n    var bn = moment.defineLocale('bn', {\n        months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),\n        monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),\n        weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'),\n        weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'),\n        weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm সময়',\n            LTS : 'A h:mm:ss সময়',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[আজ] LT',\n            nextDay : '[আগামীকাল] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[গতকাল] LT',\n            lastWeek : '[গত] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s পরে',\n            past : '%s আগে',\n            s : 'কএক সেকেন্ড',\n            m : 'এক মিনিট',\n            mm : '%d মিনিট',\n            h : 'এক ঘন্টা',\n            hh : '%d ঘন্টা',\n            d : 'এক দিন',\n            dd : '%d দিন',\n            M : 'এক মাস',\n            MM : '%d মাস',\n            y : 'এক বছর',\n            yy : '%d বছর'\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /রাত|শকাল|দুপুর|বিকেল|রাত/,\n        isPM: function (input) {\n            return /^(দুপুর|বিকেল|রাত)$/.test(input);\n        },\n        //Bengali is a vast language its spoken\n        //in different forms in various parts of the world.\n        //I have just generalized with most common one used\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 10) {\n                return 'শকাল';\n            } else if (hour < 17) {\n                return 'দুপুর';\n            } else if (hour < 20) {\n                return 'বিকেল';\n            } else {\n                return 'রাত';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return bn;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/bo.js",
    "content": "//! moment.js locale configuration\n//! locale : tibetan (bo)\n//! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '༡',\n        '2': '༢',\n        '3': '༣',\n        '4': '༤',\n        '5': '༥',\n        '6': '༦',\n        '7': '༧',\n        '8': '༨',\n        '9': '༩',\n        '0': '༠'\n    },\n    numberMap = {\n        '༡': '1',\n        '༢': '2',\n        '༣': '3',\n        '༤': '4',\n        '༥': '5',\n        '༦': '6',\n        '༧': '7',\n        '༨': '8',\n        '༩': '9',\n        '༠': '0'\n    };\n\n    var bo = moment.defineLocale('bo', {\n        months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),\n        weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[དི་རིང] LT',\n            nextDay : '[སང་ཉིན] LT',\n            nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',\n            lastDay : '[ཁ་སང] LT',\n            lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s ལ་',\n            past : '%s སྔན་ལ',\n            s : 'ལམ་སང',\n            m : 'སྐར་མ་གཅིག',\n            mm : '%d སྐར་མ',\n            h : 'ཆུ་ཚོད་གཅིག',\n            hh : '%d ཆུ་ཚོད',\n            d : 'ཉིན་གཅིག',\n            dd : '%d ཉིན་',\n            M : 'ཟླ་བ་གཅིག',\n            MM : '%d ཟླ་བ',\n            y : 'ལོ་གཅིག',\n            yy : '%d ལོ'\n        },\n        preparse: function (string) {\n            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n        isPM: function (input) {\n            return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'མཚན་མོ';\n            } else if (hour < 10) {\n                return 'ཞོགས་ཀས';\n            } else if (hour < 17) {\n                return 'ཉིན་གུང';\n            } else if (hour < 20) {\n                return 'དགོང་དག';\n            } else {\n                return 'མཚན་མོ';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return bo;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/br.js",
    "content": "//! moment.js locale configuration\n//! locale : breton (br)\n//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function relativeTimeWithMutation(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'munutenn',\n            'MM': 'miz',\n            'dd': 'devezh'\n        };\n        return number + ' ' + mutation(format[key], number);\n    }\n    function specialMutationForYears(number) {\n        switch (lastNumber(number)) {\n        case 1:\n        case 3:\n        case 4:\n        case 5:\n        case 9:\n            return number + ' bloaz';\n        default:\n            return number + ' vloaz';\n        }\n    }\n    function lastNumber(number) {\n        if (number > 9) {\n            return lastNumber(number % 10);\n        }\n        return number;\n    }\n    function mutation(text, number) {\n        if (number === 2) {\n            return softMutation(text);\n        }\n        return text;\n    }\n    function softMutation(text) {\n        var mutationTable = {\n            'm': 'v',\n            'b': 'v',\n            'd': 'z'\n        };\n        if (mutationTable[text.charAt(0)] === undefined) {\n            return text;\n        }\n        return mutationTable[text.charAt(0)] + text.substring(1);\n    }\n\n    var br = moment.defineLocale('br', {\n        months : 'Genver_C\\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),\n        monthsShort : 'Gen_C\\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n        weekdays : 'Sul_Lun_Meurzh_Merc\\'her_Yaou_Gwener_Sadorn'.split('_'),\n        weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n        weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h[e]mm A',\n            LTS : 'h[e]mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D [a viz] MMMM YYYY',\n            LLL : 'D [a viz] MMMM YYYY LT',\n            LLLL : 'dddd, D [a viz] MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Hiziv da] LT',\n            nextDay : '[Warc\\'hoazh da] LT',\n            nextWeek : 'dddd [da] LT',\n            lastDay : '[Dec\\'h da] LT',\n            lastWeek : 'dddd [paset da] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'a-benn %s',\n            past : '%s \\'zo',\n            s : 'un nebeud segondennoù',\n            m : 'ur vunutenn',\n            mm : relativeTimeWithMutation,\n            h : 'un eur',\n            hh : '%d eur',\n            d : 'un devezh',\n            dd : relativeTimeWithMutation,\n            M : 'ur miz',\n            MM : relativeTimeWithMutation,\n            y : 'ur bloaz',\n            yy : specialMutationForYears\n        },\n        ordinalParse: /\\d{1,2}(añ|vet)/,\n        ordinal : function (number) {\n            var output = (number === 1) ? 'añ' : 'vet';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return br;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/bs.js",
    "content": "//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var bs = moment.defineLocale('bs', {\n        months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : translate,\n            mm     : translate,\n            h      : translate,\n            hh     : translate,\n            d      : 'dan',\n            dd     : translate,\n            M      : 'mjesec',\n            MM     : translate,\n            y      : 'godinu',\n            yy     : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return bs;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ca.js",
    "content": "//! moment.js locale configuration\n//! locale : catalan (ca)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ca = moment.defineLocale('ca', {\n        months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n        monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),\n        weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n        weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextDay : function () {\n                return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastDay : function () {\n                return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'fa %s',\n            s : 'uns segons',\n            m : 'un minut',\n            mm : '%d minuts',\n            h : 'una hora',\n            hh : '%d hores',\n            d : 'un dia',\n            dd : '%d dies',\n            M : 'un mes',\n            MM : '%d mesos',\n            y : 'un any',\n            yy : '%d anys'\n        },\n        ordinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal : function (number, period) {\n            var output = (number === 1) ? 'r' :\n                (number === 2) ? 'n' :\n                (number === 3) ? 'r' :\n                (number === 4) ? 't' : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return ca;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/cs.js",
    "content": "//! moment.js locale configuration\n//! locale : czech (cs)\n//! author : petrbela : https://github.com/petrbela\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),\n        monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');\n    function plural(n) {\n        return (n > 1) && (n < 5) && (~~(n / 10) !== 1);\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'minuty' : 'minut');\n            } else {\n                return result + 'minutami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'hodiny' : 'hodin');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'dny' : 'dní');\n            } else {\n                return result + 'dny';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'měsíce' : 'měsíců');\n            } else {\n                return result + 'měsíci';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'roky' : 'let');\n            } else {\n                return result + 'lety';\n            }\n            break;\n        }\n    }\n\n    var cs = moment.defineLocale('cs', {\n        months : months,\n        monthsShort : monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(months, monthsShort)),\n        weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n        weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),\n        weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes v] LT',\n            nextDay: '[zítra v] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v neděli v] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [v] LT';\n                case 3:\n                    return '[ve středu v] LT';\n                case 4:\n                    return '[ve čtvrtek v] LT';\n                case 5:\n                    return '[v pátek v] LT';\n                case 6:\n                    return '[v sobotu v] LT';\n                }\n            },\n            lastDay: '[včera v] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulou neděli v] LT';\n                case 1:\n                case 2:\n                    return '[minulé] dddd [v] LT';\n                case 3:\n                    return '[minulou středu v] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [v] LT';\n                case 6:\n                    return '[minulou sobotu v] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'před %s',\n            s : translate,\n            m : translate,\n            mm : translate,\n            h : translate,\n            hh : translate,\n            d : translate,\n            dd : translate,\n            M : translate,\n            MM : translate,\n            y : translate,\n            yy : translate\n        },\n        ordinalParse : /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return cs;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/cv.js",
    "content": "//! moment.js locale configuration\n//! locale : chuvash (cv)\n//! author : Anatoly Mironov : https://github.com/mirontoli\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var cv = moment.defineLocale('cv', {\n        months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'),\n        monthsShort : 'кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш'.split('_'),\n        weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун'.split('_'),\n        weekdaysShort : 'выр_тун_ытл_юн_кĕç_эрн_шăм'.split('_'),\n        weekdaysMin : 'вр_тн_ыт_юн_кç_эр_шм'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]',\n            LLL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT',\n            LLLL : 'dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT'\n        },\n        calendar : {\n            sameDay: '[Паян] LT [сехетре]',\n            nextDay: '[Ыран] LT [сехетре]',\n            lastDay: '[Ĕнер] LT [сехетре]',\n            nextWeek: '[Çитес] dddd LT [сехетре]',\n            lastWeek: '[Иртнĕ] dddd LT [сехетре]',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (output) {\n                var affix = /сехет$/i.exec(output) ? 'рен' : /çул$/i.exec(output) ? 'тан' : 'ран';\n                return output + affix;\n            },\n            past : '%s каялла',\n            s : 'пĕр-ик çеккунт',\n            m : 'пĕр минут',\n            mm : '%d минут',\n            h : 'пĕр сехет',\n            hh : '%d сехет',\n            d : 'пĕр кун',\n            dd : '%d кун',\n            M : 'пĕр уйăх',\n            MM : '%d уйăх',\n            y : 'пĕр çул',\n            yy : '%d çул'\n        },\n        ordinalParse: /\\d{1,2}-мĕш/,\n        ordinal : '%d-мĕш',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return cv;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/cy.js",
    "content": "//! moment.js locale configuration\n//! locale : Welsh (cy)\n//! author : Robert Allen\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var cy = moment.defineLocale('cy', {\n        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),\n        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),\n        weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),\n        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n        // time formats are the same as en-gb\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Heddiw am] LT',\n            nextDay: '[Yfory am] LT',\n            nextWeek: 'dddd [am] LT',\n            lastDay: '[Ddoe am] LT',\n            lastWeek: 'dddd [diwethaf am] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'mewn %s',\n            past: '%s yn ôl',\n            s: 'ychydig eiliadau',\n            m: 'munud',\n            mm: '%d munud',\n            h: 'awr',\n            hh: '%d awr',\n            d: 'diwrnod',\n            dd: '%d diwrnod',\n            M: 'mis',\n            MM: '%d mis',\n            y: 'blwyddyn',\n            yy: '%d flynedd'\n        },\n        ordinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n        ordinal: function (number) {\n            var b = number,\n                output = '',\n                lookup = [\n                    '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed\n                    'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed\n                ];\n            if (b > 20) {\n                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                    output = 'fed'; // not 30ain, 70ain or 90ain\n                } else {\n                    output = 'ain';\n                }\n            } else if (b > 0) {\n                output = lookup[b];\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return cy;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/da.js",
    "content": "//! moment.js locale configuration\n//! locale : danish (da)\n//! author : Ulrik Nielsen : https://github.com/mrbase\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var da = moment.defineLocale('da', {\n        months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd [d.] D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[I dag kl.] LT',\n            nextDay : '[I morgen kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[I går kl.] LT',\n            lastWeek : '[sidste] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : '%s siden',\n            s : 'få sekunder',\n            m : 'et minut',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dage',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'et år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return da;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/de-at.js",
    "content": "//! moment.js locale configuration\n//! locale : austrian german (de-at)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de_at = moment.defineLocale('de-at', {\n        months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : processRelativeTime,\n            mm : '%d Minuten',\n            h : processRelativeTime,\n            hh : '%d Stunden',\n            d : processRelativeTime,\n            dd : processRelativeTime,\n            M : processRelativeTime,\n            MM : processRelativeTime,\n            y : processRelativeTime,\n            yy : processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return de_at;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/de.js",
    "content": "//! moment.js locale configuration\n//! locale : german (de)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de = moment.defineLocale('de', {\n        months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : processRelativeTime,\n            mm : '%d Minuten',\n            h : processRelativeTime,\n            hh : '%d Stunden',\n            d : processRelativeTime,\n            dd : processRelativeTime,\n            M : processRelativeTime,\n            MM : processRelativeTime,\n            y : processRelativeTime,\n            yy : processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return de;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/el.js",
    "content": "//! moment.js locale configuration\n//! locale : modern greek (el)\n//! author : Aggelos Karalias : https://github.com/mehiel\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var el = moment.defineLocale('el', {\n        monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),\n        monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),\n        months : function (momentToFormat, format) {\n            if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'\n                return this._monthsGenitiveEl[momentToFormat.month()];\n            } else {\n                return this._monthsNominativeEl[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n        weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),\n        weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n        weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'μμ' : 'ΜΜ';\n            } else {\n                return isLower ? 'πμ' : 'ΠΜ';\n            }\n        },\n        isPM : function (input) {\n            return ((input + '').toLowerCase()[0] === 'μ');\n        },\n        meridiemParse : /[ΠΜ]\\.?Μ?\\.?/i,\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendarEl : {\n            sameDay : '[Σήμερα {}] LT',\n            nextDay : '[Αύριο {}] LT',\n            nextWeek : 'dddd [{}] LT',\n            lastDay : '[Χθες {}] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                    case 6:\n                        return '[το προηγούμενο] dddd [{}] LT';\n                    default:\n                        return '[την προηγούμενη] dddd [{}] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        calendar : function (key, mom) {\n            var output = this._calendarEl[key],\n                hours = mom && mom.hours();\n            if (typeof output === 'function') {\n                output = output.apply(mom);\n            }\n            return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));\n        },\n        relativeTime : {\n            future : 'σε %s',\n            past : '%s πριν',\n            s : 'λίγα δευτερόλεπτα',\n            m : 'ένα λεπτό',\n            mm : '%d λεπτά',\n            h : 'μία ώρα',\n            hh : '%d ώρες',\n            d : 'μία μέρα',\n            dd : '%d μέρες',\n            M : 'ένας μήνας',\n            MM : '%d μήνες',\n            y : 'ένας χρόνος',\n            yy : '%d χρόνια'\n        },\n        ordinalParse: /\\d{1,2}η/,\n        ordinal: '%dη',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4st is the first week of the year.\n        }\n    });\n\n    return el;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/en-au.js",
    "content": "//! moment.js locale configuration\n//! locale : australian english (en-au)\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var en_au = moment.defineLocale('en-au', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return en_au;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/en-ca.js",
    "content": "//! moment.js locale configuration\n//! locale : canadian english (en-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var en_ca = moment.defineLocale('en-ca', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM, YYYY',\n            LLL : 'D MMMM, YYYY LT',\n            LLLL : 'dddd, D MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        }\n    });\n\n    return en_ca;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/en-gb.js",
    "content": "//! moment.js locale configuration\n//! locale : great britain english (en-gb)\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var en_gb = moment.defineLocale('en-gb', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return en_gb;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/eo.js",
    "content": "//! moment.js locale configuration\n//! locale : esperanto (eo)\n//! author : Colin Dean : https://github.com/colindean\n//! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.\n//!          Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var eo = moment.defineLocale('eo', {\n        months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),\n        weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),\n        weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D[-an de] MMMM, YYYY',\n            LLL : 'D[-an de] MMMM, YYYY LT',\n            LLLL : 'dddd, [la] D[-an de] MMMM, YYYY LT'\n        },\n        meridiemParse: /[ap]\\.t\\.m/i,\n        isPM: function (input) {\n            return input.charAt(0).toLowerCase() === 'p';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'p.t.m.' : 'P.T.M.';\n            } else {\n                return isLower ? 'a.t.m.' : 'A.T.M.';\n            }\n        },\n        calendar : {\n            sameDay : '[Hodiaŭ je] LT',\n            nextDay : '[Morgaŭ je] LT',\n            nextWeek : 'dddd [je] LT',\n            lastDay : '[Hieraŭ je] LT',\n            lastWeek : '[pasinta] dddd [je] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'je %s',\n            past : 'antaŭ %s',\n            s : 'sekundoj',\n            m : 'minuto',\n            mm : '%d minutoj',\n            h : 'horo',\n            hh : '%d horoj',\n            d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo\n            dd : '%d tagoj',\n            M : 'monato',\n            MM : '%d monatoj',\n            y : 'jaro',\n            yy : '%d jaroj'\n        },\n        ordinalParse: /\\d{1,2}a/,\n        ordinal : '%da',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return eo;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/es.js",
    "content": "//! moment.js locale configuration\n//! locale : spanish (es)\n//! author : Julio Napurí : https://github.com/julionc\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\n    var es = moment.defineLocale('es', {\n        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastDay : function () {\n                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'hace %s',\n            s : 'unos segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'una hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un año',\n            yy : '%d años'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return es;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/et.js",
    "content": "//! moment.js locale configuration\n//! locale : estonian (et)\n//! author : Henry Kehlmann : https://github.com/madhenry\n//! improvements : Illimar Tambek : https://github.com/ragulka\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n            'm' : ['ühe minuti', 'üks minut'],\n            'mm': [number + ' minuti', number + ' minutit'],\n            'h' : ['ühe tunni', 'tund aega', 'üks tund'],\n            'hh': [number + ' tunni', number + ' tundi'],\n            'd' : ['ühe päeva', 'üks päev'],\n            'M' : ['kuu aja', 'kuu aega', 'üks kuu'],\n            'MM': [number + ' kuu', number + ' kuud'],\n            'y' : ['ühe aasta', 'aasta', 'üks aasta'],\n            'yy': [number + ' aasta', number + ' aastat']\n        };\n        if (withoutSuffix) {\n            return format[key][2] ? format[key][2] : format[key][1];\n        }\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var et = moment.defineLocale('et', {\n        months        : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n        monthsShort   : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n        weekdays      : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n        weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),\n        weekdaysMin   : 'P_E_T_K_N_R_L'.split('_'),\n        longDateFormat : {\n            LT   : 'H:mm',\n            LTS : 'LT:ss',\n            L    : 'DD.MM.YYYY',\n            LL   : 'D. MMMM YYYY',\n            LLL  : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[Täna,] LT',\n            nextDay  : '[Homme,] LT',\n            nextWeek : '[Järgmine] dddd LT',\n            lastDay  : '[Eile,] LT',\n            lastWeek : '[Eelmine] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s pärast',\n            past   : '%s tagasi',\n            s      : processRelativeTime,\n            m      : processRelativeTime,\n            mm     : processRelativeTime,\n            h      : processRelativeTime,\n            hh     : processRelativeTime,\n            d      : processRelativeTime,\n            dd     : '%d päeva',\n            M      : processRelativeTime,\n            MM     : processRelativeTime,\n            y      : processRelativeTime,\n            yy     : processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return et;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/eu.js",
    "content": "//! moment.js locale configuration\n//! locale : euskara (eu)\n//! author : Eneko Illarramendi : https://github.com/eillarra\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var eu = moment.defineLocale('eu', {\n        months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),\n        monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),\n        weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),\n        weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),\n        weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY[ko] MMMM[ren] D[a]',\n            LLL : 'YYYY[ko] MMMM[ren] D[a] LT',\n            LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] LT',\n            l : 'YYYY-M-D',\n            ll : 'YYYY[ko] MMM D[a]',\n            lll : 'YYYY[ko] MMM D[a] LT',\n            llll : 'ddd, YYYY[ko] MMM D[a] LT'\n        },\n        calendar : {\n            sameDay : '[gaur] LT[etan]',\n            nextDay : '[bihar] LT[etan]',\n            nextWeek : 'dddd LT[etan]',\n            lastDay : '[atzo] LT[etan]',\n            lastWeek : '[aurreko] dddd LT[etan]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s barru',\n            past : 'duela %s',\n            s : 'segundo batzuk',\n            m : 'minutu bat',\n            mm : '%d minutu',\n            h : 'ordu bat',\n            hh : '%d ordu',\n            d : 'egun bat',\n            dd : '%d egun',\n            M : 'hilabete bat',\n            MM : '%d hilabete',\n            y : 'urte bat',\n            yy : '%d urte'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return eu;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fa.js",
    "content": "//! moment.js locale configuration\n//! locale : Persian (fa)\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '۱',\n        '2': '۲',\n        '3': '۳',\n        '4': '۴',\n        '5': '۵',\n        '6': '۶',\n        '7': '۷',\n        '8': '۸',\n        '9': '۹',\n        '0': '۰'\n    }, numberMap = {\n        '۱': '1',\n        '۲': '2',\n        '۳': '3',\n        '۴': '4',\n        '۵': '5',\n        '۶': '6',\n        '۷': '7',\n        '۸': '8',\n        '۹': '9',\n        '۰': '0'\n    };\n\n    var fa = moment.defineLocale('fa', {\n        months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        weekdays : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysShort : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        meridiemParse: /قبل از ظهر|بعد از ظهر/,\n        isPM: function (input) {\n            return /بعد از ظهر/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'قبل از ظهر';\n            } else {\n                return 'بعد از ظهر';\n            }\n        },\n        calendar : {\n            sameDay : '[امروز ساعت] LT',\n            nextDay : '[فردا ساعت] LT',\n            nextWeek : 'dddd [ساعت] LT',\n            lastDay : '[دیروز ساعت] LT',\n            lastWeek : 'dddd [پیش] [ساعت] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'در %s',\n            past : '%s پیش',\n            s : 'چندین ثانیه',\n            m : 'یک دقیقه',\n            mm : '%d دقیقه',\n            h : 'یک ساعت',\n            hh : '%d ساعت',\n            d : 'یک روز',\n            dd : '%d روز',\n            M : 'یک ماه',\n            MM : '%d ماه',\n            y : 'یک سال',\n            yy : '%d سال'\n        },\n        preparse: function (string) {\n            return string.replace(/[۰-۹]/g, function (match) {\n                return numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        ordinalParse: /\\d{1,2}م/,\n        ordinal : '%dم',\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return fa;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fi.js",
    "content": "//! moment.js locale configuration\n//! locale : finnish (fi)\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n        numbersFuture = [\n            'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n            numbersPast[7], numbersPast[8], numbersPast[9]\n        ];\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = '';\n        switch (key) {\n        case 's':\n            return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n        case 'm':\n            return isFuture ? 'minuutin' : 'minuutti';\n        case 'mm':\n            result = isFuture ? 'minuutin' : 'minuuttia';\n            break;\n        case 'h':\n            return isFuture ? 'tunnin' : 'tunti';\n        case 'hh':\n            result = isFuture ? 'tunnin' : 'tuntia';\n            break;\n        case 'd':\n            return isFuture ? 'päivän' : 'päivä';\n        case 'dd':\n            result = isFuture ? 'päivän' : 'päivää';\n            break;\n        case 'M':\n            return isFuture ? 'kuukauden' : 'kuukausi';\n        case 'MM':\n            result = isFuture ? 'kuukauden' : 'kuukautta';\n            break;\n        case 'y':\n            return isFuture ? 'vuoden' : 'vuosi';\n        case 'yy':\n            result = isFuture ? 'vuoden' : 'vuotta';\n            break;\n        }\n        result = verbalNumber(number, isFuture) + ' ' + result;\n        return result;\n    }\n    function verbalNumber(number, isFuture) {\n        return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;\n    }\n\n    var fi = moment.defineLocale('fi', {\n        months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n        monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n        weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n        weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'HH.mm.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'Do MMMM[ta] YYYY',\n            LLL : 'Do MMMM[ta] YYYY, [klo] LT',\n            LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] LT',\n            l : 'D.M.YYYY',\n            ll : 'Do MMM YYYY',\n            lll : 'Do MMM YYYY, [klo] LT',\n            llll : 'ddd, Do MMM YYYY, [klo] LT'\n        },\n        calendar : {\n            sameDay : '[tänään] [klo] LT',\n            nextDay : '[huomenna] [klo] LT',\n            nextWeek : 'dddd [klo] LT',\n            lastDay : '[eilen] [klo] LT',\n            lastWeek : '[viime] dddd[na] [klo] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s päästä',\n            past : '%s sitten',\n            s : translate,\n            m : translate,\n            mm : translate,\n            h : translate,\n            hh : translate,\n            d : translate,\n            dd : translate,\n            M : translate,\n            MM : translate,\n            y : translate,\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return fi;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fo.js",
    "content": "//! moment.js locale configuration\n//! locale : faroese (fo)\n//! author : Ragnar Johannesen : https://github.com/ragnar123\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var fo = moment.defineLocale('fo', {\n        months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),\n        weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n        weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Í dag kl.] LT',\n            nextDay : '[Í morgin kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[Í gjár kl.] LT',\n            lastWeek : '[síðstu] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'um %s',\n            past : '%s síðani',\n            s : 'fá sekund',\n            m : 'ein minutt',\n            mm : '%d minuttir',\n            h : 'ein tími',\n            hh : '%d tímar',\n            d : 'ein dagur',\n            dd : '%d dagar',\n            M : 'ein mánaði',\n            MM : '%d mánaðir',\n            y : 'eitt ár',\n            yy : '%d ár'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return fo;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fr-ca.js",
    "content": "//! moment.js locale configuration\n//! locale : canadian french (fr-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var fr_ca = moment.defineLocale('fr-ca', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        }\n    });\n\n    return fr_ca;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fr.js",
    "content": "//! moment.js locale configuration\n//! locale : french (fr)\n//! author : John Fischer : https://github.com/jfroffice\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var fr = moment.defineLocale('fr', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return fr;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/fy.js",
    "content": "//! moment.js locale configuration\n//! locale : frisian (fy)\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n        monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n    var fy = moment.defineLocale('fy', {\n        months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),\n        weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),\n        weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[hjoed om] LT',\n            nextDay: '[moarn om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[juster om] LT',\n            lastWeek: '[ôfrûne] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'oer %s',\n            past : '%s lyn',\n            s : 'in pear sekonden',\n            m : 'ien minút',\n            mm : '%d minuten',\n            h : 'ien oere',\n            hh : '%d oeren',\n            d : 'ien dei',\n            dd : '%d dagen',\n            M : 'ien moanne',\n            MM : '%d moannen',\n            y : 'ien jier',\n            yy : '%d jierren'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return fy;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/gl.js",
    "content": "//! moment.js locale configuration\n//! locale : galician (gl)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var gl = moment.defineLocale('gl', {\n        months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),\n        monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),\n        weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),\n        weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            lastDay : function () {\n                return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';\n            },\n            lastWeek : function () {\n                return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (str) {\n                if (str === 'uns segundos') {\n                    return 'nuns segundos';\n                }\n                return 'en ' + str;\n            },\n            past : 'hai %s',\n            s : 'uns segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'unha hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un ano',\n            yy : '%d anos'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return gl;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/he.js",
    "content": "//! moment.js locale configuration\n//! locale : Hebrew (he)\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var he = moment.defineLocale('he', {\n        months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),\n        monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n        weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n        weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n        weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [ב]MMMM YYYY',\n            LLL : 'D [ב]MMMM YYYY LT',\n            LLLL : 'dddd, D [ב]MMMM YYYY LT',\n            l : 'D/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[היום ב־]LT',\n            nextDay : '[מחר ב־]LT',\n            nextWeek : 'dddd [בשעה] LT',\n            lastDay : '[אתמול ב־]LT',\n            lastWeek : '[ביום] dddd [האחרון בשעה] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'בעוד %s',\n            past : 'לפני %s',\n            s : 'מספר שניות',\n            m : 'דקה',\n            mm : '%d דקות',\n            h : 'שעה',\n            hh : function (number) {\n                if (number === 2) {\n                    return 'שעתיים';\n                }\n                return number + ' שעות';\n            },\n            d : 'יום',\n            dd : function (number) {\n                if (number === 2) {\n                    return 'יומיים';\n                }\n                return number + ' ימים';\n            },\n            M : 'חודש',\n            MM : function (number) {\n                if (number === 2) {\n                    return 'חודשיים';\n                }\n                return number + ' חודשים';\n            },\n            y : 'שנה',\n            yy : function (number) {\n                if (number === 2) {\n                    return 'שנתיים';\n                } else if (number % 10 === 0 && number !== 10) {\n                    return number + ' שנה';\n                }\n                return number + ' שנים';\n            }\n        }\n    });\n\n    return he;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/hi.js",
    "content": "//! moment.js locale configuration\n//! locale : hindi (hi)\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var hi = moment.defineLocale('hi', {\n        months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),\n        monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm बजे',\n            LTS : 'A h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[कल] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[कल] LT',\n            lastWeek : '[पिछले] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s में',\n            past : '%s पहले',\n            s : 'कुछ ही क्षण',\n            m : 'एक मिनट',\n            mm : '%d मिनट',\n            h : 'एक घंटा',\n            hh : '%d घंटे',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महीने',\n            MM : '%d महीने',\n            y : 'एक वर्ष',\n            yy : '%d वर्ष'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n        meridiemParse: /रात|सुबह|दोपहर|शाम/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सुबह') {\n                return hour;\n            } else if (meridiem === 'दोपहर') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'शाम') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात';\n            } else if (hour < 10) {\n                return 'सुबह';\n            } else if (hour < 17) {\n                return 'दोपहर';\n            } else if (hour < 20) {\n                return 'शाम';\n            } else {\n                return 'रात';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return hi;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/hr.js",
    "content": "//! moment.js locale configuration\n//! locale : hrvatski (hr)\n//! author : Bojan Marković : https://github.com/bmarkovic\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var hr = moment.defineLocale('hr', {\n        months : 'sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),\n        monthsShort : 'sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : translate,\n            mm     : translate,\n            h      : translate,\n            hh     : translate,\n            d      : 'dan',\n            dd     : translate,\n            M      : 'mjesec',\n            MM     : translate,\n            y      : 'godinu',\n            yy     : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return hr;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/hu.js",
    "content": "//! moment.js locale configuration\n//! locale : hungarian (hu)\n//! author : Adam Brunner : https://github.com/adambrunner\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n    function translate(number, withoutSuffix, key, isFuture) {\n        var num = number,\n            suffix;\n        switch (key) {\n        case 's':\n            return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n        case 'm':\n            return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'mm':\n            return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'h':\n            return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'hh':\n            return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'd':\n            return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'dd':\n            return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'M':\n            return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'MM':\n            return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'y':\n            return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n        case 'yy':\n            return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n        }\n        return '';\n    }\n    function week(isFuture) {\n        return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';\n    }\n\n    var hu = moment.defineLocale('hu', {\n        months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n        monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n        weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n        weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n        weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY.MM.DD.',\n            LL : 'YYYY. MMMM D.',\n            LLL : 'YYYY. MMMM D., LT',\n            LLLL : 'YYYY. MMMM D., dddd LT'\n        },\n        meridiemParse: /de|du/i,\n        isPM: function (input) {\n            return input.charAt(1).toLowerCase() === 'u';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower === true ? 'de' : 'DE';\n            } else {\n                return isLower === true ? 'du' : 'DU';\n            }\n        },\n        calendar : {\n            sameDay : '[ma] LT[-kor]',\n            nextDay : '[holnap] LT[-kor]',\n            nextWeek : function () {\n                return week.call(this, true);\n            },\n            lastDay : '[tegnap] LT[-kor]',\n            lastWeek : function () {\n                return week.call(this, false);\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s múlva',\n            past : '%s',\n            s : translate,\n            m : translate,\n            mm : translate,\n            h : translate,\n            hh : translate,\n            d : translate,\n            dd : translate,\n            M : translate,\n            MM : translate,\n            y : translate,\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return hu;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/hy-am.js",
    "content": "//! moment.js locale configuration\n//! locale : Armenian (hy-am)\n//! author : Armendarabyan : https://github.com/armendarabyan\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n            'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function monthsShortCaseReplace(m, format) {\n        var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');\n        return monthsShort[m.month()];\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');\n        return weekdays[m.day()];\n    }\n\n    var hy_am = moment.defineLocale('hy-am', {\n        months : monthsCaseReplace,\n        monthsShort : monthsShortCaseReplace,\n        weekdays : weekdaysCaseReplace,\n        weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY թ.',\n            LLL : 'D MMMM YYYY թ., LT',\n            LLLL : 'dddd, D MMMM YYYY թ., LT'\n        },\n        calendar : {\n            sameDay: '[այսօր] LT',\n            nextDay: '[վաղը] LT',\n            lastDay: '[երեկ] LT',\n            nextWeek: function () {\n                return 'dddd [օրը ժամը] LT';\n            },\n            lastWeek: function () {\n                return '[անցած] dddd [օրը ժամը] LT';\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s հետո',\n            past : '%s առաջ',\n            s : 'մի քանի վայրկյան',\n            m : 'րոպե',\n            mm : '%d րոպե',\n            h : 'ժամ',\n            hh : '%d ժամ',\n            d : 'օր',\n            dd : '%d օր',\n            M : 'ամիս',\n            MM : '%d ամիս',\n            y : 'տարի',\n            yy : '%d տարի'\n        },\n        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n        isPM: function (input) {\n            return /^(ցերեկվա|երեկոյան)$/.test(input);\n        },\n        meridiem : function (hour) {\n            if (hour < 4) {\n                return 'գիշերվա';\n            } else if (hour < 12) {\n                return 'առավոտվա';\n            } else if (hour < 17) {\n                return 'ցերեկվա';\n            } else {\n                return 'երեկոյան';\n            }\n        },\n        ordinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'DDD':\n            case 'w':\n            case 'W':\n            case 'DDDo':\n                if (number === 1) {\n                    return number + '-ին';\n                }\n                return number + '-րդ';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return hy_am;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/id.js",
    "content": "//! moment.js locale configuration\n//! locale : Bahasa Indonesia (id)\n//! author : Mohammad Satrio Utomo : https://github.com/tyok\n//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var id = moment.defineLocale('id', {\n        months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n        weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n        weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|siang|sore|malam/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'siang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sore' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'siang';\n            } else if (hours < 19) {\n                return 'sore';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Besok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kemarin pukul] LT',\n            lastWeek : 'dddd [lalu pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lalu',\n            s : 'beberapa detik',\n            m : 'semenit',\n            mm : '%d menit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return id;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/is.js",
    "content": "//! moment.js locale configuration\n//! locale : icelandic (is)\n//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function plural(n) {\n        if (n % 100 === 11) {\n            return true;\n        } else if (n % 10 === 1) {\n            return false;\n        }\n        return true;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':\n            return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';\n        case 'm':\n            return withoutSuffix ? 'mínúta' : 'mínútu';\n        case 'mm':\n            if (plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');\n            } else if (withoutSuffix) {\n                return result + 'mínúta';\n            }\n            return result + 'mínútu';\n        case 'hh':\n            if (plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');\n            }\n            return result + 'klukkustund';\n        case 'd':\n            if (withoutSuffix) {\n                return 'dagur';\n            }\n            return isFuture ? 'dag' : 'degi';\n        case 'dd':\n            if (plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'dagar';\n                }\n                return result + (isFuture ? 'daga' : 'dögum');\n            } else if (withoutSuffix) {\n                return result + 'dagur';\n            }\n            return result + (isFuture ? 'dag' : 'degi');\n        case 'M':\n            if (withoutSuffix) {\n                return 'mánuður';\n            }\n            return isFuture ? 'mánuð' : 'mánuði';\n        case 'MM':\n            if (plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'mánuðir';\n                }\n                return result + (isFuture ? 'mánuði' : 'mánuðum');\n            } else if (withoutSuffix) {\n                return result + 'mánuður';\n            }\n            return result + (isFuture ? 'mánuð' : 'mánuði');\n        case 'y':\n            return withoutSuffix || isFuture ? 'ár' : 'ári';\n        case 'yy':\n            if (plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n            }\n            return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n        }\n    }\n\n    var is = moment.defineLocale('is', {\n        months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n        weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),\n        weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n        weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd, D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay : '[í dag kl.] LT',\n            nextDay : '[á morgun kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[í gær kl.] LT',\n            lastWeek : '[síðasta] dddd [kl.] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'eftir %s',\n            past : 'fyrir %s síðan',\n            s : translate,\n            m : translate,\n            mm : translate,\n            h : 'klukkustund',\n            hh : translate,\n            d : translate,\n            dd : translate,\n            M : translate,\n            MM : translate,\n            y : translate,\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return is;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/it.js",
    "content": "//! moment.js locale configuration\n//! locale : italian (it)\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var it = moment.defineLocale('it', {\n        months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n        monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),\n        weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),\n        weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Oggi alle] LT',\n            nextDay: '[Domani alle] LT',\n            nextWeek: 'dddd [alle] LT',\n            lastDay: '[Ieri alle] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[la scorsa] dddd [alle] LT';\n                    default:\n                        return '[lo scorso] dddd [alle] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n            },\n            past : '%s fa',\n            s : 'alcuni secondi',\n            m : 'un minuto',\n            mm : '%d minuti',\n            h : 'un\\'ora',\n            hh : '%d ore',\n            d : 'un giorno',\n            dd : '%d giorni',\n            M : 'un mese',\n            MM : '%d mesi',\n            y : 'un anno',\n            yy : '%d anni'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal: '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return it;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ja.js",
    "content": "//! moment.js locale configuration\n//! locale : japanese (ja)\n//! author : LI Long : https://github.com/baryon\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ja = moment.defineLocale('ja', {\n        months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n        weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n        weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n        longDateFormat : {\n            LT : 'Ah時m分',\n            LTS : 'LTs秒',\n            L : 'YYYY/MM/DD',\n            LL : 'YYYY年M月D日',\n            LLL : 'YYYY年M月D日LT',\n            LLLL : 'YYYY年M月D日LT dddd'\n        },\n        meridiemParse: /午前|午後/i,\n        isPM : function (input) {\n            return input === '午後';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return '午前';\n            } else {\n                return '午後';\n            }\n        },\n        calendar : {\n            sameDay : '[今日] LT',\n            nextDay : '[明日] LT',\n            nextWeek : '[来週]dddd LT',\n            lastDay : '[昨日] LT',\n            lastWeek : '[前週]dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s後',\n            past : '%s前',\n            s : '数秒',\n            m : '1分',\n            mm : '%d分',\n            h : '1時間',\n            hh : '%d時間',\n            d : '1日',\n            dd : '%d日',\n            M : '1ヶ月',\n            MM : '%dヶ月',\n            y : '1年',\n            yy : '%d年'\n        }\n    });\n\n    return ja;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ka.js",
    "content": "//! moment.js locale configuration\n//! locale : Georgian (ka)\n//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n            'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n        },\n        nounCase = (/D[oD] *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),\n            'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_')\n        },\n        nounCase = (/(წინა|შემდეგ)/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ka = moment.defineLocale('ka', {\n        months : monthsCaseReplace,\n        monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n        weekdays : weekdaysCaseReplace,\n        weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n        weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[დღეს] LT[-ზე]',\n            nextDay : '[ხვალ] LT[-ზე]',\n            lastDay : '[გუშინ] LT[-ზე]',\n            nextWeek : '[შემდეგ] dddd LT[-ზე]',\n            lastWeek : '[წინა] dddd LT-ზე',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return (/(წამი|წუთი|საათი|წელი)/).test(s) ?\n                    s.replace(/ი$/, 'ში') :\n                    s + 'ში';\n            },\n            past : function (s) {\n                if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {\n                    return s.replace(/(ი|ე)$/, 'ის წინ');\n                }\n                if ((/წელი/).test(s)) {\n                    return s.replace(/წელი$/, 'წლის წინ');\n                }\n            },\n            s : 'რამდენიმე წამი',\n            m : 'წუთი',\n            mm : '%d წუთი',\n            h : 'საათი',\n            hh : '%d საათი',\n            d : 'დღე',\n            dd : '%d დღე',\n            M : 'თვე',\n            MM : '%d თვე',\n            y : 'წელი',\n            yy : '%d წელი'\n        },\n        ordinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n        ordinal : function (number) {\n            if (number === 0) {\n                return number;\n            }\n            if (number === 1) {\n                return number + '-ლი';\n            }\n            if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {\n                return 'მე-' + number;\n            }\n            return number + '-ე';\n        },\n        week : {\n            dow : 1,\n            doy : 7\n        }\n    });\n\n    return ka;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/km.js",
    "content": "//! moment.js locale configuration\n//! locale : khmer (km)\n//! author : Kruy Vanna : https://github.com/kruyvanna\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var km = moment.defineLocale('km', {\n        months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ថ្ងៃនៈ ម៉ោង] LT',\n            nextDay: '[ស្អែក ម៉ោង] LT',\n            nextWeek: 'dddd [ម៉ោង] LT',\n            lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: '%sទៀត',\n            past: '%sមុន',\n            s: 'ប៉ុន្មានវិនាទី',\n            m: 'មួយនាទី',\n            mm: '%d នាទី',\n            h: 'មួយម៉ោង',\n            hh: '%d ម៉ោង',\n            d: 'មួយថ្ងៃ',\n            dd: '%d ថ្ងៃ',\n            M: 'មួយខែ',\n            MM: '%d ខែ',\n            y: 'មួយឆ្នាំ',\n            yy: '%d ឆ្នាំ'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return km;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ko.js",
    "content": "//! moment.js locale configuration\n//! locale : korean (ko)\n//!\n//! authors\n//!\n//! - Kyungwook, Park : https://github.com/kyungw00k\n//! - Jeeeyul Lee <jeeeyul@gmail.com>\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ko = moment.defineLocale('ko', {\n        months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n        weekdaysShort : '일_월_화_수_목_금_토'.split('_'),\n        weekdaysMin : '일_월_화_수_목_금_토'.split('_'),\n        longDateFormat : {\n            LT : 'A h시 m분',\n            LTS : 'A h시 m분 s초',\n            L : 'YYYY.MM.DD',\n            LL : 'YYYY년 MMMM D일',\n            LLL : 'YYYY년 MMMM D일 LT',\n            LLLL : 'YYYY년 MMMM D일 dddd LT'\n        },\n        calendar : {\n            sameDay : '오늘 LT',\n            nextDay : '내일 LT',\n            nextWeek : 'dddd LT',\n            lastDay : '어제 LT',\n            lastWeek : '지난주 dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s 후',\n            past : '%s 전',\n            s : '몇초',\n            ss : '%d초',\n            m : '일분',\n            mm : '%d분',\n            h : '한시간',\n            hh : '%d시간',\n            d : '하루',\n            dd : '%d일',\n            M : '한달',\n            MM : '%d달',\n            y : '일년',\n            yy : '%d년'\n        },\n        ordinalParse : /\\d{1,2}일/,\n        ordinal : '%d일',\n        meridiemParse : /오전|오후/,\n        isPM : function (token) {\n            return token === '오후';\n        },\n        meridiem : function (hour, minute, isUpper) {\n            return hour < 12 ? '오전' : '오후';\n        }\n    });\n\n    return ko;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/lb.js",
    "content": "//! moment.js locale configuration\n//! locale : Luxembourgish (lb)\n//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eng Minutt', 'enger Minutt'],\n            'h': ['eng Stonn', 'enger Stonn'],\n            'd': ['een Dag', 'engem Dag'],\n            'M': ['ee Mount', 'engem Mount'],\n            'y': ['ee Joer', 'engem Joer']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n    function processFutureTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'a ' + string;\n        }\n        return 'an ' + string;\n    }\n    function processPastTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'viru ' + string;\n        }\n        return 'virun ' + string;\n    }\n    /**\n     * Returns true if the word before the given number loses the '-n' ending.\n     * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n     *\n     * @param number {integer}\n     * @returns {boolean}\n     */\n    function eifelerRegelAppliesToNumber(number) {\n        number = parseInt(number, 10);\n        if (isNaN(number)) {\n            return false;\n        }\n        if (number < 0) {\n            // Negative Number --> always true\n            return true;\n        } else if (number < 10) {\n            // Only 1 digit\n            if (4 <= number && number <= 7) {\n                return true;\n            }\n            return false;\n        } else if (number < 100) {\n            // 2 digits\n            var lastDigit = number % 10, firstDigit = number / 10;\n            if (lastDigit === 0) {\n                return eifelerRegelAppliesToNumber(firstDigit);\n            }\n            return eifelerRegelAppliesToNumber(lastDigit);\n        } else if (number < 10000) {\n            // 3 or 4 digits --> recursively check first digit\n            while (number >= 10) {\n                number = number / 10;\n            }\n            return eifelerRegelAppliesToNumber(number);\n        } else {\n            // Anything larger than 4 digits: recursively check first n-3 digits\n            number = number / 1000;\n            return eifelerRegelAppliesToNumber(number);\n        }\n    }\n\n    var lb = moment.defineLocale('lb', {\n        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),\n        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm [Auer]',\n            LTS: 'H:mm:ss [Auer]',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Haut um] LT',\n            sameElse: 'L',\n            nextDay: '[Muer um] LT',\n            nextWeek: 'dddd [um] LT',\n            lastDay: '[Gëschter um] LT',\n            lastWeek: function () {\n                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n                switch (this.day()) {\n                    case 2:\n                    case 4:\n                        return '[Leschten] dddd [um] LT';\n                    default:\n                        return '[Leschte] dddd [um] LT';\n                }\n            }\n        },\n        relativeTime : {\n            future : processFutureTime,\n            past : processPastTime,\n            s : 'e puer Sekonnen',\n            m : processRelativeTime,\n            mm : '%d Minutten',\n            h : processRelativeTime,\n            hh : '%d Stonnen',\n            d : processRelativeTime,\n            dd : '%d Deeg',\n            M : processRelativeTime,\n            MM : '%d Méint',\n            y : processRelativeTime,\n            yy : '%d Joer'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return lb;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/lt.js",
    "content": "//! moment.js locale configuration\n//! locale : Lithuanian (lt)\n//! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var units = {\n        'm' : 'minutė_minutės_minutę',\n        'mm': 'minutės_minučių_minutes',\n        'h' : 'valanda_valandos_valandą',\n        'hh': 'valandos_valandų_valandas',\n        'd' : 'diena_dienos_dieną',\n        'dd': 'dienos_dienų_dienas',\n        'M' : 'mėnuo_mėnesio_mėnesį',\n        'MM': 'mėnesiai_mėnesių_mėnesius',\n        'y' : 'metai_metų_metus',\n        'yy': 'metai_metų_metus'\n    },\n    weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');\n    function translateSeconds(number, withoutSuffix, key, isFuture) {\n        if (withoutSuffix) {\n            return 'kelios sekundės';\n        } else {\n            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n        }\n    }\n    function translateSingular(number, withoutSuffix, key, isFuture) {\n        return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n    }\n    function special(number) {\n        return number % 10 === 0 || (number > 10 && number < 20);\n    }\n    function forms(key) {\n        return units[key].split('_');\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        if (number === 1) {\n            return result + translateSingular(number, withoutSuffix, key[0], isFuture);\n        } else if (withoutSuffix) {\n            return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n        } else {\n            if (isFuture) {\n                return result + forms(key)[1];\n            } else {\n                return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n            }\n        }\n    }\n    function relativeWeekDay(moment, format) {\n        var nominative = format.indexOf('dddd HH:mm') === -1,\n            weekDay = weekDays[moment.day()];\n        return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';\n    }\n\n    var lt = moment.defineLocale('lt', {\n        months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),\n        monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n        weekdays : relativeWeekDay,\n        weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n        weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY [m.] MMMM D [d.]',\n            LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY [m.] MMMM D [d.]',\n            lll : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'\n        },\n        calendar : {\n            sameDay : '[Šiandien] LT',\n            nextDay : '[Rytoj] LT',\n            nextWeek : 'dddd LT',\n            lastDay : '[Vakar] LT',\n            lastWeek : '[Praėjusį] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'po %s',\n            past : 'prieš %s',\n            s : translateSeconds,\n            m : translateSingular,\n            mm : translate,\n            h : translateSingular,\n            hh : translate,\n            d : translateSingular,\n            dd : translate,\n            M : translateSingular,\n            MM : translate,\n            y : translateSingular,\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}-oji/,\n        ordinal : function (number) {\n            return number + '-oji';\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return lt;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/lv.js",
    "content": "//! moment.js locale configuration\n//! locale : latvian (lv)\n//! author : Kristaps Karlsons : https://github.com/skakri\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var units = {\n        'mm': 'minūti_minūtes_minūte_minūtes',\n        'hh': 'stundu_stundas_stunda_stundas',\n        'dd': 'dienu_dienas_diena_dienas',\n        'MM': 'mēnesi_mēnešus_mēnesis_mēneši',\n        'yy': 'gadu_gadus_gads_gadi'\n    };\n    function format(word, number, withoutSuffix) {\n        var forms = word.split('_');\n        if (withoutSuffix) {\n            return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];\n        } else {\n            return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];\n        }\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        return number + ' ' + format(units[key], number, withoutSuffix);\n    }\n\n    var lv = moment.defineLocale('lv', {\n        months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),\n        weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'YYYY. [gada] D. MMMM',\n            LLL : 'YYYY. [gada] D. MMMM, LT',\n            LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'\n        },\n        calendar : {\n            sameDay : '[Šodien pulksten] LT',\n            nextDay : '[Rīt pulksten] LT',\n            nextWeek : 'dddd [pulksten] LT',\n            lastDay : '[Vakar pulksten] LT',\n            lastWeek : '[Pagājušā] dddd [pulksten] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s vēlāk',\n            past : '%s agrāk',\n            s : 'dažas sekundes',\n            m : 'minūti',\n            mm : relativeTimeWithPlural,\n            h : 'stundu',\n            hh : relativeTimeWithPlural,\n            d : 'dienu',\n            dd : relativeTimeWithPlural,\n            M : 'mēnesi',\n            MM : relativeTimeWithPlural,\n            y : 'gadu',\n            yy : relativeTimeWithPlural\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return lv;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/mk.js",
    "content": "//! moment.js locale configuration\n//! locale : macedonian (mk)\n//! author : Borislav Mickov : https://github.com/B0k0\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var mk = moment.defineLocale('mk', {\n        months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n        weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Денес во] LT',\n            nextDay : '[Утре во] LT',\n            nextWeek : 'dddd [во] LT',\n            lastDay : '[Вчера во] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[Во изминатата] dddd [во] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[Во изминатиот] dddd [во] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'после %s',\n            past : 'пред %s',\n            s : 'неколку секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дена',\n            M : 'месец',\n            MM : '%d месеци',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return mk;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ml.js",
    "content": "//! moment.js locale configuration\n//! locale : malayalam (ml)\n//! author : Floyd Pink : https://github.com/floydpink\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ml = moment.defineLocale('ml', {\n        months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),\n        monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),\n        weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),\n        weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n        weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm -നു',\n            LTS : 'A h:mm:ss -നു',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[ഇന്ന്] LT',\n            nextDay : '[നാളെ] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[ഇന്നലെ] LT',\n            lastWeek : '[കഴിഞ്ഞ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s കഴിഞ്ഞ്',\n            past : '%s മുൻപ്',\n            s : 'അൽപ നിമിഷങ്ങൾ',\n            m : 'ഒരു മിനിറ്റ്',\n            mm : '%d മിനിറ്റ്',\n            h : 'ഒരു മണിക്കൂർ',\n            hh : '%d മണിക്കൂർ',\n            d : 'ഒരു ദിവസം',\n            dd : '%d ദിവസം',\n            M : 'ഒരു മാസം',\n            MM : '%d മാസം',\n            y : 'ഒരു വർഷം',\n            yy : '%d വർഷം'\n        },\n        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n        isPM : function (input) {\n            return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'രാത്രി';\n            } else if (hour < 12) {\n                return 'രാവിലെ';\n            } else if (hour < 17) {\n                return 'ഉച്ച കഴിഞ്ഞ്';\n            } else if (hour < 20) {\n                return 'വൈകുന്നേരം';\n            } else {\n                return 'രാത്രി';\n            }\n        }\n    });\n\n    return ml;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/mr.js",
    "content": "//! moment.js locale configuration\n//! locale : Marathi (mr)\n//! author : Harshad Kale : https://github.com/kalehv\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var mr = moment.defineLocale('mr', {\n        months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),\n        monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm वाजता',\n            LTS : 'A h:mm:ss वाजता',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[उद्या] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[काल] LT',\n            lastWeek: '[मागील] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s नंतर',\n            past : '%s पूर्वी',\n            s : 'सेकंद',\n            m: 'एक मिनिट',\n            mm: '%d मिनिटे',\n            h : 'एक तास',\n            hh : '%d तास',\n            d : 'एक दिवस',\n            dd : '%d दिवस',\n            M : 'एक महिना',\n            MM : '%d महिने',\n            y : 'एक वर्ष',\n            yy : '%d वर्षे'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात्री') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सकाळी') {\n                return hour;\n            } else if (meridiem === 'दुपारी') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'सायंकाळी') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात्री';\n            } else if (hour < 10) {\n                return 'सकाळी';\n            } else if (hour < 17) {\n                return 'दुपारी';\n            } else if (hour < 20) {\n                return 'सायंकाळी';\n            } else {\n                return 'रात्री';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return mr;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ms-my.js",
    "content": "//! moment.js locale configuration\n//! locale : Bahasa Malaysia (ms-MY)\n//! author : Weldan Jamili : https://github.com/weldan\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ms_my = moment.defineLocale('ms-my', {\n        months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Esok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kelmarin pukul] LT',\n            lastWeek : 'dddd [lepas pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lepas',\n            s : 'beberapa saat',\n            m : 'seminit',\n            mm : '%d minit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ms_my;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/my.js",
    "content": "//! moment.js locale configuration\n//! locale : Burmese (my)\n//! author : Squar team, mysquar.com\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '၁',\n        '2': '၂',\n        '3': '၃',\n        '4': '၄',\n        '5': '၅',\n        '6': '၆',\n        '7': '၇',\n        '8': '၈',\n        '9': '၉',\n        '0': '၀'\n    }, numberMap = {\n        '၁': '1',\n        '၂': '2',\n        '၃': '3',\n        '၄': '4',\n        '၅': '5',\n        '၆': '6',\n        '၇': '7',\n        '၈': '8',\n        '၉': '9',\n        '၀': '0'\n    };\n\n    var my = moment.defineLocale('my', {\n        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),\n        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),\n        weekdaysShort: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        weekdaysMin: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ယနေ.] LT [မှာ]',\n            nextDay: '[မနက်ဖြန်] LT [မှာ]',\n            nextWeek: 'dddd LT [မှာ]',\n            lastDay: '[မနေ.က] LT [မှာ]',\n            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'လာမည့် %s မှာ',\n            past: 'လွန်ခဲ့သော %s က',\n            s: 'စက္ကန်.အနည်းငယ်',\n            m: 'တစ်မိနစ်',\n            mm: '%d မိနစ်',\n            h: 'တစ်နာရီ',\n            hh: '%d နာရီ',\n            d: 'တစ်ရက်',\n            dd: '%d ရက်',\n            M: 'တစ်လ',\n            MM: '%d လ',\n            y: 'တစ်နှစ်',\n            yy: '%d နှစ်'\n        },\n        preparse: function (string) {\n            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return my;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/nb.js",
    "content": "//! moment.js locale configuration\n//! locale : norwegian bokmål (nb)\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//!           Sigurd Gartmann : https://github.com/sigurdga\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var nb = moment.defineLocale('nb', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'H.mm',\n            LTS : 'LT.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[forrige] dddd [kl.] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s siden',\n            s : 'noen sekunder',\n            m : 'ett minutt',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dager',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return nb;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ne.js",
    "content": "//! moment.js locale configuration\n//! locale : nepali/nepalese\n//! author : suvash : https://github.com/suvash\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var ne = moment.defineLocale('ne', {\n        months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),\n        monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),\n        weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),\n        weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n        weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'),\n        longDateFormat : {\n            LT : 'Aको h:mm बजे',\n            LTS : 'Aको h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राती') {\n                return hour < 3 ? hour : hour + 12;\n            } else if (meridiem === 'बिहान') {\n                return hour;\n            } else if (meridiem === 'दिउँसो') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 3) {\n                return 'राती';\n            } else if (hour < 10) {\n                return 'बिहान';\n            } else if (hour < 15) {\n                return 'दिउँसो';\n            } else if (hour < 18) {\n                return 'बेलुका';\n            } else if (hour < 20) {\n                return 'साँझ';\n            } else {\n                return 'राती';\n            }\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[भोली] LT',\n            nextWeek : '[आउँदो] dddd[,] LT',\n            lastDay : '[हिजो] LT',\n            lastWeek : '[गएको] dddd[,] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%sमा',\n            past : '%s अगाडी',\n            s : 'केही समय',\n            m : 'एक मिनेट',\n            mm : '%d मिनेट',\n            h : 'एक घण्टा',\n            hh : '%d घण्टा',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महिना',\n            MM : '%d महिना',\n            y : 'एक बर्ष',\n            yy : '%d बर्ष'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ne;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/nl.js",
    "content": "//! moment.js locale configuration\n//! locale : dutch (nl)\n//! author : Joris Röling : https://github.com/jjupiter\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\n    var nl = moment.defineLocale('nl', {\n        months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'over %s',\n            past : '%s geleden',\n            s : 'een paar seconden',\n            m : 'één minuut',\n            mm : '%d minuten',\n            h : 'één uur',\n            hh : '%d uur',\n            d : 'één dag',\n            dd : '%d dagen',\n            M : 'één maand',\n            MM : '%d maanden',\n            y : 'één jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return nl;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/nn.js",
    "content": "//! moment.js locale configuration\n//! locale : norwegian nynorsk (nn)\n//! author : https://github.com/mechuwind\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var nn = moment.defineLocale('nn', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n        weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),\n        weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[I dag klokka] LT',\n            nextDay: '[I morgon klokka] LT',\n            nextWeek: 'dddd [klokka] LT',\n            lastDay: '[I går klokka] LT',\n            lastWeek: '[Føregåande] dddd [klokka] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s sidan',\n            s : 'nokre sekund',\n            m : 'eit minutt',\n            mm : '%d minutt',\n            h : 'ein time',\n            hh : '%d timar',\n            d : 'ein dag',\n            dd : '%d dagar',\n            M : 'ein månad',\n            MM : '%d månader',\n            y : 'eit år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return nn;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/pl.js",
    "content": "//! moment.js locale configuration\n//! locale : polish (pl)\n//! author : Rafal Hirsz : https://github.com/evoL\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),\n        monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');\n    function plural(n) {\n        return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);\n    }\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'minuta' : 'minutę';\n        case 'mm':\n            return result + (plural(number) ? 'minuty' : 'minut');\n        case 'h':\n            return withoutSuffix  ? 'godzina'  : 'godzinę';\n        case 'hh':\n            return result + (plural(number) ? 'godziny' : 'godzin');\n        case 'MM':\n            return result + (plural(number) ? 'miesiące' : 'miesięcy');\n        case 'yy':\n            return result + (plural(number) ? 'lata' : 'lat');\n        }\n    }\n\n    var pl = moment.defineLocale('pl', {\n        months : function (momentToFormat, format) {\n            if (/D MMMM/.test(format)) {\n                return monthsSubjective[momentToFormat.month()];\n            } else {\n                return monthsNominative[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n        weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n        weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),\n        weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Dziś o] LT',\n            nextDay: '[Jutro o] LT',\n            nextWeek: '[W] dddd [o] LT',\n            lastDay: '[Wczoraj o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[W zeszłą niedzielę o] LT';\n                case 3:\n                    return '[W zeszłą środę o] LT';\n                case 6:\n                    return '[W zeszłą sobotę o] LT';\n                default:\n                    return '[W zeszły] dddd [o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : '%s temu',\n            s : 'kilka sekund',\n            m : translate,\n            mm : translate,\n            h : translate,\n            hh : translate,\n            d : '1 dzień',\n            dd : '%d dni',\n            M : 'miesiąc',\n            MM : translate,\n            y : 'rok',\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return pl;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/pt-br.js",
    "content": "//! moment.js locale configuration\n//! locale : brazilian portuguese (pt-br)\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var pt_br = moment.defineLocale('pt-br', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY [às] LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY [às] LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : '%s atrás',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº'\n    });\n\n    return pt_br;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/pt.js",
    "content": "//! moment.js locale configuration\n//! locale : portuguese (pt)\n//! author : Jefferson : https://github.com/jalex79\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var pt = moment.defineLocale('pt', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : 'há %s',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return pt;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ro.js",
    "content": "//! moment.js locale configuration\n//! locale : romanian (ro)\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n                'mm': 'minute',\n                'hh': 'ore',\n                'dd': 'zile',\n                'MM': 'luni',\n                'yy': 'ani'\n            },\n            separator = ' ';\n        if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n            separator = ' de ';\n        }\n        return number + separator + format[key];\n    }\n\n    var ro = moment.defineLocale('ro', {\n        months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n        monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n        weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n        weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n        weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY H:mm',\n            LLLL : 'dddd, D MMMM YYYY H:mm'\n        },\n        calendar : {\n            sameDay: '[azi la] LT',\n            nextDay: '[mâine la] LT',\n            nextWeek: 'dddd [la] LT',\n            lastDay: '[ieri la] LT',\n            lastWeek: '[fosta] dddd [la] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'peste %s',\n            past : '%s în urmă',\n            s : 'câteva secunde',\n            m : 'un minut',\n            mm : relativeTimeWithPlural,\n            h : 'o oră',\n            hh : relativeTimeWithPlural,\n            d : 'o zi',\n            dd : relativeTimeWithPlural,\n            M : 'o lună',\n            MM : relativeTimeWithPlural,\n            y : 'un an',\n            yy : relativeTimeWithPlural\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ro;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ru.js",
    "content": "//! moment.js locale configuration\n//! locale : russian (ru)\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n            'hh': 'час_часа_часов',\n            'dd': 'день_дня_дней',\n            'MM': 'месяц_месяца_месяцев',\n            'yy': 'год_года_лет'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'минута' : 'минуту';\n        }\n        else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    function monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function monthsShortCaseReplace(m, format) {\n        var monthsShort = {\n            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return monthsShort[nounCase][m.month()];\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n            'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ru = moment.defineLocale('ru', {\n        months : monthsCaseReplace,\n        monthsShort : monthsShortCaseReplace,\n        weekdays : weekdaysCaseReplace,\n        weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сегодня в] LT',\n            nextDay: '[Завтра в] LT',\n            lastDay: '[Вчера в] LT',\n            nextWeek: function () {\n                return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';\n            },\n            lastWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                    case 0:\n                        return '[В прошлое] dddd [в] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                        return '[В прошлый] dddd [в] LT';\n                    case 3:\n                    case 5:\n                    case 6:\n                        return '[В прошлую] dddd [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd [в] LT';\n                    } else {\n                        return '[В] dddd [в] LT';\n                    }\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'через %s',\n            past : '%s назад',\n            s : 'несколько секунд',\n            m : relativeTimeWithPlural,\n            mm : relativeTimeWithPlural,\n            h : 'час',\n            hh : relativeTimeWithPlural,\n            d : 'день',\n            dd : relativeTimeWithPlural,\n            M : 'месяц',\n            MM : relativeTimeWithPlural,\n            y : 'год',\n            yy : relativeTimeWithPlural\n        },\n        meridiemParse: /ночи|утра|дня|вечера/i,\n        isPM : function (input) {\n            return /^(дня|вечера)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночи';\n            } else if (hour < 12) {\n                return 'утра';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечера';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го|я)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            case 'w':\n            case 'W':\n                return number + '-я';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ru;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sk.js",
    "content": "//! moment.js locale configuration\n//! locale : slovak (sk)\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),\n        monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n    function plural(n) {\n        return (n > 1) && (n < 5);\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'minúty' : 'minút');\n            } else {\n                return result + 'minútami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'hodiny' : 'hodín');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'dni' : 'dní');\n            } else {\n                return result + 'dňami';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'mesiace' : 'mesiacov');\n            } else {\n                return result + 'mesiacmi';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (plural(number) ? 'roky' : 'rokov');\n            } else {\n                return result + 'rokmi';\n            }\n            break;\n        }\n    }\n\n    var sk = moment.defineLocale('sk', {\n        months : months,\n        monthsShort : monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(months, monthsShort)),\n        weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n        weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),\n        weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes o] LT',\n            nextDay: '[zajtra o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [o] LT';\n                case 3:\n                    return '[v stredu o] LT';\n                case 4:\n                    return '[vo štvrtok o] LT';\n                case 5:\n                    return '[v piatok o] LT';\n                case 6:\n                    return '[v sobotu o] LT';\n                }\n            },\n            lastDay: '[včera o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulú nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[minulý] dddd [o] LT';\n                case 3:\n                    return '[minulú stredu o] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [o] LT';\n                case 6:\n                    return '[minulú sobotu o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'pred %s',\n            s : translate,\n            m : translate,\n            mm : translate,\n            h : translate,\n            hh : translate,\n            d : translate,\n            dd : translate,\n            M : translate,\n            MM : translate,\n            y : translate,\n            yy : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return sk;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sl.js",
    "content": "//! moment.js locale configuration\n//! locale : slovenian (sl)\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'ena minuta' : 'eno minuto';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2) {\n                result += 'minuti';\n            } else if (number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minut';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'ena ura' : 'eno uro';\n        case 'hh':\n            if (number === 1) {\n                result += 'ura';\n            } else if (number === 2) {\n                result += 'uri';\n            } else if (number === 3 || number === 4) {\n                result += 'ure';\n            } else {\n                result += 'ur';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dni';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mesec';\n            } else if (number === 2) {\n                result += 'meseca';\n            } else if (number === 3 || number === 4) {\n                result += 'mesece';\n            } else {\n                result += 'mesecev';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'leto';\n            } else if (number === 2) {\n                result += 'leti';\n            } else if (number === 3 || number === 4) {\n                result += 'leta';\n            } else {\n                result += 'let';\n            }\n            return result;\n        }\n    }\n\n    var sl = moment.defineLocale('sl', {\n        months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n        weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n        weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danes ob] LT',\n            nextDay  : '[jutri ob] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v] [nedeljo] [ob] LT';\n                case 3:\n                    return '[v] [sredo] [ob] LT';\n                case 6:\n                    return '[v] [soboto] [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[v] dddd [ob] LT';\n                }\n            },\n            lastDay  : '[včeraj ob] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[prejšnja] dddd [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prejšnji] dddd [ob] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'čez %s',\n            past   : '%s nazaj',\n            s      : 'nekaj sekund',\n            m      : translate,\n            mm     : translate,\n            h      : translate,\n            hh     : translate,\n            d      : 'en dan',\n            dd     : translate,\n            M      : 'en mesec',\n            MM     : translate,\n            y      : 'eno leto',\n            yy     : translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return sl;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sq.js",
    "content": "//! moment.js locale configuration\n//! locale : Albanian (sq)\n//! author : Flakërim Ismani : https://github.com/flakerimi\n//! author: Menelion Elensúle: https://github.com/Oire (tests)\n//! author : Oerd Cukalla : https://github.com/oerd (fixes)\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var sq = moment.defineLocale('sq', {\n        months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n        monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n        weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n        weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n        weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),\n        meridiemParse: /PD|MD/,\n        isPM: function (input) {\n            return input.charAt(0) === 'M';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            return hours < 12 ? 'PD' : 'MD';\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Sot në] LT',\n            nextDay : '[Nesër në] LT',\n            nextWeek : 'dddd [në] LT',\n            lastDay : '[Dje në] LT',\n            lastWeek : 'dddd [e kaluar në] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'në %s',\n            past : '%s më parë',\n            s : 'disa sekonda',\n            m : 'një minutë',\n            mm : '%d minuta',\n            h : 'një orë',\n            hh : '%d orë',\n            d : 'një ditë',\n            dd : '%d ditë',\n            M : 'një muaj',\n            MM : '%d muaj',\n            y : 'një vit',\n            yy : '%d vite'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return sq;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sr-cyrl.js",
    "content": "//! moment.js locale configuration\n//! locale : Serbian-cyrillic (sr-cyrl)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var translator = {\n        words: { //Different grammatical cases\n            m: ['један минут', 'једне минуте'],\n            mm: ['минут', 'минуте', 'минута'],\n            h: ['један сат', 'једног сата'],\n            hh: ['сат', 'сата', 'сати'],\n            dd: ['дан', 'дана', 'дана'],\n            MM: ['месец', 'месеца', 'месеци'],\n            yy: ['година', 'године', 'година']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr_cyrl = moment.defineLocale('sr-cyrl', {\n        months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],\n        monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],\n        weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],\n        weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],\n        weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[данас у] LT',\n            nextDay: '[сутра у] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[у] [недељу] [у] LT';\n                case 3:\n                    return '[у] [среду] [у] LT';\n                case 6:\n                    return '[у] [суботу] [у] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[у] dddd [у] LT';\n                }\n            },\n            lastDay  : '[јуче у] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past   : 'пре %s',\n            s      : 'неколико секунди',\n            m      : translator.translate,\n            mm     : translator.translate,\n            h      : translator.translate,\n            hh     : translator.translate,\n            d      : 'дан',\n            dd     : translator.translate,\n            M      : 'месец',\n            MM     : translator.translate,\n            y      : 'годину',\n            yy     : translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return sr_cyrl;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sr.js",
    "content": "//! moment.js locale configuration\n//! locale : Serbian-latin (sr)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var translator = {\n        words: { //Different grammatical cases\n            m: ['jedan minut', 'jedne minute'],\n            mm: ['minut', 'minute', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            dd: ['dan', 'dana', 'dana'],\n            MM: ['mesec', 'meseca', 'meseci'],\n            yy: ['godina', 'godine', 'godina']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr = moment.defineLocale('sr', {\n        months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],\n        monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],\n        weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],\n        weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],\n        weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedelju] [u] LT';\n                case 3:\n                    return '[u] [sredu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[juče u] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'pre %s',\n            s      : 'nekoliko sekundi',\n            m      : translator.translate,\n            mm     : translator.translate,\n            h      : translator.translate,\n            hh     : translator.translate,\n            d      : 'dan',\n            dd     : translator.translate,\n            M      : 'mesec',\n            MM     : translator.translate,\n            y      : 'godinu',\n            yy     : translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return sr;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/sv.js",
    "content": "//! moment.js locale configuration\n//! locale : swedish (sv)\n//! author : Jens Alm : https://github.com/ulmus\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var sv = moment.defineLocale('sv', {\n        months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n        weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n        weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Idag] LT',\n            nextDay: '[Imorgon] LT',\n            lastDay: '[Igår] LT',\n            nextWeek: 'dddd LT',\n            lastWeek: '[Förra] dddd[en] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'för %s sedan',\n            s : 'några sekunder',\n            m : 'en minut',\n            mm : '%d minuter',\n            h : 'en timme',\n            hh : '%d timmar',\n            d : 'en dag',\n            dd : '%d dagar',\n            M : 'en månad',\n            MM : '%d månader',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}(e|a)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'e' :\n                (b === 1) ? 'a' :\n                (b === 2) ? 'a' :\n                (b === 3) ? 'e' : 'e';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return sv;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/ta.js",
    "content": "//! moment.js locale configuration\n//! locale : tamil (ta)\n//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var ta = moment.defineLocale('ta', {\n        months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),\n        weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),\n        weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[இன்று] LT',\n            nextDay : '[நாளை] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[நேற்று] LT',\n            lastWeek : '[கடந்த வாரம்] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s இல்',\n            past : '%s முன்',\n            s : 'ஒரு சில விநாடிகள்',\n            m : 'ஒரு நிமிடம்',\n            mm : '%d நிமிடங்கள்',\n            h : 'ஒரு மணி நேரம்',\n            hh : '%d மணி நேரம்',\n            d : 'ஒரு நாள்',\n            dd : '%d நாட்கள்',\n            M : 'ஒரு மாதம்',\n            MM : '%d மாதங்கள்',\n            y : 'ஒரு வருடம்',\n            yy : '%d ஆண்டுகள்'\n        },\n        ordinalParse: /\\d{1,2}வது/,\n        ordinal : function (number) {\n            return number + 'வது';\n        },\n        // refer http://ta.wikipedia.org/s/1er1\n        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 2) {\n                return ' யாமம்';\n            } else if (hour < 6) {\n                return ' வைகறை';  // வைகறை\n            } else if (hour < 10) {\n                return ' காலை'; // காலை\n            } else if (hour < 14) {\n                return ' நண்பகல்'; // நண்பகல்\n            } else if (hour < 18) {\n                return ' எற்பாடு'; // எற்பாடு\n            } else if (hour < 22) {\n                return ' மாலை'; // மாலை\n            } else {\n                return ' யாமம்';\n            }\n        },\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'யாமம்') {\n                return hour < 2 ? hour : hour + 12;\n            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n                return hour;\n            } else if (meridiem === 'நண்பகல்') {\n                return hour >= 10 ? hour : hour + 12;\n            } else {\n                return hour + 12;\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return ta;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/th.js",
    "content": "//! moment.js locale configuration\n//! locale : thai (th)\n//! author : Kridsada Thanabulpong : https://github.com/sirn\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var th = moment.defineLocale('th', {\n        months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),\n        monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),\n        weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n        weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n        weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n        longDateFormat : {\n            LT : 'H นาฬิกา m นาที',\n            LTS : 'LT s วินาที',\n            L : 'YYYY/MM/DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY เวลา LT',\n            LLLL : 'วันddddที่ D MMMM YYYY เวลา LT'\n        },\n        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n        isPM: function (input) {\n            return input === 'หลังเที่ยง';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ก่อนเที่ยง';\n            } else {\n                return 'หลังเที่ยง';\n            }\n        },\n        calendar : {\n            sameDay : '[วันนี้ เวลา] LT',\n            nextDay : '[พรุ่งนี้ เวลา] LT',\n            nextWeek : 'dddd[หน้า เวลา] LT',\n            lastDay : '[เมื่อวานนี้ เวลา] LT',\n            lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'อีก %s',\n            past : '%sที่แล้ว',\n            s : 'ไม่กี่วินาที',\n            m : '1 นาที',\n            mm : '%d นาที',\n            h : '1 ชั่วโมง',\n            hh : '%d ชั่วโมง',\n            d : '1 วัน',\n            dd : '%d วัน',\n            M : '1 เดือน',\n            MM : '%d เดือน',\n            y : '1 ปี',\n            yy : '%d ปี'\n        }\n    });\n\n    return th;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/tl-ph.js",
    "content": "//! moment.js locale configuration\n//! locale : Tagalog/Filipino (tl-ph)\n//! author : Dan Hagman\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var tl_ph = moment.defineLocale('tl-ph', {\n        months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),\n        monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),\n        weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'MM/D/YYYY',\n            LL : 'MMMM D, YYYY',\n            LLL : 'MMMM D, YYYY LT',\n            LLLL : 'dddd, MMMM DD, YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Ngayon sa] LT',\n            nextDay: '[Bukas sa] LT',\n            nextWeek: 'dddd [sa] LT',\n            lastDay: '[Kahapon sa] LT',\n            lastWeek: 'dddd [huling linggo] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'sa loob ng %s',\n            past : '%s ang nakalipas',\n            s : 'ilang segundo',\n            m : 'isang minuto',\n            mm : '%d minuto',\n            h : 'isang oras',\n            hh : '%d oras',\n            d : 'isang araw',\n            dd : '%d araw',\n            M : 'isang buwan',\n            MM : '%d buwan',\n            y : 'isang taon',\n            yy : '%d taon'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return tl_ph;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/tr.js",
    "content": "//! moment.js locale configuration\n//! locale : turkish (tr)\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//!           Burak Yiğit Kaya: https://github.com/BYK\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var suffixes = {\n        1: '\\'inci',\n        5: '\\'inci',\n        8: '\\'inci',\n        70: '\\'inci',\n        80: '\\'inci',\n        2: '\\'nci',\n        7: '\\'nci',\n        20: '\\'nci',\n        50: '\\'nci',\n        3: '\\'üncü',\n        4: '\\'üncü',\n        100: '\\'üncü',\n        6: '\\'ncı',\n        9: '\\'uncu',\n        10: '\\'uncu',\n        30: '\\'uncu',\n        60: '\\'ıncı',\n        90: '\\'ıncı'\n    };\n\n    var tr = moment.defineLocale('tr', {\n        months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n        monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n        weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),\n        weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n        weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[yarın saat] LT',\n            nextWeek : '[haftaya] dddd [saat] LT',\n            lastDay : '[dün] LT',\n            lastWeek : '[geçen hafta] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s önce',\n            s : 'birkaç saniye',\n            m : 'bir dakika',\n            mm : '%d dakika',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir yıl',\n            yy : '%d yıl'\n        },\n        ordinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '\\'ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return tr;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/tzm-latn.js",
    "content": "//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\n//! author : Abdel Said : https://github.com/abdelsaid\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var tzm_latn = moment.defineLocale('tzm-latn', {\n        months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[asdkh g] LT',\n            nextDay: '[aska g] LT',\n            nextWeek: 'dddd [g] LT',\n            lastDay: '[assant g] LT',\n            lastWeek: 'dddd [g] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dadkh s yan %s',\n            past : 'yan %s',\n            s : 'imik',\n            m : 'minuḍ',\n            mm : '%d minuḍ',\n            h : 'saɛa',\n            hh : '%d tassaɛin',\n            d : 'ass',\n            dd : '%d ossan',\n            M : 'ayowr',\n            MM : '%d iyyirn',\n            y : 'asgas',\n            yy : '%d isgasn'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return tzm_latn;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/tzm.js",
    "content": "//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt (tzm)\n//! author : Abdel Said : https://github.com/abdelsaid\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var tzm = moment.defineLocale('tzm', {\n        months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS: 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n            nextWeek: 'dddd [ⴴ] LT',\n            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n            lastWeek: 'dddd [ⴴ] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n            past : 'ⵢⴰⵏ %s',\n            s : 'ⵉⵎⵉⴽ',\n            m : 'ⵎⵉⵏⵓⴺ',\n            mm : '%d ⵎⵉⵏⵓⴺ',\n            h : 'ⵙⴰⵄⴰ',\n            hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n            d : 'ⴰⵙⵙ',\n            dd : '%d oⵙⵙⴰⵏ',\n            M : 'ⴰⵢoⵓⵔ',\n            MM : '%d ⵉⵢⵢⵉⵔⵏ',\n            y : 'ⴰⵙⴳⴰⵙ',\n            yy : '%d ⵉⵙⴳⴰⵙⵏ'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return tzm;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/uk.js",
    "content": "//! moment.js locale configuration\n//! locale : ukrainian (uk)\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'хвилина_хвилини_хвилин',\n            'hh': 'година_години_годин',\n            'dd': 'день_дні_днів',\n            'MM': 'місяць_місяці_місяців',\n            'yy': 'рік_роки_років'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвилина' : 'хвилину';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'година' : 'годину';\n        }\n        else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    function monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),\n            'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')\n        },\n        nounCase = (/D[oD]? *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n            'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n            'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n        },\n        nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n            'accusative' :\n            ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n                'genitive' :\n                'nominative');\n        return weekdays[nounCase][m.day()];\n    }\n    function processHoursFunction(str) {\n        return function () {\n            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n        };\n    }\n\n    var uk = moment.defineLocale('uk', {\n        months : monthsCaseReplace,\n        monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n        weekdays : weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY р.',\n            LLL : 'D MMMM YYYY р., LT',\n            LLLL : 'dddd, D MMMM YYYY р., LT'\n        },\n        calendar : {\n            sameDay: processHoursFunction('[Сьогодні '),\n            nextDay: processHoursFunction('[Завтра '),\n            lastDay: processHoursFunction('[Вчора '),\n            nextWeek: processHoursFunction('[У] dddd ['),\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return processHoursFunction('[Минулої] dddd [').call(this);\n                case 1:\n                case 2:\n                case 4:\n                    return processHoursFunction('[Минулого] dddd [').call(this);\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past : '%s тому',\n            s : 'декілька секунд',\n            m : relativeTimeWithPlural,\n            mm : relativeTimeWithPlural,\n            h : 'годину',\n            hh : relativeTimeWithPlural,\n            d : 'день',\n            dd : relativeTimeWithPlural,\n            M : 'місяць',\n            MM : relativeTimeWithPlural,\n            y : 'рік',\n            yy : relativeTimeWithPlural\n        },\n        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n        meridiemParse: /ночі|ранку|дня|вечора/,\n        isPM: function (input) {\n            return /^(дня|вечора)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночі';\n            } else if (hour < 12) {\n                return 'ранку';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечора';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    return uk;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/uz.js",
    "content": "//! moment.js locale configuration\n//! locale : uzbek (uz)\n//! author : Sardor Muminov : https://github.com/muminoff\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var uz = moment.defineLocale('uz', {\n        months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n        monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n        weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n        weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'D MMMM YYYY, dddd LT'\n        },\n        calendar : {\n            sameDay : '[Бугун соат] LT [да]',\n            nextDay : '[Эртага] LT [да]',\n            nextWeek : 'dddd [куни соат] LT [да]',\n            lastDay : '[Кеча соат] LT [да]',\n            lastWeek : '[Утган] dddd [куни соат] LT [да]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'Якин %s ичида',\n            past : 'Бир неча %s олдин',\n            s : 'фурсат',\n            m : 'бир дакика',\n            mm : '%d дакика',\n            h : 'бир соат',\n            hh : '%d соат',\n            d : 'бир кун',\n            dd : '%d кун',\n            M : 'бир ой',\n            MM : '%d ой',\n            y : 'бир йил',\n            yy : '%d йил'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return uz;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/vi.js",
    "content": "//! moment.js locale configuration\n//! locale : vietnamese (vi)\n//! author : Bang Nguyen : https://github.com/bangnk\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var vi = moment.defineLocale('vi', {\n        months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n        monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n        weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),\n        weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM [năm] YYYY',\n            LLL : 'D MMMM [năm] YYYY LT',\n            LLLL : 'dddd, D MMMM [năm] YYYY LT',\n            l : 'DD/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hôm nay lúc] LT',\n            nextDay: '[Ngày mai lúc] LT',\n            nextWeek: 'dddd [tuần tới lúc] LT',\n            lastDay: '[Hôm qua lúc] LT',\n            lastWeek: 'dddd [tuần rồi lúc] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s tới',\n            past : '%s trước',\n            s : 'vài giây',\n            m : 'một phút',\n            mm : '%d phút',\n            h : 'một giờ',\n            hh : '%d giờ',\n            d : 'một ngày',\n            dd : '%d ngày',\n            M : 'một tháng',\n            MM : '%d tháng',\n            y : 'một năm',\n            yy : '%d năm'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return vi;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/zh-cn.js",
    "content": "//! moment.js locale configuration\n//! locale : chinese (zh-cn)\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var zh_cn = moment.defineLocale('zh-cn', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah点mm',\n            LTS : 'Ah点m分s秒',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' ||\n                    meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            } else {\n                // '中午'\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : function () {\n                return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';\n            },\n            nextDay : function () {\n                return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';\n            },\n            lastDay : function () {\n                return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';\n            },\n            nextWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = moment().startOf('week');\n                prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            lastWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = moment().startOf('week');\n                prefix = this.unix() < startOfWeek.unix()  ? '[上]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            sameElse : 'LL'\n        },\n        ordinalParse: /\\d{1,2}(日|月|周)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd':\n            case 'D':\n            case 'DDD':\n                return number + '日';\n            case 'M':\n                return number + '月';\n            case 'w':\n            case 'W':\n                return number + '周';\n            default:\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s内',\n            past : '%s前',\n            s : '几秒',\n            m : '1分钟',\n            mm : '%d分钟',\n            h : '1小时',\n            hh : '%d小时',\n            d : '1天',\n            dd : '%d天',\n            M : '1个月',\n            MM : '%d个月',\n            y : '1年',\n            yy : '%d年'\n        },\n        week : {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    return zh_cn;\n\n}));"
  },
  {
    "path": "www/lib/moment/locale/zh-tw.js",
    "content": "//! moment.js locale configuration\n//! locale : traditional chinese (zh-tw)\n//! author : Ben : https://github.com/ben-lin\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n\n    var zh_tw = moment.defineLocale('zh-tw', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah點mm',\n            LTS : 'Ah點m分s秒',\n            L : 'YYYY年MMMD日',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY年MMMD日',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /早上|上午|中午|下午|晚上/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : '[今天]LT',\n            nextDay : '[明天]LT',\n            nextWeek : '[下]ddddLT',\n            lastDay : '[昨天]LT',\n            lastWeek : '[上]ddddLT',\n            sameElse : 'L'\n        },\n        ordinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd' :\n            case 'D' :\n            case 'DDD' :\n                return number + '日';\n            case 'M' :\n                return number + '月';\n            case 'w' :\n            case 'W' :\n                return number + '週';\n            default :\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s內',\n            past : '%s前',\n            s : '幾秒',\n            m : '一分鐘',\n            mm : '%d分鐘',\n            h : '一小時',\n            hh : '%d小時',\n            d : '一天',\n            dd : '%d天',\n            M : '一個月',\n            MM : '%d個月',\n            y : '一年',\n            yy : '%d年'\n        }\n    });\n\n    return zh_tw;\n\n}));"
  },
  {
    "path": "www/lib/moment/meteor/README.md",
    "content": "Packaging [Moment](momentjs.org) for [Meteor.js](http://meteor.com).\n\n\n# Meteor\n\nIf you're new to Meteor, here's what the excitement is all about -\n[watch the first two minutes](https://www.youtube.com/watch?v=fsi0aJ9yr2o); you'll be hooked by 1:28.\n\nThat screencast is from 2012. In the meantime, Meteor has become a mature JavaScript-everywhere web\ndevelopment framework. Read more at [Why Meteor](http://www.meteorpedia.com/read/Why_Meteor).\n\n\n# Issues\n\nIf you encounter an issue while using this package, please CC @dandv when you file it in this repo.\n\n\n# DONE\n\n* Simple test. Should be enough.\n\n\n# TODO\n\n* Add other tests; however, that is overkill, and the responsibiity of Moment, not of the Meteor integration.\n"
  },
  {
    "path": "www/lib/moment/meteor/export.js",
    "content": "// moment.js makes `moment` global on the window (or global) object, while Meteor expects a file-scoped global variable\nmoment = this.moment;\ndelete this.moment;\n"
  },
  {
    "path": "www/lib/moment/meteor/test.js",
    "content": "'use strict';\n\nTinytest.add('Moment.is', function (test) {\n  test.ok(moment.isMoment(moment()), {message: 'simple moment object'});\n});\n"
  },
  {
    "path": "www/lib/moment/min/locales.js",
    "content": "(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n    //! locale : afrikaans (af)\n    //! author : Werner Mollentze : https://github.com/wernerm\n\n    var af = moment.defineLocale('af', {\n        months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),\n        weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n        weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n        meridiemParse: /vm|nm/i,\n        isPM : function (input) {\n            return /^nm$/i.test(input);\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'vm' : 'VM';\n            } else {\n                return isLower ? 'nm' : 'NM';\n            }\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Vandag om] LT',\n            nextDay : '[Môre om] LT',\n            nextWeek : 'dddd [om] LT',\n            lastDay : '[Gister om] LT',\n            lastWeek : '[Laas] dddd [om] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'oor %s',\n            past : '%s gelede',\n            s : '\\'n paar sekondes',\n            m : '\\'n minuut',\n            mm : '%d minute',\n            h : '\\'n uur',\n            hh : '%d ure',\n            d : '\\'n dag',\n            dd : '%d dae',\n            M : '\\'n maand',\n            MM : '%d maande',\n            y : '\\'n jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter\n        },\n        week : {\n            dow : 1, // Maandag is die eerste dag van die week.\n            doy : 4  // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Moroccan Arabic (ar-ma)\n    //! author : ElFadili Yassine : https://github.com/ElFadiliY\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var ar_ma = moment.defineLocale('ar-ma', {\n        months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Arabic Saudi Arabia (ar-sa)\n    //! author : Suhail Alkowaileet : https://github.com/xsoh\n\n    var ar_sa__symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, ar_sa__numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    };\n\n    var ar_sa = moment.defineLocale('ar-sa', {\n        months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return ar_sa__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ar_sa__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale  : Tunisian Arabic (ar-tn)\n\n    var ar_tn = moment.defineLocale('ar-tn', {\n        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! Locale: Arabic (ar)\n    //! Author: Abdel Said: https://github.com/abdelsaid\n    //! Changes in months, weekdays: Ahmed Elkhatib\n    //! Native plural forms: forabi https://github.com/forabi\n\n    var ar__symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, ar__numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    }, pluralForm = function (n) {\n        return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;\n    }, plurals = {\n        s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n        m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n        h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n        d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n        M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n        y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n    }, pluralize = function (u) {\n        return function (number, withoutSuffix, string, isFuture) {\n            var f = pluralForm(number),\n                str = plurals[u][pluralForm(number)];\n            if (f === 2) {\n                str = str[withoutSuffix ? 0 : 1];\n            }\n            return str.replace(/%d/i, number);\n        };\n    }, ar__months = [\n        'كانون الثاني يناير',\n        'شباط فبراير',\n        'آذار مارس',\n        'نيسان أبريل',\n        'أيار مايو',\n        'حزيران يونيو',\n        'تموز يوليو',\n        'آب أغسطس',\n        'أيلول سبتمبر',\n        'تشرين الأول أكتوبر',\n        'تشرين الثاني نوفمبر',\n        'كانون الأول ديسمبر'\n    ];\n\n    var ar = moment.defineLocale('ar', {\n        months : ar__months,\n        monthsShort : ar__months,\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'بعد %s',\n            past : 'منذ %s',\n            s : pluralize('s'),\n            m : pluralize('m'),\n            mm : pluralize('m'),\n            h : pluralize('h'),\n            hh : pluralize('h'),\n            d : pluralize('d'),\n            dd : pluralize('d'),\n            M : pluralize('M'),\n            MM : pluralize('M'),\n            y : pluralize('y'),\n            yy : pluralize('y')\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return ar__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ar__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : azerbaijani (az)\n    //! author : topchiyev : https://github.com/topchiyev\n\n    var az__suffixes = {\n        1: '-inci',\n        5: '-inci',\n        8: '-inci',\n        70: '-inci',\n        80: '-inci',\n        2: '-nci',\n        7: '-nci',\n        20: '-nci',\n        50: '-nci',\n        3: '-üncü',\n        4: '-üncü',\n        100: '-üncü',\n        6: '-ncı',\n        9: '-uncu',\n        10: '-uncu',\n        30: '-uncu',\n        60: '-ıncı',\n        90: '-ıncı'\n    };\n\n    var az = moment.defineLocale('az', {\n        months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),\n        monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n        weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),\n        weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n        weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[sabah saat] LT',\n            nextWeek : '[gələn həftə] dddd [saat] LT',\n            lastDay : '[dünən] LT',\n            lastWeek : '[keçən həftə] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s əvvəl',\n            s : 'birneçə saniyyə',\n            m : 'bir dəqiqə',\n            mm : '%d dəqiqə',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir il',\n            yy : '%d il'\n        },\n        meridiemParse: /gecə|səhər|gündüz|axşam/,\n        isPM : function (input) {\n            return /^(gündüz|axşam)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'gecə';\n            } else if (hour < 12) {\n                return 'səhər';\n            } else if (hour < 17) {\n                return 'gündüz';\n            } else {\n                return 'axşam';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '-ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (az__suffixes[a] || az__suffixes[b] || az__suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : belarusian (be)\n    //! author : Dmitry Demidov : https://github.com/demidov91\n    //! author: Praleska: http://praleska.pro/\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function be__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function be__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n            'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n            'dd': 'дзень_дні_дзён',\n            'MM': 'месяц_месяцы_месяцаў',\n            'yy': 'год_гады_гадоў'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвіліна' : 'хвіліну';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'гадзіна' : 'гадзіну';\n        }\n        else {\n            return number + ' ' + be__plural(format[key], +number);\n        }\n    }\n    function be__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n            'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function be__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),\n            'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:мінулую|наступную)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var be = moment.defineLocale('be', {\n        months : be__monthsCaseReplace,\n        monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n        weekdays : be__weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сёння ў] LT',\n            nextDay: '[Заўтра ў] LT',\n            lastDay: '[Учора ў] LT',\n            nextWeek: function () {\n                return '[У] dddd [ў] LT';\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return '[У мінулую] dddd [ў] LT';\n                case 1:\n                case 2:\n                case 4:\n                    return '[У мінулы] dddd [ў] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'праз %s',\n            past : '%s таму',\n            s : 'некалькі секунд',\n            m : be__relativeTimeWithPlural,\n            mm : be__relativeTimeWithPlural,\n            h : be__relativeTimeWithPlural,\n            hh : be__relativeTimeWithPlural,\n            d : 'дзень',\n            dd : be__relativeTimeWithPlural,\n            M : 'месяц',\n            MM : be__relativeTimeWithPlural,\n            y : 'год',\n            yy : be__relativeTimeWithPlural\n        },\n        meridiemParse: /ночы|раніцы|дня|вечара/,\n        isPM : function (input) {\n            return /^(дня|вечара)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночы';\n            } else if (hour < 12) {\n                return 'раніцы';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечара';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(і|ы|га)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';\n            case 'D':\n                return number + '-га';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : bulgarian (bg)\n    //! author : Krasen Borisov : https://github.com/kraz\n\n    var bg = moment.defineLocale('bg', {\n        months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Днес в] LT',\n            nextDay : '[Утре в] LT',\n            nextWeek : 'dddd [в] LT',\n            lastDay : '[Вчера в] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[В изминалата] dddd [в] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[В изминалия] dddd [в] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'след %s',\n            past : 'преди %s',\n            s : 'няколко секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дни',\n            M : 'месец',\n            MM : '%d месеца',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bengali (bn)\n    //! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n    var bn__symbolMap = {\n        '1': '১',\n        '2': '২',\n        '3': '৩',\n        '4': '৪',\n        '5': '৫',\n        '6': '৬',\n        '7': '৭',\n        '8': '৮',\n        '9': '৯',\n        '0': '০'\n    },\n    bn__numberMap = {\n        '১': '1',\n        '২': '2',\n        '৩': '3',\n        '৪': '4',\n        '৫': '5',\n        '৬': '6',\n        '৭': '7',\n        '৮': '8',\n        '৯': '9',\n        '০': '0'\n    };\n\n    var bn = moment.defineLocale('bn', {\n        months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),\n        monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),\n        weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'),\n        weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'),\n        weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm সময়',\n            LTS : 'A h:mm:ss সময়',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[আজ] LT',\n            nextDay : '[আগামীকাল] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[গতকাল] LT',\n            lastWeek : '[গত] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s পরে',\n            past : '%s আগে',\n            s : 'কএক সেকেন্ড',\n            m : 'এক মিনিট',\n            mm : '%d মিনিট',\n            h : 'এক ঘন্টা',\n            hh : '%d ঘন্টা',\n            d : 'এক দিন',\n            dd : '%d দিন',\n            M : 'এক মাস',\n            MM : '%d মাস',\n            y : 'এক বছর',\n            yy : '%d বছর'\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return bn__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return bn__symbolMap[match];\n            });\n        },\n        meridiemParse: /রাত|শকাল|দুপুর|বিকেল|রাত/,\n        isPM: function (input) {\n            return /^(দুপুর|বিকেল|রাত)$/.test(input);\n        },\n        //Bengali is a vast language its spoken\n        //in different forms in various parts of the world.\n        //I have just generalized with most common one used\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 10) {\n                return 'শকাল';\n            } else if (hour < 17) {\n                return 'দুপুর';\n            } else if (hour < 20) {\n                return 'বিকেল';\n            } else {\n                return 'রাত';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : tibetan (bo)\n    //! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n    var bo__symbolMap = {\n        '1': '༡',\n        '2': '༢',\n        '3': '༣',\n        '4': '༤',\n        '5': '༥',\n        '6': '༦',\n        '7': '༧',\n        '8': '༨',\n        '9': '༩',\n        '0': '༠'\n    },\n    bo__numberMap = {\n        '༡': '1',\n        '༢': '2',\n        '༣': '3',\n        '༤': '4',\n        '༥': '5',\n        '༦': '6',\n        '༧': '7',\n        '༨': '8',\n        '༩': '9',\n        '༠': '0'\n    };\n\n    var bo = moment.defineLocale('bo', {\n        months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),\n        weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[དི་རིང] LT',\n            nextDay : '[སང་ཉིན] LT',\n            nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',\n            lastDay : '[ཁ་སང] LT',\n            lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s ལ་',\n            past : '%s སྔན་ལ',\n            s : 'ལམ་སང',\n            m : 'སྐར་མ་གཅིག',\n            mm : '%d སྐར་མ',\n            h : 'ཆུ་ཚོད་གཅིག',\n            hh : '%d ཆུ་ཚོད',\n            d : 'ཉིན་གཅིག',\n            dd : '%d ཉིན་',\n            M : 'ཟླ་བ་གཅིག',\n            MM : '%d ཟླ་བ',\n            y : 'ལོ་གཅིག',\n            yy : '%d ལོ'\n        },\n        preparse: function (string) {\n            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n                return bo__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return bo__symbolMap[match];\n            });\n        },\n        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n        isPM: function (input) {\n            return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'མཚན་མོ';\n            } else if (hour < 10) {\n                return 'ཞོགས་ཀས';\n            } else if (hour < 17) {\n                return 'ཉིན་གུང';\n            } else if (hour < 20) {\n                return 'དགོང་དག';\n            } else {\n                return 'མཚན་མོ';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : breton (br)\n    //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n    function relativeTimeWithMutation(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'munutenn',\n            'MM': 'miz',\n            'dd': 'devezh'\n        };\n        return number + ' ' + mutation(format[key], number);\n    }\n    function specialMutationForYears(number) {\n        switch (lastNumber(number)) {\n        case 1:\n        case 3:\n        case 4:\n        case 5:\n        case 9:\n            return number + ' bloaz';\n        default:\n            return number + ' vloaz';\n        }\n    }\n    function lastNumber(number) {\n        if (number > 9) {\n            return lastNumber(number % 10);\n        }\n        return number;\n    }\n    function mutation(text, number) {\n        if (number === 2) {\n            return softMutation(text);\n        }\n        return text;\n    }\n    function softMutation(text) {\n        var mutationTable = {\n            'm': 'v',\n            'b': 'v',\n            'd': 'z'\n        };\n        if (mutationTable[text.charAt(0)] === undefined) {\n            return text;\n        }\n        return mutationTable[text.charAt(0)] + text.substring(1);\n    }\n\n    var br = moment.defineLocale('br', {\n        months : 'Genver_C\\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),\n        monthsShort : 'Gen_C\\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n        weekdays : 'Sul_Lun_Meurzh_Merc\\'her_Yaou_Gwener_Sadorn'.split('_'),\n        weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n        weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h[e]mm A',\n            LTS : 'h[e]mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D [a viz] MMMM YYYY',\n            LLL : 'D [a viz] MMMM YYYY LT',\n            LLLL : 'dddd, D [a viz] MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Hiziv da] LT',\n            nextDay : '[Warc\\'hoazh da] LT',\n            nextWeek : 'dddd [da] LT',\n            lastDay : '[Dec\\'h da] LT',\n            lastWeek : 'dddd [paset da] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'a-benn %s',\n            past : '%s \\'zo',\n            s : 'un nebeud segondennoù',\n            m : 'ur vunutenn',\n            mm : relativeTimeWithMutation,\n            h : 'un eur',\n            hh : '%d eur',\n            d : 'un devezh',\n            dd : relativeTimeWithMutation,\n            M : 'ur miz',\n            MM : relativeTimeWithMutation,\n            y : 'ur bloaz',\n            yy : specialMutationForYears\n        },\n        ordinalParse: /\\d{1,2}(añ|vet)/,\n        ordinal : function (number) {\n            var output = (number === 1) ? 'añ' : 'vet';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : bosnian (bs)\n    //! author : Nedim Cholich : https://github.com/frontyard\n    //! based on (hr) translation by Bojan Marković\n\n    function bs__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var bs = moment.defineLocale('bs', {\n        months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : bs__translate,\n            mm     : bs__translate,\n            h      : bs__translate,\n            hh     : bs__translate,\n            d      : 'dan',\n            dd     : bs__translate,\n            M      : 'mjesec',\n            MM     : bs__translate,\n            y      : 'godinu',\n            yy     : bs__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : catalan (ca)\n    //! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n    var ca = moment.defineLocale('ca', {\n        months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n        monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),\n        weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n        weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextDay : function () {\n                return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastDay : function () {\n                return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'fa %s',\n            s : 'uns segons',\n            m : 'un minut',\n            mm : '%d minuts',\n            h : 'una hora',\n            hh : '%d hores',\n            d : 'un dia',\n            dd : '%d dies',\n            M : 'un mes',\n            MM : '%d mesos',\n            y : 'un any',\n            yy : '%d anys'\n        },\n        ordinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal : function (number, period) {\n            var output = (number === 1) ? 'r' :\n                (number === 2) ? 'n' :\n                (number === 3) ? 'r' :\n                (number === 4) ? 't' : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : czech (cs)\n    //! author : petrbela : https://github.com/petrbela\n\n    var cs__months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),\n        cs__monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');\n    function cs__plural(n) {\n        return (n > 1) && (n < 5) && (~~(n / 10) !== 1);\n    }\n    function cs__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'minuty' : 'minut');\n            } else {\n                return result + 'minutami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'hodiny' : 'hodin');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'dny' : 'dní');\n            } else {\n                return result + 'dny';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'měsíce' : 'měsíců');\n            } else {\n                return result + 'měsíci';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'roky' : 'let');\n            } else {\n                return result + 'lety';\n            }\n            break;\n        }\n    }\n\n    var cs = moment.defineLocale('cs', {\n        months : cs__months,\n        monthsShort : cs__monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(cs__months, cs__monthsShort)),\n        weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n        weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),\n        weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes v] LT',\n            nextDay: '[zítra v] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v neděli v] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [v] LT';\n                case 3:\n                    return '[ve středu v] LT';\n                case 4:\n                    return '[ve čtvrtek v] LT';\n                case 5:\n                    return '[v pátek v] LT';\n                case 6:\n                    return '[v sobotu v] LT';\n                }\n            },\n            lastDay: '[včera v] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulou neděli v] LT';\n                case 1:\n                case 2:\n                    return '[minulé] dddd [v] LT';\n                case 3:\n                    return '[minulou středu v] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [v] LT';\n                case 6:\n                    return '[minulou sobotu v] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'před %s',\n            s : cs__translate,\n            m : cs__translate,\n            mm : cs__translate,\n            h : cs__translate,\n            hh : cs__translate,\n            d : cs__translate,\n            dd : cs__translate,\n            M : cs__translate,\n            MM : cs__translate,\n            y : cs__translate,\n            yy : cs__translate\n        },\n        ordinalParse : /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : chuvash (cv)\n    //! author : Anatoly Mironov : https://github.com/mirontoli\n\n    var cv = moment.defineLocale('cv', {\n        months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'),\n        monthsShort : 'кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш'.split('_'),\n        weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун'.split('_'),\n        weekdaysShort : 'выр_тун_ытл_юн_кĕç_эрн_шăм'.split('_'),\n        weekdaysMin : 'вр_тн_ыт_юн_кç_эр_шм'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]',\n            LLL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT',\n            LLLL : 'dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT'\n        },\n        calendar : {\n            sameDay: '[Паян] LT [сехетре]',\n            nextDay: '[Ыран] LT [сехетре]',\n            lastDay: '[Ĕнер] LT [сехетре]',\n            nextWeek: '[Çитес] dddd LT [сехетре]',\n            lastWeek: '[Иртнĕ] dddd LT [сехетре]',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (output) {\n                var affix = /сехет$/i.exec(output) ? 'рен' : /çул$/i.exec(output) ? 'тан' : 'ран';\n                return output + affix;\n            },\n            past : '%s каялла',\n            s : 'пĕр-ик çеккунт',\n            m : 'пĕр минут',\n            mm : '%d минут',\n            h : 'пĕр сехет',\n            hh : '%d сехет',\n            d : 'пĕр кун',\n            dd : '%d кун',\n            M : 'пĕр уйăх',\n            MM : '%d уйăх',\n            y : 'пĕр çул',\n            yy : '%d çул'\n        },\n        ordinalParse: /\\d{1,2}-мĕш/,\n        ordinal : '%d-мĕш',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Welsh (cy)\n    //! author : Robert Allen\n\n    var cy = moment.defineLocale('cy', {\n        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),\n        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),\n        weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),\n        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n        // time formats are the same as en-gb\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Heddiw am] LT',\n            nextDay: '[Yfory am] LT',\n            nextWeek: 'dddd [am] LT',\n            lastDay: '[Ddoe am] LT',\n            lastWeek: 'dddd [diwethaf am] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'mewn %s',\n            past: '%s yn ôl',\n            s: 'ychydig eiliadau',\n            m: 'munud',\n            mm: '%d munud',\n            h: 'awr',\n            hh: '%d awr',\n            d: 'diwrnod',\n            dd: '%d diwrnod',\n            M: 'mis',\n            MM: '%d mis',\n            y: 'blwyddyn',\n            yy: '%d flynedd'\n        },\n        ordinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n        ordinal: function (number) {\n            var b = number,\n                output = '',\n                lookup = [\n                    '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed\n                    'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed\n                ];\n            if (b > 20) {\n                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                    output = 'fed'; // not 30ain, 70ain or 90ain\n                } else {\n                    output = 'ain';\n                }\n            } else if (b > 0) {\n                output = lookup[b];\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : danish (da)\n    //! author : Ulrik Nielsen : https://github.com/mrbase\n\n    var da = moment.defineLocale('da', {\n        months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd [d.] D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[I dag kl.] LT',\n            nextDay : '[I morgen kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[I går kl.] LT',\n            lastWeek : '[sidste] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : '%s siden',\n            s : 'få sekunder',\n            m : 'et minut',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dage',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'et år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : austrian german (de-at)\n    //! author : lluchs : https://github.com/lluchs\n    //! author: Menelion Elensúle: https://github.com/Oire\n    //! author : Martin Groller : https://github.com/MadMG\n\n    function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de_at = moment.defineLocale('de-at', {\n        months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : de_at__processRelativeTime,\n            mm : '%d Minuten',\n            h : de_at__processRelativeTime,\n            hh : '%d Stunden',\n            d : de_at__processRelativeTime,\n            dd : de_at__processRelativeTime,\n            M : de_at__processRelativeTime,\n            MM : de_at__processRelativeTime,\n            y : de_at__processRelativeTime,\n            yy : de_at__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : german (de)\n    //! author : lluchs : https://github.com/lluchs\n    //! author: Menelion Elensúle: https://github.com/Oire\n\n    function de__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de = moment.defineLocale('de', {\n        months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : de__processRelativeTime,\n            mm : '%d Minuten',\n            h : de__processRelativeTime,\n            hh : '%d Stunden',\n            d : de__processRelativeTime,\n            dd : de__processRelativeTime,\n            M : de__processRelativeTime,\n            MM : de__processRelativeTime,\n            y : de__processRelativeTime,\n            yy : de__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : modern greek (el)\n    //! author : Aggelos Karalias : https://github.com/mehiel\n\n    var el = moment.defineLocale('el', {\n        monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),\n        monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),\n        months : function (momentToFormat, format) {\n            if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'\n                return this._monthsGenitiveEl[momentToFormat.month()];\n            } else {\n                return this._monthsNominativeEl[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n        weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),\n        weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n        weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'μμ' : 'ΜΜ';\n            } else {\n                return isLower ? 'πμ' : 'ΠΜ';\n            }\n        },\n        isPM : function (input) {\n            return ((input + '').toLowerCase()[0] === 'μ');\n        },\n        meridiemParse : /[ΠΜ]\\.?Μ?\\.?/i,\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendarEl : {\n            sameDay : '[Σήμερα {}] LT',\n            nextDay : '[Αύριο {}] LT',\n            nextWeek : 'dddd [{}] LT',\n            lastDay : '[Χθες {}] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                    case 6:\n                        return '[το προηγούμενο] dddd [{}] LT';\n                    default:\n                        return '[την προηγούμενη] dddd [{}] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        calendar : function (key, mom) {\n            var output = this._calendarEl[key],\n                hours = mom && mom.hours();\n            if (typeof output === 'function') {\n                output = output.apply(mom);\n            }\n            return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));\n        },\n        relativeTime : {\n            future : 'σε %s',\n            past : '%s πριν',\n            s : 'λίγα δευτερόλεπτα',\n            m : 'ένα λεπτό',\n            mm : '%d λεπτά',\n            h : 'μία ώρα',\n            hh : '%d ώρες',\n            d : 'μία μέρα',\n            dd : '%d μέρες',\n            M : 'ένας μήνας',\n            MM : '%d μήνες',\n            y : 'ένας χρόνος',\n            yy : '%d χρόνια'\n        },\n        ordinalParse: /\\d{1,2}η/,\n        ordinal: '%dη',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : australian english (en-au)\n\n    var en_au = moment.defineLocale('en-au', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : canadian english (en-ca)\n    //! author : Jonathan Abourbih : https://github.com/jonbca\n\n    var en_ca = moment.defineLocale('en-ca', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM, YYYY',\n            LLL : 'D MMMM, YYYY LT',\n            LLLL : 'dddd, D MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : great britain english (en-gb)\n    //! author : Chris Gedrim : https://github.com/chrisgedrim\n\n    var en_gb = moment.defineLocale('en-gb', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : esperanto (eo)\n    //! author : Colin Dean : https://github.com/colindean\n    //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.\n    //!          Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!\n\n    var eo = moment.defineLocale('eo', {\n        months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),\n        weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),\n        weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D[-an de] MMMM, YYYY',\n            LLL : 'D[-an de] MMMM, YYYY LT',\n            LLLL : 'dddd, [la] D[-an de] MMMM, YYYY LT'\n        },\n        meridiemParse: /[ap]\\.t\\.m/i,\n        isPM: function (input) {\n            return input.charAt(0).toLowerCase() === 'p';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'p.t.m.' : 'P.T.M.';\n            } else {\n                return isLower ? 'a.t.m.' : 'A.T.M.';\n            }\n        },\n        calendar : {\n            sameDay : '[Hodiaŭ je] LT',\n            nextDay : '[Morgaŭ je] LT',\n            nextWeek : 'dddd [je] LT',\n            lastDay : '[Hieraŭ je] LT',\n            lastWeek : '[pasinta] dddd [je] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'je %s',\n            past : 'antaŭ %s',\n            s : 'sekundoj',\n            m : 'minuto',\n            mm : '%d minutoj',\n            h : 'horo',\n            hh : '%d horoj',\n            d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo\n            dd : '%d tagoj',\n            M : 'monato',\n            MM : '%d monatoj',\n            y : 'jaro',\n            yy : '%d jaroj'\n        },\n        ordinalParse: /\\d{1,2}a/,\n        ordinal : '%da',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : spanish (es)\n    //! author : Julio Napurí : https://github.com/julionc\n\n    var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n        es__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\n    var es = moment.defineLocale('es', {\n        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return es__monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastDay : function () {\n                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'hace %s',\n            s : 'unos segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'una hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un año',\n            yy : '%d años'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : estonian (et)\n    //! author : Henry Kehlmann : https://github.com/madhenry\n    //! improvements : Illimar Tambek : https://github.com/ragulka\n\n    function et__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n            'm' : ['ühe minuti', 'üks minut'],\n            'mm': [number + ' minuti', number + ' minutit'],\n            'h' : ['ühe tunni', 'tund aega', 'üks tund'],\n            'hh': [number + ' tunni', number + ' tundi'],\n            'd' : ['ühe päeva', 'üks päev'],\n            'M' : ['kuu aja', 'kuu aega', 'üks kuu'],\n            'MM': [number + ' kuu', number + ' kuud'],\n            'y' : ['ühe aasta', 'aasta', 'üks aasta'],\n            'yy': [number + ' aasta', number + ' aastat']\n        };\n        if (withoutSuffix) {\n            return format[key][2] ? format[key][2] : format[key][1];\n        }\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var et = moment.defineLocale('et', {\n        months        : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n        monthsShort   : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n        weekdays      : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n        weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),\n        weekdaysMin   : 'P_E_T_K_N_R_L'.split('_'),\n        longDateFormat : {\n            LT   : 'H:mm',\n            LTS : 'LT:ss',\n            L    : 'DD.MM.YYYY',\n            LL   : 'D. MMMM YYYY',\n            LLL  : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[Täna,] LT',\n            nextDay  : '[Homme,] LT',\n            nextWeek : '[Järgmine] dddd LT',\n            lastDay  : '[Eile,] LT',\n            lastWeek : '[Eelmine] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s pärast',\n            past   : '%s tagasi',\n            s      : et__processRelativeTime,\n            m      : et__processRelativeTime,\n            mm     : et__processRelativeTime,\n            h      : et__processRelativeTime,\n            hh     : et__processRelativeTime,\n            d      : et__processRelativeTime,\n            dd     : '%d päeva',\n            M      : et__processRelativeTime,\n            MM     : et__processRelativeTime,\n            y      : et__processRelativeTime,\n            yy     : et__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : euskara (eu)\n    //! author : Eneko Illarramendi : https://github.com/eillarra\n\n    var eu = moment.defineLocale('eu', {\n        months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),\n        monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),\n        weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),\n        weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),\n        weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY[ko] MMMM[ren] D[a]',\n            LLL : 'YYYY[ko] MMMM[ren] D[a] LT',\n            LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] LT',\n            l : 'YYYY-M-D',\n            ll : 'YYYY[ko] MMM D[a]',\n            lll : 'YYYY[ko] MMM D[a] LT',\n            llll : 'ddd, YYYY[ko] MMM D[a] LT'\n        },\n        calendar : {\n            sameDay : '[gaur] LT[etan]',\n            nextDay : '[bihar] LT[etan]',\n            nextWeek : 'dddd LT[etan]',\n            lastDay : '[atzo] LT[etan]',\n            lastWeek : '[aurreko] dddd LT[etan]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s barru',\n            past : 'duela %s',\n            s : 'segundo batzuk',\n            m : 'minutu bat',\n            mm : '%d minutu',\n            h : 'ordu bat',\n            hh : '%d ordu',\n            d : 'egun bat',\n            dd : '%d egun',\n            M : 'hilabete bat',\n            MM : '%d hilabete',\n            y : 'urte bat',\n            yy : '%d urte'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Persian (fa)\n    //! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n    var fa__symbolMap = {\n        '1': '۱',\n        '2': '۲',\n        '3': '۳',\n        '4': '۴',\n        '5': '۵',\n        '6': '۶',\n        '7': '۷',\n        '8': '۸',\n        '9': '۹',\n        '0': '۰'\n    }, fa__numberMap = {\n        '۱': '1',\n        '۲': '2',\n        '۳': '3',\n        '۴': '4',\n        '۵': '5',\n        '۶': '6',\n        '۷': '7',\n        '۸': '8',\n        '۹': '9',\n        '۰': '0'\n    };\n\n    var fa = moment.defineLocale('fa', {\n        months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        weekdays : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysShort : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        meridiemParse: /قبل از ظهر|بعد از ظهر/,\n        isPM: function (input) {\n            return /بعد از ظهر/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'قبل از ظهر';\n            } else {\n                return 'بعد از ظهر';\n            }\n        },\n        calendar : {\n            sameDay : '[امروز ساعت] LT',\n            nextDay : '[فردا ساعت] LT',\n            nextWeek : 'dddd [ساعت] LT',\n            lastDay : '[دیروز ساعت] LT',\n            lastWeek : 'dddd [پیش] [ساعت] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'در %s',\n            past : '%s پیش',\n            s : 'چندین ثانیه',\n            m : 'یک دقیقه',\n            mm : '%d دقیقه',\n            h : 'یک ساعت',\n            hh : '%d ساعت',\n            d : 'یک روز',\n            dd : '%d روز',\n            M : 'یک ماه',\n            MM : '%d ماه',\n            y : 'یک سال',\n            yy : '%d سال'\n        },\n        preparse: function (string) {\n            return string.replace(/[۰-۹]/g, function (match) {\n                return fa__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return fa__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        ordinalParse: /\\d{1,2}م/,\n        ordinal : '%dم',\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : finnish (fi)\n    //! author : Tarmo Aidantausta : https://github.com/bleadof\n\n    var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n        numbersFuture = [\n            'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n            numbersPast[7], numbersPast[8], numbersPast[9]\n        ];\n    function fi__translate(number, withoutSuffix, key, isFuture) {\n        var result = '';\n        switch (key) {\n        case 's':\n            return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n        case 'm':\n            return isFuture ? 'minuutin' : 'minuutti';\n        case 'mm':\n            result = isFuture ? 'minuutin' : 'minuuttia';\n            break;\n        case 'h':\n            return isFuture ? 'tunnin' : 'tunti';\n        case 'hh':\n            result = isFuture ? 'tunnin' : 'tuntia';\n            break;\n        case 'd':\n            return isFuture ? 'päivän' : 'päivä';\n        case 'dd':\n            result = isFuture ? 'päivän' : 'päivää';\n            break;\n        case 'M':\n            return isFuture ? 'kuukauden' : 'kuukausi';\n        case 'MM':\n            result = isFuture ? 'kuukauden' : 'kuukautta';\n            break;\n        case 'y':\n            return isFuture ? 'vuoden' : 'vuosi';\n        case 'yy':\n            result = isFuture ? 'vuoden' : 'vuotta';\n            break;\n        }\n        result = verbalNumber(number, isFuture) + ' ' + result;\n        return result;\n    }\n    function verbalNumber(number, isFuture) {\n        return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;\n    }\n\n    var fi = moment.defineLocale('fi', {\n        months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n        monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n        weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n        weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'HH.mm.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'Do MMMM[ta] YYYY',\n            LLL : 'Do MMMM[ta] YYYY, [klo] LT',\n            LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] LT',\n            l : 'D.M.YYYY',\n            ll : 'Do MMM YYYY',\n            lll : 'Do MMM YYYY, [klo] LT',\n            llll : 'ddd, Do MMM YYYY, [klo] LT'\n        },\n        calendar : {\n            sameDay : '[tänään] [klo] LT',\n            nextDay : '[huomenna] [klo] LT',\n            nextWeek : 'dddd [klo] LT',\n            lastDay : '[eilen] [klo] LT',\n            lastWeek : '[viime] dddd[na] [klo] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s päästä',\n            past : '%s sitten',\n            s : fi__translate,\n            m : fi__translate,\n            mm : fi__translate,\n            h : fi__translate,\n            hh : fi__translate,\n            d : fi__translate,\n            dd : fi__translate,\n            M : fi__translate,\n            MM : fi__translate,\n            y : fi__translate,\n            yy : fi__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : faroese (fo)\n    //! author : Ragnar Johannesen : https://github.com/ragnar123\n\n    var fo = moment.defineLocale('fo', {\n        months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),\n        weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n        weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Í dag kl.] LT',\n            nextDay : '[Í morgin kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[Í gjár kl.] LT',\n            lastWeek : '[síðstu] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'um %s',\n            past : '%s síðani',\n            s : 'fá sekund',\n            m : 'ein minutt',\n            mm : '%d minuttir',\n            h : 'ein tími',\n            hh : '%d tímar',\n            d : 'ein dagur',\n            dd : '%d dagar',\n            M : 'ein mánaði',\n            MM : '%d mánaðir',\n            y : 'eitt ár',\n            yy : '%d ár'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : canadian french (fr-ca)\n    //! author : Jonathan Abourbih : https://github.com/jonbca\n\n    var fr_ca = moment.defineLocale('fr-ca', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : french (fr)\n    //! author : John Fischer : https://github.com/jfroffice\n\n    var fr = moment.defineLocale('fr', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : frisian (fy)\n    //! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n    var fy__monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n        fy__monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n    var fy = moment.defineLocale('fy', {\n        months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return fy__monthsShortWithoutDots[m.month()];\n            } else {\n                return fy__monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),\n        weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),\n        weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[hjoed om] LT',\n            nextDay: '[moarn om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[juster om] LT',\n            lastWeek: '[ôfrûne] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'oer %s',\n            past : '%s lyn',\n            s : 'in pear sekonden',\n            m : 'ien minút',\n            mm : '%d minuten',\n            h : 'ien oere',\n            hh : '%d oeren',\n            d : 'ien dei',\n            dd : '%d dagen',\n            M : 'ien moanne',\n            MM : '%d moannen',\n            y : 'ien jier',\n            yy : '%d jierren'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : galician (gl)\n    //! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n    var gl = moment.defineLocale('gl', {\n        months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),\n        monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),\n        weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),\n        weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            lastDay : function () {\n                return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';\n            },\n            lastWeek : function () {\n                return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (str) {\n                if (str === 'uns segundos') {\n                    return 'nuns segundos';\n                }\n                return 'en ' + str;\n            },\n            past : 'hai %s',\n            s : 'uns segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'unha hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un ano',\n            yy : '%d anos'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Hebrew (he)\n    //! author : Tomer Cohen : https://github.com/tomer\n    //! author : Moshe Simantov : https://github.com/DevelopmentIL\n    //! author : Tal Ater : https://github.com/TalAter\n\n    var he = moment.defineLocale('he', {\n        months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),\n        monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n        weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n        weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n        weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [ב]MMMM YYYY',\n            LLL : 'D [ב]MMMM YYYY LT',\n            LLLL : 'dddd, D [ב]MMMM YYYY LT',\n            l : 'D/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[היום ב־]LT',\n            nextDay : '[מחר ב־]LT',\n            nextWeek : 'dddd [בשעה] LT',\n            lastDay : '[אתמול ב־]LT',\n            lastWeek : '[ביום] dddd [האחרון בשעה] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'בעוד %s',\n            past : 'לפני %s',\n            s : 'מספר שניות',\n            m : 'דקה',\n            mm : '%d דקות',\n            h : 'שעה',\n            hh : function (number) {\n                if (number === 2) {\n                    return 'שעתיים';\n                }\n                return number + ' שעות';\n            },\n            d : 'יום',\n            dd : function (number) {\n                if (number === 2) {\n                    return 'יומיים';\n                }\n                return number + ' ימים';\n            },\n            M : 'חודש',\n            MM : function (number) {\n                if (number === 2) {\n                    return 'חודשיים';\n                }\n                return number + ' חודשים';\n            },\n            y : 'שנה',\n            yy : function (number) {\n                if (number === 2) {\n                    return 'שנתיים';\n                } else if (number % 10 === 0 && number !== 10) {\n                    return number + ' שנה';\n                }\n                return number + ' שנים';\n            }\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hindi (hi)\n    //! author : Mayank Singhal : https://github.com/mayanksinghal\n\n    var hi__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    hi__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var hi = moment.defineLocale('hi', {\n        months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),\n        monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm बजे',\n            LTS : 'A h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[कल] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[कल] LT',\n            lastWeek : '[पिछले] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s में',\n            past : '%s पहले',\n            s : 'कुछ ही क्षण',\n            m : 'एक मिनट',\n            mm : '%d मिनट',\n            h : 'एक घंटा',\n            hh : '%d घंटे',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महीने',\n            MM : '%d महीने',\n            y : 'एक वर्ष',\n            yy : '%d वर्ष'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return hi__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return hi__symbolMap[match];\n            });\n        },\n        // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n        meridiemParse: /रात|सुबह|दोपहर|शाम/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सुबह') {\n                return hour;\n            } else if (meridiem === 'दोपहर') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'शाम') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात';\n            } else if (hour < 10) {\n                return 'सुबह';\n            } else if (hour < 17) {\n                return 'दोपहर';\n            } else if (hour < 20) {\n                return 'शाम';\n            } else {\n                return 'रात';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hrvatski (hr)\n    //! author : Bojan Marković : https://github.com/bmarkovic\n\n    function hr__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var hr = moment.defineLocale('hr', {\n        months : 'sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),\n        monthsShort : 'sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : hr__translate,\n            mm     : hr__translate,\n            h      : hr__translate,\n            hh     : hr__translate,\n            d      : 'dan',\n            dd     : hr__translate,\n            M      : 'mjesec',\n            MM     : hr__translate,\n            y      : 'godinu',\n            yy     : hr__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hungarian (hu)\n    //! author : Adam Brunner : https://github.com/adambrunner\n\n    var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n    function hu__translate(number, withoutSuffix, key, isFuture) {\n        var num = number,\n            suffix;\n        switch (key) {\n        case 's':\n            return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n        case 'm':\n            return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'mm':\n            return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'h':\n            return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'hh':\n            return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'd':\n            return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'dd':\n            return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'M':\n            return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'MM':\n            return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'y':\n            return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n        case 'yy':\n            return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n        }\n        return '';\n    }\n    function week(isFuture) {\n        return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';\n    }\n\n    var hu = moment.defineLocale('hu', {\n        months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n        monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n        weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n        weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n        weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY.MM.DD.',\n            LL : 'YYYY. MMMM D.',\n            LLL : 'YYYY. MMMM D., LT',\n            LLLL : 'YYYY. MMMM D., dddd LT'\n        },\n        meridiemParse: /de|du/i,\n        isPM: function (input) {\n            return input.charAt(1).toLowerCase() === 'u';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower === true ? 'de' : 'DE';\n            } else {\n                return isLower === true ? 'du' : 'DU';\n            }\n        },\n        calendar : {\n            sameDay : '[ma] LT[-kor]',\n            nextDay : '[holnap] LT[-kor]',\n            nextWeek : function () {\n                return week.call(this, true);\n            },\n            lastDay : '[tegnap] LT[-kor]',\n            lastWeek : function () {\n                return week.call(this, false);\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s múlva',\n            past : '%s',\n            s : hu__translate,\n            m : hu__translate,\n            mm : hu__translate,\n            h : hu__translate,\n            hh : hu__translate,\n            d : hu__translate,\n            dd : hu__translate,\n            M : hu__translate,\n            MM : hu__translate,\n            y : hu__translate,\n            yy : hu__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Armenian (hy-am)\n    //! author : Armendarabyan : https://github.com/armendarabyan\n\n    function hy_am__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n            'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function hy_am__monthsShortCaseReplace(m, format) {\n        var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');\n        return monthsShort[m.month()];\n    }\n    function hy_am__weekdaysCaseReplace(m, format) {\n        var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');\n        return weekdays[m.day()];\n    }\n\n    var hy_am = moment.defineLocale('hy-am', {\n        months : hy_am__monthsCaseReplace,\n        monthsShort : hy_am__monthsShortCaseReplace,\n        weekdays : hy_am__weekdaysCaseReplace,\n        weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY թ.',\n            LLL : 'D MMMM YYYY թ., LT',\n            LLLL : 'dddd, D MMMM YYYY թ., LT'\n        },\n        calendar : {\n            sameDay: '[այսօր] LT',\n            nextDay: '[վաղը] LT',\n            lastDay: '[երեկ] LT',\n            nextWeek: function () {\n                return 'dddd [օրը ժամը] LT';\n            },\n            lastWeek: function () {\n                return '[անցած] dddd [օրը ժամը] LT';\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s հետո',\n            past : '%s առաջ',\n            s : 'մի քանի վայրկյան',\n            m : 'րոպե',\n            mm : '%d րոպե',\n            h : 'ժամ',\n            hh : '%d ժամ',\n            d : 'օր',\n            dd : '%d օր',\n            M : 'ամիս',\n            MM : '%d ամիս',\n            y : 'տարի',\n            yy : '%d տարի'\n        },\n        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n        isPM: function (input) {\n            return /^(ցերեկվա|երեկոյան)$/.test(input);\n        },\n        meridiem : function (hour) {\n            if (hour < 4) {\n                return 'գիշերվա';\n            } else if (hour < 12) {\n                return 'առավոտվա';\n            } else if (hour < 17) {\n                return 'ցերեկվա';\n            } else {\n                return 'երեկոյան';\n            }\n        },\n        ordinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'DDD':\n            case 'w':\n            case 'W':\n            case 'DDDo':\n                if (number === 1) {\n                    return number + '-ին';\n                }\n                return number + '-րդ';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bahasa Indonesia (id)\n    //! author : Mohammad Satrio Utomo : https://github.com/tyok\n    //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n    var id = moment.defineLocale('id', {\n        months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n        weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n        weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|siang|sore|malam/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'siang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sore' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'siang';\n            } else if (hours < 19) {\n                return 'sore';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Besok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kemarin pukul] LT',\n            lastWeek : 'dddd [lalu pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lalu',\n            s : 'beberapa detik',\n            m : 'semenit',\n            mm : '%d menit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : icelandic (is)\n    //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n    function is__plural(n) {\n        if (n % 100 === 11) {\n            return true;\n        } else if (n % 10 === 1) {\n            return false;\n        }\n        return true;\n    }\n    function is__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':\n            return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';\n        case 'm':\n            return withoutSuffix ? 'mínúta' : 'mínútu';\n        case 'mm':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');\n            } else if (withoutSuffix) {\n                return result + 'mínúta';\n            }\n            return result + 'mínútu';\n        case 'hh':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');\n            }\n            return result + 'klukkustund';\n        case 'd':\n            if (withoutSuffix) {\n                return 'dagur';\n            }\n            return isFuture ? 'dag' : 'degi';\n        case 'dd':\n            if (is__plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'dagar';\n                }\n                return result + (isFuture ? 'daga' : 'dögum');\n            } else if (withoutSuffix) {\n                return result + 'dagur';\n            }\n            return result + (isFuture ? 'dag' : 'degi');\n        case 'M':\n            if (withoutSuffix) {\n                return 'mánuður';\n            }\n            return isFuture ? 'mánuð' : 'mánuði';\n        case 'MM':\n            if (is__plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'mánuðir';\n                }\n                return result + (isFuture ? 'mánuði' : 'mánuðum');\n            } else if (withoutSuffix) {\n                return result + 'mánuður';\n            }\n            return result + (isFuture ? 'mánuð' : 'mánuði');\n        case 'y':\n            return withoutSuffix || isFuture ? 'ár' : 'ári';\n        case 'yy':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n            }\n            return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n        }\n    }\n\n    var is = moment.defineLocale('is', {\n        months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n        weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),\n        weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n        weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd, D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay : '[í dag kl.] LT',\n            nextDay : '[á morgun kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[í gær kl.] LT',\n            lastWeek : '[síðasta] dddd [kl.] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'eftir %s',\n            past : 'fyrir %s síðan',\n            s : is__translate,\n            m : is__translate,\n            mm : is__translate,\n            h : 'klukkustund',\n            hh : is__translate,\n            d : is__translate,\n            dd : is__translate,\n            M : is__translate,\n            MM : is__translate,\n            y : is__translate,\n            yy : is__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : italian (it)\n    //! author : Lorenzo : https://github.com/aliem\n    //! author: Mattia Larentis: https://github.com/nostalgiaz\n\n    var it = moment.defineLocale('it', {\n        months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n        monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),\n        weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),\n        weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Oggi alle] LT',\n            nextDay: '[Domani alle] LT',\n            nextWeek: 'dddd [alle] LT',\n            lastDay: '[Ieri alle] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[la scorsa] dddd [alle] LT';\n                    default:\n                        return '[lo scorso] dddd [alle] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n            },\n            past : '%s fa',\n            s : 'alcuni secondi',\n            m : 'un minuto',\n            mm : '%d minuti',\n            h : 'un\\'ora',\n            hh : '%d ore',\n            d : 'un giorno',\n            dd : '%d giorni',\n            M : 'un mese',\n            MM : '%d mesi',\n            y : 'un anno',\n            yy : '%d anni'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal: '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : japanese (ja)\n    //! author : LI Long : https://github.com/baryon\n\n    var ja = moment.defineLocale('ja', {\n        months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n        weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n        weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n        longDateFormat : {\n            LT : 'Ah時m分',\n            LTS : 'LTs秒',\n            L : 'YYYY/MM/DD',\n            LL : 'YYYY年M月D日',\n            LLL : 'YYYY年M月D日LT',\n            LLLL : 'YYYY年M月D日LT dddd'\n        },\n        meridiemParse: /午前|午後/i,\n        isPM : function (input) {\n            return input === '午後';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return '午前';\n            } else {\n                return '午後';\n            }\n        },\n        calendar : {\n            sameDay : '[今日] LT',\n            nextDay : '[明日] LT',\n            nextWeek : '[来週]dddd LT',\n            lastDay : '[昨日] LT',\n            lastWeek : '[前週]dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s後',\n            past : '%s前',\n            s : '数秒',\n            m : '1分',\n            mm : '%d分',\n            h : '1時間',\n            hh : '%d時間',\n            d : '1日',\n            dd : '%d日',\n            M : '1ヶ月',\n            MM : '%dヶ月',\n            y : '1年',\n            yy : '%d年'\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Georgian (ka)\n    //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n\n    function ka__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n            'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n        },\n        nounCase = (/D[oD] *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function ka__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),\n            'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_')\n        },\n        nounCase = (/(წინა|შემდეგ)/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ka = moment.defineLocale('ka', {\n        months : ka__monthsCaseReplace,\n        monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n        weekdays : ka__weekdaysCaseReplace,\n        weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n        weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[დღეს] LT[-ზე]',\n            nextDay : '[ხვალ] LT[-ზე]',\n            lastDay : '[გუშინ] LT[-ზე]',\n            nextWeek : '[შემდეგ] dddd LT[-ზე]',\n            lastWeek : '[წინა] dddd LT-ზე',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return (/(წამი|წუთი|საათი|წელი)/).test(s) ?\n                    s.replace(/ი$/, 'ში') :\n                    s + 'ში';\n            },\n            past : function (s) {\n                if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {\n                    return s.replace(/(ი|ე)$/, 'ის წინ');\n                }\n                if ((/წელი/).test(s)) {\n                    return s.replace(/წელი$/, 'წლის წინ');\n                }\n            },\n            s : 'რამდენიმე წამი',\n            m : 'წუთი',\n            mm : '%d წუთი',\n            h : 'საათი',\n            hh : '%d საათი',\n            d : 'დღე',\n            dd : '%d დღე',\n            M : 'თვე',\n            MM : '%d თვე',\n            y : 'წელი',\n            yy : '%d წელი'\n        },\n        ordinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n        ordinal : function (number) {\n            if (number === 0) {\n                return number;\n            }\n            if (number === 1) {\n                return number + '-ლი';\n            }\n            if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {\n                return 'მე-' + number;\n            }\n            return number + '-ე';\n        },\n        week : {\n            dow : 1,\n            doy : 7\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : khmer (km)\n    //! author : Kruy Vanna : https://github.com/kruyvanna\n\n    var km = moment.defineLocale('km', {\n        months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ថ្ងៃនៈ ម៉ោង] LT',\n            nextDay: '[ស្អែក ម៉ោង] LT',\n            nextWeek: 'dddd [ម៉ោង] LT',\n            lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: '%sទៀត',\n            past: '%sមុន',\n            s: 'ប៉ុន្មានវិនាទី',\n            m: 'មួយនាទី',\n            mm: '%d នាទី',\n            h: 'មួយម៉ោង',\n            hh: '%d ម៉ោង',\n            d: 'មួយថ្ងៃ',\n            dd: '%d ថ្ងៃ',\n            M: 'មួយខែ',\n            MM: '%d ខែ',\n            y: 'មួយឆ្នាំ',\n            yy: '%d ឆ្នាំ'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : korean (ko)\n    //!\n    //! authors\n    //!\n    //! - Kyungwook, Park : https://github.com/kyungw00k\n    //! - Jeeeyul Lee <jeeeyul@gmail.com>\n\n    var ko = moment.defineLocale('ko', {\n        months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n        weekdaysShort : '일_월_화_수_목_금_토'.split('_'),\n        weekdaysMin : '일_월_화_수_목_금_토'.split('_'),\n        longDateFormat : {\n            LT : 'A h시 m분',\n            LTS : 'A h시 m분 s초',\n            L : 'YYYY.MM.DD',\n            LL : 'YYYY년 MMMM D일',\n            LLL : 'YYYY년 MMMM D일 LT',\n            LLLL : 'YYYY년 MMMM D일 dddd LT'\n        },\n        calendar : {\n            sameDay : '오늘 LT',\n            nextDay : '내일 LT',\n            nextWeek : 'dddd LT',\n            lastDay : '어제 LT',\n            lastWeek : '지난주 dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s 후',\n            past : '%s 전',\n            s : '몇초',\n            ss : '%d초',\n            m : '일분',\n            mm : '%d분',\n            h : '한시간',\n            hh : '%d시간',\n            d : '하루',\n            dd : '%d일',\n            M : '한달',\n            MM : '%d달',\n            y : '일년',\n            yy : '%d년'\n        },\n        ordinalParse : /\\d{1,2}일/,\n        ordinal : '%d일',\n        meridiemParse : /오전|오후/,\n        isPM : function (token) {\n            return token === '오후';\n        },\n        meridiem : function (hour, minute, isUpper) {\n            return hour < 12 ? '오전' : '오후';\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Luxembourgish (lb)\n    //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz\n\n    function lb__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eng Minutt', 'enger Minutt'],\n            'h': ['eng Stonn', 'enger Stonn'],\n            'd': ['een Dag', 'engem Dag'],\n            'M': ['ee Mount', 'engem Mount'],\n            'y': ['ee Joer', 'engem Joer']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n    function processFutureTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'a ' + string;\n        }\n        return 'an ' + string;\n    }\n    function processPastTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'viru ' + string;\n        }\n        return 'virun ' + string;\n    }\n    /**\n     * Returns true if the word before the given number loses the '-n' ending.\n     * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n     *\n     * @param number {integer}\n     * @returns {boolean}\n     */\n    function eifelerRegelAppliesToNumber(number) {\n        number = parseInt(number, 10);\n        if (isNaN(number)) {\n            return false;\n        }\n        if (number < 0) {\n            // Negative Number --> always true\n            return true;\n        } else if (number < 10) {\n            // Only 1 digit\n            if (4 <= number && number <= 7) {\n                return true;\n            }\n            return false;\n        } else if (number < 100) {\n            // 2 digits\n            var lastDigit = number % 10, firstDigit = number / 10;\n            if (lastDigit === 0) {\n                return eifelerRegelAppliesToNumber(firstDigit);\n            }\n            return eifelerRegelAppliesToNumber(lastDigit);\n        } else if (number < 10000) {\n            // 3 or 4 digits --> recursively check first digit\n            while (number >= 10) {\n                number = number / 10;\n            }\n            return eifelerRegelAppliesToNumber(number);\n        } else {\n            // Anything larger than 4 digits: recursively check first n-3 digits\n            number = number / 1000;\n            return eifelerRegelAppliesToNumber(number);\n        }\n    }\n\n    var lb = moment.defineLocale('lb', {\n        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),\n        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm [Auer]',\n            LTS: 'H:mm:ss [Auer]',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Haut um] LT',\n            sameElse: 'L',\n            nextDay: '[Muer um] LT',\n            nextWeek: 'dddd [um] LT',\n            lastDay: '[Gëschter um] LT',\n            lastWeek: function () {\n                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n                switch (this.day()) {\n                    case 2:\n                    case 4:\n                        return '[Leschten] dddd [um] LT';\n                    default:\n                        return '[Leschte] dddd [um] LT';\n                }\n            }\n        },\n        relativeTime : {\n            future : processFutureTime,\n            past : processPastTime,\n            s : 'e puer Sekonnen',\n            m : lb__processRelativeTime,\n            mm : '%d Minutten',\n            h : lb__processRelativeTime,\n            hh : '%d Stonnen',\n            d : lb__processRelativeTime,\n            dd : '%d Deeg',\n            M : lb__processRelativeTime,\n            MM : '%d Méint',\n            y : lb__processRelativeTime,\n            yy : '%d Joer'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Lithuanian (lt)\n    //! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n    var lt__units = {\n        'm' : 'minutė_minutės_minutę',\n        'mm': 'minutės_minučių_minutes',\n        'h' : 'valanda_valandos_valandą',\n        'hh': 'valandos_valandų_valandas',\n        'd' : 'diena_dienos_dieną',\n        'dd': 'dienos_dienų_dienas',\n        'M' : 'mėnuo_mėnesio_mėnesį',\n        'MM': 'mėnesiai_mėnesių_mėnesius',\n        'y' : 'metai_metų_metus',\n        'yy': 'metai_metų_metus'\n    },\n    weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');\n    function translateSeconds(number, withoutSuffix, key, isFuture) {\n        if (withoutSuffix) {\n            return 'kelios sekundės';\n        } else {\n            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n        }\n    }\n    function translateSingular(number, withoutSuffix, key, isFuture) {\n        return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n    }\n    function special(number) {\n        return number % 10 === 0 || (number > 10 && number < 20);\n    }\n    function forms(key) {\n        return lt__units[key].split('_');\n    }\n    function lt__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        if (number === 1) {\n            return result + translateSingular(number, withoutSuffix, key[0], isFuture);\n        } else if (withoutSuffix) {\n            return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n        } else {\n            if (isFuture) {\n                return result + forms(key)[1];\n            } else {\n                return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n            }\n        }\n    }\n    function relativeWeekDay(moment, format) {\n        var nominative = format.indexOf('dddd HH:mm') === -1,\n            weekDay = weekDays[moment.day()];\n        return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';\n    }\n\n    var lt = moment.defineLocale('lt', {\n        months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),\n        monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n        weekdays : relativeWeekDay,\n        weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n        weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY [m.] MMMM D [d.]',\n            LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY [m.] MMMM D [d.]',\n            lll : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'\n        },\n        calendar : {\n            sameDay : '[Šiandien] LT',\n            nextDay : '[Rytoj] LT',\n            nextWeek : 'dddd LT',\n            lastDay : '[Vakar] LT',\n            lastWeek : '[Praėjusį] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'po %s',\n            past : 'prieš %s',\n            s : translateSeconds,\n            m : translateSingular,\n            mm : lt__translate,\n            h : translateSingular,\n            hh : lt__translate,\n            d : translateSingular,\n            dd : lt__translate,\n            M : translateSingular,\n            MM : lt__translate,\n            y : translateSingular,\n            yy : lt__translate\n        },\n        ordinalParse: /\\d{1,2}-oji/,\n        ordinal : function (number) {\n            return number + '-oji';\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : latvian (lv)\n    //! author : Kristaps Karlsons : https://github.com/skakri\n\n    var lv__units = {\n        'mm': 'minūti_minūtes_minūte_minūtes',\n        'hh': 'stundu_stundas_stunda_stundas',\n        'dd': 'dienu_dienas_diena_dienas',\n        'MM': 'mēnesi_mēnešus_mēnesis_mēneši',\n        'yy': 'gadu_gadus_gads_gadi'\n    };\n    function format(word, number, withoutSuffix) {\n        var forms = word.split('_');\n        if (withoutSuffix) {\n            return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];\n        } else {\n            return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];\n        }\n    }\n    function lv__relativeTimeWithPlural(number, withoutSuffix, key) {\n        return number + ' ' + format(lv__units[key], number, withoutSuffix);\n    }\n\n    var lv = moment.defineLocale('lv', {\n        months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),\n        weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'YYYY. [gada] D. MMMM',\n            LLL : 'YYYY. [gada] D. MMMM, LT',\n            LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'\n        },\n        calendar : {\n            sameDay : '[Šodien pulksten] LT',\n            nextDay : '[Rīt pulksten] LT',\n            nextWeek : 'dddd [pulksten] LT',\n            lastDay : '[Vakar pulksten] LT',\n            lastWeek : '[Pagājušā] dddd [pulksten] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s vēlāk',\n            past : '%s agrāk',\n            s : 'dažas sekundes',\n            m : 'minūti',\n            mm : lv__relativeTimeWithPlural,\n            h : 'stundu',\n            hh : lv__relativeTimeWithPlural,\n            d : 'dienu',\n            dd : lv__relativeTimeWithPlural,\n            M : 'mēnesi',\n            MM : lv__relativeTimeWithPlural,\n            y : 'gadu',\n            yy : lv__relativeTimeWithPlural\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : macedonian (mk)\n    //! author : Borislav Mickov : https://github.com/B0k0\n\n    var mk = moment.defineLocale('mk', {\n        months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n        weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Денес во] LT',\n            nextDay : '[Утре во] LT',\n            nextWeek : 'dddd [во] LT',\n            lastDay : '[Вчера во] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[Во изминатата] dddd [во] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[Во изминатиот] dddd [во] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'после %s',\n            past : 'пред %s',\n            s : 'неколку секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дена',\n            M : 'месец',\n            MM : '%d месеци',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : malayalam (ml)\n    //! author : Floyd Pink : https://github.com/floydpink\n\n    var ml = moment.defineLocale('ml', {\n        months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),\n        monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),\n        weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),\n        weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n        weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm -നു',\n            LTS : 'A h:mm:ss -നു',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[ഇന്ന്] LT',\n            nextDay : '[നാളെ] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[ഇന്നലെ] LT',\n            lastWeek : '[കഴിഞ്ഞ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s കഴിഞ്ഞ്',\n            past : '%s മുൻപ്',\n            s : 'അൽപ നിമിഷങ്ങൾ',\n            m : 'ഒരു മിനിറ്റ്',\n            mm : '%d മിനിറ്റ്',\n            h : 'ഒരു മണിക്കൂർ',\n            hh : '%d മണിക്കൂർ',\n            d : 'ഒരു ദിവസം',\n            dd : '%d ദിവസം',\n            M : 'ഒരു മാസം',\n            MM : '%d മാസം',\n            y : 'ഒരു വർഷം',\n            yy : '%d വർഷം'\n        },\n        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n        isPM : function (input) {\n            return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'രാത്രി';\n            } else if (hour < 12) {\n                return 'രാവിലെ';\n            } else if (hour < 17) {\n                return 'ഉച്ച കഴിഞ്ഞ്';\n            } else if (hour < 20) {\n                return 'വൈകുന്നേരം';\n            } else {\n                return 'രാത്രി';\n            }\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Marathi (mr)\n    //! author : Harshad Kale : https://github.com/kalehv\n\n    var mr__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    mr__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var mr = moment.defineLocale('mr', {\n        months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),\n        monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm वाजता',\n            LTS : 'A h:mm:ss वाजता',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[उद्या] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[काल] LT',\n            lastWeek: '[मागील] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s नंतर',\n            past : '%s पूर्वी',\n            s : 'सेकंद',\n            m: 'एक मिनिट',\n            mm: '%d मिनिटे',\n            h : 'एक तास',\n            hh : '%d तास',\n            d : 'एक दिवस',\n            dd : '%d दिवस',\n            M : 'एक महिना',\n            MM : '%d महिने',\n            y : 'एक वर्ष',\n            yy : '%d वर्षे'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return mr__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return mr__symbolMap[match];\n            });\n        },\n        meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात्री') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सकाळी') {\n                return hour;\n            } else if (meridiem === 'दुपारी') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'सायंकाळी') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात्री';\n            } else if (hour < 10) {\n                return 'सकाळी';\n            } else if (hour < 17) {\n                return 'दुपारी';\n            } else if (hour < 20) {\n                return 'सायंकाळी';\n            } else {\n                return 'रात्री';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bahasa Malaysia (ms-MY)\n    //! author : Weldan Jamili : https://github.com/weldan\n\n    var ms_my = moment.defineLocale('ms-my', {\n        months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Esok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kelmarin pukul] LT',\n            lastWeek : 'dddd [lepas pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lepas',\n            s : 'beberapa saat',\n            m : 'seminit',\n            mm : '%d minit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Burmese (my)\n    //! author : Squar team, mysquar.com\n\n    var my__symbolMap = {\n        '1': '၁',\n        '2': '၂',\n        '3': '၃',\n        '4': '၄',\n        '5': '၅',\n        '6': '၆',\n        '7': '၇',\n        '8': '၈',\n        '9': '၉',\n        '0': '၀'\n    }, my__numberMap = {\n        '၁': '1',\n        '၂': '2',\n        '၃': '3',\n        '၄': '4',\n        '၅': '5',\n        '၆': '6',\n        '၇': '7',\n        '၈': '8',\n        '၉': '9',\n        '၀': '0'\n    };\n\n    var my = moment.defineLocale('my', {\n        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),\n        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),\n        weekdaysShort: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        weekdaysMin: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ယနေ.] LT [မှာ]',\n            nextDay: '[မနက်ဖြန်] LT [မှာ]',\n            nextWeek: 'dddd LT [မှာ]',\n            lastDay: '[မနေ.က] LT [မှာ]',\n            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'လာမည့် %s မှာ',\n            past: 'လွန်ခဲ့သော %s က',\n            s: 'စက္ကန်.အနည်းငယ်',\n            m: 'တစ်မိနစ်',\n            mm: '%d မိနစ်',\n            h: 'တစ်နာရီ',\n            hh: '%d နာရီ',\n            d: 'တစ်ရက်',\n            dd: '%d ရက်',\n            M: 'တစ်လ',\n            MM: '%d လ',\n            y: 'တစ်နှစ်',\n            yy: '%d နှစ်'\n        },\n        preparse: function (string) {\n            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n                return my__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return my__symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : norwegian bokmål (nb)\n    //! authors : Espen Hovlandsdal : https://github.com/rexxars\n    //!           Sigurd Gartmann : https://github.com/sigurdga\n\n    var nb = moment.defineLocale('nb', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'H.mm',\n            LTS : 'LT.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[forrige] dddd [kl.] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s siden',\n            s : 'noen sekunder',\n            m : 'ett minutt',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dager',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : nepali/nepalese\n    //! author : suvash : https://github.com/suvash\n\n    var ne__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    ne__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var ne = moment.defineLocale('ne', {\n        months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),\n        monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),\n        weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),\n        weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n        weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'),\n        longDateFormat : {\n            LT : 'Aको h:mm बजे',\n            LTS : 'Aको h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return ne__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ne__symbolMap[match];\n            });\n        },\n        meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राती') {\n                return hour < 3 ? hour : hour + 12;\n            } else if (meridiem === 'बिहान') {\n                return hour;\n            } else if (meridiem === 'दिउँसो') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 3) {\n                return 'राती';\n            } else if (hour < 10) {\n                return 'बिहान';\n            } else if (hour < 15) {\n                return 'दिउँसो';\n            } else if (hour < 18) {\n                return 'बेलुका';\n            } else if (hour < 20) {\n                return 'साँझ';\n            } else {\n                return 'राती';\n            }\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[भोली] LT',\n            nextWeek : '[आउँदो] dddd[,] LT',\n            lastDay : '[हिजो] LT',\n            lastWeek : '[गएको] dddd[,] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%sमा',\n            past : '%s अगाडी',\n            s : 'केही समय',\n            m : 'एक मिनेट',\n            mm : '%d मिनेट',\n            h : 'एक घण्टा',\n            hh : '%d घण्टा',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महिना',\n            MM : '%d महिना',\n            y : 'एक बर्ष',\n            yy : '%d बर्ष'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : dutch (nl)\n    //! author : Joris Röling : https://github.com/jjupiter\n\n    var nl__monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        nl__monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\n    var nl = moment.defineLocale('nl', {\n        months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return nl__monthsShortWithoutDots[m.month()];\n            } else {\n                return nl__monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'over %s',\n            past : '%s geleden',\n            s : 'een paar seconden',\n            m : 'één minuut',\n            mm : '%d minuten',\n            h : 'één uur',\n            hh : '%d uur',\n            d : 'één dag',\n            dd : '%d dagen',\n            M : 'één maand',\n            MM : '%d maanden',\n            y : 'één jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : norwegian nynorsk (nn)\n    //! author : https://github.com/mechuwind\n\n    var nn = moment.defineLocale('nn', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n        weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),\n        weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[I dag klokka] LT',\n            nextDay: '[I morgon klokka] LT',\n            nextWeek: 'dddd [klokka] LT',\n            lastDay: '[I går klokka] LT',\n            lastWeek: '[Føregåande] dddd [klokka] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s sidan',\n            s : 'nokre sekund',\n            m : 'eit minutt',\n            mm : '%d minutt',\n            h : 'ein time',\n            hh : '%d timar',\n            d : 'ein dag',\n            dd : '%d dagar',\n            M : 'ein månad',\n            MM : '%d månader',\n            y : 'eit år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : polish (pl)\n    //! author : Rafal Hirsz : https://github.com/evoL\n\n    var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),\n        monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');\n    function pl__plural(n) {\n        return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);\n    }\n    function pl__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'minuta' : 'minutę';\n        case 'mm':\n            return result + (pl__plural(number) ? 'minuty' : 'minut');\n        case 'h':\n            return withoutSuffix  ? 'godzina'  : 'godzinę';\n        case 'hh':\n            return result + (pl__plural(number) ? 'godziny' : 'godzin');\n        case 'MM':\n            return result + (pl__plural(number) ? 'miesiące' : 'miesięcy');\n        case 'yy':\n            return result + (pl__plural(number) ? 'lata' : 'lat');\n        }\n    }\n\n    var pl = moment.defineLocale('pl', {\n        months : function (momentToFormat, format) {\n            if (/D MMMM/.test(format)) {\n                return monthsSubjective[momentToFormat.month()];\n            } else {\n                return monthsNominative[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n        weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n        weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),\n        weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Dziś o] LT',\n            nextDay: '[Jutro o] LT',\n            nextWeek: '[W] dddd [o] LT',\n            lastDay: '[Wczoraj o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[W zeszłą niedzielę o] LT';\n                case 3:\n                    return '[W zeszłą środę o] LT';\n                case 6:\n                    return '[W zeszłą sobotę o] LT';\n                default:\n                    return '[W zeszły] dddd [o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : '%s temu',\n            s : 'kilka sekund',\n            m : pl__translate,\n            mm : pl__translate,\n            h : pl__translate,\n            hh : pl__translate,\n            d : '1 dzień',\n            dd : '%d dni',\n            M : 'miesiąc',\n            MM : pl__translate,\n            y : 'rok',\n            yy : pl__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : brazilian portuguese (pt-br)\n    //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n    var pt_br = moment.defineLocale('pt-br', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY [às] LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY [às] LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : '%s atrás',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº'\n    });\n\n    //! moment.js locale configuration\n    //! locale : portuguese (pt)\n    //! author : Jefferson : https://github.com/jalex79\n\n    var pt = moment.defineLocale('pt', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : 'há %s',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : romanian (ro)\n    //! author : Vlad Gurdiga : https://github.com/gurdiga\n    //! author : Valentin Agachi : https://github.com/avaly\n\n    function ro__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n                'mm': 'minute',\n                'hh': 'ore',\n                'dd': 'zile',\n                'MM': 'luni',\n                'yy': 'ani'\n            },\n            separator = ' ';\n        if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n            separator = ' de ';\n        }\n        return number + separator + format[key];\n    }\n\n    var ro = moment.defineLocale('ro', {\n        months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n        monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n        weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n        weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n        weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY H:mm',\n            LLLL : 'dddd, D MMMM YYYY H:mm'\n        },\n        calendar : {\n            sameDay: '[azi la] LT',\n            nextDay: '[mâine la] LT',\n            nextWeek: 'dddd [la] LT',\n            lastDay: '[ieri la] LT',\n            lastWeek: '[fosta] dddd [la] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'peste %s',\n            past : '%s în urmă',\n            s : 'câteva secunde',\n            m : 'un minut',\n            mm : ro__relativeTimeWithPlural,\n            h : 'o oră',\n            hh : ro__relativeTimeWithPlural,\n            d : 'o zi',\n            dd : ro__relativeTimeWithPlural,\n            M : 'o lună',\n            MM : ro__relativeTimeWithPlural,\n            y : 'un an',\n            yy : ro__relativeTimeWithPlural\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : russian (ru)\n    //! author : Viktorminator : https://github.com/Viktorminator\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function ru__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function ru__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n            'hh': 'час_часа_часов',\n            'dd': 'день_дня_дней',\n            'MM': 'месяц_месяца_месяцев',\n            'yy': 'год_года_лет'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'минута' : 'минуту';\n        }\n        else {\n            return number + ' ' + ru__plural(format[key], +number);\n        }\n    }\n    function ru__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function ru__monthsShortCaseReplace(m, format) {\n        var monthsShort = {\n            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return monthsShort[nounCase][m.month()];\n    }\n    function ru__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n            'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ru = moment.defineLocale('ru', {\n        months : ru__monthsCaseReplace,\n        monthsShort : ru__monthsShortCaseReplace,\n        weekdays : ru__weekdaysCaseReplace,\n        weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сегодня в] LT',\n            nextDay: '[Завтра в] LT',\n            lastDay: '[Вчера в] LT',\n            nextWeek: function () {\n                return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';\n            },\n            lastWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                    case 0:\n                        return '[В прошлое] dddd [в] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                        return '[В прошлый] dddd [в] LT';\n                    case 3:\n                    case 5:\n                    case 6:\n                        return '[В прошлую] dddd [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd [в] LT';\n                    } else {\n                        return '[В] dddd [в] LT';\n                    }\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'через %s',\n            past : '%s назад',\n            s : 'несколько секунд',\n            m : ru__relativeTimeWithPlural,\n            mm : ru__relativeTimeWithPlural,\n            h : 'час',\n            hh : ru__relativeTimeWithPlural,\n            d : 'день',\n            dd : ru__relativeTimeWithPlural,\n            M : 'месяц',\n            MM : ru__relativeTimeWithPlural,\n            y : 'год',\n            yy : ru__relativeTimeWithPlural\n        },\n        meridiemParse: /ночи|утра|дня|вечера/i,\n        isPM : function (input) {\n            return /^(дня|вечера)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночи';\n            } else if (hour < 12) {\n                return 'утра';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечера';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го|я)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            case 'w':\n            case 'W':\n                return number + '-я';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : slovak (sk)\n    //! author : Martin Minka : https://github.com/k2s\n    //! based on work of petrbela : https://github.com/petrbela\n\n    var sk__months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),\n        sk__monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n    function sk__plural(n) {\n        return (n > 1) && (n < 5);\n    }\n    function sk__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'minúty' : 'minút');\n            } else {\n                return result + 'minútami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'hodiny' : 'hodín');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'dni' : 'dní');\n            } else {\n                return result + 'dňami';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'mesiace' : 'mesiacov');\n            } else {\n                return result + 'mesiacmi';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'roky' : 'rokov');\n            } else {\n                return result + 'rokmi';\n            }\n            break;\n        }\n    }\n\n    var sk = moment.defineLocale('sk', {\n        months : sk__months,\n        monthsShort : sk__monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(sk__months, sk__monthsShort)),\n        weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n        weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),\n        weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes o] LT',\n            nextDay: '[zajtra o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [o] LT';\n                case 3:\n                    return '[v stredu o] LT';\n                case 4:\n                    return '[vo štvrtok o] LT';\n                case 5:\n                    return '[v piatok o] LT';\n                case 6:\n                    return '[v sobotu o] LT';\n                }\n            },\n            lastDay: '[včera o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulú nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[minulý] dddd [o] LT';\n                case 3:\n                    return '[minulú stredu o] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [o] LT';\n                case 6:\n                    return '[minulú sobotu o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'pred %s',\n            s : sk__translate,\n            m : sk__translate,\n            mm : sk__translate,\n            h : sk__translate,\n            hh : sk__translate,\n            d : sk__translate,\n            dd : sk__translate,\n            M : sk__translate,\n            MM : sk__translate,\n            y : sk__translate,\n            yy : sk__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : slovenian (sl)\n    //! author : Robert Sedovšek : https://github.com/sedovsek\n\n    function sl__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'ena minuta' : 'eno minuto';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2) {\n                result += 'minuti';\n            } else if (number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minut';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'ena ura' : 'eno uro';\n        case 'hh':\n            if (number === 1) {\n                result += 'ura';\n            } else if (number === 2) {\n                result += 'uri';\n            } else if (number === 3 || number === 4) {\n                result += 'ure';\n            } else {\n                result += 'ur';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dni';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mesec';\n            } else if (number === 2) {\n                result += 'meseca';\n            } else if (number === 3 || number === 4) {\n                result += 'mesece';\n            } else {\n                result += 'mesecev';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'leto';\n            } else if (number === 2) {\n                result += 'leti';\n            } else if (number === 3 || number === 4) {\n                result += 'leta';\n            } else {\n                result += 'let';\n            }\n            return result;\n        }\n    }\n\n    var sl = moment.defineLocale('sl', {\n        months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n        weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n        weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danes ob] LT',\n            nextDay  : '[jutri ob] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v] [nedeljo] [ob] LT';\n                case 3:\n                    return '[v] [sredo] [ob] LT';\n                case 6:\n                    return '[v] [soboto] [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[v] dddd [ob] LT';\n                }\n            },\n            lastDay  : '[včeraj ob] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[prejšnja] dddd [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prejšnji] dddd [ob] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'čez %s',\n            past   : '%s nazaj',\n            s      : 'nekaj sekund',\n            m      : sl__translate,\n            mm     : sl__translate,\n            h      : sl__translate,\n            hh     : sl__translate,\n            d      : 'en dan',\n            dd     : sl__translate,\n            M      : 'en mesec',\n            MM     : sl__translate,\n            y      : 'eno leto',\n            yy     : sl__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Albanian (sq)\n    //! author : Flakërim Ismani : https://github.com/flakerimi\n    //! author: Menelion Elensúle: https://github.com/Oire (tests)\n    //! author : Oerd Cukalla : https://github.com/oerd (fixes)\n\n    var sq = moment.defineLocale('sq', {\n        months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n        monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n        weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n        weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n        weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),\n        meridiemParse: /PD|MD/,\n        isPM: function (input) {\n            return input.charAt(0) === 'M';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            return hours < 12 ? 'PD' : 'MD';\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Sot në] LT',\n            nextDay : '[Nesër në] LT',\n            nextWeek : 'dddd [në] LT',\n            lastDay : '[Dje në] LT',\n            lastWeek : 'dddd [e kaluar në] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'në %s',\n            past : '%s më parë',\n            s : 'disa sekonda',\n            m : 'një minutë',\n            mm : '%d minuta',\n            h : 'një orë',\n            hh : '%d orë',\n            d : 'një ditë',\n            dd : '%d ditë',\n            M : 'një muaj',\n            MM : '%d muaj',\n            y : 'një vit',\n            yy : '%d vite'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Serbian-cyrillic (sr-cyrl)\n    //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n    var sr_cyrl__translator = {\n        words: { //Different grammatical cases\n            m: ['један минут', 'једне минуте'],\n            mm: ['минут', 'минуте', 'минута'],\n            h: ['један сат', 'једног сата'],\n            hh: ['сат', 'сата', 'сати'],\n            dd: ['дан', 'дана', 'дана'],\n            MM: ['месец', 'месеца', 'месеци'],\n            yy: ['година', 'године', 'година']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = sr_cyrl__translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + sr_cyrl__translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr_cyrl = moment.defineLocale('sr-cyrl', {\n        months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],\n        monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],\n        weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],\n        weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],\n        weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[данас у] LT',\n            nextDay: '[сутра у] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[у] [недељу] [у] LT';\n                case 3:\n                    return '[у] [среду] [у] LT';\n                case 6:\n                    return '[у] [суботу] [у] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[у] dddd [у] LT';\n                }\n            },\n            lastDay  : '[јуче у] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past   : 'пре %s',\n            s      : 'неколико секунди',\n            m      : sr_cyrl__translator.translate,\n            mm     : sr_cyrl__translator.translate,\n            h      : sr_cyrl__translator.translate,\n            hh     : sr_cyrl__translator.translate,\n            d      : 'дан',\n            dd     : sr_cyrl__translator.translate,\n            M      : 'месец',\n            MM     : sr_cyrl__translator.translate,\n            y      : 'годину',\n            yy     : sr_cyrl__translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Serbian-latin (sr)\n    //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n    var sr__translator = {\n        words: { //Different grammatical cases\n            m: ['jedan minut', 'jedne minute'],\n            mm: ['minut', 'minute', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            dd: ['dan', 'dana', 'dana'],\n            MM: ['mesec', 'meseca', 'meseci'],\n            yy: ['godina', 'godine', 'godina']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = sr__translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + sr__translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr = moment.defineLocale('sr', {\n        months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],\n        monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],\n        weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],\n        weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],\n        weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedelju] [u] LT';\n                case 3:\n                    return '[u] [sredu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[juče u] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'pre %s',\n            s      : 'nekoliko sekundi',\n            m      : sr__translator.translate,\n            mm     : sr__translator.translate,\n            h      : sr__translator.translate,\n            hh     : sr__translator.translate,\n            d      : 'dan',\n            dd     : sr__translator.translate,\n            M      : 'mesec',\n            MM     : sr__translator.translate,\n            y      : 'godinu',\n            yy     : sr__translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : swedish (sv)\n    //! author : Jens Alm : https://github.com/ulmus\n\n    var sv = moment.defineLocale('sv', {\n        months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n        weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n        weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Idag] LT',\n            nextDay: '[Imorgon] LT',\n            lastDay: '[Igår] LT',\n            nextWeek: 'dddd LT',\n            lastWeek: '[Förra] dddd[en] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'för %s sedan',\n            s : 'några sekunder',\n            m : 'en minut',\n            mm : '%d minuter',\n            h : 'en timme',\n            hh : '%d timmar',\n            d : 'en dag',\n            dd : '%d dagar',\n            M : 'en månad',\n            MM : '%d månader',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}(e|a)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'e' :\n                (b === 1) ? 'a' :\n                (b === 2) ? 'a' :\n                (b === 3) ? 'e' : 'e';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : tamil (ta)\n    //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n    var ta = moment.defineLocale('ta', {\n        months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),\n        weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),\n        weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[இன்று] LT',\n            nextDay : '[நாளை] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[நேற்று] LT',\n            lastWeek : '[கடந்த வாரம்] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s இல்',\n            past : '%s முன்',\n            s : 'ஒரு சில விநாடிகள்',\n            m : 'ஒரு நிமிடம்',\n            mm : '%d நிமிடங்கள்',\n            h : 'ஒரு மணி நேரம்',\n            hh : '%d மணி நேரம்',\n            d : 'ஒரு நாள்',\n            dd : '%d நாட்கள்',\n            M : 'ஒரு மாதம்',\n            MM : '%d மாதங்கள்',\n            y : 'ஒரு வருடம்',\n            yy : '%d ஆண்டுகள்'\n        },\n        ordinalParse: /\\d{1,2}வது/,\n        ordinal : function (number) {\n            return number + 'வது';\n        },\n        // refer http://ta.wikipedia.org/s/1er1\n        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 2) {\n                return ' யாமம்';\n            } else if (hour < 6) {\n                return ' வைகறை';  // வைகறை\n            } else if (hour < 10) {\n                return ' காலை'; // காலை\n            } else if (hour < 14) {\n                return ' நண்பகல்'; // நண்பகல்\n            } else if (hour < 18) {\n                return ' எற்பாடு'; // எற்பாடு\n            } else if (hour < 22) {\n                return ' மாலை'; // மாலை\n            } else {\n                return ' யாமம்';\n            }\n        },\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'யாமம்') {\n                return hour < 2 ? hour : hour + 12;\n            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n                return hour;\n            } else if (meridiem === 'நண்பகல்') {\n                return hour >= 10 ? hour : hour + 12;\n            } else {\n                return hour + 12;\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : thai (th)\n    //! author : Kridsada Thanabulpong : https://github.com/sirn\n\n    var th = moment.defineLocale('th', {\n        months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),\n        monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),\n        weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n        weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n        weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n        longDateFormat : {\n            LT : 'H นาฬิกา m นาที',\n            LTS : 'LT s วินาที',\n            L : 'YYYY/MM/DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY เวลา LT',\n            LLLL : 'วันddddที่ D MMMM YYYY เวลา LT'\n        },\n        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n        isPM: function (input) {\n            return input === 'หลังเที่ยง';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ก่อนเที่ยง';\n            } else {\n                return 'หลังเที่ยง';\n            }\n        },\n        calendar : {\n            sameDay : '[วันนี้ เวลา] LT',\n            nextDay : '[พรุ่งนี้ เวลา] LT',\n            nextWeek : 'dddd[หน้า เวลา] LT',\n            lastDay : '[เมื่อวานนี้ เวลา] LT',\n            lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'อีก %s',\n            past : '%sที่แล้ว',\n            s : 'ไม่กี่วินาที',\n            m : '1 นาที',\n            mm : '%d นาที',\n            h : '1 ชั่วโมง',\n            hh : '%d ชั่วโมง',\n            d : '1 วัน',\n            dd : '%d วัน',\n            M : '1 เดือน',\n            MM : '%d เดือน',\n            y : '1 ปี',\n            yy : '%d ปี'\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Tagalog/Filipino (tl-ph)\n    //! author : Dan Hagman\n\n    var tl_ph = moment.defineLocale('tl-ph', {\n        months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),\n        monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),\n        weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'MM/D/YYYY',\n            LL : 'MMMM D, YYYY',\n            LLL : 'MMMM D, YYYY LT',\n            LLLL : 'dddd, MMMM DD, YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Ngayon sa] LT',\n            nextDay: '[Bukas sa] LT',\n            nextWeek: 'dddd [sa] LT',\n            lastDay: '[Kahapon sa] LT',\n            lastWeek: 'dddd [huling linggo] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'sa loob ng %s',\n            past : '%s ang nakalipas',\n            s : 'ilang segundo',\n            m : 'isang minuto',\n            mm : '%d minuto',\n            h : 'isang oras',\n            hh : '%d oras',\n            d : 'isang araw',\n            dd : '%d araw',\n            M : 'isang buwan',\n            MM : '%d buwan',\n            y : 'isang taon',\n            yy : '%d taon'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : turkish (tr)\n    //! authors : Erhan Gundogan : https://github.com/erhangundogan,\n    //!           Burak Yiğit Kaya: https://github.com/BYK\n\n    var tr__suffixes = {\n        1: '\\'inci',\n        5: '\\'inci',\n        8: '\\'inci',\n        70: '\\'inci',\n        80: '\\'inci',\n        2: '\\'nci',\n        7: '\\'nci',\n        20: '\\'nci',\n        50: '\\'nci',\n        3: '\\'üncü',\n        4: '\\'üncü',\n        100: '\\'üncü',\n        6: '\\'ncı',\n        9: '\\'uncu',\n        10: '\\'uncu',\n        30: '\\'uncu',\n        60: '\\'ıncı',\n        90: '\\'ıncı'\n    };\n\n    var tr = moment.defineLocale('tr', {\n        months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n        monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n        weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),\n        weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n        weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[yarın saat] LT',\n            nextWeek : '[haftaya] dddd [saat] LT',\n            lastDay : '[dün] LT',\n            lastWeek : '[geçen hafta] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s önce',\n            s : 'birkaç saniye',\n            m : 'bir dakika',\n            mm : '%d dakika',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir yıl',\n            yy : '%d yıl'\n        },\n        ordinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '\\'ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (tr__suffixes[a] || tr__suffixes[b] || tr__suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var tzm_latn = moment.defineLocale('tzm-latn', {\n        months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[asdkh g] LT',\n            nextDay: '[aska g] LT',\n            nextWeek: 'dddd [g] LT',\n            lastDay: '[assant g] LT',\n            lastWeek: 'dddd [g] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dadkh s yan %s',\n            past : 'yan %s',\n            s : 'imik',\n            m : 'minuḍ',\n            mm : '%d minuḍ',\n            h : 'saɛa',\n            hh : '%d tassaɛin',\n            d : 'ass',\n            dd : '%d ossan',\n            M : 'ayowr',\n            MM : '%d iyyirn',\n            y : 'asgas',\n            yy : '%d isgasn'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Morocco Central Atlas Tamaziɣt (tzm)\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var tzm = moment.defineLocale('tzm', {\n        months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS: 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n            nextWeek: 'dddd [ⴴ] LT',\n            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n            lastWeek: 'dddd [ⴴ] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n            past : 'ⵢⴰⵏ %s',\n            s : 'ⵉⵎⵉⴽ',\n            m : 'ⵎⵉⵏⵓⴺ',\n            mm : '%d ⵎⵉⵏⵓⴺ',\n            h : 'ⵙⴰⵄⴰ',\n            hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n            d : 'ⴰⵙⵙ',\n            dd : '%d oⵙⵙⴰⵏ',\n            M : 'ⴰⵢoⵓⵔ',\n            MM : '%d ⵉⵢⵢⵉⵔⵏ',\n            y : 'ⴰⵙⴳⴰⵙ',\n            yy : '%d ⵉⵙⴳⴰⵙⵏ'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : ukrainian (uk)\n    //! author : zemlanin : https://github.com/zemlanin\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function uk__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function uk__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'хвилина_хвилини_хвилин',\n            'hh': 'година_години_годин',\n            'dd': 'день_дні_днів',\n            'MM': 'місяць_місяці_місяців',\n            'yy': 'рік_роки_років'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвилина' : 'хвилину';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'година' : 'годину';\n        }\n        else {\n            return number + ' ' + uk__plural(format[key], +number);\n        }\n    }\n    function uk__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),\n            'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')\n        },\n        nounCase = (/D[oD]? *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function uk__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n            'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n            'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n        },\n        nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n            'accusative' :\n            ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n                'genitive' :\n                'nominative');\n        return weekdays[nounCase][m.day()];\n    }\n    function processHoursFunction(str) {\n        return function () {\n            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n        };\n    }\n\n    var uk = moment.defineLocale('uk', {\n        months : uk__monthsCaseReplace,\n        monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n        weekdays : uk__weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY р.',\n            LLL : 'D MMMM YYYY р., LT',\n            LLLL : 'dddd, D MMMM YYYY р., LT'\n        },\n        calendar : {\n            sameDay: processHoursFunction('[Сьогодні '),\n            nextDay: processHoursFunction('[Завтра '),\n            lastDay: processHoursFunction('[Вчора '),\n            nextWeek: processHoursFunction('[У] dddd ['),\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return processHoursFunction('[Минулої] dddd [').call(this);\n                case 1:\n                case 2:\n                case 4:\n                    return processHoursFunction('[Минулого] dddd [').call(this);\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past : '%s тому',\n            s : 'декілька секунд',\n            m : uk__relativeTimeWithPlural,\n            mm : uk__relativeTimeWithPlural,\n            h : 'годину',\n            hh : uk__relativeTimeWithPlural,\n            d : 'день',\n            dd : uk__relativeTimeWithPlural,\n            M : 'місяць',\n            MM : uk__relativeTimeWithPlural,\n            y : 'рік',\n            yy : uk__relativeTimeWithPlural\n        },\n        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n        meridiemParse: /ночі|ранку|дня|вечора/,\n        isPM: function (input) {\n            return /^(дня|вечора)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночі';\n            } else if (hour < 12) {\n                return 'ранку';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечора';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : uzbek (uz)\n    //! author : Sardor Muminov : https://github.com/muminoff\n\n    var uz = moment.defineLocale('uz', {\n        months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n        monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n        weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n        weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'D MMMM YYYY, dddd LT'\n        },\n        calendar : {\n            sameDay : '[Бугун соат] LT [да]',\n            nextDay : '[Эртага] LT [да]',\n            nextWeek : 'dddd [куни соат] LT [да]',\n            lastDay : '[Кеча соат] LT [да]',\n            lastWeek : '[Утган] dddd [куни соат] LT [да]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'Якин %s ичида',\n            past : 'Бир неча %s олдин',\n            s : 'фурсат',\n            m : 'бир дакика',\n            mm : '%d дакика',\n            h : 'бир соат',\n            hh : '%d соат',\n            d : 'бир кун',\n            dd : '%d кун',\n            M : 'бир ой',\n            MM : '%d ой',\n            y : 'бир йил',\n            yy : '%d йил'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : vietnamese (vi)\n    //! author : Bang Nguyen : https://github.com/bangnk\n\n    var vi = moment.defineLocale('vi', {\n        months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n        monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n        weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),\n        weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM [năm] YYYY',\n            LLL : 'D MMMM [năm] YYYY LT',\n            LLLL : 'dddd, D MMMM [năm] YYYY LT',\n            l : 'DD/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hôm nay lúc] LT',\n            nextDay: '[Ngày mai lúc] LT',\n            nextWeek: 'dddd [tuần tới lúc] LT',\n            lastDay: '[Hôm qua lúc] LT',\n            lastWeek: 'dddd [tuần rồi lúc] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s tới',\n            past : '%s trước',\n            s : 'vài giây',\n            m : 'một phút',\n            mm : '%d phút',\n            h : 'một giờ',\n            hh : '%d giờ',\n            d : 'một ngày',\n            dd : '%d ngày',\n            M : 'một tháng',\n            MM : '%d tháng',\n            y : 'một năm',\n            yy : '%d năm'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : chinese (zh-cn)\n    //! author : suupic : https://github.com/suupic\n    //! author : Zeno Zeng : https://github.com/zenozeng\n\n    var zh_cn = moment.defineLocale('zh-cn', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah点mm',\n            LTS : 'Ah点m分s秒',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' ||\n                    meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            } else {\n                // '中午'\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : function () {\n                return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';\n            },\n            nextDay : function () {\n                return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';\n            },\n            lastDay : function () {\n                return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';\n            },\n            nextWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = moment().startOf('week');\n                prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            lastWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = moment().startOf('week');\n                prefix = this.unix() < startOfWeek.unix()  ? '[上]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            sameElse : 'LL'\n        },\n        ordinalParse: /\\d{1,2}(日|月|周)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd':\n            case 'D':\n            case 'DDD':\n                return number + '日';\n            case 'M':\n                return number + '月';\n            case 'w':\n            case 'W':\n                return number + '周';\n            default:\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s内',\n            past : '%s前',\n            s : '几秒',\n            m : '1分钟',\n            mm : '%d分钟',\n            h : '1小时',\n            hh : '%d小时',\n            d : '1天',\n            dd : '%d天',\n            M : '1个月',\n            MM : '%d个月',\n            y : '1年',\n            yy : '%d年'\n        },\n        week : {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : traditional chinese (zh-tw)\n    //! author : Ben : https://github.com/ben-lin\n\n    var zh_tw = moment.defineLocale('zh-tw', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah點mm',\n            LTS : 'Ah點m分s秒',\n            L : 'YYYY年MMMD日',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY年MMMD日',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /早上|上午|中午|下午|晚上/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : '[今天]LT',\n            nextDay : '[明天]LT',\n            nextWeek : '[下]ddddLT',\n            lastDay : '[昨天]LT',\n            lastWeek : '[上]ddddLT',\n            sameElse : 'L'\n        },\n        ordinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd' :\n            case 'D' :\n            case 'DDD' :\n                return number + '日';\n            case 'M' :\n                return number + '月';\n            case 'w' :\n            case 'W' :\n                return number + '週';\n            default :\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s內',\n            past : '%s前',\n            s : '幾秒',\n            m : '一分鐘',\n            mm : '%d分鐘',\n            h : '一小時',\n            hh : '%d小時',\n            d : '一天',\n            dd : '%d天',\n            M : '一個月',\n            MM : '%d個月',\n            y : '一年',\n            yy : '%d年'\n        }\n    });\n\n\n\n}));"
  },
  {
    "path": "www/lib/moment/min/moment-with-locales.js",
    "content": "(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    global.moment = factory()\n}(this, function () { 'use strict';\n\n    var hookCallback;\n\n    function utils_hooks__hooks () {\n        return hookCallback.apply(null, arguments);\n    }\n\n    // This is done to register the method called with moment()\n    // without creating circular dependencies.\n    function setHookCallback (callback) {\n        hookCallback = callback;\n    }\n\n    function defaultParsingFlags() {\n        // We need to deep clone this object.\n        return {\n            empty           : false,\n            unusedTokens    : [],\n            unusedInput     : [],\n            overflow        : -2,\n            charsLeftOver   : 0,\n            nullInput       : false,\n            invalidMonth    : null,\n            invalidFormat   : false,\n            userInvalidated : false,\n            iso             : false\n        };\n    }\n\n    function isArray(input) {\n        return Object.prototype.toString.call(input) === '[object Array]';\n    }\n\n    function isDate(input) {\n        return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;\n    }\n\n    function map(arr, fn) {\n        var res = [], i;\n        for (i = 0; i < arr.length; ++i) {\n            res.push(fn(arr[i], i));\n        }\n        return res;\n    }\n\n    function hasOwnProp(a, b) {\n        return Object.prototype.hasOwnProperty.call(a, b);\n    }\n\n    function extend(a, b) {\n        for (var i in b) {\n            if (hasOwnProp(b, i)) {\n                a[i] = b[i];\n            }\n        }\n\n        if (hasOwnProp(b, 'toString')) {\n            a.toString = b.toString;\n        }\n\n        if (hasOwnProp(b, 'valueOf')) {\n            a.valueOf = b.valueOf;\n        }\n\n        return a;\n    }\n\n    function create_utc__createUTC (input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, true).utc();\n    }\n\n    function valid__isValid(m) {\n        if (m._isValid == null) {\n            m._isValid = !isNaN(m._d.getTime()) &&\n                m._pf.overflow < 0 &&\n                !m._pf.empty &&\n                !m._pf.invalidMonth &&\n                !m._pf.nullInput &&\n                !m._pf.invalidFormat &&\n                !m._pf.userInvalidated;\n\n            if (m._strict) {\n                m._isValid = m._isValid &&\n                    m._pf.charsLeftOver === 0 &&\n                    m._pf.unusedTokens.length === 0 &&\n                    m._pf.bigHour === undefined;\n            }\n        }\n        return m._isValid;\n    }\n\n    function valid__createInvalid (flags) {\n        var m = create_utc__createUTC(NaN);\n        if (flags != null) {\n            extend(m._pf, flags);\n        }\n        else {\n            m._pf.userInvalidated = true;\n        }\n\n        return m;\n    }\n\n    var momentProperties = utils_hooks__hooks.momentProperties = [];\n\n    function copyConfig(to, from) {\n        var i, prop, val;\n\n        if (typeof from._isAMomentObject !== 'undefined') {\n            to._isAMomentObject = from._isAMomentObject;\n        }\n        if (typeof from._i !== 'undefined') {\n            to._i = from._i;\n        }\n        if (typeof from._f !== 'undefined') {\n            to._f = from._f;\n        }\n        if (typeof from._l !== 'undefined') {\n            to._l = from._l;\n        }\n        if (typeof from._strict !== 'undefined') {\n            to._strict = from._strict;\n        }\n        if (typeof from._tzm !== 'undefined') {\n            to._tzm = from._tzm;\n        }\n        if (typeof from._isUTC !== 'undefined') {\n            to._isUTC = from._isUTC;\n        }\n        if (typeof from._offset !== 'undefined') {\n            to._offset = from._offset;\n        }\n        if (typeof from._pf !== 'undefined') {\n            to._pf = from._pf;\n        }\n        if (typeof from._locale !== 'undefined') {\n            to._locale = from._locale;\n        }\n\n        if (momentProperties.length > 0) {\n            for (i in momentProperties) {\n                prop = momentProperties[i];\n                val = from[prop];\n                if (typeof val !== 'undefined') {\n                    to[prop] = val;\n                }\n            }\n        }\n\n        return to;\n    }\n\n    var updateInProgress = false;\n\n    // Moment prototype object\n    function Moment(config) {\n        copyConfig(this, config);\n        this._d = new Date(+config._d);\n        // Prevent infinite loop in case updateOffset creates new moment\n        // objects.\n        if (updateInProgress === false) {\n            updateInProgress = true;\n            utils_hooks__hooks.updateOffset(this);\n            updateInProgress = false;\n        }\n    }\n\n    function isMoment (obj) {\n        return obj instanceof Moment || (obj != null && hasOwnProp(obj, '_isAMomentObject'));\n    }\n\n    function toInt(argumentForCoercion) {\n        var coercedNumber = +argumentForCoercion,\n            value = 0;\n\n        if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n            if (coercedNumber >= 0) {\n                value = Math.floor(coercedNumber);\n            } else {\n                value = Math.ceil(coercedNumber);\n            }\n        }\n\n        return value;\n    }\n\n    function compareArrays(array1, array2, dontConvert) {\n        var len = Math.min(array1.length, array2.length),\n            lengthDiff = Math.abs(array1.length - array2.length),\n            diffs = 0,\n            i;\n        for (i = 0; i < len; i++) {\n            if ((dontConvert && array1[i] !== array2[i]) ||\n                (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n                diffs++;\n            }\n        }\n        return diffs + lengthDiff;\n    }\n\n    function Locale() {\n    }\n\n    var locales = {};\n    var globalLocale;\n\n    function normalizeLocale(key) {\n        return key ? key.toLowerCase().replace('_', '-') : key;\n    }\n\n    // pick the locale from the array\n    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n    function chooseLocale(names) {\n        var i = 0, j, next, locale, split;\n\n        while (i < names.length) {\n            split = normalizeLocale(names[i]).split('-');\n            j = split.length;\n            next = normalizeLocale(names[i + 1]);\n            next = next ? next.split('-') : null;\n            while (j > 0) {\n                locale = loadLocale(split.slice(0, j).join('-'));\n                if (locale) {\n                    return locale;\n                }\n                if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n                    //the next array item is better than a shallower substring of this one\n                    break;\n                }\n                j--;\n            }\n            i++;\n        }\n        return null;\n    }\n\n    function loadLocale(name) {\n        var oldLocale = null;\n        // TODO: Find a better way to register and load all the locales in Node\n        if (!locales[name] && typeof module !== 'undefined' &&\n                module && module.exports) {\n            try {\n                oldLocale = globalLocale._abbr;\n                require('./locale/' + name);\n                // because defineLocale currently also sets the global locale, we\n                // want to undo that for lazy loaded locales\n                locale_locales__getSetGlobalLocale(oldLocale);\n            } catch (e) { }\n        }\n        return locales[name];\n    }\n\n    // This function will load locale and then set the global locale.  If\n    // no arguments are passed in, it will simply return the current global\n    // locale key.\n    function locale_locales__getSetGlobalLocale (key, values) {\n        var data;\n        if (key) {\n            if (typeof values === 'undefined') {\n                data = locale_locales__getLocale(key);\n            }\n            else {\n                data = defineLocale(key, values);\n            }\n\n            if (data) {\n                // moment.duration._locale = moment._locale = data;\n                globalLocale = data;\n            }\n        }\n\n        return globalLocale._abbr;\n    }\n\n    function defineLocale (name, values) {\n        if (values !== null) {\n            values.abbr = name;\n            if (!locales[name]) {\n                locales[name] = new Locale();\n            }\n            locales[name].set(values);\n\n            // backwards compat for now: also set the locale\n            locale_locales__getSetGlobalLocale(name);\n\n            return locales[name];\n        } else {\n            // useful for testing\n            delete locales[name];\n            return null;\n        }\n    }\n\n    // returns locale data\n    function locale_locales__getLocale (key) {\n        var locale;\n\n        if (key && key._locale && key._locale._abbr) {\n            key = key._locale._abbr;\n        }\n\n        if (!key) {\n            return globalLocale;\n        }\n\n        if (!isArray(key)) {\n            //short-circuit everything else\n            locale = loadLocale(key);\n            if (locale) {\n                return locale;\n            }\n            key = [key];\n        }\n\n        return chooseLocale(key);\n    }\n\n    var aliases = {};\n\n    function addUnitAlias (unit, shorthand) {\n        var lowerCase = unit.toLowerCase();\n        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n    }\n\n    function normalizeUnits(units) {\n        return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n    }\n\n    function normalizeObjectUnits(inputObject) {\n        var normalizedInput = {},\n            normalizedProp,\n            prop;\n\n        for (prop in inputObject) {\n            if (hasOwnProp(inputObject, prop)) {\n                normalizedProp = normalizeUnits(prop);\n                if (normalizedProp) {\n                    normalizedInput[normalizedProp] = inputObject[prop];\n                }\n            }\n        }\n\n        return normalizedInput;\n    }\n\n    function makeGetSet (unit, keepTime) {\n        return function (value) {\n            if (value != null) {\n                get_set__set(this, unit, value);\n                utils_hooks__hooks.updateOffset(this, keepTime);\n                return this;\n            } else {\n                return get_set__get(this, unit);\n            }\n        };\n    }\n\n    function get_set__get (mom, unit) {\n        return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();\n    }\n\n    function get_set__set (mom, unit, value) {\n        return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n    }\n\n    // MOMENTS\n\n    function getSet (units, value) {\n        var unit;\n        if (typeof units === 'object') {\n            for (unit in units) {\n                this.set(unit, units[unit]);\n            }\n        } else {\n            units = normalizeUnits(units);\n            if (typeof this[units] === 'function') {\n                return this[units](value);\n            }\n        }\n        return this;\n    }\n\n    function zeroFill(number, targetLength, forceSign) {\n        var output = '' + Math.abs(number),\n            sign = number >= 0;\n\n        while (output.length < targetLength) {\n            output = '0' + output;\n        }\n        return (sign ? (forceSign ? '+' : '') : '-') + output;\n    }\n\n    var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g;\n\n    var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n    var formatFunctions = {};\n\n    var formatTokenFunctions = {};\n\n    // token:    'M'\n    // padded:   ['MM', 2]\n    // ordinal:  'Mo'\n    // callback: function () { this.month() + 1 }\n    function addFormatToken (token, padded, ordinal, callback) {\n        var func = callback;\n        if (typeof callback === 'string') {\n            func = function () {\n                return this[callback]();\n            };\n        }\n        if (token) {\n            formatTokenFunctions[token] = func;\n        }\n        if (padded) {\n            formatTokenFunctions[padded[0]] = function () {\n                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n            };\n        }\n        if (ordinal) {\n            formatTokenFunctions[ordinal] = function () {\n                return this.localeData().ordinal(func.apply(this, arguments), token);\n            };\n        }\n    }\n\n    function removeFormattingTokens(input) {\n        if (input.match(/\\[[\\s\\S]/)) {\n            return input.replace(/^\\[|\\]$/g, '');\n        }\n        return input.replace(/\\\\/g, '');\n    }\n\n    function makeFormatFunction(format) {\n        var array = format.match(formattingTokens), i, length;\n\n        for (i = 0, length = array.length; i < length; i++) {\n            if (formatTokenFunctions[array[i]]) {\n                array[i] = formatTokenFunctions[array[i]];\n            } else {\n                array[i] = removeFormattingTokens(array[i]);\n            }\n        }\n\n        return function (mom) {\n            var output = '';\n            for (i = 0; i < length; i++) {\n                output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n            }\n            return output;\n        };\n    }\n\n    // format date using native date object\n    function formatMoment(m, format) {\n        if (!m.isValid()) {\n            return m.localeData().invalidDate();\n        }\n\n        format = expandFormat(format, m.localeData());\n\n        if (!formatFunctions[format]) {\n            formatFunctions[format] = makeFormatFunction(format);\n        }\n\n        return formatFunctions[format](m);\n    }\n\n    function expandFormat(format, locale) {\n        var i = 5;\n\n        function replaceLongDateFormatTokens(input) {\n            return locale.longDateFormat(input) || input;\n        }\n\n        localFormattingTokens.lastIndex = 0;\n        while (i >= 0 && localFormattingTokens.test(format)) {\n            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n            localFormattingTokens.lastIndex = 0;\n            i -= 1;\n        }\n\n        return format;\n    }\n\n    var match1         = /\\d/;            //       0 - 9\n    var match2         = /\\d\\d/;          //      00 - 99\n    var match3         = /\\d{3}/;         //     000 - 999\n    var match4         = /\\d{4}/;         //    0000 - 9999\n    var match6         = /[+-]?\\d{6}/;    // -999999 - 999999\n    var match1to2      = /\\d\\d?/;         //       0 - 99\n    var match1to3      = /\\d{1,3}/;       //       0 - 999\n    var match1to4      = /\\d{1,4}/;       //       0 - 9999\n    var match1to6      = /[+-]?\\d{1,6}/;  // -999999 - 999999\n\n    var matchUnsigned  = /\\d+/;           //       0 - inf\n    var matchSigned    = /[+-]?\\d+/;      //    -inf - inf\n\n    var matchOffset    = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\n    var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n    // any word (or two) characters or numbers including two/three word month in arabic.\n    var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n    var regexes = {};\n\n    function addRegexToken (token, regex, strictRegex) {\n        regexes[token] = typeof regex === 'function' ? regex : function (isStrict) {\n            return (isStrict && strictRegex) ? strictRegex : regex;\n        };\n    }\n\n    function getParseRegexForToken (token, config) {\n        if (!hasOwnProp(regexes, token)) {\n            return new RegExp(unescapeFormat(token));\n        }\n\n        return regexes[token](config._strict, config._locale);\n    }\n\n    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n    function unescapeFormat(s) {\n        return s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n            return p1 || p2 || p3 || p4;\n        }).replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n    }\n\n    var tokens = {};\n\n    function addParseToken (token, callback) {\n        var i, func = callback;\n        if (typeof token === 'string') {\n            token = [token];\n        }\n        if (typeof callback === 'number') {\n            func = function (input, array) {\n                array[callback] = toInt(input);\n            };\n        }\n        for (i = 0; i < token.length; i++) {\n            tokens[token[i]] = func;\n        }\n    }\n\n    function addWeekParseToken (token, callback) {\n        addParseToken(token, function (input, array, config, token) {\n            config._w = config._w || {};\n            callback(input, config._w, config, token);\n        });\n    }\n\n    function addTimeToArrayFromToken(token, input, config) {\n        if (input != null && hasOwnProp(tokens, token)) {\n            tokens[token](input, config._a, config, token);\n        }\n    }\n\n    var YEAR = 0;\n    var MONTH = 1;\n    var DATE = 2;\n    var HOUR = 3;\n    var MINUTE = 4;\n    var SECOND = 5;\n    var MILLISECOND = 6;\n\n    function daysInMonth(year, month) {\n        return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n    }\n\n    // FORMATTING\n\n    addFormatToken('M', ['MM', 2], 'Mo', function () {\n        return this.month() + 1;\n    });\n\n    addFormatToken('MMM', 0, 0, function (format) {\n        return this.localeData().monthsShort(this, format);\n    });\n\n    addFormatToken('MMMM', 0, 0, function (format) {\n        return this.localeData().months(this, format);\n    });\n\n    // ALIASES\n\n    addUnitAlias('month', 'M');\n\n    // PARSING\n\n    addRegexToken('M',    match1to2);\n    addRegexToken('MM',   match1to2, match2);\n    addRegexToken('MMM',  matchWord);\n    addRegexToken('MMMM', matchWord);\n\n    addParseToken(['M', 'MM'], function (input, array) {\n        array[MONTH] = toInt(input) - 1;\n    });\n\n    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n        var month = config._locale.monthsParse(input, token, config._strict);\n        // if we didn't find a month name, mark the date as invalid.\n        if (month != null) {\n            array[MONTH] = month;\n        } else {\n            config._pf.invalidMonth = input;\n        }\n    });\n\n    // LOCALES\n\n    var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n    function localeMonths (m) {\n        return this._months[m.month()];\n    }\n\n    var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n    function localeMonthsShort (m) {\n        return this._monthsShort[m.month()];\n    }\n\n    function localeMonthsParse (monthName, format, strict) {\n        var i, mom, regex;\n\n        if (!this._monthsParse) {\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n        }\n\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = create_utc__createUTC([2000, i]);\n            if (strict && !this._longMonthsParse[i]) {\n                this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n                this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n            }\n            if (!strict && !this._monthsParse[i]) {\n                regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n                return i;\n            } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n                return i;\n            } else if (!strict && this._monthsParse[i].test(monthName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function setMonth (mom, value) {\n        var dayOfMonth;\n\n        // TODO: Move this out of here!\n        if (typeof value === 'string') {\n            value = mom.localeData().monthsParse(value);\n            // TODO: Another silent failure?\n            if (typeof value !== 'number') {\n                return mom;\n            }\n        }\n\n        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n        return mom;\n    }\n\n    function getSetMonth (value) {\n        if (value != null) {\n            setMonth(this, value);\n            utils_hooks__hooks.updateOffset(this, true);\n            return this;\n        } else {\n            return get_set__get(this, 'Month');\n        }\n    }\n\n    function getDaysInMonth () {\n        return daysInMonth(this.year(), this.month());\n    }\n\n    function checkOverflow (m) {\n        var overflow;\n        var a = m._a;\n\n        if (a && m._pf.overflow === -2) {\n            overflow =\n                a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :\n                a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n                a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n                a[MINUTE]      < 0 || a[MINUTE]      > 59  ? MINUTE :\n                a[SECOND]      < 0 || a[SECOND]      > 59  ? SECOND :\n                a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n                -1;\n\n            if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n                overflow = DATE;\n            }\n\n            m._pf.overflow = overflow;\n        }\n\n        return m;\n    }\n\n    function warn(msg) {\n        if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n            console.warn('Deprecation warning: ' + msg);\n        }\n    }\n\n    function deprecate(msg, fn) {\n        var firstTime = true;\n        return extend(function () {\n            if (firstTime) {\n                warn(msg);\n                firstTime = false;\n            }\n            return fn.apply(this, arguments);\n        }, fn);\n    }\n\n    var deprecations = {};\n\n    function deprecateSimple(name, msg) {\n        if (!deprecations[name]) {\n            warn(msg);\n            deprecations[name] = true;\n        }\n    }\n\n    utils_hooks__hooks.suppressDeprecationWarnings = false;\n\n    var from_string__isoRegex = /^\\s*(?:[+-]\\d{6}|\\d{4})-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\n    var isoDates = [\n        ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d{2}-\\d{2}/],\n        ['YYYY-MM-DD', /\\d{4}-\\d{2}-\\d{2}/],\n        ['GGGG-[W]WW-E', /\\d{4}-W\\d{2}-\\d/],\n        ['GGGG-[W]WW', /\\d{4}-W\\d{2}/],\n        ['YYYY-DDD', /\\d{4}-\\d{3}/]\n    ];\n\n    // iso time formats and regexes\n    var isoTimes = [\n        ['HH:mm:ss.SSSS', /(T| )\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n        ['HH:mm:ss', /(T| )\\d\\d:\\d\\d:\\d\\d/],\n        ['HH:mm', /(T| )\\d\\d:\\d\\d/],\n        ['HH', /(T| )\\d\\d/]\n    ];\n\n    var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n    // date from iso format\n    function configFromISO(config) {\n        var i, l,\n            string = config._i,\n            match = from_string__isoRegex.exec(string);\n\n        if (match) {\n            config._pf.iso = true;\n            for (i = 0, l = isoDates.length; i < l; i++) {\n                if (isoDates[i][1].exec(string)) {\n                    // match[5] should be 'T' or undefined\n                    config._f = isoDates[i][0] + (match[6] || ' ');\n                    break;\n                }\n            }\n            for (i = 0, l = isoTimes.length; i < l; i++) {\n                if (isoTimes[i][1].exec(string)) {\n                    config._f += isoTimes[i][0];\n                    break;\n                }\n            }\n            if (string.match(matchOffset)) {\n                config._f += 'Z';\n            }\n            configFromStringAndFormat(config);\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    // date from iso format or fallback\n    function configFromString(config) {\n        var matched = aspNetJsonRegex.exec(config._i);\n\n        if (matched !== null) {\n            config._d = new Date(+matched[1]);\n            return;\n        }\n\n        configFromISO(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n            utils_hooks__hooks.createFromInputFallback(config);\n        }\n    }\n\n    utils_hooks__hooks.createFromInputFallback = deprecate(\n        'moment construction falls back to js Date. This is ' +\n        'discouraged and will be removed in upcoming major ' +\n        'release. Please refer to ' +\n        'https://github.com/moment/moment/issues/1407 for more info.',\n        function (config) {\n            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n        }\n    );\n\n    function createDate (y, m, d, h, M, s, ms) {\n        //can't just apply() to create a date:\n        //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n        var date = new Date(y, m, d, h, M, s, ms);\n\n        //the date constructor doesn't accept years < 1970\n        if (y < 1970) {\n            date.setFullYear(y);\n        }\n        return date;\n    }\n\n    function createUTCDate (y) {\n        var date = new Date(Date.UTC.apply(null, arguments));\n        if (y < 1970) {\n            date.setUTCFullYear(y);\n        }\n        return date;\n    }\n\n    addFormatToken(0, ['YY', 2], 0, function () {\n        return this.year() % 100;\n    });\n\n    addFormatToken(0, ['YYYY',   4],       0, 'year');\n    addFormatToken(0, ['YYYYY',  5],       0, 'year');\n    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n    // ALIASES\n\n    addUnitAlias('year', 'y');\n\n    // PARSING\n\n    addRegexToken('Y',      matchSigned);\n    addRegexToken('YY',     match1to2, match2);\n    addRegexToken('YYYY',   match1to4, match4);\n    addRegexToken('YYYYY',  match1to6, match6);\n    addRegexToken('YYYYYY', match1to6, match6);\n\n    addParseToken(['YYYY', 'YYYYY', 'YYYYYY'], YEAR);\n    addParseToken('YY', function (input, array) {\n        array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);\n    });\n\n    // HELPERS\n\n    function daysInYear(year) {\n        return isLeapYear(year) ? 366 : 365;\n    }\n\n    function isLeapYear(year) {\n        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n    }\n\n    // HOOKS\n\n    utils_hooks__hooks.parseTwoDigitYear = function (input) {\n        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n    };\n\n    // MOMENTS\n\n    var getSetYear = makeGetSet('FullYear', false);\n\n    function getIsLeapYear () {\n        return isLeapYear(this.year());\n    }\n\n    addFormatToken('w', ['ww', 2], 'wo', 'week');\n    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n    // ALIASES\n\n    addUnitAlias('week', 'w');\n    addUnitAlias('isoWeek', 'W');\n\n    // PARSING\n\n    addRegexToken('w',  match1to2);\n    addRegexToken('ww', match1to2, match2);\n    addRegexToken('W',  match1to2);\n    addRegexToken('WW', match1to2, match2);\n\n    addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n        week[token.substr(0, 1)] = toInt(input);\n    });\n\n    // HELPERS\n\n    // firstDayOfWeek       0 = sun, 6 = sat\n    //                      the day of the week that starts the week\n    //                      (usually sunday or monday)\n    // firstDayOfWeekOfYear 0 = sun, 6 = sat\n    //                      the first week is the week that contains the first\n    //                      of this day of the week\n    //                      (eg. ISO weeks use thursday (4))\n    function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n        var end = firstDayOfWeekOfYear - firstDayOfWeek,\n            daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),\n            adjustedMoment;\n\n\n        if (daysToDayOfWeek > end) {\n            daysToDayOfWeek -= 7;\n        }\n\n        if (daysToDayOfWeek < end - 7) {\n            daysToDayOfWeek += 7;\n        }\n\n        adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');\n        return {\n            week: Math.ceil(adjustedMoment.dayOfYear() / 7),\n            year: adjustedMoment.year()\n        };\n    }\n\n    // LOCALES\n\n    function localeWeek (mom) {\n        return weekOfYear(mom, this._week.dow, this._week.doy).week;\n    }\n\n    var defaultLocaleWeek = {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    };\n\n    function localeFirstDayOfWeek () {\n        return this._week.dow;\n    }\n\n    function localeFirstDayOfYear () {\n        return this._week.doy;\n    }\n\n    // MOMENTS\n\n    function getSetWeek (input) {\n        var week = this.localeData().week(this);\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    function getSetISOWeek (input) {\n        var week = weekOfYear(this, 1, 4).week;\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n    // ALIASES\n\n    addUnitAlias('dayOfYear', 'DDD');\n\n    // PARSING\n\n    addRegexToken('DDD',  match1to3);\n    addRegexToken('DDDD', match3);\n    addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n        config._dayOfYear = toInt(input);\n    });\n\n    // HELPERS\n\n    //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n    function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {\n        var d = createUTCDate(year, 0, 1).getUTCDay();\n        var daysToAdd;\n        var dayOfYear;\n\n        d = d === 0 ? 7 : d;\n        weekday = weekday != null ? weekday : firstDayOfWeek;\n        daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);\n        dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;\n\n        return {\n            year      : dayOfYear > 0 ? year      : year - 1,\n            dayOfYear : dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear\n        };\n    }\n\n    // MOMENTS\n\n    function getSetDayOfYear (input) {\n        var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n        return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n    }\n\n    // Pick the first defined of two or three arguments.\n    function defaults(a, b, c) {\n        if (a != null) {\n            return a;\n        }\n        if (b != null) {\n            return b;\n        }\n        return c;\n    }\n\n    function currentDateArray(config) {\n        var now = new Date();\n        if (config._useUTC) {\n            return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];\n        }\n        return [now.getFullYear(), now.getMonth(), now.getDate()];\n    }\n\n    // convert an array to a date.\n    // the array should mirror the parameters below\n    // note: all values past the year are optional and will default to the lowest possible value.\n    // [year, month, day , hour, minute, second, millisecond]\n    function configFromArray (config) {\n        var i, date, input = [], currentDate, yearToUse;\n\n        if (config._d) {\n            return;\n        }\n\n        currentDate = currentDateArray(config);\n\n        //compute day of the year from weeks and weekdays\n        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n            dayOfYearFromWeekInfo(config);\n        }\n\n        //if the day of the year is set, figure out what it is\n        if (config._dayOfYear) {\n            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n            if (config._dayOfYear > daysInYear(yearToUse)) {\n                config._pf._overflowDayOfYear = true;\n            }\n\n            date = createUTCDate(yearToUse, 0, config._dayOfYear);\n            config._a[MONTH] = date.getUTCMonth();\n            config._a[DATE] = date.getUTCDate();\n        }\n\n        // Default to current date.\n        // * if no year, month, day of month are given, default to today\n        // * if day of month is given, default month and year\n        // * if month is given, default only year\n        // * if year is given, don't default anything\n        for (i = 0; i < 3 && config._a[i] == null; ++i) {\n            config._a[i] = input[i] = currentDate[i];\n        }\n\n        // Zero out whatever was not defaulted, including time\n        for (; i < 7; i++) {\n            config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n        }\n\n        // Check for 24:00:00.000\n        if (config._a[HOUR] === 24 &&\n                config._a[MINUTE] === 0 &&\n                config._a[SECOND] === 0 &&\n                config._a[MILLISECOND] === 0) {\n            config._nextDay = true;\n            config._a[HOUR] = 0;\n        }\n\n        config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n        // Apply timezone offset from input. The actual utcOffset can be changed\n        // with parseZone.\n        if (config._tzm != null) {\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n        }\n\n        if (config._nextDay) {\n            config._a[HOUR] = 24;\n        }\n    }\n\n    function dayOfYearFromWeekInfo(config) {\n        var w, weekYear, week, weekday, dow, doy, temp;\n\n        w = config._w;\n        if (w.GG != null || w.W != null || w.E != null) {\n            dow = 1;\n            doy = 4;\n\n            // TODO: We need to take the current isoWeekYear, but that depends on\n            // how we interpret now (local, utc, fixed offset). So create\n            // a now version of current config (take local/utc/offset flags, and\n            // create now).\n            weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);\n            week = defaults(w.W, 1);\n            weekday = defaults(w.E, 1);\n        } else {\n            dow = config._locale._week.dow;\n            doy = config._locale._week.doy;\n\n            weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);\n            week = defaults(w.w, 1);\n\n            if (w.d != null) {\n                // weekday -- low day numbers are considered next week\n                weekday = w.d;\n                if (weekday < dow) {\n                    ++week;\n                }\n            } else if (w.e != null) {\n                // local weekday -- counting starts from begining of week\n                weekday = w.e + dow;\n            } else {\n                // default to begining of week\n                weekday = dow;\n            }\n        }\n        temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);\n\n        config._a[YEAR] = temp.year;\n        config._dayOfYear = temp.dayOfYear;\n    }\n\n    utils_hooks__hooks.ISO_8601 = function () {};\n\n    // date from string and format string\n    function configFromStringAndFormat(config) {\n        // TODO: Move this to another part of the creation flow to prevent circular deps\n        if (config._f === utils_hooks__hooks.ISO_8601) {\n            configFromISO(config);\n            return;\n        }\n\n        config._a = [];\n        config._pf.empty = true;\n\n        // This array is used to make a Date, either with `new Date` or `Date.UTC`\n        var string = '' + config._i,\n            i, parsedInput, tokens, token, skipped,\n            stringLength = string.length,\n            totalParsedInputLength = 0;\n\n        tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n        for (i = 0; i < tokens.length; i++) {\n            token = tokens[i];\n            parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n            if (parsedInput) {\n                skipped = string.substr(0, string.indexOf(parsedInput));\n                if (skipped.length > 0) {\n                    config._pf.unusedInput.push(skipped);\n                }\n                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n                totalParsedInputLength += parsedInput.length;\n            }\n            // don't parse if it's not a known token\n            if (formatTokenFunctions[token]) {\n                if (parsedInput) {\n                    config._pf.empty = false;\n                }\n                else {\n                    config._pf.unusedTokens.push(token);\n                }\n                addTimeToArrayFromToken(token, parsedInput, config);\n            }\n            else if (config._strict && !parsedInput) {\n                config._pf.unusedTokens.push(token);\n            }\n        }\n\n        // add remaining unparsed input length to the string\n        config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n        if (string.length > 0) {\n            config._pf.unusedInput.push(string);\n        }\n\n        // clear _12h flag if hour is <= 12\n        if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n            config._pf.bigHour = undefined;\n        }\n        // handle meridiem\n        config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n        configFromArray(config);\n        checkOverflow(config);\n    }\n\n\n    function meridiemFixWrap (locale, hour, meridiem) {\n        var isPm;\n\n        if (meridiem == null) {\n            // nothing to do\n            return hour;\n        }\n        if (locale.meridiemHour != null) {\n            return locale.meridiemHour(hour, meridiem);\n        } else if (locale.isPM != null) {\n            // Fallback\n            isPm = locale.isPM(meridiem);\n            if (isPm && hour < 12) {\n                hour += 12;\n            }\n            if (!isPm && hour === 12) {\n                hour = 0;\n            }\n            return hour;\n        } else {\n            // this is not supposed to happen\n            return hour;\n        }\n    }\n\n    function configFromStringAndArray(config) {\n        var tempConfig,\n            bestMoment,\n\n            scoreToBeat,\n            i,\n            currentScore;\n\n        if (config._f.length === 0) {\n            config._pf.invalidFormat = true;\n            config._d = new Date(NaN);\n            return;\n        }\n\n        for (i = 0; i < config._f.length; i++) {\n            currentScore = 0;\n            tempConfig = copyConfig({}, config);\n            if (config._useUTC != null) {\n                tempConfig._useUTC = config._useUTC;\n            }\n            tempConfig._pf = defaultParsingFlags();\n            tempConfig._f = config._f[i];\n            configFromStringAndFormat(tempConfig);\n\n            if (!valid__isValid(tempConfig)) {\n                continue;\n            }\n\n            // if there is any input that was not parsed add a penalty for that format\n            currentScore += tempConfig._pf.charsLeftOver;\n\n            //or tokens\n            currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n            tempConfig._pf.score = currentScore;\n\n            if (scoreToBeat == null || currentScore < scoreToBeat) {\n                scoreToBeat = currentScore;\n                bestMoment = tempConfig;\n            }\n        }\n\n        extend(config, bestMoment || tempConfig);\n    }\n\n    function configFromObject(config) {\n        if (config._d) {\n            return;\n        }\n\n        var i = normalizeObjectUnits(config._i);\n        config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];\n\n        configFromArray(config);\n    }\n\n    function createFromConfig (config) {\n        var input = config._i,\n            format = config._f,\n            res;\n\n        config._locale = config._locale || locale_locales__getLocale(config._l);\n\n        if (input === null || (format === undefined && input === '')) {\n            return valid__createInvalid({nullInput: true});\n        }\n\n        if (typeof input === 'string') {\n            config._i = input = config._locale.preparse(input);\n        }\n\n        if (isMoment(input)) {\n            return new Moment(checkOverflow(input));\n        } else if (isArray(format)) {\n            configFromStringAndArray(config);\n        } else if (format) {\n            configFromStringAndFormat(config);\n        } else {\n            configFromInput(config);\n        }\n\n        res = new Moment(checkOverflow(config));\n        if (res._nextDay) {\n            // Adding is smart enough around DST\n            res.add(1, 'd');\n            res._nextDay = undefined;\n        }\n\n        return res;\n    }\n\n    function configFromInput(config) {\n        var input = config._i;\n        if (input === undefined) {\n            config._d = new Date();\n        } else if (isDate(input)) {\n            config._d = new Date(+input);\n        } else if (typeof input === 'string') {\n            configFromString(config);\n        } else if (isArray(input)) {\n            config._a = map(input.slice(0), function (obj) {\n                return parseInt(obj, 10);\n            });\n            configFromArray(config);\n        } else if (typeof(input) === 'object') {\n            configFromObject(config);\n        } else if (typeof(input) === 'number') {\n            // from milliseconds\n            config._d = new Date(input);\n        } else {\n            utils_hooks__hooks.createFromInputFallback(config);\n        }\n    }\n\n    function createLocalOrUTC (input, format, locale, strict, isUTC) {\n        var c = {};\n\n        if (typeof(locale) === 'boolean') {\n            strict = locale;\n            locale = undefined;\n        }\n        // object construction must be done this way.\n        // https://github.com/moment/moment/issues/1423\n        c._isAMomentObject = true;\n        c._useUTC = c._isUTC = isUTC;\n        c._l = locale;\n        c._i = input;\n        c._f = format;\n        c._strict = strict;\n        c._pf = defaultParsingFlags();\n\n        return createFromConfig(c);\n    }\n\n    function local__createLocal (input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, false);\n    }\n\n    var prototypeMin = deprecate(\n         'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',\n         function () {\n             var other = local__createLocal.apply(null, arguments);\n             return other < this ? this : other;\n         }\n     );\n\n    var prototypeMax = deprecate(\n        'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',\n        function () {\n            var other = local__createLocal.apply(null, arguments);\n            return other > this ? this : other;\n        }\n    );\n\n    // Pick a moment m from moments so that m[fn](other) is true for all\n    // other. This relies on the function fn to be transitive.\n    //\n    // moments should either be an array of moment objects or an array, whose\n    // first element is an array of moment objects.\n    function pickBy(fn, moments) {\n        var res, i;\n        if (moments.length === 1 && isArray(moments[0])) {\n            moments = moments[0];\n        }\n        if (!moments.length) {\n            return local__createLocal();\n        }\n        res = moments[0];\n        for (i = 1; i < moments.length; ++i) {\n            if (moments[i][fn](res)) {\n                res = moments[i];\n            }\n        }\n        return res;\n    }\n\n    // TODO: Use [].sort instead?\n    function min () {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isBefore', args);\n    }\n\n    function max () {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isAfter', args);\n    }\n\n    function Duration (duration) {\n        var normalizedInput = normalizeObjectUnits(duration),\n            years = normalizedInput.year || 0,\n            quarters = normalizedInput.quarter || 0,\n            months = normalizedInput.month || 0,\n            weeks = normalizedInput.week || 0,\n            days = normalizedInput.day || 0,\n            hours = normalizedInput.hour || 0,\n            minutes = normalizedInput.minute || 0,\n            seconds = normalizedInput.second || 0,\n            milliseconds = normalizedInput.millisecond || 0;\n\n        // representation for dateAddRemove\n        this._milliseconds = +milliseconds +\n            seconds * 1e3 + // 1000\n            minutes * 6e4 + // 1000 * 60\n            hours * 36e5; // 1000 * 60 * 60\n        // Because of dateAddRemove treats 24 hours as different from a\n        // day when working around DST, we need to store them separately\n        this._days = +days +\n            weeks * 7;\n        // It is impossible translate months into days without knowing\n        // which months you are are talking about, so we have to store\n        // it separately.\n        this._months = +months +\n            quarters * 3 +\n            years * 12;\n\n        this._data = {};\n\n        this._locale = locale_locales__getLocale();\n\n        this._bubble();\n    }\n\n    function isDuration (obj) {\n        return obj instanceof Duration;\n    }\n\n    function offset (token, separator) {\n        addFormatToken(token, 0, 0, function () {\n            var offset = this.utcOffset();\n            var sign = '+';\n            if (offset < 0) {\n                offset = -offset;\n                sign = '-';\n            }\n            return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n        });\n    }\n\n    offset('Z', ':');\n    offset('ZZ', '');\n\n    // PARSING\n\n    addRegexToken('Z',  matchOffset);\n    addRegexToken('ZZ', matchOffset);\n    addParseToken(['Z', 'ZZ'], function (input, array, config) {\n        config._useUTC = true;\n        config._tzm = offsetFromString(input);\n    });\n\n    // HELPERS\n\n    // timezone chunker\n    // '+10:00' > ['10',  '00']\n    // '-1530'  > ['-15', '30']\n    var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n    function offsetFromString(string) {\n        var matches = ((string || '').match(matchOffset) || []);\n        var chunk   = matches[matches.length - 1] || [];\n        var parts   = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n        var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n        return parts[0] === '+' ? minutes : -minutes;\n    }\n\n    // Return a moment from input, that is local/utc/zone equivalent to model.\n    function cloneWithOffset(input, model) {\n        var res, diff;\n        if (model._isUTC) {\n            res = model.clone();\n            diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n            // Use low-level api, because this fn is low-level api.\n            res._d.setTime(+res._d + diff);\n            utils_hooks__hooks.updateOffset(res, false);\n            return res;\n        } else {\n            return local__createLocal(input).local();\n        }\n        return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n    }\n\n    function getDateOffset (m) {\n        // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n        // https://github.com/moment/moment/pull/1871\n        return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n    }\n\n    // HOOKS\n\n    // This function will be called whenever a moment is mutated.\n    // It is intended to keep the offset in sync with the timezone.\n    utils_hooks__hooks.updateOffset = function () {};\n\n    // MOMENTS\n\n    // keepLocalTime = true means only change the timezone, without\n    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n    // +0200, so we adjust the time as needed, to be valid.\n    //\n    // Keeping the time actually adds/subtracts (one hour)\n    // from the actual represented time. That is why we call updateOffset\n    // a second time. In case it wants us to change the offset again\n    // _changeInProgress == true case, then we have to adjust, because\n    // there is no such time in the given timezone.\n    function getSetOffset (input, keepLocalTime) {\n        var offset = this._offset || 0,\n            localAdjust;\n        if (input != null) {\n            if (typeof input === 'string') {\n                input = offsetFromString(input);\n            }\n            if (Math.abs(input) < 16) {\n                input = input * 60;\n            }\n            if (!this._isUTC && keepLocalTime) {\n                localAdjust = getDateOffset(this);\n            }\n            this._offset = input;\n            this._isUTC = true;\n            if (localAdjust != null) {\n                this.add(localAdjust, 'm');\n            }\n            if (offset !== input) {\n                if (!keepLocalTime || this._changeInProgress) {\n                    add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n                } else if (!this._changeInProgress) {\n                    this._changeInProgress = true;\n                    utils_hooks__hooks.updateOffset(this, true);\n                    this._changeInProgress = null;\n                }\n            }\n            return this;\n        } else {\n            return this._isUTC ? offset : getDateOffset(this);\n        }\n    }\n\n    function getSetZone (input, keepLocalTime) {\n        if (input != null) {\n            if (typeof input !== 'string') {\n                input = -input;\n            }\n\n            this.utcOffset(input, keepLocalTime);\n\n            return this;\n        } else {\n            return -this.utcOffset();\n        }\n    }\n\n    function setOffsetToUTC (keepLocalTime) {\n        return this.utcOffset(0, keepLocalTime);\n    }\n\n    function setOffsetToLocal (keepLocalTime) {\n        if (this._isUTC) {\n            this.utcOffset(0, keepLocalTime);\n            this._isUTC = false;\n\n            if (keepLocalTime) {\n                this.subtract(getDateOffset(this), 'm');\n            }\n        }\n        return this;\n    }\n\n    function setOffsetToParsedOffset () {\n        if (this._tzm) {\n            this.utcOffset(this._tzm);\n        } else if (typeof this._i === 'string') {\n            this.utcOffset(offsetFromString(this._i));\n        }\n        return this;\n    }\n\n    function hasAlignedHourOffset (input) {\n        if (!input) {\n            input = 0;\n        }\n        else {\n            input = local__createLocal(input).utcOffset();\n        }\n\n        return (this.utcOffset() - input) % 60 === 0;\n    }\n\n    function isDaylightSavingTime () {\n        return (\n            this.utcOffset() > this.clone().month(0).utcOffset() ||\n            this.utcOffset() > this.clone().month(5).utcOffset()\n        );\n    }\n\n    function isDaylightSavingTimeShifted () {\n        if (this._a) {\n            var other = this._isUTC ? create_utc__createUTC(this._a) : local__createLocal(this._a);\n            return this.isValid() && compareArrays(this._a, other.toArray()) > 0;\n        }\n\n        return false;\n    }\n\n    function isLocal () {\n        return !this._isUTC;\n    }\n\n    function isUtcOffset () {\n        return this._isUTC;\n    }\n\n    function isUtc () {\n        return this._isUTC && this._offset === 0;\n    }\n\n    var aspNetRegex = /(\\-)?(?:(\\d*)\\.)?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?)?/;\n\n    // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n    // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n    var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;\n\n    function create__createDuration (input, key) {\n        var duration = input,\n            // matching against regexp is expensive, do it on demand\n            match = null,\n            sign,\n            ret,\n            diffRes;\n\n        if (isDuration(input)) {\n            duration = {\n                ms : input._milliseconds,\n                d  : input._days,\n                M  : input._months\n            };\n        } else if (typeof input === 'number') {\n            duration = {};\n            if (key) {\n                duration[key] = input;\n            } else {\n                duration.milliseconds = input;\n            }\n        } else if (!!(match = aspNetRegex.exec(input))) {\n            sign = (match[1] === '-') ? -1 : 1;\n            duration = {\n                y  : 0,\n                d  : toInt(match[DATE])        * sign,\n                h  : toInt(match[HOUR])        * sign,\n                m  : toInt(match[MINUTE])      * sign,\n                s  : toInt(match[SECOND])      * sign,\n                ms : toInt(match[MILLISECOND]) * sign\n            };\n        } else if (!!(match = create__isoRegex.exec(input))) {\n            sign = (match[1] === '-') ? -1 : 1;\n            duration = {\n                y : parseIso(match[2], sign),\n                M : parseIso(match[3], sign),\n                d : parseIso(match[4], sign),\n                h : parseIso(match[5], sign),\n                m : parseIso(match[6], sign),\n                s : parseIso(match[7], sign),\n                w : parseIso(match[8], sign)\n            };\n        } else if (duration == null) {// checks for null or undefined\n            duration = {};\n        } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n            diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));\n\n            duration = {};\n            duration.ms = diffRes.milliseconds;\n            duration.M = diffRes.months;\n        }\n\n        ret = new Duration(duration);\n\n        if (isDuration(input) && hasOwnProp(input, '_locale')) {\n            ret._locale = input._locale;\n        }\n\n        return ret;\n    }\n\n    create__createDuration.fn = Duration.prototype;\n\n    function parseIso (inp, sign) {\n        // We'd normally use ~~inp for this, but unfortunately it also\n        // converts floats to ints.\n        // inp may be undefined, so careful calling replace on it.\n        var res = inp && parseFloat(inp.replace(',', '.'));\n        // apply sign while we're at it\n        return (isNaN(res) ? 0 : res) * sign;\n    }\n\n    function positiveMomentsDifference(base, other) {\n        var res = {milliseconds: 0, months: 0};\n\n        res.months = other.month() - base.month() +\n            (other.year() - base.year()) * 12;\n        if (base.clone().add(res.months, 'M').isAfter(other)) {\n            --res.months;\n        }\n\n        res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n        return res;\n    }\n\n    function momentsDifference(base, other) {\n        var res;\n        other = cloneWithOffset(other, base);\n        if (base.isBefore(other)) {\n            res = positiveMomentsDifference(base, other);\n        } else {\n            res = positiveMomentsDifference(other, base);\n            res.milliseconds = -res.milliseconds;\n            res.months = -res.months;\n        }\n\n        return res;\n    }\n\n    function createAdder(direction, name) {\n        return function (val, period) {\n            var dur, tmp;\n            //invert the arguments, but complain about it\n            if (period !== null && !isNaN(+period)) {\n                deprecateSimple(name, 'moment().' + name  + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n                tmp = val; val = period; period = tmp;\n            }\n\n            val = typeof val === 'string' ? +val : val;\n            dur = create__createDuration(val, period);\n            add_subtract__addSubtract(this, dur, direction);\n            return this;\n        };\n    }\n\n    function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {\n        var milliseconds = duration._milliseconds,\n            days = duration._days,\n            months = duration._months;\n        updateOffset = updateOffset == null ? true : updateOffset;\n\n        if (milliseconds) {\n            mom._d.setTime(+mom._d + milliseconds * isAdding);\n        }\n        if (days) {\n            get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);\n        }\n        if (months) {\n            setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);\n        }\n        if (updateOffset) {\n            utils_hooks__hooks.updateOffset(mom, days || months);\n        }\n    }\n\n    var add_subtract__add      = createAdder(1, 'add');\n    var add_subtract__subtract = createAdder(-1, 'subtract');\n\n    function moment_calendar__calendar (time) {\n        // We want to compare the start of today, vs this.\n        // Getting start-of-today depends on whether we're local/utc/offset or not.\n        var now = time || local__createLocal(),\n            sod = cloneWithOffset(now, this).startOf('day'),\n            diff = this.diff(sod, 'days', true),\n            format = diff < -6 ? 'sameElse' :\n                diff < -1 ? 'lastWeek' :\n                diff < 0 ? 'lastDay' :\n                diff < 1 ? 'sameDay' :\n                diff < 2 ? 'nextDay' :\n                diff < 7 ? 'nextWeek' : 'sameElse';\n        return this.format(this.localeData().calendar(format, this, local__createLocal(now)));\n    }\n\n    function clone () {\n        return new Moment(this);\n    }\n\n    function isAfter (input, units) {\n        var inputMs;\n        units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this > +input;\n        } else {\n            inputMs = isMoment(input) ? +input : +local__createLocal(input);\n            return inputMs < +this.clone().startOf(units);\n        }\n    }\n\n    function isBefore (input, units) {\n        var inputMs;\n        units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this < +input;\n        } else {\n            inputMs = isMoment(input) ? +input : +local__createLocal(input);\n            return +this.clone().endOf(units) < inputMs;\n        }\n    }\n\n    function isBetween (from, to, units) {\n        return this.isAfter(from, units) && this.isBefore(to, units);\n    }\n\n    function isSame (input, units) {\n        var inputMs;\n        units = normalizeUnits(units || 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this === +input;\n        } else {\n            inputMs = +local__createLocal(input);\n            return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));\n        }\n    }\n\n    function absFloor (number) {\n        if (number < 0) {\n            return Math.ceil(number);\n        } else {\n            return Math.floor(number);\n        }\n    }\n\n    function diff (input, units, asFloat) {\n        var that = cloneWithOffset(input, this),\n            zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,\n            delta, output;\n\n        units = normalizeUnits(units);\n\n        if (units === 'year' || units === 'month' || units === 'quarter') {\n            output = monthDiff(this, that);\n            if (units === 'quarter') {\n                output = output / 3;\n            } else if (units === 'year') {\n                output = output / 12;\n            }\n        } else {\n            delta = this - that;\n            output = units === 'second' ? delta / 1e3 : // 1000\n                units === 'minute' ? delta / 6e4 : // 1000 * 60\n                units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n                units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n                units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n                delta;\n        }\n        return asFloat ? output : absFloor(output);\n    }\n\n    function monthDiff (a, b) {\n        // difference in months\n        var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n            // b is in (anchor - 1 month, anchor + 1 month)\n            anchor = a.clone().add(wholeMonthDiff, 'months'),\n            anchor2, adjust;\n\n        if (b - anchor < 0) {\n            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor - anchor2);\n        } else {\n            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor2 - anchor);\n        }\n\n        return -(wholeMonthDiff + adjust);\n    }\n\n    utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n\n    function toString () {\n        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n    }\n\n    function moment_format__toISOString () {\n        var m = this.clone().utc();\n        if (0 < m.year() && m.year() <= 9999) {\n            if ('function' === typeof Date.prototype.toISOString) {\n                // native implementation is ~50x faster, use it when we can\n                return this.toDate().toISOString();\n            } else {\n                return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n            }\n        } else {\n            return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n        }\n    }\n\n    function moment_format__format (inputString) {\n        var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);\n        return this.localeData().postformat(output);\n    }\n\n    function from (time, withoutSuffix) {\n        return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n    }\n\n    function fromNow (withoutSuffix) {\n        return this.from(local__createLocal(), withoutSuffix);\n    }\n\n    function locale (key) {\n        var newLocaleData;\n\n        if (key === undefined) {\n            return this._locale._abbr;\n        } else {\n            newLocaleData = locale_locales__getLocale(key);\n            if (newLocaleData != null) {\n                this._locale = newLocaleData;\n            }\n            return this;\n        }\n    }\n\n    var lang = deprecate(\n        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n        function (key) {\n            if (key === undefined) {\n                return this.localeData();\n            } else {\n                return this.locale(key);\n            }\n        }\n    );\n\n    function localeData () {\n        return this._locale;\n    }\n\n    function startOf (units) {\n        units = normalizeUnits(units);\n        // the following switch intentionally omits break keywords\n        // to utilize falling through the cases.\n        switch (units) {\n        case 'year':\n            this.month(0);\n            /* falls through */\n        case 'quarter':\n        case 'month':\n            this.date(1);\n            /* falls through */\n        case 'week':\n        case 'isoWeek':\n        case 'day':\n            this.hours(0);\n            /* falls through */\n        case 'hour':\n            this.minutes(0);\n            /* falls through */\n        case 'minute':\n            this.seconds(0);\n            /* falls through */\n        case 'second':\n            this.milliseconds(0);\n        }\n\n        // weeks are a special case\n        if (units === 'week') {\n            this.weekday(0);\n        }\n        if (units === 'isoWeek') {\n            this.isoWeekday(1);\n        }\n\n        // quarters are also special\n        if (units === 'quarter') {\n            this.month(Math.floor(this.month() / 3) * 3);\n        }\n\n        return this;\n    }\n\n    function endOf (units) {\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond') {\n            return this;\n        }\n        return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n    }\n\n    function to_type__valueOf () {\n        return +this._d - ((this._offset || 0) * 60000);\n    }\n\n    function unix () {\n        return Math.floor(+this / 1000);\n    }\n\n    function toDate () {\n        return this._offset ? new Date(+this) : this._d;\n    }\n\n    function toArray () {\n        var m = this;\n        return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n    }\n\n    function moment_valid__isValid () {\n        return valid__isValid(this);\n    }\n\n    function parsingFlags () {\n        return extend({}, this._pf);\n    }\n\n    function invalidAt () {\n        return this._pf.overflow;\n    }\n\n    addFormatToken(0, ['gg', 2], 0, function () {\n        return this.weekYear() % 100;\n    });\n\n    addFormatToken(0, ['GG', 2], 0, function () {\n        return this.isoWeekYear() % 100;\n    });\n\n    function addWeekYearFormatToken (token, getter) {\n        addFormatToken(0, [token, token.length], 0, getter);\n    }\n\n    addWeekYearFormatToken('gggg',     'weekYear');\n    addWeekYearFormatToken('ggggg',    'weekYear');\n    addWeekYearFormatToken('GGGG',  'isoWeekYear');\n    addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n    // ALIASES\n\n    addUnitAlias('weekYear', 'gg');\n    addUnitAlias('isoWeekYear', 'GG');\n\n    // PARSING\n\n    addRegexToken('G',      matchSigned);\n    addRegexToken('g',      matchSigned);\n    addRegexToken('GG',     match1to2, match2);\n    addRegexToken('gg',     match1to2, match2);\n    addRegexToken('GGGG',   match1to4, match4);\n    addRegexToken('gggg',   match1to4, match4);\n    addRegexToken('GGGGG',  match1to6, match6);\n    addRegexToken('ggggg',  match1to6, match6);\n\n    addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n        week[token.substr(0, 2)] = toInt(input);\n    });\n\n    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n        week[token] = utils_hooks__hooks.parseTwoDigitYear(input);\n    });\n\n    // HELPERS\n\n    function weeksInYear(year, dow, doy) {\n        return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;\n    }\n\n    // MOMENTS\n\n    function getSetWeekYear (input) {\n        var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;\n        return input == null ? year : this.add((input - year), 'y');\n    }\n\n    function getSetISOWeekYear (input) {\n        var year = weekOfYear(this, 1, 4).year;\n        return input == null ? year : this.add((input - year), 'y');\n    }\n\n    function getISOWeeksInYear () {\n        return weeksInYear(this.year(), 1, 4);\n    }\n\n    function getWeeksInYear () {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n    }\n\n    addFormatToken('Q', 0, 0, 'quarter');\n\n    // ALIASES\n\n    addUnitAlias('quarter', 'Q');\n\n    // PARSING\n\n    addRegexToken('Q', match1);\n    addParseToken('Q', function (input, array) {\n        array[MONTH] = (toInt(input) - 1) * 3;\n    });\n\n    // MOMENTS\n\n    function getSetQuarter (input) {\n        return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n    }\n\n    addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n    // ALIASES\n\n    addUnitAlias('date', 'D');\n\n    // PARSING\n\n    addRegexToken('D',  match1to2);\n    addRegexToken('DD', match1to2, match2);\n    addRegexToken('Do', function (isStrict, locale) {\n        return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n    });\n\n    addParseToken(['D', 'DD'], DATE);\n    addParseToken('Do', function (input, array) {\n        array[DATE] = toInt(input.match(match1to2)[0], 10);\n    });\n\n    // MOMENTS\n\n    var getSetDayOfMonth = makeGetSet('Date', true);\n\n    addFormatToken('d', 0, 'do', 'day');\n\n    addFormatToken('dd', 0, 0, function (format) {\n        return this.localeData().weekdaysMin(this, format);\n    });\n\n    addFormatToken('ddd', 0, 0, function (format) {\n        return this.localeData().weekdaysShort(this, format);\n    });\n\n    addFormatToken('dddd', 0, 0, function (format) {\n        return this.localeData().weekdays(this, format);\n    });\n\n    addFormatToken('e', 0, 0, 'weekday');\n    addFormatToken('E', 0, 0, 'isoWeekday');\n\n    // ALIASES\n\n    addUnitAlias('day', 'd');\n    addUnitAlias('weekday', 'e');\n    addUnitAlias('isoWeekday', 'E');\n\n    // PARSING\n\n    addRegexToken('d',    match1to2);\n    addRegexToken('e',    match1to2);\n    addRegexToken('E',    match1to2);\n    addRegexToken('dd',   matchWord);\n    addRegexToken('ddd',  matchWord);\n    addRegexToken('dddd', matchWord);\n\n    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {\n        var weekday = config._locale.weekdaysParse(input);\n        // if we didn't get a weekday name, mark the date as invalid\n        if (weekday != null) {\n            week.d = weekday;\n        } else {\n            config._pf.invalidWeekday = input;\n        }\n    });\n\n    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n        week[token] = toInt(input);\n    });\n\n    // HELPERS\n\n    function parseWeekday(input, locale) {\n        if (typeof input === 'string') {\n            if (!isNaN(input)) {\n                input = parseInt(input, 10);\n            }\n            else {\n                input = locale.weekdaysParse(input);\n                if (typeof input !== 'number') {\n                    return null;\n                }\n            }\n        }\n        return input;\n    }\n\n    // LOCALES\n\n    var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n    function localeWeekdays (m) {\n        return this._weekdays[m.day()];\n    }\n\n    var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n    function localeWeekdaysShort (m) {\n        return this._weekdaysShort[m.day()];\n    }\n\n    var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n    function localeWeekdaysMin (m) {\n        return this._weekdaysMin[m.day()];\n    }\n\n    function localeWeekdaysParse (weekdayName) {\n        var i, mom, regex;\n\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n        }\n\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n            if (!this._weekdaysParse[i]) {\n                mom = local__createLocal([2000, 1]).day(i);\n                regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (this._weekdaysParse[i].test(weekdayName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function getSetDayOfWeek (input) {\n        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n        if (input != null) {\n            input = parseWeekday(input, this.localeData());\n            return this.add(input - day, 'd');\n        } else {\n            return day;\n        }\n    }\n\n    function getSetLocaleDayOfWeek (input) {\n        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n        return input == null ? weekday : this.add(input - weekday, 'd');\n    }\n\n    function getSetISODayOfWeek (input) {\n        // behaves the same as moment#day except\n        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n        // as a setter, sunday should belong to the previous week.\n        return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);\n    }\n\n    addFormatToken('H', ['HH', 2], 0, 'hour');\n    addFormatToken('h', ['hh', 2], 0, function () {\n        return this.hours() % 12 || 12;\n    });\n\n    function meridiem (token, lowercase) {\n        addFormatToken(token, 0, 0, function () {\n            return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n        });\n    }\n\n    meridiem('a', true);\n    meridiem('A', false);\n\n    // ALIASES\n\n    addUnitAlias('hour', 'h');\n\n    // PARSING\n\n    function matchMeridiem (isStrict, locale) {\n        return locale._meridiemParse;\n    }\n\n    addRegexToken('a',  matchMeridiem);\n    addRegexToken('A',  matchMeridiem);\n    addRegexToken('H',  match1to2);\n    addRegexToken('h',  match1to2);\n    addRegexToken('HH', match1to2, match2);\n    addRegexToken('hh', match1to2, match2);\n\n    addParseToken(['H', 'HH'], HOUR);\n    addParseToken(['a', 'A'], function (input, array, config) {\n        config._isPm = config._locale.isPM(input);\n        config._meridiem = input;\n    });\n    addParseToken(['h', 'hh'], function (input, array, config) {\n        array[HOUR] = toInt(input);\n        config._pf.bigHour = true;\n    });\n\n    // LOCALES\n\n    function localeIsPM (input) {\n        // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n        // Using charAt should be more compatible.\n        return ((input + '').toLowerCase().charAt(0) === 'p');\n    }\n\n    var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n    function localeMeridiem (hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'pm' : 'PM';\n        } else {\n            return isLower ? 'am' : 'AM';\n        }\n    }\n\n\n    // MOMENTS\n\n    // Setting the hour should keep the time, because the user explicitly\n    // specified which hour he wants. So trying to maintain the same hour (in\n    // a new timezone) makes sense. Adding/subtracting hours does not follow\n    // this rule.\n    var getSetHour = makeGetSet('Hours', true);\n\n    addFormatToken('m', ['mm', 2], 0, 'minute');\n\n    // ALIASES\n\n    addUnitAlias('minute', 'm');\n\n    // PARSING\n\n    addRegexToken('m',  match1to2);\n    addRegexToken('mm', match1to2, match2);\n    addParseToken(['m', 'mm'], MINUTE);\n\n    // MOMENTS\n\n    var getSetMinute = makeGetSet('Minutes', false);\n\n    addFormatToken('s', ['ss', 2], 0, 'second');\n\n    // ALIASES\n\n    addUnitAlias('second', 's');\n\n    // PARSING\n\n    addRegexToken('s',  match1to2);\n    addRegexToken('ss', match1to2, match2);\n    addParseToken(['s', 'ss'], SECOND);\n\n    // MOMENTS\n\n    var getSetSecond = makeGetSet('Seconds', false);\n\n    addFormatToken('S', 0, 0, function () {\n        return ~~(this.millisecond() / 100);\n    });\n\n    addFormatToken(0, ['SS', 2], 0, function () {\n        return ~~(this.millisecond() / 10);\n    });\n\n    function millisecond__milliseconds (token) {\n        addFormatToken(0, [token, 3], 0, 'millisecond');\n    }\n\n    millisecond__milliseconds('SSS');\n    millisecond__milliseconds('SSSS');\n\n    // ALIASES\n\n    addUnitAlias('millisecond', 'ms');\n\n    // PARSING\n\n    addRegexToken('S',    match1to3, match1);\n    addRegexToken('SS',   match1to3, match2);\n    addRegexToken('SSS',  match1to3, match3);\n    addRegexToken('SSSS', matchUnsigned);\n    addParseToken(['S', 'SS', 'SSS', 'SSSS'], function (input, array) {\n        array[MILLISECOND] = toInt(('0.' + input) * 1000);\n    });\n\n    // MOMENTS\n\n    var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n    addFormatToken('z',  0, 0, 'zoneAbbr');\n    addFormatToken('zz', 0, 0, 'zoneName');\n\n    // MOMENTS\n\n    function getZoneAbbr () {\n        return this._isUTC ? 'UTC' : '';\n    }\n\n    function getZoneName () {\n        return this._isUTC ? 'Coordinated Universal Time' : '';\n    }\n\n    var momentPrototype__proto = Moment.prototype;\n\n    momentPrototype__proto.add          = add_subtract__add;\n    momentPrototype__proto.calendar     = moment_calendar__calendar;\n    momentPrototype__proto.clone        = clone;\n    momentPrototype__proto.diff         = diff;\n    momentPrototype__proto.endOf        = endOf;\n    momentPrototype__proto.format       = moment_format__format;\n    momentPrototype__proto.from         = from;\n    momentPrototype__proto.fromNow      = fromNow;\n    momentPrototype__proto.get          = getSet;\n    momentPrototype__proto.invalidAt    = invalidAt;\n    momentPrototype__proto.isAfter      = isAfter;\n    momentPrototype__proto.isBefore     = isBefore;\n    momentPrototype__proto.isBetween    = isBetween;\n    momentPrototype__proto.isSame       = isSame;\n    momentPrototype__proto.isValid      = moment_valid__isValid;\n    momentPrototype__proto.lang         = lang;\n    momentPrototype__proto.locale       = locale;\n    momentPrototype__proto.localeData   = localeData;\n    momentPrototype__proto.max          = prototypeMax;\n    momentPrototype__proto.min          = prototypeMin;\n    momentPrototype__proto.parsingFlags = parsingFlags;\n    momentPrototype__proto.set          = getSet;\n    momentPrototype__proto.startOf      = startOf;\n    momentPrototype__proto.subtract     = add_subtract__subtract;\n    momentPrototype__proto.toArray      = toArray;\n    momentPrototype__proto.toDate       = toDate;\n    momentPrototype__proto.toISOString  = moment_format__toISOString;\n    momentPrototype__proto.toJSON       = moment_format__toISOString;\n    momentPrototype__proto.toString     = toString;\n    momentPrototype__proto.unix         = unix;\n    momentPrototype__proto.valueOf      = to_type__valueOf;\n\n    // Year\n    momentPrototype__proto.year       = getSetYear;\n    momentPrototype__proto.isLeapYear = getIsLeapYear;\n\n    // Week Year\n    momentPrototype__proto.weekYear    = getSetWeekYear;\n    momentPrototype__proto.isoWeekYear = getSetISOWeekYear;\n\n    // Quarter\n    momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;\n\n    // Month\n    momentPrototype__proto.month       = getSetMonth;\n    momentPrototype__proto.daysInMonth = getDaysInMonth;\n\n    // Week\n    momentPrototype__proto.week           = momentPrototype__proto.weeks        = getSetWeek;\n    momentPrototype__proto.isoWeek        = momentPrototype__proto.isoWeeks     = getSetISOWeek;\n    momentPrototype__proto.weeksInYear    = getWeeksInYear;\n    momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;\n\n    // Day\n    momentPrototype__proto.date       = getSetDayOfMonth;\n    momentPrototype__proto.day        = momentPrototype__proto.days             = getSetDayOfWeek;\n    momentPrototype__proto.weekday    = getSetLocaleDayOfWeek;\n    momentPrototype__proto.isoWeekday = getSetISODayOfWeek;\n    momentPrototype__proto.dayOfYear  = getSetDayOfYear;\n\n    // Hour\n    momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;\n\n    // Minute\n    momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;\n\n    // Second\n    momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;\n\n    // Millisecond\n    momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;\n\n    // Offset\n    momentPrototype__proto.utcOffset            = getSetOffset;\n    momentPrototype__proto.utc                  = setOffsetToUTC;\n    momentPrototype__proto.local                = setOffsetToLocal;\n    momentPrototype__proto.parseZone            = setOffsetToParsedOffset;\n    momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;\n    momentPrototype__proto.isDST                = isDaylightSavingTime;\n    momentPrototype__proto.isDSTShifted         = isDaylightSavingTimeShifted;\n    momentPrototype__proto.isLocal              = isLocal;\n    momentPrototype__proto.isUtcOffset          = isUtcOffset;\n    momentPrototype__proto.isUtc                = isUtc;\n    momentPrototype__proto.isUTC                = isUtc;\n\n    // Timezone\n    momentPrototype__proto.zoneAbbr = getZoneAbbr;\n    momentPrototype__proto.zoneName = getZoneName;\n\n    // Deprecations\n    momentPrototype__proto.dates  = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n    momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n    momentPrototype__proto.years  = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n    momentPrototype__proto.zone   = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);\n\n    var momentPrototype = momentPrototype__proto;\n\n    function moment_moment__createUnix (input) {\n        return local__createLocal(input * 1000);\n    }\n\n    function moment_moment__createInZone () {\n        return local__createLocal.apply(null, arguments).parseZone();\n    }\n\n    var defaultCalendar = {\n        sameDay : '[Today at] LT',\n        nextDay : '[Tomorrow at] LT',\n        nextWeek : 'dddd [at] LT',\n        lastDay : '[Yesterday at] LT',\n        lastWeek : '[Last] dddd [at] LT',\n        sameElse : 'L'\n    };\n\n    function locale_calendar__calendar (key, mom, now) {\n        var output = this._calendar[key];\n        return typeof output === 'function' ? output.call(mom, now) : output;\n    }\n\n    var defaultLongDateFormat = {\n        LTS  : 'h:mm:ss A',\n        LT   : 'h:mm A',\n        L    : 'MM/DD/YYYY',\n        LL   : 'MMMM D, YYYY',\n        LLL  : 'MMMM D, YYYY LT',\n        LLLL : 'dddd, MMMM D, YYYY LT'\n    };\n\n    function longDateFormat (key) {\n        var output = this._longDateFormat[key];\n        if (!output && this._longDateFormat[key.toUpperCase()]) {\n            output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {\n                return val.slice(1);\n            });\n            this._longDateFormat[key] = output;\n        }\n        return output;\n    }\n\n    var defaultInvalidDate = 'Invalid date';\n\n    function invalidDate () {\n        return this._invalidDate;\n    }\n\n    var defaultOrdinal = '%d';\n    var defaultOrdinalParse = /\\d{1,2}/;\n\n    function ordinal (number) {\n        return this._ordinal.replace('%d', number);\n    }\n\n    function preParsePostFormat (string) {\n        return string;\n    }\n\n    var defaultRelativeTime = {\n        future : 'in %s',\n        past   : '%s ago',\n        s  : 'a few seconds',\n        m  : 'a minute',\n        mm : '%d minutes',\n        h  : 'an hour',\n        hh : '%d hours',\n        d  : 'a day',\n        dd : '%d days',\n        M  : 'a month',\n        MM : '%d months',\n        y  : 'a year',\n        yy : '%d years'\n    };\n\n    function relative__relativeTime (number, withoutSuffix, string, isFuture) {\n        var output = this._relativeTime[string];\n        return (typeof output === 'function') ?\n            output(number, withoutSuffix, string, isFuture) :\n            output.replace(/%d/i, number);\n    }\n\n    function pastFuture (diff, output) {\n        var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n        return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);\n    }\n\n    function locale_set__set (config) {\n        var prop, i;\n        for (i in config) {\n            prop = config[i];\n            if (typeof prop === 'function') {\n                this[i] = prop;\n            } else {\n                this['_' + i] = prop;\n            }\n        }\n        // Lenient ordinal parsing accepts just a number in addition to\n        // number + (possibly) stuff coming from _ordinalParseLenient.\n        this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + /\\d{1,2}/.source);\n    }\n\n    var prototype__proto = Locale.prototype;\n\n    prototype__proto._calendar       = defaultCalendar;\n    prototype__proto.calendar        = locale_calendar__calendar;\n    prototype__proto._longDateFormat = defaultLongDateFormat;\n    prototype__proto.longDateFormat  = longDateFormat;\n    prototype__proto._invalidDate    = defaultInvalidDate;\n    prototype__proto.invalidDate     = invalidDate;\n    prototype__proto._ordinal        = defaultOrdinal;\n    prototype__proto.ordinal         = ordinal;\n    prototype__proto._ordinalParse   = defaultOrdinalParse;\n    prototype__proto.preparse        = preParsePostFormat;\n    prototype__proto.postformat      = preParsePostFormat;\n    prototype__proto._relativeTime   = defaultRelativeTime;\n    prototype__proto.relativeTime    = relative__relativeTime;\n    prototype__proto.pastFuture      = pastFuture;\n    prototype__proto.set             = locale_set__set;\n\n    // Month\n    prototype__proto.months       =        localeMonths;\n    prototype__proto._months      = defaultLocaleMonths;\n    prototype__proto.monthsShort  =        localeMonthsShort;\n    prototype__proto._monthsShort = defaultLocaleMonthsShort;\n    prototype__proto.monthsParse  =        localeMonthsParse;\n\n    // Week\n    prototype__proto.week = localeWeek;\n    prototype__proto._week = defaultLocaleWeek;\n    prototype__proto.firstDayOfYear = localeFirstDayOfYear;\n    prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;\n\n    // Day of Week\n    prototype__proto.weekdays       =        localeWeekdays;\n    prototype__proto._weekdays      = defaultLocaleWeekdays;\n    prototype__proto.weekdaysMin    =        localeWeekdaysMin;\n    prototype__proto._weekdaysMin   = defaultLocaleWeekdaysMin;\n    prototype__proto.weekdaysShort  =        localeWeekdaysShort;\n    prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;\n    prototype__proto.weekdaysParse  =        localeWeekdaysParse;\n\n    // Hours\n    prototype__proto.isPM = localeIsPM;\n    prototype__proto._meridiemParse = defaultLocaleMeridiemParse;\n    prototype__proto.meridiem = localeMeridiem;\n\n    function lists__get (format, index, field, setter) {\n        var locale = locale_locales__getLocale();\n        var utc = create_utc__createUTC().set(setter, index);\n        return locale[field](utc, format);\n    }\n\n    function list (format, index, field, count, setter) {\n        if (typeof format === 'number') {\n            index = format;\n            format = undefined;\n        }\n\n        format = format || '';\n\n        if (index != null) {\n            return lists__get(format, index, field, setter);\n        }\n\n        var i;\n        var out = [];\n        for (i = 0; i < count; i++) {\n            out[i] = lists__get(format, i, field, setter);\n        }\n        return out;\n    }\n\n    function lists__listMonths (format, index) {\n        return list(format, index, 'months', 12, 'month');\n    }\n\n    function lists__listMonthsShort (format, index) {\n        return list(format, index, 'monthsShort', 12, 'month');\n    }\n\n    function lists__listWeekdays (format, index) {\n        return list(format, index, 'weekdays', 7, 'day');\n    }\n\n    function lists__listWeekdaysShort (format, index) {\n        return list(format, index, 'weekdaysShort', 7, 'day');\n    }\n\n    function lists__listWeekdaysMin (format, index) {\n        return list(format, index, 'weekdaysMin', 7, 'day');\n    }\n\n    locale_locales__getSetGlobalLocale('en', {\n        ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (toInt(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        }\n    });\n\n    // Side effect imports\n    utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);\n    utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);\n\n    var mathAbs = Math.abs;\n\n    function duration_abs__abs () {\n        var data           = this._data;\n\n        this._milliseconds = mathAbs(this._milliseconds);\n        this._days         = mathAbs(this._days);\n        this._months       = mathAbs(this._months);\n\n        data.milliseconds  = mathAbs(data.milliseconds);\n        data.seconds       = mathAbs(data.seconds);\n        data.minutes       = mathAbs(data.minutes);\n        data.hours         = mathAbs(data.hours);\n        data.months        = mathAbs(data.months);\n        data.years         = mathAbs(data.years);\n\n        return this;\n    }\n\n    function duration_add_subtract__addSubtract (duration, input, value, direction) {\n        var other = create__createDuration(input, value);\n\n        duration._milliseconds += direction * other._milliseconds;\n        duration._days         += direction * other._days;\n        duration._months       += direction * other._months;\n\n        return duration._bubble();\n    }\n\n    // supports only 2.0-style add(1, 's') or add(duration)\n    function duration_add_subtract__add (input, value) {\n        return duration_add_subtract__addSubtract(this, input, value, 1);\n    }\n\n    // supports only 2.0-style subtract(1, 's') or subtract(duration)\n    function duration_add_subtract__subtract (input, value) {\n        return duration_add_subtract__addSubtract(this, input, value, -1);\n    }\n\n    function bubble () {\n        var milliseconds = this._milliseconds;\n        var days         = this._days;\n        var months       = this._months;\n        var data         = this._data;\n        var seconds, minutes, hours, years = 0;\n\n        // The following code bubbles up values, see the tests for\n        // examples of what that means.\n        data.milliseconds = milliseconds % 1000;\n\n        seconds           = absFloor(milliseconds / 1000);\n        data.seconds      = seconds % 60;\n\n        minutes           = absFloor(seconds / 60);\n        data.minutes      = minutes % 60;\n\n        hours             = absFloor(minutes / 60);\n        data.hours        = hours % 24;\n\n        days += absFloor(hours / 24);\n\n        // Accurately convert days to years, assume start from year 0.\n        years = absFloor(daysToYears(days));\n        days -= absFloor(yearsToDays(years));\n\n        // 30 days to a month\n        // TODO (iskren): Use anchor date (like 1st Jan) to compute this.\n        months += absFloor(days / 30);\n        days   %= 30;\n\n        // 12 months -> 1 year\n        years  += absFloor(months / 12);\n        months %= 12;\n\n        data.days   = days;\n        data.months = months;\n        data.years  = years;\n\n        return this;\n    }\n\n    function daysToYears (days) {\n        // 400 years have 146097 days (taking into account leap year rules)\n        return days * 400 / 146097;\n    }\n\n    function yearsToDays (years) {\n        // years * 365 + absFloor(years / 4) -\n        //     absFloor(years / 100) + absFloor(years / 400);\n        return years * 146097 / 400;\n    }\n\n    function as (units) {\n        var days;\n        var months;\n        var milliseconds = this._milliseconds;\n\n        units = normalizeUnits(units);\n\n        if (units === 'month' || units === 'year') {\n            days   = this._days   + milliseconds / 864e5;\n            months = this._months + daysToYears(days) * 12;\n            return units === 'month' ? months : months / 12;\n        } else {\n            // handle milliseconds separately because of floating point math errors (issue #1867)\n            days = this._days + Math.round(yearsToDays(this._months / 12));\n            switch (units) {\n                case 'week'   : return days / 7            + milliseconds / 6048e5;\n                case 'day'    : return days                + milliseconds / 864e5;\n                case 'hour'   : return days * 24           + milliseconds / 36e5;\n                case 'minute' : return days * 24 * 60      + milliseconds / 6e4;\n                case 'second' : return days * 24 * 60 * 60 + milliseconds / 1000;\n                // Math.floor prevents floating point math errors here\n                case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds;\n                default: throw new Error('Unknown unit ' + units);\n            }\n        }\n    }\n\n    // TODO: Use this.as('ms')?\n    function duration_as__valueOf () {\n        return (\n            this._milliseconds +\n            this._days * 864e5 +\n            (this._months % 12) * 2592e6 +\n            toInt(this._months / 12) * 31536e6\n        );\n    }\n\n    function makeAs (alias) {\n        return function () {\n            return this.as(alias);\n        };\n    }\n\n    var asMilliseconds = makeAs('ms');\n    var asSeconds      = makeAs('s');\n    var asMinutes      = makeAs('m');\n    var asHours        = makeAs('h');\n    var asDays         = makeAs('d');\n    var asWeeks        = makeAs('w');\n    var asMonths       = makeAs('M');\n    var asYears        = makeAs('y');\n\n    function duration_get__get (units) {\n        units = normalizeUnits(units);\n        return this[units + 's']();\n    }\n\n    function makeGetter(name) {\n        return function () {\n            return this._data[name];\n        };\n    }\n\n    var duration_get__milliseconds = makeGetter('milliseconds');\n    var seconds      = makeGetter('seconds');\n    var minutes      = makeGetter('minutes');\n    var hours        = makeGetter('hours');\n    var days         = makeGetter('days');\n    var duration_get__months       = makeGetter('months');\n    var years        = makeGetter('years');\n\n    function weeks () {\n        return absFloor(this.days() / 7);\n    }\n\n    var round = Math.round;\n    var thresholds = {\n        s: 45,  // seconds to minute\n        m: 45,  // minutes to hour\n        h: 22,  // hours to day\n        d: 26,  // days to month\n        M: 11   // months to year\n    };\n\n    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n    }\n\n    function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {\n        var duration = create__createDuration(posNegDuration).abs();\n        var seconds  = round(duration.as('s'));\n        var minutes  = round(duration.as('m'));\n        var hours    = round(duration.as('h'));\n        var days     = round(duration.as('d'));\n        var months   = round(duration.as('M'));\n        var years    = round(duration.as('y'));\n\n        var a = seconds < thresholds.s && ['s', seconds]  ||\n                minutes === 1          && ['m']           ||\n                minutes < thresholds.m && ['mm', minutes] ||\n                hours   === 1          && ['h']           ||\n                hours   < thresholds.h && ['hh', hours]   ||\n                days    === 1          && ['d']           ||\n                days    < thresholds.d && ['dd', days]    ||\n                months  === 1          && ['M']           ||\n                months  < thresholds.M && ['MM', months]  ||\n                years   === 1          && ['y']           || ['yy', years];\n\n        a[2] = withoutSuffix;\n        a[3] = +posNegDuration > 0;\n        a[4] = locale;\n        return substituteTimeAgo.apply(null, a);\n    }\n\n    // This function allows you to set a threshold for relative time strings\n    function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n        if (thresholds[threshold] === undefined) {\n            return false;\n        }\n        if (limit === undefined) {\n            return thresholds[threshold];\n        }\n        thresholds[threshold] = limit;\n        return true;\n    }\n\n    function humanize (withSuffix) {\n        var locale = this.localeData();\n        var output = duration_humanize__relativeTime(this, !withSuffix, locale);\n\n        if (withSuffix) {\n            output = locale.pastFuture(+this, output);\n        }\n\n        return locale.postformat(output);\n    }\n\n    var iso_string__abs = Math.abs;\n\n    function iso_string__toISOString() {\n        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n        var Y = iso_string__abs(this.years());\n        var M = iso_string__abs(this.months());\n        var D = iso_string__abs(this.days());\n        var h = iso_string__abs(this.hours());\n        var m = iso_string__abs(this.minutes());\n        var s = iso_string__abs(this.seconds() + this.milliseconds() / 1000);\n        var total = this.asSeconds();\n\n        if (!total) {\n            // this is the same as C#'s (Noda) and python (isodate)...\n            // but not other JS (goog.date)\n            return 'P0D';\n        }\n\n        return (total < 0 ? '-' : '') +\n            'P' +\n            (Y ? Y + 'Y' : '') +\n            (M ? M + 'M' : '') +\n            (D ? D + 'D' : '') +\n            ((h || m || s) ? 'T' : '') +\n            (h ? h + 'H' : '') +\n            (m ? m + 'M' : '') +\n            (s ? s + 'S' : '');\n    }\n\n    var duration_prototype__proto = Duration.prototype;\n\n    duration_prototype__proto.abs            = duration_abs__abs;\n    duration_prototype__proto.add            = duration_add_subtract__add;\n    duration_prototype__proto.subtract       = duration_add_subtract__subtract;\n    duration_prototype__proto.as             = as;\n    duration_prototype__proto.asMilliseconds = asMilliseconds;\n    duration_prototype__proto.asSeconds      = asSeconds;\n    duration_prototype__proto.asMinutes      = asMinutes;\n    duration_prototype__proto.asHours        = asHours;\n    duration_prototype__proto.asDays         = asDays;\n    duration_prototype__proto.asWeeks        = asWeeks;\n    duration_prototype__proto.asMonths       = asMonths;\n    duration_prototype__proto.asYears        = asYears;\n    duration_prototype__proto.valueOf        = duration_as__valueOf;\n    duration_prototype__proto._bubble        = bubble;\n    duration_prototype__proto.get            = duration_get__get;\n    duration_prototype__proto.milliseconds   = duration_get__milliseconds;\n    duration_prototype__proto.seconds        = seconds;\n    duration_prototype__proto.minutes        = minutes;\n    duration_prototype__proto.hours          = hours;\n    duration_prototype__proto.days           = days;\n    duration_prototype__proto.weeks          = weeks;\n    duration_prototype__proto.months         = duration_get__months;\n    duration_prototype__proto.years          = years;\n    duration_prototype__proto.humanize       = humanize;\n    duration_prototype__proto.toISOString    = iso_string__toISOString;\n    duration_prototype__proto.toString       = iso_string__toISOString;\n    duration_prototype__proto.toJSON         = iso_string__toISOString;\n    duration_prototype__proto.locale         = locale;\n    duration_prototype__proto.localeData     = localeData;\n\n    // Deprecations\n    duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);\n    duration_prototype__proto.lang = lang;\n\n    // Side effect imports\n\n    addFormatToken('X', 0, 0, 'unix');\n    addFormatToken('x', 0, 0, 'valueOf');\n\n    // PARSING\n\n    addRegexToken('x', matchSigned);\n    addRegexToken('X', matchTimestamp);\n    addParseToken('X', function (input, array, config) {\n        config._d = new Date(parseFloat(input, 10) * 1000);\n    });\n    addParseToken('x', function (input, array, config) {\n        config._d = new Date(toInt(input));\n    });\n\n    // Side effect imports\n\n    ;\n\n    //! moment.js\n    //! version : 2.10.2\n    //! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n    //! license : MIT\n    //! momentjs.com\n\n    utils_hooks__hooks.version = '2.10.2';\n\n    setHookCallback(local__createLocal);\n\n    utils_hooks__hooks.fn                    = momentPrototype;\n    utils_hooks__hooks.min                   = min;\n    utils_hooks__hooks.max                   = max;\n    utils_hooks__hooks.utc                   = create_utc__createUTC;\n    utils_hooks__hooks.unix                  = moment_moment__createUnix;\n    utils_hooks__hooks.months                = lists__listMonths;\n    utils_hooks__hooks.isDate                = isDate;\n    utils_hooks__hooks.locale                = locale_locales__getSetGlobalLocale;\n    utils_hooks__hooks.invalid               = valid__createInvalid;\n    utils_hooks__hooks.duration              = create__createDuration;\n    utils_hooks__hooks.isMoment              = isMoment;\n    utils_hooks__hooks.weekdays              = lists__listWeekdays;\n    utils_hooks__hooks.parseZone             = moment_moment__createInZone;\n    utils_hooks__hooks.localeData            = locale_locales__getLocale;\n    utils_hooks__hooks.isDuration            = isDuration;\n    utils_hooks__hooks.monthsShort           = lists__listMonthsShort;\n    utils_hooks__hooks.weekdaysMin           = lists__listWeekdaysMin;\n    utils_hooks__hooks.defineLocale          = defineLocale;\n    utils_hooks__hooks.weekdaysShort         = lists__listWeekdaysShort;\n    utils_hooks__hooks.normalizeUnits        = normalizeUnits;\n    utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;\n\n    var _moment__default = utils_hooks__hooks;\n\n    //! moment.js locale configuration\n    //! locale : afrikaans (af)\n    //! author : Werner Mollentze : https://github.com/wernerm\n\n    var af = _moment__default.defineLocale('af', {\n        months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),\n        weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n        weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n        meridiemParse: /vm|nm/i,\n        isPM : function (input) {\n            return /^nm$/i.test(input);\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'vm' : 'VM';\n            } else {\n                return isLower ? 'nm' : 'NM';\n            }\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Vandag om] LT',\n            nextDay : '[Môre om] LT',\n            nextWeek : 'dddd [om] LT',\n            lastDay : '[Gister om] LT',\n            lastWeek : '[Laas] dddd [om] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'oor %s',\n            past : '%s gelede',\n            s : '\\'n paar sekondes',\n            m : '\\'n minuut',\n            mm : '%d minute',\n            h : '\\'n uur',\n            hh : '%d ure',\n            d : '\\'n dag',\n            dd : '%d dae',\n            M : '\\'n maand',\n            MM : '%d maande',\n            y : '\\'n jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter\n        },\n        week : {\n            dow : 1, // Maandag is die eerste dag van die week.\n            doy : 4  // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Moroccan Arabic (ar-ma)\n    //! author : ElFadili Yassine : https://github.com/ElFadiliY\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var ar_ma = _moment__default.defineLocale('ar-ma', {\n        months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n        weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Arabic Saudi Arabia (ar-sa)\n    //! author : Suhail Alkowaileet : https://github.com/xsoh\n\n    var ar_sa__symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, ar_sa__numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    };\n\n    var ar_sa = _moment__default.defineLocale('ar-sa', {\n        months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'في %s',\n            past : 'منذ %s',\n            s : 'ثوان',\n            m : 'دقيقة',\n            mm : '%d دقائق',\n            h : 'ساعة',\n            hh : '%d ساعات',\n            d : 'يوم',\n            dd : '%d أيام',\n            M : 'شهر',\n            MM : '%d أشهر',\n            y : 'سنة',\n            yy : '%d سنوات'\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return ar_sa__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ar_sa__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale  : Tunisian Arabic (ar-tn)\n\n    var ar_tn = _moment__default.defineLocale('ar-tn', {\n        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! Locale: Arabic (ar)\n    //! Author: Abdel Said: https://github.com/abdelsaid\n    //! Changes in months, weekdays: Ahmed Elkhatib\n    //! Native plural forms: forabi https://github.com/forabi\n\n    var ar__symbolMap = {\n        '1': '١',\n        '2': '٢',\n        '3': '٣',\n        '4': '٤',\n        '5': '٥',\n        '6': '٦',\n        '7': '٧',\n        '8': '٨',\n        '9': '٩',\n        '0': '٠'\n    }, ar__numberMap = {\n        '١': '1',\n        '٢': '2',\n        '٣': '3',\n        '٤': '4',\n        '٥': '5',\n        '٦': '6',\n        '٧': '7',\n        '٨': '8',\n        '٩': '9',\n        '٠': '0'\n    }, pluralForm = function (n) {\n        return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;\n    }, plurals = {\n        s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n        m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n        h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n        d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n        M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n        y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n    }, pluralize = function (u) {\n        return function (number, withoutSuffix, string, isFuture) {\n            var f = pluralForm(number),\n                str = plurals[u][pluralForm(number)];\n            if (f === 2) {\n                str = str[withoutSuffix ? 0 : 1];\n            }\n            return str.replace(/%d/i, number);\n        };\n    }, ar__months = [\n        'كانون الثاني يناير',\n        'شباط فبراير',\n        'آذار مارس',\n        'نيسان أبريل',\n        'أيار مايو',\n        'حزيران يونيو',\n        'تموز يوليو',\n        'آب أغسطس',\n        'أيلول سبتمبر',\n        'تشرين الأول أكتوبر',\n        'تشرين الثاني نوفمبر',\n        'كانون الأول ديسمبر'\n    ];\n\n    var ar = _moment__default.defineLocale('ar', {\n        months : ar__months,\n        monthsShort : ar__months,\n        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        meridiemParse: /ص|م/,\n        isPM : function (input) {\n            return 'م' === input;\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar : {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'بعد %s',\n            past : 'منذ %s',\n            s : pluralize('s'),\n            m : pluralize('m'),\n            mm : pluralize('m'),\n            h : pluralize('h'),\n            hh : pluralize('h'),\n            d : pluralize('d'),\n            dd : pluralize('d'),\n            M : pluralize('M'),\n            MM : pluralize('M'),\n            y : pluralize('y'),\n            yy : pluralize('y')\n        },\n        preparse: function (string) {\n            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                return ar__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ar__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : azerbaijani (az)\n    //! author : topchiyev : https://github.com/topchiyev\n\n    var az__suffixes = {\n        1: '-inci',\n        5: '-inci',\n        8: '-inci',\n        70: '-inci',\n        80: '-inci',\n        2: '-nci',\n        7: '-nci',\n        20: '-nci',\n        50: '-nci',\n        3: '-üncü',\n        4: '-üncü',\n        100: '-üncü',\n        6: '-ncı',\n        9: '-uncu',\n        10: '-uncu',\n        30: '-uncu',\n        60: '-ıncı',\n        90: '-ıncı'\n    };\n\n    var az = _moment__default.defineLocale('az', {\n        months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),\n        monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n        weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),\n        weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n        weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[sabah saat] LT',\n            nextWeek : '[gələn həftə] dddd [saat] LT',\n            lastDay : '[dünən] LT',\n            lastWeek : '[keçən həftə] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s əvvəl',\n            s : 'birneçə saniyyə',\n            m : 'bir dəqiqə',\n            mm : '%d dəqiqə',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir il',\n            yy : '%d il'\n        },\n        meridiemParse: /gecə|səhər|gündüz|axşam/,\n        isPM : function (input) {\n            return /^(gündüz|axşam)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'gecə';\n            } else if (hour < 12) {\n                return 'səhər';\n            } else if (hour < 17) {\n                return 'gündüz';\n            } else {\n                return 'axşam';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '-ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (az__suffixes[a] || az__suffixes[b] || az__suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : belarusian (be)\n    //! author : Dmitry Demidov : https://github.com/demidov91\n    //! author: Praleska: http://praleska.pro/\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function be__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function be__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n            'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n            'dd': 'дзень_дні_дзён',\n            'MM': 'месяц_месяцы_месяцаў',\n            'yy': 'год_гады_гадоў'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвіліна' : 'хвіліну';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'гадзіна' : 'гадзіну';\n        }\n        else {\n            return number + ' ' + be__plural(format[key], +number);\n        }\n    }\n    function be__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n            'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function be__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),\n            'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:мінулую|наступную)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var be = _moment__default.defineLocale('be', {\n        months : be__monthsCaseReplace,\n        monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n        weekdays : be__weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сёння ў] LT',\n            nextDay: '[Заўтра ў] LT',\n            lastDay: '[Учора ў] LT',\n            nextWeek: function () {\n                return '[У] dddd [ў] LT';\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return '[У мінулую] dddd [ў] LT';\n                case 1:\n                case 2:\n                case 4:\n                    return '[У мінулы] dddd [ў] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'праз %s',\n            past : '%s таму',\n            s : 'некалькі секунд',\n            m : be__relativeTimeWithPlural,\n            mm : be__relativeTimeWithPlural,\n            h : be__relativeTimeWithPlural,\n            hh : be__relativeTimeWithPlural,\n            d : 'дзень',\n            dd : be__relativeTimeWithPlural,\n            M : 'месяц',\n            MM : be__relativeTimeWithPlural,\n            y : 'год',\n            yy : be__relativeTimeWithPlural\n        },\n        meridiemParse: /ночы|раніцы|дня|вечара/,\n        isPM : function (input) {\n            return /^(дня|вечара)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночы';\n            } else if (hour < 12) {\n                return 'раніцы';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечара';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(і|ы|га)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';\n            case 'D':\n                return number + '-га';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : bulgarian (bg)\n    //! author : Krasen Borisov : https://github.com/kraz\n\n    var bg = _moment__default.defineLocale('bg', {\n        months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Днес в] LT',\n            nextDay : '[Утре в] LT',\n            nextWeek : 'dddd [в] LT',\n            lastDay : '[Вчера в] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[В изминалата] dddd [в] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[В изминалия] dddd [в] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'след %s',\n            past : 'преди %s',\n            s : 'няколко секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дни',\n            M : 'месец',\n            MM : '%d месеца',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bengali (bn)\n    //! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n    var bn__symbolMap = {\n        '1': '১',\n        '2': '২',\n        '3': '৩',\n        '4': '৪',\n        '5': '৫',\n        '6': '৬',\n        '7': '৭',\n        '8': '৮',\n        '9': '৯',\n        '0': '০'\n    },\n    bn__numberMap = {\n        '১': '1',\n        '২': '2',\n        '৩': '3',\n        '৪': '4',\n        '৫': '5',\n        '৬': '6',\n        '৭': '7',\n        '৮': '8',\n        '৯': '9',\n        '০': '0'\n    };\n\n    var bn = _moment__default.defineLocale('bn', {\n        months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),\n        monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),\n        weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'),\n        weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'),\n        weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm সময়',\n            LTS : 'A h:mm:ss সময়',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[আজ] LT',\n            nextDay : '[আগামীকাল] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[গতকাল] LT',\n            lastWeek : '[গত] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s পরে',\n            past : '%s আগে',\n            s : 'কএক সেকেন্ড',\n            m : 'এক মিনিট',\n            mm : '%d মিনিট',\n            h : 'এক ঘন্টা',\n            hh : '%d ঘন্টা',\n            d : 'এক দিন',\n            dd : '%d দিন',\n            M : 'এক মাস',\n            MM : '%d মাস',\n            y : 'এক বছর',\n            yy : '%d বছর'\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return bn__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return bn__symbolMap[match];\n            });\n        },\n        meridiemParse: /রাত|শকাল|দুপুর|বিকেল|রাত/,\n        isPM: function (input) {\n            return /^(দুপুর|বিকেল|রাত)$/.test(input);\n        },\n        //Bengali is a vast language its spoken\n        //in different forms in various parts of the world.\n        //I have just generalized with most common one used\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 10) {\n                return 'শকাল';\n            } else if (hour < 17) {\n                return 'দুপুর';\n            } else if (hour < 20) {\n                return 'বিকেল';\n            } else {\n                return 'রাত';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : tibetan (bo)\n    //! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n    var bo__symbolMap = {\n        '1': '༡',\n        '2': '༢',\n        '3': '༣',\n        '4': '༤',\n        '5': '༥',\n        '6': '༦',\n        '7': '༧',\n        '8': '༨',\n        '9': '༩',\n        '0': '༠'\n    },\n    bo__numberMap = {\n        '༡': '1',\n        '༢': '2',\n        '༣': '3',\n        '༤': '4',\n        '༥': '5',\n        '༦': '6',\n        '༧': '7',\n        '༨': '8',\n        '༩': '9',\n        '༠': '0'\n    };\n\n    var bo = _moment__default.defineLocale('bo', {\n        months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n        weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),\n        weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[དི་རིང] LT',\n            nextDay : '[སང་ཉིན] LT',\n            nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',\n            lastDay : '[ཁ་སང] LT',\n            lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s ལ་',\n            past : '%s སྔན་ལ',\n            s : 'ལམ་སང',\n            m : 'སྐར་མ་གཅིག',\n            mm : '%d སྐར་མ',\n            h : 'ཆུ་ཚོད་གཅིག',\n            hh : '%d ཆུ་ཚོད',\n            d : 'ཉིན་གཅིག',\n            dd : '%d ཉིན་',\n            M : 'ཟླ་བ་གཅིག',\n            MM : '%d ཟླ་བ',\n            y : 'ལོ་གཅིག',\n            yy : '%d ལོ'\n        },\n        preparse: function (string) {\n            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n                return bo__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return bo__symbolMap[match];\n            });\n        },\n        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n        isPM: function (input) {\n            return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'མཚན་མོ';\n            } else if (hour < 10) {\n                return 'ཞོགས་ཀས';\n            } else if (hour < 17) {\n                return 'ཉིན་གུང';\n            } else if (hour < 20) {\n                return 'དགོང་དག';\n            } else {\n                return 'མཚན་མོ';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : breton (br)\n    //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n    function relativeTimeWithMutation(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'munutenn',\n            'MM': 'miz',\n            'dd': 'devezh'\n        };\n        return number + ' ' + mutation(format[key], number);\n    }\n    function specialMutationForYears(number) {\n        switch (lastNumber(number)) {\n        case 1:\n        case 3:\n        case 4:\n        case 5:\n        case 9:\n            return number + ' bloaz';\n        default:\n            return number + ' vloaz';\n        }\n    }\n    function lastNumber(number) {\n        if (number > 9) {\n            return lastNumber(number % 10);\n        }\n        return number;\n    }\n    function mutation(text, number) {\n        if (number === 2) {\n            return softMutation(text);\n        }\n        return text;\n    }\n    function softMutation(text) {\n        var mutationTable = {\n            'm': 'v',\n            'b': 'v',\n            'd': 'z'\n        };\n        if (mutationTable[text.charAt(0)] === undefined) {\n            return text;\n        }\n        return mutationTable[text.charAt(0)] + text.substring(1);\n    }\n\n    var br = _moment__default.defineLocale('br', {\n        months : 'Genver_C\\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),\n        monthsShort : 'Gen_C\\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n        weekdays : 'Sul_Lun_Meurzh_Merc\\'her_Yaou_Gwener_Sadorn'.split('_'),\n        weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n        weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h[e]mm A',\n            LTS : 'h[e]mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D [a viz] MMMM YYYY',\n            LLL : 'D [a viz] MMMM YYYY LT',\n            LLLL : 'dddd, D [a viz] MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Hiziv da] LT',\n            nextDay : '[Warc\\'hoazh da] LT',\n            nextWeek : 'dddd [da] LT',\n            lastDay : '[Dec\\'h da] LT',\n            lastWeek : 'dddd [paset da] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'a-benn %s',\n            past : '%s \\'zo',\n            s : 'un nebeud segondennoù',\n            m : 'ur vunutenn',\n            mm : relativeTimeWithMutation,\n            h : 'un eur',\n            hh : '%d eur',\n            d : 'un devezh',\n            dd : relativeTimeWithMutation,\n            M : 'ur miz',\n            MM : relativeTimeWithMutation,\n            y : 'ur bloaz',\n            yy : specialMutationForYears\n        },\n        ordinalParse: /\\d{1,2}(añ|vet)/,\n        ordinal : function (number) {\n            var output = (number === 1) ? 'añ' : 'vet';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : bosnian (bs)\n    //! author : Nedim Cholich : https://github.com/frontyard\n    //! based on (hr) translation by Bojan Marković\n\n    function bs__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var bs = _moment__default.defineLocale('bs', {\n        months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : bs__translate,\n            mm     : bs__translate,\n            h      : bs__translate,\n            hh     : bs__translate,\n            d      : 'dan',\n            dd     : bs__translate,\n            M      : 'mjesec',\n            MM     : bs__translate,\n            y      : 'godinu',\n            yy     : bs__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : catalan (ca)\n    //! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n    var ca = _moment__default.defineLocale('ca', {\n        months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n        monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),\n        weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n        weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextDay : function () {\n                return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastDay : function () {\n                return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'fa %s',\n            s : 'uns segons',\n            m : 'un minut',\n            mm : '%d minuts',\n            h : 'una hora',\n            hh : '%d hores',\n            d : 'un dia',\n            dd : '%d dies',\n            M : 'un mes',\n            MM : '%d mesos',\n            y : 'un any',\n            yy : '%d anys'\n        },\n        ordinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal : function (number, period) {\n            var output = (number === 1) ? 'r' :\n                (number === 2) ? 'n' :\n                (number === 3) ? 'r' :\n                (number === 4) ? 't' : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : czech (cs)\n    //! author : petrbela : https://github.com/petrbela\n\n    var cs__months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),\n        cs__monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');\n    function cs__plural(n) {\n        return (n > 1) && (n < 5) && (~~(n / 10) !== 1);\n    }\n    function cs__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'minuty' : 'minut');\n            } else {\n                return result + 'minutami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'hodiny' : 'hodin');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'dny' : 'dní');\n            } else {\n                return result + 'dny';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'měsíce' : 'měsíců');\n            } else {\n                return result + 'měsíci';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (cs__plural(number) ? 'roky' : 'let');\n            } else {\n                return result + 'lety';\n            }\n            break;\n        }\n    }\n\n    var cs = _moment__default.defineLocale('cs', {\n        months : cs__months,\n        monthsShort : cs__monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(cs__months, cs__monthsShort)),\n        weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n        weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),\n        weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes v] LT',\n            nextDay: '[zítra v] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v neděli v] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [v] LT';\n                case 3:\n                    return '[ve středu v] LT';\n                case 4:\n                    return '[ve čtvrtek v] LT';\n                case 5:\n                    return '[v pátek v] LT';\n                case 6:\n                    return '[v sobotu v] LT';\n                }\n            },\n            lastDay: '[včera v] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulou neděli v] LT';\n                case 1:\n                case 2:\n                    return '[minulé] dddd [v] LT';\n                case 3:\n                    return '[minulou středu v] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [v] LT';\n                case 6:\n                    return '[minulou sobotu v] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'před %s',\n            s : cs__translate,\n            m : cs__translate,\n            mm : cs__translate,\n            h : cs__translate,\n            hh : cs__translate,\n            d : cs__translate,\n            dd : cs__translate,\n            M : cs__translate,\n            MM : cs__translate,\n            y : cs__translate,\n            yy : cs__translate\n        },\n        ordinalParse : /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : chuvash (cv)\n    //! author : Anatoly Mironov : https://github.com/mirontoli\n\n    var cv = _moment__default.defineLocale('cv', {\n        months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'),\n        monthsShort : 'кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш'.split('_'),\n        weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун'.split('_'),\n        weekdaysShort : 'выр_тун_ытл_юн_кĕç_эрн_шăм'.split('_'),\n        weekdaysMin : 'вр_тн_ыт_юн_кç_эр_шм'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]',\n            LLL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT',\n            LLLL : 'dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT'\n        },\n        calendar : {\n            sameDay: '[Паян] LT [сехетре]',\n            nextDay: '[Ыран] LT [сехетре]',\n            lastDay: '[Ĕнер] LT [сехетре]',\n            nextWeek: '[Çитес] dddd LT [сехетре]',\n            lastWeek: '[Иртнĕ] dddd LT [сехетре]',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (output) {\n                var affix = /сехет$/i.exec(output) ? 'рен' : /çул$/i.exec(output) ? 'тан' : 'ран';\n                return output + affix;\n            },\n            past : '%s каялла',\n            s : 'пĕр-ик çеккунт',\n            m : 'пĕр минут',\n            mm : '%d минут',\n            h : 'пĕр сехет',\n            hh : '%d сехет',\n            d : 'пĕр кун',\n            dd : '%d кун',\n            M : 'пĕр уйăх',\n            MM : '%d уйăх',\n            y : 'пĕр çул',\n            yy : '%d çул'\n        },\n        ordinalParse: /\\d{1,2}-мĕш/,\n        ordinal : '%d-мĕш',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Welsh (cy)\n    //! author : Robert Allen\n\n    var cy = _moment__default.defineLocale('cy', {\n        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),\n        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),\n        weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),\n        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n        // time formats are the same as en-gb\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Heddiw am] LT',\n            nextDay: '[Yfory am] LT',\n            nextWeek: 'dddd [am] LT',\n            lastDay: '[Ddoe am] LT',\n            lastWeek: 'dddd [diwethaf am] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'mewn %s',\n            past: '%s yn ôl',\n            s: 'ychydig eiliadau',\n            m: 'munud',\n            mm: '%d munud',\n            h: 'awr',\n            hh: '%d awr',\n            d: 'diwrnod',\n            dd: '%d diwrnod',\n            M: 'mis',\n            MM: '%d mis',\n            y: 'blwyddyn',\n            yy: '%d flynedd'\n        },\n        ordinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n        ordinal: function (number) {\n            var b = number,\n                output = '',\n                lookup = [\n                    '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed\n                    'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed\n                ];\n            if (b > 20) {\n                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                    output = 'fed'; // not 30ain, 70ain or 90ain\n                } else {\n                    output = 'ain';\n                }\n            } else if (b > 0) {\n                output = lookup[b];\n            }\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : danish (da)\n    //! author : Ulrik Nielsen : https://github.com/mrbase\n\n    var da = _moment__default.defineLocale('da', {\n        months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd [d.] D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[I dag kl.] LT',\n            nextDay : '[I morgen kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[I går kl.] LT',\n            lastWeek : '[sidste] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : '%s siden',\n            s : 'få sekunder',\n            m : 'et minut',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dage',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'et år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : austrian german (de-at)\n    //! author : lluchs : https://github.com/lluchs\n    //! author: Menelion Elensúle: https://github.com/Oire\n    //! author : Martin Groller : https://github.com/MadMG\n\n    function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de_at = _moment__default.defineLocale('de-at', {\n        months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : de_at__processRelativeTime,\n            mm : '%d Minuten',\n            h : de_at__processRelativeTime,\n            hh : '%d Stunden',\n            d : de_at__processRelativeTime,\n            dd : de_at__processRelativeTime,\n            M : de_at__processRelativeTime,\n            MM : de_at__processRelativeTime,\n            y : de_at__processRelativeTime,\n            yy : de_at__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : german (de)\n    //! author : lluchs : https://github.com/lluchs\n    //! author: Menelion Elensúle: https://github.com/Oire\n\n    function de__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eine Minute', 'einer Minute'],\n            'h': ['eine Stunde', 'einer Stunde'],\n            'd': ['ein Tag', 'einem Tag'],\n            'dd': [number + ' Tage', number + ' Tagen'],\n            'M': ['ein Monat', 'einem Monat'],\n            'MM': [number + ' Monate', number + ' Monaten'],\n            'y': ['ein Jahr', 'einem Jahr'],\n            'yy': [number + ' Jahre', number + ' Jahren']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de = _moment__default.defineLocale('de', {\n        months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[Morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[Gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : 'vor %s',\n            s : 'ein paar Sekunden',\n            m : de__processRelativeTime,\n            mm : '%d Minuten',\n            h : de__processRelativeTime,\n            hh : '%d Stunden',\n            d : de__processRelativeTime,\n            dd : de__processRelativeTime,\n            M : de__processRelativeTime,\n            MM : de__processRelativeTime,\n            y : de__processRelativeTime,\n            yy : de__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : modern greek (el)\n    //! author : Aggelos Karalias : https://github.com/mehiel\n\n    var el = _moment__default.defineLocale('el', {\n        monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),\n        monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),\n        months : function (momentToFormat, format) {\n            if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'\n                return this._monthsGenitiveEl[momentToFormat.month()];\n            } else {\n                return this._monthsNominativeEl[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n        weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),\n        weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n        weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'μμ' : 'ΜΜ';\n            } else {\n                return isLower ? 'πμ' : 'ΠΜ';\n            }\n        },\n        isPM : function (input) {\n            return ((input + '').toLowerCase()[0] === 'μ');\n        },\n        meridiemParse : /[ΠΜ]\\.?Μ?\\.?/i,\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendarEl : {\n            sameDay : '[Σήμερα {}] LT',\n            nextDay : '[Αύριο {}] LT',\n            nextWeek : 'dddd [{}] LT',\n            lastDay : '[Χθες {}] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                    case 6:\n                        return '[το προηγούμενο] dddd [{}] LT';\n                    default:\n                        return '[την προηγούμενη] dddd [{}] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        calendar : function (key, mom) {\n            var output = this._calendarEl[key],\n                hours = mom && mom.hours();\n            if (typeof output === 'function') {\n                output = output.apply(mom);\n            }\n            return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));\n        },\n        relativeTime : {\n            future : 'σε %s',\n            past : '%s πριν',\n            s : 'λίγα δευτερόλεπτα',\n            m : 'ένα λεπτό',\n            mm : '%d λεπτά',\n            h : 'μία ώρα',\n            hh : '%d ώρες',\n            d : 'μία μέρα',\n            dd : '%d μέρες',\n            M : 'ένας μήνας',\n            MM : '%d μήνες',\n            y : 'ένας χρόνος',\n            yy : '%d χρόνια'\n        },\n        ordinalParse: /\\d{1,2}η/,\n        ordinal: '%dη',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : australian english (en-au)\n\n    var en_au = _moment__default.defineLocale('en-au', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : canadian english (en-ca)\n    //! author : Jonathan Abourbih : https://github.com/jonbca\n\n    var en_ca = _moment__default.defineLocale('en-ca', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM, YYYY',\n            LLL : 'D MMMM, YYYY LT',\n            LLLL : 'dddd, D MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : great britain english (en-gb)\n    //! author : Chris Gedrim : https://github.com/chrisgedrim\n\n    var en_gb = _moment__default.defineLocale('en-gb', {\n        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'HH:mm:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Today at] LT',\n            nextDay : '[Tomorrow at] LT',\n            nextWeek : 'dddd [at] LT',\n            lastDay : '[Yesterday at] LT',\n            lastWeek : '[Last] dddd [at] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'in %s',\n            past : '%s ago',\n            s : 'a few seconds',\n            m : 'a minute',\n            mm : '%d minutes',\n            h : 'an hour',\n            hh : '%d hours',\n            d : 'a day',\n            dd : '%d days',\n            M : 'a month',\n            MM : '%d months',\n            y : 'a year',\n            yy : '%d years'\n        },\n        ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : esperanto (eo)\n    //! author : Colin Dean : https://github.com/colindean\n    //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.\n    //!          Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!\n\n    var eo = _moment__default.defineLocale('eo', {\n        months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),\n        weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),\n        weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D[-an de] MMMM, YYYY',\n            LLL : 'D[-an de] MMMM, YYYY LT',\n            LLLL : 'dddd, [la] D[-an de] MMMM, YYYY LT'\n        },\n        meridiemParse: /[ap]\\.t\\.m/i,\n        isPM: function (input) {\n            return input.charAt(0).toLowerCase() === 'p';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'p.t.m.' : 'P.T.M.';\n            } else {\n                return isLower ? 'a.t.m.' : 'A.T.M.';\n            }\n        },\n        calendar : {\n            sameDay : '[Hodiaŭ je] LT',\n            nextDay : '[Morgaŭ je] LT',\n            nextWeek : 'dddd [je] LT',\n            lastDay : '[Hieraŭ je] LT',\n            lastWeek : '[pasinta] dddd [je] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'je %s',\n            past : 'antaŭ %s',\n            s : 'sekundoj',\n            m : 'minuto',\n            mm : '%d minutoj',\n            h : 'horo',\n            hh : '%d horoj',\n            d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo\n            dd : '%d tagoj',\n            M : 'monato',\n            MM : '%d monatoj',\n            y : 'jaro',\n            yy : '%d jaroj'\n        },\n        ordinalParse: /\\d{1,2}a/,\n        ordinal : '%da',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : spanish (es)\n    //! author : Julio Napurí : https://github.com/julionc\n\n    var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n        es__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\n    var es = _moment__default.defineLocale('es', {\n        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return es__monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastDay : function () {\n                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            lastWeek : function () {\n                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'en %s',\n            past : 'hace %s',\n            s : 'unos segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'una hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un año',\n            yy : '%d años'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : estonian (et)\n    //! author : Henry Kehlmann : https://github.com/madhenry\n    //! improvements : Illimar Tambek : https://github.com/ragulka\n\n    function et__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n            'm' : ['ühe minuti', 'üks minut'],\n            'mm': [number + ' minuti', number + ' minutit'],\n            'h' : ['ühe tunni', 'tund aega', 'üks tund'],\n            'hh': [number + ' tunni', number + ' tundi'],\n            'd' : ['ühe päeva', 'üks päev'],\n            'M' : ['kuu aja', 'kuu aega', 'üks kuu'],\n            'MM': [number + ' kuu', number + ' kuud'],\n            'y' : ['ühe aasta', 'aasta', 'üks aasta'],\n            'yy': [number + ' aasta', number + ' aastat']\n        };\n        if (withoutSuffix) {\n            return format[key][2] ? format[key][2] : format[key][1];\n        }\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var et = _moment__default.defineLocale('et', {\n        months        : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n        monthsShort   : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n        weekdays      : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n        weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),\n        weekdaysMin   : 'P_E_T_K_N_R_L'.split('_'),\n        longDateFormat : {\n            LT   : 'H:mm',\n            LTS : 'LT:ss',\n            L    : 'DD.MM.YYYY',\n            LL   : 'D. MMMM YYYY',\n            LLL  : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[Täna,] LT',\n            nextDay  : '[Homme,] LT',\n            nextWeek : '[Järgmine] dddd LT',\n            lastDay  : '[Eile,] LT',\n            lastWeek : '[Eelmine] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s pärast',\n            past   : '%s tagasi',\n            s      : et__processRelativeTime,\n            m      : et__processRelativeTime,\n            mm     : et__processRelativeTime,\n            h      : et__processRelativeTime,\n            hh     : et__processRelativeTime,\n            d      : et__processRelativeTime,\n            dd     : '%d päeva',\n            M      : et__processRelativeTime,\n            MM     : et__processRelativeTime,\n            y      : et__processRelativeTime,\n            yy     : et__processRelativeTime\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : euskara (eu)\n    //! author : Eneko Illarramendi : https://github.com/eillarra\n\n    var eu = _moment__default.defineLocale('eu', {\n        months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),\n        monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),\n        weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),\n        weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),\n        weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY[ko] MMMM[ren] D[a]',\n            LLL : 'YYYY[ko] MMMM[ren] D[a] LT',\n            LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] LT',\n            l : 'YYYY-M-D',\n            ll : 'YYYY[ko] MMM D[a]',\n            lll : 'YYYY[ko] MMM D[a] LT',\n            llll : 'ddd, YYYY[ko] MMM D[a] LT'\n        },\n        calendar : {\n            sameDay : '[gaur] LT[etan]',\n            nextDay : '[bihar] LT[etan]',\n            nextWeek : 'dddd LT[etan]',\n            lastDay : '[atzo] LT[etan]',\n            lastWeek : '[aurreko] dddd LT[etan]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s barru',\n            past : 'duela %s',\n            s : 'segundo batzuk',\n            m : 'minutu bat',\n            mm : '%d minutu',\n            h : 'ordu bat',\n            hh : '%d ordu',\n            d : 'egun bat',\n            dd : '%d egun',\n            M : 'hilabete bat',\n            MM : '%d hilabete',\n            y : 'urte bat',\n            yy : '%d urte'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Persian (fa)\n    //! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n    var fa__symbolMap = {\n        '1': '۱',\n        '2': '۲',\n        '3': '۳',\n        '4': '۴',\n        '5': '۵',\n        '6': '۶',\n        '7': '۷',\n        '8': '۸',\n        '9': '۹',\n        '0': '۰'\n    }, fa__numberMap = {\n        '۱': '1',\n        '۲': '2',\n        '۳': '3',\n        '۴': '4',\n        '۵': '5',\n        '۶': '6',\n        '۷': '7',\n        '۸': '8',\n        '۹': '9',\n        '۰': '0'\n    };\n\n    var fa = _moment__default.defineLocale('fa', {\n        months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n        weekdays : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysShort : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n        weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        meridiemParse: /قبل از ظهر|بعد از ظهر/,\n        isPM: function (input) {\n            return /بعد از ظهر/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'قبل از ظهر';\n            } else {\n                return 'بعد از ظهر';\n            }\n        },\n        calendar : {\n            sameDay : '[امروز ساعت] LT',\n            nextDay : '[فردا ساعت] LT',\n            nextWeek : 'dddd [ساعت] LT',\n            lastDay : '[دیروز ساعت] LT',\n            lastWeek : 'dddd [پیش] [ساعت] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'در %s',\n            past : '%s پیش',\n            s : 'چندین ثانیه',\n            m : 'یک دقیقه',\n            mm : '%d دقیقه',\n            h : 'یک ساعت',\n            hh : '%d ساعت',\n            d : 'یک روز',\n            dd : '%d روز',\n            M : 'یک ماه',\n            MM : '%d ماه',\n            y : 'یک سال',\n            yy : '%d سال'\n        },\n        preparse: function (string) {\n            return string.replace(/[۰-۹]/g, function (match) {\n                return fa__numberMap[match];\n            }).replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return fa__symbolMap[match];\n            }).replace(/,/g, '،');\n        },\n        ordinalParse: /\\d{1,2}م/,\n        ordinal : '%dم',\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : finnish (fi)\n    //! author : Tarmo Aidantausta : https://github.com/bleadof\n\n    var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n        numbersFuture = [\n            'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n            numbersPast[7], numbersPast[8], numbersPast[9]\n        ];\n    function fi__translate(number, withoutSuffix, key, isFuture) {\n        var result = '';\n        switch (key) {\n        case 's':\n            return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n        case 'm':\n            return isFuture ? 'minuutin' : 'minuutti';\n        case 'mm':\n            result = isFuture ? 'minuutin' : 'minuuttia';\n            break;\n        case 'h':\n            return isFuture ? 'tunnin' : 'tunti';\n        case 'hh':\n            result = isFuture ? 'tunnin' : 'tuntia';\n            break;\n        case 'd':\n            return isFuture ? 'päivän' : 'päivä';\n        case 'dd':\n            result = isFuture ? 'päivän' : 'päivää';\n            break;\n        case 'M':\n            return isFuture ? 'kuukauden' : 'kuukausi';\n        case 'MM':\n            result = isFuture ? 'kuukauden' : 'kuukautta';\n            break;\n        case 'y':\n            return isFuture ? 'vuoden' : 'vuosi';\n        case 'yy':\n            result = isFuture ? 'vuoden' : 'vuotta';\n            break;\n        }\n        result = verbalNumber(number, isFuture) + ' ' + result;\n        return result;\n    }\n    function verbalNumber(number, isFuture) {\n        return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;\n    }\n\n    var fi = _moment__default.defineLocale('fi', {\n        months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n        monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n        weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n        weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'HH.mm.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'Do MMMM[ta] YYYY',\n            LLL : 'Do MMMM[ta] YYYY, [klo] LT',\n            LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] LT',\n            l : 'D.M.YYYY',\n            ll : 'Do MMM YYYY',\n            lll : 'Do MMM YYYY, [klo] LT',\n            llll : 'ddd, Do MMM YYYY, [klo] LT'\n        },\n        calendar : {\n            sameDay : '[tänään] [klo] LT',\n            nextDay : '[huomenna] [klo] LT',\n            nextWeek : 'dddd [klo] LT',\n            lastDay : '[eilen] [klo] LT',\n            lastWeek : '[viime] dddd[na] [klo] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s päästä',\n            past : '%s sitten',\n            s : fi__translate,\n            m : fi__translate,\n            mm : fi__translate,\n            h : fi__translate,\n            hh : fi__translate,\n            d : fi__translate,\n            dd : fi__translate,\n            M : fi__translate,\n            MM : fi__translate,\n            y : fi__translate,\n            yy : fi__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : faroese (fo)\n    //! author : Ragnar Johannesen : https://github.com/ragnar123\n\n    var fo = _moment__default.defineLocale('fo', {\n        months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),\n        weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n        weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM, YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Í dag kl.] LT',\n            nextDay : '[Í morgin kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[Í gjár kl.] LT',\n            lastWeek : '[síðstu] dddd [kl] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'um %s',\n            past : '%s síðani',\n            s : 'fá sekund',\n            m : 'ein minutt',\n            mm : '%d minuttir',\n            h : 'ein tími',\n            hh : '%d tímar',\n            d : 'ein dagur',\n            dd : '%d dagar',\n            M : 'ein mánaði',\n            MM : '%d mánaðir',\n            y : 'eitt ár',\n            yy : '%d ár'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : canadian french (fr-ca)\n    //! author : Jonathan Abourbih : https://github.com/jonbca\n\n    var fr_ca = _moment__default.defineLocale('fr-ca', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : french (fr)\n    //! author : John Fischer : https://github.com/jfroffice\n\n    var fr = _moment__default.defineLocale('fr', {\n        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Aujourd\\'hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dans %s',\n            past : 'il y a %s',\n            s : 'quelques secondes',\n            m : 'une minute',\n            mm : '%d minutes',\n            h : 'une heure',\n            hh : '%d heures',\n            d : 'un jour',\n            dd : '%d jours',\n            M : 'un mois',\n            MM : '%d mois',\n            y : 'un an',\n            yy : '%d ans'\n        },\n        ordinalParse: /\\d{1,2}(er|)/,\n        ordinal : function (number) {\n            return number + (number === 1 ? 'er' : '');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : frisian (fy)\n    //! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n    var fy__monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n        fy__monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n    var fy = _moment__default.defineLocale('fy', {\n        months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return fy__monthsShortWithoutDots[m.month()];\n            } else {\n                return fy__monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),\n        weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),\n        weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[hjoed om] LT',\n            nextDay: '[moarn om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[juster om] LT',\n            lastWeek: '[ôfrûne] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'oer %s',\n            past : '%s lyn',\n            s : 'in pear sekonden',\n            m : 'ien minút',\n            mm : '%d minuten',\n            h : 'ien oere',\n            hh : '%d oeren',\n            d : 'ien dei',\n            dd : '%d dagen',\n            M : 'ien moanne',\n            MM : '%d moannen',\n            y : 'ien jier',\n            yy : '%d jierren'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : galician (gl)\n    //! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n    var gl = _moment__default.defineLocale('gl', {\n        months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),\n        monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),\n        weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),\n        weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),\n        weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : function () {\n                return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextDay : function () {\n                return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n            },\n            nextWeek : function () {\n                return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            lastDay : function () {\n                return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';\n            },\n            lastWeek : function () {\n                return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (str) {\n                if (str === 'uns segundos') {\n                    return 'nuns segundos';\n                }\n                return 'en ' + str;\n            },\n            past : 'hai %s',\n            s : 'uns segundos',\n            m : 'un minuto',\n            mm : '%d minutos',\n            h : 'unha hora',\n            hh : '%d horas',\n            d : 'un día',\n            dd : '%d días',\n            M : 'un mes',\n            MM : '%d meses',\n            y : 'un ano',\n            yy : '%d anos'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Hebrew (he)\n    //! author : Tomer Cohen : https://github.com/tomer\n    //! author : Moshe Simantov : https://github.com/DevelopmentIL\n    //! author : Tal Ater : https://github.com/TalAter\n\n    var he = _moment__default.defineLocale('he', {\n        months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),\n        monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n        weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n        weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n        weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [ב]MMMM YYYY',\n            LLL : 'D [ב]MMMM YYYY LT',\n            LLLL : 'dddd, D [ב]MMMM YYYY LT',\n            l : 'D/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[היום ב־]LT',\n            nextDay : '[מחר ב־]LT',\n            nextWeek : 'dddd [בשעה] LT',\n            lastDay : '[אתמול ב־]LT',\n            lastWeek : '[ביום] dddd [האחרון בשעה] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'בעוד %s',\n            past : 'לפני %s',\n            s : 'מספר שניות',\n            m : 'דקה',\n            mm : '%d דקות',\n            h : 'שעה',\n            hh : function (number) {\n                if (number === 2) {\n                    return 'שעתיים';\n                }\n                return number + ' שעות';\n            },\n            d : 'יום',\n            dd : function (number) {\n                if (number === 2) {\n                    return 'יומיים';\n                }\n                return number + ' ימים';\n            },\n            M : 'חודש',\n            MM : function (number) {\n                if (number === 2) {\n                    return 'חודשיים';\n                }\n                return number + ' חודשים';\n            },\n            y : 'שנה',\n            yy : function (number) {\n                if (number === 2) {\n                    return 'שנתיים';\n                } else if (number % 10 === 0 && number !== 10) {\n                    return number + ' שנה';\n                }\n                return number + ' שנים';\n            }\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hindi (hi)\n    //! author : Mayank Singhal : https://github.com/mayanksinghal\n\n    var hi__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    hi__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var hi = _moment__default.defineLocale('hi', {\n        months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),\n        monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm बजे',\n            LTS : 'A h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[कल] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[कल] LT',\n            lastWeek : '[पिछले] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s में',\n            past : '%s पहले',\n            s : 'कुछ ही क्षण',\n            m : 'एक मिनट',\n            mm : '%d मिनट',\n            h : 'एक घंटा',\n            hh : '%d घंटे',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महीने',\n            MM : '%d महीने',\n            y : 'एक वर्ष',\n            yy : '%d वर्ष'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return hi__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return hi__symbolMap[match];\n            });\n        },\n        // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n        meridiemParse: /रात|सुबह|दोपहर|शाम/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सुबह') {\n                return hour;\n            } else if (meridiem === 'दोपहर') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'शाम') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात';\n            } else if (hour < 10) {\n                return 'सुबह';\n            } else if (hour < 17) {\n                return 'दोपहर';\n            } else if (hour < 20) {\n                return 'शाम';\n            } else {\n                return 'रात';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hrvatski (hr)\n    //! author : Bojan Marković : https://github.com/bmarkovic\n\n    function hr__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minuta';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'jedan sat' : 'jednog sata';\n        case 'hh':\n            if (number === 1) {\n                result += 'sat';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'sata';\n            } else {\n                result += 'sati';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dana';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mjesec';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'mjeseca';\n            } else {\n                result += 'mjeseci';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'godina';\n            } else if (number === 2 || number === 3 || number === 4) {\n                result += 'godine';\n            } else {\n                result += 'godina';\n            }\n            return result;\n        }\n    }\n\n    var hr = _moment__default.defineLocale('hr', {\n        months : 'sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),\n        monthsShort : 'sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),\n        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danas u] LT',\n            nextDay  : '[sutra u] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedjelju] [u] LT';\n                case 3:\n                    return '[u] [srijedu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[jučer u] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                    return '[prošlu] dddd [u] LT';\n                case 6:\n                    return '[prošle] [subote] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'prije %s',\n            s      : 'par sekundi',\n            m      : hr__translate,\n            mm     : hr__translate,\n            h      : hr__translate,\n            hh     : hr__translate,\n            d      : 'dan',\n            dd     : hr__translate,\n            M      : 'mjesec',\n            MM     : hr__translate,\n            y      : 'godinu',\n            yy     : hr__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : hungarian (hu)\n    //! author : Adam Brunner : https://github.com/adambrunner\n\n    var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n    function hu__translate(number, withoutSuffix, key, isFuture) {\n        var num = number,\n            suffix;\n        switch (key) {\n        case 's':\n            return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n        case 'm':\n            return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'mm':\n            return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n        case 'h':\n            return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'hh':\n            return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n        case 'd':\n            return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'dd':\n            return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n        case 'M':\n            return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'MM':\n            return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n        case 'y':\n            return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n        case 'yy':\n            return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n        }\n        return '';\n    }\n    function week(isFuture) {\n        return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';\n    }\n\n    var hu = _moment__default.defineLocale('hu', {\n        months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n        monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n        weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n        weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n        weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY.MM.DD.',\n            LL : 'YYYY. MMMM D.',\n            LLL : 'YYYY. MMMM D., LT',\n            LLLL : 'YYYY. MMMM D., dddd LT'\n        },\n        meridiemParse: /de|du/i,\n        isPM: function (input) {\n            return input.charAt(1).toLowerCase() === 'u';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower === true ? 'de' : 'DE';\n            } else {\n                return isLower === true ? 'du' : 'DU';\n            }\n        },\n        calendar : {\n            sameDay : '[ma] LT[-kor]',\n            nextDay : '[holnap] LT[-kor]',\n            nextWeek : function () {\n                return week.call(this, true);\n            },\n            lastDay : '[tegnap] LT[-kor]',\n            lastWeek : function () {\n                return week.call(this, false);\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s múlva',\n            past : '%s',\n            s : hu__translate,\n            m : hu__translate,\n            mm : hu__translate,\n            h : hu__translate,\n            hh : hu__translate,\n            d : hu__translate,\n            dd : hu__translate,\n            M : hu__translate,\n            MM : hu__translate,\n            y : hu__translate,\n            yy : hu__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Armenian (hy-am)\n    //! author : Armendarabyan : https://github.com/armendarabyan\n\n    function hy_am__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n            'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function hy_am__monthsShortCaseReplace(m, format) {\n        var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');\n        return monthsShort[m.month()];\n    }\n    function hy_am__weekdaysCaseReplace(m, format) {\n        var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');\n        return weekdays[m.day()];\n    }\n\n    var hy_am = _moment__default.defineLocale('hy-am', {\n        months : hy_am__monthsCaseReplace,\n        monthsShort : hy_am__monthsShortCaseReplace,\n        weekdays : hy_am__weekdaysCaseReplace,\n        weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY թ.',\n            LLL : 'D MMMM YYYY թ., LT',\n            LLLL : 'dddd, D MMMM YYYY թ., LT'\n        },\n        calendar : {\n            sameDay: '[այսօր] LT',\n            nextDay: '[վաղը] LT',\n            lastDay: '[երեկ] LT',\n            nextWeek: function () {\n                return 'dddd [օրը ժամը] LT';\n            },\n            lastWeek: function () {\n                return '[անցած] dddd [օրը ժամը] LT';\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s հետո',\n            past : '%s առաջ',\n            s : 'մի քանի վայրկյան',\n            m : 'րոպե',\n            mm : '%d րոպե',\n            h : 'ժամ',\n            hh : '%d ժամ',\n            d : 'օր',\n            dd : '%d օր',\n            M : 'ամիս',\n            MM : '%d ամիս',\n            y : 'տարի',\n            yy : '%d տարի'\n        },\n        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n        isPM: function (input) {\n            return /^(ցերեկվա|երեկոյան)$/.test(input);\n        },\n        meridiem : function (hour) {\n            if (hour < 4) {\n                return 'գիշերվա';\n            } else if (hour < 12) {\n                return 'առավոտվա';\n            } else if (hour < 17) {\n                return 'ցերեկվա';\n            } else {\n                return 'երեկոյան';\n            }\n        },\n        ordinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'DDD':\n            case 'w':\n            case 'W':\n            case 'DDDo':\n                if (number === 1) {\n                    return number + '-ին';\n                }\n                return number + '-րդ';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bahasa Indonesia (id)\n    //! author : Mohammad Satrio Utomo : https://github.com/tyok\n    //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n    var id = _moment__default.defineLocale('id', {\n        months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n        weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n        weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n        weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|siang|sore|malam/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'siang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sore' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'siang';\n            } else if (hours < 19) {\n                return 'sore';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Besok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kemarin pukul] LT',\n            lastWeek : 'dddd [lalu pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lalu',\n            s : 'beberapa detik',\n            m : 'semenit',\n            mm : '%d menit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : icelandic (is)\n    //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n    function is__plural(n) {\n        if (n % 100 === 11) {\n            return true;\n        } else if (n % 10 === 1) {\n            return false;\n        }\n        return true;\n    }\n    function is__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':\n            return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';\n        case 'm':\n            return withoutSuffix ? 'mínúta' : 'mínútu';\n        case 'mm':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');\n            } else if (withoutSuffix) {\n                return result + 'mínúta';\n            }\n            return result + 'mínútu';\n        case 'hh':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');\n            }\n            return result + 'klukkustund';\n        case 'd':\n            if (withoutSuffix) {\n                return 'dagur';\n            }\n            return isFuture ? 'dag' : 'degi';\n        case 'dd':\n            if (is__plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'dagar';\n                }\n                return result + (isFuture ? 'daga' : 'dögum');\n            } else if (withoutSuffix) {\n                return result + 'dagur';\n            }\n            return result + (isFuture ? 'dag' : 'degi');\n        case 'M':\n            if (withoutSuffix) {\n                return 'mánuður';\n            }\n            return isFuture ? 'mánuð' : 'mánuði';\n        case 'MM':\n            if (is__plural(number)) {\n                if (withoutSuffix) {\n                    return result + 'mánuðir';\n                }\n                return result + (isFuture ? 'mánuði' : 'mánuðum');\n            } else if (withoutSuffix) {\n                return result + 'mánuður';\n            }\n            return result + (isFuture ? 'mánuð' : 'mánuði');\n        case 'y':\n            return withoutSuffix || isFuture ? 'ár' : 'ári';\n        case 'yy':\n            if (is__plural(number)) {\n                return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n            }\n            return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n        }\n    }\n\n    var is = _moment__default.defineLocale('is', {\n        months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n        weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),\n        weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n        weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd, D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay : '[í dag kl.] LT',\n            nextDay : '[á morgun kl.] LT',\n            nextWeek : 'dddd [kl.] LT',\n            lastDay : '[í gær kl.] LT',\n            lastWeek : '[síðasta] dddd [kl.] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'eftir %s',\n            past : 'fyrir %s síðan',\n            s : is__translate,\n            m : is__translate,\n            mm : is__translate,\n            h : 'klukkustund',\n            hh : is__translate,\n            d : is__translate,\n            dd : is__translate,\n            M : is__translate,\n            MM : is__translate,\n            y : is__translate,\n            yy : is__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : italian (it)\n    //! author : Lorenzo : https://github.com/aliem\n    //! author: Mattia Larentis: https://github.com/nostalgiaz\n\n    var it = _moment__default.defineLocale('it', {\n        months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n        monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),\n        weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),\n        weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Oggi alle] LT',\n            nextDay: '[Domani alle] LT',\n            nextWeek: 'dddd [alle] LT',\n            lastDay: '[Ieri alle] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[la scorsa] dddd [alle] LT';\n                    default:\n                        return '[lo scorso] dddd [alle] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n            },\n            past : '%s fa',\n            s : 'alcuni secondi',\n            m : 'un minuto',\n            mm : '%d minuti',\n            h : 'un\\'ora',\n            hh : '%d ore',\n            d : 'un giorno',\n            dd : '%d giorni',\n            M : 'un mese',\n            MM : '%d mesi',\n            y : 'un anno',\n            yy : '%d anni'\n        },\n        ordinalParse : /\\d{1,2}º/,\n        ordinal: '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : japanese (ja)\n    //! author : LI Long : https://github.com/baryon\n\n    var ja = _moment__default.defineLocale('ja', {\n        months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n        weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n        weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n        longDateFormat : {\n            LT : 'Ah時m分',\n            LTS : 'LTs秒',\n            L : 'YYYY/MM/DD',\n            LL : 'YYYY年M月D日',\n            LLL : 'YYYY年M月D日LT',\n            LLLL : 'YYYY年M月D日LT dddd'\n        },\n        meridiemParse: /午前|午後/i,\n        isPM : function (input) {\n            return input === '午後';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return '午前';\n            } else {\n                return '午後';\n            }\n        },\n        calendar : {\n            sameDay : '[今日] LT',\n            nextDay : '[明日] LT',\n            nextWeek : '[来週]dddd LT',\n            lastDay : '[昨日] LT',\n            lastWeek : '[前週]dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s後',\n            past : '%s前',\n            s : '数秒',\n            m : '1分',\n            mm : '%d分',\n            h : '1時間',\n            hh : '%d時間',\n            d : '1日',\n            dd : '%d日',\n            M : '1ヶ月',\n            MM : '%dヶ月',\n            y : '1年',\n            yy : '%d年'\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Georgian (ka)\n    //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n\n    function ka__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n            'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n        },\n        nounCase = (/D[oD] *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function ka__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),\n            'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_')\n        },\n        nounCase = (/(წინა|შემდეგ)/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ka = _moment__default.defineLocale('ka', {\n        months : ka__monthsCaseReplace,\n        monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n        weekdays : ka__weekdaysCaseReplace,\n        weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n        weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n        longDateFormat : {\n            LT : 'h:mm A',\n            LTS : 'h:mm:ss A',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[დღეს] LT[-ზე]',\n            nextDay : '[ხვალ] LT[-ზე]',\n            lastDay : '[გუშინ] LT[-ზე]',\n            nextWeek : '[შემდეგ] dddd LT[-ზე]',\n            lastWeek : '[წინა] dddd LT-ზე',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : function (s) {\n                return (/(წამი|წუთი|საათი|წელი)/).test(s) ?\n                    s.replace(/ი$/, 'ში') :\n                    s + 'ში';\n            },\n            past : function (s) {\n                if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {\n                    return s.replace(/(ი|ე)$/, 'ის წინ');\n                }\n                if ((/წელი/).test(s)) {\n                    return s.replace(/წელი$/, 'წლის წინ');\n                }\n            },\n            s : 'რამდენიმე წამი',\n            m : 'წუთი',\n            mm : '%d წუთი',\n            h : 'საათი',\n            hh : '%d საათი',\n            d : 'დღე',\n            dd : '%d დღე',\n            M : 'თვე',\n            MM : '%d თვე',\n            y : 'წელი',\n            yy : '%d წელი'\n        },\n        ordinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n        ordinal : function (number) {\n            if (number === 0) {\n                return number;\n            }\n            if (number === 1) {\n                return number + '-ლი';\n            }\n            if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {\n                return 'მე-' + number;\n            }\n            return number + '-ე';\n        },\n        week : {\n            dow : 1,\n            doy : 7\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : khmer (km)\n    //! author : Kruy Vanna : https://github.com/kruyvanna\n\n    var km = _moment__default.defineLocale('km', {\n        months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS : 'LT:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd, D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ថ្ងៃនៈ ម៉ោង] LT',\n            nextDay: '[ស្អែក ម៉ោង] LT',\n            nextWeek: 'dddd [ម៉ោង] LT',\n            lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: '%sទៀត',\n            past: '%sមុន',\n            s: 'ប៉ុន្មានវិនាទី',\n            m: 'មួយនាទី',\n            mm: '%d នាទី',\n            h: 'មួយម៉ោង',\n            hh: '%d ម៉ោង',\n            d: 'មួយថ្ងៃ',\n            dd: '%d ថ្ងៃ',\n            M: 'មួយខែ',\n            MM: '%d ខែ',\n            y: 'មួយឆ្នាំ',\n            yy: '%d ឆ្នាំ'\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : korean (ko)\n    //!\n    //! authors\n    //!\n    //! - Kyungwook, Park : https://github.com/kyungw00k\n    //! - Jeeeyul Lee <jeeeyul@gmail.com>\n\n    var ko = _moment__default.defineLocale('ko', {\n        months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n        weekdaysShort : '일_월_화_수_목_금_토'.split('_'),\n        weekdaysMin : '일_월_화_수_목_금_토'.split('_'),\n        longDateFormat : {\n            LT : 'A h시 m분',\n            LTS : 'A h시 m분 s초',\n            L : 'YYYY.MM.DD',\n            LL : 'YYYY년 MMMM D일',\n            LLL : 'YYYY년 MMMM D일 LT',\n            LLLL : 'YYYY년 MMMM D일 dddd LT'\n        },\n        calendar : {\n            sameDay : '오늘 LT',\n            nextDay : '내일 LT',\n            nextWeek : 'dddd LT',\n            lastDay : '어제 LT',\n            lastWeek : '지난주 dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s 후',\n            past : '%s 전',\n            s : '몇초',\n            ss : '%d초',\n            m : '일분',\n            mm : '%d분',\n            h : '한시간',\n            hh : '%d시간',\n            d : '하루',\n            dd : '%d일',\n            M : '한달',\n            MM : '%d달',\n            y : '일년',\n            yy : '%d년'\n        },\n        ordinalParse : /\\d{1,2}일/,\n        ordinal : '%d일',\n        meridiemParse : /오전|오후/,\n        isPM : function (token) {\n            return token === '오후';\n        },\n        meridiem : function (hour, minute, isUpper) {\n            return hour < 12 ? '오전' : '오후';\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Luxembourgish (lb)\n    //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz\n\n    function lb__processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            'm': ['eng Minutt', 'enger Minutt'],\n            'h': ['eng Stonn', 'enger Stonn'],\n            'd': ['een Dag', 'engem Dag'],\n            'M': ['ee Mount', 'engem Mount'],\n            'y': ['ee Joer', 'engem Joer']\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n    function processFutureTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'a ' + string;\n        }\n        return 'an ' + string;\n    }\n    function processPastTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'viru ' + string;\n        }\n        return 'virun ' + string;\n    }\n    /**\n     * Returns true if the word before the given number loses the '-n' ending.\n     * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n     *\n     * @param number {integer}\n     * @returns {boolean}\n     */\n    function eifelerRegelAppliesToNumber(number) {\n        number = parseInt(number, 10);\n        if (isNaN(number)) {\n            return false;\n        }\n        if (number < 0) {\n            // Negative Number --> always true\n            return true;\n        } else if (number < 10) {\n            // Only 1 digit\n            if (4 <= number && number <= 7) {\n                return true;\n            }\n            return false;\n        } else if (number < 100) {\n            // 2 digits\n            var lastDigit = number % 10, firstDigit = number / 10;\n            if (lastDigit === 0) {\n                return eifelerRegelAppliesToNumber(firstDigit);\n            }\n            return eifelerRegelAppliesToNumber(lastDigit);\n        } else if (number < 10000) {\n            // 3 or 4 digits --> recursively check first digit\n            while (number >= 10) {\n                number = number / 10;\n            }\n            return eifelerRegelAppliesToNumber(number);\n        } else {\n            // Anything larger than 4 digits: recursively check first n-3 digits\n            number = number / 1000;\n            return eifelerRegelAppliesToNumber(number);\n        }\n    }\n\n    var lb = _moment__default.defineLocale('lb', {\n        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n        monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n        weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),\n        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm [Auer]',\n            LTS: 'H:mm:ss [Auer]',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[Haut um] LT',\n            sameElse: 'L',\n            nextDay: '[Muer um] LT',\n            nextWeek: 'dddd [um] LT',\n            lastDay: '[Gëschter um] LT',\n            lastWeek: function () {\n                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n                switch (this.day()) {\n                    case 2:\n                    case 4:\n                        return '[Leschten] dddd [um] LT';\n                    default:\n                        return '[Leschte] dddd [um] LT';\n                }\n            }\n        },\n        relativeTime : {\n            future : processFutureTime,\n            past : processPastTime,\n            s : 'e puer Sekonnen',\n            m : lb__processRelativeTime,\n            mm : '%d Minutten',\n            h : lb__processRelativeTime,\n            hh : '%d Stonnen',\n            d : lb__processRelativeTime,\n            dd : '%d Deeg',\n            M : lb__processRelativeTime,\n            MM : '%d Méint',\n            y : lb__processRelativeTime,\n            yy : '%d Joer'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Lithuanian (lt)\n    //! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n    var lt__units = {\n        'm' : 'minutė_minutės_minutę',\n        'mm': 'minutės_minučių_minutes',\n        'h' : 'valanda_valandos_valandą',\n        'hh': 'valandos_valandų_valandas',\n        'd' : 'diena_dienos_dieną',\n        'dd': 'dienos_dienų_dienas',\n        'M' : 'mėnuo_mėnesio_mėnesį',\n        'MM': 'mėnesiai_mėnesių_mėnesius',\n        'y' : 'metai_metų_metus',\n        'yy': 'metai_metų_metus'\n    },\n    weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');\n    function translateSeconds(number, withoutSuffix, key, isFuture) {\n        if (withoutSuffix) {\n            return 'kelios sekundės';\n        } else {\n            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n        }\n    }\n    function translateSingular(number, withoutSuffix, key, isFuture) {\n        return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n    }\n    function special(number) {\n        return number % 10 === 0 || (number > 10 && number < 20);\n    }\n    function forms(key) {\n        return lt__units[key].split('_');\n    }\n    function lt__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        if (number === 1) {\n            return result + translateSingular(number, withoutSuffix, key[0], isFuture);\n        } else if (withoutSuffix) {\n            return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n        } else {\n            if (isFuture) {\n                return result + forms(key)[1];\n            } else {\n                return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n            }\n        }\n    }\n    function relativeWeekDay(moment, format) {\n        var nominative = format.indexOf('dddd HH:mm') === -1,\n            weekDay = weekDays[moment.day()];\n        return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';\n    }\n\n    var lt = _moment__default.defineLocale('lt', {\n        months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),\n        monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n        weekdays : relativeWeekDay,\n        weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n        weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY [m.] MMMM D [d.]',\n            LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY [m.] MMMM D [d.]',\n            lll : 'YYYY [m.] MMMM D [d.], LT [val.]',\n            llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'\n        },\n        calendar : {\n            sameDay : '[Šiandien] LT',\n            nextDay : '[Rytoj] LT',\n            nextWeek : 'dddd LT',\n            lastDay : '[Vakar] LT',\n            lastWeek : '[Praėjusį] dddd LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'po %s',\n            past : 'prieš %s',\n            s : translateSeconds,\n            m : translateSingular,\n            mm : lt__translate,\n            h : translateSingular,\n            hh : lt__translate,\n            d : translateSingular,\n            dd : lt__translate,\n            M : translateSingular,\n            MM : lt__translate,\n            y : translateSingular,\n            yy : lt__translate\n        },\n        ordinalParse: /\\d{1,2}-oji/,\n        ordinal : function (number) {\n            return number + '-oji';\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : latvian (lv)\n    //! author : Kristaps Karlsons : https://github.com/skakri\n\n    var lv__units = {\n        'mm': 'minūti_minūtes_minūte_minūtes',\n        'hh': 'stundu_stundas_stunda_stundas',\n        'dd': 'dienu_dienas_diena_dienas',\n        'MM': 'mēnesi_mēnešus_mēnesis_mēneši',\n        'yy': 'gadu_gadus_gads_gadi'\n    };\n    function lv__format(word, number, withoutSuffix) {\n        var forms = word.split('_');\n        if (withoutSuffix) {\n            return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];\n        } else {\n            return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];\n        }\n    }\n    function lv__relativeTimeWithPlural(number, withoutSuffix, key) {\n        return number + ' ' + lv__format(lv__units[key], number, withoutSuffix);\n    }\n\n    var lv = _moment__default.defineLocale('lv', {\n        months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),\n        weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'YYYY. [gada] D. MMMM',\n            LLL : 'YYYY. [gada] D. MMMM, LT',\n            LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'\n        },\n        calendar : {\n            sameDay : '[Šodien pulksten] LT',\n            nextDay : '[Rīt pulksten] LT',\n            nextWeek : 'dddd [pulksten] LT',\n            lastDay : '[Vakar pulksten] LT',\n            lastWeek : '[Pagājušā] dddd [pulksten] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s vēlāk',\n            past : '%s agrāk',\n            s : 'dažas sekundes',\n            m : 'minūti',\n            mm : lv__relativeTimeWithPlural,\n            h : 'stundu',\n            hh : lv__relativeTimeWithPlural,\n            d : 'dienu',\n            dd : lv__relativeTimeWithPlural,\n            M : 'mēnesi',\n            MM : lv__relativeTimeWithPlural,\n            y : 'gadu',\n            yy : lv__relativeTimeWithPlural\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : macedonian (mk)\n    //! author : Borislav Mickov : https://github.com/B0k0\n\n    var mk = _moment__default.defineLocale('mk', {\n        months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),\n        monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),\n        weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n        weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'D.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Денес во] LT',\n            nextDay : '[Утре во] LT',\n            nextWeek : 'dddd [во] LT',\n            lastDay : '[Вчера во] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[Во изминатата] dddd [во] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[Во изминатиот] dddd [во] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'после %s',\n            past : 'пред %s',\n            s : 'неколку секунди',\n            m : 'минута',\n            mm : '%d минути',\n            h : 'час',\n            hh : '%d часа',\n            d : 'ден',\n            dd : '%d дена',\n            M : 'месец',\n            MM : '%d месеци',\n            y : 'година',\n            yy : '%d години'\n        },\n        ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal : function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : malayalam (ml)\n    //! author : Floyd Pink : https://github.com/floydpink\n\n    var ml = _moment__default.defineLocale('ml', {\n        months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),\n        monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),\n        weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),\n        weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n        weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm -നു',\n            LTS : 'A h:mm:ss -നു',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[ഇന്ന്] LT',\n            nextDay : '[നാളെ] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[ഇന്നലെ] LT',\n            lastWeek : '[കഴിഞ്ഞ] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s കഴിഞ്ഞ്',\n            past : '%s മുൻപ്',\n            s : 'അൽപ നിമിഷങ്ങൾ',\n            m : 'ഒരു മിനിറ്റ്',\n            mm : '%d മിനിറ്റ്',\n            h : 'ഒരു മണിക്കൂർ',\n            hh : '%d മണിക്കൂർ',\n            d : 'ഒരു ദിവസം',\n            dd : '%d ദിവസം',\n            M : 'ഒരു മാസം',\n            MM : '%d മാസം',\n            y : 'ഒരു വർഷം',\n            yy : '%d വർഷം'\n        },\n        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n        isPM : function (input) {\n            return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'രാത്രി';\n            } else if (hour < 12) {\n                return 'രാവിലെ';\n            } else if (hour < 17) {\n                return 'ഉച്ച കഴിഞ്ഞ്';\n            } else if (hour < 20) {\n                return 'വൈകുന്നേരം';\n            } else {\n                return 'രാത്രി';\n            }\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Marathi (mr)\n    //! author : Harshad Kale : https://github.com/kalehv\n\n    var mr__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    mr__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var mr = _moment__default.defineLocale('mr', {\n        months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),\n        monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),\n        weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat : {\n            LT : 'A h:mm वाजता',\n            LTS : 'A h:mm:ss वाजता',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[उद्या] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[काल] LT',\n            lastWeek: '[मागील] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s नंतर',\n            past : '%s पूर्वी',\n            s : 'सेकंद',\n            m: 'एक मिनिट',\n            mm: '%d मिनिटे',\n            h : 'एक तास',\n            hh : '%d तास',\n            d : 'एक दिवस',\n            dd : '%d दिवस',\n            M : 'एक महिना',\n            MM : '%d महिने',\n            y : 'एक वर्ष',\n            yy : '%d वर्षे'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return mr__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return mr__symbolMap[match];\n            });\n        },\n        meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात्री') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सकाळी') {\n                return hour;\n            } else if (meridiem === 'दुपारी') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'सायंकाळी') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात्री';\n            } else if (hour < 10) {\n                return 'सकाळी';\n            } else if (hour < 17) {\n                return 'दुपारी';\n            } else if (hour < 20) {\n                return 'सायंकाळी';\n            } else {\n                return 'रात्री';\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Bahasa Malaysia (ms-MY)\n    //! author : Weldan Jamili : https://github.com/weldan\n\n    var ms_my = _moment__default.defineLocale('ms-my', {\n        months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat : {\n            LT : 'HH.mm',\n            LTS : 'LT.ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY [pukul] LT',\n            LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar : {\n            sameDay : '[Hari ini pukul] LT',\n            nextDay : '[Esok pukul] LT',\n            nextWeek : 'dddd [pukul] LT',\n            lastDay : '[Kelmarin pukul] LT',\n            lastWeek : 'dddd [lepas pukul] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'dalam %s',\n            past : '%s yang lepas',\n            s : 'beberapa saat',\n            m : 'seminit',\n            mm : '%d minit',\n            h : 'sejam',\n            hh : '%d jam',\n            d : 'sehari',\n            dd : '%d hari',\n            M : 'sebulan',\n            MM : '%d bulan',\n            y : 'setahun',\n            yy : '%d tahun'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Burmese (my)\n    //! author : Squar team, mysquar.com\n\n    var my__symbolMap = {\n        '1': '၁',\n        '2': '၂',\n        '3': '၃',\n        '4': '၄',\n        '5': '၅',\n        '6': '၆',\n        '7': '၇',\n        '8': '၈',\n        '9': '၉',\n        '0': '၀'\n    }, my__numberMap = {\n        '၁': '1',\n        '၂': '2',\n        '၃': '3',\n        '၄': '4',\n        '၅': '5',\n        '၆': '6',\n        '၇': '7',\n        '၈': '8',\n        '၉': '9',\n        '၀': '0'\n    };\n\n    var my = _moment__default.defineLocale('my', {\n        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),\n        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),\n        weekdaysShort: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        weekdaysMin: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY LT',\n            LLLL: 'dddd D MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[ယနေ.] LT [မှာ]',\n            nextDay: '[မနက်ဖြန်] LT [မှာ]',\n            nextWeek: 'dddd LT [မှာ]',\n            lastDay: '[မနေ.က] LT [မှာ]',\n            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n            sameElse: 'L'\n        },\n        relativeTime: {\n            future: 'လာမည့် %s မှာ',\n            past: 'လွန်ခဲ့သော %s က',\n            s: 'စက္ကန်.အနည်းငယ်',\n            m: 'တစ်မိနစ်',\n            mm: '%d မိနစ်',\n            h: 'တစ်နာရီ',\n            hh: '%d နာရီ',\n            d: 'တစ်ရက်',\n            dd: '%d ရက်',\n            M: 'တစ်လ',\n            MM: '%d လ',\n            y: 'တစ်နှစ်',\n            yy: '%d နှစ်'\n        },\n        preparse: function (string) {\n            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n                return my__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return my__symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4 // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : norwegian bokmål (nb)\n    //! authors : Espen Hovlandsdal : https://github.com/rexxars\n    //!           Sigurd Gartmann : https://github.com/sigurdga\n\n    var nb = _moment__default.defineLocale('nb', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'),\n        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'H.mm',\n            LTS : 'LT.ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY [kl.] LT',\n            LLLL : 'dddd D. MMMM YYYY [kl.] LT'\n        },\n        calendar : {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[forrige] dddd [kl.] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s siden',\n            s : 'noen sekunder',\n            m : 'ett minutt',\n            mm : '%d minutter',\n            h : 'en time',\n            hh : '%d timer',\n            d : 'en dag',\n            dd : '%d dager',\n            M : 'en måned',\n            MM : '%d måneder',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : nepali/nepalese\n    //! author : suvash : https://github.com/suvash\n\n    var ne__symbolMap = {\n        '1': '१',\n        '2': '२',\n        '3': '३',\n        '4': '४',\n        '5': '५',\n        '6': '६',\n        '7': '७',\n        '8': '८',\n        '9': '९',\n        '0': '०'\n    },\n    ne__numberMap = {\n        '१': '1',\n        '२': '2',\n        '३': '3',\n        '४': '4',\n        '५': '5',\n        '६': '6',\n        '७': '7',\n        '८': '8',\n        '९': '9',\n        '०': '0'\n    };\n\n    var ne = _moment__default.defineLocale('ne', {\n        months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),\n        monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),\n        weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),\n        weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n        weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'),\n        longDateFormat : {\n            LT : 'Aको h:mm बजे',\n            LTS : 'Aको h:mm:ss बजे',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return ne__numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return ne__symbolMap[match];\n            });\n        },\n        meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राती') {\n                return hour < 3 ? hour : hour + 12;\n            } else if (meridiem === 'बिहान') {\n                return hour;\n            } else if (meridiem === 'दिउँसो') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 3) {\n                return 'राती';\n            } else if (hour < 10) {\n                return 'बिहान';\n            } else if (hour < 15) {\n                return 'दिउँसो';\n            } else if (hour < 18) {\n                return 'बेलुका';\n            } else if (hour < 20) {\n                return 'साँझ';\n            } else {\n                return 'राती';\n            }\n        },\n        calendar : {\n            sameDay : '[आज] LT',\n            nextDay : '[भोली] LT',\n            nextWeek : '[आउँदो] dddd[,] LT',\n            lastDay : '[हिजो] LT',\n            lastWeek : '[गएको] dddd[,] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%sमा',\n            past : '%s अगाडी',\n            s : 'केही समय',\n            m : 'एक मिनेट',\n            mm : '%d मिनेट',\n            h : 'एक घण्टा',\n            hh : '%d घण्टा',\n            d : 'एक दिन',\n            dd : '%d दिन',\n            M : 'एक महिना',\n            MM : '%d महिना',\n            y : 'एक बर्ष',\n            yy : '%d बर्ष'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : dutch (nl)\n    //! author : Joris Röling : https://github.com/jjupiter\n\n    var nl__monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        nl__monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\n    var nl = _moment__default.defineLocale('nl', {\n        months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n        monthsShort : function (m, format) {\n            if (/-MMM-/.test(format)) {\n                return nl__monthsShortWithoutDots[m.month()];\n            } else {\n                return nl__monthsShortWithDots[m.month()];\n            }\n        },\n        weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD-MM-YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'over %s',\n            past : '%s geleden',\n            s : 'een paar seconden',\n            m : 'één minuut',\n            mm : '%d minuten',\n            h : 'één uur',\n            hh : '%d uur',\n            d : 'één dag',\n            dd : '%d dagen',\n            M : 'één maand',\n            MM : '%d maanden',\n            y : 'één jaar',\n            yy : '%d jaar'\n        },\n        ordinalParse: /\\d{1,2}(ste|de)/,\n        ordinal : function (number) {\n            return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : norwegian nynorsk (nn)\n    //! author : https://github.com/mechuwind\n\n    var nn = _moment__default.defineLocale('nn', {\n        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n        weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),\n        weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[I dag klokka] LT',\n            nextDay: '[I morgon klokka] LT',\n            nextWeek: 'dddd [klokka] LT',\n            lastDay: '[I går klokka] LT',\n            lastWeek: '[Føregåande] dddd [klokka] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'for %s sidan',\n            s : 'nokre sekund',\n            m : 'eit minutt',\n            mm : '%d minutt',\n            h : 'ein time',\n            hh : '%d timar',\n            d : 'ein dag',\n            dd : '%d dagar',\n            M : 'ein månad',\n            MM : '%d månader',\n            y : 'eit år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : polish (pl)\n    //! author : Rafal Hirsz : https://github.com/evoL\n\n    var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),\n        monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');\n    function pl__plural(n) {\n        return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);\n    }\n    function pl__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'minuta' : 'minutę';\n        case 'mm':\n            return result + (pl__plural(number) ? 'minuty' : 'minut');\n        case 'h':\n            return withoutSuffix  ? 'godzina'  : 'godzinę';\n        case 'hh':\n            return result + (pl__plural(number) ? 'godziny' : 'godzin');\n        case 'MM':\n            return result + (pl__plural(number) ? 'miesiące' : 'miesięcy');\n        case 'yy':\n            return result + (pl__plural(number) ? 'lata' : 'lat');\n        }\n    }\n\n    var pl = _moment__default.defineLocale('pl', {\n        months : function (momentToFormat, format) {\n            if (/D MMMM/.test(format)) {\n                return monthsSubjective[momentToFormat.month()];\n            } else {\n                return monthsNominative[momentToFormat.month()];\n            }\n        },\n        monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n        weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n        weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),\n        weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Dziś o] LT',\n            nextDay: '[Jutro o] LT',\n            nextWeek: '[W] dddd [o] LT',\n            lastDay: '[Wczoraj o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[W zeszłą niedzielę o] LT';\n                case 3:\n                    return '[W zeszłą środę o] LT';\n                case 6:\n                    return '[W zeszłą sobotę o] LT';\n                default:\n                    return '[W zeszły] dddd [o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : '%s temu',\n            s : 'kilka sekund',\n            m : pl__translate,\n            mm : pl__translate,\n            h : pl__translate,\n            hh : pl__translate,\n            d : '1 dzień',\n            dd : '%d dni',\n            M : 'miesiąc',\n            MM : pl__translate,\n            y : 'rok',\n            yy : pl__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : brazilian portuguese (pt-br)\n    //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n    var pt_br = _moment__default.defineLocale('pt-br', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY [às] LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY [às] LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : '%s atrás',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº'\n    });\n\n    //! moment.js locale configuration\n    //! locale : portuguese (pt)\n    //! author : Jefferson : https://github.com/jalex79\n\n    var pt = _moment__default.defineLocale('pt', {\n        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n        weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D [de] MMMM [de] YYYY',\n            LLL : 'D [de] MMMM [de] YYYY LT',\n            LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return (this.day() === 0 || this.day() === 6) ?\n                    '[Último] dddd [às] LT' : // Saturday + Sunday\n                    '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'em %s',\n            past : 'há %s',\n            s : 'segundos',\n            m : 'um minuto',\n            mm : '%d minutos',\n            h : 'uma hora',\n            hh : '%d horas',\n            d : 'um dia',\n            dd : '%d dias',\n            M : 'um mês',\n            MM : '%d meses',\n            y : 'um ano',\n            yy : '%d anos'\n        },\n        ordinalParse: /\\d{1,2}º/,\n        ordinal : '%dº',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : romanian (ro)\n    //! author : Vlad Gurdiga : https://github.com/gurdiga\n    //! author : Valentin Agachi : https://github.com/avaly\n\n    function ro__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n                'mm': 'minute',\n                'hh': 'ore',\n                'dd': 'zile',\n                'MM': 'luni',\n                'yy': 'ani'\n            },\n            separator = ' ';\n        if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n            separator = ' de ';\n        }\n        return number + separator + format[key];\n    }\n\n    var ro = _moment__default.defineLocale('ro', {\n        months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n        monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n        weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n        weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n        weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY H:mm',\n            LLLL : 'dddd, D MMMM YYYY H:mm'\n        },\n        calendar : {\n            sameDay: '[azi la] LT',\n            nextDay: '[mâine la] LT',\n            nextWeek: 'dddd [la] LT',\n            lastDay: '[ieri la] LT',\n            lastWeek: '[fosta] dddd [la] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'peste %s',\n            past : '%s în urmă',\n            s : 'câteva secunde',\n            m : 'un minut',\n            mm : ro__relativeTimeWithPlural,\n            h : 'o oră',\n            hh : ro__relativeTimeWithPlural,\n            d : 'o zi',\n            dd : ro__relativeTimeWithPlural,\n            M : 'o lună',\n            MM : ro__relativeTimeWithPlural,\n            y : 'un an',\n            yy : ro__relativeTimeWithPlural\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : russian (ru)\n    //! author : Viktorminator : https://github.com/Viktorminator\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function ru__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function ru__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n            'hh': 'час_часа_часов',\n            'dd': 'день_дня_дней',\n            'MM': 'месяц_месяца_месяцев',\n            'yy': 'год_года_лет'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'минута' : 'минуту';\n        }\n        else {\n            return number + ' ' + ru__plural(format[key], +number);\n        }\n    }\n    function ru__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function ru__monthsShortCaseReplace(m, format) {\n        var monthsShort = {\n            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n        },\n        nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return monthsShort[nounCase][m.month()];\n    }\n    function ru__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n            'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')\n        },\n        nounCase = (/\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/).test(format) ?\n            'accusative' :\n            'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n\n    var ru = _moment__default.defineLocale('ru', {\n        months : ru__monthsCaseReplace,\n        monthsShort : ru__monthsShortCaseReplace,\n        weekdays : ru__weekdaysCaseReplace,\n        weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY г.',\n            LLL : 'D MMMM YYYY г., LT',\n            LLLL : 'dddd, D MMMM YYYY г., LT'\n        },\n        calendar : {\n            sameDay: '[Сегодня в] LT',\n            nextDay: '[Завтра в] LT',\n            lastDay: '[Вчера в] LT',\n            nextWeek: function () {\n                return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';\n            },\n            lastWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                    case 0:\n                        return '[В прошлое] dddd [в] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                        return '[В прошлый] dddd [в] LT';\n                    case 3:\n                    case 5:\n                    case 6:\n                        return '[В прошлую] dddd [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd [в] LT';\n                    } else {\n                        return '[В] dddd [в] LT';\n                    }\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'через %s',\n            past : '%s назад',\n            s : 'несколько секунд',\n            m : ru__relativeTimeWithPlural,\n            mm : ru__relativeTimeWithPlural,\n            h : 'час',\n            hh : ru__relativeTimeWithPlural,\n            d : 'день',\n            dd : ru__relativeTimeWithPlural,\n            M : 'месяц',\n            MM : ru__relativeTimeWithPlural,\n            y : 'год',\n            yy : ru__relativeTimeWithPlural\n        },\n        meridiemParse: /ночи|утра|дня|вечера/i,\n        isPM : function (input) {\n            return /^(дня|вечера)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночи';\n            } else if (hour < 12) {\n                return 'утра';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечера';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го|я)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            case 'w':\n            case 'W':\n                return number + '-я';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : slovak (sk)\n    //! author : Martin Minka : https://github.com/k2s\n    //! based on work of petrbela : https://github.com/petrbela\n\n    var sk__months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),\n        sk__monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n    function sk__plural(n) {\n        return (n > 1) && (n < 5);\n    }\n    function sk__translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n        case 's':  // a few seconds / in a few seconds / a few seconds ago\n            return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n        case 'm':  // a minute / in a minute / a minute ago\n            return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n        case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'minúty' : 'minút');\n            } else {\n                return result + 'minútami';\n            }\n            break;\n        case 'h':  // an hour / in an hour / an hour ago\n            return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n        case 'hh': // 9 hours / in 9 hours / 9 hours ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'hodiny' : 'hodín');\n            } else {\n                return result + 'hodinami';\n            }\n            break;\n        case 'd':  // a day / in a day / a day ago\n            return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n        case 'dd': // 9 days / in 9 days / 9 days ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'dni' : 'dní');\n            } else {\n                return result + 'dňami';\n            }\n            break;\n        case 'M':  // a month / in a month / a month ago\n            return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n        case 'MM': // 9 months / in 9 months / 9 months ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'mesiace' : 'mesiacov');\n            } else {\n                return result + 'mesiacmi';\n            }\n            break;\n        case 'y':  // a year / in a year / a year ago\n            return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n        case 'yy': // 9 years / in 9 years / 9 years ago\n            if (withoutSuffix || isFuture) {\n                return result + (sk__plural(number) ? 'roky' : 'rokov');\n            } else {\n                return result + 'rokmi';\n            }\n            break;\n        }\n    }\n\n    var sk = _moment__default.defineLocale('sk', {\n        months : sk__months,\n        monthsShort : sk__monthsShort,\n        monthsParse : (function (months, monthsShort) {\n            var i, _monthsParse = [];\n            for (i = 0; i < 12; i++) {\n                // use custom parser to solve problem with July (červenec)\n                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n            }\n            return _monthsParse;\n        }(sk__months, sk__monthsShort)),\n        weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n        weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),\n        weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),\n        longDateFormat : {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[dnes o] LT',\n            nextDay: '[zajtra o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[v] dddd [o] LT';\n                case 3:\n                    return '[v stredu o] LT';\n                case 4:\n                    return '[vo štvrtok o] LT';\n                case 5:\n                    return '[v piatok o] LT';\n                case 6:\n                    return '[v sobotu o] LT';\n                }\n            },\n            lastDay: '[včera o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[minulú nedeľu o] LT';\n                case 1:\n                case 2:\n                    return '[minulý] dddd [o] LT';\n                case 3:\n                    return '[minulú stredu o] LT';\n                case 4:\n                case 5:\n                    return '[minulý] dddd [o] LT';\n                case 6:\n                    return '[minulú sobotu o] LT';\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past : 'pred %s',\n            s : sk__translate,\n            m : sk__translate,\n            mm : sk__translate,\n            h : sk__translate,\n            hh : sk__translate,\n            d : sk__translate,\n            dd : sk__translate,\n            M : sk__translate,\n            MM : sk__translate,\n            y : sk__translate,\n            yy : sk__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : slovenian (sl)\n    //! author : Robert Sedovšek : https://github.com/sedovsek\n\n    function sl__translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n        case 'm':\n            return withoutSuffix ? 'ena minuta' : 'eno minuto';\n        case 'mm':\n            if (number === 1) {\n                result += 'minuta';\n            } else if (number === 2) {\n                result += 'minuti';\n            } else if (number === 3 || number === 4) {\n                result += 'minute';\n            } else {\n                result += 'minut';\n            }\n            return result;\n        case 'h':\n            return withoutSuffix ? 'ena ura' : 'eno uro';\n        case 'hh':\n            if (number === 1) {\n                result += 'ura';\n            } else if (number === 2) {\n                result += 'uri';\n            } else if (number === 3 || number === 4) {\n                result += 'ure';\n            } else {\n                result += 'ur';\n            }\n            return result;\n        case 'dd':\n            if (number === 1) {\n                result += 'dan';\n            } else {\n                result += 'dni';\n            }\n            return result;\n        case 'MM':\n            if (number === 1) {\n                result += 'mesec';\n            } else if (number === 2) {\n                result += 'meseca';\n            } else if (number === 3 || number === 4) {\n                result += 'mesece';\n            } else {\n                result += 'mesecev';\n            }\n            return result;\n        case 'yy':\n            if (number === 1) {\n                result += 'leto';\n            } else if (number === 2) {\n                result += 'leti';\n            } else if (number === 3 || number === 4) {\n                result += 'leta';\n            } else {\n                result += 'let';\n            }\n            return result;\n        }\n    }\n\n    var sl = _moment__default.defineLocale('sl', {\n        months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n        weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n        weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n        weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),\n        longDateFormat : {\n            LT : 'H:mm',\n            LTS : 'LT:ss',\n            L : 'DD. MM. YYYY',\n            LL : 'D. MMMM YYYY',\n            LLL : 'D. MMMM YYYY LT',\n            LLLL : 'dddd, D. MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay  : '[danes ob] LT',\n            nextDay  : '[jutri ob] LT',\n            nextWeek : function () {\n                switch (this.day()) {\n                case 0:\n                    return '[v] [nedeljo] [ob] LT';\n                case 3:\n                    return '[v] [sredo] [ob] LT';\n                case 6:\n                    return '[v] [soboto] [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[v] dddd [ob] LT';\n                }\n            },\n            lastDay  : '[včeraj ob] LT',\n            lastWeek : function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 6:\n                    return '[prejšnja] dddd [ob] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[prejšnji] dddd [ob] LT';\n                }\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'čez %s',\n            past   : '%s nazaj',\n            s      : 'nekaj sekund',\n            m      : sl__translate,\n            mm     : sl__translate,\n            h      : sl__translate,\n            hh     : sl__translate,\n            d      : 'en dan',\n            dd     : sl__translate,\n            M      : 'en mesec',\n            MM     : sl__translate,\n            y      : 'eno leto',\n            yy     : sl__translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Albanian (sq)\n    //! author : Flakërim Ismani : https://github.com/flakerimi\n    //! author: Menelion Elensúle: https://github.com/Oire (tests)\n    //! author : Oerd Cukalla : https://github.com/oerd (fixes)\n\n    var sq = _moment__default.defineLocale('sq', {\n        months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n        monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n        weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n        weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n        weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),\n        meridiemParse: /PD|MD/,\n        isPM: function (input) {\n            return input.charAt(0) === 'M';\n        },\n        meridiem : function (hours, minutes, isLower) {\n            return hours < 12 ? 'PD' : 'MD';\n        },\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[Sot në] LT',\n            nextDay : '[Nesër në] LT',\n            nextWeek : 'dddd [në] LT',\n            lastDay : '[Dje në] LT',\n            lastWeek : 'dddd [e kaluar në] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'në %s',\n            past : '%s më parë',\n            s : 'disa sekonda',\n            m : 'një minutë',\n            mm : '%d minuta',\n            h : 'një orë',\n            hh : '%d orë',\n            d : 'një ditë',\n            dd : '%d ditë',\n            M : 'një muaj',\n            MM : '%d muaj',\n            y : 'një vit',\n            yy : '%d vite'\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Serbian-cyrillic (sr-cyrl)\n    //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n    var sr_cyrl__translator = {\n        words: { //Different grammatical cases\n            m: ['један минут', 'једне минуте'],\n            mm: ['минут', 'минуте', 'минута'],\n            h: ['један сат', 'једног сата'],\n            hh: ['сат', 'сата', 'сати'],\n            dd: ['дан', 'дана', 'дана'],\n            MM: ['месец', 'месеца', 'месеци'],\n            yy: ['година', 'године', 'година']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = sr_cyrl__translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + sr_cyrl__translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr_cyrl = _moment__default.defineLocale('sr-cyrl', {\n        months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],\n        monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],\n        weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],\n        weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],\n        weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[данас у] LT',\n            nextDay: '[сутра у] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[у] [недељу] [у] LT';\n                case 3:\n                    return '[у] [среду] [у] LT';\n                case 6:\n                    return '[у] [суботу] [у] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[у] dddd [у] LT';\n                }\n            },\n            lastDay  : '[јуче у] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past   : 'пре %s',\n            s      : 'неколико секунди',\n            m      : sr_cyrl__translator.translate,\n            mm     : sr_cyrl__translator.translate,\n            h      : sr_cyrl__translator.translate,\n            hh     : sr_cyrl__translator.translate,\n            d      : 'дан',\n            dd     : sr_cyrl__translator.translate,\n            M      : 'месец',\n            MM     : sr_cyrl__translator.translate,\n            y      : 'годину',\n            yy     : sr_cyrl__translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Serbian-latin (sr)\n    //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n    var sr__translator = {\n        words: { //Different grammatical cases\n            m: ['jedan minut', 'jedne minute'],\n            mm: ['minut', 'minute', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            dd: ['dan', 'dana', 'dana'],\n            MM: ['mesec', 'meseca', 'meseci'],\n            yy: ['godina', 'godine', 'godina']\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = sr__translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return number + ' ' + sr__translator.correctGrammaticalCase(number, wordKey);\n            }\n        }\n    };\n\n    var sr = _moment__default.defineLocale('sr', {\n        months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],\n        monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],\n        weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],\n        weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],\n        weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS : 'LT:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY LT',\n            LLLL: 'dddd, D. MMMM YYYY LT'\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                case 0:\n                    return '[u] [nedelju] [u] LT';\n                case 3:\n                    return '[u] [sredu] [u] LT';\n                case 6:\n                    return '[u] [subotu] [u] LT';\n                case 1:\n                case 2:\n                case 4:\n                case 5:\n                    return '[u] dddd [u] LT';\n                }\n            },\n            lastDay  : '[juče u] LT',\n            lastWeek : function () {\n                var lastWeekDays = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT'\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'za %s',\n            past   : 'pre %s',\n            s      : 'nekoliko sekundi',\n            m      : sr__translator.translate,\n            mm     : sr__translator.translate,\n            h      : sr__translator.translate,\n            hh     : sr__translator.translate,\n            d      : 'dan',\n            dd     : sr__translator.translate,\n            M      : 'mesec',\n            MM     : sr__translator.translate,\n            y      : 'godinu',\n            yy     : sr__translator.translate\n        },\n        ordinalParse: /\\d{1,2}\\./,\n        ordinal : '%d.',\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : swedish (sv)\n    //! author : Jens Alm : https://github.com/ulmus\n\n    var sv = _moment__default.defineLocale('sv', {\n        months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n        weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n        weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'YYYY-MM-DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Idag] LT',\n            nextDay: '[Imorgon] LT',\n            lastDay: '[Igår] LT',\n            nextWeek: 'dddd LT',\n            lastWeek: '[Förra] dddd[en] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'om %s',\n            past : 'för %s sedan',\n            s : 'några sekunder',\n            m : 'en minut',\n            mm : '%d minuter',\n            h : 'en timme',\n            hh : '%d timmar',\n            d : 'en dag',\n            dd : '%d dagar',\n            M : 'en månad',\n            MM : '%d månader',\n            y : 'ett år',\n            yy : '%d år'\n        },\n        ordinalParse: /\\d{1,2}(e|a)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (~~(number % 100 / 10) === 1) ? 'e' :\n                (b === 1) ? 'a' :\n                (b === 2) ? 'a' :\n                (b === 3) ? 'e' : 'e';\n            return number + output;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : tamil (ta)\n    //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n    var ta = _moment__default.defineLocale('ta', {\n        months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n        weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),\n        weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),\n        weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY, LT',\n            LLLL : 'dddd, D MMMM YYYY, LT'\n        },\n        calendar : {\n            sameDay : '[இன்று] LT',\n            nextDay : '[நாளை] LT',\n            nextWeek : 'dddd, LT',\n            lastDay : '[நேற்று] LT',\n            lastWeek : '[கடந்த வாரம்] dddd, LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s இல்',\n            past : '%s முன்',\n            s : 'ஒரு சில விநாடிகள்',\n            m : 'ஒரு நிமிடம்',\n            mm : '%d நிமிடங்கள்',\n            h : 'ஒரு மணி நேரம்',\n            hh : '%d மணி நேரம்',\n            d : 'ஒரு நாள்',\n            dd : '%d நாட்கள்',\n            M : 'ஒரு மாதம்',\n            MM : '%d மாதங்கள்',\n            y : 'ஒரு வருடம்',\n            yy : '%d ஆண்டுகள்'\n        },\n        ordinalParse: /\\d{1,2}வது/,\n        ordinal : function (number) {\n            return number + 'வது';\n        },\n        // refer http://ta.wikipedia.org/s/1er1\n        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 2) {\n                return ' யாமம்';\n            } else if (hour < 6) {\n                return ' வைகறை';  // வைகறை\n            } else if (hour < 10) {\n                return ' காலை'; // காலை\n            } else if (hour < 14) {\n                return ' நண்பகல்'; // நண்பகல்\n            } else if (hour < 18) {\n                return ' எற்பாடு'; // எற்பாடு\n            } else if (hour < 22) {\n                return ' மாலை'; // மாலை\n            } else {\n                return ' யாமம்';\n            }\n        },\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'யாமம்') {\n                return hour < 2 ? hour : hour + 12;\n            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n                return hour;\n            } else if (meridiem === 'நண்பகல்') {\n                return hour >= 10 ? hour : hour + 12;\n            } else {\n                return hour + 12;\n            }\n        },\n        week : {\n            dow : 0, // Sunday is the first day of the week.\n            doy : 6  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : thai (th)\n    //! author : Kridsada Thanabulpong : https://github.com/sirn\n\n    var th = _moment__default.defineLocale('th', {\n        months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),\n        monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),\n        weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n        weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n        weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n        longDateFormat : {\n            LT : 'H นาฬิกา m นาที',\n            LTS : 'LT s วินาที',\n            L : 'YYYY/MM/DD',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY เวลา LT',\n            LLLL : 'วันddddที่ D MMMM YYYY เวลา LT'\n        },\n        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n        isPM: function (input) {\n            return input === 'หลังเที่ยง';\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ก่อนเที่ยง';\n            } else {\n                return 'หลังเที่ยง';\n            }\n        },\n        calendar : {\n            sameDay : '[วันนี้ เวลา] LT',\n            nextDay : '[พรุ่งนี้ เวลา] LT',\n            nextWeek : 'dddd[หน้า เวลา] LT',\n            lastDay : '[เมื่อวานนี้ เวลา] LT',\n            lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'อีก %s',\n            past : '%sที่แล้ว',\n            s : 'ไม่กี่วินาที',\n            m : '1 นาที',\n            mm : '%d นาที',\n            h : '1 ชั่วโมง',\n            hh : '%d ชั่วโมง',\n            d : '1 วัน',\n            dd : '%d วัน',\n            M : '1 เดือน',\n            MM : '%d เดือน',\n            y : '1 ปี',\n            yy : '%d ปี'\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Tagalog/Filipino (tl-ph)\n    //! author : Dan Hagman\n\n    var tl_ph = _moment__default.defineLocale('tl-ph', {\n        months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),\n        monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),\n        weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'MM/D/YYYY',\n            LL : 'MMMM D, YYYY',\n            LLL : 'MMMM D, YYYY LT',\n            LLLL : 'dddd, MMMM DD, YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Ngayon sa] LT',\n            nextDay: '[Bukas sa] LT',\n            nextWeek: 'dddd [sa] LT',\n            lastDay: '[Kahapon sa] LT',\n            lastWeek: 'dddd [huling linggo] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'sa loob ng %s',\n            past : '%s ang nakalipas',\n            s : 'ilang segundo',\n            m : 'isang minuto',\n            mm : '%d minuto',\n            h : 'isang oras',\n            hh : '%d oras',\n            d : 'isang araw',\n            dd : '%d araw',\n            M : 'isang buwan',\n            MM : '%d buwan',\n            y : 'isang taon',\n            yy : '%d taon'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : turkish (tr)\n    //! authors : Erhan Gundogan : https://github.com/erhangundogan,\n    //!           Burak Yiğit Kaya: https://github.com/BYK\n\n    var tr__suffixes = {\n        1: '\\'inci',\n        5: '\\'inci',\n        8: '\\'inci',\n        70: '\\'inci',\n        80: '\\'inci',\n        2: '\\'nci',\n        7: '\\'nci',\n        20: '\\'nci',\n        50: '\\'nci',\n        3: '\\'üncü',\n        4: '\\'üncü',\n        100: '\\'üncü',\n        6: '\\'ncı',\n        9: '\\'uncu',\n        10: '\\'uncu',\n        30: '\\'uncu',\n        60: '\\'ıncı',\n        90: '\\'ıncı'\n    };\n\n    var tr = _moment__default.defineLocale('tr', {\n        months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n        monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n        weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),\n        weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n        weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd, D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay : '[bugün saat] LT',\n            nextDay : '[yarın saat] LT',\n            nextWeek : '[haftaya] dddd [saat] LT',\n            lastDay : '[dün] LT',\n            lastWeek : '[geçen hafta] dddd [saat] LT',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : '%s sonra',\n            past : '%s önce',\n            s : 'birkaç saniye',\n            m : 'bir dakika',\n            mm : '%d dakika',\n            h : 'bir saat',\n            hh : '%d saat',\n            d : 'bir gün',\n            dd : '%d gün',\n            M : 'bir ay',\n            MM : '%d ay',\n            y : 'bir yıl',\n            yy : '%d yıl'\n        },\n        ordinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n        ordinal : function (number) {\n            if (number === 0) {  // special case for zero\n                return number + '\\'ıncı';\n            }\n            var a = number % 10,\n                b = number % 100 - a,\n                c = number >= 100 ? 100 : null;\n            return number + (tr__suffixes[a] || tr__suffixes[b] || tr__suffixes[c]);\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var tzm_latn = _moment__default.defineLocale('tzm-latn', {\n        months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n        weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[asdkh g] LT',\n            nextDay: '[aska g] LT',\n            nextWeek: 'dddd [g] LT',\n            lastDay: '[assant g] LT',\n            lastWeek: 'dddd [g] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'dadkh s yan %s',\n            past : 'yan %s',\n            s : 'imik',\n            m : 'minuḍ',\n            mm : '%d minuḍ',\n            h : 'saɛa',\n            hh : '%d tassaɛin',\n            d : 'ass',\n            dd : '%d ossan',\n            M : 'ayowr',\n            MM : '%d iyyirn',\n            y : 'asgas',\n            yy : '%d isgasn'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : Morocco Central Atlas Tamaziɣt (tzm)\n    //! author : Abdel Said : https://github.com/abdelsaid\n\n    var tzm = _moment__default.defineLocale('tzm', {\n        months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n        weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS: 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'dddd D MMMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n            nextWeek: 'dddd [ⴴ] LT',\n            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n            lastWeek: 'dddd [ⴴ] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n            past : 'ⵢⴰⵏ %s',\n            s : 'ⵉⵎⵉⴽ',\n            m : 'ⵎⵉⵏⵓⴺ',\n            mm : '%d ⵎⵉⵏⵓⴺ',\n            h : 'ⵙⴰⵄⴰ',\n            hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n            d : 'ⴰⵙⵙ',\n            dd : '%d oⵙⵙⴰⵏ',\n            M : 'ⴰⵢoⵓⵔ',\n            MM : '%d ⵉⵢⵢⵉⵔⵏ',\n            y : 'ⴰⵙⴳⴰⵙ',\n            yy : '%d ⵉⵙⴳⴰⵙⵏ'\n        },\n        week : {\n            dow : 6, // Saturday is the first day of the week.\n            doy : 12  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : ukrainian (uk)\n    //! author : zemlanin : https://github.com/zemlanin\n    //! Author : Menelion Elensúle : https://github.com/Oire\n\n    function uk__plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n    }\n    function uk__relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            'mm': 'хвилина_хвилини_хвилин',\n            'hh': 'година_години_годин',\n            'dd': 'день_дні_днів',\n            'MM': 'місяць_місяці_місяців',\n            'yy': 'рік_роки_років'\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвилина' : 'хвилину';\n        }\n        else if (key === 'h') {\n            return withoutSuffix ? 'година' : 'годину';\n        }\n        else {\n            return number + ' ' + uk__plural(format[key], +number);\n        }\n    }\n    function uk__monthsCaseReplace(m, format) {\n        var months = {\n            'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),\n            'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')\n        },\n        nounCase = (/D[oD]? *MMMM?/).test(format) ?\n            'accusative' :\n            'nominative';\n        return months[nounCase][m.month()];\n    }\n    function uk__weekdaysCaseReplace(m, format) {\n        var weekdays = {\n            'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n            'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n            'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n        },\n        nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n            'accusative' :\n            ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n                'genitive' :\n                'nominative');\n        return weekdays[nounCase][m.day()];\n    }\n    function processHoursFunction(str) {\n        return function () {\n            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n        };\n    }\n\n    var uk = _moment__default.defineLocale('uk', {\n        months : uk__monthsCaseReplace,\n        monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n        weekdays : uk__weekdaysCaseReplace,\n        weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD.MM.YYYY',\n            LL : 'D MMMM YYYY р.',\n            LLL : 'D MMMM YYYY р., LT',\n            LLLL : 'dddd, D MMMM YYYY р., LT'\n        },\n        calendar : {\n            sameDay: processHoursFunction('[Сьогодні '),\n            nextDay: processHoursFunction('[Завтра '),\n            lastDay: processHoursFunction('[Вчора '),\n            nextWeek: processHoursFunction('[У] dddd ['),\n            lastWeek: function () {\n                switch (this.day()) {\n                case 0:\n                case 3:\n                case 5:\n                case 6:\n                    return processHoursFunction('[Минулої] dddd [').call(this);\n                case 1:\n                case 2:\n                case 4:\n                    return processHoursFunction('[Минулого] dddd [').call(this);\n                }\n            },\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : 'за %s',\n            past : '%s тому',\n            s : 'декілька секунд',\n            m : uk__relativeTimeWithPlural,\n            mm : uk__relativeTimeWithPlural,\n            h : 'годину',\n            hh : uk__relativeTimeWithPlural,\n            d : 'день',\n            dd : uk__relativeTimeWithPlural,\n            M : 'місяць',\n            MM : uk__relativeTimeWithPlural,\n            y : 'рік',\n            yy : uk__relativeTimeWithPlural\n        },\n        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n        meridiemParse: /ночі|ранку|дня|вечора/,\n        isPM: function (input) {\n            return /^(дня|вечора)$/.test(input);\n        },\n        meridiem : function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночі';\n            } else if (hour < 12) {\n                return 'ранку';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечора';\n            }\n        },\n        ordinalParse: /\\d{1,2}-(й|го)/,\n        ordinal: function (number, period) {\n            switch (period) {\n            case 'M':\n            case 'd':\n            case 'DDD':\n            case 'w':\n            case 'W':\n                return number + '-й';\n            case 'D':\n                return number + '-го';\n            default:\n                return number;\n            }\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 1st is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : uzbek (uz)\n    //! author : Sardor Muminov : https://github.com/muminoff\n\n    var uz = _moment__default.defineLocale('uz', {\n        months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n        monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n        weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n        weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM YYYY',\n            LLL : 'D MMMM YYYY LT',\n            LLLL : 'D MMMM YYYY, dddd LT'\n        },\n        calendar : {\n            sameDay : '[Бугун соат] LT [да]',\n            nextDay : '[Эртага] LT [да]',\n            nextWeek : 'dddd [куни соат] LT [да]',\n            lastDay : '[Кеча соат] LT [да]',\n            lastWeek : '[Утган] dddd [куни соат] LT [да]',\n            sameElse : 'L'\n        },\n        relativeTime : {\n            future : 'Якин %s ичида',\n            past : 'Бир неча %s олдин',\n            s : 'фурсат',\n            m : 'бир дакика',\n            mm : '%d дакика',\n            h : 'бир соат',\n            hh : '%d соат',\n            d : 'бир кун',\n            dd : '%d кун',\n            M : 'бир ой',\n            MM : '%d ой',\n            y : 'бир йил',\n            yy : '%d йил'\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 7  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : vietnamese (vi)\n    //! author : Bang Nguyen : https://github.com/bangnk\n\n    var vi = _moment__default.defineLocale('vi', {\n        months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n        monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n        weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),\n        weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        longDateFormat : {\n            LT : 'HH:mm',\n            LTS : 'LT:ss',\n            L : 'DD/MM/YYYY',\n            LL : 'D MMMM [năm] YYYY',\n            LLL : 'D MMMM [năm] YYYY LT',\n            LLLL : 'dddd, D MMMM [năm] YYYY LT',\n            l : 'DD/M/YYYY',\n            ll : 'D MMM YYYY',\n            lll : 'D MMM YYYY LT',\n            llll : 'ddd, D MMM YYYY LT'\n        },\n        calendar : {\n            sameDay: '[Hôm nay lúc] LT',\n            nextDay: '[Ngày mai lúc] LT',\n            nextWeek: 'dddd [tuần tới lúc] LT',\n            lastDay: '[Hôm qua lúc] LT',\n            lastWeek: 'dddd [tuần rồi lúc] LT',\n            sameElse: 'L'\n        },\n        relativeTime : {\n            future : '%s tới',\n            past : '%s trước',\n            s : 'vài giây',\n            m : 'một phút',\n            mm : '%d phút',\n            h : 'một giờ',\n            hh : '%d giờ',\n            d : 'một ngày',\n            dd : '%d ngày',\n            M : 'một tháng',\n            MM : '%d tháng',\n            y : 'một năm',\n            yy : '%d năm'\n        },\n        ordinalParse: /\\d{1,2}/,\n        ordinal : function (number) {\n            return number;\n        },\n        week : {\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : chinese (zh-cn)\n    //! author : suupic : https://github.com/suupic\n    //! author : Zeno Zeng : https://github.com/zenozeng\n\n    var zh_cn = _moment__default.defineLocale('zh-cn', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah点mm',\n            LTS : 'Ah点m分s秒',\n            L : 'YYYY-MM-DD',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY-MM-DD',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' ||\n                    meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            } else {\n                // '中午'\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : function () {\n                return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';\n            },\n            nextDay : function () {\n                return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';\n            },\n            lastDay : function () {\n                return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';\n            },\n            nextWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = _moment__default().startOf('week');\n                prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            lastWeek : function () {\n                var startOfWeek, prefix;\n                startOfWeek = _moment__default().startOf('week');\n                prefix = this.unix() < startOfWeek.unix()  ? '[上]' : '[本]';\n                return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n            },\n            sameElse : 'LL'\n        },\n        ordinalParse: /\\d{1,2}(日|月|周)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd':\n            case 'D':\n            case 'DDD':\n                return number + '日';\n            case 'M':\n                return number + '月';\n            case 'w':\n            case 'W':\n                return number + '周';\n            default:\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s内',\n            past : '%s前',\n            s : '几秒',\n            m : '1分钟',\n            mm : '%d分钟',\n            h : '1小时',\n            hh : '%d小时',\n            d : '1天',\n            dd : '%d天',\n            M : '1个月',\n            MM : '%d个月',\n            y : '1年',\n            yy : '%d年'\n        },\n        week : {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow : 1, // Monday is the first day of the week.\n            doy : 4  // The week that contains Jan 4th is the first week of the year.\n        }\n    });\n\n    //! moment.js locale configuration\n    //! locale : traditional chinese (zh-tw)\n    //! author : Ben : https://github.com/ben-lin\n\n    var zh_tw = _moment__default.defineLocale('zh-tw', {\n        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat : {\n            LT : 'Ah點mm',\n            LTS : 'Ah點m分s秒',\n            L : 'YYYY年MMMD日',\n            LL : 'YYYY年MMMD日',\n            LLL : 'YYYY年MMMD日LT',\n            LLLL : 'YYYY年MMMD日ddddLT',\n            l : 'YYYY年MMMD日',\n            ll : 'YYYY年MMMD日',\n            lll : 'YYYY年MMMD日LT',\n            llll : 'YYYY年MMMD日ddddLT'\n        },\n        meridiemParse: /早上|上午|中午|下午|晚上/,\n        meridiemHour : function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem : function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar : {\n            sameDay : '[今天]LT',\n            nextDay : '[明天]LT',\n            nextWeek : '[下]ddddLT',\n            lastDay : '[昨天]LT',\n            lastWeek : '[上]ddddLT',\n            sameElse : 'L'\n        },\n        ordinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal : function (number, period) {\n            switch (period) {\n            case 'd' :\n            case 'D' :\n            case 'DDD' :\n                return number + '日';\n            case 'M' :\n                return number + '月';\n            case 'w' :\n            case 'W' :\n                return number + '週';\n            default :\n                return number;\n            }\n        },\n        relativeTime : {\n            future : '%s內',\n            past : '%s前',\n            s : '幾秒',\n            m : '一分鐘',\n            mm : '%d分鐘',\n            h : '一小時',\n            hh : '%d小時',\n            d : '一天',\n            dd : '%d天',\n            M : '一個月',\n            MM : '%d個月',\n            y : '一年',\n            yy : '%d年'\n        }\n    });\n\n    var moment_with_locales = _moment__default;\n\n    return moment_with_locales;\n\n}));"
  },
  {
    "path": "www/lib/moment/min/tests.js",
    "content": "\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('af');\n\n    test('parse', function (assert) {\n        var tests = 'Januarie Jan_Februarie Feb_Maart Mar_April Apr_Mei Mei_Junie Jun_Julie Jul_Augustus Aug_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sondag, Februarie 14de 2010, 3:25:50 nm'],\n                ['ddd, hA',                            'Son, 3NM'],\n                ['M Mo MM MMMM MMM',                   '2 2de 02 Februarie Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14de 14'],\n                ['d do dddd ddd dd',                   '0 0de Sondag Son So'],\n                ['DDD DDDo DDDD',                      '45 45ste 045'],\n                ['w wo ww',                            '6 6de 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'nm NM'],\n                ['[the] DDDo [day of the year]',       'the 45ste day of the year'],\n                ['LT',                                 '15:25'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Februarie 2010'],\n                ['LLL',                                '14 Februarie 2010 15:25'],\n                ['LLLL',                               'Sondag, 14 Februarie 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb 2010'],\n                ['lll',                                '14 Feb 2010 15:25'],\n                ['llll',                               'Son, 14 Feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Januarie Jan_Februarie Feb_Maart Mar_April Apr_Mei Mei_Junie Jun_Julie Jul_Augustus Aug_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sondag Son So_Maandag Maa Ma_Dinsdag Din Di_Woensdag Woe Wo_Donderdag Don Do_Vrydag Vry Vr_Saterdag Sat Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '\\'n paar sekondes', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '\\'n minuut',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '\\'n minuut',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minute',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minute',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '\\'n uur',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '\\'n uur',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ure',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ure',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ure',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '\\'n dag',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '\\'n dag',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dae',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '\\'n dag',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dae',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dae',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '\\'n maand',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '\\'n maand',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '\\'n maand',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 maande',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 maande',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 maande',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '\\'n maand',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 maande',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '\\'n jaar',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaar',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '\\'n jaar',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 jaar',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'oor \\'n paar sekondes',  'prefix');\n        assert.equal(moment(0).from(30000), '\\'n paar sekondes gelede', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), '\\'n paar sekondes gelede',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'oor \\'n paar sekondes', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'oor 5 dae', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                   'Vandag om 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Vandag om 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Vandag om 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Môre om 02:00',    'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Vandag om 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Gister om 02:00',   'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Laas] dddd [om] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Laas] dddd [om] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Laas] dddd [om] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52ste', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1ste', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1ste', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),    '2 02 2de', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),    '2 02 2de', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ar-ma');\n\n    test('parse', function (assert) {\n        var tests = 'يناير:يناير_فبراير:فبراير_مارس:مارس_أبريل:أبريل_ماي:ماي_يونيو:يونيو_يوليوز:يوليوز_غشت:غشت_شتنبر:شتنبر_أكتوبر:أكتوبر_نونبر:نونبر_دجنبر:دجنبر'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(':');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'الأحد, فبراير 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'احد, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 فبراير فبراير'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 الأحد احد ح'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LT',                                 '15:25'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 فبراير 2010'],\n                ['LLL',                                '14 فبراير 2010 15:25'],\n                ['LLLL',                               'الأحد 14 فبراير 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 فبراير 2010'],\n                ['lll',                                '14 فبراير 2010 15:25'],\n                ['llll',                               'احد 14 فبراير 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'يناير يناير_فبراير فبراير_مارس مارس_أبريل أبريل_ماي ماي_يونيو يونيو_يوليوز يوليوز_غشت غشت_شتنبر شتنبر_أكتوبر أكتوبر_نونبر نونبر_دجنبر دجنبر'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'الأحد احد ح_الإتنين اتنين ن_الثلاثاء ثلاثاء ث_الأربعاء اربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ثوان', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'دقيقة',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'دقيقة',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 دقائق',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 دقائق',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ساعة',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ساعة',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ساعات',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ساعات',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ساعات',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'يوم',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'يوم',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 أيام',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'يوم',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 أيام',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 أيام',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'شهر',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'شهر',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'شهر',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 أشهر',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 أشهر',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 أشهر',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'شهر',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 أشهر',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'سنة',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 سنوات',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'سنة',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 سنوات',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'في ثوان',  'prefix');\n        assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'منذ ثوان',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'في ثوان', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'في 5 أيام', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'اليوم على الساعة 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'اليوم على الساعة 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'اليوم على الساعة 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'غدا على الساعة 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'اليوم على الساعة 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'أمس على الساعة 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '1 01 1', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '2 02 2', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ar-sa');\n\n    test('parse', function (assert) {\n        var tests = 'يناير:يناير_فبراير:فبراير_مارس:مارس_أبريل:أبريل_مايو:مايو_يونيو:يونيو_يوليو:يوليو_أغسطس:أغسطس_سبتمبر:سبتمبر_أكتوبر:أكتوبر_نوفمبر:نوفمبر_ديسمبر:ديسمبر'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month());\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(':');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'الأحد، فبراير ١٤ ٢٠١٠، ٣:٢٥:٥٠ م'],\n                ['ddd, hA',                            'أحد، ٣م'],\n                ['M Mo MM MMMM MMM',                   '٢ ٢ ٠٢ فبراير فبراير'],\n                ['YYYY YY',                            '٢٠١٠ ١٠'],\n                ['D Do DD',                            '١٤ ١٤ ١٤'],\n                ['d do dddd ddd dd',                   '٠ ٠ الأحد أحد ح'],\n                ['DDD DDDo DDDD',                      '٤٥ ٤٥ ٠٤٥'],\n                ['w wo ww',                            '٨ ٨ ٠٨'],\n                ['h hh',                               '٣ ٠٣'],\n                ['H HH',                               '١٥ ١٥'],\n                ['m mm',                               '٢٥ ٢٥'],\n                ['s ss',                               '٥٠ ٥٠'],\n                ['a A',                                'م م'],\n                ['[the] DDDo [day of the year]',       'the ٤٥ day of the year'],\n                ['LT',                                 '١٥:٢٥'],\n                ['LTS',                                '١٥:٢٥:٥٠'],\n                ['L',                                  '١٤/٠٢/٢٠١٠'],\n                ['LL',                                 '١٤ فبراير ٢٠١٠'],\n                ['LLL',                                '١٤ فبراير ٢٠١٠ ١٥:٢٥'],\n                ['LLLL',                               'الأحد ١٤ فبراير ٢٠١٠ ١٥:٢٥'],\n                ['l',                                  '١٤/٢/٢٠١٠'],\n                ['ll',                                 '١٤ فبراير ٢٠١٠'],\n                ['lll',                                '١٤ فبراير ٢٠١٠ ١٥:٢٥'],\n                ['llll',                               'أحد ١٤ فبراير ٢٠١٠ ١٥:٢٥']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '١', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '٢', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '٣', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '٤', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '٥', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '٦', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '٧', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '٨', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '٩', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '١٠', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '١١', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '١٢', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '١٣', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '١٤', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '١٥', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '١٦', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '١٧', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '١٨', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '١٩', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '٢٠', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '٢١', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '٢٢', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '٢٣', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '٢٤', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '٢٥', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '٢٦', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '٢٧', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '٢٨', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '٢٩', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '٣٠', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '٣١', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'يناير يناير_فبراير فبراير_مارس مارس_أبريل أبريل_مايو مايو_يونيو يونيو_يوليو يوليو_أغسطس أغسطس_سبتمبر سبتمبر_أكتوبر أكتوبر_نوفمبر نوفمبر_ديسمبر ديسمبر'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ثوان', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'دقيقة',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'دقيقة',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '٢ دقائق',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '٤٤ دقائق',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ساعة',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ساعة',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '٢ ساعات',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '٥ ساعات',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '٢١ ساعات',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'يوم',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'يوم',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '٢ أيام',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'يوم',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '٥ أيام',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '٢٥ أيام',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'شهر',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'شهر',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'شهر',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '٢ أشهر',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '٢ أشهر',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '٣ أشهر',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'شهر',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '٥ أشهر',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'سنة',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '٢ سنوات',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'سنة',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '٥ سنوات',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'في ثوان',  'prefix');\n        assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'منذ ثوان',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'في ثوان', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'في ٥ أيام', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'اليوم على الساعة ٠٢:٠٠',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'اليوم على الساعة ٠٢:٢٥',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'اليوم على الساعة ٠٣:٠٠',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'غدا على الساعة ٠٢:٠٠',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'اليوم على الساعة ٠١:٠٠',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'أمس على الساعة ٠٢:٠٠', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [على الساعة] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n\n        assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');\n        assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');\n        assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', 'Saturday of week 1 of 2003 parsed should be formatted as 2003 1 6');\n        assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '١ ٠١ ١', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ar-tn');\n\n    test('parse', function (assert) {\n        var tests = 'جانفي:جانفي_فيفري:فيفري_مارس:مارس_أفريل:أفريل_ماي:ماي_جوان:جوان_جويلية:جويلية_أوت:أوت_سبتمبر:سبتمبر_أكتوبر:أكتوبر_نوفمبر:نوفمبر_ديسمبر:ديسمبر'.split('_'),\n            i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(':');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a', 'الأحد, فيفري 14 2010, 3:25:50 pm'],\n                ['ddd, hA', 'أحد, 3PM'],\n                ['M Mo MM MMMM MMM', '2 2 02 فيفري فيفري'],\n                ['YYYY YY', '2010 10'],\n                ['D Do DD', '14 14 14'],\n                ['d do dddd ddd dd', '0 0 الأحد أحد ح'],\n                ['DDD DDDo DDDD', '45 45 045'],\n                ['w wo ww', '6 6 06'],\n                ['h hh', '3 03'],\n                ['H HH', '15 15'],\n                ['m mm', '25 25'],\n                ['s ss', '50 50'],\n                ['a A', 'pm PM'],\n                ['[the] DDDo [day of the year]', 'the 45 day of the year'],\n                ['LT', '15:25'],\n                ['LTS', '15:25:50'],\n                ['L', '14/02/2010'],\n                ['LL', '14 فيفري 2010'],\n                ['LLL', '14 فيفري 2010 15:25'],\n                ['LLLL', 'الأحد 14 فيفري 2010 15:25'],\n                ['l', '14/2/2010'],\n                ['ll', '14 فيفري 2010'],\n                ['lll', '14 فيفري 2010 15:25'],\n                ['llll', 'أحد 14 فيفري 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'جانفي جانفي_فيفري فيفري_مارس مارس_أفريل أفريل_ماي ماي_جوان جوان_جويلية جويلية_أوت أوت_سبتمبر سبتمبر_أكتوبر أكتوبر_نوفمبر نوفمبر_ديسمبر ديسمبر'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 44\n        }), true), 'ثوان', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 45\n        }), true), 'دقيقة', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 89\n        }), true), 'دقيقة', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 90\n        }), true), '2 دقائق', '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 44\n        }), true), '44 دقائق', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 45\n        }), true), 'ساعة', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 89\n        }), true), 'ساعة', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 90\n        }), true), '2 ساعات', '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 5\n        }), true), '5 ساعات', '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 21\n        }), true), '21 ساعات', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 22\n        }), true), 'يوم', '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 35\n        }), true), 'يوم', '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 36\n        }), true), '2 أيام', '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 1\n        }), true), 'يوم', '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 5\n        }), true), '5 أيام', '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 25\n        }), true), '25 أيام', '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 26\n        }), true), 'شهر', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 30\n        }), true), 'شهر', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 43\n        }), true), 'شهر', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 46\n        }), true), '2 أشهر', '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 74\n        }), true), '2 أشهر', '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 76\n        }), true), '3 أشهر', '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            M: 1\n        }), true), 'شهر', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            M: 5\n        }), true), '5 أشهر', '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 345\n        }), true), 'سنة', '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 548\n        }), true), '2 سنوات', '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            y: 1\n        }), true), 'سنة', '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            y: 5\n        }), true), '5 سنوات', '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'في ثوان', 'prefix');\n        assert.equal(moment(0).from(30000), 'منذ ثوان', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'منذ ثوان', 'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({\n            s: 30\n        }).fromNow(), 'في ثوان', 'in a few seconds');\n        assert.equal(moment().add({\n            d: 5\n        }).fromNow(), 'في 5 أيام', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(), 'اليوم على الساعة 02:00', 'today at the same time');\n        assert.equal(moment(a).add({\n            m: 25\n        }).calendar(), 'اليوم على الساعة 02:25', 'Now plus 25 min');\n        assert.equal(moment(a).add({\n            h: 1\n        }).calendar(), 'اليوم على الساعة 03:00', 'Now plus 1 hour');\n        assert.equal(moment(a).add({\n            d: 1\n        }).calendar(), 'غدا على الساعة 02:00', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({\n            h: 1\n        }).calendar(), 'اليوم على الساعة 01:00', 'Now minus 1 hour');\n        assert.equal(moment(a).subtract({\n            d: 1\n        }).calendar(), 'أمس على الساعة 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd [على الساعة] LT'), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({\n                w: 1\n            }),\n            weeksFromNow = moment().add({\n                w: 1\n            });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week');\n\n        weeksAgo = moment().subtract({\n            w: 2\n        });\n        weeksFromNow = moment().add({\n            w: 2\n        });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'), '1 01 1', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '1 01 1', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ar');\n\n    var months = [\n        'كانون الثاني يناير',\n        'شباط فبراير',\n        'آذار مارس',\n        'نيسان أبريل',\n        'أيار مايو',\n        'حزيران يونيو',\n        'تموز يوليو',\n        'آب أغسطس',\n        'أيلول سبتمبر',\n        'تشرين الأول أكتوبر',\n        'تشرين الثاني نوفمبر',\n        'كانون الأول ديسمبر'\n    ];\n\n    test('parse', function (assert) {\n        var tests = months, i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month());\n        }\n        for (i = 0; i < 12; i++) {\n            equalTest(tests[i], 'MMM', i);\n            equalTest(tests[i], 'MMM', i);\n            equalTest(tests[i], 'MMMM', i);\n            equalTest(tests[i], 'MMMM', i);\n            equalTest(tests[i].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'الأحد، شباط فبراير ١٤ ٢٠١٠، ٣:٢٥:٥٠ م'],\n                ['ddd, hA',                            'أحد، ٣م'],\n                ['M Mo MM MMMM MMM',                   '٢ ٢ ٠٢ شباط فبراير شباط فبراير'],\n                ['YYYY YY',                            '٢٠١٠ ١٠'],\n                ['D Do DD',                            '١٤ ١٤ ١٤'],\n                ['d do dddd ddd dd',                   '٠ ٠ الأحد أحد ح'],\n                ['DDD DDDo DDDD',                      '٤٥ ٤٥ ٠٤٥'],\n                ['w wo ww',                            '٨ ٨ ٠٨'],\n                ['h hh',                               '٣ ٠٣'],\n                ['H HH',                               '١٥ ١٥'],\n                ['m mm',                               '٢٥ ٢٥'],\n                ['s ss',                               '٥٠ ٥٠'],\n                ['a A',                                'م م'],\n                ['[the] DDDo [day of the year]',       'the ٤٥ day of the year'],\n                ['LT',                                 '١٥:٢٥'],\n                ['LTS',                                '١٥:٢٥:٥٠'],\n                ['L',                                  '١٤/٠٢/٢٠١٠'],\n                ['LL',                                 '١٤ شباط فبراير ٢٠١٠'],\n                ['LLL',                                '١٤ شباط فبراير ٢٠١٠ ١٥:٢٥'],\n                ['LLLL',                               'الأحد ١٤ شباط فبراير ٢٠١٠ ١٥:٢٥'],\n                ['l',                                  '١٤/٢/٢٠١٠'],\n                ['ll',                                 '١٤ شباط فبراير ٢٠١٠'],\n                ['lll',                                '١٤ شباط فبراير ٢٠١٠ ١٥:٢٥'],\n                ['llll',                               'أحد ١٤ شباط فبراير ٢٠١٠ ١٥:٢٥']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '١', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '٢', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '٣', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '٤', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '٥', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '٦', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '٧', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '٨', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '٩', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '١٠', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '١١', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '١٢', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '١٣', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '١٤', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '١٥', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '١٦', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '١٧', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '١٨', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '١٩', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '٢٠', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '٢١', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '٢٢', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '٢٣', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '٢٤', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '٢٥', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '٢٦', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '٢٧', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '٢٨', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '٢٩', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '٣٠', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '٣١', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = months, i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM'), expected[i], expected[i]);\n            assert.equal(moment([2011, i, 1]).format('MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'الأحد أحد ح_الإثنين إثنين ن_الثلاثاء ثلاثاء ث_الأربعاء أربعاء ر_الخميس خميس خ_الجمعة جمعة ج_السبت سبت س'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '٤٤ ثانية', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'دقيقة واحدة',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'دقيقة واحدة',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  'دقيقتان',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '٤٤ دقيقة',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ساعة واحدة',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ساعة واحدة',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  'ساعتان',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '٥ ساعات',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '٢١ ساعة',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'يوم واحد',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'يوم واحد',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  'يومان',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'يوم واحد',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '٥ أيام',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '٢٥ يومًا',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'شهر واحد',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'شهر واحد',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'شهر واحد',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  'شهران',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  'شهران',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '٣ أشهر',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'شهر واحد',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '٥ أشهر',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'عام واحد',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'عامان',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'عام واحد',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '٥ أعوام',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'بعد ٣٠ ثانية',  'prefix');\n        assert.equal(moment(0).from(30000), 'منذ ٣٠ ثانية', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'منذ ثانية واحدة',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'بعد ٣٠ ثانية', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'بعد ٥ أيام', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'اليوم عند الساعة ٠٢:٠٠',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'اليوم عند الساعة ٠٢:٢٥',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'اليوم عند الساعة ٠٣:٠٠',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'غدًا عند الساعة ٠٢:٠٠',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'اليوم عند الساعة ٠١:٠٠',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'أمس عند الساعة ٠٢:٠٠', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [عند الساعة] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n\n        assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');\n        assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002');\n        assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', 'Saturday of week 1 of 2003 parsed should be formatted as 2003 1 6');\n        assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '١ ٠١ ١', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('az');\n\n    test('parse', function (assert) {\n        var tests = 'yanvar yan_fevral fev_mart mar_Aprel apr_may may_iyun iyn_iyul iyl_Avqust avq_sentyabr sen_oktyabr okt_noyabr noy_dekabr dek'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, D MMMM YYYY, HH:mm:ss',        'Bazar, 14 fevral 2010, 15:25:50'],\n                ['ddd, A h',                           'Baz, gündüz 3'],\n                ['M Mo MM MMMM MMM',                   '2 2-nci 02 fevral fev'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-üncü 14'],\n                ['d do dddd ddd dd',                   '0 0-ıncı Bazar Baz Bz'],\n                ['DDD DDDo DDDD',                      '45 45-inci 045'],\n                ['w wo ww',                            '7 7-nci 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'gündüz gündüz'],\n                ['[ilin] DDDo [günü]',                 'ilin 45-inci günü'],\n                ['LT',                                 '15:25'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 fevral 2010'],\n                ['LLL',                                '14 fevral 2010 15:25'],\n                ['LLLL',                               'Bazar, 14 fevral 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 fev 2010'],\n                ['lll',                                '14 fev 2010 15:25'],\n                ['llll',                               'Baz, 14 fev 2010 15:25']\n            ],\n            DDDo = [\n                [359, '360-ıncı'],\n                [199, '200-üncü'],\n                [149, '150-nci']\n            ],\n            dt = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            DDDoDt,\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(dt.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n        for (i = 0; i < DDDo.length; i++) {\n            DDDoDt = moment([2010]);\n            assert.equal(DDDoDt.add(DDDo[i][0], 'days').format('DDDo'), DDDo[i][1], DDDo[i][0] + ' ---> ' + DDDo[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-inci', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-nci', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-üncü', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-üncü', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-inci', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ncı', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-nci', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-inci', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-uncu', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-uncu', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-inci', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-nci', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-üncü', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-üncü', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-inci', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ncı', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-nci', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-inci', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-uncu', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-nci', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-inci', '21th');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-nci', '22th');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-üncü', '23th');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-üncü', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-inci', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ncı', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-nci', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-inci', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-uncu', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-uncu', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-inci', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'yanvar yan_fevral fev_mart mar_aprel apr_may may_iyun iyn_iyul iyl_avqust avq_sentyabr sen_oktyabr okt_noyabr noy_dekabr dek'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Bazar Baz Bz_Bazar ertəsi BzE BE_Çərşənbə axşamı ÇAx ÇA_Çərşənbə Çər Çə_Cümə axşamı CAx CA_Cümə Cüm Cü_Şənbə Şən Şə'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'birneçə saniyyə', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'bir dəqiqə',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'bir dəqiqə',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 dəqiqə',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 dəqiqə',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'bir saat',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'bir saat',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 saat',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 saat',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 saat',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'bir gün',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'bir gün',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 gün',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'bir gün',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 gün',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 gün',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'bir ay',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'bir ay',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 ay',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 ay',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 ay',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'bir ay',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 ay',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'bir il',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 il',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'bir il',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 il',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'birneçə saniyyə sonra',  'prefix');\n        assert.equal(moment(0).from(30000), 'birneçə saniyyə əvvəl', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'birneçə saniyyə əvvəl',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'birneçə saniyyə sonra', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 gün sonra', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'bugün saat 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'bugün saat 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'bugün saat 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'sabah saat 02:00',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'bugün saat 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'dünən 02:00',          'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[gələn həftə] dddd [saat] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[gələn həftə] dddd [saat] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[gələn həftə] dddd [saat] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[keçən həftə] dddd [saat] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[keçən həftə] dddd [saat] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[keçən həftə] dddd [saat] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-inci', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-inci', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-nci', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-nci', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-üncü', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('be');\n\n    test('parse', function (assert) {\n        var tests = 'студзень студ_люты лют_сакавік сак_красавік крас_травень трав_чэрвень чэрв_ліпень ліп_жнівень жнів_верасень вер_кастрычнік каст_лістапад ліст_снежань снеж'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, HH:mm:ss',       'нядзеля, 14-га лютага 2010, 15:25:50'],\n                ['ddd, h A',                           'нд, 3 дня'],\n                ['M Mo MM MMMM MMM',                   '2 2-і 02 люты лют'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-га 14'],\n                ['d do dddd ddd dd',                   '0 0-ы нядзеля нд нд'],\n                ['DDD DDDo DDDD',                      '45 45-ы 045'],\n                ['w wo ww',                            '7 7-ы 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'дня дня'],\n                ['DDDo [дзень года]',                   '45-ы дзень года'],\n                ['LT',                                 '15:25'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 лютага 2010 г.'],\n                ['LLL',                                '14 лютага 2010 г., 15:25'],\n                ['LLLL',                               'нядзеля, 14 лютага 2010 г., 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 лют 2010 г.'],\n                ['lll',                                '14 лют 2010 г., 15:25'],\n                ['llll',                               'нд, 14 лют 2010 г., 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format meridiem', function (assert) {\n        assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночы', 'night');\n        assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночы', 'night');\n        assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'раніцы', 'morning');\n        assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'раніцы', 'morning');\n        assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'вечара', 'evening');\n        assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечара', 'evening');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ы', '1-ы');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-і', '2-і');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-і', '3-і');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ы', '4-ы');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ы', '5-ы');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ы', '6-ы');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ы', '7-ы');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ы', '8-ы');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-ы', '9-ы');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-ы', '10-ы');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ы', '11-ы');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ы', '12-ы');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ы', '13-ы');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ы', '14-ы');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ы', '15-ы');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ы', '16-ы');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ы', '17-ы');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ы', '18-ы');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-ы', '19-ы');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-ы', '20-ы');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ы', '21-ы');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-і', '22-і');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-і', '23-і');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ы', '24-ы');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ы', '25-ы');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ы', '26-ы');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ы', '27-ы');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ы', '28-ы');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ы', '29-ы');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ы', '30-ы');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ы', '31-ы');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'студзень студ_люты лют_сакавік сак_красавік крас_травень трав_чэрвень чэрв_ліпень ліп_жнівень жнів_верасень вер_кастрычнік каст_лістапад ліст_снежань снеж'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format month case', function (assert) {\n        var months = {\n            'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n            'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]);\n        }\n    });\n\n    test('format month case with escaped symbols', function (assert) {\n        var months = {\n            'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n            'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('[<i>]D[</i>] [<b>]MMMM[</b>]'), '<i>1</i> <b>' + months.accusative[i] + '</b>', '1 <b>' + months.accusative[i] + '</b>');\n            assert.equal(moment([2013, i, 1]).format('D[-ы дзень] MMMM'), '1-ы дзень ' + months.accusative[i], '1-ы дзень ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'нядзеля нд нд_панядзелак пн пн_аўторак ат ат_серада ср ср_чацвер чц чц_пятніца пт пт_субота сб сб'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'некалькі секунд',    '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'хвіліна',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'хвіліна',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 хвіліны',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 31}), true),  '31 хвіліна',  '31 minutes = 31 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 хвіліны', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'гадзіна',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'гадзіна',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 гадзіны',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 гадзін',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 гадзіна',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'дзень',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'дзень',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дні',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'дзень',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 дзён',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true),  '11 дзён',     '11 days = 11 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true),  '21 дзень',     '21 days = 21 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 дзён',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'месяц',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'месяц',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'месяц',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 месяцы',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 месяцы',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 месяцы',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'месяц',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 месяцаў',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'год',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 гады',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'год',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 гадоў',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'праз некалькі секунд', 'prefix');\n        assert.equal(moment(0).from(30000), 'некалькі секунд таму', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'праз некалькі секунд', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'праз 5 дзён', 'in 5 days');\n        assert.equal(moment().add({m: 31}).fromNow(), 'праз 31 хвіліну', 'in 31 minutes = in 31 minutes');\n        assert.equal(moment().subtract({m: 31}).fromNow(), '31 хвіліну таму', '31 minutes ago = 31 minutes ago');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Сёння ў 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Сёння ў 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Сёння ў 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Заўтра ў 02:00',      'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Сёння ў 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Учора ў 02:00',       'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        function makeFormat(d) {\n            return '[У] dddd [ў] LT';\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n            case 5:\n            case 6:\n                return '[У мінулую] dddd [ў] LT';\n            case 1:\n            case 2:\n            case 4:\n                return '[У мінулы] dddd [ў] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ы', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-ы', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-і', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-і', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-і', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('bg');\n\n    test('parse', function (assert) {\n        var tests = 'януари янр_февруари фев_март мар_април апр_май май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, H:mm:ss',        'неделя, февруари 14-ти 2010, 15:25:50'],\n                ['ddd, hA',                            'нед, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2-ри 02 февруари фев'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-ти 14'],\n                ['d do dddd ddd dd',                   '0 0-ев неделя нед нд'],\n                ['DDD DDDo DDDD',                      '45 45-ти 045'],\n                ['w wo ww',                            '7 7-ми 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45-ти day of the year'],\n                ['LT',                                 '15:25'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 февруари 2010'],\n                ['LLL',                                '14 февруари 2010 15:25'],\n                ['LLLL',                               'неделя, 14 февруари 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 фев 2010'],\n                ['lll',                                '14 фев 2010 15:25'],\n                ['llll',                               'нед, 14 фев 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ти', '4-ти');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ти', '5-ти');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ти', '6-ти');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ми', '7-ми');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ми', '8-ми');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-ти', '9-ти');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-ти', '10-ти');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ти', '11-ти');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ти', '12-ти');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ти', '13-ти');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ти', '14-ти');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ти', '15-ти');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ти', '16-ти');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ти', '17-ти');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ти', '18-ти');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-ти', '19-ти');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-ти', '20-ти');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ви', '21-ви');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ри', '22-ри');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ти', '23-ти');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ти', '24-ти');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ти', '25-ти');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ти', '26-ти');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ми', '27-ми');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ми', '28-ми');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ти', '29-ти');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ти', '30-ти');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'януари янр_февруари фев_март мар_април апр_май май_юни юни_юли юли_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'неделя нед нд_понеделник пон пн_вторник вто вт_сряда сря ср_четвъртък чет чт_петък пет пт_събота съб сб'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'няколко секунди', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'минута',          '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'минута',          '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 минути',        '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 минути',       '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'час',             '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'час',             '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 часа',          '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 часа',          '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 часа',         '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ден',             '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ден',             '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дни',           '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ден',             '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 дни',           '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 дни',          '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'месец',           '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'месец',           '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'месец',           '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 месеца',        '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 месеца',        '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 месеца',        '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'месец',           '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 месеца',        '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'година',          '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 години',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'година',          '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 години',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'след няколко секунди',  'prefix');\n        assert.equal(moment(0).from(30000), 'преди няколко секунди', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'преди няколко секунди',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'след няколко секунди', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'след 5 дни', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Днес в 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Днес в 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Днес в 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Утре в 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Днес в 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Вчера в 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [в] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [в] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [в] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[В изминалата] dddd [в] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[В изминалия] dddd [в] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-ви', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-ри', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-ри', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-ти', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('bn');\n\n    test('parse', function (assert) {\n        var tests = 'জানুয়ারী জানু_ফেবুয়ারী ফেব_মার্চ মার্চ_এপ্রিল এপর_মে মে_জুন জুন_জুলাই জুল_অগাস্ট অগ_সেপ্টেম্বর সেপ্ট_অক্টোবর অক্টো_নভেম্বর নভ_ডিসেম্বর ডিসেম্'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, a h:mm:ss সময়',  'রবিবার, ১৪ ফেবুয়ারী ২০১০, দুপুর ৩:২৫:৫০ সময়'],\n                ['ddd, a h সময়',                       'রবি, দুপুর ৩ সময়'],\n                ['M Mo MM MMMM MMM',                   '২ ২ ০২ ফেবুয়ারী ফেব'],\n                ['YYYY YY',                            '২০১০ ১০'],\n                ['D Do DD',                            '১৪ ১৪ ১৪'],\n                ['d do dddd ddd dd',                   '০ ০ রবিবার রবি রব'],\n                ['DDD DDDo DDDD',                      '৪৫ ৪৫ ০৪৫'],\n                ['w wo ww',                            '৮ ৮ ০৮'],\n                ['h hh',                               '৩ ০৩'],\n                ['H HH',                               '১৫ ১৫'],\n                ['m mm',                               '২৫ ২৫'],\n                ['s ss',                               '৫০ ৫০'],\n                ['a A',                                'দুপুর দুপুর'],\n                ['LT',                                 'দুপুর ৩:২৫ সময়'],\n                ['LTS',                                'দুপুর ৩:২৫:৫০ সময়'],\n                ['L',                                  '১৪/০২/২০১০'],\n                ['LL',                                 '১৪ ফেবুয়ারী ২০১০'],\n                ['LLL',                                '১৪ ফেবুয়ারী ২০১০, দুপুর ৩:২৫ সময়'],\n                ['LLLL',                               'রবিবার, ১৪ ফেবুয়ারী ২০১০, দুপুর ৩:২৫ সময়'],\n                ['l',                                  '১৪/২/২০১০'],\n                ['ll',                                 '১৪ ফেব ২০১০'],\n                ['lll',                                '১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়'],\n                ['llll',                               'রবি, ১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '১', '১');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '২', '২');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '৩', '৩');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '৪', '৪');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '৫', '৫');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '৬', '৬');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '৭', '৭');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '৮', '৮');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '৯', '৯');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '১০', '১০');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '১১', '১১');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '১২', '১২');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '১৩', '১৩');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '১৪', '১৪');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '১৫', '১৫');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '১৬', '১৬');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '১৭', '১৭');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '১৮', '১৮');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '১৯', '১৯');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '২০', '২০');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '২১', '২১');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '২২', '২২');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '২৩', '২৩');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '২৪', '২৪');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '২৫', '২৫');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '২৬', '২৬');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '২৭', '২৭');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '২৮', '२৮');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '২৯', '২৯');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '৩০', '৩০');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '৩১', '৩১');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'জানুয়ারী জানু_ফেবুয়ারী ফেব_মার্চ মার্চ_এপ্রিল এপর_মে মে_জুন জুন_জুলাই জুল_অগাস্ট অগ_সেপ্টেম্বর সেপ্ট_অক্টোবর অক্টো_নভেম্বর নভ_ডিসেম্বর ডিসেম্'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'রবিবার রবি রব_সোমবার সোম সম_মঙ্গলবার মঙ্গল মঙ্গ_বুধবার বুধ বু_বৃহস্পত্তিবার বৃহস্পত্তি ব্রিহ_শুক্রুবার শুক্রু শু_শনিবার শনি শনি'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'কএক সেকেন্ড', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'এক মিনিট',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'এক মিনিট',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '২ মিনিট',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '৪৪ মিনিট',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'এক ঘন্টা',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'এক ঘন্টা',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '২ ঘন্টা',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '৫ ঘন্টা',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '২১ ঘন্টা',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'এক দিন',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'এক দিন',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '২ দিন',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'এক দিন',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '৫ দিন',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '২৫ দিন',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'এক মাস',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'এক মাস',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '২ মাস',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '২ মাস',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '৩ মাস',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'এক মাস',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '৫ মাস',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'এক বছর',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '২ বছর',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'এক বছর',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '৫ বছর',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'কএক সেকেন্ড পরে',  'prefix');\n        assert.equal(moment(0).from(30000), 'কএক সেকেন্ড আগে', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'কএক সেকেন্ড আগে',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'কএক সেকেন্ড পরে', 'কএক সেকেন্ড পরে');\n        assert.equal(moment().add({d: 5}).fromNow(), '৫ দিন পরে', '৫ দিন পরে');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'আজ রাত ২:০০ সময়',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'আজ রাত ২:২৫ সময়',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 3}).calendar(),       'আজ শকাল ৫:০০ সময়',     'Now plus 3 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'আগামীকাল রাত ২:০০ সময়',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'আজ রাত ১:০০ সময়',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'গতকাল রাত ২:০০ সময়', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[গত] dddd[,] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[গত] dddd[,] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[গত] dddd[,] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'রাত', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'শকাল', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'দুপুর', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'বিকেল', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'বিকেল', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'রাত', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'রাত', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'শকাল', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'দুপুর', ' during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'বিকেল', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'বিকেল', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'রাত', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '১ ০১ ১', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '১ ০১ ১', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '২ ০২ ২', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '২ ০২ ২', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '৩ ০৩ ৩', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('bo');\n\n    test('parse', function (assert) {\n        var tests = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ._ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, a h:mm:ss ལ་',  'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥:༥༠ ལ་'],\n                ['ddd, a h ལ་',                       'ཉི་མ་, ཉིན་གུང ༣ ལ་'],\n                ['M Mo MM MMMM MMM',                   '༢ ༢ ༠༢ ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ'],\n                ['YYYY YY',                            '༢༠༡༠ ༡༠'],\n                ['D Do DD',                            '༡༤ ༡༤ ༡༤'],\n                ['d do dddd ddd dd',                   '༠ ༠ གཟའ་ཉི་མ་ ཉི་མ་ ཉི་མ་'],\n                ['DDD DDDo DDDD',                      '༤༥ ༤༥ ༠༤༥'],\n                ['w wo ww',                            '༨ ༨ ༠༨'],\n                ['h hh',                               '༣ ༠༣'],\n                ['H HH',                               '༡༥ ༡༥'],\n                ['m mm',                               '༢༥ ༢༥'],\n                ['s ss',                               '༥༠ ༥༠'],\n                ['a A',                                'ཉིན་གུང ཉིན་གུང'],\n                ['LT',                                 'ཉིན་གུང ༣:༢༥'],\n                ['LTS',                                'ཉིན་གུང ༣:༢༥:༥༠'],\n                ['L',                                  '༡༤/༠༢/༢༠༡༠'],\n                ['LL',                                 '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠'],\n                ['LLL',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],\n                ['LLLL',                               'གཟའ་ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],\n                ['l',                                  '༡༤/༢/༢༠༡༠'],\n                ['ll',                                 '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠'],\n                ['lll',                                '༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥'],\n                ['llll',                               'ཉི་མ་, ༡༤ ཟླ་བ་གཉིས་པ ༢༠༡༠, ཉིན་གུང ༣:༢༥']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '༡', '༡');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '༢', '༢');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '༣', '༣');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '༤', '༤');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '༥', '༥');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '༦', '༦');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '༧', '༧');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '༨', '༨');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '༩', '༩');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '༡༠', '༡༠');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '༡༡', '༡༡');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '༡༢', '༡༢');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '༡༣', '༡༣');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '༡༤', '༡༤');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '༡༥', '༡༥');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '༡༦', '༡༦');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '༡༧', '༡༧');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '༡༨', '༡༨');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '༡༩', '༡༩');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '༢༠', '༢༠');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '༢༡', '༢༡');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '༢༢', '༢༢');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '༢༣', '༢༣');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '༢༤', '༢༤');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '༢༥', '༢༥');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '༢༦', '༢༦');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '༢༧', '༢༧');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '༢༨', '༢༨');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '༢༩', '༢༩');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '༣༠', '༣༠');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '༣༡', '༣༡');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ཟླ་བ་དང་པོ ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'གཟའ་ཉི་མ་ ཉི་མ་ ཉི་མ་_གཟའ་ཟླ་བ་ ཟླ་བ་ ཟླ་བ་_གཟའ་མིག་དམར་ མིག་དམར་ མིག་དམར་_གཟའ་ལྷག་པ་ ལྷག་པ་ ལྷག་པ་_གཟའ་ཕུར་བུ ཕུར་བུ ཕུར་བུ_གཟའ་པ་སངས་ པ་སངས་ པ་སངས་_གཟའ་སྤེན་པ་ སྤེན་པ་ སྤེན་པ་'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ལམ་སང', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'སྐར་མ་གཅིག',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'སྐར་མ་གཅིག',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '༢ སྐར་མ',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '༤༤ སྐར་མ',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ཆུ་ཚོད་གཅིག',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ཆུ་ཚོད་གཅིག',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '༢ ཆུ་ཚོད',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '༥ ཆུ་ཚོད',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '༢༡ ཆུ་ཚོད',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ཉིན་གཅིག',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ཉིན་གཅིག',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '༢ ཉིན་',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ཉིན་གཅིག',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '༥ ཉིན་',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '༢༥ ཉིན་',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ཟླ་བ་གཅིག',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ཟླ་བ་གཅིག',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ཟླ་བ་གཅིག',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '༢ ཟླ་བ',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '༢ ཟླ་བ',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '༣ ཟླ་བ',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ཟླ་བ་གཅིག',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '༥ ཟླ་བ',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ལོ་གཅིག',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '༢ ལོ',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ལོ་གཅིག',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '༥ ལོ',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'ལམ་སང ལ་',  'prefix');\n        assert.equal(moment(0).from(30000), 'ལམ་སང སྔན་ལ', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'ལམ་སང སྔན་ལ',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'ལམ་སང ལ་', 'ལམ་སང ལ་');\n        assert.equal(moment().add({d: 5}).fromNow(), '༥ ཉིན་ ལ་', '༥ ཉིན་ ལ་');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'དི་རིང མཚན་མོ ༢:༠༠',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'དི་རིང མཚན་མོ ༢:༢༥',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 3}).calendar(),       'དི་རིང ཞོགས་ཀས ༥:༠༠',     'Now plus 3 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'སང་ཉིན མཚན་མོ ༢:༠༠',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'དི་རིང མཚན་མོ ༡:༠༠',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'ཁ་སང མཚན་མོ ༢:༠༠', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ][,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ][,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་རྗེས་མ][,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་མཐའ་མ] dddd[,] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་མཐའ་མ] dddd[,] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[བདུན་ཕྲག་མཐའ་མ] dddd[,] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'མཚན་མོ', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'ཞོགས་ཀས', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ཉིན་གུང', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'དགོང་དག', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'དགོང་དག', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'མཚན་མོ', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'མཚན་མོ', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'ཞོགས་ཀས', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'ཉིན་གུང', ' during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'དགོང་དག', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'དགོང་དག', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'མཚན་མོ', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '༢ ༠༢ ༢', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '༢ ༠༢ ༢', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('br');\n\n    test('parse', function (assert) {\n        var tests = 'Genver Gen_C\\'hwevrer C\\'hwe_Meurzh Meu_Ebrel Ebr_Mae Mae_Mezheven Eve_Gouere Gou_Eost Eos_Gwengolo Gwe_Here Her_Du Du_Kerzu Ker'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        moment.locale('br');\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sul, C\\'hwevrer 14vet 2010, 3:25:50 pm'],\n                ['ddd, h A',                            'Sul, 3 PM'],\n                ['M Mo MM MMMM MMM',                   '2 2vet 02 C\\'hwevrer C\\'hwe'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14vet 14'],\n                ['d do dddd ddd dd',                   '0 0vet Sul Sul Su'],\n                ['DDD DDDo DDDD',                      '45 45vet 045'],\n                ['w wo ww',                            '6 6vet 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['DDDo [devezh] [ar] [vloaz]',       '45vet devezh ar vloaz'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 a viz C\\'hwevrer 2010'],\n                ['LLL',                                '14 a viz C\\'hwevrer 2010 3e25 PM'],\n                ['LLLL',                               'Sul, 14 a viz C\\'hwevrer 2010 3e25 PM']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        moment.locale('br');\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1añ', '1añ');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2vet', '2vet');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3vet', '3vet');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4vet', '4vet');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5vet', '5vet');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6vet', '6vet');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7vet', '7vet');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8vet', '8vet');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9vet', '9vet');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10vet', '10vet');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11vet', '11vet');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12vet', '12vet');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13vet', '13vet');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14vet', '14vet');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15vet', '15vet');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16vet', '16vet');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17vet', '17vet');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18vet', '18vet');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19vet', '19vet');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20vet', '20vet');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21vet', '21vet');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22vet', '22vet');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23vet', '23vet');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24vet', '24vet');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25vet', '25vet');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26vet', '26vet');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27vet', '27vet');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28vet', '28vet');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29vet', '29vet');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30vet', '30vet');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31vet', '31vet');\n    });\n\n    test('format month', function (assert) {\n        moment.locale('br');\n        var expected = 'Genver Gen_C\\'hwevrer C\\'hwe_Meurzh Meu_Ebrel Ebr_Mae Mae_Mezheven Eve_Gouere Gou_Eost Eos_Gwengolo Gwe_Here Her_Du Du_Kerzu Ker'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        moment.locale('br');\n        var expected = 'Sul Sul Su_Lun Lun Lu_Meurzh Meu Me_Merc\\'her Mer Mer_Yaou Yao Ya_Gwener Gwe Gw_Sadorn Sad Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        moment.locale('br');\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'un nebeud segondennoù', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ur vunutenn',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ur vunutenn',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 vunutenn',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 munutenn',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'un eur',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'un eur',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 eur',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 eur',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 eur',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un devezh',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un devezh',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 zevezh',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un devezh',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 devezh',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 devezh',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ur miz',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ur miz',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ur miz',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 viz',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 viz',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 miz',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ur miz',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 miz',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ur bloaz',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 vloaz',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ur bloaz',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 bloaz',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        moment.locale('br');\n        assert.equal(moment(30000).from(0), 'a-benn un nebeud segondennoù',  'prefix');\n        assert.equal(moment(0).from(30000), 'un nebeud segondennoù \\'zo', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        moment.locale('br');\n        assert.equal(moment().fromNow(), 'un nebeud segondennoù \\'zo',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        moment.locale('br');\n        assert.equal(moment().add({s: 30}).fromNow(), 'a-benn un nebeud segondennoù', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'a-benn 5 devezh', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        moment.locale('br');\n\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hiziv da 2e00 AM',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hiziv da 2e25 AM',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hiziv da 3e00 AM',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Warc\\'hoazh da 2e00 AM',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hiziv da 1e00 AM',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Dec\\'h da 2e00 AM', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        moment.locale('br');\n\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [da] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [da] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [da] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        moment.locale('br');\n\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [paset da] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [paset da] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [paset da] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        moment.locale('br');\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('special mutations for years', function (assert) {\n        moment.locale('br');\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ur bloaz', 'mutation 1 year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 2}), true), '2 vloaz', 'mutation 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 3}), true), '3 bloaz', 'mutation 3 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 4}), true), '4 bloaz', 'mutation 4 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 bloaz', 'mutation 5 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 9}), true), '9 bloaz', 'mutation 9 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 10}), true), '10 vloaz', 'mutation 10 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true), '21 bloaz', 'mutation 21 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 22}), true), '22 vloaz', 'mutation 22 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 133}), true), '133 bloaz', 'mutation 133 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 148}), true), '148 vloaz', 'mutation 148 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 261}), true), '261 bloaz', 'mutation 261 years');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('bs');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan._februar feb._mart mar._april apr._maj maj._juni jun._juli jul._august aug._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'nedjelja, 14. februar 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ned., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. nedjelja ned. ne'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14. 02. 2010'],\n                ['LL',                                 '14. februar 2010'],\n                ['LLL',                                '14. februar 2010 15:25'],\n                ['LLLL',                               'nedjelja, 14. februar 2010 15:25'],\n                ['l',                                  '14. 2. 2010'],\n                ['ll',                                 '14. feb. 2010'],\n                ['lll',                                '14. feb. 2010 15:25'],\n                ['llll',                               'ned., 14. feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan._februar feb._mart mar._april apr._maj maj._juni jun._juli jul._august aug._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'par sekundi', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'jedna minuta',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'jedna minuta',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minute',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuta',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'jedan sat',      '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'jedan sat',      '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 sata',        '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 sati',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 sati',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'dan',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'dan',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dana',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'dan',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dana',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dana',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mjesec',     '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mjesec',     '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mjesec',     '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mjeseca',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mjeseca',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mjeseca',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mjesec',     '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mjeseci',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'godinu',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 godina',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za par sekundi',  'prefix');\n        assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'prije par sekundi',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'danas u 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'danas u 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'danas u 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'sutra u 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'danas u 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'jučer u 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[u] [nedjelju] [u] LT';\n            case 3:\n                return '[u] [srijedu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n                return '[prošlu] dddd [u] LT';\n            case 6:\n                return '[prošle] [subote] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prošli] dddd [u] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ca');\n\n    test('parse', function (assert) {\n        var tests = 'gener gen._febrer febr._març mar._abril abr._maig mai._juny jun._juliol jul._agost ag._setembre set._octubre oct._novembre nov._desembre des.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'diumenge, 14è febrer 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dg., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2n 02 febrer febr.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14è 14'],\n                ['d do dddd ddd dd',                   '0 0è diumenge dg. Dg'],\n                ['DDD DDDo DDDD',                      '45 45è 045'],\n                ['w wo ww',                            '6 6a 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45è day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 febrer 2010'],\n                ['LLL',                                '14 febrer 2010 15:25'],\n                ['LLLL',                               'diumenge 14 febrer 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 febr. 2010'],\n                ['lll',                                '14 febr. 2010 15:25'],\n                ['llll',                               'dg. 14 febr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1r', '1r');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2n', '2n');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3r', '3r');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4t', '4t');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5è', '5è');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6è', '6è');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7è', '7è');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8è', '8è');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9è', '9è');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10è', '10è');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11è', '11è');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12è', '12è');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13è', '13è');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14è', '14è');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15è', '15è');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16è', '16è');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17è', '17è');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18è', '18è');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19è', '19è');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20è', '20è');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21è', '21è');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22è', '22è');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23è', '23è');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24è', '24è');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25è', '25è');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26è', '26è');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27è', '27è');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28è', '28è');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29è', '29è');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30è', '30è');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31è', '31è');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'gener gen._febrer febr._març mar._abril abr._maig mai._juny jun._juliol jul._agost ag._setembre set._octubre oct._novembre nov._desembre des.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'diumenge dg. Dg_dilluns dl. Dl_dimarts dt. Dt_dimecres dc. Dc_dijous dj. Dj_divendres dv. Dv_dissabte ds. Ds'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'uns segons', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'un minut',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'un minut',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuts',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuts',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'una hora',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'una hora',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hores',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hores',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hores',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un dia',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un dia',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dies',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un dia',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dies',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dies',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mes',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mes',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mes',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mesos',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mesos',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mesos',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mes',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mesos',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un any',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anys',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un any',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 anys',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'en uns segons',  'prefix');\n        assert.equal(moment(0).from(30000), 'fa uns segons', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'fa uns segons',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'en uns segons', 'en uns segons');\n        assert.equal(moment().add({d: 5}).fromNow(), 'en 5 dies', 'en 5 dies');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                         'avui a les 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),          'avui a les 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),           'avui a les 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),           'demà a les 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).add({d: 1, h : -1}).calendar(),   'demà a la 1:00',   'tomorrow minus 1 hour');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),      'avui a la 1:00',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),      'ahir a les 2:00',    'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52a', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1a', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1a', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2a', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2a', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('cs');\n\n    test('parse', function (assert) {\n        var tests = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split('_'), i;\n        function equalTest(input, mmm, monthIndex) {\n            assert.equal(moment(input, mmm).month(), monthIndex, input + ' should be month ' + (monthIndex + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss',  'neděle, únor 14. 2010, 3:25:50'],\n                ['ddd, h',                       'ne, 3'],\n                ['M Mo MM MMMM MMM',             '2 2. 02 únor úno'],\n                ['YYYY YY',                      '2010 10'],\n                ['D Do DD',                      '14 14. 14'],\n                ['d do dddd ddd dd',             '0 0. neděle ne ne'],\n                ['DDD DDDo DDDD',                '45 45. 045'],\n                ['w wo ww',                      '6 6. 06'],\n                ['h hh',                         '3 03'],\n                ['H HH',                         '15 15'],\n                ['m mm',                         '25 25'],\n                ['s ss',                         '50 50'],\n                ['a A',                          'pm PM'],\n                ['DDDo [den v roce]',            '45. den v roce'],\n                ['LTS',                          '15:25:50'],\n                ['L',                            '14.02.2010'],\n                ['LL',                           '14. únor 2010'],\n                ['LLL',                          '14. únor 2010 15:25'],\n                ['LLLL',                         'neděle 14. únor 2010 15:25'],\n                ['l',                            '14.2.2010'],\n                ['ll',                           '14. úno 2010'],\n                ['lll',                          '14. úno 2010 15:25'],\n                ['llll',                         'ne 14. úno 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'leden led_únor úno_březen bře_duben dub_květen kvě_červen čvn_červenec čvc_srpen srp_září zář_říjen říj_listopad lis_prosinec pro'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'neděle ne ne_pondělí po po_úterý út út_středa st st_čtvrtek čt čt_pátek pá pá_sobota so so'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'pár sekund',  '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minuta',        '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minuta',        '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuty',      '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minut',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'hodina',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'hodina',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hodiny',     '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hodin',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hodin',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'den',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'den',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dny',         '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'den',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dní',         '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dní',        '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'měsíc',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'měsíc',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'měsíc',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 měsíce',    '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 měsíce',    '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 měsíce',    '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'měsíc',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 měsíců',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'rok',           '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 roky',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'rok',           '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 let',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za pár sekund',  'prefix');\n        assert.equal(moment(0).from(30000), 'před pár sekundami', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'před pár sekundami',  'now from now should display as in the past');\n    });\n\n    test('fromNow (future)', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za pár sekund', 'in a few seconds');\n        assert.equal(moment().add({m: 1}).fromNow(), 'za minutu', 'in a minute');\n        assert.equal(moment().add({m: 3}).fromNow(), 'za 3 minuty', 'in 3 minutes');\n        assert.equal(moment().add({m: 10}).fromNow(), 'za 10 minut', 'in 10 minutes');\n        assert.equal(moment().add({h: 1}).fromNow(), 'za hodinu', 'in an hour');\n        assert.equal(moment().add({h: 3}).fromNow(), 'za 3 hodiny', 'in 3 hours');\n        assert.equal(moment().add({h: 10}).fromNow(), 'za 10 hodin', 'in 10 hours');\n        assert.equal(moment().add({d: 1}).fromNow(), 'za den', 'in a day');\n        assert.equal(moment().add({d: 3}).fromNow(), 'za 3 dny', 'in 3 days');\n        assert.equal(moment().add({d: 10}).fromNow(), 'za 10 dní', 'in 10 days');\n        assert.equal(moment().add({M: 1}).fromNow(), 'za měsíc', 'in a month');\n        assert.equal(moment().add({M: 3}).fromNow(), 'za 3 měsíce', 'in 3 months');\n        assert.equal(moment().add({M: 10}).fromNow(), 'za 10 měsíců', 'in 10 months');\n        assert.equal(moment().add({y: 1}).fromNow(), 'za rok', 'in a year');\n        assert.equal(moment().add({y: 3}).fromNow(), 'za 3 roky', 'in 3 years');\n        assert.equal(moment().add({y: 10}).fromNow(), 'za 10 let', 'in 10 years');\n    });\n\n    test('fromNow (past)', function (assert) {\n        assert.equal(moment().subtract({s: 30}).fromNow(), 'před pár sekundami', 'a few seconds ago');\n        assert.equal(moment().subtract({m: 1}).fromNow(), 'před minutou', 'a minute ago');\n        assert.equal(moment().subtract({m: 3}).fromNow(), 'před 3 minutami', '3 minutes ago');\n        assert.equal(moment().subtract({m: 10}).fromNow(), 'před 10 minutami', '10 minutes ago');\n        assert.equal(moment().subtract({h: 1}).fromNow(), 'před hodinou', 'an hour ago');\n        assert.equal(moment().subtract({h: 3}).fromNow(), 'před 3 hodinami', '3 hours ago');\n        assert.equal(moment().subtract({h: 10}).fromNow(), 'před 10 hodinami', '10 hours ago');\n        assert.equal(moment().subtract({d: 1}).fromNow(), 'před dnem', 'a day ago');\n        assert.equal(moment().subtract({d: 3}).fromNow(), 'před 3 dny', '3 days ago');\n        assert.equal(moment().subtract({d: 10}).fromNow(), 'před 10 dny', '10 days ago');\n        assert.equal(moment().subtract({M: 1}).fromNow(), 'před měsícem', 'a month ago');\n        assert.equal(moment().subtract({M: 3}).fromNow(), 'před 3 měsíci', '3 months ago');\n        assert.equal(moment().subtract({M: 10}).fromNow(), 'před 10 měsíci', '10 months ago');\n        assert.equal(moment().subtract({y: 1}).fromNow(), 'před rokem', 'a year ago');\n        assert.equal(moment().subtract({y: 3}).fromNow(), 'před 3 lety', '3 years ago');\n        assert.equal(moment().subtract({y: 10}).fromNow(), 'před 10 lety', '10 years ago');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'dnes v 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'dnes v 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'dnes v 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'zítra v 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'dnes v 1:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'včera v 2:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m, nextDay;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            nextDay = '';\n            switch (m.day()) {\n            case 0:\n                nextDay = 'v neděli';\n                break;\n            case 1:\n                nextDay = 'v pondělí';\n                break;\n            case 2:\n                nextDay = 'v úterý';\n                break;\n            case 3:\n                nextDay = 've středu';\n                break;\n            case 4:\n                nextDay = 've čtvrtek';\n                break;\n            case 5:\n                nextDay = 'v pátek';\n                break;\n            case 6:\n                nextDay = 'v sobotu';\n                break;\n            }\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [v] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [v] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [v] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, lastDay;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            lastDay = '';\n            switch (m.day()) {\n            case 0:\n                lastDay = 'minulou neděli';\n                break;\n            case 1:\n                lastDay = 'minulé pondělí';\n                break;\n            case 2:\n                lastDay = 'minulé úterý';\n                break;\n            case 3:\n                lastDay = 'minulou středu';\n                break;\n            case 4:\n                lastDay = 'minulý čtvrtek';\n                break;\n            case 5:\n                lastDay = 'minulý pátek';\n                break;\n            case 6:\n                lastDay = 'minulou sobotu';\n                break;\n            }\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [v] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [v] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [v] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('humanize duration', function (assert) {\n        assert.equal(moment.duration(1, 'minutes').humanize(), 'minuta', 'a minute (future)');\n        assert.equal(moment.duration(1, 'minutes').humanize(true), 'za minutu', 'in a minute');\n        assert.equal(moment.duration(-1, 'minutes').humanize(), 'minuta', 'a minute (past)');\n        assert.equal(moment.duration(-1, 'minutes').humanize(true), 'před minutou', 'a minute ago');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('cv');\n\n    test('parse', function (assert) {\n        var tests = 'кăрлач кăр_нарăс нар_пуш пуш_ака ака_май май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'вырсарникун, нарăс 14-мĕш 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'выр, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2-мĕш 02 нарăс нар'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-мĕш 14'],\n                ['d do dddd ddd dd',                   '0 0-мĕш вырсарникун выр вр'],\n                ['DDD DDDo DDDD',                      '45 45-мĕш 045'],\n                ['w wo ww',                            '7 7-мĕш 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['Çулăн DDDo кунĕ',                    'Çулăн 45-мĕш кунĕ'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14-02-2010'],\n                ['LL',                                 '2010 çулхи нарăс уйăхĕн 14-мĕшĕ'],\n                ['LLL',                                '2010 çулхи нарăс уйăхĕн 14-мĕшĕ, 15:25'],\n                ['LLLL',                               'вырсарникун, 2010 çулхи нарăс уйăхĕн 14-мĕшĕ, 15:25'],\n                ['l',                                  '14-2-2010'],\n                ['ll',                                 '2010 çулхи нар уйăхĕн 14-мĕшĕ'],\n                ['lll',                                '2010 çулхи нар уйăхĕн 14-мĕшĕ, 15:25'],\n                ['llll',                               'выр, 2010 çулхи нар уйăхĕн 14-мĕшĕ, 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-мĕш', '1-мĕш');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-мĕш', '2-мĕш');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-мĕш', '3-мĕш');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-мĕш', '4-мĕш');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-мĕш', '5-мĕш');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-мĕш', '6-мĕш');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-мĕш', '7-мĕш');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-мĕш', '8-мĕш');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-мĕш', '9-мĕш');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-мĕш', '10-мĕш');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-мĕш', '11-мĕш');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-мĕш', '12-мĕш');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-мĕш', '13-мĕш');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-мĕш', '14-мĕш');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-мĕш', '15-мĕш');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-мĕш', '16-мĕш');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-мĕш', '17-мĕш');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-мĕш', '18-мĕш');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-мĕш', '19-мĕш');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-мĕш', '20-мĕш');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-мĕш', '21-мĕш');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-мĕш', '22-мĕш');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-мĕш', '23-мĕш');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-мĕш', '24-мĕш');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-мĕш', '25-мĕш');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-мĕш', '26-мĕш');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-мĕш', '27-мĕш');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-мĕш', '28-мĕш');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-мĕш', '29-мĕш');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-мĕш', '30-мĕш');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-мĕш', '31-мĕш');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'кăрлач кăр_нарăс нар_пуш пуш_ака ака_май май_çĕртме çĕр_утă утă_çурла çур_авăн ав_юпа юпа_чӳк чӳк_раштав раш'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'вырсарникун выр вр_тунтикун тун тн_ытларикун ытл ыт_юнкун юн юн_кĕçнерникун кĕç кç_эрнекун эрн эр_шăматкун шăм шм'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'пĕр-ик çеккунт', '44 sekunder = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'пĕр минут',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'пĕр минут',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 минут',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 минут',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'пĕр сехет',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'пĕр сехет',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 сехет',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 сехет',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 сехет',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'пĕр кун',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'пĕр кун',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 кун',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'пĕр кун',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 кун',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 кун',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'пĕр уйăх',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'пĕр уйăх',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'пĕр уйăх',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 уйăх',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 уйăх',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 уйăх',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'пĕр уйăх',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 уйăх',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'пĕр çул',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 çул',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'пĕр çул',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 çул',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'пĕр-ик çеккунтран',  'prefix');\n        assert.equal(moment(0).from(30000), 'пĕр-ик çеккунт каялла', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'пĕр-ик çеккунт каялла',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'пĕр-ик çеккунтран', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 кунран', 'in 5 days');\n        assert.equal(moment().add({h: 2}).fromNow(), '2 сехетрен', 'in 2 hours, the right suffix!');\n        assert.equal(moment().add({y: 3}).fromNow(), '3 çултан', 'in 3 years, the right suffix!');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n        assert.equal(moment(a).calendar(),                     'Паян 02:00 сехетре',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Паян 02:25 сехетре',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Паян 03:00 сехетре',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Ыран 02:00 сехетре',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Паян 01:00 сехетре',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Ĕнер 02:00 сехетре',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[Çитес] dddd LT [сехетре]'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Çитес] dddd LT [сехетре]'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Çитес] dddd LT [сехетре]'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Иртнĕ] dddd LT [сехетре]'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Иртнĕ] dddd LT [сехетре]'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Иртнĕ] dddd LT [сехетре]'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-мĕш', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-мĕш', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-мĕш', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-мĕш', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-мĕш', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('cy');\n\n    test('parse', function (assert) {\n        var tests = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Dydd Sul, Chwefror 14eg 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sul, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2il 02 Chwefror Chwe'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14eg 14'],\n                ['d do dddd ddd dd',                   '0 0 Dydd Sul Sul Su'],\n                ['DDD DDDo DDDD',                      '45 45ain 045'],\n                ['w wo ww',                            '6 6ed 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45ain day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Chwefror 2010'],\n                ['LLL',                                '14 Chwefror 2010 15:25'],\n                ['LLLL',                               'Dydd Sul, 14 Chwefror 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Chwe 2010'],\n                ['lll',                                '14 Chwe 2010 15:25'],\n                ['llll',                               'Sul, 14 Chwe 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1af', '1af');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2il', '2il');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3ydd', '3ydd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4ydd', '4ydd');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5ed', '5ed');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6ed', '6ed');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7ed', '7ed');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8fed', '8fed');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9fed', '9fed');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10fed', '10fed');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11eg', '11eg');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12fed', '12fed');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13eg', '13eg');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14eg', '14eg');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15fed', '15fed');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16eg', '16eg');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17eg', '17eg');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18fed', '18fed');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19eg', '19eg');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20fed', '20fed');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ain', '21ain');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ain', '22ain');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ain', '23ain');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ain', '24ain');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ain', '25ain');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ain', '26ain');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ain', '27ain');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ain', '28ain');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ain', '29ain');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ain', '30ain');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ain', '31ain');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Ionawr Ion_Chwefror Chwe_Mawrth Maw_Ebrill Ebr_Mai Mai_Mehefin Meh_Gorffennaf Gor_Awst Aws_Medi Med_Hydref Hyd_Tachwedd Tach_Rhagfyr Rhag'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Dydd Sul Sul Su_Dydd Llun Llun Ll_Dydd Mawrth Maw Ma_Dydd Mercher Mer Me_Dydd Iau Iau Ia_Dydd Gwener Gwe Gw_Dydd Sadwrn Sad Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ychydig eiliadau', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'munud',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'munud',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 munud',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 munud', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'awr',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'awr',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 awr',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 awr',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 awr',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'diwrnod',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'diwrnod',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 diwrnod',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'diwrnod',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 diwrnod',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 diwrnod',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mis',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mis',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mis',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mis',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mis',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mis',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mis',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mis',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'blwyddyn',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 flynedd',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'blwyddyn',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 flynedd',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'mewn ychydig eiliadau', 'prefix');\n        assert.equal(moment(0).from(30000), 'ychydig eiliadau yn ôl', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'mewn ychydig eiliadau', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'mewn 5 diwrnod', 'in 5 days');\n    });\n\n    test('same day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Heddiw am 02:00',    'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Heddiw am 02:25',    'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Heddiw am 03:00',    'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Yfory am 02:00',         'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Heddiw am 01:00',    'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Ddoe am 02:00',           'yesterday at the same time');\n    });\n\n    test('same next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [am] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [am] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [am] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('same last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [diwethaf am] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [diwethaf am] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [diwethaf am] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('same all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52ain', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'), '1 01 1af', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '1 01 1af', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2il', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2il', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('da');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd [den] Do MMMM YYYY, h:mm:ss a', 'søndag den 14. februar 2010, 3:25:50 pm'],\n                ['ddd hA',                             'søn 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. søndag søn sø'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[den] DDDo [dag på året]',           'den 45. dag på året'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14. februar 2010'],\n                ['LLL',                                '14. februar 2010 15:25'],\n                ['LLLL',                               'søndag d. 14. februar 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14. feb 2010'],\n                ['lll',                                '14. feb 2010 15:25'],\n                ['llll',                               'søn d. 14. feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan_februar feb_marts mar_april apr_maj maj_juni jun_juli jul_august aug_september sep_oktober okt_november nov_december dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'søndag søn sø_mandag man ma_tirsdag tir ti_onsdag ons on_torsdag tor to_fredag fre fr_lørdag lør lø'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'få sekunder', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'et minut',    '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'et minut',    '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutter',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutter', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'en time',     '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'en time',     '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 timer',     '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 timer',     '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 timer',    '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'en dag',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'en dag',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dage',      '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'en dag',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dage',      '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dage',     '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'en måned',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'en måned',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'en måned',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 måneder',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 måneder',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 måneder',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'en måned',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 måneder',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'et år',       '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'et år',       '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 år',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'om få sekunder',  'prefix');\n        assert.equal(moment(0).from(30000), 'få sekunder siden', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'få sekunder siden',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'om få sekunder', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dage', 'in 5 days');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('de-at');\n\n    test('parse', function (assert) {\n        var tests = 'Jänner Jän._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],\n                ['ddd, hA', 'So., 3PM'],\n                ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],\n                ['YYYY YY', '2010 10'],\n                ['D Do DD', '14 14. 14'],\n                ['d do dddd ddd dd', '0 0. Sonntag So. So'],\n                ['DDD DDDo DDDD', '45 45. 045'],\n                ['w wo ww', '6 6. 06'],\n                ['h hh', '3 03'],\n                ['H HH', '15 15'],\n                ['m mm', '25 25'],\n                ['s ss', '50 50'],\n                ['a A', 'pm PM'],\n                ['[the] DDDo [day of the year]', 'the 45. day of the year'],\n                ['LTS', '15:25:50'],\n                ['L', '14.02.2010'],\n                ['LL', '14. Februar 2010'],\n                ['LLL', '14. Februar 2010 15:25'],\n                ['LLLL', 'Sonntag, 14. Februar 2010 15:25'],\n                ['l', '14.2.2010'],\n                ['ll', '14. Febr. 2010'],\n                ['lll', '14. Febr. 2010 15:25'],\n                ['llll', 'So., 14. Febr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Jänner Jän._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ein paar Sekunden', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eine Minute', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eine Minute', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 Minuten', '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 Minuten', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'eine Stunde', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'eine Stunde', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 Stunden', '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 Stunden', '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 Stunden', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ein Tag', '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ein Tag', '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 Tage', '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ein Tag', '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 Tage', '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 Tage', '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ein Monat', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ein Monat', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 Monate', '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 Monate', '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 Monate', '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ein Monat', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 Monate', '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ein Jahr', '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 Jahre', '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ein Jahr', '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Jahre', '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix');\n        assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in ein paar Sekunden', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 Tagen', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(), 'Heute um 02:00 Uhr', 'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(), 'Heute um 02:25 Uhr', 'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(), 'Heute um 03:00 Uhr', 'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(), 'Morgen um 02:00 Uhr', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(), 'Heute um 01:00 Uhr', 'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(), 'Gestern um 02:00 Uhr', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(), m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd [um] LT [Uhr]'), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(), m.format('[letzten] dddd [um] LT [Uhr]'), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('[letzten] dddd [um] LT [Uhr]'), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('[letzten] dddd [um] LT [Uhr]'), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('de');\n\n    test('parse', function (assert) {\n        var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'Sonntag, 14. Februar 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'So., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 Februar Febr.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. Sonntag So. So'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14. Februar 2010'],\n                ['LLL',                                '14. Februar 2010 15:25'],\n                ['LLLL',                               'Sonntag, 14. Februar 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14. Febr. 2010'],\n                ['lll',                                '14. Febr. 2010 15:25'],\n                ['llll',                               'So., 14. Febr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sonntag So. So_Montag Mo. Mo_Dienstag Di. Di_Mittwoch Mi. Mi_Donnerstag Do. Do_Freitag Fr. Fr_Samstag Sa. Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ein paar Sekunden',  '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'eine Minute',       '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'eine Minute',       '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 Minuten',          '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 Minuten',         '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'eine Stunde',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'eine Stunde',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 Stunden',          '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 Stunden',          '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 Stunden',         '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ein Tag',          '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ein Tag',          '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 Tage',            '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ein Tag',          '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 Tage',            '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 Tage',           '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ein Monat',        '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ein Monat',        '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ein Monat',        '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 Monate',          '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 Monate',          '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 Monate',          '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ein Monat',        '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 Monate',          '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ein Jahr',         '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 Jahre',           '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ein Jahr',         '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 Jahre',           '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in ein paar Sekunden', 'prefix');\n        assert.equal(moment(0).from(30000), 'vor ein paar Sekunden', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in ein paar Sekunden', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 Tagen', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Heute um 02:00 Uhr',   'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Heute um 02:25 Uhr',   'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Heute um 03:00 Uhr',   'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Morgen um 02:00 Uhr',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Heute um 01:00 Uhr',   'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Gestern um 02:00 Uhr', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [um] LT [Uhr]'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [um] LT [Uhr]'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [um] LT [Uhr]'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[letzten] dddd [um] LT [Uhr]'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[letzten] dddd [um] LT [Uhr]'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[letzten] dddd [um] LT [Uhr]'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('el');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('parse meridiem', function (assert) {\n        var i,\n            b = moment(),\n            meridiemTests = [\n                // h a patterns, expected hours, isValid\n                ['10 πμ',   10, true],\n                ['10 μμ',   22, true],\n                ['10 π.μ.', 10, true],\n                ['10 μ.μ.', 22, true],\n                ['10 π',    10, true],\n                ['10 μ',    22, true],\n                ['10 ΠΜ',   10, true],\n                ['10 ΜΜ',   22, true],\n                ['10 Π.Μ.', 10, true],\n                ['10 Μ.Μ.', 22, true],\n                ['10 Π',    10, true],\n                ['10 Μ',    22, true],\n                ['10 am',   10, false],\n                ['10 pm',   10, false]\n            ];\n\n        // test that a formatted moment including meridiem string can be parsed back to the same moment\n        assert.ok(b.isSame(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true), 'seconds'), b.format('h:mm:ss a') + ' should be equal to ' + moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).format('h:mm:ss a'));\n\n        // test that a formatted moment having a meridiem string can be parsed with strict flag\n        assert.ok(moment(b.format('h:mm:ss a'), 'h:mm:ss a', 'el', true).isValid(), b.format('h:mm:ss a') + ' should be parsed as valid');\n\n        for (i = 0; i < meridiemTests.length; i++) {\n            assert.equal(moment(meridiemTests[i][0], 'h a', 'el', true).hours(), meridiemTests[i][1], moment(meridiemTests[i][0], 'h a', 'el', true).hours() + ' should be ' + meridiemTests[i][1]);\n            assert.ok(moment(meridiemTests[i][0], 'h a', 'el', true).isValid() === meridiemTests[i][2], meridiemTests[i][0] + ' ----> ' + meridiemTests[i][2]);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Κυριακή, Φεβρουάριος 14η 2010, 3:25:50 μμ'],\n                ['dddd, D MMMM YYYY, h:mm:ss a',       'Κυριακή, 14 Φεβρουαρίου 2010, 3:25:50 μμ'],\n                ['ddd, hA',                            'Κυρ, 3ΜΜ'],\n                ['dddd, MMMM YYYY',                    'Κυριακή, Φεβρουάριος 2010'],\n                ['M Mo MM MMMM MMM',                   '2 2η 02 Φεβρουάριος Φεβ'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14η 14'],\n                ['d do dddd ddd dd',                   '0 0η Κυριακή Κυρ Κυ'],\n                ['DDD DDDo DDDD',                      '45 45η 045'],\n                ['w wo ww',                            '6 6η 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'μμ ΜΜ'],\n                ['[the] DDDo [day of the year]',       'the 45η day of the year'],\n                ['LTS',                                '3:25:50 ΜΜ'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Φεβρουαρίου 2010'],\n                ['LLL',                                '14 Φεβρουαρίου 2010 3:25 ΜΜ'],\n                ['LLLL',                               'Κυριακή, 14 Φεβρουαρίου 2010 3:25 ΜΜ'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Φεβ 2010'],\n                ['lll',                                '14 Φεβ 2010 3:25 ΜΜ'],\n                ['llll',                               'Κυρ, 14 Φεβ 2010 3:25 ΜΜ']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1η', '1η');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2η', '2η');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3η', '3η');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4η', '4η');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5η', '5η');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6η', '6η');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7η', '7η');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8η', '8η');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9η', '9η');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10η', '10η');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11η', '11η');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12η', '12η');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13η', '13η');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14η', '14η');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15η', '15η');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16η', '16η');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17η', '17η');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18η', '18η');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19η', '19η');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20η', '20η');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21η', '21η');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22η', '22η');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23η', '23η');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24η', '24η');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25η', '25η');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26η', '26η');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27η', '27η');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28η', '28η');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29η', '29η');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30η', '30η');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31η', '31η');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'Ιανουάριος Ιαν_Φεβρουάριος Φεβ_Μάρτιος Μαρ_Απρίλιος Απρ_Μάιος Μαϊ_Ιούνιος Ιουν_Ιούλιος Ιουλ_Αύγουστος Αυγ_Σεπτέμβριος Σεπ_Οκτώβριος Οκτ_Νοέμβριος Νοε_Δεκέμβριος Δεκ'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'Κυριακή Κυρ Κυ_Δευτέρα Δευ Δε_Τρίτη Τρι Τρ_Τετάρτη Τετ Τε_Πέμπτη Πεμ Πε_Παρασκευή Παρ Πα_Σάββατο Σαβ Σα'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'λίγα δευτερόλεπτα',   '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ένα λεπτό',           '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ένα λεπτό',           '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 λεπτά',             '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 λεπτά',            '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'μία ώρα',             '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'μία ώρα',             '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ώρες',              '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ώρες',              '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ώρες',             '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'μία μέρα',            '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'μία μέρα',            '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 μέρες',             '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'μία μέρα',            '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 μέρες',             '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 μέρες',            '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ένας μήνας',          '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ένας μήνας',          '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ένας μήνας',          '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 μήνες',             '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 μήνες',             '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 μήνες',             '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ένας μήνας',          '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 μήνες',             '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ένας χρόνος',         '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 χρόνια',            '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ένας χρόνος',         '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 χρόνια',            '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'σε λίγα δευτερόλεπτα',  'prefix');\n        assert.equal(moment(0).from(30000), 'λίγα δευτερόλεπτα πριν', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'λίγα δευτερόλεπτα πριν',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'σε λίγα δευτερόλεπτα', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'σε 5 μέρες', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Σήμερα στις 2:00 ΠΜ',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Σήμερα στις 2:25 ΠΜ',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Σήμερα στις 3:00 ΠΜ',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Αύριο στις 2:00 ΠΜ',      'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Σήμερα στη 1:00 ΠΜ',        'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Χθες στις 2:00 ΠΜ',       'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [στις] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [στις] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, dayString;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            dayString = m.day() === 6 ? '[το προηγούμενο Σάββατο]' : '[την προηγούμενη] dddd';\n            assert.equal(m.calendar(),       m.format(dayString + ' [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT'),  'Today - ' + i + ' days current time');\n            m.hours(1).minutes(30).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(dayString + ' [στη] LT'),  'Today - ' + i + ' days one o clock');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(dayString + ' [στις] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(dayString + ' [στις] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 should be week 52');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 should be week 52');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  2]).week(), 53, 'Jan  2 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  9]).week(), 1, 'Jan  9 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(), 1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(), 2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 51, 'Dec 26 2010 should be week 51');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  8]).week(), 1, 'Jan  8 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(), 1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(), 2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52η', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'),   '1 01 1η', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1η', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'),   '2 02 2η', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2η', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('en-au');\n\n    test('parse', function (assert) {\n        var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sunday, February 14th 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2nd 02 February Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14th 14'],\n                ['d do dddd ddd dd',                   '0 0th Sunday Sun Su'],\n                ['DDD DDDo DDDD',                      '45 45th 045'],\n                ['w wo ww',                            '6 6th 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45th day of the year'],\n                ['LTS',                                '3:25:50 PM'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 February 2010'],\n                ['LLL',                                '14 February 2010 3:25 PM'],\n                ['LLLL',                               'Sunday, 14 February 2010 3:25 PM'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb 2010'],\n                ['lll',                                '14 Feb 2010 3:25 PM'],\n                ['llll',                               'Sun, 14 Feb 2010 3:25 PM']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'a few seconds', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'a minute',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'a minute',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'an hour',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'an hour',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hours',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hours',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hours',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'a day',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'a day',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 days',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'a day',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 days',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 days',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'a month',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'a month',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'a month',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 months',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 months',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 months',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'a month',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 months',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'a year',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 years',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in a few seconds',  'prefix');\n        assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'a few seconds ago',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Today at 2:00 AM',      'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Today at 2:25 AM',      'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Today at 3:00 AM',      'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Tomorrow at 2:00 AM',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Today at 1:00 AM',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Yesterday at 2:00 AM',  'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52nd', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1st', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1st', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2nd', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2nd', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testStr;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testStr = moment(ordinalStr, 'YYYY MM Do').format('YYYY MM D');\n            assert.equal(testStr, '2014 01 ' + i, 'lenient ordinal parsing ' + i);\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testStr;\n        for (i = 1; i <= 31; ++i) {\n            testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D');\n            assert.equal(testStr, '2014 01 ' + i,\n                    'lenient ordinal parsing of number ' + i);\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do');\n            testMoment = moment(ordinalStr, 'YYYY MMM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('en-ca');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sunday, February 14th 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2nd 02 February Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14th 14'],\n                ['d do dddd ddd dd',                   '0 0th Sunday Sun Su'],\n                ['DDD DDDo DDDD',                      '45 45th 045'],\n                ['w wo ww',                            '8 8th 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45th day of the year'],\n                ['L',                                  '2010-02-14'],\n                ['LTS',                                '3:25:50 PM'],\n                ['LL',                                 '14 February, 2010'],\n                ['LLL',                                '14 February, 2010 3:25 PM'],\n                ['LLLL',                               'Sunday, 14 February, 2010 3:25 PM'],\n                ['l',                                  '2010-2-14'],\n                ['ll',                                 '14 Feb, 2010'],\n                ['lll',                                '14 Feb, 2010 3:25 PM'],\n                ['llll',                               'Sun, 14 Feb, 2010 3:25 PM']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'a few seconds', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'a minute',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'a minute',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'an hour',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'an hour',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hours',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hours',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hours',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'a day',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'a day',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 days',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'a day',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 days',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 days',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'a month',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'a month',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'a month',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 months',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 months',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 months',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'a month',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 months',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'a year',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 years',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in a few seconds',  'prefix');\n        assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'a few seconds ago',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Today at 2:00 AM',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Today at 2:25 AM',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Today at 3:00 AM',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Tomorrow at 2:00 AM',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Today at 1:00 AM',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Yesterday at 2:00 AM', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1st', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1st', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2nd', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('en-gb');\n\n    test('parse', function (assert) {\n        var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sunday, February 14th 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2nd 02 February Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14th 14'],\n                ['d do dddd ddd dd',                   '0 0th Sunday Sun Su'],\n                ['DDD DDDo DDDD',                      '45 45th 045'],\n                ['w wo ww',                            '6 6th 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45th day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 February 2010'],\n                ['LLL',                                '14 February 2010 15:25'],\n                ['LLLL',                               'Sunday, 14 February 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb 2010'],\n                ['lll',                                '14 Feb 2010 15:25'],\n                ['llll',                               'Sun, 14 Feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'a few seconds', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'a minute',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'a minute',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'an hour',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'an hour',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hours',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hours',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hours',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'a day',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'a day',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 days',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'a day',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 days',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 days',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'a month',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'a month',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'a month',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 months',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 months',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 months',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'a month',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 months',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'a year',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 years',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in a few seconds',  'prefix');\n        assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'a few seconds ago',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Today at 02:00',      'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Today at 02:25',      'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Today at 03:00',      'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Tomorrow at 02:00',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Today at 01:00',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Yesterday at 02:00',  'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52nd', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1st', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1st', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2nd', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2nd', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('en');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Sunday, February 14th 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2nd 02 February Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14th 14'],\n                ['d do dddd ddd dd',                   '0 0th Sunday Sun Su'],\n                ['DDD DDDo DDDD',                      '45 45th 045'],\n                ['w wo ww',                            '8 8th 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45th day of the year'],\n                ['LTS',                                '3:25:50 PM'],\n                ['L',                                  '02/14/2010'],\n                ['LL',                                 'February 14, 2010'],\n                ['LLL',                                'February 14, 2010 3:25 PM'],\n                ['LLLL',                               'Sunday, February 14, 2010 3:25 PM'],\n                ['l',                                  '2/14/2010'],\n                ['ll',                                 'Feb 14, 2010'],\n                ['lll',                                'Feb 14, 2010 3:25 PM'],\n                ['llll',                               'Sun, Feb 14, 2010 3:25 PM']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'Sunday Sun Su_Monday Mon Mo_Tuesday Tue Tu_Wednesday Wed We_Thursday Thu Th_Friday Fri Fr_Saturday Sat Sa'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'a few seconds', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'a minute',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'a minute',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'an hour',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'an hour',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hours',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hours',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hours',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'a day',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'a day',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 days',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'a day',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 days',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 days',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'a month',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'a month',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'a month',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 months',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 months',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 months',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'a month',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 months',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'a year',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 years',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'a year',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 years',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in a few seconds',  'prefix');\n        assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'a few seconds ago',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in a few seconds', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'in 5 days', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Today at 2:00 AM',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Today at 2:25 AM',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Today at 3:00 AM',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Tomorrow at 2:00 AM',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Today at 1:00 AM',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Yesterday at 2:00 AM', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [at] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Last] dddd [at] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1st', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1st', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2nd', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('eo');\n\n    test('parse', function (assert) {\n        var tests = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Dimanĉo, februaro 14a 2010, 3:25:50 p.t.m.'],\n                ['ddd, hA',                            'Dim, 3P.T.M.'],\n                ['M Mo MM MMMM MMM',                   '2 2a 02 februaro feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14a 14'],\n                ['d do dddd ddd dd',                   '0 0a Dimanĉo Dim Di'],\n                ['DDD DDDo DDDD',                      '45 45a 045'],\n                ['w wo ww',                            '7 7a 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'p.t.m. P.T.M.'],\n                ['[la] DDDo [tago] [de] [la] [jaro]',  'la 45a tago de la jaro'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '14-an de februaro, 2010'],\n                ['LLL',                                '14-an de februaro, 2010 15:25'],\n                ['LLLL',                               'Dimanĉo, la 14-an de februaro, 2010 15:25'],\n                ['l',                                  '2010-2-14'],\n                ['ll',                                 '14-an de feb, 2010'],\n                ['lll',                                '14-an de feb, 2010 15:25'],\n                ['llll',                               'Dim, la 14-an de feb, 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3a', '3a');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4a', '4a');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5a', '5a');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6a', '6a');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7a', '7a');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8a', '8a');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9a', '9a');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10a', '10a');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11a', '11a');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12a', '12a');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13a', '13a');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14a', '14a');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15a', '15a');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16a', '16a');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17a', '17a');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18a', '18a');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19a', '19a');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20a', '20a');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23a', '23a');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24a', '24a');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25a', '25a');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26a', '26a');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27a', '27a');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28a', '28a');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29a', '29a');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30a', '30a');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januaro jan_februaro feb_marto mar_aprilo apr_majo maj_junio jun_julio jul_aŭgusto aŭg_septembro sep_oktobro okt_novembro nov_decembro dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Dimanĉo Dim Di_Lundo Lun Lu_Mardo Mard Ma_Merkredo Merk Me_Ĵaŭdo Ĵaŭ Ĵa_Vendredo Ven Ve_Sabato Sab Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'sekundoj', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minuto',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minuto',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutoj',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutoj',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'horo',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'horo',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 horoj',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 horoj',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 horoj',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'tago',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'tago',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 tagoj',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'tago',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 tagoj',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 tagoj',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'monato',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'monato',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'monato',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 monatoj',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 monatoj',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 monatoj',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'monato',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 monatoj',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'jaro',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaroj',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'jaro',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 jaroj',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'je sekundoj',  'je prefix');\n        assert.equal(moment(0).from(30000), 'antaŭ sekundoj', 'antaŭ prefix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'antaŭ sekundoj',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'je sekundoj', 'je sekundoj');\n        assert.equal(moment().add({d: 5}).fromNow(), 'je 5 tagoj', 'je 5 tagoj');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hodiaŭ je 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hodiaŭ je 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hodiaŭ je 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Morgaŭ je 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hodiaŭ je 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Hieraŭ je 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [je] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [je] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [je] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[pasinta] dddd [je] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[pasinta] dddd [je] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[pasinta] dddd [je] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1a', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1a', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2a', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2a', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3a', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('es');\n\n    test('parse', function (assert) {\n        var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'domingo, febrero 14º 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dom., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2º 02 febrero feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14º 14'],\n                ['d do dddd ddd dd',                   '0 0º domingo dom. Do'],\n                ['DDD DDDo DDDD',                      '45 45º 045'],\n                ['w wo ww',                            '6 6º 06'],\n                ['YYYY-MMM-DD',                        '2010-feb-14'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45º day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 de febrero de 2010'],\n                ['LLL',                                '14 de febrero de 2010 15:25'],\n                ['LLLL',                               'domingo, 14 de febrero de 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 de feb. de 2010'],\n                ['lll',                                '14 de feb. de 2010 15:25'],\n                ['llll',                               'dom., 14 de feb. de 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'domingo dom. Do_lunes lun. Lu_martes mar. Ma_miércoles mié. Mi_jueves jue. Ju_viernes vie. Vi_sábado sáb. Sá'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'unos segundos', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'un minuto',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'un minuto',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutos',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutos',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'una hora',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'una hora',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 horas',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 horas',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 horas',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un día',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un día',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 días',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un día',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 días',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 días',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mes',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mes',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mes',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meses',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meses',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 meses',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mes',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 meses',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un año',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 años',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un año',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 años',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'en unos segundos',  'prefix');\n        assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'hace unos segundos',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'en unos segundos', 'en unos segundos');\n        assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                         'hoy a las 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),          'hoy a las 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),           'hoy a las 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),           'mañana a las 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).add({d: 1, h : -1}).calendar(),   'mañana a la 1:00',   'tomorrow minus 1 hour');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),      'hoy a la 1:00',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),      'ayer a las 2:00',    'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52º', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1º', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1º', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2º', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2º', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('et');\n\n    test('parse', function (assert) {\n        var tests = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' peaks olema kuu ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, H:mm:ss',      'pühapäev, 14. veebruar 2010, 15:25:50'],\n                ['ddd, h',                           'P, 3'],\n                ['M Mo MM MMMM MMM',                 '2 2. 02 veebruar veebr'],\n                ['YYYY YY',                          '2010 10'],\n                ['D Do DD',                          '14 14. 14'],\n                ['d do dddd ddd dd',                 '0 0. pühapäev P P'],\n                ['DDD DDDo DDDD',                    '45 45. 045'],\n                ['w wo ww',                          '6 6. 06'],\n                ['h hh',                             '3 03'],\n                ['H HH',                             '15 15'],\n                ['m mm',                             '25 25'],\n                ['s ss',                             '50 50'],\n                ['a A',                              'pm PM'],\n                ['[aasta] DDDo [päev]',              'aasta 45. päev'],\n                ['LTS',                              '15:25:50'],\n                ['L',                                '14.02.2010'],\n                ['LL',                               '14. veebruar 2010'],\n                ['LLL',                              '14. veebruar 2010 15:25'],\n                ['LLLL',                             'pühapäev, 14. veebruar 2010 15:25'],\n                ['l',                                '14.2.2010'],\n                ['ll',                               '14. veebr 2010'],\n                ['lll',                              '14. veebr 2010 15:25'],\n                ['llll',                             'P, 14. veebr 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'jaanuar jaan_veebruar veebr_märts märts_aprill apr_mai mai_juuni juuni_juuli juuli_august aug_september sept_oktoober okt_november nov_detsember dets'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'pühapäev P P_esmaspäev E E_teisipäev T T_kolmapäev K K_neljapäev N N_reede R R_laupäev L L'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'paar sekundit',  '44 seconds = paar sekundit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'üks minut',      '45 seconds = üks minut');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'üks minut',      '89 seconds = üks minut');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutit',      '90 seconds = 2 minutit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutit',     '44 minutes = 44 minutit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'üks tund',       '45 minutes = tund aega');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'üks tund',       '89 minutes = üks tund');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 tundi',        '90 minutes = 2 tundi');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 tundi',        '5 hours = 5 tundi');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 tundi',       '21 hours = 21 tundi');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'üks päev',       '22 hours = üks päev');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'üks päev',       '35 hours = üks päev');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 päeva',        '36 hours = 2 päeva');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'üks päev',       '1 day = üks päev');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 päeva',        '5 days = 5 päeva');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 päeva',       '25 days = 25 päeva');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'üks kuu',        '26 days = üks kuu');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'üks kuu',        '30 days = üks kuu');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'üks kuu',        '43 days = üks kuu');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 kuud',         '46 days = 2 kuud');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 kuud',         '75 days = 2 kuud');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 kuud',         '76 days = 3 kuud');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'üks kuu',        '1 month = üks kuu');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 kuud',         '5 months = 5 kuud');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'üks aasta',      '345 days = üks aasta');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 aastat',       '548 days = 2 aastat');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'üks aasta',      '1 year = üks aasta');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 aastat',       '5 years = 5 aastat');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'mõne sekundi pärast',  'prefix');\n        assert.equal(moment(0).from(30000), 'mõni sekund tagasi', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'mõni sekund tagasi',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'mõne sekundi pärast', 'in a few seconds');\n        assert.equal(moment().subtract({s: 30}).fromNow(), 'mõni sekund tagasi', 'a few seconds ago');\n\n        assert.equal(moment().add({m: 1}).fromNow(), 'ühe minuti pärast', 'in a minute');\n        assert.equal(moment().subtract({m: 1}).fromNow(), 'üks minut tagasi', 'a minute ago');\n\n        assert.equal(moment().add({m: 5}).fromNow(), '5 minuti pärast', 'in 5 minutes');\n        assert.equal(moment().subtract({m: 5}).fromNow(), '5 minutit tagasi', '5 minutes ago');\n\n        assert.equal(moment().add({d: 1}).fromNow(), 'ühe päeva pärast', 'in one day');\n        assert.equal(moment().subtract({d: 1}).fromNow(), 'üks päev tagasi', 'one day ago');\n\n        assert.equal(moment().add({d: 5}).fromNow(), '5 päeva pärast', 'in 5 days');\n        assert.equal(moment().subtract({d: 5}).fromNow(), '5 päeva tagasi', '5 days ago');\n\n        assert.equal(moment().add({M: 1}).fromNow(), 'kuu aja pärast', 'in a month');\n        assert.equal(moment().subtract({M: 1}).fromNow(), 'kuu aega tagasi', 'a month ago');\n\n        assert.equal(moment().add({M: 5}).fromNow(), '5 kuu pärast', 'in 5 months');\n        assert.equal(moment().subtract({M: 5}).fromNow(), '5 kuud tagasi', '5 months ago');\n\n        assert.equal(moment().add({y: 1}).fromNow(), 'ühe aasta pärast', 'in a year');\n        assert.equal(moment().subtract({y: 1}).fromNow(), 'aasta tagasi', 'a year ago');\n\n        assert.equal(moment().add({y: 5}).fromNow(), '5 aasta pärast', 'in 5 years');\n        assert.equal(moment().subtract({y: 5}).fromNow(), '5 aastat tagasi', '5 years ago');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Täna, 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Täna, 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Täna, 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Homme, 2:00',    'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Täna, 1:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Eile, 2:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[Järgmine] dddd LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Järgmine] dddd LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Järgmine] dddd LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Eelmine] dddd LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Eelmine] dddd LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Eelmine] dddd LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 nädal tagasi');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  '1 nädala pärast');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 nädalat tagasi');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  '2 nädala pärast');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('eu');\n\n    test('parse', function (assert) {\n        var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'igandea, otsaila 14. 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ig., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 otsaila ots.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. igandea ig. ig'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '2010ko otsailaren 14a'],\n                ['LLL',                                '2010ko otsailaren 14a 15:25'],\n                ['LLLL',                               'igandea, 2010ko otsailaren 14a 15:25'],\n                ['l',                                  '2010-2-14'],\n                ['ll',                                 '2010ko ots. 14a'],\n                ['lll',                                '2010ko ots. 14a 15:25'],\n                ['llll',                               'ig., 2010ko ots. 14a 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'igandea ig. ig_astelehena al. al_asteartea ar. ar_asteazkena az. az_osteguna og. og_ostirala ol. ol_larunbata lr. lr'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'segundo batzuk', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minutu bat',     '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minutu bat',     '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutu',       '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutu',      '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ordu bat',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ordu bat',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ordu',         '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ordu',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ordu',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'egun bat',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'egun bat',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 egun',         '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'egun bat',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 egun',         '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 egun',        '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'hilabete bat',   '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'hilabete bat',   '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'hilabete bat',   '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 hilabete',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 hilabete',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 hilabete',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'hilabete bat',   '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 hilabete',     '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'urte bat',       '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 urte',         '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'urte bat',       '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 urte',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'segundo batzuk barru',  'prefix');\n        assert.equal(moment(0).from(30000), 'duela segundo batzuk', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'duela segundo batzuk',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'segundo batzuk barru', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 egun barru', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'gaur 02:00etan',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'gaur 02:25etan',  'now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'gaur 03:00etan',  'now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'bihar 02:00etan', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'gaur 01:00etan',  'now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'atzo 02:00etan',  'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd LT[etan]'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd LT[etan]'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd LT[etan]'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[aurreko] dddd LT[etan]'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[aurreko] dddd LT[etan]'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[aurreko] dddd LT[etan]'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fa');\n\n    test('parse', function (assert) {\n        var tests = 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1) + ' instead is month ' + moment(input, mmm).month());\n        }\n        for (i = 0; i < 12; i++) {\n            equalTest(tests[i], 'MMM', i);\n            equalTest(tests[i], 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'یک\\u200cشنبه، فوریه ۱۴م ۲۰۱۰، ۳:۲۵:۵۰ بعد از ظهر'],\n                ['ddd, hA',                            'یک\\u200cشنبه، ۳بعد از ظهر'],\n                ['M Mo MM MMMM MMM',                   '۲ ۲م ۰۲ فوریه فوریه'],\n                ['YYYY YY',                            '۲۰۱۰ ۱۰'],\n                ['D Do DD',                            '۱۴ ۱۴م ۱۴'],\n                ['d do dddd ddd dd',                   '۰ ۰م یک\\u200cشنبه یک\\u200cشنبه ی'],\n                ['DDD DDDo DDDD',                      '۴۵ ۴۵م ۰۴۵'],\n                ['w wo ww',                            '۸ ۸م ۰۸'],\n                ['h hh',                               '۳ ۰۳'],\n                ['H HH',                               '۱۵ ۱۵'],\n                ['m mm',                               '۲۵ ۲۵'],\n                ['s ss',                               '۵۰ ۵۰'],\n                ['a A',                                'بعد از ظهر بعد از ظهر'],\n                ['DDDo [روز سال]',             '۴۵م روز سال'],\n                ['LTS',                                '۱۵:۲۵:۵۰'],\n                ['L',                                  '۱۴/۰۲/۲۰۱۰'],\n                ['LL',                                 '۱۴ فوریه ۲۰۱۰'],\n                ['LLL',                                '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'],\n                ['LLLL',                               'یک\\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'],\n                ['l',                                  '۱۴/۲/۲۰۱۰'],\n                ['ll',                                 '۱۴ فوریه ۲۰۱۰'],\n                ['lll',                                '۱۴ فوریه ۲۰۱۰ ۱۵:۲۵'],\n                ['llll',                               'یک\\u200cشنبه، ۱۴ فوریه ۲۰۱۰ ۱۵:۲۵']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '۱م', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '۲م', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '۳م', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '۴م', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '۵م', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '۶م', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '۷م', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '۸م', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '۹م', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '۱۰م', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '۱۱م', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '۱۲م', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '۱۳م', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '۱۴م', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '۱۵م', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '۱۶م', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '۱۷م', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '۱۸م', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '۱۹م', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '۲۰م', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '۲۱م', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '۲۲م', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '۲۳م', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '۲۴م', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '۲۵م', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '۲۶م', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '۲۷م', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '۲۸م', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '۲۹م', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '۳۰م', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '۳۱م', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ژانویه ژانویه_فوریه فوریه_مارس مارس_آوریل آوریل_مه مه_ژوئن ژوئن_ژوئیه ژوئیه_اوت اوت_سپتامبر سپتامبر_اکتبر اکتبر_نوامبر نوامبر_دسامبر دسامبر'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'یک\\u200cشنبه یک\\u200cشنبه ی_دوشنبه دوشنبه د_سه\\u200cشنبه سه\\u200cشنبه س_چهارشنبه چهارشنبه چ_پنج\\u200cشنبه پنج\\u200cشنبه پ_جمعه جمعه ج_شنبه شنبه ش'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'چندین ثانیه', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'یک دقیقه',       '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'یک دقیقه',       '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '۲ دقیقه',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '۴۴ دقیقه',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'یک ساعت',     '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'یک ساعت',     '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '۲ ساعت',      '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '۵ ساعت',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '۲۱ ساعت',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'یک روز',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'یک روز',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '۲ روز',       '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'یک روز',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '۵ روز',       '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '۲۵ روز',      '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'یک ماه',      '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'یک ماه',      '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'یک ماه',      '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '۲ ماه',       '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '۲ ماه',       '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '۳ ماه',       '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'یک ماه',      '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '۵ ماه',       '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'یک سال',      '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '۲ سال',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'یک سال',      '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '۵ سال',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'در چندین ثانیه', 'prefix');\n        assert.equal(moment(0).from(30000), 'چندین ثانیه پیش', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'چندین ثانیه پیش',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'در چندین ثانیه', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'در ۵ روز', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'امروز ساعت ۰۲:۰۰', 'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'امروز ساعت ۰۲:۲۵', 'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'امروز ساعت ۰۳:۰۰', 'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'فردا ساعت ۰۲:۰۰', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'امروز ساعت ۰۱:۰۰', 'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'دیروز ساعت ۰۲:۰۰', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [ساعت] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [ساعت] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [ساعت] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [پیش ساعت] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [پیش ساعت] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [پیش ساعت] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '۱ ۰۱ ۱م', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '۱ ۰۱ ۱م', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fi');\n\n    test('parse', function (assert) {\n        var tests = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'sunnuntai, helmikuu 14. 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'su, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 helmikuu helmi'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. sunnuntai su su'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[vuoden] DDDo [päivä]',              'vuoden 45. päivä'],\n                ['LTS',                                '15.25.50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14. helmikuuta 2010'],\n                ['LLL',                                '14. helmikuuta 2010, klo 15.25'],\n                ['LLLL',                               'sunnuntai, 14. helmikuuta 2010, klo 15.25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14. helmi 2010'],\n                ['lll',                                '14. helmi 2010, klo 15.25'],\n                ['llll',                               'su, 14. helmi 2010, klo 15.25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'tammikuu tammi_helmikuu helmi_maaliskuu maalis_huhtikuu huhti_toukokuu touko_kesäkuu kesä_heinäkuu heinä_elokuu elo_syyskuu syys_lokakuu loka_marraskuu marras_joulukuu joulu'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'sunnuntai su su_maanantai ma ma_tiistai ti ti_keskiviikko ke ke_torstai to to_perjantai pe pe_lauantai la la'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'muutama sekunti', '44 seconds = few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minuutti',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minuutti',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  'kaksi minuuttia',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuuttia',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'tunti',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'tunti',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  'kaksi tuntia',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   'viisi tuntia',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 tuntia',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'päivä',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'päivä',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  'kaksi päivää',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'päivä',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   'viisi päivää',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 päivää',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'kuukausi',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'kuukausi',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'kuukausi',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  'kaksi kuukautta',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  'kaksi kuukautta',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  'kolme kuukautta',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'kuukausi',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   'viisi kuukautta',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'vuosi',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'kaksi vuotta',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'vuosi',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   'viisi vuotta',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'muutaman sekunnin päästä',  'prefix');\n        assert.equal(moment(0).from(30000), 'muutama sekunti sitten', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'muutama sekunti sitten',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'muutaman sekunnin päästä', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'viiden päivän päästä', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'tänään klo 02.00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'tänään klo 02.25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'tänään klo 03.00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'huomenna klo 02.00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'tänään klo 01.00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'eilen klo 02.00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [klo] LT'),  'today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [klo] LT'),  'today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [klo] LT'),  'today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[viime] dddd[na] [klo] LT'),  'today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[viime] dddd[na] [klo] LT'),  'today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[viime] dddd[na] [klo] LT'),  'today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  'yksi viikko sitten');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'yhden viikon päästä');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  'kaksi viikkoa sitten');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'kaden viikon päästä');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fo');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd [tann] Do MMMM YYYY, h:mm:ss a', 'sunnudagur tann 14. februar 2010, 3:25:50 pm'],\n                ['ddd hA',                             'sun 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. sunnudagur sun su'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[tann] DDDo [dagin á árinum]',       'tann 45. dagin á árinum'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 februar 2010'],\n                ['LLL',                                '14 februar 2010 15:25'],\n                ['LLLL',                               'sunnudagur 14. februar, 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 feb 2010'],\n                ['lll',                                '14 feb 2010 15:25'],\n                ['llll',                               'sun 14. feb, 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan_februar feb_mars mar_apríl apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'sunnudagur sun su_mánadagur mán má_týsdagur týs tý_mikudagur mik mi_hósdagur hós hó_fríggjadagur frí fr_leygardagur ley le'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'fá sekund', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ein minutt',    '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ein minutt',    '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuttir',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuttir', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ein tími',     '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ein tími',     '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 tímar',     '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 tímar',     '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 tímar',    '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ein dagur',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ein dagur',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagar',      '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ein dagur',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagar',      '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagar',     '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ein mánaði',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ein mánaði',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ein mánaði',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mánaðir',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mánaðir',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mánaðir',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ein mánaði',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mánaðir',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eitt ár',       '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'eitt ár',       '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ár',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'um fá sekund',  'prefix');\n        assert.equal(moment(0).from(30000), 'fá sekund síðani', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'fá sekund síðani',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'um fá sekund', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'um 5 dagar', 'in 5 days');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fr-ca');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'dimanche, février 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dim., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 février févr.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 dimanche dim. Di'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '14 février 2010'],\n                ['LLL',                                '14 février 2010 15:25'],\n                ['LLLL',                               'dimanche 14 février 2010 15:25'],\n                ['l',                                  '2010-2-14'],\n                ['ll',                                 '14 févr. 2010'],\n                ['lll',                                '14 févr. 2010 15:25'],\n                ['llll',                               'dim. 14 févr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'quelques secondes', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'une minute',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'une minute',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'une heure',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'une heure',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 heures',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 heures',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 heures',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un jour',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un jour',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 jours',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un jour',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 jours',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 jours',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mois',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mois',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mois',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mois',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mois',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mois',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mois',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mois',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un an',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ans',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix');\n        assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days');\n    });\n\n    test('same day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Aujourd\\'hui à 02:00',    'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Aujourd\\'hui à 02:25',    'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Aujourd\\'hui à 03:00',    'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Demain à 02:00',         'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Aujourd\\'hui à 01:00',    'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Hier à 02:00',           'yesterday at the same time');\n    });\n\n    test('same next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('same last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('same all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1er', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1er', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fr');\n\n    test('parse', function (assert) {\n        var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'dimanche, février 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dim., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 février févr.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 dimanche dim. Di'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '6 6 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 février 2010'],\n                ['LLL',                                '14 février 2010 15:25'],\n                ['LLLL',                               'dimanche 14 février 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 févr. 2010'],\n                ['lll',                                '14 févr. 2010 15:25'],\n                ['llll',                               'dim. 14 févr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'dimanche dim. Di_lundi lun. Lu_mardi mar. Ma_mercredi mer. Me_jeudi jeu. Je_vendredi ven. Ve_samedi sam. Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'quelques secondes', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'une minute',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'une minute',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutes',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutes', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'une heure',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'une heure',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 heures',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 heures',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 heures',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un jour',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un jour',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 jours',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un jour',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 jours',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 jours',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mois',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mois',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mois',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mois',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mois',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mois',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mois',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mois',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ans',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un an',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ans',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dans quelques secondes', 'prefix');\n        assert.equal(moment(0).from(30000), 'il y a quelques secondes', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dans quelques secondes', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'dans 5 jours', 'in 5 days');\n    });\n\n    test('same day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Aujourd\\'hui à 02:00',    'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Aujourd\\'hui à 02:25',    'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Aujourd\\'hui à 03:00',    'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Demain à 02:00',         'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Aujourd\\'hui à 01:00',    'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Hier à 02:00',           'yesterday at the same time');\n    });\n\n    test('same next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [à] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('same last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [dernier à] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('same all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'), '1 01 1er', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '1 01 1er', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('fy');\n\n    test('parse', function (assert) {\n        var tests = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai._juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, HH:mm:ss',       'snein, febrewaris 14de 2010, 15:25:50'],\n                ['ddd, HH',                            'si., 15'],\n                ['M Mo MM MMMM MMM',                   '2 2de 02 febrewaris feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14de 14'],\n                ['d do dddd ddd dd',                   '0 0de snein si. Si'],\n                ['DDD DDDo DDDD',                      '45 45ste 045'],\n                ['w wo ww',                            '6 6de 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45ste day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14-02-2010'],\n                ['LL',                                 '14 febrewaris 2010'],\n                ['LLL',                                '14 febrewaris 2010 15:25'],\n                ['LLLL',                               'snein 14 febrewaris 2010 15:25'],\n                ['l',                                  '14-2-2010'],\n                ['ll',                                 '14 feb. 2010'],\n                ['lll',                                '14 feb. 2010 15:25'],\n                ['llll',                               'si. 14 feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'jannewaris jan._febrewaris feb._maart mrt._april apr._maaie mai_juny jun._july jul._augustus aug._septimber sep._oktober okt._novimber nov._desimber des.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'snein si. Si_moandei mo. Mo_tiisdei ti. Ti_woansdei wo. Wo_tongersdei to. To_freed fr. Fr_sneon so. So'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'in pear sekonden', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ien minút',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ien minút',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuten',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuten',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ien oere',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ien oere',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 oeren',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 oeren',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 oeren',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ien dei',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ien dei',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagen',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ien dei',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagen',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagen',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ien moanne',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ien moanne',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ien moanne',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 moannen',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 moannen',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 moannen',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ien moanne',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 moannen',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ien jier',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jierren',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ien jier',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 jierren',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'oer in pear sekonden',  'prefix');\n        assert.equal(moment(0).from(30000), 'in pear sekonden lyn', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'in pear sekonden lyn',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'oer in pear sekonden', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'oer 5 dagen', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'hjoed om 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'hjoed om 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'hjoed om 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'moarn om 02:00',    'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'hjoed om 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'juster om 02:00',   'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[ôfrûne] dddd [om] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[ôfrûne] dddd [om] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[ôfrûne] dddd [om] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('month abbreviation', function (assert) {\n        assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot');\n        assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52ste', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1ste', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1ste', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),    '2 02 2de', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),    '2 02 2de', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('gl');\n\n    test('parse', function (assert) {\n        var tests = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Domingo, Febreiro 14º 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Dom., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2º 02 Febreiro Feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14º 14'],\n                ['d do dddd ddd dd',                   '0 0º Domingo Dom. Do'],\n                ['DDD DDDo DDDD',                      '45 45º 045'],\n                ['w wo ww',                            '7 7º 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45º day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Febreiro 2010'],\n                ['LLL',                                '14 Febreiro 2010 15:25'],\n                ['LLLL',                               'Domingo 14 Febreiro 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb. 2010'],\n                ['lll',                                '14 Feb. 2010 15:25'],\n                ['llll',                               'Dom. 14 Feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Outubro Out._Novembro Nov._Decembro Dec.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Domingo Dom. Do_Luns Lun. Lu_Martes Mar. Ma_Mércores Mér. Mé_Xoves Xov. Xo_Venres Ven. Ve_Sábado Sáb. Sá'.split('_'),\n        i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'uns segundos', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'un minuto',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'un minuto',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutos',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutos',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'unha hora',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'unha hora',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 horas',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 horas',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 horas',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un día',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un día',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 días',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un día',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 días',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 días',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mes',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mes',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mes',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meses',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meses',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 meses',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mes',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 meses',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un ano',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un ano',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 anos',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'nuns segundos',  'prefix');\n        assert.equal(moment(0).from(30000), 'hai uns segundos', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'hai uns segundos',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'nuns segundos', 'en unos segundos');\n        assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                         'hoxe ás 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),          'hoxe ás 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),           'hoxe ás 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),           'mañá ás 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).add({d: 1, h : -1}).calendar(),   'mañá á 1:00',   'tomorrow minus 1 hour');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),      'hoxe á 1:00',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),      'onte á 2:00',    'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('regression tests', function (assert) {\n        var lastWeek = moment().subtract({d: 4}).hours(1);\n        assert.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), '1 o\\'clock bug');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1º', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1º', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2º', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2º', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3º', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('he');\n\n    test('parse', function (assert) {\n        var tests = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'ראשון, פברואר 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'א׳, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 פברואר פבר׳'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 ראשון א׳ א'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 בפברואר 2010'],\n                ['LLL',                                '14 בפברואר 2010 15:25'],\n                ['LLLL',                               'ראשון, 14 בפברואר 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 פבר׳ 2010'],\n                ['lll',                                '14 פבר׳ 2010 15:25'],\n                ['llll',                               'א׳, 14 פבר׳ 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ינואר ינו׳_פברואר פבר׳_מרץ מרץ_אפריל אפר׳_מאי מאי_יוני יוני_יולי יולי_אוגוסט אוג׳_ספטמבר ספט׳_אוקטובר אוק׳_נובמבר נוב׳_דצמבר דצמ׳'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'ראשון א׳ א|שני ב׳ ב|שלישי ג׳ ג|רביעי ד׳ ד|חמישי ה׳ ה|שישי ו׳ ו|שבת ש׳ ש'.split('|'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'מספר שניות', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'דקה',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'דקה',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 דקות',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 דקות',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'שעה',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'שעה',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  'שעתיים',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 שעות',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 שעות',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'יום',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'יום',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  'יומיים',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'יום',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 ימים',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 ימים',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'חודש',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'חודש',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'חודש',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  'חודשיים',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  'חודשיים',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 חודשים',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'חודש',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 חודשים',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'שנה',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'שנתיים',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 3699}), true), '10 שנים',        '345 days = 10 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 7340}), true), '20 שנה',       '548 days = 20 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'שנה',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 שנים',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'בעוד מספר שניות',  'prefix');\n        assert.equal(moment(0).from(30000), 'לפני מספר שניות', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'לפני מספר שניות',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'בעוד מספר שניות', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'בעוד 5 ימים', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'היום ב־02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'היום ב־02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'היום ב־03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'מחר ב־02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'היום ב־01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'אתמול ב־02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [בשעה] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [בשעה] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [בשעה] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[ביום] dddd [האחרון בשעה] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[ביום] dddd [האחרון בשעה] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[ביום] dddd [האחרון בשעה] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('hi');\n\n    test('parse', function (assert) {\n        var tests = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, a h:mm:ss बजे',  'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५:५० बजे'],\n                ['ddd, a h बजे',                       'रवि, दोपहर ३ बजे'],\n                ['M Mo MM MMMM MMM',                   '२ २ ०२ फ़रवरी फ़र.'],\n                ['YYYY YY',                            '२०१० १०'],\n                ['D Do DD',                            '१४ १४ १४'],\n                ['d do dddd ddd dd',                   '० ० रविवार रवि र'],\n                ['DDD DDDo DDDD',                      '४५ ४५ ०४५'],\n                ['w wo ww',                            '८ ८ ०८'],\n                ['h hh',                               '३ ०३'],\n                ['H HH',                               '१५ १५'],\n                ['m mm',                               '२५ २५'],\n                ['s ss',                               '५० ५०'],\n                ['a A',                                'दोपहर दोपहर'],\n                ['LTS',                                'दोपहर ३:२५:५० बजे'],\n                ['L',                                  '१४/०२/२०१०'],\n                ['LL',                                 '१४ फ़रवरी २०१०'],\n                ['LLL',                                '१४ फ़रवरी २०१०, दोपहर ३:२५ बजे'],\n                ['LLLL',                               'रविवार, १४ फ़रवरी २०१०, दोपहर ३:२५ बजे'],\n                ['l',                                  '१४/२/२०१०'],\n                ['ll',                                 '१४ फ़र. २०१०'],\n                ['lll',                                '१४ फ़र. २०१०, दोपहर ३:२५ बजे'],\n                ['llll',                               'रवि, १४ फ़र. २०१०, दोपहर ३:२५ बजे']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'जनवरी जन._फ़रवरी फ़र._मार्च मार्च_अप्रैल अप्रै._मई मई_जून जून_जुलाई जुल._अगस्त अग._सितम्बर सित._अक्टूबर अक्टू._नवम्बर नव._दिसम्बर दिस.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'रविवार रवि र_सोमवार सोम सो_मंगलवार मंगल मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'कुछ ही क्षण', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'एक मिनट',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'एक मिनट',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '२ मिनट',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '४४ मिनट',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'एक घंटा',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'एक घंटा',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '२ घंटे',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '५ घंटे',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '२१ घंटे',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'एक दिन',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'एक दिन',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '२ दिन',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'एक दिन',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '५ दिन',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '२५ दिन',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'एक महीने',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'एक महीने',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'एक महीने',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '२ महीने',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '२ महीने',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '३ महीने',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'एक महीने',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '५ महीने',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्ष',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'एक वर्ष',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '५ वर्ष',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'कुछ ही क्षण में',  'prefix');\n        assert.equal(moment(0).from(30000), 'कुछ ही क्षण पहले', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'कुछ ही क्षण पहले',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'कुछ ही क्षण में', 'कुछ ही क्षण में');\n        assert.equal(moment().add({d: 5}).fromNow(), '५ दिन में', '५ दिन में');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'आज रात २:०० बजे',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'आज रात २:२५ बजे',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 3}).calendar(),       'आज सुबह ५:०० बजे',     'Now plus 3 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'कल रात २:०० बजे',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'आज रात १:०० बजे',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'कल रात २:०० बजे', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[पिछले] dddd[,] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[पिछले] dddd[,] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[पिछले] dddd[,] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem invariant', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'रात', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'सुबह', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दोपहर', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'शाम', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'शाम', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'रात', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'सुबह', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दोपहर', ' during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'शाम', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'शाम', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '१ ०१ १', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '१ ०१ १', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '२ ०२ २', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('hr');\n\n    test('parse', function (assert) {\n        var tests = 'sječanj sje._veljača vel._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'nedjelja, 14. veljača 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ned., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 veljača vel.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. nedjelja ned. ne'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14. 02. 2010'],\n                ['LL',                                 '14. veljača 2010'],\n                ['LLL',                                '14. veljača 2010 15:25'],\n                ['LLLL',                               'nedjelja, 14. veljača 2010 15:25'],\n                ['l',                                  '14. 2. 2010'],\n                ['ll',                                 '14. vel. 2010'],\n                ['lll',                                '14. vel. 2010 15:25'],\n                ['llll',                               'ned., 14. vel. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'sječanj sje._veljača vel._ožujak ožu._travanj tra._svibanj svi._lipanj lip._srpanj srp._kolovoz kol._rujan ruj._listopad lis._studeni stu._prosinac pro.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'nedjelja ned. ne_ponedjeljak pon. po_utorak uto. ut_srijeda sri. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'par sekundi', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'jedna minuta',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'jedna minuta',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minute',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuta',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'jedan sat',      '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'jedan sat',      '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 sata',        '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 sati',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 sati',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'dan',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'dan',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dana',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'dan',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dana',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dana',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mjesec',     '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mjesec',     '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mjesec',     '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mjeseca',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mjeseca',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mjeseca',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mjesec',     '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mjeseci',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'godinu',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 godina',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za par sekundi',  'prefix');\n        assert.equal(moment(0).from(30000), 'prije par sekundi', 'prefix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'prije par sekundi',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za par sekundi', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'danas u 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'danas u 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'danas u 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'sutra u 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'danas u 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'jučer u 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[u] [nedjelju] [u] LT';\n            case 3:\n                return '[u] [srijedu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n                return '[prošlu] dddd [u] LT';\n            case 6:\n                return '[prošle] [subote] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prošli] dddd [u] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('hu');\n\n    test('parse', function (assert) {\n        var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, HH:mm:ss',      'vasárnap, február 14. 2010, 15:25:50'],\n                ['ddd, HH',                            'vas, 15'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 február feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. vasárnap vas v'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['[az év] DDDo [napja]',               'az év 45. napja'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010.02.14.'],\n                ['LL',                                 '2010. február 14.'],\n                ['LLL',                                '2010. február 14., 15:25'],\n                ['LLLL',                               '2010. február 14., vasárnap 15:25'],\n                ['l',                                  '2010.2.14.'],\n                ['ll',                                 '2010. feb 14.'],\n                ['lll',                                '2010. feb 14., 15:25'],\n                ['llll',                               '2010. feb 14., vas 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  0,  0]).format('a'), 'de', 'am');\n        assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), 'de', 'am');\n        assert.equal(moment([2011, 2, 23, 12,  0]).format('a'), 'du', 'pm');\n        assert.equal(moment([2011, 2, 23, 23, 59]).format('a'), 'du', 'pm');\n\n        assert.equal(moment([2011, 2, 23,  0,  0]).format('A'), 'DE', 'AM');\n        assert.equal(moment([2011, 2, 23, 11, 59]).format('A'), 'DE', 'AM');\n        assert.equal(moment([2011, 2, 23, 12,  0]).format('A'), 'DU', 'PM');\n        assert.equal(moment([2011, 2, 23, 23, 59]).format('A'), 'DU', 'PM');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'vasárnap vas_hétfő hét_kedd kedd_szerda sze_csütörtök csüt_péntek pén_szombat szo'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'néhány másodperc', '44 másodperc = néhány másodperc');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'egy perc',         '45 másodperc = egy perc');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'egy perc',         '89 másodperc = egy perc');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 perc',           '90 másodperc = 2 perc');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 perc',          '44 perc = 44 perc');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'egy óra',          '45 perc = egy óra');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'egy óra',          '89 perc = egy óra');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 óra',            '90 perc = 2 óra');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 óra',            '5 óra = 5 óra');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 óra',           '21 óra = 21 óra');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'egy nap',          '22 óra = egy nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'egy nap',          '35 óra = egy nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 nap',            '36 óra = 2 nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'egy nap',          '1 nap = egy nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 nap',            '5 nap = 5 nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 nap',           '25 nap = 25 nap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'egy hónap',        '26 nap = egy hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'egy hónap',        '30 nap = egy hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'egy hónap',        '45 nap = egy hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 hónap',          '46 nap = 2 hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 hónap',          '75 nap = 2 hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 hónap',          '76 nap = 3 hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'egy hónap',        '1 hónap = egy hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 hónap',          '5 hónap = 5 hónap');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'egy év',           '345 nap = egy év');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 év',             '548 nap = 2 év');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'egy év',           '1 év = egy év');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 év',             '5 év = 5 év');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'néhány másodperc múlva',  'prefix');\n        assert.equal(moment(0).from(30000), 'néhány másodperce', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'néhány másodperce',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'néhány másodperc múlva', 'néhány másodperc múlva');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 nap múlva', '5 nap múlva');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'ma 2:00-kor',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'ma 2:25-kor',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'ma 3:00-kor',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'holnap 2:00-kor', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'ma 1:00-kor',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'tegnap 2:00-kor', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[' + days[m.day()] + '] LT[-kor]'),  'today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[' + days[m.day()] + '] LT[-kor]'),  'today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[' + days[m.day()] + '] LT[-kor]'),  'today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[múlt ' + days[m.day()] + '] LT[-kor]'),  'today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[múlt ' + days[m.day()] + '] LT[-kor]'),  'today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[múlt ' + days[m.day()] + '] LT[-kor]'),  'today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  'egy héte');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'egy hét múlva');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 hete');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  '2 hét múlva');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('hy-am');\n\n    test('parse', function (assert) {\n        var tests = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('parse exceptional case', function (assert) {\n        assert.equal(moment('11 մայիսի 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989');\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, HH:mm:ss',       'կիրակի, 14 փետրվարի 2010, 15:25:50'],\n                ['ddd, h A',                           'կրկ, 3 ցերեկվա'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 փետրվար փտր'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 կիրակի կրկ կրկ'],\n                ['DDD DDDo DDDD',                      '45 45-րդ 045'],\n                ['w wo ww',                            '7 7-րդ 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'ցերեկվա ցերեկվա'],\n                ['[տարվա] DDDo [օրը]',                 'տարվա 45-րդ օրը'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 փետրվարի 2010 թ.'],\n                ['LLL',                                '14 փետրվարի 2010 թ., 15:25'],\n                ['LLLL',                               'կիրակի, 14 փետրվարի 2010 թ., 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 փտր 2010 թ.'],\n                ['lll',                                '14 փտր 2010 թ., 15:25'],\n                ['llll',                               'կրկ, 14 փտր 2010 թ., 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format meridiem', function (assert) {\n        assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'գիշերվա', 'night');\n        assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'գիշերվա', 'night');\n        assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'առավոտվա', 'morning');\n        assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'առավոտվա', 'morning');\n        assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'ցերեկվա', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'ցերեկվա', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'երեկոյան', 'evening');\n        assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'երեկոյան', 'evening');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ին', '1-ին');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-րդ', '2-րդ');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-րդ', '3-րդ');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-րդ', '4-րդ');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-րդ', '5-րդ');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-րդ', '6-րդ');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-րդ', '7-րդ');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-րդ', '8-րդ');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-րդ', '9-րդ');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-րդ', '10-րդ');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-րդ', '11-րդ');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-րդ', '12-րդ');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-րդ', '13-րդ');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-րդ', '14-րդ');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-րդ', '15-րդ');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-րդ', '16-րդ');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-րդ', '17-րդ');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-րդ', '18-րդ');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-րդ', '19-րդ');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-րդ', '20-րդ');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-րդ', '21-րդ');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-րդ', '22-րդ');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-րդ', '23-րդ');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-րդ', '24-րդ');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-րդ', '25-րդ');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-րդ', '26-րդ');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-րդ', '27-րդ');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-րդ', '28-րդ');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-րդ', '29-րդ');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-րդ', '30-րդ');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-րդ', '31-րդ');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'հունվար հնվ_փետրվար փտր_մարտ մրտ_ապրիլ ապր_մայիս մյս_հունիս հնս_հուլիս հլս_օգոստոս օգս_սեպտեմբեր սպտ_հոկտեմբեր հկտ_նոյեմբեր նմբ_դեկտեմբեր դկտ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format month case', function (assert) {\n        var months = {\n            'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n            'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]);\n        }\n    });\n\n    test('format month short case', function (assert) {\n        var monthsShort = {\n            'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),\n            'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]);\n        }\n    });\n\n    test('format month case with escaped symbols', function (assert) {\n        var months = {\n            'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n            'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('[<i>]D[</i>] [<b>]MMMM[</b>]'), '<i>1</i> <b>' + months.accusative[i] + '</b>', '1 <b>' + months.accusative[i] + '</b>');\n            assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMMM'), '1-ին օրը ' + months.accusative[i], '1-ին օրը ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]);\n        }\n    });\n\n    test('format month short case with escaped symbols', function (assert) {\n        var monthsShort = {\n            'nominative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),\n            'accusative': 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('[<i>]D[</i>] [<b>]MMM[</b>]'), '<i>1</i> <b>' + monthsShort.accusative[i] + '</b>', '1 <b>' + monthsShort.accusative[i] + '</b>');\n            assert.equal(moment([2013, i, 1]).format('D[-ին օրը] MMM'), '1-ին օրը ' + monthsShort.accusative[i], '1-ին օրը ' + monthsShort.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'կիրակի կրկ կրկ_երկուշաբթի երկ երկ_երեքշաբթի երք երք_չորեքշաբթի չրք չրք_հինգշաբթի հնգ հնգ_ուրբաթ ուրբ ուրբ_շաբաթ շբթ շբթ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'մի քանի վայրկյան',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'րոպե',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'րոպե',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 րոպե',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 րոպե', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ժամ',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ժամ',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ժամ',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ժամ',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ժամ',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'օր',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'օր',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 օր',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'օր',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 օր',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true),  '11 օր',     '11 days = 11 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true),  '21 օր',     '21 days = 21 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 օր',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ամիս',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ամիս',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ամիս',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 ամիս',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 ամիս',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 ամիս',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ամիս',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 ամիս',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'տարի',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 տարի',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'տարի',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 տարի',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'մի քանի վայրկյան հետո', 'prefix');\n        assert.equal(moment(0).from(30000), 'մի քանի վայրկյան առաջ', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'մի քանի վայրկյան հետո', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 օր հետո', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'այսօր 02:00',   'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'այսօր 02:25',   'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'այսօր 03:00',   'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'վաղը 02:00',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'այսօր 01:00',   'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'երեկ 02:00',   'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        function makeFormat(d) {\n            return 'dddd [օրը ժամը] LT';\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            return '[անցած] dddd [օրը ժամը] LT';\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ին', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-ին', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-րդ', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-րդ', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-րդ', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('id');\n\n    test('parse', function (assert) {\n        var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Minggu, Februari 14 2010, 3:25:50 sore'],\n                ['ddd, hA',                            'Min, 3sore'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 Februari Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 Minggu Min Mg'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '7 7 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'sore sore'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15.25.50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Februari 2010'],\n                ['LLL',                                '14 Februari 2010 pukul 15.25'],\n                ['LLLL',                               'Minggu, 14 Februari 2010 pukul 15.25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb 2010'],\n                ['lll',                                '14 Feb 2010 pukul 15.25'],\n                ['llll',                               'Min, 14 Feb 2010 pukul 15.25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_November Nov_Desember Des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Minggu Min Mg_Senin Sen Sn_Selasa Sel Sl_Rabu Rab Rb_Kamis Kam Km_Jumat Jum Jm_Sabtu Sab Sb'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'beberapa detik', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'semenit',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'semenit',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 menit',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 menit',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'sejam',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'sejam',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 jam',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 jam',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 jam',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'sehari',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'sehari',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 hari',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'sehari',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 hari',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 hari',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'sebulan',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'sebulan',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'sebulan',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 bulan',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 bulan',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 bulan',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'sebulan',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 bulan',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'setahun',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 tahun',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dalam beberapa detik',  'prefix');\n        assert.equal(moment(0).from(30000), 'beberapa detik yang lalu', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'beberapa detik yang lalu',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa detik', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hari ini pukul 02.00', 'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hari ini pukul 02.25', 'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hari ini pukul 03.00', 'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Besok pukul 02.00',    'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hari ini pukul 01.00', 'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Kemarin pukul 02.00',  'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [lalu pukul] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [lalu pukul] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [lalu pukul] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('is');\n\n    test('parse', function (assert) {\n        var tests = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'sunnudagur, 14. febrúar 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 febrúar feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. sunnudagur sun Su'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14. febrúar 2010'],\n                ['LLL',                                '14. febrúar 2010 kl. 15:25'],\n                ['LLLL',                               'sunnudagur, 14. febrúar 2010 kl. 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14. feb 2010'],\n                ['lll',                                '14. feb 2010 kl. 15:25'],\n                ['llll',                               'sun, 14. feb 2010 kl. 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'janúar jan_febrúar feb_mars mar_apríl apr_maí maí_júní jún_júlí júl_ágúst ágú_september sep_október okt_nóvember nóv_desember des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'sunnudagur sun Su_mánudagur mán Má_þriðjudagur þri Þr_miðvikudagur mið Mi_fimmtudagur fim Fi_föstudagur fös Fö_laugardagur lau La'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'nokkrar sekúndur', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'mínúta',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'mínúta',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 mínútur',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 mínútur',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 21}), true),  '21 mínúta',    '21 minutes = 21 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'klukkustund',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'klukkustund',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 klukkustundir',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 klukkustundir',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 klukkustund',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'dagur',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'dagur',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagar',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'dagur',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagar',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagar',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true),  '11 dagar',       '11 days = 11 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true),  '21 dagur',       '21 days = 21 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mánuður',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mánuður',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mánuður',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mánuðir',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mánuðir',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mánuðir',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mánuður',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mánuðir',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ár',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ár',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ár',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ár',       '5 years = 5 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true),  '21 ár',       '21 years = 21 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'eftir nokkrar sekúndur',  'prefix');\n        assert.equal(moment(0).from(30000), 'fyrir nokkrum sekúndum síðan', 'suffix');\n        assert.equal(moment().subtract({m: 1}).fromNow(), 'fyrir mínútu síðan', 'a minute ago');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'fyrir nokkrum sekúndum síðan',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'eftir nokkrar sekúndur', 'in a few seconds');\n        assert.equal(moment().add({m: 1}).fromNow(), 'eftir mínútu', 'in a minute');\n        assert.equal(moment().add({d: 5}).fromNow(), 'eftir 5 daga', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'í dag kl. 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'í dag kl. 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'í dag kl. 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'á morgun kl. 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'í dag kl. 1:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'í gær kl. 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[síðasta] dddd [kl.] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[síðasta] dddd [kl.] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[síðasta] dddd [kl.] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('it');\n\n    test('parse', function (assert) {\n        var tests = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Domenica, febbraio 14º 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Dom, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2º 02 febbraio feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14º 14'],\n                ['d do dddd ddd dd',                   '0 0º Domenica Dom D'],\n                ['DDD DDDo DDDD',                      '45 45º 045'],\n                ['w wo ww',                            '6 6º 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45º day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 febbraio 2010'],\n                ['LLL',                                '14 febbraio 2010 15:25'],\n                ['LLLL',                               'Domenica, 14 febbraio 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 feb 2010'],\n                ['lll',                                '14 feb 2010 15:25'],\n                ['llll',                               'Dom, 14 feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'gennaio gen_febbraio feb_marzo mar_aprile apr_maggio mag_giugno giu_luglio lug_agosto ago_settembre set_ottobre ott_novembre nov_dicembre dic'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Domenica Dom D_Lunedì Lun L_Martedì Mar Ma_Mercoledì Mer Me_Giovedì Gio G_Venerdì Ven V_Sabato Sab S'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'alcuni secondi', '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'un minuto',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'un minuto',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuti',       '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuti',      '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'un\\'ora',        '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'un\\'ora',        '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ore',          '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ore',          '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ore',         '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'un giorno',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'un giorno',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 giorni',       '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'un giorno',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 giorni',       '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 giorni',      '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'un mese',        '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'un mese',        '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'un mese',        '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mesi',         '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mesi',         '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mesi',         '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'un mese',        '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mesi',         '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un anno',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anni',         '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un anno',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 anni',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'in alcuni secondi', 'prefix');\n        assert.equal(moment(0).from(30000), 'alcuni secondi fa', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'in alcuni secondi', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'tra 5 giorni', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                   'Oggi alle 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Oggi alle 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Oggi alle 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Domani alle 02:00',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Oggi alle 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Ieri alle 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [alle] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [alle] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [alle] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, weekday, datestring;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            // Different date string\n            weekday = parseInt(m.format('d'), 10);\n            datestring = (weekday === 0) ? '[la scorsa] dddd [alle] LT' : '[lo scorso] dddd [alle] LT';\n            assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format(datestring), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52º', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1º', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1º', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2º', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2º', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ja');\n\n    test('parse', function (assert) {\n        var tests = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, a h:mm:ss',      '日曜日, 2月 14 2010, 午後 3:25:50'],\n                ['ddd, Ah',                            '日, 午後3'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 2月 2月'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 日曜日 日 日'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                '午後 午後'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '午後3時25分50秒'],\n                ['L',                                  '2010/02/14'],\n                ['LL',                                 '2010年2月14日'],\n                ['LLL',                                '2010年2月14日午後3時25分'],\n                ['LLLL',                               '2010年2月14日午後3時25分 日曜日'],\n                ['l',                                  '2010/2/14'],\n                ['ll',                                 '2010年2月14日'],\n                ['lll',                                '2010年2月14日午後3時25分'],\n                ['llll',                               '2010年2月14日午後3時25分 日']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = '1月 1月_2月 2月_3月 3月_4月 4月_5月 5月_6月 6月_7月 7月_8月 8月_9月 9月_10月 10月_11月 11月_12月 12月'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = '日曜日 日 日_月曜日 月 月_火曜日 火 火_水曜日 水 水_木曜日 木 木_金曜日 金 金_土曜日 土 土'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '数秒',   '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '1分', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '1分', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2分',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44分', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '1時間', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '1時間', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2時間',  '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5時間',  '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21時間', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '1日',   '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '1日',   '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2日',   '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '1日',   '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5日',   '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25日',  '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '1ヶ月', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '1ヶ月', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '1ヶ月', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2ヶ月',  '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2ヶ月',  '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3ヶ月',  '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '1ヶ月', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5ヶ月',  '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1年',   '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年',   '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '1年',   '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5年',   '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), '数秒後',  'prefix');\n        assert.equal(moment(0).from(30000), '数秒前', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), '数秒前',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), '数秒後', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5日後', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     '今日 午前2時0分',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      '今日 午前2時25分',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       '今日 午前3時0分',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       '明日 午前2時0分',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  '今日 午前1時0分',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨日 午前2時0分',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[来週]dddd LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[来週]dddd LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[来週]dddd LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[前週]dddd LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[前週]dddd LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[前週]dddd LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ka');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' უნდა იყოს თვე ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a', 'კვირა, თებერვალი მე-14 2010, 3:25:50 pm'],\n                ['ddd, hA',                       'კვი, 3PM'],\n                ['M Mo MM MMMM MMM',              '2 მე-2 02 თებერვალი თებ'],\n                ['YYYY YY',                       '2010 10'],\n                ['D Do DD',                       '14 მე-14 14'],\n                ['d do dddd ddd dd',              '0 0 კვირა კვი კვ'],\n                ['DDD DDDo DDDD',                 '45 45-ე 045'],\n                ['w wo ww',                       '7 მე-7 07'],\n                ['h hh',                          '3 03'],\n                ['H HH',                          '15 15'],\n                ['m mm',                          '25 25'],\n                ['s ss',                          '50 50'],\n                ['a A',                           'pm PM'],\n                ['წლის DDDo დღე',                 'წლის 45-ე დღე'],\n                ['LTS',                           '3:25:50 PM'],\n                ['L',                             '14/02/2010'],\n                ['LL',                            '14 თებერვალი 2010'],\n                ['LLL',                           '14 თებერვალი 2010 3:25 PM'],\n                ['LLLL',                          'კვირა, 14 თებერვალი 2010 3:25 PM'],\n                ['l',                             '14/2/2010'],\n                ['ll',                            '14 თებ 2010'],\n                ['lll',                           '14 თებ 2010 3:25 PM'],\n                ['llll',                          'კვი, 14 თებ 2010 3:25 PM']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'),  '1-ლი',  '1-ლი');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'),  'მე-2',  'მე-2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'),  'მე-3',  'მე-3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'),  'მე-4',  'მე-4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'),  'მე-5',  'მე-5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'),  'მე-6',  'მე-6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'),  'მე-7',  'მე-7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'),  'მე-8',  'მე-8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'),  'მე-9',  'მე-9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), 'მე-10', 'მე-10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), 'მე-11', 'მე-11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), 'მე-12', 'მე-12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), 'მე-13', 'მე-13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), 'მე-14', 'მე-14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), 'მე-15', 'მე-15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), 'მე-16', 'მე-16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), 'მე-17', 'მე-17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), 'მე-18', 'მე-18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), 'მე-19', 'მე-19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), 'მე-20', 'მე-20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ე', '21-ე');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ე', '22-ე');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ე', '23-ე');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ე', '24-ე');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ე', '25-ე');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ე', '26-ე');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ე', '27-ე');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ე', '28-ე');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ე', '29-ე');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ე', '30-ე');\n\n        assert.equal(moment('2011 40', 'YYYY DDD').format('DDDo'),  'მე-40',  'მე-40');\n        assert.equal(moment('2011 50', 'YYYY DDD').format('DDDo'),  '50-ე',   '50-ე');\n        assert.equal(moment('2011 60', 'YYYY DDD').format('DDDo'),  'მე-60',  'მე-60');\n        assert.equal(moment('2011 100', 'YYYY DDD').format('DDDo'), 'მე-100', 'მე-100');\n        assert.equal(moment('2011 101', 'YYYY DDD').format('DDDo'), '101-ე',  '101-ე');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'იანვარი იან_თებერვალი თებ_მარტი მარ_აპრილი აპრ_მაისი მაი_ივნისი ივნ_ივლისი ივლ_აგვისტო აგვ_სექტემბერი სექ_ოქტომბერი ოქტ_ნოემბერი ნოე_დეკემბერი დეკ'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'კვირა კვი კვ_ორშაბათი ორშ ორ_სამშაბათი სამ სა_ოთხშაბათი ოთხ ოთ_ხუთშაბათი ხუთ ხუ_პარასკევი პარ პა_შაბათი შაბ შა'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}),  true), 'რამდენიმე წამი', '44 წამი  = რამდენიმე წამი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}),  true), 'წუთი',           '45 წამი  = წუთი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}),  true), 'წუთი',           '89 წამი  = წუთი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}),  true), '2 წუთი',         '90 წამი  = 2 წუთი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}),  true), '44 წუთი',        '44 წამი  = 44 წუთი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}),  true), 'საათი',          '45 წამი  = საათი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}),  true), 'საათი',          '89 წამი  = საათი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}),  true), '2 საათი',        '90 წამი  = 2 საათი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}),   true), '5 საათი',        '5 საათი  = 5 საათი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}),  true), '21 საათი',       '21 საათი = 21 საათი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}),  true), 'დღე',            '22 საათი = დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}),  true), 'დღე',            '35 საათი = დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}),  true), '2 დღე',          '36 საათი = 2 დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}),   true), 'დღე',            '1 დღე    = დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}),   true), '5 დღე',          '5 დღე    = 5 დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}),  true), '25 დღე',         '25 დღე   = 25 დღე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}),  true), 'თვე',            '26 დღე   = თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}),  true), 'თვე',            '30 დღე   = თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}),  true), 'თვე',            '45 დღე   = თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}),  true), '2 თვე',          '46 დღე   = 2 თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}),  true), '2 თვე',          '75 დღე   = 2 თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}),  true), '3 თვე',          '76 დღე   = 3 თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}),   true), 'თვე',            '1 თვე    = თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}),   true), '5 თვე',          '5 თვე    = 5 თვე');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'წელი',           '345 დღე  = წელი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 წელი',         '548 დღე  = 2 წელი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}),   true), 'წელი',           '1 წელი   = წელი');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}),   true), '5 წელი',         '5 წელი   = 5 წელი');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'რამდენიმე წამში',     'ში სუფიქსი');\n        assert.equal(moment(0).from(30000), 'რამდენიმე წამის წინ', 'წინ სუფიქსი');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'რამდენიმე წამის წინ', 'უნდა აჩვენოს როგორც წარსული');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'რამდენიმე წამში', 'რამდენიმე წამში');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 დღეში', '5 დღეში');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'დღეს 2:00 AM-ზე',  'დღეს ამავე დროს');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'დღეს 2:25 AM-ზე',  'ახლანდელ დროს დამატებული 25 წუთი');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'დღეს 3:00 AM-ზე',  'ახლანდელ დროს დამატებული 1 საათი');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'ხვალ 2:00 AM-ზე',  'ხვალ ამავე დროს');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'დღეს 1:00 AM-ზე',  'ახლანდელ დროს გამოკლებული 1 საათი');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'გუშინ 2:00 AM-ზე', 'გუშინ ამავე დროს');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[შემდეგ] dddd LT[-ზე]'),  'დღეს + ' + i + ' დღე ახლანდელ დროს');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[შემდეგ] dddd LT[-ზე]'),  'დღეს + ' + i + ' დღე დღის დასაწყისში');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[შემდეგ] dddd LT[-ზე]'),  'დღეს + ' + i + ' დღე დღის დასასრულს');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[წინა] dddd LT[-ზე]'),  'დღეს - ' + i + ' დღე ახლანდელ დროს');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[წინა] dddd LT[-ზე]'),  'დღეს - ' + i + ' დღე დღის დასაწყისში');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[წინა] dddd LT[-ზე]'),  'დღეს - ' + i + ' დღე დღის დასასრულს');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 კვირის წინ');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  '1 კვირაში');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 კვირის წინ');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  '2 კვირაში');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'დეკ 26 2011 უნდა იყოს კვირა 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'იან  1 2012 უნდა იყოს კვირა 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'იან  2 2012 უნდა იყოს კვირა 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'იან  8 2012 უნდა იყოს კვირა 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'იან  9 2012 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'იან  1 2007 უნდა იყოს კვირა 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'იან  7 2007 უნდა იყოს კვირა 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'იან  8 2007 უნდა იყოს კვირა 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'იან 14 2007 უნდა იყოს კვირა 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'იან 15 2007 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'დეკ 31 2007 უნდა იყოს კვირა 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'იან  1 2008 უნდა იყოს კვირა 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'იან  6 2008 უნდა იყოს კვირა 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'იან  7 2008 უნდა იყოს კვირა 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'იან 13 2008 უნდა იყოს კვირა 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'იან 14 2008 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'დეკ 30 2002 უნდა იყოს კვირა 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'იან  1 2003 უნდა იყოს კვირა 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'იან  5 2003 უნდა იყოს კვირა 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'იან  6 2003 უნდა იყოს კვირა 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'იან 12 2003 უნდა იყოს კვირა 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'იან 13 2003 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'დეკ 29 2008 უნდა იყოს კვირა 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'იან  1 2009 უნდა იყოს კვირა 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'იან  4 2009 უნდა იყოს კვირა 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'იან  5 2009 უნდა იყოს კვირა 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'იან 11 2009 უნდა იყოს კვირა 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'იან 12 2009 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'დეკ 28 2009 უნდა იყოს კვირა 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'იან  1 2010 უნდა იყოს კვირა 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'იან  3 2010 უნდა იყოს კვირა 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'იან  4 2010 უნდა იყოს კვირა 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'იან 10 2010 უნდა იყოს კვირა 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'იან 11 2010 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'დეკ 27 2010 უნდა იყოს კვირა 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'იან  1 2011 უნდა იყოს კვირა 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'იან  2 2011 უნდა იყოს კვირა 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'იან  3 2011 უნდა იყოს კვირა 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'იან  9 2011 უნდა იყოს კვირა 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'იან 10 2011 უნდა იყოს კვირა 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ლი', 'დეკ 26 2011 უნდა იყოს კვირა 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-ლი', 'იან  1 2012 უნდა იყოს კვირა 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 მე-2', 'იან  2 2012 უნდა იყოს კვირა 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 მე-2', 'იან  8 2012 უნდა იყოს კვირა 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 მე-3', 'იან  9 2012 უნდა იყოს კვირა 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('km');\n\n    test('parse', function (assert) {\n        var tests = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'),\n            i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'],\n                ['ddd, hA', 'អាទិត្យ, 3PM'],\n                ['M Mo MM MMMM MMM', '2 2 02 កុម្ភៈ កុម្ភៈ'],\n                ['YYYY YY', '2010 10'],\n                ['D Do DD', '14 14 14'],\n                ['d do dddd ddd dd', '0 0 អាទិត្យ អាទិត្យ អាទិត្យ'],\n                ['DDD DDDo DDDD', '45 45 045'],\n                ['w wo ww', '6 6 06'],\n                ['h hh', '3 03'],\n                ['H HH', '15 15'],\n                ['m mm', '25 25'],\n                ['s ss', '50 50'],\n                ['a A', 'pm PM'],\n                ['[the] DDDo [day of the year]', 'the 45 day of the year'],\n                ['LTS', '15:25:50'],\n                ['L', '14/02/2010'],\n                ['LL', '14 កុម្ភៈ 2010'],\n                ['LLL', '14 កុម្ភៈ 2010 15:25'],\n                ['LLLL', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'],\n                ['l', '14/2/2010'],\n                ['ll', '14 កុម្ភៈ 2010'],\n                ['lll', '14 កុម្ភៈ 2010 15:25'],\n                ['llll', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21st');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22nd');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23rd');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'មករា មករា_កុម្ភៈ កុម្ភៈ_មិនា មិនា_មេសា មេសា_ឧសភា ឧសភា_មិថុនា មិថុនា_កក្កដា កក្កដា_សីហា សីហា_កញ្ញា កញ្ញា_តុលា តុលា_វិច្ឆិកា វិច្ឆិកា_ធ្នូ ធ្នូ'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'អាទិត្យ អាទិត្យ អាទិត្យ_ច័ន្ទ ច័ន្ទ ច័ន្ទ_អង្គារ អង្គារ អង្គារ_ពុធ ពុធ ពុធ_ព្រហស្បតិ៍ ព្រហស្បតិ៍ ព្រហស្បតិ៍_សុក្រ សុក្រ សុក្រ_សៅរ៍ សៅរ៍ សៅរ៍'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ប៉ុន្មានវិនាទី', '44 seconds = ប៉ុន្មានវិនាទី');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'មួយនាទី', '45 seconds = មួយនាទី');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'មួយនាទី', '89 seconds = មួយនាទី');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 នាទី', '90 seconds = 2 នាទី');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 នាទី', '44 minutes = 44 នាទី');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'មួយម៉ោង', '45 minutes = មួយម៉ោង');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'មួយម៉ោង', '89 minutes = មួយម៉ោង');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 ម៉ោង', '90 minutes = 2 ម៉ោង');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 ម៉ោង', '5 hours = 5 ម៉ោង');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 ម៉ោង', '21 hours = 21 ម៉ោង');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'មួយថ្ងៃ', '22 hours = មួយថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'មួយថ្ងៃ', '35 hours = មួយថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 ថ្ងៃ', '36 hours = 2 ថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'មួយថ្ងៃ', '1 day = មួយថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 ថ្ងៃ', '5 days = 5 ថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 ថ្ងៃ', '25 days = 25 ថ្ងៃ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'មួយខែ', '26 days = មួយខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'មួយខែ', '30 days = មួយខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'មួយខែ', '43 days = មួយខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 ខែ', '46 days = 2 ខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 ខែ', '75 days = 2 ខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 ខែ', '76 days = 3 ខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'មួយខែ', '1 month = មួយខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 ខែ', '5 months = 5 ខែ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'មួយឆ្នាំ', '345 days = មួយឆ្នាំ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ឆ្នាំ', '548 days = 2 ឆ្នាំ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'មួយឆ្នាំ', '1 year = មួយឆ្នាំ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 ឆ្នាំ', '5 years = 5 ឆ្នាំ');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'ប៉ុន្មានវិនាទីទៀត', 'prefix');\n        assert.equal(moment(0).from(30000), 'ប៉ុន្មានវិនាទីមុន', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'ប៉ុន្មានវិនាទីមុន', 'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({\n            s: 30\n        }).fromNow(), 'ប៉ុន្មានវិនាទីទៀត', 'in a few seconds');\n        assert.equal(moment().add({\n            d: 5\n        }).fromNow(), '5 ថ្ងៃទៀត', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(), 'ថ្ងៃនៈ ម៉ោង 02:00', 'today at the same time');\n        assert.equal(moment(a).add({\n            m: 25\n        }).calendar(), 'ថ្ងៃនៈ ម៉ោង 02:25', 'Now plus 25 min');\n        assert.equal(moment(a).add({\n            h: 1\n        }).calendar(), 'ថ្ងៃនៈ ម៉ោង 03:00', 'Now plus 1 hour');\n        assert.equal(moment(a).add({\n            d: 1\n        }).calendar(), 'ស្អែក ម៉ោង 02:00', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({\n            h: 1\n        }).calendar(), 'ថ្ងៃនៈ ម៉ោង 01:00', 'Now minus 1 hour');\n        assert.equal(moment(a).subtract({\n            d: 1\n        }).calendar(), 'ម្សិលមិញ ម៉ោង 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd [ម៉ោង] LT'), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd [សប្តាហ៍មុន] [ម៉ោង] LT'), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({\n                w: 1\n            }),\n            weeksFromNow = moment().add({\n                w: 1\n            });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week');\n\n        weeksAgo = moment().subtract({\n            w: 2\n        });\n        weeksFromNow = moment().add({\n            w: 2\n        });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ko');\n\n    test('parse', function (assert) {\n        var tests = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('parse meridiem', function (assert) {\n        var elements = [{\n            expression : '1981년 9월 8일 오후 2시 30분',\n            inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]',\n            outputFormat : 'A',\n            expected : '오후'\n        }, {\n            expression : '1981년 9월 8일 오전 2시 30분',\n            inputFormat : 'YYYY[년] M[월] D[일] A h[시] m[분]',\n            outputFormat : 'A h시',\n            expected : '오전 2시'\n        }, {\n            expression : '14시 30분',\n            inputFormat : 'H[시] m[분]',\n            outputFormat : 'A',\n            expected : '오후'\n        }, {\n            expression : '오후 4시',\n            inputFormat : 'A h[시]',\n            outputFormat : 'H',\n            expected : '16'\n        }], i, l, it, actual;\n\n\n        for (i = 0, l = elements.length; i < l; ++i) {\n            it = elements[i];\n            actual = moment(it.expression, it.inputFormat).format(it.outputFormat);\n\n            assert.equal(\n                actual,\n                it.expected,\n                '\\'' + it.outputFormat + '\\' of \\'' + it.expression + '\\' must be \\'' + it.expected + '\\' but was \\'' + actual + '\\'.'\n            );\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['YYYY년 MMMM Do dddd a h:mm:ss',      '2010년 2월 14일 일요일 오후 3:25:50'],\n                ['ddd A h',                            '일 오후 3'],\n                ['M Mo MM MMMM MMM',                   '2 2일 02 2월 2월'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14일 14'],\n                ['d do dddd ddd dd',                   '0 0일 일요일 일 일'],\n                ['DDD DDDo DDDD',                      '45 45일 045'],\n                ['w wo ww',                            '8 8일 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                '오후 오후'],\n                ['일년 중 DDDo째 되는 날',                 '일년 중 45일째 되는 날'],\n                ['LTS',                                '오후 3시 25분 50초'],\n                ['L',                                  '2010.02.14'],\n                ['LL',                                 '2010년 2월 14일'],\n                ['LLL',                                '2010년 2월 14일 오후 3시 25분'],\n                ['LLLL',                               '2010년 2월 14일 일요일 오후 3시 25분'],\n                ['l',                                  '2010.2.14'],\n                ['ll',                                 '2010년 2월 14일'],\n                ['lll',                                '2010년 2월 14일 오후 3시 25분'],\n                ['llll',                               '2010년 2월 14일 일 오후 3시 25분']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');\n    });\n\n    test('format month', function (assert) {\n        var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = '일요일 일 일_월요일 월 월_화요일 화 화_수요일 수 수_목요일 목 목_금요일 금 금_토요일 토 토'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '몇초', '44초 = 몇초');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '일분',      '45초 = 일분');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '일분',      '89초 = 일분');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2분',     '90초 = 2분');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44분',    '44분 = 44분');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '한시간',       '45분 = 한시간');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '한시간',       '89분 = 한시간');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2시간',       '90분 = 2시간');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5시간',       '5시간 = 5시간');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21시간',      '21시간 = 21시간');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '하루',         '22시간 = 하루');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '하루',         '35시간 = 하루');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2일',        '36시간 = 2일');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '하루',         '하루 = 하루');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5일',        '5일 = 5일');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25일',       '25일 = 25일');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '한달',       '26일 = 한달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '한달',       '30일 = 한달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '한달',       '45일 = 한달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2달',      '46일 = 2달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2달',      '75일 = 2달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3달',      '76일 = 3달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '한달',       '1달 = 한달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5달',      '5달 = 5달');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '일년',        '345일 = 일년');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2년',       '548일 = 2년');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '일년',        '일년 = 일년');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5년',       '5년 = 5년');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), '몇초 후',  'prefix');\n        assert.equal(moment(0).from(30000), '몇초 전', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), '몇초 전',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), '몇초 후', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5일 후', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     '오늘 오전 2시 0분',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      '오늘 오전 2시 25분',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       '오늘 오전 3시 0분',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       '내일 오전 2시 0분',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  '오늘 오전 1시 0분',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  '어제 오전 2시 0분',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('지난주 dddd LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('지난주 dddd LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('지난주 dddd LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1일', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1일', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2일', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2일', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('lb');\n\n    test('parse', function (assert) {\n        var tests = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, HH:mm:ss', 'Sonndeg, 14. Februar 2010, 15:25:50'],\n                ['ddd, HH:mm', 'So., 15:25'],\n                ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],\n                ['YYYY YY', '2010 10'],\n                ['D Do DD', '14 14. 14'],\n                ['d do dddd ddd dd', '0 0. Sonndeg So. So'],\n                ['DDD DDDo DDDD', '45 45. 045'],\n                ['w wo ww', '6 6. 06'],\n                ['h hh', '3 03'],\n                ['H HH', '15 15'],\n                ['m mm', '25 25'],\n                ['s ss', '50 50'],\n                ['a A', 'pm PM'],\n                ['[the] DDDo [day of the year]', 'the 45. day of the year'],\n                ['LTS', '15:25:50 Auer'],\n                ['L', '14.02.2010'],\n                ['LL', '14. Februar 2010'],\n                ['LLL', '14. Februar 2010 15:25 Auer'],\n                ['LLLL', 'Sonndeg, 14. Februar 2010 15:25 Auer'],\n                ['l', '14.2.2010'],\n                ['ll', '14. Febr. 2010'],\n                ['lll', '14. Febr. 2010 15:25 Auer'],\n                ['llll', 'So., 14. Febr. 2010 15:25 Auer']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Januar Jan._Februar Febr._Mäerz Mrz._Abrëll Abr._Mee Mee_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Sonndeg So. So_Méindeg Mé. Mé_Dënschdeg Dë. Dë_Mëttwoch Më. Më_Donneschdeg Do. Do_Freideg Fr. Fr_Samschdeg Sa. Sa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'e puer Sekonnen', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'eng Minutt', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'eng Minutt', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 Minutten', '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 Minutten', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'eng Stonn', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'eng Stonn', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 Stonnen', '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 Stonnen', '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 Stonnen', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'een Dag', '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'een Dag', '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 Deeg', '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'een Dag', '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 Deeg', '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 Deeg', '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ee Mount', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ee Mount', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ee Mount', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 Méint', '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 Méint', '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 Méint', '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ee Mount', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 Méint', '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ee Joer', '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 Joer', '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ee Joer', '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 Joer', '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'an e puer Sekonnen', 'prefix');\n        assert.equal(moment(0).from(30000), 'virun e puer Sekonnen', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'an e puer Sekonnen', 'in a few seconds');\n        assert.equal(moment().add({d: 1}).fromNow(), 'an engem Dag', 'in one day');\n        assert.equal(moment().add({d: 2}).fromNow(), 'an 2 Deeg', 'in 2 days');\n        assert.equal(moment().add({d: 3}).fromNow(), 'an 3 Deeg', 'in 3 days');\n        assert.equal(moment().add({d: 4}).fromNow(), 'a 4 Deeg', 'in 4 days');\n        assert.equal(moment().add({d: 5}).fromNow(), 'a 5 Deeg', 'in 5 days');\n        assert.equal(moment().add({d: 6}).fromNow(), 'a 6 Deeg', 'in 6 days');\n        assert.equal(moment().add({d: 7}).fromNow(), 'a 7 Deeg', 'in 7 days');\n        assert.equal(moment().add({d: 8}).fromNow(), 'an 8 Deeg', 'in 8 days');\n        assert.equal(moment().add({d: 9}).fromNow(), 'an 9 Deeg', 'in 9 days');\n        assert.equal(moment().add({d: 10}).fromNow(), 'an 10 Deeg', 'in 10 days');\n        assert.equal(moment().add({y: 100}).fromNow(), 'an 100 Joer', 'in 100 years');\n        assert.equal(moment().add({y: 400}).fromNow(), 'a 400 Joer', 'in 400 years');\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, weekday, datestring;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n\n            // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday)\n            weekday = parseInt(m.format('d'), 10);\n            datestring = (weekday === 2 || weekday === 4 ? '[Leschten] dddd [um] LT' : '[Leschte] dddd [um] LT');\n\n            assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('lt');\n\n    test('parse', function (assert) {\n        var tests = 'sausio sau_vasario vas_kovo kov_balandžio bal_gegužės geg_birželio bir_liepos lie_rugpjūčio rgp_rugsėjo rgs_spalio spa_lapkričio lap_gruodžio grd'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'sekmadienis, 14-oji vasario 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sek, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2-oji 02 vasario vas'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-oji 14'],\n                ['d do dddd ddd dd',                   '0 0-oji sekmadienis Sek S'],\n                ['DDD DDDo DDDD',                      '45 45-oji 045'],\n                ['w wo ww',                            '6 6-oji 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['DDDo [metų diena]',                  '45-oji metų diena'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '2010 m. vasario 14 d.'],\n                ['LLL',                                '2010 m. vasario 14 d., 15:25 val.'],\n                ['LLLL',                               '2010 m. vasario 14 d., sekmadienis, 15:25 val.'],\n                ['l',                                  '2010-02-14'],\n                ['ll',                                 '2010 m. vasario 14 d.'],\n                ['lll',                                '2010 m. vasario 14 d., 15:25 val.'],\n                ['llll',                               '2010 m. vasario 14 d., Sek, 15:25 val.']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-oji', '1-oji');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-oji', '2-oji');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-oji', '3-oji');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-oji', '4-oji');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-oji', '5-oji');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-oji', '6-oji');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-oji', '7-oji');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-oji', '8-oji');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-oji', '9-oji');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-oji', '10-oji');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-oji', '11-oji');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-oji', '12-oji');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-oji', '13-oji');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-oji', '14-oji');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-oji', '15-oji');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-oji', '16-oji');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-oji', '17-oji');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-oji', '18-oji');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-oji', '19-oji');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-oji', '20-oji');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-oji', '21-oji');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-oji', '22-oji');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-oji', '23-oji');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-oji', '24-oji');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-oji', '25-oji');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-oji', '26-oji');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-oji', '27-oji');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-oji', '28-oji');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-oji', '29-oji');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-oji', '30-oji');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-oji', '31-oji');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'sausio sau_vasario vas_kovo kov_balandžio bal_gegužės geg_birželio bir_liepos lie_rugpjūčio rgp_rugsėjo rgs_spalio spa_lapkričio lap_gruodžio grd'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week on US calendar', function (assert) {\n        // Tests, whether the weekday names are correct, even if the week does not start on Monday\n        moment.locale('lt', {week: {dow: 0, doy: 6}});\n        var expected = 'sekmadienis Sek S_pirmadienis Pir P_antradienis Ant A_trečiadienis Tre T_ketvirtadienis Ket K_penktadienis Pen Pn_šeštadienis Šeš Š'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n        moment.locale('lt', {week: {dow: 1, doy: 4}});\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'kelios sekundės', '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minutė',          '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minutė',          '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutės',       '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 10}), true),  '10 minučių',       '10 minutes = 10 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 11}), true),  '11 minučių',       '11 minutes = 11 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 19}), true),  '19 minučių',       '19 minutes = 19 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 20}), true),  '20 minučių',       '20 minutes = 20 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutės',      '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'valanda',         '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'valanda',         '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 valandos',      '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 valandos',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 10}), true),  '10 valandų',      '10 hours = 10 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 valandos',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'diena',           '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'diena',           '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dienos',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'diena',           '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dienos',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 10}), true),  '10 dienų',        '10 days = 10 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dienos',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mėnuo',           '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mėnuo',           '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mėnuo',           '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mėnesiai',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mėnesiai',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mėnesiai',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mėnuo',           '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mėnesiai',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 10}), true),  '10 mėnesių',      '10 months = 10 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'metai',           '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 metai',         '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'metai',           '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 metai',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'po kelių sekundžių',  'prefix');\n        assert.equal(moment(0).from(30000), 'prieš kelias sekundes', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'prieš kelias sekundes',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'po kelių sekundžių', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'po 5 dienų', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Šiandien 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Šiandien 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Šiandien 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Rytoj 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Šiandien 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Vakar 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Praėjusį] dddd LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Praėjusį] dddd LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Praėjusį] dddd LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52-oji', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1-oji', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1-oji', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2-oji', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2-oji', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('lv');\n\n    test('parse', function (assert) {\n        var tests = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'svētdiena, 14. februāris 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Sv, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februāris feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. svētdiena Sv Sv'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '2010. gada 14. februāris'],\n                ['LLL',                                '2010. gada 14. februāris, 15:25'],\n                ['LLLL',                               '2010. gada 14. februāris, svētdiena, 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '2010. gada 14. feb'],\n                ['lll',                                '2010. gada 14. feb, 15:25'],\n                ['llll',                               '2010. gada 14. feb, Sv, 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'janvāris jan_februāris feb_marts mar_aprīlis apr_maijs mai_jūnijs jūn_jūlijs jūl_augusts aug_septembris sep_oktobris okt_novembris nov_decembris dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'svētdiena Sv Sv_pirmdiena P P_otrdiena O O_trešdiena T T_ceturtdiena C C_piektdiena Pk Pk_sestdiena S S'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'dažas sekundes',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minūti',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minūti',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minūtes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minūtes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'stundu',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'stundu',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 stundas',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 stundas',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 stunda',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'dienu',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'dienu',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dienas',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'dienu',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dienas',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dienas',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mēnesi',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mēnesi',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mēnesi',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mēneši',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mēneši',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mēneši',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mēnesi',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mēneši',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'gadu',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 gadi',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'gadu',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 gadi',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dažas sekundes vēlāk',  'prefix');\n        assert.equal(moment(0).from(30000), 'dažas sekundes agrāk', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'dažas sekundes agrāk',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dažas sekundes vēlāk', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 dienas vēlāk', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Šodien pulksten 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Šodien pulksten 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Šodien pulksten 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Rīt pulksten 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Šodien pulksten 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Vakar pulksten 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [pulksten] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [pulksten] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [pulksten] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Pagājušā] dddd [pulksten] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Pagājušā] dddd [pulksten] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Pagājušā] dddd [pulksten] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('mk');\n\n    test('parse', function (assert) {\n        var tests = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, H:mm:ss',        'недела, февруари 14-ти 2010, 15:25:50'],\n                ['ddd, hA',                            'нед, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2-ри 02 февруари фев'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-ти 14'],\n                ['d do dddd ddd dd',                   '0 0-ев недела нед нe'],\n                ['DDD DDDo DDDD',                      '45 45-ти 045'],\n                ['w wo ww',                            '7 7-ми 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45-ти day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 февруари 2010'],\n                ['LLL',                                '14 февруари 2010 15:25'],\n                ['LLLL',                               'недела, 14 февруари 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 фев 2010'],\n                ['lll',                                '14 фев 2010 15:25'],\n                ['llll',                               'нед, 14 фев 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-ви', '1-ви');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-ри', '2-ри');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-ти', '3-ти');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-ти', '4-ти');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-ти', '5-ти');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-ти', '6-ти');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-ми', '7-ми');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-ми', '8-ми');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-ти', '9-ти');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-ти', '10-ти');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-ти', '11-ти');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-ти', '12-ти');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-ти', '13-ти');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-ти', '14-ти');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-ти', '15-ти');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-ти', '16-ти');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-ти', '17-ти');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-ти', '18-ти');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-ти', '19-ти');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-ти', '20-ти');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-ви', '21-ви');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-ри', '22-ри');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-ти', '23-ти');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-ти', '24-ти');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-ти', '25-ти');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-ти', '26-ти');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-ми', '27-ми');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-ми', '28-ми');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-ти', '29-ти');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-ти', '30-ти');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-ви', '31-ви');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'јануари јан_февруари фев_март мар_април апр_мај мај_јуни јун_јули јул_август авг_септември сеп_октомври окт_ноември ное_декември дек'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'недела нед нe_понеделник пон пo_вторник вто вт_среда сре ср_четврток чет че_петок пет пе_сабота саб сa'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'неколку секунди', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'минута',          '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'минута',          '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 минути',        '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 минути',       '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'час',             '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'час',             '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 часа',          '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 часа',          '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 часа',         '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ден',             '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ден',             '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дена',          '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ден',             '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 дена',          '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 дена',         '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'месец',           '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'месец',           '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'месец',           '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 месеци',        '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 месеци',        '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 месеци',        '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'месец',           '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 месеци',        '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'година',          '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 години',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'година',          '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 години',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'после неколку секунди',  'prefix');\n        assert.equal(moment(0).from(30000), 'пред неколку секунди', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'пред неколку секунди',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'после неколку секунди', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'после 5 дена', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Денес во 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Денес во 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Денес во 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Утре во 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Денес во 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Вчера во 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [во] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [во] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [во] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[Во изминатата] dddd [во] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[Во изминатиот] dddd [во] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-ви', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-ри', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-ри', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-ти', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ml');\n\n    test('parse', function (assert) {\n        var tests = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, a h:mm:ss -നു',  'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'],\n                ['ddd, a h -നു',                       'ഞായർ, ഉച്ച കഴിഞ്ഞ് 3 -നു'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 ഫെബ്രുവരി ഫെബ്രു.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 ഞായറാഴ്ച ഞായർ ഞാ'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'ഉച്ച കഴിഞ്ഞ് ഉച്ച കഴിഞ്ഞ്'],\n                ['LTS',                                'ഉച്ച കഴിഞ്ഞ് 3:25:50 -നു'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 ഫെബ്രുവരി 2010'],\n                ['LLL',                                '14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'],\n                ['LLLL',                               'ഞായറാഴ്ച, 14 ഫെബ്രുവരി 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 ഫെബ്രു. 2010'],\n                ['lll',                                '14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു'],\n                ['llll',                               'ഞായർ, 14 ഫെബ്രു. 2010, ഉച്ച കഴിഞ്ഞ് 3:25 -നു']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ജനുവരി ജനു._ഫെബ്രുവരി ഫെബ്രു._മാർച്ച് മാർ._ഏപ്രിൽ ഏപ്രി._മേയ് മേയ്_ജൂൺ ജൂൺ_ജൂലൈ ജൂലൈ._ഓഗസ്റ്റ് ഓഗ._സെപ്റ്റംബർ സെപ്റ്റ._ഒക്ടോബർ ഒക്ടോ._നവംബർ നവം._ഡിസംബർ ഡിസം.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'ഞായറാഴ്ച ഞായർ ഞാ_തിങ്കളാഴ്ച തിങ്കൾ തി_ചൊവ്വാഴ്ച ചൊവ്വ ചൊ_ബുധനാഴ്ച ബുധൻ ബു_വ്യാഴാഴ്ച വ്യാഴം വ്യാ_വെള്ളിയാഴ്ച വെള്ളി വെ_ശനിയാഴ്ച ശനി ശ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'അൽപ നിമിഷങ്ങൾ', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ഒരു മിനിറ്റ്',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ഒരു മിനിറ്റ്',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 മിനിറ്റ്',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 മിനിറ്റ്',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ഒരു മണിക്കൂർ',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ഒരു മണിക്കൂർ',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 മണിക്കൂർ',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 മണിക്കൂർ',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 മണിക്കൂർ',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ഒരു ദിവസം',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ഒരു ദിവസം',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 ദിവസം',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ഒരു ദിവസം',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 ദിവസം',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 ദിവസം',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ഒരു മാസം',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ഒരു മാസം',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ഒരു മാസം',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 മാസം',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 മാസം',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 മാസം',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ഒരു മാസം',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 മാസം',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ഒരു വർഷം',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 വർഷം',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ഒരു വർഷം',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 വർഷം',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്',  'prefix');\n        assert.equal(moment(0).from(30000), 'അൽപ നിമിഷങ്ങൾ മുൻപ്', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'അൽപ നിമിഷങ്ങൾ മുൻപ്',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്', 'അൽപ നിമിഷങ്ങൾ കഴിഞ്ഞ്');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 ദിവസം കഴിഞ്ഞ്', '5 ദിവസം കഴിഞ്ഞ്');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'ഇന്ന് രാത്രി 2:00 -നു',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'ഇന്ന് രാത്രി 2:25 -നു',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 3}).calendar(),       'ഇന്ന് രാവിലെ 5:00 -നു',     'Now plus 3 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'നാളെ രാത്രി 2:00 -നു',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'ഇന്ന് രാത്രി 1:00 -നു',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'ഇന്നലെ രാത്രി 2:00 -നു', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[കഴിഞ്ഞ] dddd[,] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[കഴിഞ്ഞ] dddd[,] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[കഴിഞ്ഞ] dddd[,] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'രാത്രി', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'രാവിലെ', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ഉച്ച കഴിഞ്ഞ്', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'വൈകുന്നേരം', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'വൈകുന്നേരം', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'രാത്രി', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'രാത്രി', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'രാവിലെ', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'ഉച്ച കഴിഞ്ഞ്', ' during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'വൈകുന്നേരം', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'വൈകുന്നേരം', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'രാത്രി', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('mr');\n\n    test('parse', function (assert) {\n        var tests = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, a h:mm:ss वाजता', 'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५:५० वाजता'],\n                ['ddd, a h वाजता',                       'रवि, दुपारी ३ वाजता'],\n                ['M Mo MM MMMM MMM',                   '२ २ ०२ फेब्रुवारी फेब्रु.'],\n                ['YYYY YY',                            '२०१० १०'],\n                ['D Do DD',                            '१४ १४ १४'],\n                ['d do dddd ddd dd',                   '० ० रविवार रवि र'],\n                ['DDD DDDo DDDD',                      '४५ ४५ ०४५'],\n                ['w wo ww',                            '८ ८ ०८'],\n                ['h hh',                               '३ ०३'],\n                ['H HH',                               '१५ १५'],\n                ['m mm',                               '२५ २५'],\n                ['s ss',                               '५० ५०'],\n                ['a A',                                'दुपारी दुपारी'],\n                ['LTS',                                'दुपारी ३:२५:५० वाजता'],\n                ['L',                                  '१४/०२/२०१०'],\n                ['LL',                                 '१४ फेब्रुवारी २०१०'],\n                ['LLL',                                '१४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'],\n                ['LLLL',                               'रविवार, १४ फेब्रुवारी २०१०, दुपारी ३:२५ वाजता'],\n                ['l',                                  '१४/२/२०१०'],\n                ['ll',                                 '१४ फेब्रु. २०१०'],\n                ['lll',                                '१४ फेब्रु. २०१०, दुपारी ३:२५ वाजता'],\n                ['llll',                               'रवि, १४ फेब्रु. २०१०, दुपारी ३:२५ वाजता']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'जानेवारी जाने._फेब्रुवारी फेब्रु._मार्च मार्च._एप्रिल एप्रि._मे मे._जून जून._जुलै जुलै._ऑगस्ट ऑग._सप्टेंबर सप्टें._ऑक्टोबर ऑक्टो._नोव्हेंबर नोव्हें._डिसेंबर डिसें.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'रविवार रवि र_सोमवार सोम सो_मंगळवार मंगळ मं_बुधवार बुध बु_गुरूवार गुरू गु_शुक्रवार शुक्र शु_शनिवार शनि श'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'सेकंद', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'एक मिनिट',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'एक मिनिट',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '२ मिनिटे',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '४४ मिनिटे', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'एक तास',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'एक तास',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '२ तास',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '५ तास',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '२१ तास',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'एक दिवस',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'एक दिवस',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '२ दिवस',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'एक दिवस',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '५ दिवस',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '२५ दिवस',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'एक महिना', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'एक महिना', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'एक महिना', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '२ महिने', '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '२ महिने', '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '३ महिने', '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'एक महिना', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '५ महिने', '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक वर्ष',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ वर्षे',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'एक वर्ष',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '५ वर्षे', '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'सेकंद नंतर', 'prefix');\n        assert.equal(moment(0).from(30000), 'सेकंद पूर्वी', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'सेकंद पूर्वी',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'सेकंद नंतर', 'सेकंद नंतर');\n        assert.equal(moment().add({d: 5}).fromNow(), '५ दिवस नंतर', '५ दिवस नंतर');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'आज रात्री २:०० वाजता',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'आज रात्री २:२५ वाजता',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 3}).calendar(),       'आज सकाळी ५:०० वाजता',     'Now plus 3 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'उद्या रात्री २:०० वाजता',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'आज रात्री १:०० वाजता',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'काल रात्री २:०० वाजता', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd[,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'रात्री', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'सकाळी', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दुपारी', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'सायंकाळी', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'सायंकाळी', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'रात्री', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'रात्री', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'सकाळी', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दुपारी', ' during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'सायंकाळी', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'सायंकाळी', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात्री', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '१ ०१ १', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '१ ०१ १', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '२ ०२ २', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ms-my');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' sepatutnya bulan ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Ahad, Februari 14 2010, 3:25:50 petang'],\n                ['ddd, hA',                            'Ahd, 3petang'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 Februari Feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 Ahad Ahd Ah'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '7 7 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'petang petang'],\n                ['[hari] [ke] DDDo [tahun] ini', 'hari ke 45 tahun ini'],\n                ['LTS',                                '15.25.50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Februari 2010'],\n                ['LLL',                                '14 Februari 2010 pukul 15.25'],\n                ['LLLL',                               'Ahad, 14 Februari 2010 pukul 15.25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Feb 2010'],\n                ['lll',                                '14 Feb 2010 pukul 15.25'],\n                ['llll',                               'Ahd, 14 Feb 2010 pukul 15.25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'Januari Jan_Februari Feb_Mac Mac_April Apr_Mei Mei_Jun Jun_Julai Jul_Ogos Ogs_September Sep_Oktober Okt_November Nov_Disember Dis'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'Ahad Ahd Ah_Isnin Isn Is_Selasa Sel Sl_Rabu Rab Rb_Khamis Kha Km_Jumaat Jum Jm_Sabtu Sab Sb'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'beberapa saat', '44 saat = beberapa saat');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'seminit',      '45 saat = seminit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'seminit',      '89 saat = seminit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minit',     '90 saat = 2 minit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minit',    '44 minit = 44 minit');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'sejam',       '45 minit = sejam');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'sejam',       '89 minit = sejam');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 jam',       '90 minit = 2 jam');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 jam',       '5 jam = 5 jam');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 jam',      '21 jam = 21 jam');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'sehari',         '22 jam = sehari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'sehari',         '35 jam = sehari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 hari',        '36 jam = 2 hari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'sehari',         '1 hari = sehari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 hari',        '5 hari = 5 hari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 hari',       '25 hari = 25 hari');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'sebulan',       '26 hari = sebulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'sebulan',       '30 hari = sebulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'sebulan',       '45 hari = sebulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 bulan',      '46 hari = 2 bulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 bulan',      '75 hari = 2 bulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 bulan',      '76 hari = 3 bulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'sebulan',       '1 bulan = sebulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 bulan',      '5 bulan = 5 bulan');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'setahun',        '345 hari = setahun');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 tahun',       '548 hari = 2 tahun');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'setahun',        '1 tahun = setahun');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 tahun',       '5 tahun = 5 tahun');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dalam beberapa saat',  'prefix');\n        assert.equal(moment(0).from(30000), 'beberapa saat yang lepas', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'beberapa saat yang lepas',  'waktu sekarang dari sekarang sepatutnya menunjukkan sebagai telah lepas');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dalam beberapa saat', 'dalam beberapa saat');\n        assert.equal(moment().add({d: 5}).fromNow(), 'dalam 5 hari', 'dalam 5 hari');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hari ini pukul 02.00',     'hari ini pada waktu yang sama');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hari ini pukul 02.25',     'Sekarang tambah 25 minit');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hari ini pukul 03.00',     'Sekarang tambah 1 jam');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Esok pukul 02.00',  'esok pada waktu yang sama');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hari ini pukul 01.00',     'Sekarang tolak 1 jam');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Kelmarin pukul 02.00', 'kelmarin pada waktu yang sama');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Hari ini + ' + i + ' hari waktu sekarang');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Hari ini + ' + i + ' hari permulaan hari');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [pukul] LT'),  'Hari ini + ' + i + ' hari tamat hari');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [lepas] [pukul] LT'),  'Hari ini - ' + i + ' hari waktu sekarang');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [lepas] [pukul] LT'),  'Hari ini - ' + i + ' hari permulaan hari');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [lepas] [pukul] LT'),  'Hari ini - ' + i + ' hari tamat hari');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 minggu lepas');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'dalam 1 minggu');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 minggu lepas');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'dalam 2 minggu');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 sepatutnya minggu 1');\n        assert.equal(moment([2012, 0,  7]).week(), 2, 'Jan  7 2012 sepatutnya minggu 2');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 sepatutnya minggu 2');\n        assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 sepatutnya minggu 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 sepatutnya minggu 1');\n        assert.equal(moment([2007,  0,  7]).week(), 1, 'Jan  7 2007 sepatutnya minggu 1');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2');\n        assert.equal(moment([2007,  0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 sepatutnya minggu 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 sepatutnya minggu 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 sepatutnya minggu 1');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 sepatutnya minggu 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 sepatutnya minggu 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 sepatutnya minggu 1');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 sepatutnya minggu 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 sepatutnya minggu 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 sepatutnya minggu 1');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 sepatutnya minggu 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 sepatutnya minggu 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 sepatutnya minggu 1');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 sepatutnya minggu 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 sepatutnya minggu 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 sepatutnya minggu 1');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 sepatutnya minggu 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 sepatutnya minggu 2');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 sepatutnya minggu 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '2 02 2', 'Jan  7 2012 sepatutnya minggu 2');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 sepatutnya minggu 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('my');\n\n    test('parse', function (assert) {\n        var tests = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'),\n            i;\n\n        function equalTest (input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a', 'တနင်္ဂနွေ, ဖေဖော်ဝါရီ ၁၄ ၂၀၁၀, ၃:၂၅:၅၀ pm'],\n                ['ddd, hA', 'နွေ, ၃PM'],\n                ['M Mo MM MMMM MMM', '၂ ၂ ၀၂ ဖေဖော်ဝါရီ ဖေ'],\n                ['YYYY YY', '၂၀၁၀ ၁၀'],\n                ['D Do DD', '၁၄ ၁၄ ၁၄'],\n                ['d do dddd ddd dd', '၀ ၀ တနင်္ဂနွေ နွေ နွေ'],\n                ['DDD DDDo DDDD', '၄၅ ၄၅ ၀၄၅'],\n                ['w wo ww', '၆ ၆ ၀၆'],\n                ['h hh', '၃ ၀၃'],\n                ['H HH', '၁၅ ၁၅'],\n                ['m mm', '၂၅ ၂၅'],\n                ['s ss', '၅၀ ၅၀'],\n                ['a A', 'pm PM'],\n                ['[နှစ်၏] DDDo [ရက်မြောက်]', 'နှစ်၏ ၄၅ ရက်မြောက်'],\n                ['LTS', '၁၅:၂၅:၅၀'],\n                ['L', '၁၄/၀၂/၂၀၁၀'],\n                ['LL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀'],\n                ['LLL', '၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'],\n                ['LLLL', 'တနင်္ဂနွေ ၁၄ ဖေဖော်ဝါရီ ၂၀၁၀ ၁၅:၂၅'],\n                ['l', '၁၄/၂/၂၀၁၀'],\n                ['ll', '၁၄ ဖေ ၂၀၁၀'],\n                ['lll', '၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅'],\n                ['llll', 'နွေ ၁၄ ဖေ ၂၀၁၀ ၁၅:၂၅']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '၁', '၁');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '၂', '၂');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '၃', '၃');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '၄', '၄');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '၅', '၅');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '၆', '၆');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '၇', '၇');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '၈', '၈');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '၉', '၉');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '၁၀', '၁၀');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '၁၁', '၁၁');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '၁၂', '၁၂');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '၁၃', '၁၃');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '၁၄', '၁၄');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '၁၅', '၁၅');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '၁၆', '၁၆');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '၁၇', '၁၇');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '၁၈', '၁၈');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '၁၉', '၁၉');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '၂၀', '၂၀');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '၂၁', '၂၁');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '၂၂', '၂၂');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '၂၃', '၂၃');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '၂၄', '၂၄');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '၂၅', '၂၅');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '၂၆', '၂၆');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '၂၇', '၂၇');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '၂၈', '၂၈');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '၂၉', '၂၉');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '၃၀', '၃၀');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '၃၁', '၃၁');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ဇန်နဝါရီ ဇန်_ဖေဖော်ဝါရီ ဖေ_မတ် မတ်_ဧပြီ ပြီ_မေ မေ_ဇွန် ဇွန်_ဇူလိုင် လိုင်_သြဂုတ် သြ_စက်တင်ဘာ စက်_အောက်တိုဘာ အောက်_နိုဝင်ဘာ နို_ဒီဇင်ဘာ ဒီ'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'တနင်္ဂနွေ နွေ နွေ_တနင်္လာ လာ လာ_အင်္ဂါ င်္ဂါ င်္ဂါ_ဗုဒ္ဓဟူး ဟူး ဟူး_ကြာသပတေး ကြာ ကြာ_သောကြာ သော သော_စနေ နေ နေ'.split('_'),\n            i;\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 44\n        }), true), 'စက္ကန်.အနည်းငယ်', '၄၄ စက္ကန်. = စက္ကန်.အနည်းငယ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 45\n        }), true), 'တစ်မိနစ်', '၄၅ စက္ကန်. = တစ်မိနစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 89\n        }), true), 'တစ်မိနစ်', '၈၉ စက္ကန်. = တစ်မိနစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            s: 90\n        }), true), '၂ မိနစ်', '၉၀ စက္ကန်. =  ၂ မိနစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 44\n        }), true), '၄၄ မိနစ်', '၄၄ မိနစ် = ၄၄ မိနစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 45\n        }), true), 'တစ်နာရီ', '၄၅ မိနစ် = ၁ နာရီ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 89\n        }), true), 'တစ်နာရီ', '၈၉ မိနစ် = တစ်နာရီ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            m: 90\n        }), true), '၂ နာရီ', 'မိနစ် ၉၀= ၂ နာရီ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 5\n        }), true), '၅ နာရီ', '၅ နာရီ= ၅ နာရီ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 21\n        }), true), '၂၁ နာရီ', '၂၁ နာရီ =၂၁ နာရီ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 22\n        }), true), 'တစ်ရက်', '၂၂ နာရီ =တစ်ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 35\n        }), true), 'တစ်ရက်', '၃၅ နာရီ =တစ်ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            h: 36\n        }), true), '၂ ရက်', '၃၆ နာရီ = ၂ ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 1\n        }), true), 'တစ်ရက်', '၁ ရက်= တစ်ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 5\n        }), true), '၅ ရက်', '၅ ရက် = ၅ ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 25\n        }), true), '၂၅ ရက်', '၂၅ ရက်= ၂၅ ရက်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 26\n        }), true), 'တစ်လ', '၂၆ ရက် = တစ်လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 30\n        }), true), 'တစ်လ', 'ရက် ၃၀ = တစ်လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 43\n        }), true), 'တစ်လ', '၄၃ ရက် = တစ်လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 46\n        }), true), '၂ လ', '၄၆ ရက် = ၂ လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 74\n        }), true), '၂ လ', '၇၅ ရက်= ၂ လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 76\n        }), true), '၃ လ', '၇၆ ရက် = ၃ လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            M: 1\n        }), true), 'တစ်လ', '၁ လ = တစ်လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            M: 5\n        }), true), '၅ လ', '၅ လ = ၅ လ');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 345\n        }), true), 'တစ်နှစ်', '၃၄၅ ရက် = တစ်နှစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            d: 548\n        }), true), '၂ နှစ်', '၅၄၈ ရက် = ၂ နှစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            y: 1\n        }), true), 'တစ်နှစ်', '၁ နှစ် = တစ်နှစ်');\n        assert.equal(start.from(moment([2007, 1, 28]).add({\n            y: 5\n        }), true), '၅ နှစ်', '၅ နှစ် = ၅ နှစ်');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'prefix');\n        assert.equal(moment(0).from(30000), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'လွန်ခဲ့သော စက္ကန်.အနည်းငယ် က', 'ယခုမှစပြီး အတိတ်တွင်ဖော်ပြသလိုဖော်ပြမည်');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({\n            s: 30\n        }).fromNow(), 'လာမည့် စက္ကန်.အနည်းငယ် မှာ', 'လာမည့် စက္ကန်.အနည်းငယ် မှာ');\n        assert.equal(moment().add({\n            d: 5\n        }).fromNow(), 'လာမည့် ၅ ရက် မှာ', 'လာမည့် ၅ ရက် မှာ');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(), 'ယနေ. ၀၂:၀၀ မှာ', 'ယနေ. ဒီအချိန်');\n        assert.equal(moment(a).add({\n            m: 25\n        }).calendar(), 'ယနေ. ၀၂:၂၅ မှာ', 'ယခုမှ ၂၅ မိနစ်ပေါင်းထည့်');\n        assert.equal(moment(a).add({\n            h: 1\n        }).calendar(), 'ယနေ. ၀၃:၀၀ မှာ', 'ယခုမှ ၁ နာရီပေါင်းထည့်');\n        assert.equal(moment(a).add({\n            d: 1\n        }).calendar(), 'မနက်ဖြန် ၀၂:၀၀ မှာ', 'မနက်ဖြန် ဒီအချိန်');\n        assert.equal(moment(a).subtract({\n            h: 1\n        }).calendar(), 'ယနေ. ၀၁:၀၀ မှာ', 'ယခုမှ ၁ နာရီနှုတ်');\n        assert.equal(moment(a).subtract({\n            d: 1\n        }).calendar(), 'မနေ.က ၀၂:၀၀ မှာ', 'မနေ.က ဒီအချိန်');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('dddd LT [မှာ]'), 'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({\n                d: i\n            });\n            assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format('[ပြီးခဲ့သော] dddd LT [မှာ]'), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({\n                w: 1\n            }),\n            weeksFromNow = moment().add({\n                w: 1\n            });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'လွန်ခဲ့သော ၁ ပတ်က');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၁ ပတ်အတွင်း');\n\n        weeksAgo = moment().subtract({\n            w: 2\n        });\n        weeksFromNow = moment().add({\n            w: 2\n        });\n\n        assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '၂ ပတ် အရင်က');\n        assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၂ ပတ် အတွင်း');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0, 1]).format('w ww wo'), '၅၂ ၅၂ ၅၂', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('nb');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'søndag, februar 14. 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'søn, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. søndag søn sø'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[den] DDDo [dagen i året]',          'den 45. dagen i året'],\n                ['LTS',                                '15.25.50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14. februar 2010'],\n                ['LLL',                                '14. februar 2010 kl. 15.25'],\n                ['LLLL',                               'søndag 14. februar 2010 kl. 15.25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14. feb 2010'],\n                ['lll',                                '14. feb 2010 kl. 15.25'],\n                ['llll',                               'søn 14. feb 2010 kl. 15.25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'søndag søn sø_mandag man ma_tirsdag tirs ti_onsdag ons on_torsdag tors to_fredag fre fr_lørdag lør lø'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'noen sekunder', '44 sekunder = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ett minutt',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ett minutt',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutter',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutter',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'en time',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'en time',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 timer',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 timer',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 timer',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'en dag',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'en dag',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dager',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'en dag',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dager',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dager',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'en måned',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'en måned',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'en måned',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 måneder',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 måneder',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 måneder',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'en måned',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 måneder',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ett år',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ett år',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 år',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'om noen sekunder',  'prefix');\n        assert.equal(moment(0).from(30000), 'for noen sekunder siden', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'for noen sekunder siden',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'om noen sekunder', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dager', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'i dag kl. 2.00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'i dag kl. 2.25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'i dag kl. 3.00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'i morgen kl. 2.00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'i dag kl. 1.00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'i går kl. 2.00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [kl.] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[forrige] dddd [kl.] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[forrige] dddd [kl.] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[forrige] dddd [kl.] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ne');\n\n    test('parse', function (assert) {\n        var tests = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, aको h:mm:ss बजे',       'आइतबार, १४ फेब्रुवरी २०१०, बेलुकाको ३:२५:५० बजे'],\n                ['ddd, aको h बजे',                                                      'आइत., बेलुकाको ३ बजे'],\n                ['M Mo MM MMMM MMM',                   '२ २ ०२ फेब्रुवरी फेब्रु.'],\n                ['YYYY YY',                            '२०१० १०'],\n                ['D Do DD',                            '१४ १४ १४'],\n                ['d do dddd ddd dd',                   '० ० आइतबार आइत. आइ.'],\n                ['DDD DDDo DDDD',                      '४५ ४५ ०४५'],\n                ['w wo ww',                            '७ ७ ०७'],\n                ['h hh',                               '३ ०३'],\n                ['H HH',                               '१५ १५'],\n                ['m mm',                               '२५ २५'],\n                ['s ss',                               '५० ५०'],\n                ['a A',                                'बेलुका बेलुका'],\n                ['LTS',                                'बेलुकाको ३:२५:५० बजे'],\n                ['L',                                  '१४/०२/२०१०'],\n                ['LL',                                 '१४ फेब्रुवरी २०१०'],\n                ['LLL',                                '१४ फेब्रुवरी २०१०, बेलुकाको ३:२५ बजे'],\n                ['LLLL',                               'आइतबार, १४ फेब्रुवरी २०१०, बेलुकाको ३:२५ बजे'],\n                ['l',                                  '१४/२/२०१०'],\n                ['ll',                                 '१४ फेब्रु. २०१०'],\n                ['lll',                                '१४ फेब्रु. २०१०, बेलुकाको ३:२५ बजे'],\n                ['llll',                               'आइत., १४ फेब्रु. २०१०, बेलुकाको ३:२५ बजे']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '१', '१');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '२', '२');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '३', '३');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '४', '४');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '५', '५');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '६', '६');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '७', '७');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '८', '८');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '९', '९');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '१०', '१०');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '११', '११');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '१२', '१२');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '१३', '१३');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '१४', '१४');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '१५', '१५');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '१६', '१६');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '१७', '१७');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '१८', '१८');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '१९', '१९');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '२०', '२०');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '२१', '२१');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '२२', '२२');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '२३', '२३');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '२४', '२४');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '२५', '२५');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '२६', '२६');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '२७', '२७');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '२८', '२८');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '२९', '२९');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '३०', '३०');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '३१', '३१');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'जनवरी जन._फेब्रुवरी फेब्रु._मार्च मार्च_अप्रिल अप्रि._मई मई_जुन जुन_जुलाई जुलाई._अगष्ट अग._सेप्टेम्बर सेप्ट._अक्टोबर अक्टो._नोभेम्बर नोभे._डिसेम्बर डिसे.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'आइतबार आइत. आइ._सोमबार सोम. सो._मङ्गलबार मङ्गल. मङ्_बुधबार बुध. बु._बिहिबार बिहि. बि._शुक्रबार शुक्र. शु._शनिबार शनि. श.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'केही समय', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'एक मिनेट',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'एक मिनेट',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '२ मिनेट',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '४४ मिनेट',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'एक घण्टा',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'एक घण्टा',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '२ घण्टा',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '५ घण्टा',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '२१ घण्टा',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'एक दिन',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'एक दिन',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '२ दिन',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'एक दिन',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '५ दिन',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '२५ दिन',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'एक महिना',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'एक महिना',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'एक महिना',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '२ महिना',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '२ महिना',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '३ महिना',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'एक महिना',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '५ महिना',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'एक बर्ष',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '२ बर्ष',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'एक बर्ष',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '५ बर्ष',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'केही समयमा',  'prefix');\n        assert.equal(moment(0).from(30000), 'केही समय अगाडी', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'केही समय अगाडी',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'केही समयमा', 'केही समयमा');\n        assert.equal(moment().add({d: 5}).fromNow(), '५ दिनमा', '५ दिनमा');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'आज रातीको २:०० बजे',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'आज रातीको २:२५ बजे',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'आज बिहानको ३:०० बजे',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'भोली रातीको २:०० बजे',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'आज रातीको १:०० बजे',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'हिजो रातीको २:०० बजे', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[आउँदो] dddd[,] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[आउँदो] dddd[,] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[आउँदो] dddd[,] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[गएको] dddd[,] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[गएको] dddd[,] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[गएको] dddd[,] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), 'राती', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), 'बिहान', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दिउँसो', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'बेलुका', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'साँझ', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'राती', 'night');\n\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('A'), 'राती', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('A'), 'बिहान', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'दिउँसो', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'बेलुका', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'साँझ', 'late evening');\n        assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'राती', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '१ ०१ १', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '१ ०१ १', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '२ ०२ २', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '२ ०२ २', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '३ ०३ ३', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('nl');\n\n    test('parse', function (assert) {\n        var tests = 'januari jan._februari feb._maart mrt._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, HH:mm:ss',       'zondag, februari 14de 2010, 15:25:50'],\n                ['ddd, HH',                            'zo., 15'],\n                ['M Mo MM MMMM MMM',                   '2 2de 02 februari feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14de 14'],\n                ['d do dddd ddd dd',                   '0 0de zondag zo. Zo'],\n                ['DDD DDDo DDDD',                      '45 45ste 045'],\n                ['w wo ww',                            '6 6de 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45ste day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14-02-2010'],\n                ['LL',                                 '14 februari 2010'],\n                ['LLL',                                '14 februari 2010 15:25'],\n                ['LLLL',                               'zondag 14 februari 2010 15:25'],\n                ['l',                                  '14-2-2010'],\n                ['ll',                                 '14 feb. 2010'],\n                ['lll',                                '14 feb. 2010 15:25'],\n                ['llll',                               'zo. 14 feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januari jan._februari feb._maart mrt._april apr._mei mei_juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'zondag zo. Zo_maandag ma. Ma_dinsdag di. Di_woensdag wo. Wo_donderdag do. Do_vrijdag vr. Vr_zaterdag za. Za'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'een paar seconden', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'één minuut',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'één minuut',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuten',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuten',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'één uur',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'één uur',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 uur',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 uur',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 uur',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'één dag',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'één dag',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagen',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'één dag',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagen',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagen',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'één maand',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'één maand',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'één maand',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 maanden',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 maanden',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 maanden',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'één maand',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 maanden',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'één jaar',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 jaar',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'één jaar',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 jaar',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'over een paar seconden',  'prefix');\n        assert.equal(moment(0).from(30000), 'een paar seconden geleden', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'een paar seconden geleden',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'over een paar seconden', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'over 5 dagen', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'vandaag om 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'vandaag om 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'vandaag om 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'morgen om 02:00',    'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'vandaag om 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'gisteren om 02:00',   'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [om] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[afgelopen] dddd [om] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[afgelopen] dddd [om] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[afgelopen] dddd [om] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('month abbreviation', function (assert) {\n        assert.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot');\n        assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52ste', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1ste', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1ste', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),    '2 02 2de', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),    '2 02 2de', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('nn');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'sundag, februar 14. 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'sun, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. sundag sun su'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 februar 2010'],\n                ['LLL',                                '14 februar 2010 15:25'],\n                ['LLLL',                               'sundag 14 februar 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 feb 2010'],\n                ['lll',                                '14 feb 2010 15:25'],\n                ['llll',                               'sun 14 feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'sundag sun su_måndag mån må_tysdag tys ty_onsdag ons on_torsdag tor to_fredag fre fr_laurdag lau lø'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'nokre sekund', '44 sekunder = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'eit minutt',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'eit minutt',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutt',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutt',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ein time',     '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ein time',     '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 timar',      '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 timar',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 timar',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ein dag',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ein dag',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagar',      '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ein dag',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagar',      '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagar',     '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ein månad',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ein månad',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ein månad',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 månader',    '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 månader',    '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 månader',    '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ein månad',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 månader',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eit år',       '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år',         '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'eit år',       '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 år',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'om nokre sekund',  'prefix');\n        assert.equal(moment(0).from(30000), 'for nokre sekund sidan', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'for nokre sekund sidan',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'om nokre sekund', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'I dag klokka 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'I dag klokka 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'I dag klokka 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'I morgon klokka 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'I dag klokka 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'I går klokka 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [klokka] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [klokka] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [klokka] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Føregåande] dddd [klokka] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Føregåande] dddd [klokka] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Føregåande] dddd [klokka] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('pl');\n\n    test('parse', function (assert) {\n        var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'niedziela, luty 14. 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'nie, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 luty lut'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. niedziela nie N'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 lutego 2010'],\n                ['LLL',                                '14 lutego 2010 15:25'],\n                ['LLLL',                               'niedziela, 14 lutego 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 lut 2010'],\n                ['lll',                                '14 lut 2010 15:25'],\n                ['llll',                               'nie, 14 lut 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'niedziela nie N_poniedziałek pon Pn_wtorek wt Wt_środa śr Śr_czwartek czw Cz_piątek pt Pt_sobota sb So'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'kilka sekund',  '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minuta',        '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minuta',        '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuty',      '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuty',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'godzina',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'godzina',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 godziny',     '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 godzin',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 godzin',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '1 dzień',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '1 dzień',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dni',         '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '1 dzień',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dni',         '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dni',        '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'miesiąc',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'miesiąc',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'miesiąc',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 miesiące',    '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 miesiące',    '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 miesiące',    '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'miesiąc',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 miesięcy',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'rok',           '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 lata',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'rok',           '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 lat',         '5 years = 5 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 112}), true), '112 lat',       '112 years = 112 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 122}), true), '122 lata',      '122 years = 122 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 213}), true), '213 lat',       '213 years = 213 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 223}), true), '223 lata',      '223 years = 223 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za kilka sekund',  'prefix');\n        assert.equal(moment(0).from(30000), 'kilka sekund temu', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'kilka sekund temu',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za kilka sekund', 'in a few seconds');\n        assert.equal(moment().add({h: 1}).fromNow(), 'za godzinę', 'in an hour');\n        assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dni', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Dziś o 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Dziś o 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Dziś o 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Jutro o 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Dziś o 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Wczoraj o 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[W] dddd [o] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[W] dddd [o] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[W] dddd [o] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[W zeszłą niedzielę o] LT';\n            case 3:\n                return '[W zeszłą środę o] LT';\n            case 6:\n                return '[W zeszłą sobotę o] LT';\n            default:\n                return '[W zeszły] dddd [o] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days current time');\n\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days beginning of day');\n\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(), m.format(makeFormat(m)), 'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('pt-br');\n\n    test('parse', function (assert) {\n        var tests = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'domingo, fevereiro 14º 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dom, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2º 02 fevereiro fev'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14º 14'],\n                ['d do dddd ddd',                      '0 0º domingo dom'],\n                ['DDD DDDo DDDD',                      '45 45º 045'],\n                ['w wo ww',                            '8 8º 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45º day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 de fevereiro de 2010'],\n                ['LLL',                                '14 de fevereiro de 2010 às 15:25'],\n                ['LLLL',                               'domingo, 14 de fevereiro de 2010 às 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 de fev de 2010'],\n                ['lll',                                '14 de fev de 2010 às 15:25'],\n                ['llll',                               'dom, 14 de fev de 2010 às 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'domingo dom_segunda-feira seg_terça-feira ter_quarta-feira qua_quinta-feira qui_sexta-feira sex_sábado sáb'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'segundos',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'um minuto',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'um minuto',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutos',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutos', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'uma hora',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'uma hora',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 horas',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 horas',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 horas',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'um dia',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'um dia',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dias',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'um dia',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dias',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dias',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'um mês',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'um mês',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'um mês',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meses',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meses',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 meses',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'um mês',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 meses',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'um ano',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 anos',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'em segundos', 'prefix');\n        assert.equal(moment(0).from(30000), 'segundos atrás', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hoje às 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hoje às 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hoje às 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Amanhã às 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hoje às 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Ontem às 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1º', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1º', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2º', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('pt');\n\n    test('parse', function (assert) {\n        var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'domingo, fevereiro 14º 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'dom, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2º 02 fevereiro fev'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14º 14'],\n                ['d do dddd ddd dd',                   '0 0º domingo dom dom'],\n                ['DDD DDDo DDDD',                      '45 45º 045'],\n                ['w wo ww',                            '6 6º 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45º day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 de fevereiro de 2010'],\n                ['LLL',                                '14 de fevereiro de 2010 15:25'],\n                ['LLLL',                               'domingo, 14 de fevereiro de 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 de fev de 2010'],\n                ['lll',                                '14 de fev de 2010 15:25'],\n                ['llll',                               'dom, 14 de fev de 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'domingo dom dom_segunda-feira seg 2ª_terça-feira ter 3ª_quarta-feira qua 4ª_quinta-feira qui 5ª_sexta-feira sex 6ª_sábado sáb sáb'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'segundos',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'um minuto',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'um minuto',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minutos',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minutos', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'uma hora',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'uma hora',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 horas',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 horas',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 horas',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'um dia',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'um dia',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dias',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'um dia',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dias',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dias',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'um mês',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'um mês',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'um mês',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meses',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meses',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 meses',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'um mês',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 meses',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'um ano',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 anos',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'um ano',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 anos',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'em segundos', 'prefix');\n        assert.equal(moment(0).from(30000), 'há segundos', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'em segundos', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'em 5 dias', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hoje às 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hoje às 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hoje às 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Amanhã às 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hoje às 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Ontem às 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [às] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52º', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),  '1 01 1º', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),  '1 01 1º', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),  '2 02 2º', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),  '2 02 2º', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ro');\n\n    test('parse', function (assert) {\n        var tests = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss A',  'duminică, februarie 14 2010, 3:25:50 PM'],\n                ['ddd, hA',                        'Dum, 3PM'],\n                ['M Mo MM MMMM MMM',               '2 2 02 februarie febr.'],\n                ['YYYY YY',                        '2010 10'],\n                ['D Do DD',                        '14 14 14'],\n                ['d do dddd ddd dd',               '0 0 duminică Dum Du'],\n                ['DDD DDDo DDDD',                  '45 45 045'],\n                ['w wo ww',                        '7 7 07'],\n                ['h hh',                           '3 03'],\n                ['H HH',                           '15 15'],\n                ['m mm',                           '25 25'],\n                ['s ss',                           '50 50'],\n                ['a A',                            'pm PM'],\n                ['[a] DDDo[a zi a anului]',        'a 45a zi a anului'],\n                ['LTS',                            '15:25:50'],\n                ['L',                              '14.02.2010'],\n                ['LL',                             '14 februarie 2010'],\n                ['LLL',                            '14 februarie 2010 15:25'],\n                ['LLLL',                           'duminică, 14 februarie 2010 15:25'],\n                ['l',                              '14.2.2010'],\n                ['ll',                             '14 febr. 2010'],\n                ['lll',                            '14 febr. 2010 15:25'],\n                ['llll',                           'Dum, 14 febr. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ianuarie ian._februarie febr._martie mart._aprilie apr._mai mai_iunie iun._iulie iul._august aug._septembrie sept._octombrie oct._noiembrie nov._decembrie dec.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'duminică Dum Du_luni Lun Lu_marți Mar Ma_miercuri Mie Mi_joi Joi Jo_vineri Vin Vi_sâmbătă Sâm Sâ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'câteva secunde', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'un minut',       '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'un minut',       '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minute',       '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 de minute',   '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'o oră',          '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'o oră',          '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ore',          '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ore',          '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 de ore',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'o zi',           '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'o zi',           '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 zile',         '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'o zi',           '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 zile',         '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 de zile',     '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'o lună',         '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'o lună',         '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'o lună',         '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 luni',         '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 luni',         '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 luni',         '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'o lună',         '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 luni',         '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un an',          '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ani',          '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'un an',          '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ani',          '5 years = 5 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 19}), true),   '19 ani',        '19 years = 19 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 20}), true),   '20 de ani',     '20 years = 20 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 100}), true),   '100 de ani',   '100 years = 100 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 101}), true),   '101 ani',      '101 years = 101 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 119}), true),   '119 ani',      '119 years = 119 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 120}), true),   '120 de ani',   '120 years = 120 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 219}), true),   '219 ani',      '219 years = 219 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 220}), true),   '220 de ani',   '220 years = 220 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'peste câteva secunde',   'prefix');\n        assert.equal(moment(0).from(30000), 'câteva secunde în urmă', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'câteva secunde în urmă',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'peste câteva secunde', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'peste 5 zile', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'azi la 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'azi la 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'azi la 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'mâine la 2:00',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'azi la 1:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'ieri la 2:00',    'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [la] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [la] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [la] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[fosta] dddd [la] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[fosta] dddd [la] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[fosta] dddd [la] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ru');\n\n    test('parse', function (assert) {\n        var tests = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('parse exceptional case', function (assert) {\n        assert.equal(moment('11 мая 1989', ['DD MMMM YYYY']).format('DD-MM-YYYY'), '11-05-1989');\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, HH:mm:ss',       'воскресенье, 14-го февраля 2010, 15:25:50'],\n                ['ddd, h A',                           'вс, 3 дня'],\n                ['M Mo MM MMMM MMM',                   '2 2-й 02 февраль фев'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-го 14'],\n                ['d do dddd ddd dd',                   '0 0-й воскресенье вс вс'],\n                ['DDD DDDo DDDD',                      '45 45-й 045'],\n                ['w wo ww',                            '7 7-я 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'дня дня'],\n                ['DDDo [день года]',                   '45-й день года'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 февраля 2010 г.'],\n                ['LLL',                                '14 февраля 2010 г., 15:25'],\n                ['LLLL',                               'воскресенье, 14 февраля 2010 г., 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 фев 2010 г.'],\n                ['lll',                                '14 фев 2010 г., 15:25'],\n                ['llll',                               'вс, 14 фев 2010 г., 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format meridiem', function (assert) {\n        assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночи', 'night');\n        assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночи', 'night');\n        assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'утра', 'morning');\n        assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'утра', 'morning');\n        assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'вечера', 'evening');\n        assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечера', 'evening');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-й', '4-й');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-й', '5-й');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-й', '6-й');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-й', '7-й');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-й', '8-й');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-й', '9-й');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-й', '10-й');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-й', '11-й');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-й', '12-й');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-й', '13-й');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-й', '14-й');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-й', '15-й');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-й', '16-й');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-й', '17-й');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-й', '18-й');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-й', '19-й');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-й', '20-й');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-й', '21-й');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-й', '22-й');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-й', '23-й');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-й', '24-й');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-й', '25-й');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-й', '26-й');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-й', '27-й');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-й', '28-й');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-й', '29-й');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-й', '30-й');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format month case', function (assert) {\n        var months = {\n            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]);\n        }\n    });\n\n    test('format month short case', function (assert) {\n        var monthsShort = {\n            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMM'), monthsShort.nominative[i], '1 ' + monthsShort.nominative[i]);\n        }\n    });\n\n    test('format month case with escaped symbols', function (assert) {\n        var months = {\n            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('[<i>]D[</i>] [<b>]MMMM[</b>]'), '<i>1</i> <b>' + months.accusative[i] + '</b>', '1 <b>' + months.accusative[i] + '</b>');\n            assert.equal(moment([2013, i, 1]).format('D[-й день] MMMM'), '1-й день ' + months.accusative[i], '1-й день ' + months.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('D, MMMM'), '1, ' + months.nominative[i], '1, ' + months.nominative[i]);\n        }\n    });\n\n    test('format month short case with escaped symbols', function (assert) {\n        var monthsShort = {\n            'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2013, i, 1]).format('D[] MMM'), '1 ' + monthsShort.accusative[i], '1 ' + monthsShort.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('[<i>]D[</i>] [<b>]MMM[</b>]'), '<i>1</i> <b>' + monthsShort.accusative[i] + '</b>', '1 <b>' + monthsShort.accusative[i] + '</b>');\n            assert.equal(moment([2013, i, 1]).format('D[-й день] MMM'), '1-й день ' + monthsShort.accusative[i], '1-й день ' + monthsShort.accusative[i]);\n            assert.equal(moment([2013, i, 1]).format('D, MMM'), '1, ' + monthsShort.nominative[i], '1, ' + monthsShort.nominative[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'воскресенье вс вс_понедельник пн пн_вторник вт вт_среда ср ср_четверг чт чт_пятница пт пт_суббота сб сб'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'несколько секунд',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'минута',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'минута',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 минуты',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 31}), true),  '31 минута',  '31 minutes = 31 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 минуты', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'час',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'час',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 часа',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 часов',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 час',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'день',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'день',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дня',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'день',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 дней',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true),  '11 дней',     '11 days = 11 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true),  '21 день',     '21 days = 21 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 дней',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'месяц',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'месяц',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'месяц',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 месяца',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 месяца',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 месяца',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'месяц',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 месяцев',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'год',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 года',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'год',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 лет',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'через несколько секунд', 'prefix');\n        assert.equal(moment(0).from(30000), 'несколько секунд назад', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'через несколько секунд', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'через 5 дней', 'in 5 days');\n        assert.equal(moment().add({m: 31}).fromNow(), 'через 31 минуту', 'in 31 minutes = in 31 minutes');\n        assert.equal(moment().subtract({m: 31}).fromNow(), '31 минуту назад', '31 minutes ago = 31 minutes ago');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Сегодня в 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Сегодня в 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Сегодня в 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Завтра в 02:00',      'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Сегодня в 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Вчера в 02:00',       'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        function makeFormat(d) {\n            return d.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, now;\n\n        function makeFormatLast(d) {\n            switch (d.day()) {\n            case 0:\n                return '[В прошлое] dddd [в] LT';\n            case 1:\n            case 2:\n            case 4:\n                return '[В прошлый] dddd [в] LT';\n            case 3:\n            case 5:\n            case 6:\n                return '[В прошлую] dddd [в] LT';\n            }\n        }\n\n        function makeFormatThis(d) {\n            switch (d.day()) {\n            case 2:\n                return '[Во] dddd [в] LT';\n            case 0:\n            case 1:\n            case 3:\n            case 4:\n            case 5:\n            case 6:\n                return '[В] dddd [в] LT';\n            }\n        }\n\n        now = moment().startOf('week');\n        for (i = 2; i < 7; i++) {\n            m = moment(now).subtract({d: i});\n            assert.equal(m.calendar(now),       m.format(makeFormatLast(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(now),       m.format(makeFormatLast(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(now),       m.format(makeFormatLast(m)),  'Today - ' + i + ' days end of day');\n        }\n\n        now = moment().endOf('week');\n        for (i = 2; i < 7; i++) {\n            m = moment(now).subtract({d: i});\n            assert.equal(m.calendar(now),       m.format(makeFormatThis(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(now),       m.format(makeFormatThis(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(now),       m.format(makeFormatThis(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-я', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-я', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-я', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-я', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-я', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sk');\n\n    test('parse', function (assert) {\n        var tests = 'január jan._február feb._marec mar._apríl apr._máj máj_jún jún._júl júl._august aug._september sep._október okt._november nov._december dec.'.split('_'), i;\n        function equalTest(input, mmm, monthIndex) {\n            assert.equal(moment(input, mmm).month(), monthIndex, input + ' should be month ' + (monthIndex + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss',  'nedeľa, február 14. 2010, 3:25:50'],\n                ['ddd, h',                       'ne, 3'],\n                ['M Mo MM MMMM MMM',             '2 2. 02 február feb'],\n                ['YYYY YY',                      '2010 10'],\n                ['D Do DD',                      '14 14. 14'],\n                ['d do dddd ddd dd',             '0 0. nedeľa ne ne'],\n                ['DDD DDDo DDDD',                '45 45. 045'],\n                ['w wo ww',                      '6 6. 06'],\n                ['h hh',                         '3 03'],\n                ['H HH',                         '15 15'],\n                ['m mm',                         '25 25'],\n                ['s ss',                         '50 50'],\n                ['a A',                          'pm PM'],\n                ['DDDo [deň v roku]',            '45. deň v roku'],\n                ['LTS',                          '15:25:50'],\n                ['L',                            '14.02.2010'],\n                ['LL',                           '14. február 2010'],\n                ['LLL',                          '14. február 2010 15:25'],\n                ['LLLL',                         'nedeľa 14. február 2010 15:25'],\n                ['l',                            '14.2.2010'],\n                ['ll',                           '14. feb 2010'],\n                ['lll',                          '14. feb 2010 15:25'],\n                ['llll',                         'ne 14. feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'január jan_február feb_marec mar_apríl apr_máj máj_jún jún_júl júl_august aug_september sep_október okt_november nov_december dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'nedeľa ne ne_pondelok po po_utorok ut ut_streda st st_štvrtok št št_piatok pi pi_sobota so so'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'pár sekúnd',  '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minúta',        '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minúta',        '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minúty',      '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minút',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'hodina',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'hodina',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 hodiny',     '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 hodín',      '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 hodín',     '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'deň',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'deň',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dni',         '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'deň',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dní',         '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dní',        '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mesiac',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mesiac',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mesiac',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 mesiace',    '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 mesiace',    '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mesiace',    '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mesiac',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mesiacov',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'rok',           '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 roky',        '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'rok',           '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 rokov',         '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za pár sekúnd',  'prefix');\n        assert.equal(moment(0).from(30000), 'pred pár sekundami', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'pred pár sekundami',  'now from now should display as in the past');\n    });\n\n    test('fromNow (future)', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za pár sekúnd', 'in a few seconds');\n        assert.equal(moment().add({m: 1}).fromNow(), 'za minútu', 'in a minute');\n        assert.equal(moment().add({m: 3}).fromNow(), 'za 3 minúty', 'in 3 minutes');\n        assert.equal(moment().add({m: 10}).fromNow(), 'za 10 minút', 'in 10 minutes');\n        assert.equal(moment().add({h: 1}).fromNow(), 'za hodinu', 'in an hour');\n        assert.equal(moment().add({h: 3}).fromNow(), 'za 3 hodiny', 'in 3 hours');\n        assert.equal(moment().add({h: 10}).fromNow(), 'za 10 hodín', 'in 10 hours');\n        assert.equal(moment().add({d: 1}).fromNow(), 'za deň', 'in a day');\n        assert.equal(moment().add({d: 3}).fromNow(), 'za 3 dni', 'in 3 days');\n        assert.equal(moment().add({d: 10}).fromNow(), 'za 10 dní', 'in 10 days');\n        assert.equal(moment().add({M: 1}).fromNow(), 'za mesiac', 'in a month');\n        assert.equal(moment().add({M: 3}).fromNow(), 'za 3 mesiace', 'in 3 months');\n        assert.equal(moment().add({M: 10}).fromNow(), 'za 10 mesiacov', 'in 10 months');\n        assert.equal(moment().add({y: 1}).fromNow(), 'za rok', 'in a year');\n        assert.equal(moment().add({y: 3}).fromNow(), 'za 3 roky', 'in 3 years');\n        assert.equal(moment().add({y: 10}).fromNow(), 'za 10 rokov', 'in 10 years');\n    });\n\n    test('fromNow (past)', function (assert) {\n        assert.equal(moment().subtract({s: 30}).fromNow(), 'pred pár sekundami', 'a few seconds ago');\n        assert.equal(moment().subtract({m: 1}).fromNow(), 'pred minútou', 'a minute ago');\n        assert.equal(moment().subtract({m: 3}).fromNow(), 'pred 3 minútami', '3 minutes ago');\n        assert.equal(moment().subtract({m: 10}).fromNow(), 'pred 10 minútami', '10 minutes ago');\n        assert.equal(moment().subtract({h: 1}).fromNow(), 'pred hodinou', 'an hour ago');\n        assert.equal(moment().subtract({h: 3}).fromNow(), 'pred 3 hodinami', '3 hours ago');\n        assert.equal(moment().subtract({h: 10}).fromNow(), 'pred 10 hodinami', '10 hours ago');\n        assert.equal(moment().subtract({d: 1}).fromNow(), 'pred dňom', 'a day ago');\n        assert.equal(moment().subtract({d: 3}).fromNow(), 'pred 3 dňami', '3 days ago');\n        assert.equal(moment().subtract({d: 10}).fromNow(), 'pred 10 dňami', '10 days ago');\n        assert.equal(moment().subtract({M: 1}).fromNow(), 'pred mesiacom', 'a month ago');\n        assert.equal(moment().subtract({M: 3}).fromNow(), 'pred 3 mesiacmi', '3 months ago');\n        assert.equal(moment().subtract({M: 10}).fromNow(), 'pred 10 mesiacmi', '10 months ago');\n        assert.equal(moment().subtract({y: 1}).fromNow(), 'pred rokom', 'a year ago');\n        assert.equal(moment().subtract({y: 3}).fromNow(), 'pred 3 rokmi', '3 years ago');\n        assert.equal(moment().subtract({y: 10}).fromNow(), 'pred 10 rokmi', '10 years ago');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'dnes o 2:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'dnes o 2:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'dnes o 3:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'zajtra o 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'dnes o 1:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'včera o 2:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m, nextDay;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            nextDay = '';\n            switch (m.day()) {\n            case 0:\n                nextDay = 'v nedeľu';\n                break;\n            case 1:\n                nextDay = 'v pondelok';\n                break;\n            case 2:\n                nextDay = 'v utorok';\n                break;\n            case 3:\n                nextDay = 'v stredu';\n                break;\n            case 4:\n                nextDay = 'vo štvrtok';\n                break;\n            case 5:\n                nextDay = 'v piatok';\n                break;\n            case 6:\n                nextDay = 'v sobotu';\n                break;\n            }\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [o] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [o] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[' + nextDay + '] [o] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m, lastDay;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            lastDay = '';\n            switch (m.day()) {\n            case 0:\n                lastDay = 'minulú nedeľu';\n                break;\n            case 1:\n                lastDay = 'minulý pondelok';\n                break;\n            case 2:\n                lastDay = 'minulý utorok';\n                break;\n            case 3:\n                lastDay = 'minulú stredu';\n                break;\n            case 4:\n                lastDay = 'minulý štvrtok';\n                break;\n            case 5:\n                lastDay = 'minulý piatok';\n                break;\n            case 6:\n                lastDay = 'minulú sobotu';\n                break;\n            }\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [o] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [o] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[' + lastDay + '] [o] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('humanize duration', function (assert) {\n        assert.equal(moment.duration(1, 'minutes').humanize(), 'minúta', 'a minute (future)');\n        assert.equal(moment.duration(1, 'minutes').humanize(true), 'za minútu', 'in a minute');\n        assert.equal(moment.duration(-1, 'minutes').humanize(), 'minúta', 'a minute (past)');\n        assert.equal(moment.duration(-1, 'minutes').humanize(true), 'pred minútou', 'a minute ago');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sl');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan._februar feb._marec mar._april apr._maj maj_junij jun._julij jul._avgust avg._september sep._oktober okt._november nov._december dec.'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'nedelja, 14. februar 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ned., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. nedelja ned. ne'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14. 02. 2010'],\n                ['LL',                                 '14. februar 2010'],\n                ['LLL',                                '14. februar 2010 15:25'],\n                ['LLLL',                               'nedelja, 14. februar 2010 15:25'],\n                ['l',                                  '14. 2. 2010'],\n                ['ll',                                 '14. feb. 2010'],\n                ['lll',                                '14. feb. 2010 15:25'],\n                ['llll',                               'ned., 14. feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan._februar feb._marec mar._april apr._maj maj._junij jun._julij jul._avgust avg._september sep._oktober okt._november nov._december dec.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'nedelja ned. ne_ponedeljek pon. po_torek tor. to_sreda sre. sr_četrtek čet. če_petek pet. pe_sobota sob. so'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'nekaj sekund', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ena minuta',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ena minuta',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuti',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minut',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ena ura',      '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ena ura',      '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 uri',        '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ur',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ur',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'en dan',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'en dan',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dni',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'en dan',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dni',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dni',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'en mesec',     '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'en mesec',     '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'en mesec',     '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meseca',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meseca',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 mesece',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'en mesec',     '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 mesecev',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'eno leto',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 leti',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'eno leto',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 let',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'čez nekaj sekund',  'prefix');\n        assert.equal(moment(0).from(30000), 'nekaj sekund nazaj', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'nekaj sekund nazaj',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'čez nekaj sekund', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'čez 5 dni', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'danes ob 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'danes ob 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'danes ob 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'jutri ob 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'danes ob 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'včeraj ob 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[v] [nedeljo] [ob] LT';\n            case 3:\n                return '[v] [sredo] [ob] LT';\n            case 6:\n                return '[v] [soboto] [ob] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[v] dddd [ob] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[prejšnja] dddd [ob] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prejšnji] dddd [ob] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sq');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'Janar Jan_Shkurt Shk_Mars Mar_Prill Pri_Maj Maj_Qershor Qer_Korrik Kor_Gusht Gus_Shtator Sht_Tetor Tet_Nëntor Nën_Dhjetor Dhj'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, HH:mm:ss',       'E Diel, Shkurt 14. 2010, 15:25:50'],\n                ['ddd, HH',                            'Die, 15'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 Shkurt Shk'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. E Diel Die D'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '6 6. 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'MD MD'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 Shkurt 2010'],\n                ['LLL',                                '14 Shkurt 2010 15:25'],\n                ['LLLL',                               'E Diel, 14 Shkurt 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Shk 2010'],\n                ['lll',                                '14 Shk 2010 15:25'],\n                ['llll',                               'Die, 14 Shk 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  0, 0]).format('A'), 'PD', 'before dawn');\n        assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), 'MD', 'noon');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'Janar Jan_Shkurt Shk_Mars Mar_Prill Pri_Maj Maj_Qershor Qer_Korrik Kor_Gusht Gus_Shtator Sht_Tetor Tet_Nëntor Nën_Dhjetor Dhj'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'E Diel Die D_E Hënë Hën H_E Martë Mar Ma_E Mërkurë Mër Më_E Enjte Enj E_E Premte Pre P_E Shtunë Sht Sh'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'disa sekonda', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'një minutë',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'një minutë',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuta',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuta',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'një orë',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'një orë',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 orë',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 orë',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 orë',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'një ditë',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'një ditë',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 ditë',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'një ditë',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 ditë',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 ditë',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'një muaj',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'një muaj',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'një muaj',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 muaj',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 muaj',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 muaj',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'një muaj',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 muaj',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'një vit',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 vite',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'një vit',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 vite',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'në disa sekonda',  'prefix');\n        assert.equal(moment(0).from(30000), 'disa sekonda më parë', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'disa sekonda më parë',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'në disa sekonda', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'në 5 ditë', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Sot në 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Sot në 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Sot në 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Nesër në 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Sot në 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Dje në 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [në] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [në] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [në] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [e kaluar në] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [e kaluar në] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [e kaluar në] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52.', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1.', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1.', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2.', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2.', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sr-cyrl');\n\n    test('parse', function (assert) {\n        var tests = 'јануар јан._фебруар феб._март мар._април апр._мај мај_јун јун_јул јул_август авг._септембар сеп._октобар окт._новембар нов._децембар дец.'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'недеља, 14. фебруар 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'нед., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 фебруар феб.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. недеља нед. не'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14. 02. 2010'],\n                ['LL',                                 '14. фебруар 2010'],\n                ['LLL',                                '14. фебруар 2010 15:25'],\n                ['LLLL',                               'недеља, 14. фебруар 2010 15:25'],\n                ['l',                                  '14. 2. 2010'],\n                ['ll',                                 '14. феб. 2010'],\n                ['lll',                                '14. феб. 2010 15:25'],\n                ['llll',                               'нед., 14. феб. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'јануар јан._фебруар феб._март мар._април апр._мај мај_јун јун_јул јул_август авг._септембар сеп._октобар окт._новембар нов._децембар дец.'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'недеља нед. не_понедељак пон. по_уторак уто. ут_среда сре. ср_четвртак чет. че_петак пет. пе_субота суб. су'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'неколико секунди', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'један минут',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'један минут',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 минуте',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 минута',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'један сат',      '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'један сат',      '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 сата',        '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 сати',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 сати',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'дан',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'дан',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дана',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'дан',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 дана',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 дана',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'месец',     '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'месец',     '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'месец',     '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 месеца',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 месеца',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 месеца',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'месец',     '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 месеци',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'годину',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 године',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'годину',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 година',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'за неколико секунди',  'prefix');\n        assert.equal(moment(0).from(30000), 'пре неколико секунди', 'prefix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'пре неколико секунди',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'за неколико секунди', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'за 5 дана', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'данас у 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'данас у 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'данас у 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'сутра у 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'данас у 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'јуче у 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[у] [недељу] [у] LT';\n            case 3:\n                return '[у] [среду] [у] LT';\n            case 6:\n                return '[у] [суботу] [у] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[у] dddd [у] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            var lastWeekDay = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT'\n                ];\n\n            return lastWeekDay[d.day()];\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sr');\n\n    test('parse', function (assert) {\n        var tests = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'nedelja, 14. februar 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ned., 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2. 02 februar feb.'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14. 14'],\n                ['d do dddd ddd dd',                   '0 0. nedelja ned. ne'],\n                ['DDD DDDo DDDD',                      '45 45. 045'],\n                ['w wo ww',                            '7 7. 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45. day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14. 02. 2010'],\n                ['LL',                                 '14. februar 2010'],\n                ['LLL',                                '14. februar 2010 15:25'],\n                ['LLLL',                               'nedelja, 14. februar 2010 15:25'],\n                ['l',                                  '14. 2. 2010'],\n                ['ll',                                 '14. feb. 2010'],\n                ['lll',                                '14. feb. 2010 15:25'],\n                ['llll',                               'ned., 14. feb. 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januar jan._februar feb._mart mar._april apr._maj maj_jun jun_jul jul_avgust avg._septembar sep._oktobar okt._novembar nov._decembar dec.'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'nedelja ned. ne_ponedeljak pon. po_utorak uto. ut_sreda sre. sr_četvrtak čet. če_petak pet. pe_subota sub. su'.split('_'),\n            i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'nekoliko sekundi', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'jedan minut',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'jedan minut',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minute',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuta',     '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'jedan sat',      '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'jedan sat',      '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 sata',        '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 sati',         '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 sati',        '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'dan',       '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'dan',       '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dana',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'dan',       '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dana',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dana',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'mesec',     '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'mesec',     '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'mesec',     '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 meseca',     '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 meseca',     '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 meseca',     '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'mesec',     '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 meseci',    '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'godinu',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 godine',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'godinu',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 godina',        '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'za nekoliko sekundi',  'prefix');\n        assert.equal(moment(0).from(30000), 'pre nekoliko sekundi', 'prefix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'pre nekoliko sekundi',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'za nekoliko sekundi', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'za 5 dana', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'danas u 2:00',  'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'danas u 2:25',  'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'danas u 3:00',  'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'sutra u 2:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'danas u 1:00',  'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'juče u 2:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n                return '[u] [nedelju] [u] LT';\n            case 3:\n                return '[u] [sredu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            var lastWeekDay = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT'\n                ];\n\n            return lastWeekDay[d.day()];\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1.', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2.', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2.', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3.', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('sv');\n\n    test('parse', function (assert) {\n        var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'söndag, februari 14e 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'sön, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2a 02 februari feb'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14e 14'],\n                ['d do dddd ddd dd',                   '0 0e söndag sön sö'],\n                ['DDD DDDo DDDD',                      '45 45e 045'],\n                ['w wo ww',                            '6 6e 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45e day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '14 februari 2010'],\n                ['LLL',                                '14 februari 2010 15:25'],\n                ['LLLL',                               'söndag 14 februari 2010 15:25'],\n                ['l',                                  '2010-2-14'],\n                ['ll',                                 '14 feb 2010'],\n                ['lll',                                '14 feb 2010 15:25'],\n                ['llll',                               'sön 14 feb 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'söndag sön sö_måndag mån må_tisdag tis ti_onsdag ons on_torsdag tor to_fredag fre fr_lördag lör lö'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'några sekunder', '44 sekunder = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'en minut',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'en minut',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuter',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuter',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'en timme',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'en timme',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 timmar',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 timmar',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 timmar',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'en dag',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'en dag',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 dagar',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'en dag',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 dagar',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 dagar',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'en månad',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'en månad',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'en månad',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 månader',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 månader',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 månader',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'en månad',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 månader',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ett år',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 år',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ett år',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 år',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'om några sekunder',  'prefix');\n        assert.equal(moment(0).from(30000), 'för några sekunder sedan', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'för några sekunder sedan',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'om några sekunder', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dagar', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Idag 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Idag 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Idag 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Imorgon 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Idag 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Igår 02:00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Förra] dddd[en] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Förra] dddd[en] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Förra] dddd[en] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52a', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1a', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1a', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2a', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2a', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('ta');\n\n    test('parse', function (assert) {\n        var tests = 'ஜனவரி ஜனவரி_பிப்ரவரி பிப்ரவரி_மார்ச் மார்ச்_ஏப்ரல் ஏப்ரல்_மே மே_ஜூன் ஜூன்_ஜூலை ஜூலை_ஆகஸ்ட் ஆகஸ்ட்_செப்டெம்பர் செப்டெம்பர்_அக்டோபர் அக்டோபர்_நவம்பர் நவம்பர்_டிசம்பர் டிசம்பர்'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a', 'ஞாயிற்றுக்கிழமை, பிப்ரவரி 14வது 2010, 3:25:50  எற்பாடு'],\n                ['ddd, hA',                       'ஞாயிறு, 3 எற்பாடு'],\n                ['M Mo MM MMMM MMM',              '2 2வது 02 பிப்ரவரி பிப்ரவரி'],\n                ['YYYY YY',                       '2010 10'],\n                ['D Do DD',                       '14 14வது 14'],\n                ['d do dddd ddd dd',              '0 0வது ஞாயிற்றுக்கிழமை ஞாயிறு ஞா'],\n                ['DDD DDDo DDDD',                 '45 45வது 045'],\n                ['w wo ww',                       '8 8வது 08'],\n                ['h hh',                          '3 03'],\n                ['H HH',                          '15 15'],\n                ['m mm',                          '25 25'],\n                ['s ss',                          '50 50'],\n                ['a A',                           ' எற்பாடு  எற்பாடு'],\n                ['[ஆண்டின்] DDDo  [நாள்]', 'ஆண்டின் 45வது  நாள்'],\n                ['LTS',                           '15:25:50'],\n                ['L',                             '14/02/2010'],\n                ['LL',                            '14 பிப்ரவரி 2010'],\n                ['LLL',                           '14 பிப்ரவரி 2010, 15:25'],\n                ['LLLL',                          'ஞாயிற்றுக்கிழமை, 14 பிப்ரவரி 2010, 15:25'],\n                ['l',                             '14/2/2010'],\n                ['ll',                            '14 பிப்ரவரி 2010'],\n                ['lll',                           '14 பிப்ரவரி 2010, 15:25'],\n                ['llll',                          'ஞாயிறு, 14 பிப்ரவரி 2010, 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1வது', '1வது');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2வது', '2வது');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3வது', '3வது');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4வது', '4வது');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5வது', '5வது');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6வது', '6வது');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7வது', '7வது');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8வது', '8வது');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9வது', '9வது');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10வது', '10வது');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11வது', '11வது');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12வது', '12வது');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13வது', '13வது');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14வது', '14வது');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15வது', '15வது');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16வது', '16வது');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17வது', '17வது');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18வது', '18வது');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19வது', '19வது');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20வது', '20வது');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21வது', '21வது');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22வது', '22வது');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23வது', '23வது');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24வது', '24வது');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25வது', '25வது');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26வது', '26வது');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27வது', '27வது');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28வது', '28வது');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29வது', '29வது');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30வது', '30வது');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31வது', '31வது');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ஜனவரி ஜனவரி_பிப்ரவரி பிப்ரவரி_மார்ச் மார்ச்_ஏப்ரல் ஏப்ரல்_மே மே_ஜூன் ஜூன்_ஜூலை ஜூலை_ஆகஸ்ட் ஆகஸ்ட்_செப்டெம்பர் செப்டெம்பர்_அக்டோபர் அக்டோபர்_நவம்பர் நவம்பர்_டிசம்பர் டிசம்பர்'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'ஞாயிற்றுக்கிழமை ஞாயிறு ஞா_திங்கட்கிழமை திங்கள் தி_செவ்வாய்கிழமை செவ்வாய் செ_புதன்கிழமை புதன் பு_வியாழக்கிழமை வியாழன் வி_வெள்ளிக்கிழமை வெள்ளி வெ_சனிக்கிழமை சனி ச'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ஒரு சில விநாடிகள்', '44 விநாடிகள் = ஒரு சில விநாடிகள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ஒரு நிமிடம்',      '45 விநாடிகள் = ஒரு நிமிடம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ஒரு நிமிடம்',      '89 விநாடிகள் = ஒரு நிமிடம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 நிமிடங்கள்',     '90 விநாடிகள் = 2 நிமிடங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 நிமிடங்கள்',    '44 நிமிடங்கள் = 44 நிமிடங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ஒரு மணி நேரம்',       '45 நிமிடங்கள் = ஒரு மணி நேரம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ஒரு மணி நேரம்',       '89 நிமிடங்கள் = ஒரு மணி நேரம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 மணி நேரம்',       '90 நிமிடங்கள் = 2 மணி நேரம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 மணி நேரம்',       '5 மணி நேரம் = 5 மணி நேரம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 மணி நேரம்',      '21 மணி நேரம் = 21 மணி நேரம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ஒரு நாள்',         '22 மணி நேரம் = ஒரு நாள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ஒரு நாள்',         '35 மணி நேரம் = ஒரு நாள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 நாட்கள்',        '36 மணி நேரம் = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ஒரு நாள்',         '1 நாள் = ஒரு நாள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 நாட்கள்',        '5 நாட்கள் = 5 நாட்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 நாட்கள்',       '25 நாட்கள் = 25 நாட்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ஒரு மாதம்',       '26 நாட்கள் = ஒரு மாதம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ஒரு மாதம்',       '30 நாட்கள் = ஒரு மாதம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ஒரு மாதம்',       '45 நாட்கள் = ஒரு மாதம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 மாதங்கள்',      '46 நாட்கள் = 2 மாதங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 மாதங்கள்',      '75 நாட்கள் = 2 மாதங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 மாதங்கள்',      '76 நாட்கள் = 3 மாதங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ஒரு மாதம்',       '1 மாதம் = ஒரு மாதம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 மாதங்கள்',      '5 மாதங்கள் = 5 மாதங்கள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ஒரு வருடம்',        '345 நாட்கள் = ஒரு வருடம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ஆண்டுகள்',       '548 நாட்கள் = 2 ஆண்டுகள்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ஒரு வருடம்',        '1 வருடம் = ஒரு வருடம்');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ஆண்டுகள்',       '5 ஆண்டுகள் = 5 ஆண்டுகள்');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'ஒரு சில விநாடிகள் இல்',  'prefix');\n        assert.equal(moment(0).from(30000), 'ஒரு சில விநாடிகள் முன்', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'ஒரு சில விநாடிகள் முன்',  'இப்போது இருந்து கடந்த காலத்தில் காட்ட வேண்டும்');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'ஒரு சில விநாடிகள் இல்', 'ஒரு சில விநாடிகள் இல்');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 நாட்கள் இல்', '5 நாட்கள் இல்');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),  'இன்று 02:00', 'இன்று  02:00');\n        assert.equal(moment(a).add({m: 25}).calendar(), 'இன்று 02:25', 'இன்று  02:25');\n        assert.equal(moment(a).add({h: 1}).calendar(), 'இன்று 03:00', 'இன்று  03:00');\n        assert.equal(moment(a).add({d: 1}).calendar(), 'நாளை 02:00', 'நாளை  02:00');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'இன்று 01:00',      'இன்று  01:00');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'நேற்று 02:00',  'நேற்று  02:00');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd, LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd, LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd, LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[கடந்த வாரம்] dddd, LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[கடந்த வாரம்] dddd, LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[கடந்த வாரம்] dddd, LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  0, 30]).format('a'), ' யாமம்', '(after) midnight');\n        assert.equal(moment([2011, 2, 23,  2, 30]).format('a'), ' வைகறை', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  9, 30]).format('a'), ' காலை', 'morning');\n        assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), ' எற்பாடு', 'during day');\n        assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), ' எற்பாடு', 'evening');\n        assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), ' மாலை', 'late evening');\n        assert.equal(moment([2011, 2, 23, 23, 30]).format('a'), ' யாமம்', '(before) midnight');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('th');\n\n    test('parse', function (assert) {\n        var tests = 'มกราคม มกรา_กุมภาพันธ์ กุมภา_มีนาคม มีนา_เมษายน เมษา_พฤษภาคม พฤษภา_มิถุนายน มิถุนา_กรกฎาคม กรกฎา_สิงหาคม สิงหา_กันยายน กันยา_ตุลาคม ตุลา_พฤศจิกายน พฤศจิกา_ธันวาคม ธันวา'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, h:mm:ss a',      'อาทิตย์, 14 กุมภาพันธ์ 2010, 3:25:50 หลังเที่ยง'],\n                ['ddd, h A',                           'อาทิตย์, 3 หลังเที่ยง'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 กุมภาพันธ์ กุมภา'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 อาทิตย์ อาทิตย์ อา.'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'หลังเที่ยง หลังเที่ยง'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15 นาฬิกา 25 นาที 50 วินาที'],\n                ['L',                                  '2010/02/14'],\n                ['LL',                                 '14 กุมภาพันธ์ 2010'],\n                ['LLL',                                '14 กุมภาพันธ์ 2010 เวลา 15 นาฬิกา 25 นาที'],\n                ['LLLL',                               'วันอาทิตย์ที่ 14 กุมภาพันธ์ 2010 เวลา 15 นาฬิกา 25 นาที'],\n                ['l',                                  '2010/2/14'],\n                ['ll',                                 '14 กุมภา 2010'],\n                ['lll',                                '14 กุมภา 2010 เวลา 15 นาฬิกา 25 นาที'],\n                ['llll',                               'วันอาทิตย์ที่ 14 กุมภา 2010 เวลา 15 นาฬิกา 25 นาที']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = 'มกราคม มกรา_กุมภาพันธ์ กุมภา_มีนาคม มีนา_เมษายน เมษา_พฤษภาคม พฤษภา_มิถุนายน มิถุนา_กรกฎาคม กรกฎา_สิงหาคม สิงหา_กันยายน กันยา_ตุลาคม ตุลา_พฤศจิกายน พฤศจิกา_ธันวาคม ธันวา'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'อาทิตย์ อาทิตย์ อา._จันทร์ จันทร์ จ._อังคาร อังคาร อ._พุธ พุธ พ._พฤหัสบดี พฤหัส พฤ._ศุกร์ ศุกร์ ศ._เสาร์ เสาร์ ส.'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ไม่กี่วินาที',   '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '1 นาที', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '1 นาที', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 นาที',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 นาที', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '1 ชั่วโมง', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '1 ชั่วโมง', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ชั่วโมง',  '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ชั่วโมง',  '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ชั่วโมง', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '1 วัน',   '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '1 วัน',   '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 วัน',   '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '1 วัน',   '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 วัน',   '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 วัน',  '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '1 เดือน', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '1 เดือน', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '1 เดือน', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 เดือน',  '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 เดือน',  '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 เดือน',  '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '1 เดือน', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 เดือน',  '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1 ปี',   '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ปี',   '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '1 ปี',   '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ปี',   '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'อีก ไม่กี่วินาที',  'prefix');\n        assert.equal(moment(0).from(30000), 'ไม่กี่วินาทีที่แล้ว', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'ไม่กี่วินาทีที่แล้ว',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'อีก ไม่กี่วินาที', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'อีก 5 วัน', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'วันนี้ เวลา 2 นาฬิกา 0 นาที',      'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'วันนี้ เวลา 2 นาฬิกา 25 นาที',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'วันนี้ เวลา 3 นาฬิกา 0 นาที',      'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'พรุ่งนี้ เวลา 2 นาฬิกา 0 นาที', 'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'วันนี้ เวลา 1 นาฬิกา 0 นาที',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'เมื่อวานนี้ เวลา 2 นาฬิกา 0 นาที', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd[หน้า เวลา] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd[หน้า เวลา] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd[หน้า เวลา] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[วัน]dddd[ที่แล้ว เวลา] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[วัน]dddd[ที่แล้ว เวลา] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[วัน]dddd[ที่แล้ว เวลา] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1', 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('tl-ph');\n\n    test('parse', function (assert) {\n        var tests = 'Enero Ene_Pebrero Peb_Marso Mar_Abril Abr_Mayo May_Hunyo Hun_Hulyo Hul_Agosto Ago_Setyembre Set_Oktubre Okt_Nobyembre Nob_Disyembre Dis'.split('_'),\n            i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Linggo, Pebrero 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Lin, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 Pebrero Peb'],\n                ['YYYY YY',                             '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 Linggo Lin Li'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '6 6 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '02/14/2010'],\n                ['LL',                                 'Pebrero 14, 2010'],\n                ['LLL',                                'Pebrero 14, 2010 15:25'],\n                ['LLLL',                               'Linggo, Pebrero 14, 2010 15:25'],\n                ['l',                                  '2/14/2010'],\n                ['ll',                                 'Peb 14, 2010'],\n                ['lll',                                'Peb 14, 2010 15:25'],\n                ['llll',                               'Lin, Peb 14, 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Enero Ene_Pebrero Peb_Marso Mar_Abril Abr_Mayo May_Hunyo Hun_Hulyo Hul_Agosto Ago_Setyembre Set_Oktubre Okt_Nobyembre Nob_Disyembre Dis'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Linggo Lin Li_Lunes Lun Lu_Martes Mar Ma_Miyerkules Miy Mi_Huwebes Huw Hu_Biyernes Biy Bi_Sabado Sab Sab'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ilang segundo', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'isang minuto',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'isang minuto',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuto',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuto', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'isang oras',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'isang oras',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 oras',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 oras',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 oras',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'isang araw',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'isang araw',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 araw',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'isang araw',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 araw',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 araw',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'isang buwan',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'isang buwan',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'isang buwan',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 buwan',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 buwan',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 buwan',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'isang buwan',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 buwan',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'isang taon',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 taon',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'isang taon',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 taon',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'sa loob ng ilang segundo', 'prefix');\n        assert.equal(moment(0).from(30000), 'ilang segundo ang nakalipas', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'sa loob ng ilang segundo', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'sa loob ng 5 araw', 'in 5 days');\n    });\n\n    test('same day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Ngayon sa 02:00',    'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Ngayon sa 02:25',    'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Ngayon sa 03:00',    'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Bukas sa 02:00',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Ngayon sa 01:00',    'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Kahapon sa 02:00',   'yesterday at the same time');\n    });\n\n    test('same next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [sa] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [sa] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [sa] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('same last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [huling linggo] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [huling linggo] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [huling linggo] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('same all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'), '1 01 1', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '1 01 1', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('tr');\n\n    test('parse', function (assert) {\n        var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'Pazar, Şubat 14\\'üncü 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'Paz, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2\\'nci 02 Şubat Şub'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14\\'üncü 14'],\n                ['d do dddd ddd dd',                   '0 0\\'ıncı Pazar Paz Pz'],\n                ['DDD DDDo DDDD',                      '45 45\\'inci 045'],\n                ['w wo ww',                            '7 7\\'nci 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[yılın] DDDo [günü]',                'yılın 45\\'inci günü'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 Şubat 2010'],\n                ['LLL',                                '14 Şubat 2010 15:25'],\n                ['LLLL',                               'Pazar, 14 Şubat 2010 15:25'],\n                ['l',                                  '14.2.2010'],\n                ['ll',                                 '14 Şub 2010'],\n                ['lll',                                '14 Şub 2010 15:25'],\n                ['llll',                               'Paz, 14 Şub 2010 15:25']\n            ],\n            DDDo = [\n                [359, '360\\'ıncı'],\n                [199, '200\\'üncü'],\n                [149, '150\\'nci']\n            ],\n            dt = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            DDDoDt,\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(dt.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n        for (i = 0; i < DDDo.length; i++) {\n            DDDoDt = moment([2010]);\n            assert.equal(DDDoDt.add(DDDo[i][0], 'days').format('DDDo'), DDDo[i][1], DDDo[i][0] + ' ---> ' + DDDo[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1\\'inci', '1st');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2\\'nci', '2nd');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3\\'üncü', '3rd');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4\\'üncü', '4th');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5\\'inci', '5th');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6\\'ncı', '6th');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7\\'nci', '7th');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8\\'inci', '8th');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9\\'uncu', '9th');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10\\'uncu', '10th');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11\\'inci', '11th');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12\\'nci', '12th');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13\\'üncü', '13th');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14\\'üncü', '14th');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15\\'inci', '15th');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16\\'ncı', '16th');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17\\'nci', '17th');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18\\'inci', '18th');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19\\'uncu', '19th');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20\\'nci', '20th');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21\\'inci', '21th');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22\\'nci', '22th');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23\\'üncü', '23th');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24\\'üncü', '24th');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25\\'inci', '25th');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26\\'ncı', '26th');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27\\'nci', '27th');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28\\'inci', '28th');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29\\'uncu', '29th');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30\\'uncu', '30th');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31\\'inci', '31st');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Pazar Paz Pz_Pazartesi Pts Pt_Salı Sal Sa_Çarşamba Çar Ça_Perşembe Per Pe_Cuma Cum Cu_Cumartesi Cts Ct'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'birkaç saniye', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'bir dakika',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'bir dakika',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 dakika',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 dakika',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'bir saat',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'bir saat',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 saat',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 saat',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 saat',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'bir gün',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'bir gün',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 gün',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'bir gün',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 gün',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 gün',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'bir ay',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'bir ay',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'bir ay',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 ay',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 ay',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 ay',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'bir ay',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 ay',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'bir yıl',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 yıl',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'bir yıl',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 yıl',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'birkaç saniye sonra',  'prefix');\n        assert.equal(moment(0).from(30000), 'birkaç saniye önce', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'birkaç saniye önce',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'birkaç saniye sonra', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 gün sonra', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'bugün saat 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'bugün saat 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'bugün saat 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'yarın saat 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'bugün saat 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'dün 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[haftaya] dddd [saat] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[haftaya] dddd [saat] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[haftaya] dddd [saat] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[geçen hafta] dddd [saat] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[geçen hafta] dddd [saat] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[geçen hafta] dddd [saat] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1\\'inci', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1\\'inci', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2\\'nci', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2\\'nci', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3\\'üncü', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('tzm-latn');\n\n    test('parse', function (assert) {\n        var tests = 'innayr innayr_brˤayrˤ brˤayrˤ_marˤsˤ marˤsˤ_ibrir ibrir_mayyw mayyw_ywnyw ywnyw_ywlywz ywlywz_ɣwšt ɣwšt_šwtanbir šwtanbir_ktˤwbrˤ ktˤwbrˤ_nwwanbir nwwanbir_dwjnbir dwjnbir'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'asamas, brˤayrˤ 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'asamas, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 brˤayrˤ brˤayrˤ'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 asamas asamas asamas'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 brˤayrˤ 2010'],\n                ['LLL',                                '14 brˤayrˤ 2010 15:25'],\n                ['LLLL',                               'asamas 14 brˤayrˤ 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 brˤayrˤ 2010'],\n                ['lll',                                '14 brˤayrˤ 2010 15:25'],\n                ['llll',                               'asamas 14 brˤayrˤ 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'innayr innayr_brˤayrˤ brˤayrˤ_marˤsˤ marˤsˤ_ibrir ibrir_mayyw mayyw_ywnyw ywnyw_ywlywz ywlywz_ɣwšt ɣwšt_šwtanbir šwtanbir_ktˤwbrˤ ktˤwbrˤ_nwwanbir nwwanbir_dwjnbir dwjnbir'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'asamas asamas asamas_aynas aynas aynas_asinas asinas asinas_akras akras akras_akwas akwas akwas_asimwas asimwas asimwas_asiḍyas asiḍyas asiḍyas'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'imik', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'minuḍ',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'minuḍ',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 minuḍ',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 minuḍ',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'saɛa',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'saɛa',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 tassaɛin',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 tassaɛin',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 tassaɛin',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ass',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ass',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 ossan',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ass',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 ossan',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 ossan',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ayowr',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ayowr',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ayowr',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 iyyirn',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 iyyirn',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 iyyirn',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ayowr',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 iyyirn',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'asgas',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 isgasn',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'asgas',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 isgasn',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'dadkh s yan imik',  'prefix');\n        assert.equal(moment(0).from(30000), 'yan imik', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'yan imik',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'dadkh s yan imik', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'dadkh s yan 5 ossan', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'asdkh g 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'asdkh g 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'asdkh g 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'aska g 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'asdkh g 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'assant g 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [g] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '1 01 1', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '2 02 2', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('tzm');\n\n    test('parse', function (assert) {\n        var tests = 'ⵉⵏⵏⴰⵢⵔ ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'ⴰⵙⴰⵎⴰⵙ, ⴱⵕⴰⵢⵕ 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'ⴰⵙⴰⵎⴰⵙ, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 ⴱⵕⴰⵢⵕ ⴱⵕⴰⵢⵕ'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '8 8 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[the] DDDo [day of the year]',       'the 45 day of the year'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 ⴱⵕⴰⵢⵕ 2010'],\n                ['LLL',                                '14 ⴱⵕⴰⵢⵕ 2010 15:25'],\n                ['LLLL',                               'ⴰⵙⴰⵎⴰⵙ 14 ⴱⵕⴰⵢⵕ 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 ⴱⵕⴰⵢⵕ 2010'],\n                ['lll',                                '14 ⴱⵕⴰⵢⵕ 2010 15:25'],\n                ['llll',                               'ⴰⵙⴰⵎⴰⵙ 14 ⴱⵕⴰⵢⵕ 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'ⵉⵏⵏⴰⵢⵔ ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ ⴰⵢⵏⴰⵙ ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ ⴰⵙⵉⵏⴰⵙ ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ ⴰⴽⵔⴰⵙ ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ ⴰⴽⵡⴰⵙ ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'ⵉⵎⵉⴽ', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'ⵎⵉⵏⵓⴺ',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'ⵎⵉⵏⵓⴺ',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 ⵎⵉⵏⵓⴺ',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 ⵎⵉⵏⵓⴺ',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'ⵙⴰⵄⴰ',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'ⵙⴰⵄⴰ',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 ⵜⴰⵙⵙⴰⵄⵉⵏ',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 ⵜⴰⵙⵙⴰⵄⵉⵏ',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 ⵜⴰⵙⵙⴰⵄⵉⵏ',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'ⴰⵙⵙ',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'ⴰⵙⵙ',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 oⵙⵙⴰⵏ',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'ⴰⵙⵙ',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 oⵙⵙⴰⵏ',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 oⵙⵙⴰⵏ',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'ⴰⵢoⵓⵔ',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'ⴰⵢoⵓⵔ',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'ⴰⵢoⵓⵔ',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 ⵉⵢⵢⵉⵔⵏ',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 ⵉⵢⵢⵉⵔⵏ',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 ⵉⵢⵢⵉⵔⵏ',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'ⴰⵢoⵓⵔ',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 ⵉⵢⵢⵉⵔⵏ',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ⴰⵙⴳⴰⵙ',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 ⵉⵙⴳⴰⵙⵏ',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'ⴰⵙⴳⴰⵙ',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 ⵉⵙⴳⴰⵙⵏ',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ',  'prefix');\n        assert.equal(moment(0).from(30000), 'ⵢⴰⵏ ⵉⵎⵉⴽ', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'ⵢⴰⵏ ⵉⵎⵉⴽ',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ 5 oⵙⵙⴰⵏ', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'ⴰⵙⴷⵅ ⴴ 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'ⴰⵙⴷⵅ ⴴ 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'ⴰⵙⴷⵅ ⴴ 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'ⴰⵙⴽⴰ ⴴ 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'ⴰⵙⴷⵅ ⴴ 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'ⴰⵚⴰⵏⵜ ⴴ 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [ⴴ] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).week(), 1, 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).week(), 2, 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).week(), 2, 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).week(), 3, 'Jan 14 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1');\n        assert.equal(moment([2007,  0,  5]).week(), 1, 'Jan  5 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 2, 'Jan  6 2007 should be week 2');\n        assert.equal(moment([2007,  0, 12]).week(), 2, 'Jan 12 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 3, 'Jan 13 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  4]).week(), 1, 'Jan  4 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 2, 'Jan  5 2008 should be week 2');\n        assert.equal(moment([2008,  0, 11]).week(), 2, 'Jan 11 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 3, 'Jan 12 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  3]).week(), 1, 'Jan  3 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 2, 'Jan  4 2003 should be week 2');\n        assert.equal(moment([2003,  0, 10]).week(), 2, 'Jan 10 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 3, 'Jan 11 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  2]).week(), 1, 'Jan  2 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 2, 'Jan  3 2009 should be week 2');\n        assert.equal(moment([2009,  0,  9]).week(), 2, 'Jan  9 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 3, 'Jan 10 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 2, 'Jan  2 2010 should be week 2');\n        assert.equal(moment([2010,  0,  8]).week(), 2, 'Jan  8 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 3, 'Jan  9 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011, 0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011, 0,  7]).week(), 1, 'Jan  7 2011 should be week 1');\n        assert.equal(moment([2011, 0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2');\n        assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1');\n        assert.equal(moment([2012,  0,  6]).format('w ww wo'), '1 01 1', 'Jan  6 2012 should be week 1');\n        assert.equal(moment([2012,  0,  7]).format('w ww wo'), '2 02 2', 'Jan  7 2012 should be week 2');\n        assert.equal(moment([2012,  0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');\n        assert.equal(moment([2012,  0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('uk');\n\n    test('parse', function (assert) {\n        var tests = 'січень січ_лютий лют_березень бер_квітень квіт_травень трав_червень черв_липень лип_серпень серп_вересень вер_жовтень жовт_листопад лист_грудень груд'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do MMMM YYYY, HH:mm:ss',       'неділя, 14-го лютого 2010, 15:25:50'],\n                ['ddd, h A',                           'нд, 3 дня'],\n                ['M Mo MM MMMM MMM',                   '2 2-й 02 лютий лют'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14-го 14'],\n                ['d do dddd ddd dd',                   '0 0-й неділя нд нд'],\n                ['DDD DDDo DDDD',                      '45 45-й 045'],\n                ['w wo ww',                            '7 7-й 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'дня дня'],\n                ['DDDo [день року]',                  '45-й день року'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14.02.2010'],\n                ['LL',                                 '14 лютого 2010 р.'],\n                ['LLL',                                '14 лютого 2010 р., 15:25'],\n                ['LLLL',                               'неділя, 14 лютого 2010 р., 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format meridiem', function (assert) {\n        assert.equal(moment([2012, 11, 28, 0, 0]).format('A'), 'ночі', 'night');\n        assert.equal(moment([2012, 11, 28, 3, 59]).format('A'), 'ночі', 'night');\n        assert.equal(moment([2012, 11, 28, 4, 0]).format('A'), 'ранку', 'morning');\n        assert.equal(moment([2012, 11, 28, 11, 59]).format('A'), 'ранку', 'morning');\n        assert.equal(moment([2012, 11, 28, 12, 0]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 16, 59]).format('A'), 'дня', 'afternoon');\n        assert.equal(moment([2012, 11, 28, 17, 0]).format('A'), 'вечора', 'evening');\n        assert.equal(moment([2012, 11, 28, 23, 59]).format('A'), 'вечора', 'evening');\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1-й', '1-й');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2-й', '2-й');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3-й', '3-й');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4-й', '4-й');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5-й', '5-й');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6-й', '6-й');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7-й', '7-й');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8-й', '8-й');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9-й', '9-й');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10-й', '10-й');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11-й', '11-й');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12-й', '12-й');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13-й', '13-й');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14-й', '14-й');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15-й', '15-й');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16-й', '16-й');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17-й', '17-й');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18-й', '18-й');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19-й', '19-й');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20-й', '20-й');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21-й', '21-й');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22-й', '22-й');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23-й', '23-й');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24-й', '24-й');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25-й', '25-й');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26-й', '26-й');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27-й', '27-й');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28-й', '28-й');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29-й', '29-й');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30-й', '30-й');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31-й', '31-й');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'січень січ_лютий лют_березень бер_квітень квіт_травень трав_червень черв_липень лип_серпень серп_вересень вер_жовтень жовт_листопад лист_грудень груд'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format month case', function (assert) {\n        var months = {\n            'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),\n            'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')\n        }, i;\n        for (i = 0; i < 12; i++) {\n            assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]);\n            assert.equal(moment([2011, i, 1]).format('MMMM'), months.nominative[i], '1 ' + months.nominative[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'неділя нд нд_понеділок пн пн_вівторок вт вт_середа ср ср_четвер чт чт_п’ятниця пт пт_субота сб сб'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'декілька секунд',    '44 seconds = seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'хвилина',   '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'хвилина',   '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 хвилини',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 хвилини', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'годину',    '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'годину',    '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 години',    '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 годин',    '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 година',   '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'день',      '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'день',      '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 дні',     '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'день',      '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 днів',     '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 11}), true),  '11 днів',     '11 days = 11 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 21}), true),  '21 день',     '21 days = 21 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 днів',    '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'місяць',    '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'місяць',    '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'місяць',    '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 місяці',   '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 місяці',   '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 місяці',   '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'місяць',    '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 місяців',   '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'рік',     '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 роки',    '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'рік',     '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 років',    '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'за декілька секунд', 'prefix');\n        assert.equal(moment(0).from(30000), 'декілька секунд тому', 'suffix');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'за декілька секунд', 'in seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'за 5 днів', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Сьогодні о 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Сьогодні о 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Сьогодні о 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Завтра о 02:00',      'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Сьогодні о 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Вчора о 02:00',       'yesterday at the same time');\n        // A special case for Ukrainian since 11 hours have different preposition\n        assert.equal(moment(a).add({h: 9}).calendar(),  'Сьогодні об 11:00',       'same day at 11 o\\'clock');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[У] dddd [о' + (m.hours() === 11 ? 'б' : '') + '] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[У] dddd [о] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[У] dddd [о] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        function makeFormat(d) {\n            switch (d.day()) {\n            case 0:\n            case 3:\n            case 5:\n            case 6:\n                return '[Минулої] dddd [о' + (d.hours() === 11 ? 'б' : '') + '] LT';\n            case 1:\n            case 2:\n            case 4:\n                return '[Минулого] dddd [о' + (d.hours() === 11 ? 'б' : '') + '] LT';\n            }\n        }\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format(makeFormat(m)),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).week(), 2, 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).week(), 3, 'Jan  9 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 12]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 1');\n        assert.equal(moment([2010,  0,  4]).week(), 2, 'Jan  4 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 2, 'Jan 10 2010 should be week 2');\n        assert.equal(moment([2010,  0, 11]).week(), 3, 'Jan 11 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 1');\n        assert.equal(moment([2011,  0,  3]).week(), 2, 'Jan  3 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 2, 'Jan  9 2011 should be week 2');\n        assert.equal(moment([2011,  0, 10]).week(), 3, 'Jan 10 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-й', 'Dec 26 2011 should be week 1');\n        assert.equal(moment([2012,  0,  1]).format('w ww wo'), '1 01 1-й', 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012,  0,  2]).format('w ww wo'), '2 02 2-й', 'Jan  2 2012 should be week 2');\n        assert.equal(moment([2012,  0,  8]).format('w ww wo'), '2 02 2-й', 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-й', 'Jan  9 2012 should be week 3');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('uz');\n\n    test('parse', function (assert) {\n        var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, Do-MMMM YYYY, h:mm:ss',        'Якшанба, 14-февраль 2010, 3:25:50'],\n                ['ddd, h:mm',                          'Якш, 3:25'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 февраль фев'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 Якшанба Якш Як'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '7 7 07'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[йилнинг] DDDo-[куни]',             'йилнинг 45-куни'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 февраль 2010'],\n                ['LLL',                                '14 февраль 2010 15:25'],\n                ['LLLL',                               '14 февраль 2010, Якшанба 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 фев 2010'],\n                ['lll',                                '14 фев 2010 15:25'],\n                ['llll',                               '14 фев 2010, Якш 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = 'Якшанба Якш Як_Душанба Душ Ду_Сешанба Сеш Се_Чоршанба Чор Чо_Пайшанба Пай Па_Жума Жум Жу_Шанба Шан Ша'.split('_'), i;\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'фурсат', '44 секунд = фурсат');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'бир дакика',      '45 секунд = бир дакика');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'бир дакика',      '89 секунд = бир дакика');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 дакика',     '90 секунд = 2 дакика');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 дакика',    '44 дакика = 44 дакика');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'бир соат',       '45 минут = бир соат');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'бир соат',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 соат',       '90 минут = 2 соат');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 соат',       '5 соат = 5 соат');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 соат',      '21 соат = 21 соат');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'бир кун',         '22 соат = бир кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'бир кун',         '35 соат = бир кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 кун',        '36 соат = 2 кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'бир кун',         '1 кун = 1 кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 кун',        '5 кун = 5 кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 кун',       '25 кун = 25 кун');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'бир ой',       '26 кун = бир ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'бир ой',       '30 кун = бир ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'бир ой',       '45 кун = бир ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 ой',      '46 кун = 2 ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 ой',      '75 кун = 2 ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 ой',      '76 кун = 3 ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'бир ой',       'бир ой = бир ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 ой',      '5 ой = 5 ой');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'бир йил',        '345 кун = бир йил');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 йил',       '548 кун = 2 йил');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'бир йил',        '1 йил = бир йил');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 йил',       '5 йил = 5 йил');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'Якин фурсат ичида',  'prefix');\n        assert.equal(moment(0).from(30000), 'Бир неча фурсат олдин', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'Бир неча фурсат олдин',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'Якин фурсат ичида', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), 'Якин 5 кун ичида', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Бугун соат 02:00 да',      'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Бугун соат 02:25 да',      'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Бугун соат 03:00 да',      'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Эртага 02:00 да',   'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Бугун соат 01:00 да',      'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Кеча соат 02:00 да',  'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [куни соат] LT [да]'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [куни соат] LT [да]'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [куни соат] LT [да]'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[Утган] dddd [куни соат] LT [да]'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[Утган] dddd [куни соат] LT [да]'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[Утган] dddd [куни соат] LT [да]'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  2, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  2, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  3, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 1, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  2, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  2, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  3, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 1, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  2, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  2, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  3, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '2 02 2', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '2 02 2', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '3 03 3', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '3 03 3', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('vi');\n\n    test('parse', function (assert) {\n        var i,\n            tests = 'tháng 1,Th01_tháng 2,Th02_tháng 3,Th03_tháng 4,Th04_tháng 5,Th05_tháng 6,Th06_tháng 7,Th07_tháng 8,Th08_tháng 9,Th09_tháng 10,Th10_tháng 11,Th11_tháng 12,Th12'.split('_');\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + i);\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(',');\n            equalTest(tests[i][0], '[tháng] M', i);\n            equalTest(tests[i][1], '[Th]M', i);\n            equalTest(tests[i][0], '[tháng] MM', i);\n            equalTest(tests[i][1], '[Th]MM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), '[THÁNG] M', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), '[TH]M', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), '[THÁNG] MM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), '[TH]MM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, h:mm:ss a',      'chủ nhật, tháng 2 14 2010, 3:25:50 pm'],\n                ['ddd, hA',                            'CN, 3PM'],\n                ['M Mo MM MMMM MMM',                   '2 2 02 tháng 2 Th02'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14 14'],\n                ['d do dddd ddd dd',                   '0 0 chủ nhật CN CN'],\n                ['DDD DDDo DDDD',                      '45 45 045'],\n                ['w wo ww',                            '6 6 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                'pm PM'],\n                ['[ngày thứ] DDDo [của năm]',          'ngày thứ 45 của năm'],\n                ['LTS',                                '15:25:50'],\n                ['L',                                  '14/02/2010'],\n                ['LL',                                 '14 tháng 2 năm 2010'],\n                ['LLL',                                '14 tháng 2 năm 2010 15:25'],\n                ['LLLL',                               'chủ nhật, 14 tháng 2 năm 2010 15:25'],\n                ['l',                                  '14/2/2010'],\n                ['ll',                                 '14 Th02 2010'],\n                ['lll',                                '14 Th02 2010 15:25'],\n                ['llll',                               'CN, 14 Th02 2010 15:25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format ordinal', function (assert) {\n        assert.equal(moment([2011, 0, 1]).format('DDDo'), '1', '1');\n        assert.equal(moment([2011, 0, 2]).format('DDDo'), '2', '2');\n        assert.equal(moment([2011, 0, 3]).format('DDDo'), '3', '3');\n        assert.equal(moment([2011, 0, 4]).format('DDDo'), '4', '4');\n        assert.equal(moment([2011, 0, 5]).format('DDDo'), '5', '5');\n        assert.equal(moment([2011, 0, 6]).format('DDDo'), '6', '6');\n        assert.equal(moment([2011, 0, 7]).format('DDDo'), '7', '7');\n        assert.equal(moment([2011, 0, 8]).format('DDDo'), '8', '8');\n        assert.equal(moment([2011, 0, 9]).format('DDDo'), '9', '9');\n        assert.equal(moment([2011, 0, 10]).format('DDDo'), '10', '10');\n\n        assert.equal(moment([2011, 0, 11]).format('DDDo'), '11', '11');\n        assert.equal(moment([2011, 0, 12]).format('DDDo'), '12', '12');\n        assert.equal(moment([2011, 0, 13]).format('DDDo'), '13', '13');\n        assert.equal(moment([2011, 0, 14]).format('DDDo'), '14', '14');\n        assert.equal(moment([2011, 0, 15]).format('DDDo'), '15', '15');\n        assert.equal(moment([2011, 0, 16]).format('DDDo'), '16', '16');\n        assert.equal(moment([2011, 0, 17]).format('DDDo'), '17', '17');\n        assert.equal(moment([2011, 0, 18]).format('DDDo'), '18', '18');\n        assert.equal(moment([2011, 0, 19]).format('DDDo'), '19', '19');\n        assert.equal(moment([2011, 0, 20]).format('DDDo'), '20', '20');\n\n        assert.equal(moment([2011, 0, 21]).format('DDDo'), '21', '21');\n        assert.equal(moment([2011, 0, 22]).format('DDDo'), '22', '22');\n        assert.equal(moment([2011, 0, 23]).format('DDDo'), '23', '23');\n        assert.equal(moment([2011, 0, 24]).format('DDDo'), '24', '24');\n        assert.equal(moment([2011, 0, 25]).format('DDDo'), '25', '25');\n        assert.equal(moment([2011, 0, 26]).format('DDDo'), '26', '26');\n        assert.equal(moment([2011, 0, 27]).format('DDDo'), '27', '27');\n        assert.equal(moment([2011, 0, 28]).format('DDDo'), '28', '28');\n        assert.equal(moment([2011, 0, 29]).format('DDDo'), '29', '29');\n        assert.equal(moment([2011, 0, 30]).format('DDDo'), '30', '30');\n\n        assert.equal(moment([2011, 0, 31]).format('DDDo'), '31', '31');\n    });\n\n    test('format month', function (assert) {\n        var i,\n            expected = 'tháng 1,Th01_tháng 2,Th02_tháng 3,Th03_tháng 4,Th04_tháng 5,Th05_tháng 6,Th06_tháng 7,Th07_tháng 8,Th08_tháng 9,Th09_tháng 10,Th10_tháng 11,Th11_tháng 12,Th12'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM,MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var i,\n            expected = 'chủ nhật CN CN_thứ hai T2 T2_thứ ba T3 T3_thứ tư T4 T4_thứ năm T5 T5_thứ sáu T6 T6_thứ bảy T7 T7'.split('_');\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  'vài giây', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  'một phút',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  'một phút',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2 phút',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44 phút',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  'một giờ',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  'một giờ',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2 giờ',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5 giờ',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21 giờ',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  'một ngày',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  'một ngày',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2 ngày',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   'một ngày',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5 ngày',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25 ngày',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  'một tháng',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  'một tháng',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  'một tháng',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2 tháng',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2 tháng',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3 tháng',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   'một tháng',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5 tháng',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'một năm',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 năm',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   'một năm',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5 năm',       '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), 'vài giây tới',  'prefix');\n        assert.equal(moment(0).from(30000), 'vài giây trước', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), 'vài giây trước',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), 'vài giây tới', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5 ngày tới', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     'Hôm nay lúc 02:00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Hôm nay lúc 02:25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Hôm nay lúc 03:00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Ngày mai lúc 02:00',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Hôm nay lúc 01:00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Hôm qua lúc 02:00', 'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [tuần tới lúc] LT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [tuần tới lúc] LT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [tuần tới lúc] LT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('dddd [tuần rồi lúc] LT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('dddd [tuần rồi lúc] LT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('dddd [tuần rồi lúc] LT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),  '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0, 2]).week(),  1, 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0, 8]).week(),  1, 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0, 9]).week(),  2, 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).week(),  1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007, 0, 7]).week(),  1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007, 0, 8]).week(),  2, 'Jan  8 2007 should be week 2');\n        assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n        assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0,  7]).week(), 2, 'Jan  7 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n        assert.equal(moment([2008,  0, 14]).week(), 3, 'Jan 14 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0,  6]).week(), 2, 'Jan  6 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n        assert.equal(moment([2003,  0, 13]).week(), 3, 'Jan 13 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0,  5]).week(), 2, 'Jan  5 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n        assert.equal(moment([2009,  0, 13]).week(), 3, 'Jan 12 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53');\n        assert.equal(moment([2010,  0,  1]).week(), 53, 'Jan  1 2010 should be week 53');\n        assert.equal(moment([2010,  0,  3]).week(), 53, 'Jan  3 2010 should be week 53');\n        assert.equal(moment([2010,  0,  4]).week(),  1, 'Jan  4 2010 should be week 1');\n        assert.equal(moment([2010,  0, 10]).week(),  1, 'Jan 10 2010 should be week 1');\n        assert.equal(moment([2010,  0, 11]).week(),  2, 'Jan 11 2010 should be week 2');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52');\n        assert.equal(moment([2011,  0,  1]).week(), 52, 'Jan  1 2011 should be week 52');\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  3]).week(),  1, 'Jan  3 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(),  1, 'Jan  9 2011 should be week 1');\n        assert.equal(moment([2011,  0, 10]).week(),  2, 'Jan 10 2011 should be week 2');\n    });\n\n    test('weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52', 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).format('w ww wo'),   '1 01 1', 'Jan  2 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'),   '1 01 1', 'Jan  8 2012 should be week 1');\n        assert.equal(moment([2012, 0,  9]).format('w ww wo'),   '2 02 2', 'Jan  9 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'),   '2 02 2', 'Jan 15 2012 should be week 2');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('zh-cn');\n\n    test('parse', function (assert) {\n        var tests = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i;\n\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, a h:mm:ss',      '星期日, 二月 14日 2010, 下午 3:25:50'],\n                ['ddd, Ah',                            '周日, 下午3'],\n                ['M Mo MM MMMM MMM',                   '2 2月 02 二月 2月'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14日 14'],\n                ['d do dddd ddd dd',                   '0 0日 星期日 周日 日'],\n                ['DDD DDDo DDDD',                      '45 45日 045'],\n                ['w wo ww',                            '6 6周 06'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                '下午 下午'],\n                ['[这年的第] DDDo',                    '这年的第 45日'],\n                ['LTS',                                '下午3点25分50秒'],\n                ['L',                                  '2010-02-14'],\n                ['LL',                                 '2010年2月14日'],\n                ['LLL',                                '2010年2月14日下午3点25'],\n                ['LLLL',                               '2010年2月14日星期日下午3点25'],\n                ['l',                                  '2010-02-14'],\n                ['ll',                                 '2010年2月14日'],\n                ['lll',                                '2010年2月14日下午3点25'],\n                ['llll',                               '2010年2月14日星期日下午3点25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i;\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = '星期日 周日 日_星期一 周一 一_星期二 周二 二_星期三 周三 三_星期四 周四 四_星期五 周五 五_星期六 周六 六'.split('_'), i;\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '几秒',   '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '1分钟', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '1分钟', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2分钟',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44分钟', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '1小时', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '1小时', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2小时',  '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5小时',  '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21小时', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '1天',   '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '1天',   '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2天',   '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '1天',   '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5天',   '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25天',  '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '1个月', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '1个月', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '1个月', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2个月',  '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2个月',  '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3个月',  '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '1个月', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5个月',  '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1年',   '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年',   '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '1年',   '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5年',   '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), '几秒内',  'prefix');\n        assert.equal(moment(0).from(30000), '几秒前', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), '几秒前',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), '几秒内', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5天内', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     '今天凌晨2点整',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      '今天凌晨2点25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       '今天凌晨3点整',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       '明天凌晨2点整',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天凌晨1点整',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天凌晨2点整',     'yesterday at the same time');\n    });\n\n    test('calendar current week', function (assert) {\n        var i, m,\n            today = moment().startOf('day');\n\n        for (i = 0; i < 7; i++) {\n            m = moment().startOf('week').add({d: i});\n            if (Math.abs(m.diff(today, 'days')) <= 1) {\n                continue; // skip today, yesterday, tomorrow\n            }\n            assert.equal(m.calendar(),       m.format('[本]ddd凌晨12点整'),  'Monday + ' + i + ' days current time');\n        }\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m,\n            today = moment().startOf('day');\n\n        for (i = 7; i < 14; i++) {\n            m = moment().startOf('week').add({d: i});\n            if (Math.abs(m.diff(today, 'days')) >= 7) {\n                continue;\n            }\n            if (Math.abs(m.diff(today, 'days')) <= 1) {\n                continue; // skip today, yesterday, tomorrow\n            }\n            assert.equal(m.calendar(),  m.format('[下]ddd凌晨12点整'), 'Today + ' + i + ' days beginning of day');\n        }\n        assert.equal(42, 42, 'at least one assert');\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m,\n            today = moment().startOf('day');\n\n        for (i = 1; i < 8; i++) {\n            m = moment().startOf('week').subtract({d: i});\n            if ((Math.abs(m.diff(today, 'days')) >= 7) || (Math.abs(m.diff(today, 'days')) <= 1)) {\n                continue;\n            }\n            assert.equal(m.calendar(),  m.format('[上]ddd凌晨12点整'),  'Monday - ' + i + ' days next week');\n        }\n        assert.equal(42, 42, 'at least one assert');\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('LL'),      '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('LL'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('LL'),      '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('LL'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  0, 0]).format('A'), '凌晨', 'before dawn');\n        assert.equal(moment([2011, 2, 23,  6, 0]).format('A'), '早上', 'morning');\n        assert.equal(moment([2011, 2, 23,  9, 0]).format('A'), '上午', 'before noon');\n        assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), '中午', 'noon');\n        assert.equal(moment([2011, 2, 23, 13, 0]).format('A'), '下午', 'afternoon');\n        assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 52, 'Jan  1 2012 should be week 52');\n        assert.equal(moment([2012, 0,  2]).week(), 1, 'Jan  2 2012 should be week 52');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 1, 'Jan  7 2007 should be week 1');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 2, 'Jan 14 2007 should be week 2');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 1, 'Jan  6 2008 should be week 1');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 2, 'Jan 13 2008 should be week 2');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 1, 'Jan  5 2003 should be week 1');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 2, 'Jan 12 2003 should be week 2');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 1, 'Jan  4 2009 should be week 1');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 2, 'Jan 11 2009 should be week 2');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2010,  0,  2]).week(), 53, 'Jan  2 2010 should be week 53');\n        assert.equal(moment([2010,  0, 10]).week(), 1, 'Jan 10 2010 should be week 1');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2011,  0,  2]).week(), 52, 'Jan  2 2011 should be week 52');\n        assert.equal(moment([2011,  0,  8]).week(), 1, 'Jan  8 2011 should be week 1');\n        assert.equal(moment([2011,  0,  9]).week(), 1, 'Jan  9 2011 should be week 1');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '52 52 52周', 'Jan  1 2012 应该是第52周');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1周', 'Jan  7 2012 应该是第 1周');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2周', 'Jan 14 2012 应该是第 2周');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    localeModule('zh-tw');\n\n    test('parse', function (assert) {\n        var tests = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i;\n        function equalTest(input, mmm, i) {\n            assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));\n        }\n        for (i = 0; i < 12; i++) {\n            tests[i] = tests[i].split(' ');\n            equalTest(tests[i][0], 'MMM', i);\n            equalTest(tests[i][1], 'MMM', i);\n            equalTest(tests[i][0], 'MMMM', i);\n            equalTest(tests[i][1], 'MMMM', i);\n            equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);\n            equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);\n            equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);\n        }\n    });\n\n    test('format', function (assert) {\n        var a = [\n                ['dddd, MMMM Do YYYY, a h:mm:ss',      '星期日, 二月 14日 2010, 下午 3:25:50'],\n                ['ddd, Ah',                            '週日, 下午3'],\n                ['M Mo MM MMMM MMM',                   '2 2月 02 二月 2月'],\n                ['YYYY YY',                            '2010 10'],\n                ['D Do DD',                            '14 14日 14'],\n                ['d do dddd ddd dd',                   '0 0日 星期日 週日 日'],\n                ['DDD DDDo DDDD',                      '45 45日 045'],\n                ['w wo ww',                            '8 8週 08'],\n                ['h hh',                               '3 03'],\n                ['H HH',                               '15 15'],\n                ['m mm',                               '25 25'],\n                ['s ss',                               '50 50'],\n                ['a A',                                '下午 下午'],\n                ['[這年的第] DDDo',                    '這年的第 45日'],\n                ['LTS',                                '下午3點25分50秒'],\n                ['L',                                  '2010年2月14日'],\n                ['LL',                                 '2010年2月14日'],\n                ['LLL',                                '2010年2月14日下午3點25'],\n                ['LLLL',                               '2010年2月14日星期日下午3點25'],\n                ['l',                                  '2010年2月14日'],\n                ['ll',                                 '2010年2月14日'],\n                ['lll',                                '2010年2月14日下午3點25'],\n                ['llll',                               '2010年2月14日星期日下午3點25']\n            ],\n            b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),\n            i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('format month', function (assert) {\n        var expected = '一月 1月_二月 2月_三月 3月_四月 4月_五月 5月_六月 6月_七月 7月_八月 8月_九月 9月_十月 10月_十一月 11月_十二月 12月'.split('_'), i;\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);\n        }\n    });\n\n    test('format week', function (assert) {\n        var expected = '星期日 週日 日_星期一 週一 一_星期二 週二 二_星期三 週三 三_星期四 週四 四_星期五 週五 五_星期六 週六 六'.split('_'), i;\n\n        for (i = 0; i < expected.length; i++) {\n            assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]);\n        }\n    });\n\n    test('from', function (assert) {\n        var start = moment([2007, 1, 28]);\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true),  '幾秒',   '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true),  '一分鐘', '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true),  '一分鐘', '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true),  '2分鐘',  '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  '44分鐘', '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  '一小時', '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  '一小時', '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  '2小時',  '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   '5小時',  '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  '21小時', '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  '一天',   '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  '一天',   '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  '2天',   '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   '一天',   '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   '5天',   '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  '25天',  '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  '一個月', '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  '一個月', '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true),  '一個月', '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  '2個月',  '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  '2個月',  '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  '3個月',  '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   '一個月', '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   '5個月',  '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '一年',   '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年',   '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   '一年',   '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   '5年',   '5 years = 5 years');\n    });\n\n    test('suffix', function (assert) {\n        assert.equal(moment(30000).from(0), '幾秒內',  'prefix');\n        assert.equal(moment(0).from(30000), '幾秒前', 'suffix');\n    });\n\n    test('now from now', function (assert) {\n        assert.equal(moment().fromNow(), '幾秒前',  'now from now should display as in the past');\n    });\n\n    test('fromNow', function (assert) {\n        assert.equal(moment().add({s: 30}).fromNow(), '幾秒內', 'in a few seconds');\n        assert.equal(moment().add({d: 5}).fromNow(), '5天內', 'in 5 days');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                     '今天早上2點00',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      '今天早上2點25',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       '今天早上3點00',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       '明天早上2點00',     'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天早上1點00',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天早上2點00',     'yesterday at the same time');\n    });\n\n    test('calendar next week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().add({d: i});\n            assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar last week', function (assert) {\n        var i, m;\n        for (i = 2; i < 7; i++) {\n            m = moment().subtract({d: i});\n            assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days current time');\n            m.hours(0).minutes(0).seconds(0).milliseconds(0);\n            assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days beginning of day');\n            m.hours(23).minutes(59).seconds(59).milliseconds(999);\n            assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days end of day');\n        }\n    });\n\n    test('calendar all else', function (assert) {\n        var weeksAgo = moment().subtract({w: 1}),\n            weeksFromNow = moment().add({w: 1});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '1 week ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 1 week');\n\n        weeksAgo = moment().subtract({w: 2});\n        weeksFromNow = moment().add({w: 2});\n\n        assert.equal(weeksAgo.calendar(),       weeksAgo.format('L'),      '2 weeks ago');\n        assert.equal(weeksFromNow.calendar(),   weeksFromNow.format('L'),  'in 2 weeks');\n    });\n\n    test('meridiem', function (assert) {\n        assert.equal(moment([2011, 2, 23,  0, 0]).format('a'), '早上', 'morning');\n        assert.equal(moment([2011, 2, 23,  9, 0]).format('a'), '上午', 'before noon');\n        assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), '中午', 'noon');\n        assert.equal(moment([2011, 2, 23, 13, 0]).format('a'), '下午', 'after noon');\n        assert.equal(moment([2011, 2, 23, 18, 0]).format('a'), '晚上', 'night');\n\n        assert.equal(moment([2011, 2, 23,  0, 0]).format('A'), '早上', 'morning');\n        assert.equal(moment([2011, 2, 23,  9, 0]).format('A'), '上午', 'before noon');\n        assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), '中午', 'noon');\n        assert.equal(moment([2011, 2, 23, 13, 0]).format('A'), '下午', 'afternoon');\n        assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night');\n    });\n\n    test('weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).week(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).week(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('weeks year starting monday', function (assert) {\n        assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1');\n        assert.equal(moment([2007,  0,  1]).week(), 1, 'Jan  1 2007 should be week 1');\n        assert.equal(moment([2007,  0,  6]).week(), 1, 'Jan  6 2007 should be week 1');\n        assert.equal(moment([2007,  0,  7]).week(), 2, 'Jan  7 2007 should be week 2');\n        assert.equal(moment([2007,  0, 13]).week(), 2, 'Jan 13 2007 should be week 2');\n        assert.equal(moment([2007,  0, 14]).week(), 3, 'Jan 14 2007 should be week 3');\n    });\n\n    test('weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52');\n        assert.equal(moment([2008,  0,  1]).week(), 1, 'Jan  1 2008 should be week 1');\n        assert.equal(moment([2008,  0,  5]).week(), 1, 'Jan  5 2008 should be week 1');\n        assert.equal(moment([2008,  0,  6]).week(), 2, 'Jan  6 2008 should be week 2');\n        assert.equal(moment([2008,  0, 12]).week(), 2, 'Jan 12 2008 should be week 2');\n        assert.equal(moment([2008,  0, 13]).week(), 3, 'Jan 13 2008 should be week 3');\n    });\n\n    test('weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1');\n        assert.equal(moment([2003,  0,  1]).week(), 1, 'Jan  1 2003 should be week 1');\n        assert.equal(moment([2003,  0,  4]).week(), 1, 'Jan  4 2003 should be week 1');\n        assert.equal(moment([2003,  0,  5]).week(), 2, 'Jan  5 2003 should be week 2');\n        assert.equal(moment([2003,  0, 11]).week(), 2, 'Jan 11 2003 should be week 2');\n        assert.equal(moment([2003,  0, 12]).week(), 3, 'Jan 12 2003 should be week 3');\n    });\n\n    test('weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1');\n        assert.equal(moment([2009,  0,  1]).week(), 1, 'Jan  1 2009 should be week 1');\n        assert.equal(moment([2009,  0,  3]).week(), 1, 'Jan  3 2009 should be week 1');\n        assert.equal(moment([2009,  0,  4]).week(), 2, 'Jan  4 2009 should be week 2');\n        assert.equal(moment([2009,  0, 10]).week(), 2, 'Jan 10 2009 should be week 2');\n        assert.equal(moment([2009,  0, 11]).week(), 3, 'Jan 11 2009 should be week 3');\n    });\n\n    test('weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1');\n        assert.equal(moment([2010,  0,  1]).week(), 1, 'Jan  1 2010 should be week 1');\n        assert.equal(moment([2010,  0,  2]).week(), 1, 'Jan  2 2010 should be week 1');\n        assert.equal(moment([2010,  0,  3]).week(), 2, 'Jan  3 2010 should be week 2');\n        assert.equal(moment([2010,  0,  9]).week(), 2, 'Jan  9 2010 should be week 2');\n        assert.equal(moment([2010,  0, 10]).week(), 3, 'Jan 10 2010 should be week 3');\n    });\n\n    test('weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1');\n        assert.equal(moment([2011,  0,  1]).week(), 1, 'Jan  1 2011 should be week 1');\n        assert.equal(moment([2011,  0,  2]).week(), 2, 'Jan  2 2011 should be week 2');\n        assert.equal(moment([2011,  0,  8]).week(), 2, 'Jan  8 2011 should be week 2');\n        assert.equal(moment([2011,  0,  9]).week(), 3, 'Jan  9 2011 should be week 3');\n    });\n\n    test('weeks year starting sunday format', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('w ww wo'), '1 01 1週', 'Jan  1 2012 應該是第 1週');\n        assert.equal(moment([2012, 0,  7]).format('w ww wo'), '1 01 1週', 'Jan  7 2012 應該是第 1週');\n        assert.equal(moment([2012, 0,  8]).format('w ww wo'), '2 02 2週', 'Jan  8 2012 應該是第 2週');\n        assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2週', 'Jan 14 2012 應該是第 2週');\n        assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3週', 'Jan 15 2012 應該是第 3週');\n    });\n\n    test('lenient ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing ' + i + ' date check');\n        }\n    });\n\n    test('lenient ordinal parsing of number', function (assert) {\n        var i, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            testMoment = moment('2014 01 ' + i, 'YYYY MM Do');\n            assert.equal(testMoment.year(), 2014,\n                    'lenient ordinal parsing of number ' + i + ' year check');\n            assert.equal(testMoment.month(), 0,\n                    'lenient ordinal parsing of number ' + i + ' month check');\n            assert.equal(testMoment.date(), i,\n                    'lenient ordinal parsing of number ' + i + ' date check');\n        }\n    });\n\n    test('meridiem invariant', function (assert) {\n        var h, m, t1, t2;\n        for (h = 0; h < 24; ++h) {\n            for (m = 0; m < 60; m += 15) {\n                t1 = moment.utc([2000, 0, 1, h, m]);\n                t2 = moment(t1.format('A h:mm'), 'A h:mm');\n                assert.equal(t2.format('HH:mm'), t1.format('HH:mm'),\n                        'meridiem at ' + t1.format('HH:mm'));\n            }\n        }\n    });\n\n    test('strict ordinal parsing', function (assert) {\n        var i, ordinalStr, testMoment;\n        for (i = 1; i <= 31; ++i) {\n            ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');\n            testMoment = moment(ordinalStr, 'YYYY MM Do', true);\n            assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('add and subtract');\n\n    test('add short reverse args', function (assert) {\n        var a = moment(), b, c, d;\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add({ms: 50}).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add({s: 1}).seconds(), 9, 'Add seconds');\n        assert.equal(a.add({m: 1}).minutes(), 8, 'Add minutes');\n        assert.equal(a.add({h: 1}).hours(), 7, 'Add hours');\n        assert.equal(a.add({d: 1}).date(), 13, 'Add date');\n        assert.equal(a.add({w: 1}).date(), 20, 'Add week');\n        assert.equal(a.add({M: 1}).month(), 10, 'Add month');\n        assert.equal(a.add({y: 1}).year(), 2012, 'Add year');\n        assert.equal(a.add({Q: 1}).month(), 1, 'Add quarter');\n\n        b = moment([2010, 0, 31]).add({M: 1});\n        c = moment([2010, 1, 28]).subtract({M: 1});\n        d = moment([2010, 1, 28]).subtract({Q: 1});\n\n        assert.equal(b.month(), 1, 'add month, jan 31st to feb 28th');\n        assert.equal(b.date(), 28, 'add month, jan 31st to feb 28th');\n        assert.equal(c.month(), 0, 'subtract month, feb 28th to jan 28th');\n        assert.equal(c.date(), 28, 'subtract month, feb 28th to jan 28th');\n        assert.equal(d.month(), 10, 'subtract quarter, feb 28th 2010 to nov 28th 2009');\n        assert.equal(d.date(), 28, 'subtract quarter, feb 28th 2010 to nov 28th 2009');\n        assert.equal(d.year(), 2009, 'subtract quarter, feb 28th 2010 to nov 28th 2009');\n    });\n\n    test('add long reverse args', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add({milliseconds: 50}).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add({seconds: 1}).seconds(), 9, 'Add seconds');\n        assert.equal(a.add({minutes: 1}).minutes(), 8, 'Add minutes');\n        assert.equal(a.add({hours: 1}).hours(), 7, 'Add hours');\n        assert.equal(a.add({days: 1}).date(), 13, 'Add date');\n        assert.equal(a.add({weeks: 1}).date(), 20, 'Add week');\n        assert.equal(a.add({months: 1}).month(), 10, 'Add month');\n        assert.equal(a.add({years: 1}).year(), 2012, 'Add year');\n        assert.equal(a.add({quarters: 1}).month(), 1, 'Add quarter');\n    });\n\n    test('add long singular reverse args', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add({millisecond: 50}).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add({second: 1}).seconds(), 9, 'Add seconds');\n        assert.equal(a.add({minute: 1}).minutes(), 8, 'Add minutes');\n        assert.equal(a.add({hour: 1}).hours(), 7, 'Add hours');\n        assert.equal(a.add({day: 1}).date(), 13, 'Add date');\n        assert.equal(a.add({week: 1}).date(), 20, 'Add week');\n        assert.equal(a.add({month: 1}).month(), 10, 'Add month');\n        assert.equal(a.add({year: 1}).year(), 2012, 'Add year');\n        assert.equal(a.add({quarter: 1}).month(), 1, 'Add quarter');\n    });\n\n    test('add string long reverse args', function (assert) {\n        var a = moment(), b;\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        b = a.clone();\n\n        assert.equal(a.add('millisecond', 50).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add('second', 1).seconds(), 9, 'Add seconds');\n        assert.equal(a.add('minute', 1).minutes(), 8, 'Add minutes');\n        assert.equal(a.add('hour', 1).hours(), 7, 'Add hours');\n        assert.equal(a.add('day', 1).date(), 13, 'Add date');\n        assert.equal(a.add('week', 1).date(), 20, 'Add week');\n        assert.equal(a.add('month', 1).month(), 10, 'Add month');\n        assert.equal(a.add('year', 1).year(), 2012, 'Add year');\n        assert.equal(b.add('day', '01').date(), 13, 'Add date');\n        assert.equal(a.add('quarter', 1).month(), 1, 'Add quarter');\n    });\n\n    test('add string long singular reverse args', function (assert) {\n        var a = moment(), b;\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        b = a.clone();\n\n        assert.equal(a.add('milliseconds', 50).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add('seconds', 1).seconds(), 9, 'Add seconds');\n        assert.equal(a.add('minutes', 1).minutes(), 8, 'Add minutes');\n        assert.equal(a.add('hours', 1).hours(), 7, 'Add hours');\n        assert.equal(a.add('days', 1).date(), 13, 'Add date');\n        assert.equal(a.add('weeks', 1).date(), 20, 'Add week');\n        assert.equal(a.add('months', 1).month(), 10, 'Add month');\n        assert.equal(a.add('years', 1).year(), 2012, 'Add year');\n        assert.equal(b.add('days', '01').date(), 13, 'Add date');\n        assert.equal(a.add('quarters', 1).month(), 1, 'Add quarter');\n    });\n\n    test('add string short reverse args', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add('ms', 50).milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add('s', 1).seconds(), 9, 'Add seconds');\n        assert.equal(a.add('m', 1).minutes(), 8, 'Add minutes');\n        assert.equal(a.add('h', 1).hours(), 7, 'Add hours');\n        assert.equal(a.add('d', 1).date(), 13, 'Add date');\n        assert.equal(a.add('w', 1).date(), 20, 'Add week');\n        assert.equal(a.add('M', 1).month(), 10, 'Add month');\n        assert.equal(a.add('y', 1).year(), 2012, 'Add year');\n        assert.equal(a.add('Q', 1).month(), 1, 'Add quarter');\n    });\n\n    test('add string long', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add(50, 'millisecond').milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add(1, 'second').seconds(), 9, 'Add seconds');\n        assert.equal(a.add(1, 'minute').minutes(), 8, 'Add minutes');\n        assert.equal(a.add(1, 'hour').hours(), 7, 'Add hours');\n        assert.equal(a.add(1, 'day').date(), 13, 'Add date');\n        assert.equal(a.add(1, 'week').date(), 20, 'Add week');\n        assert.equal(a.add(1, 'month').month(), 10, 'Add month');\n        assert.equal(a.add(1, 'year').year(), 2012, 'Add year');\n        assert.equal(a.add(1, 'quarter').month(), 1, 'Add quarter');\n    });\n\n    test('add string long singular', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add(50, 'milliseconds').milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add(1, 'seconds').seconds(), 9, 'Add seconds');\n        assert.equal(a.add(1, 'minutes').minutes(), 8, 'Add minutes');\n        assert.equal(a.add(1, 'hours').hours(), 7, 'Add hours');\n        assert.equal(a.add(1, 'days').date(), 13, 'Add date');\n        assert.equal(a.add(1, 'weeks').date(), 20, 'Add week');\n        assert.equal(a.add(1, 'months').month(), 10, 'Add month');\n        assert.equal(a.add(1, 'years').year(), 2012, 'Add year');\n        assert.equal(a.add(1, 'quarters').month(), 1, 'Add quarter');\n    });\n\n    test('add string short', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add(50, 'ms').milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add(1, 's').seconds(), 9, 'Add seconds');\n        assert.equal(a.add(1, 'm').minutes(), 8, 'Add minutes');\n        assert.equal(a.add(1, 'h').hours(), 7, 'Add hours');\n        assert.equal(a.add(1, 'd').date(), 13, 'Add date');\n        assert.equal(a.add(1, 'w').date(), 20, 'Add week');\n        assert.equal(a.add(1, 'M').month(), 10, 'Add month');\n        assert.equal(a.add(1, 'y').year(), 2012, 'Add year');\n        assert.equal(a.add(1, 'Q').month(), 1, 'Add quarter');\n    });\n\n    test('add strings string short args', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add('ms', '50').milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add('s', '1').seconds(), 9, 'Add seconds');\n        assert.equal(a.add('m', '1').minutes(), 8, 'Add minutes');\n        assert.equal(a.add('h', '1').hours(), 7, 'Add hours');\n        assert.equal(a.add('d', '1').date(), 13, 'Add date');\n        assert.equal(a.add('w', '1').date(), 20, 'Add week');\n        assert.equal(a.add('M', '1').month(), 10, 'Add month');\n        assert.equal(a.add('y', '1').year(), 2012, 'Add year');\n        assert.equal(a.add('Q', '1').month(), 1, 'Add quarter');\n    });\n\n    test('subtract strings string short args', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.subtract('ms', '50').milliseconds(), 450, 'Subtract milliseconds');\n        assert.equal(a.subtract('s', '1').seconds(), 7, 'Subtract seconds');\n        assert.equal(a.subtract('m', '1').minutes(), 6, 'Subtract minutes');\n        assert.equal(a.subtract('h', '1').hours(), 5, 'Subtract hours');\n        assert.equal(a.subtract('d', '1').date(), 11, 'Subtract date');\n        assert.equal(a.subtract('w', '1').date(), 4, 'Subtract week');\n        assert.equal(a.subtract('M', '1').month(), 8, 'Subtract month');\n        assert.equal(a.subtract('y', '1').year(), 2010, 'Subtract year');\n        assert.equal(a.subtract('Q', '1').month(), 5, 'Subtract quarter');\n    });\n\n    test('add strings string short', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.add('50', 'ms').milliseconds(), 550, 'Add milliseconds');\n        assert.equal(a.add('1', 's').seconds(), 9, 'Add seconds');\n        assert.equal(a.add('1', 'm').minutes(), 8, 'Add minutes');\n        assert.equal(a.add('1', 'h').hours(), 7, 'Add hours');\n        assert.equal(a.add('1', 'd').date(), 13, 'Add date');\n        assert.equal(a.add('1', 'w').date(), 20, 'Add week');\n        assert.equal(a.add('1', 'M').month(), 10, 'Add month');\n        assert.equal(a.add('1', 'y').year(), 2012, 'Add year');\n        assert.equal(a.add('1', 'Q').month(), 1, 'Add quarter');\n    });\n\n    test('subtract strings string short', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(500);\n\n        assert.equal(a.subtract('50', 'ms').milliseconds(), 450, 'Subtract milliseconds');\n        assert.equal(a.subtract('1', 's').seconds(), 7, 'Subtract seconds');\n        assert.equal(a.subtract('1', 'm').minutes(), 6, 'Subtract minutes');\n        assert.equal(a.subtract('1', 'h').hours(), 5, 'Subtract hours');\n        assert.equal(a.subtract('1', 'd').date(), 11, 'Subtract date');\n        assert.equal(a.subtract('1', 'w').date(), 4, 'Subtract week');\n        assert.equal(a.subtract('1', 'M').month(), 8, 'Subtract month');\n        assert.equal(a.subtract('1', 'y').year(), 2010, 'Subtract year');\n        assert.equal(a.subtract('1', 'Q').month(), 5, 'Subtract quarter');\n    });\n\n    test('add across DST', function (assert) {\n        // Detect Safari bug and bail. Hours on 13th March 2011 are shifted\n        // with 1 ahead.\n        if (new Date(2011, 2, 13, 5, 0, 0).getHours() !== 5) {\n            return;\n        }\n\n        var a = moment(new Date(2011, 2, 12, 5, 0, 0)),\n            b = moment(new Date(2011, 2, 12, 5, 0, 0)),\n            c = moment(new Date(2011, 2, 12, 5, 0, 0)),\n            d = moment(new Date(2011, 2, 12, 5, 0, 0)),\n            e = moment(new Date(2011, 2, 12, 5, 0, 0));\n        a.add(1, 'days');\n        b.add(24, 'hours');\n        c.add(1, 'months');\n        e.add(1, 'quarter');\n\n        assert.equal(a.hours(), 5, 'adding days over DST difference should result in the same hour');\n        if (b.isDST() && !d.isDST()) {\n            assert.equal(b.hours(), 6, 'adding hours over DST difference should result in a different hour');\n        } else if (!b.isDST() && d.isDST()) {\n            assert.equal(b.hours(), 4, 'adding hours over DST difference should result in a different hour');\n        } else {\n            assert.equal(b.hours(), 5, 'adding hours over DST difference should result in a same hour if the timezone does not have daylight savings time');\n        }\n        assert.equal(c.hours(), 5, 'adding months over DST difference should result in the same hour');\n        assert.equal(e.hours(), 5, 'adding quarters over DST difference should result in the same hour');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('create');\n\n    test('array', function (assert) {\n        assert.ok(moment([2010]).toDate() instanceof Date, '[2010]');\n        assert.ok(moment([2010, 1]).toDate() instanceof Date, '[2010, 1]');\n        assert.ok(moment([2010, 1, 12]).toDate() instanceof Date, '[2010, 1, 12]');\n        assert.ok(moment([2010, 1, 12, 1]).toDate() instanceof Date, '[2010, 1, 12, 1]');\n        assert.ok(moment([2010, 1, 12, 1, 1]).toDate() instanceof Date, '[2010, 1, 12, 1, 1]');\n        assert.ok(moment([2010, 1, 12, 1, 1, 1]).toDate() instanceof Date, '[2010, 1, 12, 1, 1, 1]');\n        assert.ok(moment([2010, 1, 12, 1, 1, 1, 1]).toDate() instanceof Date, '[2010, 1, 12, 1, 1, 1, 1]');\n        assert.equal(+moment(new Date(2010, 1, 14, 15, 25, 50, 125)), +moment([2010, 1, 14, 15, 25, 50, 125]), 'constructing with array === constructing with new Date()');\n    });\n\n    test('array copying', function (assert) {\n        var importantArray = [2009, 11];\n        moment(importantArray);\n        assert.deepEqual(importantArray, [2009, 11], 'initializer should not mutate the original array');\n    });\n\n    test('object', function (assert) {\n        var fmt = 'YYYY-MM-DD HH:mm:ss.SSS',\n            tests = [\n                [{year: 2010}, '2010-01-01 00:00:00.000'],\n                [{year: 2010, month: 1}, '2010-02-01 00:00:00.000'],\n                [{year: 2010, month: 1, day: 12}, '2010-02-12 00:00:00.000'],\n                [{year: 2010, month: 1, date: 12}, '2010-02-12 00:00:00.000'],\n                [{year: 2010, month: 1, day: 12, hours: 1}, '2010-02-12 01:00:00.000'],\n                [{year: 2010, month: 1, date: 12, hours: 1}, '2010-02-12 01:00:00.000'],\n                [{year: 2010, month: 1, day: 12, hours: 1, minutes: 1}, '2010-02-12 01:01:00.000'],\n                [{year: 2010, month: 1, date: 12, hours: 1, minutes: 1}, '2010-02-12 01:01:00.000'],\n                [{year: 2010, month: 1, day: 12, hours: 1, minutes: 1, seconds: 1}, '2010-02-12 01:01:01.000'],\n                [{year: 2010, month: 1, day: 12, hours: 1, minutes: 1, seconds: 1, milliseconds: 1}, '2010-02-12 01:01:01.001'],\n                [{years: 2010, months: 1, days: 14, hours: 15, minutes: 25, seconds: 50, milliseconds: 125}, '2010-02-14 15:25:50.125'],\n                [{year: 2010, month: 1, day: 14, hour: 15, minute: 25, second: 50, millisecond: 125}, '2010-02-14 15:25:50.125'],\n                [{y: 2010, M: 1, d: 14, h: 15, m: 25, s: 50, ms: 125}, '2010-02-14 15:25:50.125']\n            ], i;\n        for (i = 0; i < tests.length; ++i) {\n            assert.equal(moment(tests[i][0]).format(fmt), tests[i][1]);\n        }\n    });\n\n    test('multi format array copying', function (assert) {\n        var importantArray = ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY'];\n        moment('1999-02-13', importantArray);\n        assert.deepEqual(importantArray, ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY'], 'initializer should not mutate the original array');\n    });\n\n    test('number', function (assert) {\n        assert.ok(moment(1000).toDate() instanceof Date, '1000');\n        assert.equal(moment(1000).valueOf(), 1000, 'asserting valueOf');\n        assert.equal(moment.utc(1000).valueOf(), 1000, 'asserting valueOf');\n    });\n\n    test('unix', function (assert) {\n        assert.equal(moment.unix(1).valueOf(), 1000, '1 unix timestamp == 1000 Date.valueOf');\n        assert.equal(moment(1000).unix(), 1, '1000 Date.valueOf == 1 unix timestamp');\n        assert.equal(moment.unix(1000).valueOf(), 1000000, '1000 unix timestamp == 1000000 Date.valueOf');\n        assert.equal(moment(1500).unix(), 1, '1500 Date.valueOf == 1 unix timestamp');\n        assert.equal(moment(1900).unix(), 1, '1900 Date.valueOf == 1 unix timestamp');\n        assert.equal(moment(2100).unix(), 2, '2100 Date.valueOf == 2 unix timestamp');\n        assert.equal(moment(1333129333524).unix(), 1333129333, '1333129333524 Date.valueOf == 1333129333 unix timestamp');\n        assert.equal(moment(1333129333524000).unix(), 1333129333524, '1333129333524000 Date.valueOf == 1333129333524 unix timestamp');\n    });\n\n    test('date', function (assert) {\n        assert.ok(moment(new Date()).toDate() instanceof Date, 'new Date()');\n    });\n\n    test('date mutation', function (assert) {\n        var a = new Date();\n        assert.ok(moment(a).toDate() !== a, 'the date moment uses should not be the date passed in');\n    });\n\n    test('moment', function (assert) {\n        assert.ok(moment(moment()).toDate() instanceof Date, 'moment(moment())');\n        assert.ok(moment(moment(moment())).toDate() instanceof Date, 'moment(moment(moment()))');\n    });\n\n    test('cloning moment should only copy own properties', function (assert) {\n        assert.ok(!moment().clone().hasOwnProperty('month'), 'Should not clone prototype methods');\n    });\n\n    test('cloning moment works with weird clones', function (assert) {\n        var extend = function (a, b) {\n            var i;\n            for (i in b) {\n                a[i] = b[i];\n            }\n            return a;\n        },\n        now = moment(),\n        nowu = moment.utc();\n\n        assert.equal(+extend({}, now).clone(), +now, 'cloning extend-ed now is now');\n        assert.equal(+extend({}, nowu).clone(), +nowu, 'cloning extend-ed utc now is utc now');\n    });\n\n    test('cloning respects moment.momentProperties', function (assert) {\n        var m = moment();\n\n        assert.equal(m.clone()._special, undefined, 'cloning ignores extra properties');\n        m._special = 'bacon';\n        moment.momentProperties.push('_special');\n        assert.equal(m.clone()._special, 'bacon', 'cloning respects momentProperties');\n        moment.momentProperties.pop();\n    });\n\n    test('undefined', function (assert) {\n        assert.ok(moment().toDate() instanceof Date, 'undefined');\n    });\n\n    test('iso format 24hrs', function (assert) {\n        assert.equal(moment('2014-01-01T24:00:00.000').format('YYYY-MM-DD[T]HH:mm:ss.SSS'),\n                '2014-01-02T00:00:00.000', 'iso format with 24:00 localtime');\n        assert.equal(moment.utc('2014-01-01T24:00:00.000').format('YYYY-MM-DD[T]HH:mm:ss.SSS'),\n                '2014-01-02T00:00:00.000', 'iso format with 24:00 utc');\n    });\n\n    test('string without format - json', function (assert) {\n        assert.equal(moment('Date(1325132654000)').valueOf(), 1325132654000, 'Date(1325132654000)');\n        assert.equal(moment('Date(-1325132654000)').valueOf(), -1325132654000, 'Date(-1325132654000)');\n        assert.equal(moment('/Date(1325132654000)/').valueOf(), 1325132654000, '/Date(1325132654000)/');\n        assert.equal(moment('/Date(1325132654000+0700)/').valueOf(), 1325132654000, '/Date(1325132654000+0700)/');\n        assert.equal(moment('/Date(1325132654000-0700)/').valueOf(), 1325132654000, '/Date(1325132654000-0700)/');\n    });\n\n    test('string with format dropped am/pm bug', function (assert) {\n        moment.locale('en');\n\n        assert.equal(moment('05/1/2012 12:25:00', 'MM/DD/YYYY h:m:s a').format('MM/DD/YYYY'), '05/01/2012', 'should not break if am/pm is left off from the parsing tokens');\n        assert.equal(moment('05/1/2012 12:25:00 am', 'MM/DD/YYYY h:m:s a').format('MM/DD/YYYY'), '05/01/2012', 'should not break if am/pm is left off from the parsing tokens');\n        assert.equal(moment('05/1/2012 12:25:00 pm', 'MM/DD/YYYY h:m:s a').format('MM/DD/YYYY'), '05/01/2012', 'should not break if am/pm is left off from the parsing tokens');\n\n        assert.ok(moment('05/1/2012 12:25:00', 'MM/DD/YYYY h:m:s a').isValid());\n        assert.ok(moment('05/1/2012 12:25:00 am', 'MM/DD/YYYY h:m:s a').isValid());\n        assert.ok(moment('05/1/2012 12:25:00 pm', 'MM/DD/YYYY h:m:s a').isValid());\n    });\n\n    test('empty string with formats', function (assert) {\n        assert.equal(moment('', 'MM').format('YYYY-MM-DD HH:mm:ss'), 'Invalid date');\n        assert.equal(moment(' ', 'MM').format('YYYY-MM-DD HH:mm:ss'), 'Invalid date');\n        assert.equal(moment(' ', 'DD').format('YYYY-MM-DD HH:mm:ss'), 'Invalid date');\n        assert.equal(moment(' ', ['MM', 'DD']).format('YYYY-MM-DD HH:mm:ss'), 'Invalid date');\n\n        assert.ok(!moment('', 'MM').isValid());\n        assert.ok(!moment(' ', 'MM').isValid());\n        assert.ok(!moment(' ', 'DD').isValid());\n        assert.ok(!moment(' ', ['MM', 'DD']).isValid());\n    });\n\n    test('defaulting to current date', function (assert) {\n        var now = moment();\n        assert.equal(moment('12:13:14', 'hh:mm:ss').format('YYYY-MM-DD hh:mm:ss'),\n                     now.clone().hour(12).minute(13).second(14).format('YYYY-MM-DD hh:mm:ss'),\n                     'given only time default to current date');\n        assert.equal(moment('05', 'DD').format('YYYY-MM-DD'),\n                     now.clone().date(5).format('YYYY-MM-DD'),\n                     'given day of month default to current month, year');\n        assert.equal(moment('05', 'MM').format('YYYY-MM-DD'),\n                     now.clone().month(4).date(1).format('YYYY-MM-DD'),\n                     'given month default to current year');\n        assert.equal(moment('1996', 'YYYY').format('YYYY-MM-DD'),\n                     now.clone().year(1996).month(0).date(1).format('YYYY-MM-DD'),\n                     'given year do not default');\n    });\n\n    test('matching am/pm', function (assert) {\n        assert.equal(moment('2012-09-03T03:00PM',   'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for PM');\n        assert.equal(moment('2012-09-03T03:00P.M.', 'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for P.M.');\n        assert.equal(moment('2012-09-03T03:00P',    'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for P');\n        assert.equal(moment('2012-09-03T03:00pm',   'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for pm');\n        assert.equal(moment('2012-09-03T03:00p.m.', 'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for p.m.');\n        assert.equal(moment('2012-09-03T03:00p',    'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00PM', 'am/pm should parse correctly for p');\n\n        assert.equal(moment('2012-09-03T03:00AM',   'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for AM');\n        assert.equal(moment('2012-09-03T03:00A.M.', 'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for A.M.');\n        assert.equal(moment('2012-09-03T03:00A',    'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for A');\n        assert.equal(moment('2012-09-03T03:00am',   'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for am');\n        assert.equal(moment('2012-09-03T03:00a.m.', 'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for a.m.');\n        assert.equal(moment('2012-09-03T03:00a',    'YYYY-MM-DDThh:mmA').format('YYYY-MM-DDThh:mmA'), '2012-09-03T03:00AM', 'am/pm should parse correctly for a');\n\n        assert.equal(moment('5:00p.m.March 4 2012', 'h:mmAMMMM D YYYY').format('YYYY-MM-DDThh:mmA'), '2012-03-04T05:00PM', 'am/pm should parse correctly before month names');\n    });\n\n    test('string with format', function (assert) {\n        moment.locale('en');\n        var a = [\n            ['YYYY-Q',              '2014-4'],\n            ['MM-DD-YYYY',          '12-02-1999'],\n            ['DD-MM-YYYY',          '12-02-1999'],\n            ['DD/MM/YYYY',          '12/02/1999'],\n            ['DD_MM_YYYY',          '12_02_1999'],\n            ['DD:MM:YYYY',          '12:02:1999'],\n            ['D-M-YY',              '2-2-99'],\n            ['YY',                  '99'],\n            ['DDD-YYYY',            '300-1999'],\n            ['DD-MM-YYYY h:m:s',    '12-02-1999 2:45:10'],\n            ['DD-MM-YYYY h:m:s a',  '12-02-1999 2:45:10 am'],\n            ['DD-MM-YYYY h:m:s a',  '12-02-1999 2:45:10 pm'],\n            ['h:mm a',              '12:00 pm'],\n            ['h:mm a',              '12:30 pm'],\n            ['h:mm a',              '12:00 am'],\n            ['h:mm a',              '12:30 am'],\n            ['HH:mm',               '12:00'],\n            ['YYYY-MM-DDTHH:mm:ss', '2011-11-11T11:11:11'],\n            ['MM-DD-YYYY [M]',      '12-02-1999 M'],\n            ['ddd MMM DD HH:mm:ss YYYY', 'Tue Apr 07 22:52:51 2009'],\n            ['HH:mm:ss',            '12:00:00'],\n            ['HH:mm:ss',            '12:30:00'],\n            ['HH:mm:ss',            '00:00:00'],\n            ['HH:mm:ss S',          '00:30:00 1'],\n            ['HH:mm:ss SS',         '00:30:00 12'],\n            ['HH:mm:ss SSS',        '00:30:00 123'],\n            ['HH:mm:ss S',          '00:30:00 7'],\n            ['HH:mm:ss SS',         '00:30:00 78'],\n            ['HH:mm:ss SSS',        '00:30:00 789'],\n            ['X',                   '1234567890'],\n            ['x',                   '1234567890123'],\n            ['LT',                  '12:30 AM'],\n            ['LTS',                 '12:30:29 AM'],\n            ['L',                   '09/02/1999'],\n            ['l',                   '9/2/1999'],\n            ['LL',                  'September 2, 1999'],\n            ['ll',                  'Sep 2, 1999'],\n            ['LLL',                 'September 2, 1999 12:30 AM'],\n            ['lll',                 'Sep 2, 1999 12:30 AM'],\n            ['LLLL',                'Thursday, September 2, 1999 12:30 AM'],\n            ['llll',                'Thu, Sep 2, 1999 12:30 AM']\n        ],\n        m,\n        i;\n\n        for (i = 0; i < a.length; i++) {\n            m = moment(a[i][1], a[i][0]);\n            assert.ok(m.isValid());\n            assert.equal(m.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('unix timestamp format', function (assert) {\n        var formats = ['X', 'X.S', 'X.SS', 'X.SSS'], i, format;\n\n        for (i = 0; i < formats.length; i++) {\n            format = formats[i];\n            assert.equal(moment('1234567890',     format).valueOf(), 1234567890 * 1000,       format + ' matches timestamp without milliseconds');\n            assert.equal(moment('1234567890.1',   format).valueOf(), 1234567890 * 1000 + 100, format + ' matches timestamp with deciseconds');\n            assert.equal(moment('1234567890.12',  format).valueOf(), 1234567890 * 1000 + 120, format + ' matches timestamp with centiseconds');\n            assert.equal(moment('1234567890.123', format).valueOf(), 1234567890 * 1000 + 123, format + ' matches timestamp with milliseconds');\n        }\n    });\n\n    test('unix offset milliseconds', function (assert) {\n        assert.equal(moment('1234567890123', 'x').valueOf(), 1234567890123, 'x matches unix offset in milliseconds');\n    });\n\n    test('milliseconds format', function (assert) {\n        assert.equal(moment('1', 'S').get('ms'), 100, 'deciseconds');\n        // assert.equal(moment('10', 'S', true).isValid(), false, 'deciseconds with two digits');\n        // assert.equal(moment('1', 'SS', true).isValid(), false, 'centiseconds with one digits');\n        assert.equal(moment('12', 'SS').get('ms'), 120, 'centiseconds');\n        // assert.equal(moment('123', 'SS', true).isValid(), false, 'centiseconds with three digits');\n        assert.equal(moment('123', 'SSS').get('ms'), 123, 'milliseconds');\n        assert.equal(moment('1234', 'SSSS').get('ms'), 123, 'milliseconds with SSSS');\n        assert.equal(moment('123456789101112', 'SSSS').get('ms'), 123, 'milliseconds with SSSS');\n    });\n\n    test('string with format no separators', function (assert) {\n        moment.locale('en');\n        var a = [\n            ['MMDDYYYY',          '12021999'],\n            ['DDMMYYYY',          '12021999'],\n            ['YYYYMMDD',          '19991202'],\n            ['DDMMMYYYY',         '10Sep2001']\n        ], i;\n\n        for (i = 0; i < a.length; i++) {\n            assert.equal(moment(a[i][1], a[i][0]).format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);\n        }\n    });\n\n    test('string with format (timezone)', function (assert) {\n        assert.equal(moment('5 -0700', 'H ZZ').toDate().getUTCHours(), 12, 'parse hours \\'5 -0700\\' ---> \\'H ZZ\\'');\n        assert.equal(moment('5 -07:00', 'H Z').toDate().getUTCHours(), 12, 'parse hours \\'5 -07:00\\' ---> \\'H Z\\'');\n        assert.equal(moment('5 -0730', 'H ZZ').toDate().getUTCMinutes(), 30, 'parse hours \\'5 -0730\\' ---> \\'H ZZ\\'');\n        assert.equal(moment('5 -07:30', 'H Z').toDate().getUTCMinutes(), 30, 'parse hours \\'5 -07:0\\' ---> \\'H Z\\'');\n        assert.equal(moment('5 +0100', 'H ZZ').toDate().getUTCHours(), 4, 'parse hours \\'5 +0100\\' ---> \\'H ZZ\\'');\n        assert.equal(moment('5 +01:00', 'H Z').toDate().getUTCHours(), 4, 'parse hours \\'5 +01:00\\' ---> \\'H Z\\'');\n        assert.equal(moment('5 +0130', 'H ZZ').toDate().getUTCMinutes(), 30, 'parse hours \\'5 +0130\\' ---> \\'H ZZ\\'');\n        assert.equal(moment('5 +01:30', 'H Z').toDate().getUTCMinutes(), 30, 'parse hours \\'5 +01:30\\' ---> \\'H Z\\'');\n    });\n\n    test('string with format (timezone offset)', function (assert) {\n        var a, b, c, d, e, f;\n        a = new Date(Date.UTC(2011, 0, 1, 1));\n        b = moment('2011 1 1 0 -01:00', 'YYYY MM DD HH Z');\n        assert.equal(a.getHours(), b.hours(), 'date created with utc == parsed string with timezone offset');\n        assert.equal(+a, +b, 'date created with utc == parsed string with timezone offset');\n        c = moment('2011 2 1 10 -05:00', 'YYYY MM DD HH Z');\n        d = moment('2011 2 1 8 -07:00', 'YYYY MM DD HH Z');\n        assert.equal(c.hours(), d.hours(), '10 am central time == 8 am pacific time');\n        e = moment.utc('Fri, 20 Jul 2012 17:15:00', 'ddd, DD MMM YYYY HH:mm:ss');\n        f = moment.utc('Fri, 20 Jul 2012 10:15:00 -0700', 'ddd, DD MMM YYYY HH:mm:ss ZZ');\n        assert.equal(e.hours(), f.hours(), 'parse timezone offset in utc');\n    });\n\n    test('string with timezone around start of year', function (assert) {\n        assert.equal(moment('2000-01-01T00:00:00.000+01:00').toISOString(), '1999-12-31T23:00:00.000Z', '+1:00 around 2000');\n        assert.equal(moment('2000-01-01T00:00:00.000-01:00').toISOString(), '2000-01-01T01:00:00.000Z', '-1:00 around 2000');\n        assert.equal(moment('1970-01-01T00:00:00.000+01:00').toISOString(), '1969-12-31T23:00:00.000Z', '+1:00 around 1970');\n        assert.equal(moment('1970-01-01T00:00:00.000-01:00').toISOString(), '1970-01-01T01:00:00.000Z', '-1:00 around 1970');\n        assert.equal(moment('1200-01-01T00:00:00.000+01:00').toISOString(), '1199-12-31T23:00:00.000Z', '+1:00 around 1200');\n        assert.equal(moment('1200-01-01T00:00:00.000-01:00').toISOString(), '1200-01-01T01:00:00.000Z', '-1:00 around 1200');\n    });\n\n    test('string with array of formats', function (assert) {\n        assert.equal(moment('11-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '11 02 1999', 'switching month and day');\n        assert.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY MM DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last');\n        assert.equal(moment('1999-02-11', ['MM/DD/YYYY', 'YYYY MM DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 11 1999', 'year first');\n\n        assert.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY MM DD']).format('MM DD YYYY'), '02 11 1999', 'year last');\n        assert.equal(moment('1999-02-11', ['MM/DD/YYYY', 'YYYY MM DD']).format('MM DD YYYY'), '02 11 1999', 'year first');\n        assert.equal(moment('02-11-1999', ['YYYY MM DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last');\n        assert.equal(moment('1999-02-11', ['YYYY MM DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year first');\n\n        assert.equal(moment('13-11-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'second must be month');\n        assert.equal(moment('11-13-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'first must be month');\n        assert.equal(moment('01-02-2000', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '01 02 2000', 'either can be a month, month first format');\n        assert.equal(moment('02-01-2000', ['DD/MM/YYYY', 'MM/DD/YYYY']).format('MM DD YYYY'), '01 02 2000', 'either can be a month, day first format');\n\n        assert.equal(moment('11-02-10', ['MM/DD/YY', 'YY MM DD', 'DD-MM-YY']).format('MM DD YYYY'), '02 11 2010', 'all unparsed substrings have influence on format penalty');\n        assert.equal(moment('11-02-10', ['MM-DD-YY HH:mm', 'YY MM DD']).format('MM DD YYYY'), '02 10 2011', 'prefer formats without extra tokens');\n        assert.equal(moment('11-02-10 junk', ['MM-DD-YY', 'YY.MM.DD junk']).format('MM DD YYYY'), '02 10 2011', 'prefer formats that dont result in extra characters');\n        assert.equal(moment('11-22-10', ['YY-MM-DD', 'YY-DD-MM']).format('MM DD YYYY'), '10 22 2011', 'prefer valid results');\n\n        assert.equal(moment('gibberish', ['YY-MM-DD', 'YY-DD-MM']).format('MM DD YYYY'), 'Invalid date', 'doest throw for invalid strings');\n        assert.equal(moment('gibberish', []).format('MM DD YYYY'), 'Invalid date', 'doest throw for an empty array');\n\n        //https://github.com/moment/moment/issues/1143\n        assert.equal(moment(\n            'System Administrator and Database Assistant (7/1/2011), System Administrator and Database Assistant (7/1/2011), Database Coordinator (7/1/2011), Vice President (7/1/2011), System Administrator and Database Assistant (5/31/2012), Database Coordinator (7/1/2012), System Administrator and Database Assistant (7/1/2013)',\n            ['MM/DD/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD', 'YYYY-MM-DDTHH:mm:ssZ'])\n            .format('YYYY-MM-DD'), '2011-07-01', 'Works for long strings');\n\n        assert.equal(moment('11-02-10', ['MM.DD.YY', 'DD-MM-YY']).format('MM DD YYYY'), '02 11 2010', 'escape RegExp special characters on comparing');\n\n        assert.equal(moment('13-10-98', ['DD MM YY', 'DD MM YYYY'])._f, 'DD MM YY', 'use two digit year');\n        assert.equal(moment('13-10-1998', ['DD MM YY', 'DD MM YYYY'])._f, 'DD MM YYYY', 'use four digit year');\n\n        assert.equal(moment('01', ['MM', 'DD'])._f, 'MM', 'Should use first valid format');\n    });\n\n    test('string with array of formats + ISO', function (assert) {\n        assert.equal(moment('1994', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).year(), 1994, 'iso: assert parse YYYY');\n        assert.equal(moment('17:15', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).hour(), 17, 'iso: assert parse HH:mm (1)');\n        assert.equal(moment('17:15', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).minutes(), 15, 'iso: assert parse HH:mm (2)');\n        assert.equal(moment('06', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).month(), 6 - 1, 'iso: assert parse MM');\n        assert.equal(moment('2012-06-01', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).parsingFlags().iso, true, 'iso: assert parse iso');\n        assert.equal(moment('2014-05-05', [moment.ISO_8601, 'YYYY-MM-DD']).parsingFlags().iso, true, 'iso: edge case array precedence iso');\n        assert.equal(moment('2014-05-05', ['YYYY-MM-DD', moment.ISO_8601]).parsingFlags().iso, false, 'iso: edge case array precedence not iso');\n    });\n\n    test('string with format - years', function (assert) {\n        assert.equal(moment('67', 'YY').format('YYYY'), '2067', '67 > 2067');\n        assert.equal(moment('68', 'YY').format('YYYY'), '2068', '68 > 2068');\n        assert.equal(moment('69', 'YY').format('YYYY'), '1969', '69 > 1969');\n        assert.equal(moment('70', 'YY').format('YYYY'), '1970', '70 > 1970');\n    });\n\n    test('implicit cloning', function (assert) {\n        var momentA = moment([2011, 10, 10]),\n        momentB = moment(momentA);\n        momentA.month(5);\n        assert.equal(momentB.month(), 10, 'Calling moment() on a moment will create a clone');\n        assert.equal(momentA.month(), 5, 'Calling moment() on a moment will create a clone');\n    });\n\n    test('explicit cloning', function (assert) {\n        var momentA = moment([2011, 10, 10]),\n        momentB = momentA.clone();\n        momentA.month(5);\n        assert.equal(momentB.month(), 10, 'Calling moment() on a moment will create a clone');\n        assert.equal(momentA.month(), 5, 'Calling moment() on a moment will create a clone');\n    });\n\n    test('cloning carrying over utc mode', function (assert) {\n        assert.equal(moment().local().clone()._isUTC, false, 'An explicit cloned local moment should have _isUTC == false');\n        assert.equal(moment().utc().clone()._isUTC, true, 'An cloned utc moment should have _isUTC == true');\n        assert.equal(moment().clone()._isUTC, false, 'An explicit cloned local moment should have _isUTC == false');\n        assert.equal(moment.utc().clone()._isUTC, true, 'An explicit cloned utc moment should have _isUTC == true');\n        assert.equal(moment(moment().local())._isUTC, false, 'An implicit cloned local moment should have _isUTC == false');\n        assert.equal(moment(moment().utc())._isUTC, true, 'An implicit cloned utc moment should have _isUTC == true');\n        assert.equal(moment(moment())._isUTC, false, 'An implicit cloned local moment should have _isUTC == false');\n        assert.equal(moment(moment.utc())._isUTC, true, 'An implicit cloned utc moment should have _isUTC == true');\n    });\n\n    test('parsing iso', function (assert) {\n        var offset = moment([2011, 9, 8]).utcOffset(),\n        pad = function (input) {\n            if (input < 10) {\n                return '0' + input;\n            }\n            return '' + input;\n        },\n        hourOffset = (offset > 0 ? Math.floor(offset / 60) : Math.ceil(offset / 60)),\n        minOffset = offset - (hourOffset * 60),\n        tz = (offset >= 0) ?\n            '+' + pad(hourOffset) + ':' + pad(minOffset) :\n            '-' + pad(-hourOffset) + ':' + pad(-minOffset),\n        tz2 = tz.replace(':', ''),\n        tz3 = tz2.slice(0, 3),\n        formats = [\n            ['2011-10-08',                    '2011-10-08T00:00:00.000' + tz],\n            ['2011-10-08T18',                 '2011-10-08T18:00:00.000' + tz],\n            ['2011-10-08T18:04',              '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08T18:04:20',           '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08T18:04' + tz,         '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08T18:04:20' + tz,      '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08T18:04' + tz2,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08T18:04:20' + tz2,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08T18:04' + tz3,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08T18:04:20' + tz3,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08T18:04:20.1' + tz2,   '2011-10-08T18:04:20.100' + tz],\n            ['2011-10-08T18:04:20.11' + tz2,  '2011-10-08T18:04:20.110' + tz],\n            ['2011-10-08T18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz],\n            ['2011-10-08 18',                 '2011-10-08T18:00:00.000' + tz],\n            ['2011-10-08 18:04',              '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08 18:04:20',           '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08 18:04' + tz,         '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08 18:04:20' + tz,      '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08 18:04' + tz2,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08 18:04:20' + tz2,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08 18:04' + tz3,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-10-08 18:04:20' + tz3,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-10-08 18:04:20.1' + tz2,   '2011-10-08T18:04:20.100' + tz],\n            ['2011-10-08 18:04:20.11' + tz2,  '2011-10-08T18:04:20.110' + tz],\n            ['2011-10-08 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz],\n            ['2011-W40',                      '2011-10-03T00:00:00.000' + tz],\n            ['2011-W40-6',                    '2011-10-08T00:00:00.000' + tz],\n            ['2011-W40-6T18',                 '2011-10-08T18:00:00.000' + tz],\n            ['2011-W40-6T18:04',              '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6T18:04:20',           '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6T18:04' + tz,         '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6T18:04:20' + tz,      '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6T18:04' + tz2,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6T18:04:20' + tz2,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6T18:04' + tz3,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6T18:04:20' + tz3,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6T18:04:20.1' + tz2,   '2011-10-08T18:04:20.100' + tz],\n            ['2011-W40-6T18:04:20.11' + tz2,  '2011-10-08T18:04:20.110' + tz],\n            ['2011-W40-6T18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz],\n            ['2011-W40-6 18',                 '2011-10-08T18:00:00.000' + tz],\n            ['2011-W40-6 18:04',              '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6 18:04:20',           '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6 18:04' + tz,         '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6 18:04:20' + tz,      '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6 18:04' + tz2,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6 18:04:20' + tz2,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6 18:04' + tz3,        '2011-10-08T18:04:00.000' + tz],\n            ['2011-W40-6 18:04:20' + tz3,     '2011-10-08T18:04:20.000' + tz],\n            ['2011-W40-6 18:04:20.1' + tz2,   '2011-10-08T18:04:20.100' + tz],\n            ['2011-W40-6 18:04:20.11' + tz2,  '2011-10-08T18:04:20.110' + tz],\n            ['2011-W40-6 18:04:20.111' + tz2, '2011-10-08T18:04:20.111' + tz],\n            ['2011-281',                      '2011-10-08T00:00:00.000' + tz],\n            ['2011-281T18',                   '2011-10-08T18:00:00.000' + tz],\n            ['2011-281T18:04',                '2011-10-08T18:04:00.000' + tz],\n            ['2011-281T18:04:20',             '2011-10-08T18:04:20.000' + tz],\n            ['2011-281T18:04' + tz,           '2011-10-08T18:04:00.000' + tz],\n            ['2011-281T18:04:20' + tz,        '2011-10-08T18:04:20.000' + tz],\n            ['2011-281T18:04' + tz2,          '2011-10-08T18:04:00.000' + tz],\n            ['2011-281T18:04:20' + tz2,       '2011-10-08T18:04:20.000' + tz],\n            ['2011-281T18:04' + tz3,          '2011-10-08T18:04:00.000' + tz],\n            ['2011-281T18:04:20' + tz3,       '2011-10-08T18:04:20.000' + tz],\n            ['2011-281T18:04:20.1' + tz2,     '2011-10-08T18:04:20.100' + tz],\n            ['2011-281T18:04:20.11' + tz2,    '2011-10-08T18:04:20.110' + tz],\n            ['2011-281T18:04:20.111' + tz2,   '2011-10-08T18:04:20.111' + tz],\n            ['2011-281 18',                   '2011-10-08T18:00:00.000' + tz],\n            ['2011-281 18:04',                '2011-10-08T18:04:00.000' + tz],\n            ['2011-281 18:04:20',             '2011-10-08T18:04:20.000' + tz],\n            ['2011-281 18:04' + tz,           '2011-10-08T18:04:00.000' + tz],\n            ['2011-281 18:04:20' + tz,        '2011-10-08T18:04:20.000' + tz],\n            ['2011-281 18:04' + tz2,          '2011-10-08T18:04:00.000' + tz],\n            ['2011-281 18:04:20' + tz2,       '2011-10-08T18:04:20.000' + tz],\n            ['2011-281 18:04' + tz3,          '2011-10-08T18:04:00.000' + tz],\n            ['2011-281 18:04:20' + tz3,       '2011-10-08T18:04:20.000' + tz],\n            ['2011-281 18:04:20.1' + tz2,     '2011-10-08T18:04:20.100' + tz],\n            ['2011-281 18:04:20.11' + tz2,    '2011-10-08T18:04:20.110' + tz],\n            ['2011-281 18:04:20.111' + tz2,   '2011-10-08T18:04:20.111' + tz]\n        ], i;\n        for (i = 0; i < formats.length; i++) {\n            assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]);\n        }\n    });\n\n    test('parsing iso week year/week/weekday', function (assert) {\n        assert.equal(moment.utc('2007-W01').format(), '2007-01-01T00:00:00+00:00', '2008 week 1 (1st Jan Mon)');\n        assert.equal(moment.utc('2008-W01').format(), '2007-12-31T00:00:00+00:00', '2008 week 1 (1st Jan Tue)');\n        assert.equal(moment.utc('2003-W01').format(), '2002-12-30T00:00:00+00:00', '2008 week 1 (1st Jan Wed)');\n        assert.equal(moment.utc('2009-W01').format(), '2008-12-29T00:00:00+00:00', '2009 week 1 (1st Jan Thu)');\n        assert.equal(moment.utc('2010-W01').format(), '2010-01-04T00:00:00+00:00', '2010 week 1 (1st Jan Fri)');\n        assert.equal(moment.utc('2011-W01').format(), '2011-01-03T00:00:00+00:00', '2011 week 1 (1st Jan Sat)');\n        assert.equal(moment.utc('2012-W01').format(), '2012-01-02T00:00:00+00:00', '2012 week 1 (1st Jan Sun)');\n    });\n\n    test('parsing week year/week/weekday (dow 1, doy 4)', function (assert) {\n        moment.locale('dow:1,doy:4', {week: {dow: 1, doy: 4}});\n\n        assert.equal(moment.utc('2007-01', 'gggg-ww').format(), '2007-01-01T00:00:00+00:00', '2007 week 1 (1st Jan Mon)');\n        assert.equal(moment.utc('2008-01', 'gggg-ww').format(), '2007-12-31T00:00:00+00:00', '2008 week 1 (1st Jan Tue)');\n        assert.equal(moment.utc('2003-01', 'gggg-ww').format(), '2002-12-30T00:00:00+00:00', '2003 week 1 (1st Jan Wed)');\n        assert.equal(moment.utc('2009-01', 'gggg-ww').format(), '2008-12-29T00:00:00+00:00', '2009 week 1 (1st Jan Thu)');\n        assert.equal(moment.utc('2010-01', 'gggg-ww').format(), '2010-01-04T00:00:00+00:00', '2010 week 1 (1st Jan Fri)');\n        assert.equal(moment.utc('2011-01', 'gggg-ww').format(), '2011-01-03T00:00:00+00:00', '2011 week 1 (1st Jan Sat)');\n        assert.equal(moment.utc('2012-01', 'gggg-ww').format(), '2012-01-02T00:00:00+00:00', '2012 week 1 (1st Jan Sun)');\n\n        moment.defineLocale('dow:1,doy:4', null);\n    });\n\n    test('parsing week year/week/weekday (dow 1, doy 7)', function (assert) {\n        moment.locale('dow:1,doy:7', {week: {dow: 1, doy: 7}});\n\n        assert.equal(moment.utc('2007-01', 'gggg-ww').format(), '2007-01-01T00:00:00+00:00', '2007 week 1 (1st Jan Mon)');\n        assert.equal(moment.utc('2008-01', 'gggg-ww').format(), '2007-12-31T00:00:00+00:00', '2008 week 1 (1st Jan Tue)');\n        assert.equal(moment.utc('2003-01', 'gggg-ww').format(), '2002-12-30T00:00:00+00:00', '2003 week 1 (1st Jan Wed)');\n        assert.equal(moment.utc('2009-01', 'gggg-ww').format(), '2008-12-29T00:00:00+00:00', '2009 week 1 (1st Jan Thu)');\n        assert.equal(moment.utc('2010-01', 'gggg-ww').format(), '2009-12-28T00:00:00+00:00', '2010 week 1 (1st Jan Fri)');\n        assert.equal(moment.utc('2011-01', 'gggg-ww').format(), '2010-12-27T00:00:00+00:00', '2011 week 1 (1st Jan Sat)');\n        assert.equal(moment.utc('2012-01', 'gggg-ww').format(), '2011-12-26T00:00:00+00:00', '2012 week 1 (1st Jan Sun)');\n        moment.defineLocale('dow:1,doy:7', null);\n    });\n\n    test('parsing week year/week/weekday (dow 0, doy 6)', function (assert) {\n        moment.locale('dow:0,doy:6', {week: {dow: 0, doy: 6}});\n\n        assert.equal(moment.utc('2007-01', 'gggg-ww').format(), '2006-12-31T00:00:00+00:00', '2007 week 1 (1st Jan Mon)');\n        assert.equal(moment.utc('2008-01', 'gggg-ww').format(), '2007-12-30T00:00:00+00:00', '2008 week 1 (1st Jan Tue)');\n        assert.equal(moment.utc('2003-01', 'gggg-ww').format(), '2002-12-29T00:00:00+00:00', '2003 week 1 (1st Jan Wed)');\n        assert.equal(moment.utc('2009-01', 'gggg-ww').format(), '2008-12-28T00:00:00+00:00', '2009 week 1 (1st Jan Thu)');\n        assert.equal(moment.utc('2010-01', 'gggg-ww').format(), '2009-12-27T00:00:00+00:00', '2010 week 1 (1st Jan Fri)');\n        assert.equal(moment.utc('2011-01', 'gggg-ww').format(), '2010-12-26T00:00:00+00:00', '2011 week 1 (1st Jan Sat)');\n        assert.equal(moment.utc('2012-01', 'gggg-ww').format(), '2012-01-01T00:00:00+00:00', '2012 week 1 (1st Jan Sun)');\n        moment.defineLocale('dow:0,doy:6', null);\n    });\n\n    test('parsing week year/week/weekday (dow 6, doy 12)', function (assert) {\n        moment.locale('dow:6,doy:12', {week: {dow: 6, doy: 12}});\n\n        assert.equal(moment.utc('2007-01', 'gggg-ww').format(), '2006-12-30T00:00:00+00:00', '2007 week 1 (1st Jan Mon)');\n        assert.equal(moment.utc('2008-01', 'gggg-ww').format(), '2007-12-29T00:00:00+00:00', '2008 week 1 (1st Jan Tue)');\n        assert.equal(moment.utc('2003-01', 'gggg-ww').format(), '2002-12-28T00:00:00+00:00', '2003 week 1 (1st Jan Wed)');\n        assert.equal(moment.utc('2009-01', 'gggg-ww').format(), '2008-12-27T00:00:00+00:00', '2009 week 1 (1st Jan Thu)');\n        assert.equal(moment.utc('2010-01', 'gggg-ww').format(), '2009-12-26T00:00:00+00:00', '2010 week 1 (1st Jan Fri)');\n        assert.equal(moment.utc('2011-01', 'gggg-ww').format(), '2011-01-01T00:00:00+00:00', '2011 week 1 (1st Jan Sat)');\n        assert.equal(moment.utc('2012-01', 'gggg-ww').format(), '2011-12-31T00:00:00+00:00', '2012 week 1 (1st Jan Sun)');\n    });\n\n    test('parsing ISO with Z', function (assert) {\n        var i, mom, formats = [\n            ['2011-10-08T18:04',             '2011-10-08T18:04:00.000'],\n            ['2011-10-08T18:04:20',          '2011-10-08T18:04:20.000'],\n            ['2011-10-08T18:04:20.1',        '2011-10-08T18:04:20.100'],\n            ['2011-10-08T18:04:20.11',       '2011-10-08T18:04:20.110'],\n            ['2011-10-08T18:04:20.111',      '2011-10-08T18:04:20.111'],\n            ['2011-W40-6T18',                '2011-10-08T18:00:00.000'],\n            ['2011-W40-6T18:04',             '2011-10-08T18:04:00.000'],\n            ['2011-W40-6T18:04:20',          '2011-10-08T18:04:20.000'],\n            ['2011-W40-6T18:04:20.1',        '2011-10-08T18:04:20.100'],\n            ['2011-W40-6T18:04:20.11',       '2011-10-08T18:04:20.110'],\n            ['2011-W40-6T18:04:20.111',      '2011-10-08T18:04:20.111'],\n            ['2011-281T18',                  '2011-10-08T18:00:00.000'],\n            ['2011-281T18:04',               '2011-10-08T18:04:00.000'],\n            ['2011-281T18:04:20',            '2011-10-08T18:04:20.000'],\n            ['2011-281T18:04:20',            '2011-10-08T18:04:20.000'],\n            ['2011-281T18:04:20.1',          '2011-10-08T18:04:20.100'],\n            ['2011-281T18:04:20.11',         '2011-10-08T18:04:20.110'],\n            ['2011-281T18:04:20.111',        '2011-10-08T18:04:20.111']\n        ];\n\n        for (i = 0; i < formats.length; i++) {\n            mom = moment(formats[i][0] + 'Z').utc();\n            assert.equal(mom.format('YYYY-MM-DDTHH:mm:ss.SSS'), formats[i][1], 'moment should be able to parse ISO in UTC ' + formats[i][0] + 'Z');\n\n            mom = moment(formats[i][0] + ' Z').utc();\n            assert.equal(mom.format('YYYY-MM-DDTHH:mm:ss.SSS'), formats[i][1], 'moment should be able to parse ISO in UTC ' + formats[i][0] + ' Z');\n        }\n    });\n\n    test('parsing iso with T', function (assert) {\n        assert.equal(moment('2011-10-08T18')._f, 'YYYY-MM-DDTHH', 'should include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08T18:20')._f, 'YYYY-MM-DDTHH:mm', 'should include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08T18:20:13')._f, 'YYYY-MM-DDTHH:mm:ss', 'should include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08T18:20:13.321')._f, 'YYYY-MM-DDTHH:mm:ss.SSSS', 'should include \\'T\\' in the format');\n\n        assert.equal(moment('2011-10-08 18')._f, 'YYYY-MM-DD HH', 'should not include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08 18:20')._f, 'YYYY-MM-DD HH:mm', 'should not include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08 18:20:13')._f, 'YYYY-MM-DD HH:mm:ss', 'should not include \\'T\\' in the format');\n        assert.equal(moment('2011-10-08 18:20:13.321')._f, 'YYYY-MM-DD HH:mm:ss.SSSS', 'should not include \\'T\\' in the format');\n    });\n\n    test('parsing iso Z timezone', function (assert) {\n        var i,\n        formats = [\n            ['2011-10-08T18:04Z',             '2011-10-08T18:04:00.000+00:00'],\n            ['2011-10-08T18:04:20Z',          '2011-10-08T18:04:20.000+00:00'],\n            ['2011-10-08T18:04:20.111Z',      '2011-10-08T18:04:20.111+00:00']\n        ];\n        for (i = 0; i < formats.length; i++) {\n            assert.equal(moment.utc(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]);\n        }\n    });\n\n    test('parsing iso Z timezone into local', function (assert) {\n        var m = moment('2011-10-08T18:04:20.111Z');\n\n        assert.equal(m.utc().format('YYYY-MM-DDTHH:mm:ss.SSS'), '2011-10-08T18:04:20.111', 'moment should be able to parse ISO 2011-10-08T18:04:20.111Z');\n    });\n\n    test('parsing iso with more subsecond precision digits', function (assert) {\n        assert.equal(moment.utc('2013-07-31T22:00:00.0000000Z').format(), '2013-07-31T22:00:00+00:00', 'more than 3 subsecond digits');\n    });\n\n    test('null or empty', function (assert) {\n        assert.equal(moment('').isValid(), false, 'moment(\\'\\') is not valid');\n        assert.equal(moment(null).isValid(), false, 'moment(null) is not valid');\n        assert.equal(moment(null, 'YYYY-MM-DD').isValid(), false, 'moment(\\'\\', \\'format\\') is not valid');\n        assert.equal(moment('', 'YYYY-MM-DD').isValid(), false, 'moment(\\'\\', \\'format\\') is not valid');\n        assert.equal(moment.utc('').isValid(), false, 'moment.utc(\\'\\') is not valid');\n        assert.equal(moment.utc(null).isValid(), false, 'moment.utc(null) is not valid');\n        assert.equal(moment.utc(null, 'YYYY-MM-DD').isValid(), false, 'moment.utc(null) is not valid');\n        assert.equal(moment.utc('', 'YYYY-MM-DD').isValid(), false, 'moment.utc(\\'\\', \\'YYYY-MM-DD\\') is not valid');\n    });\n\n    test('first century', function (assert) {\n        assert.equal(moment([0, 0, 1]).format('YYYY-MM-DD'), '0000-01-01', 'Year AD 0');\n        assert.equal(moment([99, 0, 1]).format('YYYY-MM-DD'), '0099-01-01', 'Year AD 99');\n        assert.equal(moment([999, 0, 1]).format('YYYY-MM-DD'), '0999-01-01', 'Year AD 999');\n        assert.equal(moment('0 1 1', 'YYYY MM DD').format('YYYY-MM-DD'), '0000-01-01', 'Year AD 0');\n        assert.equal(moment('99 1 1', 'YYYY MM DD').format('YYYY-MM-DD'), '0099-01-01', 'Year AD 99');\n        assert.equal(moment('999 1 1', 'YYYY MM DD').format('YYYY-MM-DD'), '0999-01-01', 'Year AD 999');\n        assert.equal(moment('0 1 1', 'YYYYY MM DD').format('YYYYY-MM-DD'), '00000-01-01', 'Year AD 0');\n        assert.equal(moment('99 1 1', 'YYYYY MM DD').format('YYYYY-MM-DD'), '00099-01-01', 'Year AD 99');\n        assert.equal(moment('999 1 1', 'YYYYY MM DD').format('YYYYY-MM-DD'), '00999-01-01', 'Year AD 999');\n    });\n\n    test('six digit years', function (assert) {\n        assert.equal(moment([-270000, 0, 1]).format('YYYYY-MM-DD'), '-270000-01-01', 'format BC 270,001');\n        assert.equal(moment([270000, 0, 1]).format('YYYYY-MM-DD'), '270000-01-01', 'format AD 270,000');\n        assert.equal(moment('-270000-01-01', 'YYYYY-MM-DD').toDate().getFullYear(), -270000, 'parse BC 270,001');\n        assert.equal(moment('270000-01-01',  'YYYYY-MM-DD').toDate().getFullYear(), 270000, 'parse AD 270,000');\n        assert.equal(moment('+270000-01-01', 'YYYYY-MM-DD').toDate().getFullYear(), 270000, 'parse AD +270,000');\n        assert.equal(moment.utc('-270000-01-01', 'YYYYY-MM-DD').toDate().getUTCFullYear(), -270000, 'parse utc BC 270,001');\n        assert.equal(moment.utc('270000-01-01',  'YYYYY-MM-DD').toDate().getUTCFullYear(), 270000, 'parse utc AD 270,000');\n        assert.equal(moment.utc('+270000-01-01', 'YYYYY-MM-DD').toDate().getUTCFullYear(), 270000, 'parse utc AD +270,000');\n    });\n\n    test('negative four digit years', function (assert) {\n        assert.equal(moment('-1000-01-01', 'YYYYY-MM-DD').toDate().getFullYear(), -1000, 'parse BC 1,001');\n        assert.equal(moment.utc('-1000-01-01', 'YYYYY-MM-DD').toDate().getUTCFullYear(), -1000, 'parse utc BC 1,001');\n    });\n\n    test('strict parsing', function (assert) {\n        assert.equal(moment('2014-', 'YYYY-Q', true).isValid(), false, 'fail missing quarter');\n\n        assert.equal(moment('2012-05', 'YYYY-MM', true).format('YYYY-MM'), '2012-05', 'parse correct string');\n        assert.equal(moment(' 2012-05', 'YYYY-MM', true).isValid(), false, 'fail on extra whitespace');\n        assert.equal(moment('foo 2012-05', '[foo] YYYY-MM', true).format('YYYY-MM'), '2012-05', 'handle fixed text');\n        assert.equal(moment('2012 05', 'YYYY-MM', true).isValid(), false, 'fail on different separator');\n        assert.equal(moment('2012 05', 'YYYY MM DD', true).isValid(), false, 'fail on too many tokens');\n\n        assert.equal(moment('05 30 2010', ['DD MM YYYY', 'MM DD YYYY'], true).format('MM DD YYYY'), '05 30 2010', 'array with bad date');\n        assert.equal(moment('05 30 2010', ['', 'MM DD YYYY'], true).format('MM DD YYYY'), '05 30 2010', 'array with invalid format');\n        assert.equal(moment('05 30 2010', [' DD MM YYYY', 'MM DD YYYY'], true).format('MM DD YYYY'), '05 30 2010', 'array with non-matching format');\n\n        assert.equal(moment('2010.*...', 'YYYY.*', true).isValid(), false, 'invalid format with regex chars');\n        assert.equal(moment('2010.*', 'YYYY.*', true).year(), 2010, 'valid format with regex chars');\n        assert.equal(moment('.*2010.*', '.*YYYY.*', true).year(), 2010, 'valid format with regex chars on both sides');\n\n        //strict tokens\n        assert.equal(moment('-5-05-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid negative year');\n        assert.equal(moment('2-05-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid one-digit year');\n        assert.equal(moment('20-05-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid two-digit year');\n        assert.equal(moment('201-05-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid three-digit year');\n        assert.equal(moment('2010-05-25', 'YYYY-MM-DD', true).isValid(), true, 'valid four-digit year');\n        assert.equal(moment('22010-05-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid five-digit year');\n\n        assert.equal(moment('12-05-25', 'YY-MM-DD', true).isValid(), true, 'valid two-digit year');\n        assert.equal(moment('2012-05-25', 'YY-MM-DD', true).isValid(), false, 'invalid four-digit year');\n\n        assert.equal(moment('-5-05-25', 'Y-MM-DD', true).isValid(), true, 'valid negative year');\n        assert.equal(moment('2-05-25', 'Y-MM-DD', true).isValid(), true, 'valid one-digit year');\n        assert.equal(moment('20-05-25', 'Y-MM-DD', true).isValid(), true, 'valid two-digit year');\n        assert.equal(moment('201-05-25', 'Y-MM-DD', true).isValid(), true, 'valid three-digit year');\n\n        assert.equal(moment('2012-5-25', 'YYYY-M-DD', true).isValid(), true, 'valid one-digit month');\n        assert.equal(moment('2012-5-25', 'YYYY-MM-DD', true).isValid(), false, 'invalid one-digit month');\n        assert.equal(moment('2012-05-25', 'YYYY-M-DD', true).isValid(), true, 'valid one-digit month');\n        assert.equal(moment('2012-05-25', 'YYYY-MM-DD', true).isValid(), true, 'valid one-digit month');\n\n        assert.equal(moment('2012-05-2', 'YYYY-MM-D', true).isValid(), true, 'valid one-digit day');\n        assert.equal(moment('2012-05-2', 'YYYY-MM-DD', true).isValid(), false, 'invalid one-digit day');\n        assert.equal(moment('2012-05-02', 'YYYY-MM-D', true).isValid(), true, 'valid two-digit day');\n        assert.equal(moment('2012-05-02', 'YYYY-MM-DD', true).isValid(), true, 'valid two-digit day');\n\n        assert.equal(moment('+002012-05-25', 'YYYYY-MM-DD', true).isValid(), true, 'valid six-digit year');\n        assert.equal(moment('+2012-05-25', 'YYYYY-MM-DD', true).isValid(), false, 'invalid four-digit year');\n\n        //thse are kinda pointless, but they should work as expected\n        assert.equal(moment('1', 'S', true).isValid(), true, 'valid one-digit milisecond');\n        assert.equal(moment('12', 'S', true).isValid(), false, 'invalid two-digit milisecond');\n        assert.equal(moment('123', 'S', true).isValid(), false, 'invalid three-digit milisecond');\n\n        assert.equal(moment('1', 'SS', true).isValid(), false, 'invalid one-digit milisecond');\n        assert.equal(moment('12', 'SS', true).isValid(), true, 'valid two-digit milisecond');\n        assert.equal(moment('123', 'SS', true).isValid(), false, 'invalid three-digit milisecond');\n\n        assert.equal(moment('1', 'SSS', true).isValid(), false, 'invalid one-digit milisecond');\n        assert.equal(moment('12', 'SSS', true).isValid(), false, 'invalid two-digit milisecond');\n        assert.equal(moment('123', 'SSS', true).isValid(), true, 'valid three-digit milisecond');\n\n        // strict parsing respects month length\n        assert.ok(moment('1 January 2000', 'D MMMM YYYY', true).isValid(), 'capital long-month + MMMM');\n        assert.ok(!moment('1 January 2000', 'D MMM YYYY', true).isValid(), 'capital long-month + MMM');\n        assert.ok(!moment('1 Jan 2000', 'D MMMM YYYY', true).isValid(), 'capital short-month + MMMM');\n        assert.ok(moment('1 Jan 2000', 'D MMM YYYY', true).isValid(), 'capital short-month + MMM');\n        assert.ok(moment('1 january 2000', 'D MMMM YYYY', true).isValid(), 'lower long-month + MMMM');\n        assert.ok(!moment('1 january 2000', 'D MMM YYYY', true).isValid(), 'lower long-month + MMM');\n        assert.ok(!moment('1 jan 2000', 'D MMMM YYYY', true).isValid(), 'lower short-month + MMMM');\n        assert.ok(moment('1 jan 2000', 'D MMM YYYY', true).isValid(), 'lower short-month + MMM');\n    });\n\n    test('parsing into a locale', function (assert) {\n        moment.defineLocale('parselocale', {\n            months : 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_'),\n            monthsShort : 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_')\n        });\n\n        moment.locale('en');\n\n        assert.equal(moment('2012 seven', 'YYYY MMM', 'parselocale').month(), 6, 'should be able to parse in a specific locale');\n\n        moment.locale('parselocale');\n\n        assert.equal(moment('2012 july', 'YYYY MMM', 'en').month(), 6, 'should be able to parse in a specific locale');\n\n        moment.defineLocale('parselocale', null);\n    });\n\n    function getVerifier(test) {\n        return function (input, format, expected, description, asymetrical) {\n            var m = moment(input, format);\n            test.equal(m.format('YYYY MM DD'), expected, 'compare: ' + description);\n\n            //test round trip\n            if (!asymetrical) {\n                test.equal(m.format(format), input, 'round trip: ' + description);\n            }\n        };\n    }\n\n    test('parsing week and weekday information', function (assert) {\n        var ver = getVerifier(assert);\n\n        // year\n        ver('12', 'gg', '2012 01 01', 'week-year two digits');\n        ver('2012', 'gggg', '2012 01 01', 'week-year four digits');\n\n        ver('99', 'gg', '1998 12 27', 'week-year two digits previous year');\n        ver('1999', 'gggg', '1998 12 27', 'week-year four digits previous year');\n\n        ver('99', 'GG', '1999 01 04', 'iso week-year two digits');\n        ver('1999', 'GGGG', '1999 01 04', 'iso week-year four digits');\n\n        ver('13', 'GG', '2012 12 31', 'iso week-year two digits previous year');\n        ver('2013', 'GGGG', '2012 12 31', 'iso week-year four digits previous year');\n\n        // year + week\n        ver('1999 37', 'gggg w', '1999 09 05', 'week');\n        ver('1999 37', 'gggg ww', '1999 09 05', 'week double');\n        ver('1999 37', 'GGGG W', '1999 09 13', 'iso week');\n        ver('1999 37', 'GGGG WW', '1999 09 13', 'iso week double');\n\n        ver('1999 37 4', 'GGGG WW E', '1999 09 16', 'iso day');\n        ver('1999 37 04', 'GGGG WW E', '1999 09 16', 'iso day wide', true);\n\n        ver('1999 37 4', 'gggg ww e', '1999 09 09', 'day');\n        ver('1999 37 04', 'gggg ww e', '1999 09 09', 'day wide', true);\n\n        // year + week + day\n        ver('1999 37 4', 'gggg ww d', '1999 09 09', 'd');\n        ver('1999 37 Th', 'gggg ww dd', '1999 09 09', 'dd');\n        ver('1999 37 Thu', 'gggg ww ddd', '1999 09 09', 'ddd');\n        ver('1999 37 Thursday', 'gggg ww dddd', '1999 09 09', 'dddd');\n\n        // lower-order only\n        assert.equal(moment('22', 'ww').week(), 22, 'week sets the week by itself');\n        assert.equal(moment('22', 'ww').weekYear(), moment().weekYear(), 'week keeps this year');\n        assert.equal(moment('2012 22', 'YYYY ww').weekYear(), 2012, 'week keeps parsed year');\n\n        assert.equal(moment('22', 'WW').isoWeek(), 22, 'iso week sets the week by itself');\n        assert.equal(moment('2012 22', 'YYYY WW').weekYear(), 2012, 'iso week keeps parsed year');\n        assert.equal(moment('22', 'WW').isoWeekYear(), moment().isoWeekYear(), 'iso week keeps this year');\n\n        // order\n        ver('6 2013 2', 'e gggg w', '2013 01 12', 'order doesn\\'t matter');\n        ver('6 2013 2', 'E GGGG W', '2013 01 12', 'iso order doesn\\'t matter');\n\n        //can parse other stuff too\n        assert.equal(moment('1999-W37-4 3:30', 'GGGG-[W]WW-E HH:mm').format('YYYY MM DD HH:mm'), '1999 09 16 03:30', 'parsing weeks and hours');\n\n        // In safari, all years before 1300 are shifted back with one day.\n        // http://stackoverflow.com/questions/20768975/safari-subtracts-1-day-from-dates-before-1300\n        if (new Date('1300-01-01').getUTCFullYear() === 1300) {\n            // Years less than 100\n            ver('0098-06', 'GGGG-WW', '0098 02 03', 'small years work', true);\n        }\n    });\n\n    test('parsing localized weekdays', function (assert) {\n        var ver = getVerifier(assert);\n        try {\n            moment.locale('dow:1,doy:4', {\n                weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n                weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n                weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n                week: {dow: 1, doy: 4}\n            });\n            ver('1999 37 4', 'GGGG WW E', '1999 09 16', 'iso ignores locale');\n            ver('1999 37 7', 'GGGG WW E', '1999 09 19', 'iso ignores locale');\n\n            ver('1999 37 0', 'gggg ww e', '1999 09 13', 'localized e uses local doy and dow: 0 = monday');\n            ver('1999 37 4', 'gggg ww e', '1999 09 17', 'localized e uses local doy and dow: 4 = friday');\n\n            ver('1999 37 1', 'gggg ww d', '1999 09 13', 'localized d uses 0-indexed days: 1 = monday');\n            ver('1999 37 Lu', 'gggg ww dd', '1999 09 13', 'localized d uses 0-indexed days: Mo');\n            ver('1999 37 lun.', 'gggg ww ddd', '1999 09 13', 'localized d uses 0-indexed days: Mon');\n            ver('1999 37 lundi', 'gggg ww dddd', '1999 09 13', 'localized d uses 0-indexed days: Monday');\n            ver('1999 37 4', 'gggg ww d', '1999 09 16', 'localized d uses 0-indexed days: 4');\n\n            //sunday goes at the end of the week\n            ver('1999 37 0', 'gggg ww d', '1999 09 19', 'localized d uses 0-indexed days: 0 = sund');\n            ver('1999 37 Di', 'gggg ww dd', '1999 09 19', 'localized d uses 0-indexed days: 0 = sund');\n        }\n        finally {\n            moment.locale('en');\n        }\n    });\n\n    test('parsing with customized two-digit year', function (assert) {\n        var original = moment.parseTwoDigitYear;\n        try {\n            assert.equal(moment('68', 'YY').year(), 2068);\n            assert.equal(moment('69', 'YY').year(), 1969);\n            moment.parseTwoDigitYear = function (input) {\n                return +input + (+input > 30 ? 1900 : 2000);\n            };\n            assert.equal(moment('68', 'YY').year(), 1968);\n            assert.equal(moment('67', 'YY').year(), 1967);\n            assert.equal(moment('31', 'YY').year(), 1931);\n            assert.equal(moment('30', 'YY').year(), 2030);\n        }\n        finally {\n            moment.parseTwoDigitYear = original;\n        }\n    });\n\n    test('array with strings', function (assert) {\n        assert.equal(moment(['2014', '7', '31']).isValid(), true, 'string array + isValid');\n    });\n\n    test('utc with array of formats', function (assert) {\n        assert.equal(moment.utc('2014-01-01', ['YYYY-MM-DD', 'YYYY-MM']).format(), '2014-01-01T00:00:00+00:00', 'moment.utc works with array of formats');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function each(array, callback) {\n        var i;\n        for (i = 0; i < array.length; i++) {\n            callback(array[i], i, array);\n        }\n    }\n\n    var helpers_each = each;\n\n    module('days in month');\n\n    test('days in month', function (assert) {\n        helpers_each([31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], function (days, i) {\n            var firstDay = moment([2012, i]),\n                lastDay  = moment([2012, i, days]);\n            assert.equal(firstDay.daysInMonth(), days, firstDay.format('L') + ' should have ' + days + ' days.');\n            assert.equal(lastDay.daysInMonth(), days, lastDay.format('L') + ' should have ' + days + ' days.');\n        });\n    });\n\n    test('days in month leap years', function (assert) {\n        assert.equal(moment([2010, 1]).daysInMonth(), 28, 'Feb 2010 should have 28 days');\n        assert.equal(moment([2100, 1]).daysInMonth(), 28, 'Feb 2100 should have 28 days');\n        assert.equal(moment([2008, 1]).daysInMonth(), 29, 'Feb 2008 should have 29 days');\n        assert.equal(moment([2000, 1]).daysInMonth(), 29, 'Feb 2000 should have 29 days');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function equal(assert, a, b, message) {\n        assert.ok(Math.abs(a - b) < 0.00000001, '(' + a + ' === ' + b + ') ' + message);\n    }\n\n    function dstForYear(year) {\n        var start = moment([year]),\n            end = moment([year + 1]),\n            current = start.clone(),\n            last;\n\n        while (current < end) {\n            last = current.clone();\n            current.add(24, 'hour');\n            if (last.utcOffset() !== current.utcOffset()) {\n                end = current.clone();\n                current = last.clone();\n                break;\n            }\n        }\n\n        while (current < end) {\n            last = current.clone();\n            current.add(1, 'hour');\n            if (last.utcOffset() !== current.utcOffset()) {\n                return {\n                    moment : last,\n                    diff : -(current.utcOffset() - last.utcOffset()) / 60\n                };\n            }\n        }\n    }\n\n    module('diff');\n\n    test('diff', function (assert) {\n        assert.equal(moment(1000).diff(0), 1000, '1 second - 0 = 1000');\n        assert.equal(moment(1000).diff(500), 500, '1 second - 0.5 seconds = 500');\n        assert.equal(moment(0).diff(1000), -1000, '0 - 1 second = -1000');\n        assert.equal(moment(new Date(1000)).diff(1000), 0, '1 second - 1 second = 0');\n        var oneHourDate = new Date(),\n        nowDate = new Date(+oneHourDate);\n        oneHourDate.setHours(oneHourDate.getHours() + 1);\n        assert.equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, '1 hour from now = 3600000');\n    });\n\n    test('diff key after', function (assert) {\n        assert.equal(moment([2010]).diff([2011], 'years'), -1, 'year diff');\n        assert.equal(moment([2010]).diff([2010, 2], 'months'), -2, 'month diff');\n        assert.equal(moment([2010]).diff([2010, 0, 7], 'weeks'), 0, 'week diff');\n        assert.equal(moment([2010]).diff([2010, 0, 8], 'weeks'), -1, 'week diff');\n        assert.equal(moment([2010]).diff([2010, 0, 21], 'weeks'), -2, 'week diff');\n        assert.equal(moment([2010]).diff([2010, 0, 22], 'weeks'), -3, 'week diff');\n        assert.equal(moment([2010]).diff([2010, 0, 4], 'days'), -3, 'day diff');\n        assert.equal(moment([2010]).diff([2010, 0, 1, 4], 'hours'), -4, 'hour diff');\n        assert.equal(moment([2010]).diff([2010, 0, 1, 0, 5], 'minutes'), -5, 'minute diff');\n        assert.equal(moment([2010]).diff([2010, 0, 1, 0, 0, 6], 'seconds'), -6, 'second diff');\n    });\n\n    test('diff key before', function (assert) {\n        assert.equal(moment([2011]).diff([2010], 'years'), 1, 'year diff');\n        assert.equal(moment([2010, 2]).diff([2010], 'months'), 2, 'month diff');\n        assert.equal(moment([2010, 0, 4]).diff([2010], 'days'), 3, 'day diff');\n        assert.equal(moment([2010, 0, 7]).diff([2010], 'weeks'), 0, 'week diff');\n        assert.equal(moment([2010, 0, 8]).diff([2010], 'weeks'), 1, 'week diff');\n        assert.equal(moment([2010, 0, 21]).diff([2010], 'weeks'), 2, 'week diff');\n        assert.equal(moment([2010, 0, 22]).diff([2010], 'weeks'), 3, 'week diff');\n        assert.equal(moment([2010, 0, 1, 4]).diff([2010], 'hours'), 4, 'hour diff');\n        assert.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minutes'), 5, 'minute diff');\n        assert.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'seconds'), 6, 'second diff');\n    });\n\n    test('diff key before singular', function (assert) {\n        assert.equal(moment([2011]).diff([2010], 'year'), 1, 'year diff singular');\n        assert.equal(moment([2010, 2]).diff([2010], 'month'), 2, 'month diff singular');\n        assert.equal(moment([2010, 0, 4]).diff([2010], 'day'), 3, 'day diff singular');\n        assert.equal(moment([2010, 0, 7]).diff([2010], 'week'), 0, 'week diff singular');\n        assert.equal(moment([2010, 0, 8]).diff([2010], 'week'), 1, 'week diff singular');\n        assert.equal(moment([2010, 0, 21]).diff([2010], 'week'), 2, 'week diff singular');\n        assert.equal(moment([2010, 0, 22]).diff([2010], 'week'), 3, 'week diff singular');\n        assert.equal(moment([2010, 0, 1, 4]).diff([2010], 'hour'), 4, 'hour diff singular');\n        assert.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minute'), 5, 'minute diff singular');\n        assert.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'second'), 6, 'second diff singular');\n    });\n\n    test('diff key before abbreviated', function (assert) {\n        assert.equal(moment([2011]).diff([2010], 'y'), 1, 'year diff abbreviated');\n        assert.equal(moment([2010, 2]).diff([2010], 'M'), 2, 'month diff abbreviated');\n        assert.equal(moment([2010, 0, 4]).diff([2010], 'd'), 3, 'day diff abbreviated');\n        assert.equal(moment([2010, 0, 7]).diff([2010], 'w'), 0, 'week diff abbreviated');\n        assert.equal(moment([2010, 0, 8]).diff([2010], 'w'), 1, 'week diff abbreviated');\n        assert.equal(moment([2010, 0, 21]).diff([2010], 'w'), 2, 'week diff abbreviated');\n        assert.equal(moment([2010, 0, 22]).diff([2010], 'w'), 3, 'week diff abbreviated');\n        assert.equal(moment([2010, 0, 1, 4]).diff([2010], 'h'), 4, 'hour diff abbreviated');\n        assert.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'm'), 5, 'minute diff abbreviated');\n        assert.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 's'), 6, 'second diff abbreviated');\n    });\n\n    test('diff month', function (assert) {\n        assert.equal(moment([2011, 0, 31]).diff([2011, 2, 1], 'months'), -1, 'month diff');\n    });\n\n    test('diff across DST', function (assert) {\n        var dst = dstForYear(2012), a, b, daysInMonth;\n        if (!dst) {\n            assert.equal(42, 42, 'at least one assertion');\n            return;\n        }\n\n        a = dst.moment;\n        b = a.clone().utc().add(12, 'hours').local();\n        daysInMonth = (a.daysInMonth() + b.daysInMonth()) / 2;\n        assert.equal(b.diff(a, 'milliseconds', true), 12 * 60 * 60 * 1000,\n                'ms diff across DST');\n        assert.equal(b.diff(a, 'seconds', true), 12 * 60 * 60,\n                'second diff across DST');\n        assert.equal(b.diff(a, 'minutes', true), 12 * 60,\n                'minute diff across DST');\n        assert.equal(b.diff(a, 'hours', true), 12,\n                'hour diff across DST');\n        assert.equal(b.diff(a, 'days', true), (12 - dst.diff) / 24,\n                'day diff across DST');\n        equal(assert, b.diff(a, 'weeks', true),  (12 - dst.diff) / 24 / 7,\n                'week diff across DST');\n        assert.ok(0.95 / (2 * 31) < b.diff(a, 'months', true),\n                'month diff across DST, lower bound');\n        assert.ok(b.diff(a, 'month', true) < 1.05 / (2 * 28),\n                'month diff across DST, upper bound');\n        assert.ok(0.95 / (2 * 31 * 12) < b.diff(a, 'years', true),\n                'year diff across DST, lower bound');\n        assert.ok(b.diff(a, 'year', true) < 1.05 / (2 * 28 * 12),\n                'year diff across DST, upper bound');\n\n        a = dst.moment;\n        b = a.clone().utc().add(12 + dst.diff, 'hours').local();\n        daysInMonth = (a.daysInMonth() + b.daysInMonth()) / 2;\n\n        assert.equal(b.diff(a, 'milliseconds', true),\n                (12 + dst.diff) * 60 * 60 * 1000,\n                'ms diff across DST');\n        assert.equal(b.diff(a, 'seconds', true),  (12 + dst.diff) * 60 * 60,\n                'second diff across DST');\n        assert.equal(b.diff(a, 'minutes', true),  (12 + dst.diff) * 60,\n                'minute diff across DST');\n        assert.equal(b.diff(a, 'hours', true),  (12 + dst.diff),\n                'hour diff across DST');\n        assert.equal(b.diff(a, 'days', true),  12 / 24, 'day diff across DST');\n        equal(assert, b.diff(a, 'weeks', true),  12 / 24 / 7,\n                'week diff across DST');\n        assert.ok(0.95 / (2 * 31) < b.diff(a, 'months', true),\n                'month diff across DST, lower bound');\n        assert.ok(b.diff(a, 'month', true) < 1.05 / (2 * 28),\n                'month diff across DST, upper bound');\n        assert.ok(0.95 / (2 * 31 * 12) < b.diff(a, 'years', true),\n                'year diff across DST, lower bound');\n        assert.ok(b.diff(a, 'year', true) < 1.05 / (2 * 28 * 12),\n                'year diff across DST, upper bound');\n    });\n\n    test('diff overflow', function (assert) {\n        assert.equal(moment([2011]).diff([2010], 'months'), 12, 'month diff');\n        assert.equal(moment([2010, 0, 2]).diff([2010], 'hours'), 24, 'hour diff');\n        assert.equal(moment([2010, 0, 1, 2]).diff([2010], 'minutes'), 120, 'minute diff');\n        assert.equal(moment([2010, 0, 1, 0, 4]).diff([2010], 'seconds'), 240, 'second diff');\n    });\n\n    test('diff between utc and local', function (assert) {\n        if (moment([2012]).utcOffset() === moment([2011]).utcOffset()) {\n            // Russia's utc offset on 1st of Jan 2012 vs 2011 is different\n            assert.equal(moment([2012]).utc().diff([2011], 'years'), 1, 'year diff');\n        }\n        assert.equal(moment([2010, 2, 2]).utc().diff([2010, 0, 2], 'months'), 2, 'month diff');\n        assert.equal(moment([2010, 0, 4]).utc().diff([2010], 'days'), 3, 'day diff');\n        assert.equal(moment([2010, 0, 22]).utc().diff([2010], 'weeks'), 3, 'week diff');\n        assert.equal(moment([2010, 0, 1, 4]).utc().diff([2010], 'hours'), 4, 'hour diff');\n        assert.equal(moment([2010, 0, 1, 0, 5]).utc().diff([2010], 'minutes'), 5, 'minute diff');\n        assert.equal(moment([2010, 0, 1, 0, 0, 6]).utc().diff([2010], 'seconds'), 6, 'second diff');\n    });\n\n    test('diff floored', function (assert) {\n        assert.equal(moment([2010, 0, 1, 23]).diff([2010], 'day'), 0, '23 hours = 0 days');\n        assert.equal(moment([2010, 0, 1, 23, 59]).diff([2010], 'day'), 0, '23:59 hours = 0 days');\n        assert.equal(moment([2010, 0, 1, 24]).diff([2010], 'day'), 1, '24 hours = 1 day');\n        assert.equal(moment([2010, 0, 2]).diff([2011, 0, 1], 'year'), 0, 'year rounded down');\n        assert.equal(moment([2011, 0, 1]).diff([2010, 0, 2], 'year'), 0, 'year rounded down');\n        assert.equal(moment([2010, 0, 2]).diff([2011, 0, 2], 'year'), -1, 'year rounded down');\n        assert.equal(moment([2011, 0, 2]).diff([2010, 0, 2], 'year'), 1, 'year rounded down');\n    });\n\n    test('year diffs include dates', function (assert) {\n        assert.ok(moment([2012, 1, 19]).diff(moment([2002, 1, 20]), 'years', true) < 10, 'year diff should include date of month');\n    });\n\n    test('month diffs', function (assert) {\n        // due to floating point math errors, these tests just need to be accurate within 0.00000001\n        assert.equal(moment([2012, 0, 1]).diff([2012, 1, 1], 'months', true), -1, 'Jan 1 to Feb 1 should be 1 month');\n        equal(assert, moment([2012, 0, 1]).diff([2012, 0, 1, 12], 'months', true), -0.5 / 31, 'Jan 1 to Jan 1 noon should be 0.5 / 31 months');\n        assert.equal(moment([2012, 0, 15]).diff([2012, 1, 15], 'months', true), -1, 'Jan 15 to Feb 15 should be 1 month');\n        assert.equal(moment([2012, 0, 28]).diff([2012, 1, 28], 'months', true), -1, 'Jan 28 to Feb 28 should be 1 month');\n        assert.ok(moment([2012, 0, 31]).diff([2012, 1, 29], 'months', true), -1, 'Jan 31 to Feb 29 should be 1 month');\n        assert.ok(-1 > moment([2012, 0, 31]).diff([2012, 2, 1], 'months', true), 'Jan 31 to Mar 1 should be more than 1 month');\n        assert.ok(-30 / 28 < moment([2012, 0, 31]).diff([2012, 2, 1], 'months', true), 'Jan 31 to Mar 1 should be less than 1 month and 1 day');\n        equal(assert, moment([2012, 0, 1]).diff([2012, 0, 31], 'months', true), -(30 / 31), 'Jan 1 to Jan 31 should be 30 / 31 months');\n        assert.ok(0 < moment('2014-02-01').diff(moment('2014-01-31'), 'months', true), 'jan-31 to feb-1 diff is positive');\n    });\n\n    test('exact month diffs', function (assert) {\n        // generate all pairs of months and compute month diff, with fixed day\n        // of month = 15.\n\n        var m1, m2;\n        for (m1 = 0; m1 < 12; ++m1) {\n            for (m2 = m1; m2 < 12; ++m2) {\n                assert.equal(moment([2013, m2, 15]).diff(moment([2013, m1, 15]), 'months', true), m2 - m1,\n                             'month diff from 2013-' + m1 + '-15 to 2013-' + m2 + '-15');\n            }\n        }\n    });\n\n    test('year diffs', function (assert) {\n        // due to floating point math errors, these tests just need to be accurate within 0.00000001\n        equal(assert, moment([2012, 0, 1]).diff([2013, 0, 1], 'years', true), -1, 'Jan 1 2012 to Jan 1 2013 should be 1 year');\n        equal(assert, moment([2012, 1, 28]).diff([2013, 1, 28], 'years', true), -1, 'Feb 28 2012 to Feb 28 2013 should be 1 year');\n        equal(assert, moment([2012, 2, 1]).diff([2013, 2, 1], 'years', true), -1, 'Mar 1 2012 to Mar 1 2013 should be 1 year');\n        equal(assert, moment([2012, 11, 1]).diff([2013, 11, 1], 'years', true), -1, 'Dec 1 2012 to Dec 1 2013 should be 1 year');\n        equal(assert, moment([2012, 11, 31]).diff([2013, 11, 31], 'years', true), -1, 'Dec 31 2012 to Dec 31 2013 should be 1 year');\n        equal(assert, moment([2012, 0, 1]).diff([2013, 6, 1], 'years', true), -1.5, 'Jan 1 2012 to Jul 1 2013 should be 1.5 years');\n        equal(assert, moment([2012, 0, 31]).diff([2013, 6, 31], 'years', true), -1.5, 'Jan 31 2012 to Jul 31 2013 should be 1.5 years');\n        equal(assert, moment([2012, 0, 1]).diff([2013, 0, 1, 12], 'years', true), -1 - (0.5 / 31) / 12, 'Jan 1 2012 to Jan 1 2013 noon should be 1+(0.5 / 31) / 12 years');\n        equal(assert, moment([2012, 0, 1]).diff([2013, 6, 1, 12], 'years', true), -1.5 - (0.5 / 31) / 12, 'Jan 1 2012 to Jul 1 2013 noon should be 1.5+(0.5 / 31) / 12 years');\n        equal(assert, moment([2012, 1, 29]).diff([2013, 1, 28], 'years', true), -1, 'Feb 29 2012 to Feb 28 2013 should be 1-(1 / 28.5) / 12 years');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('duration');\n\n    test('object instantiation', function (assert) {\n        var d = moment.duration({\n            years: 2,\n            months: 3,\n            weeks: 2,\n            days: 1,\n            hours: 8,\n            minutes: 9,\n            seconds: 20,\n            milliseconds: 12\n        });\n\n        assert.equal(d.years(),        2,  'years');\n        assert.equal(d.months(),       3,  'months');\n        assert.equal(d.weeks(),        2,  'weeks');\n        assert.equal(d.days(),         15, 'days'); // two weeks + 1 day\n        assert.equal(d.hours(),        8,  'hours');\n        assert.equal(d.minutes(),      9,  'minutes');\n        assert.equal(d.seconds(),      20, 'seconds');\n        assert.equal(d.milliseconds(), 12, 'milliseconds');\n    });\n\n    test('object instantiation with strings', function (assert) {\n        var d = moment.duration({\n            years: '2',\n            months: '3',\n            weeks: '2',\n            days: '1',\n            hours: '8',\n            minutes: '9',\n            seconds: '20',\n            milliseconds: '12'\n        });\n\n        assert.equal(d.years(),        2,  'years');\n        assert.equal(d.months(),       3,  'months');\n        assert.equal(d.weeks(),        2,  'weeks');\n        assert.equal(d.days(),         15, 'days'); // two weeks + 1 day\n        assert.equal(d.hours(),        8,  'hours');\n        assert.equal(d.minutes(),      9,  'minutes');\n        assert.equal(d.seconds(),      20, 'seconds');\n        assert.equal(d.milliseconds(), 12, 'milliseconds');\n    });\n\n    test('milliseconds instantiation', function (assert) {\n        assert.equal(moment.duration(72).milliseconds(), 72, 'milliseconds');\n    });\n\n    test('undefined instantiation', function (assert) {\n        assert.equal(moment.duration(undefined).milliseconds(), 0, 'milliseconds');\n    });\n\n    test('null instantiation', function (assert) {\n        assert.equal(moment.duration(null).milliseconds(), 0, 'milliseconds');\n    });\n\n    test('instantiation by type', function (assert) {\n        assert.equal(moment.duration(1, 'years').years(),                 1, 'years');\n        assert.equal(moment.duration(1, 'y').years(),                     1, 'y');\n        assert.equal(moment.duration(2, 'months').months(),               2, 'months');\n        assert.equal(moment.duration(2, 'M').months(),                    2, 'M');\n        assert.equal(moment.duration(3, 'weeks').weeks(),                 3, 'weeks');\n        assert.equal(moment.duration(3, 'w').weeks(),                     3, 'weeks');\n        assert.equal(moment.duration(4, 'days').days(),                   4, 'days');\n        assert.equal(moment.duration(4, 'd').days(),                      4, 'd');\n        assert.equal(moment.duration(5, 'hours').hours(),                 5, 'hours');\n        assert.equal(moment.duration(5, 'h').hours(),                     5, 'h');\n        assert.equal(moment.duration(6, 'minutes').minutes(),             6, 'minutes');\n        assert.equal(moment.duration(6, 'm').minutes(),                   6, 'm');\n        assert.equal(moment.duration(7, 'seconds').seconds(),             7, 'seconds');\n        assert.equal(moment.duration(7, 's').seconds(),                   7, 's');\n        assert.equal(moment.duration(8, 'milliseconds').milliseconds(),   8, 'milliseconds');\n        assert.equal(moment.duration(8, 'ms').milliseconds(),             8, 'ms');\n    });\n\n    test('shortcuts', function (assert) {\n        assert.equal(moment.duration({y: 1}).years(),         1, 'years = y');\n        assert.equal(moment.duration({M: 2}).months(),        2, 'months = M');\n        assert.equal(moment.duration({w: 3}).weeks(),         3, 'weeks = w');\n        assert.equal(moment.duration({d: 4}).days(),          4, 'days = d');\n        assert.equal(moment.duration({h: 5}).hours(),         5, 'hours = h');\n        assert.equal(moment.duration({m: 6}).minutes(),       6, 'minutes = m');\n        assert.equal(moment.duration({s: 7}).seconds(),       7, 'seconds = s');\n        assert.equal(moment.duration({ms: 8}).milliseconds(), 8, 'milliseconds = ms');\n    });\n\n    test('generic getter', function (assert) {\n        assert.equal(moment.duration(1, 'years').get('years'),                1, 'years');\n        assert.equal(moment.duration(1, 'years').get('year'),                 1, 'years = year');\n        assert.equal(moment.duration(1, 'years').get('y'),                    1, 'years = y');\n        assert.equal(moment.duration(2, 'months').get('months'),              2, 'months');\n        assert.equal(moment.duration(2, 'months').get('month'),               2, 'months = month');\n        assert.equal(moment.duration(2, 'months').get('M'),                   2, 'months = M');\n        assert.equal(moment.duration(3, 'weeks').get('weeks'),                3, 'weeks');\n        assert.equal(moment.duration(3, 'weeks').get('week'),                 3, 'weeks = week');\n        assert.equal(moment.duration(3, 'weeks').get('w'),                    3, 'weeks = w');\n        assert.equal(moment.duration(4, 'days').get('days'),                  4, 'days');\n        assert.equal(moment.duration(4, 'days').get('day'),                   4, 'days = day');\n        assert.equal(moment.duration(4, 'days').get('d'),                     4, 'days = d');\n        assert.equal(moment.duration(5, 'hours').get('hours'),                5, 'hours');\n        assert.equal(moment.duration(5, 'hours').get('hour'),                 5, 'hours = hour');\n        assert.equal(moment.duration(5, 'hours').get('h'),                    5, 'hours = h');\n        assert.equal(moment.duration(6, 'minutes').get('minutes'),            6, 'minutes');\n        assert.equal(moment.duration(6, 'minutes').get('minute'),             6, 'minutes = minute');\n        assert.equal(moment.duration(6, 'minutes').get('m'),                  6, 'minutes = m');\n        assert.equal(moment.duration(7, 'seconds').get('seconds'),            7, 'seconds');\n        assert.equal(moment.duration(7, 'seconds').get('second'),             7, 'seconds = second');\n        assert.equal(moment.duration(7, 'seconds').get('s'),                  7, 'seconds = s');\n        assert.equal(moment.duration(8, 'milliseconds').get('milliseconds'),  8, 'milliseconds');\n        assert.equal(moment.duration(8, 'milliseconds').get('millisecond'),   8, 'milliseconds = millisecond');\n        assert.equal(moment.duration(8, 'milliseconds').get('ms'),            8, 'milliseconds = ms');\n    });\n\n    test('instantiation from another duration', function (assert) {\n        var simple = moment.duration(1234),\n            lengthy = moment.duration(60 * 60 * 24 * 360 * 1e3),\n            complicated = moment.duration({\n                years: 2,\n                months: 3,\n                weeks: 4,\n                days: 1,\n                hours: 8,\n                minutes: 9,\n                seconds: 20,\n                milliseconds: 12\n            }),\n            modified = moment.duration(1, 'day').add(moment.duration(1, 'day'));\n\n        assert.deepEqual(moment.duration(simple), simple, 'simple clones are equal');\n        assert.deepEqual(moment.duration(lengthy), lengthy, 'lengthy clones are equal');\n        assert.deepEqual(moment.duration(complicated), complicated, 'complicated clones are equal');\n        assert.deepEqual(moment.duration(modified), modified, 'cloning modified duration works');\n    });\n\n    test('instantiation from 24-hour time zero', function (assert) {\n        assert.equal(moment.duration('00:00').years(), 0, '0 years');\n        assert.equal(moment.duration('00:00').days(), 0, '0 days');\n        assert.equal(moment.duration('00:00').hours(), 0, '0 hours');\n        assert.equal(moment.duration('00:00').minutes(), 0, '0 minutes');\n        assert.equal(moment.duration('00:00').seconds(), 0, '0 seconds');\n        assert.equal(moment.duration('00:00').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instantiation from 24-hour time <24 hours', function (assert) {\n        assert.equal(moment.duration('06:45').years(), 0, '0 years');\n        assert.equal(moment.duration('06:45').days(), 0, '0 days');\n        assert.equal(moment.duration('06:45').hours(), 6, '6 hours');\n        assert.equal(moment.duration('06:45').minutes(), 45, '45 minutes');\n        assert.equal(moment.duration('06:45').seconds(), 0, '0 seconds');\n        assert.equal(moment.duration('06:45').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instantiation from 24-hour time >24 hours', function (assert) {\n        assert.equal(moment.duration('26:45').years(), 0, '0 years');\n        assert.equal(moment.duration('26:45').days(), 1, '0 days');\n        assert.equal(moment.duration('26:45').hours(), 2, '2 hours');\n        assert.equal(moment.duration('26:45').minutes(), 45, '45 minutes');\n        assert.equal(moment.duration('26:45').seconds(), 0, '0 seconds');\n        assert.equal(moment.duration('26:45').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan zero', function (assert) {\n        assert.equal(moment.duration('00:00:00').years(), 0, '0 years');\n        assert.equal(moment.duration('00:00:00').days(), 0, '0 days');\n        assert.equal(moment.duration('00:00:00').hours(), 0, '0 hours');\n        assert.equal(moment.duration('00:00:00').minutes(), 0, '0 minutes');\n        assert.equal(moment.duration('00:00:00').seconds(), 0, '0 seconds');\n        assert.equal(moment.duration('00:00:00').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan with days', function (assert) {\n        assert.equal(moment.duration('1.02:03:04.9999999').years(), 0, '0 years');\n        assert.equal(moment.duration('1.02:03:04.9999999').days(), 1, '1 day');\n        assert.equal(moment.duration('1.02:03:04.9999999').hours(), 2, '2 hours');\n        assert.equal(moment.duration('1.02:03:04.9999999').minutes(), 3, '3 minutes');\n        assert.equal(moment.duration('1.02:03:04.9999999').seconds(), 4, '4 seconds');\n        assert.equal(moment.duration('1.02:03:04.9999999').milliseconds(), 999, '999 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan without days', function (assert) {\n        assert.equal(moment.duration('01:02:03.9999999').years(), 0, '0 years');\n        assert.equal(moment.duration('01:02:03.9999999').days(), 0, '0 days');\n        assert.equal(moment.duration('01:02:03.9999999').hours(), 1, '1 hour');\n        assert.equal(moment.duration('01:02:03.9999999').minutes(), 2, '2 minutes');\n        assert.equal(moment.duration('01:02:03.9999999').seconds(), 3, '3 seconds');\n        assert.equal(moment.duration('01:02:03.9999999').milliseconds(), 999, '999 milliseconds');\n\n        assert.equal(moment.duration('23:59:59.9999999').days(), 0, '0 days');\n        assert.equal(moment.duration('23:59:59.9999999').hours(), 23, '23 hours');\n\n        assert.equal(moment.duration('500:59:59.9999999').days(), 20, '500 hours overflows to 20 days');\n        assert.equal(moment.duration('500:59:59.9999999').hours(), 20, '500 hours overflows to 20 hours');\n    });\n\n    test('instatiation from serialized C# TimeSpan without days or milliseconds', function (assert) {\n        assert.equal(moment.duration('01:02:03').years(), 0, '0 years');\n        assert.equal(moment.duration('01:02:03').days(), 0, '0 days');\n        assert.equal(moment.duration('01:02:03').hours(), 1, '1 hour');\n        assert.equal(moment.duration('01:02:03').minutes(), 2, '2 minutes');\n        assert.equal(moment.duration('01:02:03').seconds(), 3, '3 seconds');\n        assert.equal(moment.duration('01:02:03').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan without milliseconds', function (assert) {\n        assert.equal(moment.duration('1.02:03:04').years(), 0, '0 years');\n        assert.equal(moment.duration('1.02:03:04').days(), 1, '1 day');\n        assert.equal(moment.duration('1.02:03:04').hours(), 2, '2 hours');\n        assert.equal(moment.duration('1.02:03:04').minutes(), 3, '3 minutes');\n        assert.equal(moment.duration('1.02:03:04').seconds(), 4, '4 seconds');\n        assert.equal(moment.duration('1.02:03:04').milliseconds(), 0, '0 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan maxValue', function (assert) {\n        var d = moment.duration('10675199.02:48:05.4775807');\n\n        assert.equal(d.years(), 29227, '29227 years');\n        assert.equal(d.months(), 8, '8 months');\n        assert.equal(d.days(), 17, '17 day');  // this should be 13\n\n        assert.equal(d.hours(), 2, '2 hours');\n        assert.equal(d.minutes(), 48, '48 minutes');\n        assert.equal(d.seconds(), 5, '5 seconds');\n        assert.equal(d.milliseconds(), 477, '477 milliseconds');\n    });\n\n    test('instatiation from serialized C# TimeSpan minValue', function (assert) {\n        var d = moment.duration('-10675199.02:48:05.4775808');\n\n        assert.equal(d.years(), -29227, '29653 years');\n        assert.equal(d.months(), -8, '8 day');\n        assert.equal(d.days(), -17, '17 day'); // this should be 13\n\n        assert.equal(d.hours(), -2, '2 hours');\n        assert.equal(d.minutes(), -48, '48 minutes');\n        assert.equal(d.seconds(), -5, '5 seconds');\n        assert.equal(d.milliseconds(), -477, '477 milliseconds');\n    });\n\n    test('instantiation from ISO 8601 duration', function (assert) {\n        assert.equal(moment.duration('P1Y2M3DT4H5M6S').asSeconds(), moment.duration({y: 1, M: 2, d: 3, h: 4, m: 5, s: 6}).asSeconds(), 'all fields');\n        assert.equal(moment.duration('P1M').asSeconds(), moment.duration({M: 1}).asSeconds(), 'single month field');\n        assert.equal(moment.duration('PT1M').asSeconds(), moment.duration({m: 1}).asSeconds(), 'single minute field');\n        assert.equal(moment.duration('P1MT2H').asSeconds(), moment.duration({M: 1, h: 2}).asSeconds(), 'random fields missing');\n        assert.equal(moment.duration('-P60D').asSeconds(), moment.duration({d: -60}).asSeconds(), 'negative days');\n        assert.equal(moment.duration('PT0.5S').asSeconds(), moment.duration({s: 0.5}).asSeconds(), 'fractional seconds');\n        assert.equal(moment.duration('PT0,5S').asSeconds(), moment.duration({s: 0.5}).asSeconds(), 'fractional seconds (comma)');\n    });\n\n    test('serialization to ISO 8601 duration strings', function (assert) {\n        assert.equal(moment.duration({y: 1, M: 2, d: 3, h: 4, m: 5, s: 6}).toISOString(), 'P1Y2M3DT4H5M6S', 'all fields');\n        assert.equal(moment.duration({M: -1}).toISOString(), '-P1M', 'one month ago');\n        assert.equal(moment.duration({m: -1}).toISOString(), '-PT1M', 'one minute ago');\n        assert.equal(moment.duration({s: -0.5}).toISOString(), '-PT0.5S', 'one half second ago');\n        assert.equal(moment.duration({y: -0.5, M: 1}).toISOString(), '-P5M', 'a month after half a year ago');\n        assert.equal(moment.duration({}).toISOString(), 'P0D', 'zero duration');\n    });\n\n    test('toString acts as toISOString', function (assert) {\n        assert.equal(moment.duration({y: 1, M: 2, d: 3, h: 4, m: 5, s: 6}).toString(), 'P1Y2M3DT4H5M6S', 'all fields');\n        assert.equal(moment.duration({M: -1}).toString(), '-P1M', 'one month ago');\n        assert.equal(moment.duration({m: -1}).toString(), '-PT1M', 'one minute ago');\n        assert.equal(moment.duration({s: -0.5}).toString(), '-PT0.5S', 'one half second ago');\n        assert.equal(moment.duration({y: -0.5, M: 1}).toString(), '-P5M', 'a month after half a year ago');\n        assert.equal(moment.duration({}).toString(), 'P0D', 'zero duration');\n    });\n\n    test('toIsoString deprecation', function (assert) {\n        assert.equal(moment.duration({}).toIsoString(), moment.duration({}).toISOString(), 'toIsoString delegates to toISOString');\n    });\n\n    test('`isodate` (python) test cases', function (assert) {\n        assert.equal(moment.duration('P18Y9M4DT11H9M8S').asSeconds(), moment.duration({y: 18, M: 9, d: 4, h: 11, m: 9, s: 8}).asSeconds(), 'python isodate 1');\n        assert.equal(moment.duration('P2W').asSeconds(), moment.duration({w: 2}).asSeconds(), 'python isodate 2');\n        assert.equal(moment.duration('P3Y6M4DT12H30M5S').asSeconds(), moment.duration({y: 3, M: 6, d: 4, h: 12, m: 30, s: 5}).asSeconds(), 'python isodate 3');\n        assert.equal(moment.duration('P23DT23H').asSeconds(), moment.duration({d: 23, h: 23}).asSeconds(), 'python isodate 4');\n        assert.equal(moment.duration('P4Y').asSeconds(), moment.duration({y: 4}).asSeconds(), 'python isodate 5');\n        assert.equal(moment.duration('P1M').asSeconds(), moment.duration({M: 1}).asSeconds(), 'python isodate 6');\n        assert.equal(moment.duration('PT1M').asSeconds(), moment.duration({m: 1}).asSeconds(), 'python isodate 7');\n        assert.equal(moment.duration('P0.5Y').asSeconds(), moment.duration({y: 0.5}).asSeconds(), 'python isodate 8');\n        assert.equal(moment.duration('PT36H').asSeconds(), moment.duration({h: 36}).asSeconds(), 'python isodate 9');\n        assert.equal(moment.duration('P1DT12H').asSeconds(), moment.duration({d: 1, h: 12}).asSeconds(), 'python isodate 10');\n        assert.equal(moment.duration('-P2W').asSeconds(), moment.duration({w: -2}).asSeconds(), 'python isodate 11');\n        assert.equal(moment.duration('-P2.2W').asSeconds(), moment.duration({w: -2.2}).asSeconds(), 'python isodate 12');\n        assert.equal(moment.duration('P1DT2H3M4S').asSeconds(), moment.duration({d: 1, h: 2, m: 3, s: 4}).asSeconds(), 'python isodate 13');\n        assert.equal(moment.duration('P1DT2H3M').asSeconds(), moment.duration({d: 1, h: 2, m: 3}).asSeconds(), 'python isodate 14');\n        assert.equal(moment.duration('P1DT2H').asSeconds(), moment.duration({d: 1, h: 2}).asSeconds(), 'python isodate 15');\n        assert.equal(moment.duration('PT2H').asSeconds(), moment.duration({h: 2}).asSeconds(), 'python isodate 16');\n        assert.equal(moment.duration('PT2.3H').asSeconds(), moment.duration({h: 2.3}).asSeconds(), 'python isodate 17');\n        assert.equal(moment.duration('PT2H3M4S').asSeconds(), moment.duration({h: 2, m: 3, s: 4}).asSeconds(), 'python isodate 18');\n        assert.equal(moment.duration('PT3M4S').asSeconds(), moment.duration({m: 3, s: 4}).asSeconds(), 'python isodate 19');\n        assert.equal(moment.duration('PT22S').asSeconds(), moment.duration({s: 22}).asSeconds(), 'python isodate 20');\n        assert.equal(moment.duration('PT22.22S').asSeconds(), moment.duration({s: 22.22}).asSeconds(), 'python isodate 21');\n        assert.equal(moment.duration('-P2Y').asSeconds(), moment.duration({y: -2}).asSeconds(), 'python isodate 22');\n        assert.equal(moment.duration('-P3Y6M4DT12H30M5S').asSeconds(), moment.duration({y: -3, M: -6, d: -4, h: -12, m: -30, s: -5}).asSeconds(), 'python isodate 23');\n        assert.equal(moment.duration('-P1DT2H3M4S').asSeconds(), moment.duration({d: -1, h: -2, m: -3, s: -4}).asSeconds(), 'python isodate 24');\n    });\n\n    test('ISO 8601 misuse cases', function (assert) {\n        assert.equal(moment.duration('P').asSeconds(), 0, 'lonely P');\n        assert.equal(moment.duration('PT').asSeconds(), 0, 'just P and T');\n        assert.equal(moment.duration('P1H').asSeconds(), 0, 'missing T');\n        assert.equal(moment.duration('P1D1Y').asSeconds(), 0, 'out of order');\n        assert.equal(moment.duration('PT.5S').asSeconds(), 0.5, 'accept no leading zero for decimal');\n        assert.equal(moment.duration('PT1,S').asSeconds(), 1, 'accept trailing decimal separator');\n        assert.equal(moment.duration('PT1M0,,5S').asSeconds(), 60, 'extra decimal separators are ignored as 0');\n        assert.equal(moment.duration('P-1DS').asSeconds(), 0, 'wrong position of negative');\n    });\n\n    test('humanize', function (assert) {\n        moment.locale('en');\n        assert.equal(moment.duration({seconds: 44}).humanize(),  'a few seconds', '44 seconds = a few seconds');\n        assert.equal(moment.duration({seconds: 45}).humanize(),  'a minute',      '45 seconds = a minute');\n        assert.equal(moment.duration({seconds: 89}).humanize(),  'a minute',      '89 seconds = a minute');\n        assert.equal(moment.duration({seconds: 90}).humanize(),  '2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(moment.duration({minutes: 44}).humanize(),  '44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(moment.duration({minutes: 45}).humanize(),  'an hour',       '45 minutes = an hour');\n        assert.equal(moment.duration({minutes: 89}).humanize(),  'an hour',       '89 minutes = an hour');\n        assert.equal(moment.duration({minutes: 90}).humanize(),  '2 hours',       '90 minutes = 2 hours');\n        assert.equal(moment.duration({hours: 5}).humanize(),     '5 hours',       '5 hours = 5 hours');\n        assert.equal(moment.duration({hours: 21}).humanize(),    '21 hours',      '21 hours = 21 hours');\n        assert.equal(moment.duration({hours: 22}).humanize(),    'a day',         '22 hours = a day');\n        assert.equal(moment.duration({hours: 35}).humanize(),    'a day',         '35 hours = a day');\n        assert.equal(moment.duration({hours: 36}).humanize(),    '2 days',        '36 hours = 2 days');\n        assert.equal(moment.duration({days: 1}).humanize(),      'a day',         '1 day = a day');\n        assert.equal(moment.duration({days: 5}).humanize(),      '5 days',        '5 days = 5 days');\n        assert.equal(moment.duration({weeks: 1}).humanize(),     '7 days',        '1 week = 7 days');\n        assert.equal(moment.duration({days: 25}).humanize(),     '25 days',       '25 days = 25 days');\n        assert.equal(moment.duration({days: 26}).humanize(),     'a month',       '26 days = a month');\n        assert.equal(moment.duration({days: 30}).humanize(),     'a month',       '30 days = a month');\n        assert.equal(moment.duration({days: 45}).humanize(),     'a month',       '45 days = a month');\n        assert.equal(moment.duration({days: 46}).humanize(),     '2 months',      '46 days = 2 months');\n        assert.equal(moment.duration({days: 74}).humanize(),     '2 months',      '74 days = 2 months');\n        assert.equal(moment.duration({days: 77}).humanize(),     '3 months',      '77 days = 3 months');\n        assert.equal(moment.duration({months: 1}).humanize(),    'a month',       '1 month = a month');\n        assert.equal(moment.duration({months: 5}).humanize(),    '5 months',      '5 months = 5 months');\n        assert.equal(moment.duration({days: 344}).humanize(),    'a year',        '344 days = a year');\n        assert.equal(moment.duration({days: 345}).humanize(),    'a year',        '345 days = a year');\n        assert.equal(moment.duration({days: 547}).humanize(),    'a year',        '547 days = a year');\n        assert.equal(moment.duration({days: 548}).humanize(),    '2 years',       '548 days = 2 years');\n        assert.equal(moment.duration({years: 1}).humanize(),     'a year',        '1 year = a year');\n        assert.equal(moment.duration({years: 5}).humanize(),     '5 years',       '5 years = 5 years');\n        assert.equal(moment.duration(7200000).humanize(),        '2 hours',       '7200000 = 2 minutes');\n    });\n\n    test('humanize duration with suffix', function (assert) {\n        moment.locale('en');\n        assert.equal(moment.duration({seconds:  44}).humanize(true),  'in a few seconds', '44 seconds = a few seconds');\n        assert.equal(moment.duration({seconds: -44}).humanize(true),  'a few seconds ago', '44 seconds = a few seconds');\n    });\n\n    test('bubble value up', function (assert) {\n        assert.equal(moment.duration({milliseconds: 61001}).milliseconds(), 1, '61001 milliseconds has 1 millisecond left over');\n        assert.equal(moment.duration({milliseconds: 61001}).seconds(),      1, '61001 milliseconds has 1 second left over');\n        assert.equal(moment.duration({milliseconds: 61001}).minutes(),      1, '61001 milliseconds has 1 minute left over');\n\n        assert.equal(moment.duration({minutes: 350}).minutes(), 50, '350 minutes has 50 minutes left over');\n        assert.equal(moment.duration({minutes: 350}).hours(),   5,  '350 minutes has 5 hours left over');\n    });\n\n    test('clipping', function (assert) {\n        assert.equal(moment.duration({months: 11}).months(), 11, '11 months is 11 months');\n        assert.equal(moment.duration({months: 11}).years(),  0,  '11 months makes no year');\n        assert.equal(moment.duration({months: 12}).months(), 0,  '12 months is 0 months left over');\n        assert.equal(moment.duration({months: 12}).years(),  1,  '12 months makes 1 year');\n        assert.equal(moment.duration({months: 13}).months(), 1,  '13 months is 1 month left over');\n        assert.equal(moment.duration({months: 13}).years(),  1,  '13 months makes 1 year');\n\n        assert.equal(moment.duration({days: 29}).days(),   29, '29 days is 29 days');\n        assert.equal(moment.duration({days: 29}).months(), 0,  '29 days makes no month');\n        assert.equal(moment.duration({days: 30}).days(),   0,  '30 days is 0 days left over');\n        assert.equal(moment.duration({days: 30}).months(), 1,  '30 days is a month');\n        assert.equal(moment.duration({days: 31}).days(),   1,  '31 days is 1 day left over');\n        assert.equal(moment.duration({days: 31}).months(), 1,  '31 days is a month');\n\n        assert.equal(moment.duration({hours: 23}).hours(), 23, '23 hours is 23 hours');\n        assert.equal(moment.duration({hours: 23}).days(),  0,  '23 hours makes no day');\n        assert.equal(moment.duration({hours: 24}).hours(), 0,  '24 hours is 0 hours left over');\n        assert.equal(moment.duration({hours: 24}).days(),  1,  '24 hours makes 1 day');\n        assert.equal(moment.duration({hours: 25}).hours(), 1,  '25 hours is 1 hour left over');\n        assert.equal(moment.duration({hours: 25}).days(),  1,  '25 hours makes 1 day');\n    });\n\n    test('effective equivalency', function (assert) {\n        assert.deepEqual(moment.duration({seconds: 1})._data,  moment.duration({milliseconds: 1000})._data, '1 second is the same as 1000 milliseconds');\n        assert.deepEqual(moment.duration({seconds: 60})._data, moment.duration({minutes: 1})._data,         '1 minute is the same as 60 seconds');\n        assert.deepEqual(moment.duration({minutes: 60})._data, moment.duration({hours: 1})._data,           '1 hour is the same as 60 minutes');\n        assert.deepEqual(moment.duration({hours: 24})._data,   moment.duration({days: 1})._data,            '1 day is the same as 24 hours');\n        assert.deepEqual(moment.duration({days: 7})._data,     moment.duration({weeks: 1})._data,           '1 week is the same as 7 days');\n        assert.deepEqual(moment.duration({days: 30})._data,    moment.duration({months: 1})._data,          '1 month is the same as 30 days');\n        assert.deepEqual(moment.duration({months: 12})._data,  moment.duration({years: 1})._data,           '1 years is the same as 12 months');\n    });\n\n    test('asGetters', function (assert) {\n        // 400 years have exactly 146097 days\n\n        // years\n        assert.equal(moment.duration(1, 'year').asYears(),            1,           '1 year as years');\n        assert.equal(moment.duration(1, 'year').asMonths(),           12,          '1 year as months');\n        assert.equal(moment.duration(400, 'year').asMonths(),         4800,        '400 years as months');\n        assert.equal(moment.duration(1, 'year').asWeeks().toFixed(3), 52.143,      '1 year as weeks');\n        assert.equal(moment.duration(1, 'year').asDays(),             365,         '1 year as days');\n        assert.equal(moment.duration(2, 'year').asDays(),             730,         '2 years as days');\n        assert.equal(moment.duration(3, 'year').asDays(),             1096,        '3 years as days');\n        assert.equal(moment.duration(4, 'year').asDays(),             1461,        '4 years as days');\n        assert.equal(moment.duration(400, 'year').asDays(),           146097,      '400 years as days');\n        assert.equal(moment.duration(1, 'year').asHours(),            8760,        '1 year as hours');\n        assert.equal(moment.duration(1, 'year').asMinutes(),          525600,      '1 year as minutes');\n        assert.equal(moment.duration(1, 'year').asSeconds(),          31536000,    '1 year as seconds');\n        assert.equal(moment.duration(1, 'year').asMilliseconds(),     31536000000, '1 year as milliseconds');\n\n        // months\n        assert.equal(moment.duration(1, 'month').asYears().toFixed(4), 0.0833,     '1 month as years');\n        assert.equal(moment.duration(1, 'month').asMonths(),           1,          '1 month as months');\n        assert.equal(moment.duration(1, 'month').asWeeks().toFixed(3), 4.286,      '1 month as weeks');\n        assert.equal(moment.duration(1, 'month').asDays(),             30,         '1 month as days');\n        assert.equal(moment.duration(2, 'month').asDays(),             61,         '2 months as days');\n        assert.equal(moment.duration(3, 'month').asDays(),             91,         '3 months as days');\n        assert.equal(moment.duration(4, 'month').asDays(),             122,        '4 months as days');\n        assert.equal(moment.duration(5, 'month').asDays(),             152,        '5 months as days');\n        assert.equal(moment.duration(6, 'month').asDays(),             183,        '6 months as days');\n        assert.equal(moment.duration(7, 'month').asDays(),             213,        '7 months as days');\n        assert.equal(moment.duration(8, 'month').asDays(),             243,        '8 months as days');\n        assert.equal(moment.duration(9, 'month').asDays(),             274,        '9 months as days');\n        assert.equal(moment.duration(10, 'month').asDays(),            304,        '10 months as days');\n        assert.equal(moment.duration(11, 'month').asDays(),            335,        '11 months as days');\n        assert.equal(moment.duration(12, 'month').asDays(),            365,        '12 months as days');\n        assert.equal(moment.duration(24, 'month').asDays(),            730,        '24 months as days');\n        assert.equal(moment.duration(36, 'month').asDays(),            1096,       '36 months as days');\n        assert.equal(moment.duration(48, 'month').asDays(),            1461,       '48 months as days');\n        assert.equal(moment.duration(4800, 'month').asDays(),          146097,     '4800 months as days');\n        assert.equal(moment.duration(1, 'month').asHours(),            720,        '1 month as hours');\n        assert.equal(moment.duration(1, 'month').asMinutes(),          43200,      '1 month as minutes');\n        assert.equal(moment.duration(1, 'month').asSeconds(),          2592000,    '1 month as seconds');\n        assert.equal(moment.duration(1, 'month').asMilliseconds(),     2592000000, '1 month as milliseconds');\n\n        // weeks\n        assert.equal(moment.duration(1, 'week').asYears().toFixed(4),  0.0192,    '1 week as years');\n        assert.equal(moment.duration(1, 'week').asMonths().toFixed(3), 0.230,     '1 week as months');\n        assert.equal(moment.duration(1, 'week').asWeeks(),             1,         '1 week as weeks');\n        assert.equal(moment.duration(1, 'week').asDays(),              7,         '1 week as days');\n        assert.equal(moment.duration(1, 'week').asHours(),             168,       '1 week as hours');\n        assert.equal(moment.duration(1, 'week').asMinutes(),           10080,     '1 week as minutes');\n        assert.equal(moment.duration(1, 'week').asSeconds(),           604800,    '1 week as seconds');\n        assert.equal(moment.duration(1, 'week').asMilliseconds(),      604800000, '1 week as milliseconds');\n\n        // days\n        assert.equal(moment.duration(1, 'day').asYears().toFixed(4),  0.0027,   '1 day as years');\n        assert.equal(moment.duration(1, 'day').asMonths().toFixed(3), 0.033,    '1 day as months');\n        assert.equal(moment.duration(1, 'day').asWeeks().toFixed(3),  0.143,    '1 day as weeks');\n        assert.equal(moment.duration(1, 'day').asDays(),              1,        '1 day as days');\n        assert.equal(moment.duration(1, 'day').asHours(),             24,       '1 day as hours');\n        assert.equal(moment.duration(1, 'day').asMinutes(),           1440,     '1 day as minutes');\n        assert.equal(moment.duration(1, 'day').asSeconds(),           86400,    '1 day as seconds');\n        assert.equal(moment.duration(1, 'day').asMilliseconds(),      86400000, '1 day as milliseconds');\n\n        // hours\n        assert.equal(moment.duration(1, 'hour').asYears().toFixed(6),  0.000114, '1 hour as years');\n        assert.equal(moment.duration(1, 'hour').asMonths().toFixed(5), 0.00137,  '1 hour as months');\n        assert.equal(moment.duration(1, 'hour').asWeeks().toFixed(5),  0.00595,  '1 hour as weeks');\n        assert.equal(moment.duration(1, 'hour').asDays().toFixed(4),   0.0417,   '1 hour as days');\n        assert.equal(moment.duration(1, 'hour').asHours(),             1,        '1 hour as hours');\n        assert.equal(moment.duration(1, 'hour').asMinutes(),           60,       '1 hour as minutes');\n        assert.equal(moment.duration(1, 'hour').asSeconds(),           3600,     '1 hour as seconds');\n        assert.equal(moment.duration(1, 'hour').asMilliseconds(),      3600000,  '1 hour as milliseconds');\n\n        // minutes\n        assert.equal(moment.duration(1, 'minute').asYears().toFixed(8),  0.00000190, '1 minute as years');\n        assert.equal(moment.duration(1, 'minute').asMonths().toFixed(7), 0.0000228,  '1 minute as months');\n        assert.equal(moment.duration(1, 'minute').asWeeks().toFixed(7),  0.0000992,  '1 minute as weeks');\n        assert.equal(moment.duration(1, 'minute').asDays().toFixed(6),   0.000694,   '1 minute as days');\n        assert.equal(moment.duration(1, 'minute').asHours().toFixed(4),  0.0167,     '1 minute as hours');\n        assert.equal(moment.duration(1, 'minute').asMinutes(),           1,          '1 minute as minutes');\n        assert.equal(moment.duration(1, 'minute').asSeconds(),           60,         '1 minute as seconds');\n        assert.equal(moment.duration(1, 'minute').asMilliseconds(),      60000,      '1 minute as milliseconds');\n\n        // seconds\n        assert.equal(moment.duration(1, 'second').asYears().toFixed(10),  0.0000000317, '1 second as years');\n        assert.equal(moment.duration(1, 'second').asMonths().toFixed(9),  0.000000380,  '1 second as months');\n        assert.equal(moment.duration(1, 'second').asWeeks().toFixed(8),   0.00000165,   '1 second as weeks');\n        assert.equal(moment.duration(1, 'second').asDays().toFixed(7),    0.0000116,    '1 second as days');\n        assert.equal(moment.duration(1, 'second').asHours().toFixed(6),   0.000278,     '1 second as hours');\n        assert.equal(moment.duration(1, 'second').asMinutes().toFixed(4), 0.0167,       '1 second as minutes');\n        assert.equal(moment.duration(1, 'second').asSeconds(),            1,            '1 second as seconds');\n        assert.equal(moment.duration(1, 'second').asMilliseconds(),       1000,         '1 second as milliseconds');\n\n        // milliseconds\n        assert.equal(moment.duration(1, 'millisecond').asYears().toFixed(13),  0.0000000000317, '1 millisecond as years');\n        assert.equal(moment.duration(1, 'millisecond').asMonths().toFixed(12), 0.000000000380,  '1 millisecond as months');\n        assert.equal(moment.duration(1, 'millisecond').asWeeks().toFixed(11),  0.00000000165,   '1 millisecond as weeks');\n        assert.equal(moment.duration(1, 'millisecond').asDays().toFixed(10),   0.0000000116,    '1 millisecond as days');\n        assert.equal(moment.duration(1, 'millisecond').asHours().toFixed(9),   0.000000278,     '1 millisecond as hours');\n        assert.equal(moment.duration(1, 'millisecond').asMinutes().toFixed(7), 0.0000167,       '1 millisecond as minutes');\n        assert.equal(moment.duration(1, 'millisecond').asSeconds(),            0.001,           '1 millisecond as seconds');\n        assert.equal(moment.duration(1, 'millisecond').asMilliseconds(),       1,               '1 millisecond as milliseconds');\n    });\n\n    test('as getters for small units', function (assert) {\n        var dS = moment.duration(1, 'milliseconds'),\n            ds = moment.duration(3, 'seconds'),\n            dm = moment.duration(13, 'minutes');\n\n        // Tests for issue #1867.\n        // Floating point errors for small duration units were introduced in version 2.8.0.\n        assert.equal(dS.as('milliseconds'), 1, 'as(\"milliseconds\")');\n        assert.equal(dS.asMilliseconds(),   1, 'asMilliseconds()');\n        assert.equal(ds.as('seconds'),      3, 'as(\"seconds\")');\n        assert.equal(ds.asSeconds(),        3, 'asSeconds()');\n        assert.equal(dm.as('minutes'),      13, 'as(\"minutes\")');\n        assert.equal(dm.asMinutes(),        13, 'asMinutes()');\n    });\n\n    test('isDuration', function (assert) {\n        assert.ok(moment.isDuration(moment.duration(12345678)), 'correctly says true');\n        assert.ok(!moment.isDuration(moment()), 'moment object is not a duration');\n        assert.ok(!moment.isDuration({milliseconds: 1}), 'plain object is not a duration');\n    });\n\n    test('add', function (assert) {\n        var d = moment.duration({months: 4, weeks: 3, days: 2});\n        // for some reason, d._data._months does not get updated; use d._months instead.\n        assert.equal(d.add(1, 'month')._months, 5, 'Add months');\n        assert.equal(d.add(5, 'days')._days, 28, 'Add days');\n        assert.equal(d.add(10000)._milliseconds, 10000, 'Add milliseconds');\n        assert.equal(d.add({h: 23, m: 59})._milliseconds, 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 10000, 'Add hour:minute');\n    });\n\n    test('add and bubble', function (assert) {\n        assert.equal(moment.duration(1, 'second').add(1000, 'milliseconds').seconds(), 2, 'Adding milliseconds should bubble up to seconds');\n        assert.equal(moment.duration(1, 'minute').add(60, 'second').minutes(), 2, 'Adding seconds should bubble up to minutes');\n        assert.equal(moment.duration(1, 'hour').add(60, 'minutes').hours(), 2, 'Adding minutes should bubble up to hours');\n        assert.equal(moment.duration(1, 'day').add(24, 'hours').days(), 2, 'Adding hours should bubble up to days');\n    });\n\n    test('subtract and bubble', function (assert) {\n        assert.equal(moment.duration(2, 'second').subtract(1000, 'milliseconds').seconds(), 1, 'Subtracting milliseconds should bubble up to seconds');\n        assert.equal(moment.duration(2, 'minute').subtract(60, 'second').minutes(), 1, 'Subtracting seconds should bubble up to minutes');\n        assert.equal(moment.duration(2, 'hour').subtract(60, 'minutes').hours(), 1, 'Subtracting minutes should bubble up to hours');\n        assert.equal(moment.duration(2, 'day').subtract(24, 'hours').days(), 1, 'Subtracting hours should bubble up to days');\n    });\n\n    test('subtract', function (assert) {\n        var d = moment.duration({months: 2, weeks: 2, days: 0, hours: 5});\n        // for some reason, d._data._months does not get updated; use d._months instead.\n        assert.equal(d.subtract(1, 'months')._months, 1, 'Subtract months');\n        assert.equal(d.subtract(14, 'days')._days, 0, 'Subtract days');\n        assert.equal(d.subtract(10000)._milliseconds, 5 * 60 * 60 * 1000 - 10000, 'Subtract milliseconds');\n        assert.equal(d.subtract({h: 1, m: 59})._milliseconds, 3 * 60 * 60 * 1000 + 1 * 60 * 1000 - 10000, 'Subtract hour:minute');\n    });\n\n    test('JSON.stringify duration', function (assert) {\n        var d = moment.duration(1024, 'h');\n\n        assert.equal(JSON.stringify(d), '\"' + d.toISOString() + '\"', 'JSON.stringify on duration should return ISO string');\n    });\n\n    test('duration plugins', function (assert) {\n        var durationObject = moment.duration();\n        moment.duration.fn.foo = function (arg) {\n            assert.equal(this, durationObject);\n            assert.equal(arg, 5);\n        };\n        durationObject.foo(5);\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('duration from moments');\n\n    test('pure year diff', function (assert) {\n        var m1 = moment('2012-01-01T00:00:00.000Z'),\n            m2 = moment('2013-01-01T00:00:00.000Z');\n\n        assert.equal(moment.duration({from: m1, to: m2}).as('years'), 1, 'year moment difference');\n        assert.equal(moment.duration({from: m2, to: m1}).as('years'), -1, 'negative year moment difference');\n    });\n\n    test('month and day diff', function (assert) {\n        var m1 = moment('2012-01-15T00:00:00.000Z'),\n            m2 = moment('2012-02-17T00:00:00.000Z'),\n            d = moment.duration({from: m1, to: m2});\n\n        assert.equal(d.get('days'), 2);\n        assert.equal(d.get('months'), 1);\n    });\n\n    test('day diff, separate months', function (assert) {\n        var m1 = moment('2012-01-15T00:00:00.000Z'),\n            m2 = moment('2012-02-13T00:00:00.000Z'),\n            d = moment.duration({from: m1, to: m2});\n\n        assert.equal(d.as('days'), 29);\n    });\n\n    test('hour diff', function (assert) {\n        var m1 = moment('2012-01-15T17:00:00.000Z'),\n            m2 = moment('2012-01-16T03:00:00.000Z'),\n            d = moment.duration({from: m1, to: m2});\n\n        assert.equal(d.as('hours'), 10);\n    });\n\n    test('minute diff', function (assert) {\n        var m1 = moment('2012-01-15T17:45:00.000Z'),\n            m2 = moment('2012-01-16T03:15:00.000Z'),\n            d = moment.duration({from: m1, to: m2});\n\n        assert.equal(d.as('hours'), 9.5);\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('format');\n\n    test('format YY', function (assert) {\n        var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));\n        assert.equal(b.format('YY'), '09', 'YY ---> 09');\n    });\n\n    test('format escape brackets', function (assert) {\n        moment.locale('en');\n\n        var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));\n        assert.equal(b.format('[day]'), 'day', 'Single bracket');\n        assert.equal(b.format('[day] YY [YY]'), 'day 09 YY', 'Double bracket');\n        assert.equal(b.format('[YY'), '[09', 'Un-ended bracket');\n        assert.equal(b.format('[[YY]]'), '[YY]', 'Double nested brackets');\n        assert.equal(b.format('[[]'), '[', 'Escape open bracket');\n        assert.equal(b.format('[Last]'), 'Last', 'localized tokens');\n        assert.equal(b.format('[L] L'), 'L 02/14/2009', 'localized tokens with escaped localized tokens');\n        assert.equal(b.format('[L LL LLL LLLL aLa]'), 'L LL LLL LLLL aLa', 'localized tokens with escaped localized tokens');\n        assert.equal(b.format('[LLL] LLL'), 'LLL February 14, 2009 3:25 PM', 'localized tokens with escaped localized tokens (recursion)');\n        assert.equal(b.format('YYYY[\\n]DD[\\n]'), '2009\\n14\\n', 'Newlines');\n    });\n\n    test('handle negative years', function (assert) {\n        moment.locale('en');\n        assert.equal(moment.utc().year(-1).format('YY'), '-01', 'YY with negative year');\n        assert.equal(moment.utc().year(-1).format('YYYY'), '-0001', 'YYYY with negative year');\n        assert.equal(moment.utc().year(-12).format('YY'), '-12', 'YY with negative year');\n        assert.equal(moment.utc().year(-12).format('YYYY'), '-0012', 'YYYY with negative year');\n        assert.equal(moment.utc().year(-123).format('YY'), '-23', 'YY with negative year');\n        assert.equal(moment.utc().year(-123).format('YYYY'), '-0123', 'YYYY with negative year');\n        assert.equal(moment.utc().year(-1234).format('YY'), '-34', 'YY with negative year');\n        assert.equal(moment.utc().year(-1234).format('YYYY'), '-1234', 'YYYY with negative year');\n        assert.equal(moment.utc().year(-12345).format('YY'), '-45', 'YY with negative year');\n        assert.equal(moment.utc().year(-12345).format('YYYY'), '-12345', 'YYYY with negative year');\n    });\n\n    test('format milliseconds', function (assert) {\n        var b = moment(new Date(2009, 1, 14, 15, 25, 50, 123));\n        assert.equal(b.format('S'), '1', 'Deciseconds');\n        assert.equal(b.format('SS'), '12', 'Centiseconds');\n        assert.equal(b.format('SSS'), '123', 'Milliseconds');\n        b.milliseconds(789);\n        assert.equal(b.format('S'), '7', 'Deciseconds');\n        assert.equal(b.format('SS'), '78', 'Centiseconds');\n        assert.equal(b.format('SSS'), '789', 'Milliseconds');\n    });\n\n    test('format timezone', function (assert) {\n        var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));\n        assert.ok(b.format('Z').match(/^[\\+\\-]\\d\\d:\\d\\d$/), b.format('Z') + ' should be something like \\'+07:30\\'');\n        assert.ok(b.format('ZZ').match(/^[\\+\\-]\\d{4}$/), b.format('ZZ') + ' should be something like \\'+0700\\'');\n    });\n\n    test('format multiple with utc offset', function (assert) {\n        var b = moment('2012-10-08 -1200', ['YYYY-MM-DD HH:mm ZZ', 'YYYY-MM-DD ZZ', 'YYYY-MM-DD']);\n        assert.equal(b.format('YYYY-MM'), '2012-10', 'Parsing multiple formats should not crash with different sized formats');\n    });\n\n    test('isDST', function (assert) {\n        var janOffset = new Date(2011, 0, 1).getTimezoneOffset(),\n            julOffset = new Date(2011, 6, 1).getTimezoneOffset(),\n            janIsDst = janOffset < julOffset,\n            julIsDst = julOffset < janOffset,\n            jan1 = moment([2011]),\n            jul1 = moment([2011, 6]);\n\n        if (janIsDst && julIsDst) {\n            assert.ok(0, 'January and July cannot both be in DST');\n            assert.ok(0, 'January and July cannot both be in DST');\n        } else if (janIsDst) {\n            assert.ok(jan1.isDST(), 'January 1 is DST');\n            assert.ok(!jul1.isDST(), 'July 1 is not DST');\n        } else if (julIsDst) {\n            assert.ok(!jan1.isDST(), 'January 1 is not DST');\n            assert.ok(jul1.isDST(), 'July 1 is DST');\n        } else {\n            assert.ok(!jan1.isDST(), 'January 1 is not DST');\n            assert.ok(!jul1.isDST(), 'July 1 is not DST');\n        }\n    });\n\n    test('unix timestamp', function (assert) {\n        var m = moment('1234567890.123', 'X');\n        assert.equal(m.format('X'), '1234567890', 'unix timestamp without milliseconds');\n        assert.equal(m.format('X.S'), '1234567890.1', 'unix timestamp with deciseconds');\n        assert.equal(m.format('X.SS'), '1234567890.12', 'unix timestamp with centiseconds');\n        assert.equal(m.format('X.SSS'), '1234567890.123', 'unix timestamp with milliseconds');\n\n        m = moment(1234567890.123, 'X');\n        assert.equal(m.format('X'), '1234567890', 'unix timestamp as integer');\n    });\n\n    test('unix offset milliseconds', function (assert) {\n        var m = moment('1234567890123', 'x');\n        assert.equal(m.format('x'), '1234567890123', 'unix offset in milliseconds');\n\n        m = moment(1234567890123, 'x');\n        assert.equal(m.format('x'), '1234567890123', 'unix offset in milliseconds as integer');\n    });\n\n    test('utcOffset sanity checks', function (assert) {\n        assert.equal(moment().utcOffset() % 15, 0,\n                'utc offset should be a multiple of 15 (was ' + moment().utcOffset() + ')');\n\n        assert.equal(moment().utcOffset(), -(new Date()).getTimezoneOffset(),\n            'utcOffset should return the opposite of getTimezoneOffset');\n    });\n\n    test('default format', function (assert) {\n        var isoRegex = /\\d{4}.\\d\\d.\\d\\dT\\d\\d.\\d\\d.\\d\\d[\\+\\-]\\d\\d:\\d\\d/;\n        assert.ok(isoRegex.exec(moment().format()), 'default format (' + moment().format() + ') should match ISO');\n    });\n\n    test('toJSON', function (assert) {\n        var supportsJson = typeof JSON !== 'undefined' && JSON.stringify && JSON.stringify.call,\n            date = moment('2012-10-09T21:30:40.678+0100');\n\n        assert.equal(date.toJSON(), '2012-10-09T20:30:40.678Z', 'should output ISO8601 on moment.fn.toJSON');\n\n        if (supportsJson) {\n            assert.equal(JSON.stringify({\n                date : date\n            }), '{\"date\":\"2012-10-09T20:30:40.678Z\"}', 'should output ISO8601 on JSON.stringify');\n        }\n    });\n\n    test('toISOString', function (assert) {\n        var date = moment.utc('2012-10-09T20:30:40.678');\n\n        assert.equal(date.toISOString(), '2012-10-09T20:30:40.678Z', 'should output ISO8601 on moment.fn.toISOString');\n\n        // big years\n        date = moment.utc('+020123-10-09T20:30:40.678');\n        assert.equal(date.toISOString(), '+020123-10-09T20:30:40.678Z', 'ISO8601 format on big positive year');\n        // negative years\n        date = moment.utc('-000001-10-09T20:30:40.678');\n        assert.equal(date.toISOString(), '-000001-10-09T20:30:40.678Z', 'ISO8601 format on negative year');\n        // big negative years\n        date = moment.utc('-020123-10-09T20:30:40.678');\n        assert.equal(date.toISOString(), '-020123-10-09T20:30:40.678Z', 'ISO8601 format on big negative year');\n    });\n\n    test('long years', function (assert) {\n        assert.equal(moment.utc().year(2).format('YYYYYY'), '+000002', 'small year with YYYYYY');\n        assert.equal(moment.utc().year(2012).format('YYYYYY'), '+002012', 'regular year with YYYYYY');\n        assert.equal(moment.utc().year(20123).format('YYYYYY'), '+020123', 'big year with YYYYYY');\n\n        assert.equal(moment.utc().year(-1).format('YYYYYY'), '-000001', 'small negative year with YYYYYY');\n        assert.equal(moment.utc().year(-2012).format('YYYYYY'), '-002012', 'negative year with YYYYYY');\n        assert.equal(moment.utc().year(-20123).format('YYYYYY'), '-020123', 'big negative year with YYYYYY');\n    });\n\n    test('iso week formats', function (assert) {\n        // http://en.wikipedia.org/wiki/ISO_week_date\n        var cases = {\n            '2005-01-02': '2004-53',\n            '2005-12-31': '2005-52',\n            '2007-01-01': '2007-01',\n            '2007-12-30': '2007-52',\n            '2007-12-31': '2008-01',\n            '2008-01-01': '2008-01',\n            '2008-12-28': '2008-52',\n            '2008-12-29': '2009-01',\n            '2008-12-30': '2009-01',\n            '2008-12-31': '2009-01',\n            '2009-01-01': '2009-01',\n            '2009-12-31': '2009-53',\n            '2010-01-01': '2009-53',\n            '2010-01-02': '2009-53',\n            '2010-01-03': '2009-53',\n            '404-12-31': '0404-53',\n            '405-12-31': '0405-52'\n        }, i, isoWeek, formatted2, formatted1;\n\n        for (i in cases) {\n            isoWeek = cases[i].split('-').pop();\n            formatted2 = moment(i, 'YYYY-MM-DD').format('WW');\n            assert.equal(isoWeek, formatted2, i + ': WW should be ' + isoWeek + ', but ' + formatted2);\n            isoWeek = isoWeek.replace(/^0+/, '');\n            formatted1 = moment(i, 'YYYY-MM-DD').format('W');\n            assert.equal(isoWeek, formatted1, i + ': W should be ' + isoWeek + ', but ' + formatted1);\n        }\n    });\n\n    test('iso week year formats', function (assert) {\n        // http://en.wikipedia.org/wiki/ISO_week_date\n        var cases = {\n            '2005-01-02': '2004-53',\n            '2005-12-31': '2005-52',\n            '2007-01-01': '2007-01',\n            '2007-12-30': '2007-52',\n            '2007-12-31': '2008-01',\n            '2008-01-01': '2008-01',\n            '2008-12-28': '2008-52',\n            '2008-12-29': '2009-01',\n            '2008-12-30': '2009-01',\n            '2008-12-31': '2009-01',\n            '2009-01-01': '2009-01',\n            '2009-12-31': '2009-53',\n            '2010-01-01': '2009-53',\n            '2010-01-02': '2009-53',\n            '2010-01-03': '2009-53',\n            '404-12-31': '0404-53',\n            '405-12-31': '0405-52'\n        }, i, isoWeekYear, formatted5, formatted4, formatted2;\n\n        for (i in cases) {\n            isoWeekYear = cases[i].split('-')[0];\n            formatted5 = moment(i, 'YYYY-MM-DD').format('GGGGG');\n            assert.equal('0' + isoWeekYear, formatted5, i + ': GGGGG should be ' + isoWeekYear + ', but ' + formatted5);\n            formatted4 = moment(i, 'YYYY-MM-DD').format('GGGG');\n            assert.equal(isoWeekYear, formatted4, i + ': GGGG should be ' + isoWeekYear + ', but ' + formatted4);\n            formatted2 = moment(i, 'YYYY-MM-DD').format('GG');\n            assert.equal(isoWeekYear.slice(2, 4), formatted2, i + ': GG should be ' + isoWeekYear + ', but ' + formatted2);\n        }\n    });\n\n    test('week year formats', function (assert) {\n        // http://en.wikipedia.org/wiki/ISO_week_date\n        var cases = {\n            '2005-01-02': '2004-53',\n            '2005-12-31': '2005-52',\n            '2007-01-01': '2007-01',\n            '2007-12-30': '2007-52',\n            '2007-12-31': '2008-01',\n            '2008-01-01': '2008-01',\n            '2008-12-28': '2008-52',\n            '2008-12-29': '2009-01',\n            '2008-12-30': '2009-01',\n            '2008-12-31': '2009-01',\n            '2009-01-01': '2009-01',\n            '2009-12-31': '2009-53',\n            '2010-01-01': '2009-53',\n            '2010-01-02': '2009-53',\n            '2010-01-03': '2009-53',\n            '404-12-31': '0404-53',\n            '405-12-31': '0405-52'\n        }, i, isoWeekYear, formatted5, formatted4, formatted2;\n\n        moment.locale('dow:1,doy:4', {week: {dow: 1, doy: 4}});\n\n        for (i in cases) {\n            isoWeekYear = cases[i].split('-')[0];\n            formatted5 = moment(i, 'YYYY-MM-DD').format('ggggg');\n            assert.equal('0' + isoWeekYear, formatted5, i + ': ggggg should be ' + isoWeekYear + ', but ' + formatted5);\n            formatted4 = moment(i, 'YYYY-MM-DD').format('gggg');\n            assert.equal(isoWeekYear, formatted4, i + ': gggg should be ' + isoWeekYear + ', but ' + formatted4);\n            formatted2 = moment(i, 'YYYY-MM-DD').format('gg');\n            assert.equal(isoWeekYear.slice(2, 4), formatted2, i + ': gg should be ' + isoWeekYear + ', but ' + formatted2);\n        }\n    });\n\n    test('iso weekday formats', function (assert) {\n        assert.equal(moment([1985, 1,  4]).format('E'), '1', 'Feb  4 1985 is Monday    -- 1st day');\n        assert.equal(moment([2029, 8, 18]).format('E'), '2', 'Sep 18 2029 is Tuesday   -- 2nd day');\n        assert.equal(moment([2013, 3, 24]).format('E'), '3', 'Apr 24 2013 is Wednesday -- 3rd day');\n        assert.equal(moment([2015, 2,  5]).format('E'), '4', 'Mar  5 2015 is Thursday  -- 4th day');\n        assert.equal(moment([1970, 0,  2]).format('E'), '5', 'Jan  2 1970 is Friday    -- 5th day');\n        assert.equal(moment([2001, 4, 12]).format('E'), '6', 'May 12 2001 is Saturday  -- 6th day');\n        assert.equal(moment([2000, 0,  2]).format('E'), '7', 'Jan  2 2000 is Sunday    -- 7th day');\n    });\n\n    test('weekday formats', function (assert) {\n        moment.locale('dow: 3,doy: 5', {week: {dow: 3, doy: 5}});\n        assert.equal(moment([1985, 1,  6]).format('e'), '0', 'Feb  6 1985 is Wednesday -- 0th day');\n        assert.equal(moment([2029, 8, 20]).format('e'), '1', 'Sep 20 2029 is Thursday  -- 1st day');\n        assert.equal(moment([2013, 3, 26]).format('e'), '2', 'Apr 26 2013 is Friday    -- 2nd day');\n        assert.equal(moment([2015, 2,  7]).format('e'), '3', 'Mar  7 2015 is Saturday  -- 3nd day');\n        assert.equal(moment([1970, 0,  4]).format('e'), '4', 'Jan  4 1970 is Sunday    -- 4th day');\n        assert.equal(moment([2001, 4, 14]).format('e'), '5', 'May 14 2001 is Monday    -- 5th day');\n        assert.equal(moment([2000, 0,  4]).format('e'), '6', 'Jan  4 2000 is Tuesday   -- 6th day');\n    });\n\n    test('toString is just human readable format', function (assert) {\n        var b = moment(new Date(2009, 1, 5, 15, 25, 50, 125));\n        assert.equal(b.toString(), b.format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'));\n    });\n\n    test('toJSON skips postformat', function (assert) {\n        moment.locale('postformat', {\n            postformat: function (s) {\n                s.replace(/./g, 'X');\n            }\n        });\n        assert.equal(moment.utc([2000, 0, 1]).toJSON(), '2000-01-01T00:00:00.000Z', 'toJSON doesn\\'t postformat');\n        moment.locale('postformat', null);\n    });\n\n    test('calendar day timezone', function (assert) {\n        moment.locale('en');\n        var zones = [60, -60, 90, -90, 360, -360, 720, -720],\n            b = moment().utc().startOf('day').subtract({m : 1}),\n            c = moment().local().startOf('day').subtract({m : 1}),\n            d = moment().local().startOf('day').subtract({d : 2}),\n            i, z, a;\n\n        for (i = 0; i < zones.length; ++i) {\n            z = zones[i];\n            a = moment().utcOffset(z).startOf('day').subtract({m: 1});\n            assert.equal(moment(a).utcOffset(z).calendar(), 'Yesterday at 11:59 PM',\n                         'Yesterday at 11:59 PM, not Today, or the wrong time, tz = ' + z);\n        }\n\n        assert.equal(moment(b).utc().calendar(), 'Yesterday at 11:59 PM', 'Yesterday at 11:59 PM, not Today, or the wrong time');\n        assert.equal(moment(c).local().calendar(), 'Yesterday at 11:59 PM', 'Yesterday at 11:59 PM, not Today, or the wrong time');\n        assert.equal(moment(c).local().calendar(d), 'Tomorrow at 11:59 PM', 'Tomorrow at 11:59 PM, not Yesterday, or the wrong time');\n    });\n\n    test('invalid', function (assert) {\n        assert.equal(moment.invalid().format(), 'Invalid date');\n        assert.equal(moment.invalid().format('YYYY-MM-DD'), 'Invalid date');\n    });\n\n    test('quarter formats', function (assert) {\n        assert.equal(moment([1985, 1,  4]).format('Q'), '1', 'Feb  4 1985 is Q1');\n        assert.equal(moment([2029, 8, 18]).format('Q'), '3', 'Sep 18 2029 is Q3');\n        assert.equal(moment([2013, 3, 24]).format('Q'), '2', 'Apr 24 2013 is Q2');\n        assert.equal(moment([2015, 2,  5]).format('Q'), '1', 'Mar  5 2015 is Q1');\n        assert.equal(moment([1970, 0,  2]).format('Q'), '1', 'Jan  2 1970 is Q1');\n        assert.equal(moment([2001, 11, 12]).format('Q'), '4', 'Dec 12 2001 is Q4');\n        assert.equal(moment([2000, 0,  2]).format('[Q]Q-YYYY'), 'Q1-2000', 'Jan  2 2000 is Q1');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('getters and setters');\n\n    test('getters', function (assert) {\n        var a = moment([2011, 9, 12, 6, 7, 8, 9]);\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hours(), 6, 'hour');\n        assert.equal(a.minutes(), 7, 'minute');\n        assert.equal(a.seconds(), 8, 'second');\n        assert.equal(a.milliseconds(), 9, 'milliseconds');\n    });\n\n    test('getters programmatic', function (assert) {\n        var a = moment([2011, 9, 12, 6, 7, 8, 9]);\n        assert.equal(a.get('year'), 2011, 'year');\n        assert.equal(a.get('month'), 9, 'month');\n        assert.equal(a.get('date'), 12, 'date');\n        assert.equal(a.get('day'), 3, 'day');\n        assert.equal(a.get('hour'), 6, 'hour');\n        assert.equal(a.get('minute'), 7, 'minute');\n        assert.equal(a.get('second'), 8, 'second');\n        assert.equal(a.get('milliseconds'), 9, 'milliseconds');\n\n        //actual getters tested elsewhere\n        assert.equal(a.get('weekday'), a.weekday(), 'weekday');\n        assert.equal(a.get('isoWeekday'), a.isoWeekday(), 'isoWeekday');\n        assert.equal(a.get('week'), a.week(), 'week');\n        assert.equal(a.get('isoWeek'), a.isoWeek(), 'isoWeek');\n        assert.equal(a.get('dayOfYear'), a.dayOfYear(), 'dayOfYear');\n    });\n\n    test('setters plural', function (assert) {\n        var a = moment();\n        a.years(2011);\n        a.months(9);\n        a.dates(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(9);\n        assert.equal(a.years(), 2011, 'years');\n        assert.equal(a.months(), 9, 'months');\n        assert.equal(a.dates(), 12, 'dates');\n        assert.equal(a.days(), 3, 'days');\n        assert.equal(a.hours(), 6, 'hours');\n        assert.equal(a.minutes(), 7, 'minutes');\n        assert.equal(a.seconds(), 8, 'seconds');\n        assert.equal(a.milliseconds(), 9, 'milliseconds');\n    });\n\n    test('setters singular', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hour(6);\n        a.minute(7);\n        a.second(8);\n        a.millisecond(9);\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hour(), 6, 'hour');\n        assert.equal(a.minute(), 7, 'minute');\n        assert.equal(a.second(), 8, 'second');\n        assert.equal(a.millisecond(), 9, 'milliseconds');\n    });\n\n    test('setters', function (assert) {\n        var a = moment();\n        a.year(2011);\n        a.month(9);\n        a.date(12);\n        a.hours(6);\n        a.minutes(7);\n        a.seconds(8);\n        a.milliseconds(9);\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hours(), 6, 'hour');\n        assert.equal(a.minutes(), 7, 'minute');\n        assert.equal(a.seconds(), 8, 'second');\n        assert.equal(a.milliseconds(), 9, 'milliseconds');\n\n        // Test month() behavior. See https://github.com/timrwood/moment/pull/822\n        a = moment('20130531', 'YYYYMMDD');\n        a.month(3);\n        assert.equal(a.month(), 3, 'month edge case');\n    });\n\n    test('setter programmatic', function (assert) {\n        var a = moment();\n        a.set('year', 2011);\n        a.set('month', 9);\n        a.set('date', 12);\n        a.set('hours', 6);\n        a.set('minutes', 7);\n        a.set('seconds', 8);\n        a.set('milliseconds', 9);\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hours(), 6, 'hour');\n        assert.equal(a.minutes(), 7, 'minute');\n        assert.equal(a.seconds(), 8, 'second');\n        assert.equal(a.milliseconds(), 9, 'milliseconds');\n\n        // Test month() behavior. See https://github.com/timrwood/moment/pull/822\n        a = moment('20130531', 'YYYYMMDD');\n        a.month(3);\n        assert.equal(a.month(), 3, 'month edge case');\n    });\n\n    // Disable this, until we weekYear setter is fixed.\n    // https://github.com/moment/moment/issues/1379\n    // test('setters programatic with weeks', function (assert) {\n    //     var a = moment();\n    //     a.set('weekYear', 2001);\n    //     a.set('week', 49);\n    //     a.set('day', 4);\n    //     assert.equals(a.weekYear(), 2001);\n    //     assert.equals(a.week(), 49);\n    //     assert.equals(a.day(), 4);\n\n    //     a.set('weekday', 1);\n    //     assert.equals(a.weekday(), 1);\n\n    //     assert.done();\n    //},\n\n    // I think this suffers from the same issue as the non-iso version.\n    // test('setters programatic with weeks ISO', function (assert) {\n    //     var a = moment();\n    //     a.set('isoWeekYear', 2001);\n    //     a.set('isoWeek', 49);\n    //     a.set('isoWeekday', 4);\n\n    //     assert.equals(a.weekYear(), 2001);\n    //     assert.equals(a.week(), 49);\n    //     assert.equals(a.day(), 4);\n\n    //     assert.done();\n    //},\n\n    test('setters strings', function (assert) {\n        var a = moment([2012]).locale('en');\n        assert.equal(a.clone().day(0).day('Wednesday').day(), 3, 'day full name');\n        assert.equal(a.clone().day(0).day('Wed').day(), 3, 'day short name');\n        assert.equal(a.clone().day(0).day('We').day(), 3, 'day minimal name');\n        assert.equal(a.clone().day(0).day('invalid').day(), 0, 'invalid day name');\n        assert.equal(a.clone().month(0).month('April').month(), 3, 'month full name');\n        assert.equal(a.clone().month(0).month('Apr').month(), 3, 'month short name');\n        assert.equal(a.clone().month(0).month('invalid').month(), 0, 'invalid month name');\n    });\n\n    test('setters - falsey values', function (assert) {\n        var a = moment();\n        // ensure minutes wasn't coincidentally 0 already\n        a.minutes(1);\n        a.minutes(0);\n        assert.equal(a.minutes(), 0, 'falsey value');\n    });\n\n    test('chaining setters', function (assert) {\n        var a = moment();\n        a.year(2011)\n         .month(9)\n         .date(12)\n         .hours(6)\n         .minutes(7)\n         .seconds(8);\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hours(), 6, 'hour');\n        assert.equal(a.minutes(), 7, 'minute');\n        assert.equal(a.seconds(), 8, 'second');\n    });\n\n    test('setter with multiple unit values', function (assert) {\n        var a = moment();\n        a.set({\n            year: 2011,\n            month: 9,\n            date: 12,\n            hours: 6,\n            minutes: 7,\n            seconds: 8,\n            milliseconds: 9\n        });\n        assert.equal(a.year(), 2011, 'year');\n        assert.equal(a.month(), 9, 'month');\n        assert.equal(a.date(), 12, 'date');\n        assert.equal(a.day(), 3, 'day');\n        assert.equal(a.hours(), 6, 'hour');\n        assert.equal(a.minutes(), 7, 'minute');\n        assert.equal(a.seconds(), 8, 'second');\n        assert.equal(a.milliseconds(), 9, 'milliseconds');\n    });\n\n    test('day setter', function (assert) {\n        var a = moment([2011, 0, 15]);\n        assert.equal(moment(a).day(0).date(), 9, 'set from saturday to sunday');\n        assert.equal(moment(a).day(6).date(), 15, 'set from saturday to saturday');\n        assert.equal(moment(a).day(3).date(), 12, 'set from saturday to wednesday');\n\n        a = moment([2011, 0, 9]);\n        assert.equal(moment(a).day(0).date(), 9, 'set from sunday to sunday');\n        assert.equal(moment(a).day(6).date(), 15, 'set from sunday to saturday');\n        assert.equal(moment(a).day(3).date(), 12, 'set from sunday to wednesday');\n\n        a = moment([2011, 0, 12]);\n        assert.equal(moment(a).day(0).date(), 9, 'set from wednesday to sunday');\n        assert.equal(moment(a).day(6).date(), 15, 'set from wednesday to saturday');\n        assert.equal(moment(a).day(3).date(), 12, 'set from wednesday to wednesday');\n\n        assert.equal(moment(a).day(-7).date(), 2, 'set from wednesday to last sunday');\n        assert.equal(moment(a).day(-1).date(), 8, 'set from wednesday to last saturday');\n        assert.equal(moment(a).day(-4).date(), 5, 'set from wednesday to last wednesday');\n\n        assert.equal(moment(a).day(7).date(), 16, 'set from wednesday to next sunday');\n        assert.equal(moment(a).day(13).date(), 22, 'set from wednesday to next saturday');\n        assert.equal(moment(a).day(10).date(), 19, 'set from wednesday to next wednesday');\n\n        assert.equal(moment(a).day(14).date(), 23, 'set from wednesday to second next sunday');\n        assert.equal(moment(a).day(20).date(), 29, 'set from wednesday to second next saturday');\n        assert.equal(moment(a).day(17).date(), 26, 'set from wednesday to second next wednesday');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('invalid');\n\n    test('invalid', function (assert) {\n        var m = moment.invalid();\n        assert.equal(m.isValid(), false);\n        assert.equal(m.parsingFlags().userInvalidated, true);\n        assert.ok(isNaN(m.valueOf()));\n    });\n\n    test('invalid with existing flag', function (assert) {\n        var m = moment.invalid({invalidMonth : 'whatchamacallit'});\n        assert.equal(m.isValid(), false);\n        assert.equal(m.parsingFlags().userInvalidated, false);\n        assert.equal(m.parsingFlags().invalidMonth, 'whatchamacallit');\n        assert.ok(isNaN(m.valueOf()));\n    });\n\n    test('invalid with custom flag', function (assert) {\n        var m = moment.invalid({tooBusyWith : 'reiculating splines'});\n        assert.equal(m.isValid(), false);\n        assert.equal(m.parsingFlags().userInvalidated, false);\n        assert.equal(m.parsingFlags().tooBusyWith, 'reiculating splines');\n        assert.ok(isNaN(m.valueOf()));\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is after');\n\n    test('is after without units', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), false, 'hour is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), true, 'hour is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), false, 'minute is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), true, 'minute is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), false, 'second is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), true, 'second is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'millisecond match');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), false, 'millisecond is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), true, 'millisecond is earlier');\n        assert.equal(m.isAfter(m), false, 'moments are not after themselves');\n        assert.equal(+m, +mCopy, 'isAfter second should not change moment');\n    });\n\n    test('is after year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year match');\n        assert.equal(m.isAfter(moment(new Date(2010, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2013, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), false, 'exact start of year');\n        assert.equal(m.isAfter(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), false, 'exact end of year');\n        assert.equal(m.isAfter(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), false, 'start of next year');\n        assert.equal(m.isAfter(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), true, 'end of previous year');\n        assert.equal(m.isAfter(moment(new Date(1980, 11, 31, 23, 59, 59, 999)), 'year'), true, 'end of year far before');\n        assert.equal(m.isAfter(m, 'year'), false, 'same moments are not after the same year');\n        assert.equal(+m, +mCopy, 'isAfter year should not change moment');\n    });\n\n    test('is after month', function (assert) {\n        var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), false, 'month match');\n        assert.equal(m.isAfter(moment(new Date(2010, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 2, 6, 7, 8, 9, 10)), 'month'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), false, 'exact start of month');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), false, 'exact end of month');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), false, 'start of next month');\n        assert.equal(m.isAfter(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), true, 'end of previous month');\n        assert.equal(m.isAfter(moment(new Date(2010, 12, 31, 23, 59, 59, 999)), 'month'), true, 'later month but earlier year');\n        assert.equal(m.isAfter(m, 'month'), false, 'same moments are not after the same month');\n        assert.equal(+m, +mCopy, 'isAfter month should not change moment');\n    });\n\n    test('is after day', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 7, 8, 9, 10)), 'day'), false, 'day match');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 7, 8, 9, 10)), 'day'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 7, 8, 9, 10)), 'day'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 7, 8, 9, 10)), 'day'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 7, 8, 9, 10)), 'day'), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 7, 8, 9, 10)), 'day'), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 0, 0, 0, 0)), 'day'), false, 'exact start of day');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 23, 59, 59, 999)), 'day'), false, 'exact end of day');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 0, 0, 0, 0)), 'day'), false, 'start of next day');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 23, 59, 59, 999)), 'day'), true, 'end of previous day');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 10, 0, 0, 0, 0)), 'day'), true, 'later day but earlier year');\n        assert.equal(m.isAfter(m, 'day'), false, 'same moments are not after the same day');\n        assert.equal(+m, +mCopy, 'isAfter day should not change moment');\n    });\n\n    test('is after hour', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'hour match');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 8, 9, 10)), 'hour'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 3, 8, 9, 10)), 'hour'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 3, 8, 9, 10)), 'hour'), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 3, 8, 9, 10)), 'hour'), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 8, 9, 10)), 'hour'), false, 'hour is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'hour is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 0, 0, 0)), 'hour'), false, 'exact start of hour');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 59, 59, 999)), 'hour'), false, 'exact end of hour');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 0, 0, 0)), 'hour'), false, 'start of next hour');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 2, 59, 59, 999)), 'hour'), true, 'end of previous hour');\n        assert.equal(m.isAfter(m, 'hour'), false, 'same moments are not after the same hour');\n        assert.equal(+m, +mCopy, 'isAfter hour should not change moment');\n    });\n\n    test('is after minute', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 9, 10)), 'minute'), false, 'minute match');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 3, 4, 9, 10)), 'minute'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 9, 10)), 'minute'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 3, 4, 9, 10)), 'minute'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 3, 4, 9, 10)), 'minute'), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 3, 4, 9, 10)), 'minute'), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 4, 9, 10)), 'minute'), false, 'hour is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 2, 4, 9, 10)), 'minute'), true, 'hour is earler');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 5, 9, 10)), 'minute'), false, 'minute is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 3, 9, 10)), 'minute'), true, 'minute is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 0, 0)), 'minute'), false, 'exact start of minute');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 59, 999)), 'minute'), false, 'exact end of minute');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 5, 0, 0)), 'minute'), false, 'start of next minute');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 3, 59, 999)), 'minute'), true, 'end of previous minute');\n        assert.equal(m.isAfter(m, 'minute'), false, 'same moments are not after the same minute');\n        assert.equal(+m, +mCopy, 'isAfter minute should not change moment');\n    });\n\n    test('is after second', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'second'), false, 'second match');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'second'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'second'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'second'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'second'), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'second'), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'second'), false, 'hour is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'second'), true, 'hour is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'second'), false, 'minute is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'second'), true, 'minute is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'second'), false, 'second is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'second'), true, 'second is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 0)), 'second'), false, 'exact start of second');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 999)), 'second'), false, 'exact end of second');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 0)), 'second'), false, 'start of next second');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 999)), 'second'), true, 'end of previous second');\n        assert.equal(m.isAfter(m, 'second'), false, 'same moments are not after the same second');\n        assert.equal(+m, +mCopy, 'isAfter second should not change moment');\n    });\n\n    test('is after millisecond', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'millisecond match');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work');\n        assert.equal(m.isAfter(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is later');\n        assert.equal(m.isAfter(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'year is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), true, 'month is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), false, 'day is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), true, 'day is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), false, 'hour is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), true, 'hour is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), false, 'minute is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), true, 'minute is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), false, 'second is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), true, 'second is earlier');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), false, 'millisecond is later');\n        assert.equal(m.isAfter(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), true, 'millisecond is earlier');\n        assert.equal(m.isAfter(m, 'millisecond'), false, 'same moments are not after the same millisecond');\n        assert.equal(+m, +mCopy, 'isAfter millisecond should not change moment');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is before');\n\n    test('is after without units', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), true, 'hour is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), false, 'hour is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), true, 'minute is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), false, 'minute is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), true, 'second is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), false, 'second is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'millisecond match');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), true, 'millisecond is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), false, 'millisecond is earlier');\n        assert.equal(m.isBefore(m), false, 'moments are not before themselves');\n        assert.equal(+m, +mCopy, 'isBefore second should not change moment');\n    });\n\n    test('is before year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year match');\n        assert.equal(m.isBefore(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2013, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), false, 'exact start of year');\n        assert.equal(m.isBefore(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), false, 'exact end of year');\n        assert.equal(m.isBefore(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), true, 'start of next year');\n        assert.equal(m.isBefore(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of previous year');\n        assert.equal(m.isBefore(moment(new Date(1980, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of year far before');\n        assert.equal(m.isBefore(m, 'year'), false, 'same moments are not before the same year');\n        assert.equal(+m, +mCopy, 'isBefore year should not change moment');\n    });\n\n    test('is before month', function (assert) {\n        var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), false, 'month match');\n        assert.equal(m.isBefore(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), false, 'exact start of month');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), false, 'exact end of month');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), true, 'start of next month');\n        assert.equal(m.isBefore(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), false, 'end of previous month');\n        assert.equal(m.isBefore(moment(new Date(2010, 12, 31, 23, 59, 59, 999)), 'month'), false, 'later month but earlier year');\n        assert.equal(m.isBefore(m, 'month'), false, 'same moments are not before the same month');\n        assert.equal(+m, +mCopy, 'isBefore month should not change moment');\n    });\n\n    test('is before day', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 7, 8, 9, 10)), 'day'), false, 'day match');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 7, 8, 9, 10)), 'day'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 7, 8, 9, 10)), 'day'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 7, 8, 9, 10)), 'day'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 7, 8, 9, 10)), 'day'), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 7, 8, 9, 10)), 'day'), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 0, 0, 0, 0)), 'day'), false, 'exact start of day');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 23, 59, 59, 999)), 'day'), false, 'exact end of day');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 0, 0, 0, 0)), 'day'), true, 'start of next day');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 23, 59, 59, 999)), 'day'), false, 'end of previous day');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 10, 0, 0, 0, 0)), 'day'), false, 'later day but earlier year');\n        assert.equal(m.isBefore(m, 'day'), false, 'same moments are not before the same day');\n        assert.equal(+m, +mCopy, 'isBefore day should not change moment');\n    });\n\n    test('is before hour', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'hour match');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 8, 9, 10)), 'hour'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 3, 8, 9, 10)), 'hour'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 3, 8, 9, 10)), 'hour'), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 3, 8, 9, 10)), 'hour'), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 8, 9, 10)), 'hour'), true, 'hour is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 8, 9, 10)), 'hour'), false, 'hour is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 0, 0, 0)), 'hour'), false, 'exact start of hour');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 59, 59, 999)), 'hour'), false, 'exact end of hour');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 0, 0, 0)), 'hour'), true, 'start of next hour');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 2, 59, 59, 999)), 'hour'), false, 'end of previous hour');\n        assert.equal(m.isBefore(m, 'hour'), false, 'same moments are not before the same hour');\n        assert.equal(+m, +mCopy, 'isBefore hour should not change moment');\n    });\n\n    test('is before minute', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 9, 10)), 'minute'), false, 'minute match');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 4, 9, 10)), 'minute'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 4, 9, 10)), 'minute'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 3, 4, 9, 10)), 'minute'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 3, 4, 9, 10)), 'minute'), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 3, 4, 9, 10)), 'minute'), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 4, 9, 10)), 'minute'), true, 'hour is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 2, 4, 9, 10)), 'minute'), false, 'hour is earler');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 5, 9, 10)), 'minute'), true, 'minute is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 3, 9, 10)), 'minute'), false, 'minute is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 0, 0)), 'minute'), false, 'exact start of minute');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 59, 999)), 'minute'), false, 'exact end of minute');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 5, 0, 0)), 'minute'), true, 'start of next minute');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 3, 59, 999)), 'minute'), false, 'end of previous minute');\n        assert.equal(m.isBefore(m, 'minute'), false, 'same moments are not before the same minute');\n        assert.equal(+m, +mCopy, 'isBefore minute should not change moment');\n    });\n\n    test('is before second', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'second'), false, 'second match');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'second'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'second'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'second'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'second'), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'second'), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'second'), true, 'hour is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'second'), false, 'hour is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'second'), true, 'minute is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'second'), false, 'minute is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'second'), true, 'second is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'second'), false, 'second is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 0)), 'second'), false, 'exact start of second');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 999)), 'second'), false, 'exact end of second');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 0)), 'second'), true, 'start of next second');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 999)), 'second'), false, 'end of previous second');\n        assert.equal(m.isBefore(m, 'second'), false, 'same moments are not before the same second');\n        assert.equal(+m, +mCopy, 'isBefore second should not change moment');\n    });\n\n    test('is before millisecond', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'millisecond match');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'milliseconds'), false, 'plural should work');\n        assert.equal(m.isBefore(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'year is later');\n        assert.equal(m.isBefore(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), true, 'month is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), true, 'day is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), false, 'day is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), true, 'hour is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), false, 'hour is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), true, 'minute is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), false, 'minute is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), true, 'second is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), false, 'second is earlier');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), true, 'millisecond is later');\n        assert.equal(m.isBefore(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), false, 'millisecond is earlier');\n        assert.equal(m.isBefore(m, 'millisecond'), false, 'same moments are not before the same millisecond');\n        assert.equal(+m, +mCopy, 'isBefore millisecond should not change moment');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is between');\n\n    test('is between without units', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2009, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'year is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2013, 3, 2, 3, 4, 5, 10))), false, 'year is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2010, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2012, 3, 2, 3, 4, 5, 10))), true, 'year is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'month is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 5, 2, 3, 4, 5, 10))), false, 'month is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 2, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 4, 2, 3, 4, 5, 10))), true, 'month is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 1, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'day is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 4, 3, 4, 5, 10))), false, 'day is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 1, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 3, 3, 4, 5, 10))), true, 'day is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 1, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'hour is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 5, 4, 5, 10))), false, 'hour is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 2, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 4, 4, 5, 10))), true, 'hour is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 6, 5, 10))), false, 'minute is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 2, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'minute is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 3, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 5, 5, 10))), true, 'minute is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 7, 10))), false, 'second is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 3, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'second is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 4, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 6, 10))), true, 'second is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 12))), false, 'millisecond is later');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 8)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 10))), false, 'millisecond is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 9)),\n                    moment(new Date(2011, 3, 2, 3, 4, 5, 11))), true, 'millisecond is between');\n        assert.equal(m.isBetween(m, m), false, 'moments are not between themselves');\n        assert.equal(+m, +mCopy, 'isBetween second should not change moment');\n    });\n\n    test('is between year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 5, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2010, 5, 6, 7, 8, 9, 10)),\n                    moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2010, 5, 6, 7, 8, 9, 10)),\n                    moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 5, 6, 7, 8, 9, 10)),\n                    moment(new Date(2013, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2010, 5, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year is later');\n        assert.equal(m.isBetween(m, 'year'), false, 'same moments are not between the same year');\n        assert.equal(+m, +mCopy, 'isBetween year should not change moment');\n    });\n\n    test('is between month', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), false, 'month match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 0, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 0, 31, 23, 59, 59, 999)),\n                    moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'month is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), false, 'month is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 11, 6, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 6, 7, 8, 9, 10)), 'month'), false, 'month is later');\n        assert.equal(m.isBetween(m, 'month'), false, 'same moments are not between the same month');\n        assert.equal(+m, +mCopy, 'isBetween month should not change moment');\n    });\n\n    test('is between day', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), false, 'day match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 1, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'days'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 1, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), true, 'day is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 4, 7, 8, 9, 10)), 'day'), false, 'day is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 1, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), false, 'day is later');\n        assert.equal(m.isBetween(m, 'day'), false, 'same moments are not between the same day');\n        assert.equal(+m, +mCopy, 'isBetween day should not change moment');\n    });\n\n    test('is between hour', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 5, 9, 10)),\n                    moment(new Date(2011, 1, 2, 3, 9, 9, 10)), 'hour'), false, 'hour match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 1, 59, 59, 999)),\n                    moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hours'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 2, 59, 59, 999)),\n                    moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), true, 'hour is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'hour'), false, 'hour is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)),\n                    moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'hour'), false, 'hour is later');\n        assert.equal(m.isBetween(m, 'hour'), false, 'same moments are not between the same hour');\n        assert.equal(+m, +mCopy, 'isBetween hour should not change moment');\n    });\n\n    test('is between minute', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 9, 10)),\n                    moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'minute match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 3, 9, 10)),\n                    moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minutes'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 3, 59, 999)),\n                    moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), true, 'minute is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 5, 0, 0)),\n                    moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'minute'), false, 'minute is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 2, 9, 10)),\n                    moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), false, 'minute is later');\n        assert.equal(m.isBetween(m, 'minute'), false, 'same moments are not between the same minute');\n        assert.equal(+m, +mCopy, 'isBetween minute should not change moment');\n    });\n\n    test('is between second', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 10)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), false, 'second match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 4, 10)),\n                    moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'seconds'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 4, 999)),\n                    moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), true, 'second is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 6, 0)),\n                    moment(new Date(2011, 1, 2, 3, 4, 7, 10)), 'second'), false, 'second is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 3, 10)),\n                    moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), false, 'second is later');\n        assert.equal(m.isBetween(m, 'second'), false, 'same moments are not between the same second');\n        assert.equal(+m, +mCopy, 'isBetween second should not change moment');\n    });\n\n    test('is between millisecond', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 6)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 6)), 'millisecond'), false, 'millisecond match');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 5)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 7)), 'milliseconds'), true, 'plural should work');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 5)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 7)), 'millisecond'), true, 'millisecond is between');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 7)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'millisecond'), false, 'millisecond is earlier');\n        assert.equal(m.isBetween(\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 4)),\n                    moment(new Date(2011, 1, 2, 3, 4, 5, 6)), 'millisecond'), false, 'millisecond is later');\n        assert.equal(m.isBetween(m, 'millisecond'), false, 'same moments are not between the same millisecond');\n        assert.equal(+m, +mCopy, 'isBetween millisecond should not change moment');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is date');\n\n    test('isDate recognizes Date objects', function (assert) {\n        assert.ok(moment.isDate(new Date()), 'no args (now)');\n        assert.ok(moment.isDate(new Date([2014, 2, 15])), 'array args');\n        assert.ok(moment.isDate(new Date('2014-03-15')), 'string args');\n        assert.ok(moment.isDate(new Date('does NOT look like a date')), 'invalid date');\n    });\n\n    test('isDate rejects non-Date objects', function (assert) {\n        assert.ok(!moment.isDate(), 'nothing');\n        assert.ok(!moment.isDate(undefined), 'undefined');\n        assert.ok(!moment.isDate(null), 'string args');\n        assert.ok(!moment.isDate(42), 'number');\n        assert.ok(!moment.isDate('2014-03-15'), 'string');\n        assert.ok(!moment.isDate([2014, 2, 15]), 'array');\n        assert.ok(!moment.isDate({year: 2014, month: 2, day: 15}), 'object');\n        assert.ok(!moment.isDate({toString: function () {\n            return '[object Date]';\n        }}), 'lying object');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is moment');\n\n    test('is moment object', function (assert) {\n        var MyObj = function () {},\n            extend = function (a, b) {\n                var i;\n                for (i in b) {\n                    a[i] = b[i];\n                }\n                return a;\n            };\n        MyObj.prototype.toDate = function () {\n            return new Date();\n        };\n\n        assert.ok(moment.isMoment(moment()), 'simple moment object');\n        assert.ok(moment.isMoment(moment(null)), 'invalid moment object');\n        assert.ok(moment.isMoment(extend({}, moment())), 'externally cloned moments are moments');\n        assert.ok(moment.isMoment(extend({}, moment.utc())), 'externally cloned utc moments are moments');\n\n        assert.ok(!moment.isMoment(new MyObj()), 'myObj is not moment object');\n        assert.ok(!moment.isMoment(moment), 'moment function is not moment object');\n        assert.ok(!moment.isMoment(new Date()), 'date object is not moment object');\n        assert.ok(!moment.isMoment(Object), 'Object is not moment object');\n        assert.ok(!moment.isMoment('foo'), 'string is not moment object');\n        assert.ok(!moment.isMoment(1), 'number is not moment object');\n        assert.ok(!moment.isMoment(NaN), 'NaN is not moment object');\n        assert.ok(!moment.isMoment(null), 'null is not moment object');\n        assert.ok(!moment.isMoment(undefined), 'undefined is not moment object');\n    });\n\n    test('is moment with hacked hasOwnProperty', function (assert) {\n        var obj = {};\n        // HACK to suppress jshint warning about bad property name\n        obj['hasOwnMoney'.replace('Money', 'Property')] = function () {\n            return true;\n        };\n\n        assert.ok(!moment.isMoment(obj), 'isMoment works even if passed object has a wrong hasOwnProperty implementation (ie8)');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is same');\n\n    test('is same without units', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 5, 5, 10))), false, 'year is later');\n        assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 3, 5, 10))), false, 'year is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10))), false, 'month is later');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10))), false, 'month is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10))), false, 'day is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 1, 3, 4, 5, 10))), false, 'day is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10))), false, 'hour is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 2, 4, 5, 10))), false, 'hour is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10))), false, 'minute is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10))), false, 'minute is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10))), false, 'second is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 11))), false, 'second is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10))), true, 'millisecond match');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 11))), false, 'millisecond is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 9))), false, 'millisecond is earlier');\n        assert.equal(m.isSame(m), true, 'moments are the same as themselves');\n        assert.equal(+m, +mCopy, 'isSame second should not change moment');\n    });\n\n    test('is same year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'year'), true, 'year match');\n        assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'years'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 5, 6, 7, 8, 9, 10)), 'year'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 0, 1, 0, 0, 0, 0)), 'year'), true, 'exact start of year');\n        assert.equal(m.isSame(moment(new Date(2011, 11, 31, 23, 59, 59, 999)), 'year'), true, 'exact end of year');\n        assert.equal(m.isSame(moment(new Date(2012, 0, 1, 0, 0, 0, 0)), 'year'), false, 'start of next year');\n        assert.equal(m.isSame(moment(new Date(2010, 11, 31, 23, 59, 59, 999)), 'year'), false, 'end of previous year');\n        assert.equal(m.isSame(m, 'year'), true, 'same moments are in the same year');\n        assert.equal(+m, +mCopy, 'isSame year should not change moment');\n    });\n\n    test('is same month', function (assert) {\n        var m = moment(new Date(2011, 2, 3, 4, 5, 6, 7)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'month'), true, 'month match');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 6, 7, 8, 9, 10)), 'months'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 2, 6, 7, 8, 9, 10)), 'month'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 5, 6, 7, 8, 9, 10)), 'month'), false, 'month mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 1, 0, 0, 0, 0)), 'month'), true, 'exact start of month');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 31, 23, 59, 59, 999)), 'month'), true, 'exact end of month');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 1, 0, 0, 0, 0)), 'month'), false, 'start of next month');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 27, 23, 59, 59, 999)), 'month'), false, 'end of previous month');\n        assert.equal(m.isSame(m, 'month'), true, 'same moments are in the same month');\n        assert.equal(+m, +mCopy, 'isSame month should not change moment');\n    });\n\n    test('is same day', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'day'), true, 'day match');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 7, 8, 9, 10)), 'days'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 1, 2, 7, 8, 9, 10)), 'day'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 7, 8, 9, 10)), 'day'), false, 'month mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 3, 7, 8, 9, 10)), 'day'), false, 'day mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 0, 0, 0, 0)), 'day'), true, 'exact start of day');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 23, 59, 59, 999)), 'day'), true, 'exact end of day');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 3, 0, 0, 0, 0)), 'day'), false, 'start of next day');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 1, 23, 59, 59, 999)), 'day'), false, 'end of previous day');\n        assert.equal(m.isSame(m, 'day'), true, 'same moments are in the same day');\n        assert.equal(+m, +mCopy, 'isSame day should not change moment');\n    });\n\n    test('is same hour', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hour'), true, 'hour match');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 8, 9, 10)), 'hours'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 8, 9, 10)), 'hour'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 8, 9, 10)), 'hour'), false, 'month mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 8, 9, 10)), 'hour'), false, 'day mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 8, 9, 10)), 'hour'), false, 'hour mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 0, 0, 0)), 'hour'), true, 'exact start of hour');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 59, 59, 999)), 'hour'), true, 'exact end of hour');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 0, 0, 0)), 'hour'), false, 'start of next hour');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 2, 59, 59, 999)), 'hour'), false, 'end of previous hour');\n        assert.equal(m.isSame(m, 'hour'), true, 'same moments are in the same hour');\n        assert.equal(+m, +mCopy, 'isSame hour should not change moment');\n    });\n\n    test('is same minute', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minute'), true, 'minute match');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 9, 10)), 'minutes'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 9, 10)), 'minute'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 9, 10)), 'minute'), false, 'month mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 9, 10)), 'minute'), false, 'day mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 9, 10)), 'minute'), false, 'hour mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 9, 10)), 'minute'), false, 'minute mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 0, 0)), 'minute'), true, 'exact start of minute');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 59, 999)), 'minute'), true, 'exact end of minute');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 0, 0)), 'minute'), false, 'start of next minute');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 3, 59, 999)), 'minute'), false, 'end of previous minute');\n        assert.equal(m.isSame(m, 'minute'), true, 'same moments are in the same minute');\n        assert.equal(+m, +mCopy, 'isSame minute should not change moment');\n    });\n\n    test('is same second', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'second'), true, 'second match');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 10)), 'seconds'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 1, 2, 3, 4, 5, 10)), 'second'), false, 'year mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'second'), false, 'month mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 3, 3, 4, 5, 10)), 'second'), false, 'day mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 4, 4, 5, 10)), 'second'), false, 'hour mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 5, 5, 10)), 'second'), false, 'minute mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 10)), 'second'), false, 'second mismatch');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 0)), 'second'), true, 'exact start of second');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 5, 999)), 'second'), true, 'exact end of second');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 6, 0)), 'second'), false, 'start of next second');\n        assert.equal(m.isSame(moment(new Date(2011, 1, 2, 3, 4, 4, 999)), 'second'), false, 'end of previous second');\n        assert.equal(m.isSame(m, 'second'), true, 'same moments are in the same second');\n        assert.equal(+m, +mCopy, 'isSame second should not change moment');\n    });\n\n    test('is same millisecond', function (assert) {\n        var m = moment(new Date(2011, 3, 2, 3, 4, 5, 10)), mCopy = moment(m);\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'millisecond'), true, 'millisecond match');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 5, 10)), 'milliseconds'), true, 'plural should work');\n        assert.equal(m.isSame(moment(new Date(2012, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is later');\n        assert.equal(m.isSame(moment(new Date(2010, 3, 2, 3, 4, 5, 10)), 'millisecond'), false, 'year is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 4, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is later');\n        assert.equal(m.isSame(moment(new Date(2011, 2, 2, 3, 4, 5, 10)), 'millisecond'), false, 'month is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 3, 3, 4, 5, 10)), 'millisecond'), false, 'day is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 1, 1, 4, 5, 10)), 'millisecond'), false, 'day is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 4, 4, 5, 10)), 'millisecond'), false, 'hour is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 1, 4, 1, 5, 10)), 'millisecond'), false, 'hour is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 5, 5, 10)), 'millisecond'), false, 'minute is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 3, 5, 10)), 'millisecond'), false, 'minute is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 10)), 'millisecond'), false, 'second is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 5)), 'millisecond'), false, 'second is earlier');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 6, 11)), 'millisecond'), false, 'millisecond is later');\n        assert.equal(m.isSame(moment(new Date(2011, 3, 2, 3, 4, 4, 9)), 'millisecond'), false, 'millisecond is earlier');\n        assert.equal(m.isSame(m, 'millisecond'), true, 'same moments are in the same millisecond');\n        assert.equal(+m, +mCopy, 'isSame millisecond should not change moment');\n    });\n\n    test('is same with utc offset moments', function (assert) {\n        assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment('2013-02-01'), 'year'), 'zoned vs local moment');\n        assert.ok(moment('2013-02-01').isSame(moment('2013-02-01').utcOffset('-05:00'), 'year'), 'local vs zoned moment');\n        assert.ok(moment.parseZone('2013-02-01T-05:00').isSame(moment.parseZone('2013-02-01T-06:30'), 'year'),\n                'zoned vs (differently) zoned moment');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('is valid');\n\n    test('array bad month', function (assert) {\n        assert.equal(moment([2010, -1]).isValid(), false, 'month -1 invalid');\n        assert.equal(moment([2100, 12]).isValid(), false, 'month 12 invalid');\n    });\n\n    test('array good month', function (assert) {\n        for (var i = 0; i < 12; i++) {\n            assert.equal(moment([2010, i]).isValid(), true, 'month ' + i);\n            assert.equal(moment.utc([2010, i]).isValid(), true, 'month ' + i);\n        }\n    });\n\n    test('array bad date', function (assert) {\n        var tests = [\n            moment([2010, 0, 0]),\n            moment([2100, 0, 32]),\n            moment.utc([2010, 0, 0]),\n            moment.utc([2100, 0, 32])\n        ],\n        i, m;\n\n        for (i in tests) {\n            m = tests[i];\n            assert.equal(m.isValid(), false);\n        }\n    });\n\n    test('h/hh with hour > 12', function (assert) {\n        assert.ok(moment('06/20/2014 11:51 PM', 'MM/DD/YYYY hh:mm A', true).isValid(), '11 for hh');\n        assert.ok(moment('06/20/2014 11:51 AM', 'MM/DD/YYYY hh:mm A', true).isValid(), '11 for hh');\n        assert.ok(moment('06/20/2014 23:51 PM', 'MM/DD/YYYY hh:mm A').isValid(), 'non-strict validity 23 for hh');\n        assert.ok(moment('06/20/2014 23:51 PM', 'MM/DD/YYYY hh:mm A').parsingFlags().bigHour, 'non-strict bigHour 23 for hh');\n        assert.ok(!moment('06/20/2014 23:51 PM', 'MM/DD/YYYY hh:mm A', true).isValid(), 'validity 23 for hh');\n        assert.ok(moment('06/20/2014 23:51 PM', 'MM/DD/YYYY hh:mm A', true).parsingFlags().bigHour, 'bigHour 23 for hh');\n    });\n\n    test('array bad date leap year', function (assert) {\n        assert.equal(moment([2010, 1, 29]).isValid(), false, '2010 feb 29');\n        assert.equal(moment([2100, 1, 29]).isValid(), false, '2100 feb 29');\n        assert.equal(moment([2008, 1, 30]).isValid(), false, '2008 feb 30');\n        assert.equal(moment([2000, 1, 30]).isValid(), false, '2000 feb 30');\n\n        assert.equal(moment.utc([2010, 1, 29]).isValid(), false, 'utc 2010 feb 29');\n        assert.equal(moment.utc([2100, 1, 29]).isValid(), false, 'utc 2100 feb 29');\n        assert.equal(moment.utc([2008, 1, 30]).isValid(), false, 'utc 2008 feb 30');\n        assert.equal(moment.utc([2000, 1, 30]).isValid(), false, 'utc 2000 feb 30');\n    });\n\n    test('string + formats bad date', function (assert) {\n        assert.equal(moment('2020-00-00', []).isValid(), false, 'invalid on empty array');\n        assert.equal(moment('2020-00-00', ['YYYY-MM-DD', 'DD-MM-YYYY']).isValid(), false, 'invalid on all in array');\n        assert.equal(moment('2020-00-00', ['DD-MM-YYYY', 'YYYY-MM-DD']).isValid(), false, 'invalid on all in array');\n        assert.equal(moment('2020-01-01', ['YYYY-MM-DD', 'DD-MM-YYYY']).isValid(), true, 'valid on first');\n        assert.equal(moment('2020-01-01', ['DD-MM-YYYY', 'YYYY-MM-DD']).isValid(), true, 'valid on last');\n        assert.equal(moment('2020-01-01', ['YYYY-MM-DD', 'YYYY-DD-MM']).isValid(), true, 'valid on both');\n        assert.equal(moment('2020-13-01', ['YYYY-MM-DD', 'YYYY-DD-MM']).isValid(), true, 'valid on last');\n\n        assert.equal(moment('12-13-2012', ['DD-MM-YYYY', 'YYYY-MM-DD']).isValid(), false, 'month rollover');\n        assert.equal(moment('12-13-2012', ['DD-MM-YYYY', 'DD-MM-YYYY']).isValid(), false, 'month rollover');\n        assert.equal(moment('38-12-2012', ['DD-MM-YYYY']).isValid(), false, 'day rollover');\n    });\n\n    test('string nonsensical with format', function (assert) {\n        assert.equal(moment('fail', 'MM-DD-YYYY').isValid(), false, 'string \\'fail\\' with format \\'MM-DD-YYYY\\'');\n        assert.equal(moment('xx-xx-2001', 'DD-MM-YYY').isValid(), true, 'string \\'xx-xx-2001\\' with format \\'MM-DD-YYYY\\'');\n    });\n\n    test('string with bad month name', function (assert) {\n        assert.equal(moment('01-Nam-2012', 'DD-MMM-YYYY').isValid(), false, '\\'Nam\\' is an invalid month');\n        assert.equal(moment('01-Aug-2012', 'DD-MMM-YYYY').isValid(), true, '\\'Aug\\' is a valid month');\n    });\n\n    test('string with spaceless format', function (assert) {\n        assert.equal(moment('10Sep2001', 'DDMMMYYYY').isValid(), true, 'Parsing 10Sep2001 should result in a valid date');\n    });\n\n    test('invalid string iso 8601', function (assert) {\n        var tests = [\n            '2010-00-00',\n            '2010-01-00',\n            '2010-01-40',\n            '2010-01-01T24:01',  // 24:00:00 is actually valid\n            '2010-01-01T23:60',\n            '2010-01-01T23:59:60'\n        ], i;\n\n        for (i = 0; i < tests.length; i++) {\n            assert.equal(moment(tests[i]).isValid(), false, tests[i] + ' should be invalid');\n            assert.equal(moment.utc(tests[i]).isValid(), false, tests[i] + ' should be invalid');\n        }\n    });\n\n    test('invalid string iso 8601 + timezone', function (assert) {\n        var tests = [\n            '2010-00-00T+00:00',\n            '2010-01-00T+00:00',\n            '2010-01-40T+00:00',\n            '2010-01-40T24:01+00:00',\n            '2010-01-40T23:60+00:00',\n            '2010-01-40T23:59:60+00:00',\n            '2010-01-40T23:59:59.9999+00:00'\n        ], i;\n\n        for (i = 0; i < tests.length; i++) {\n            assert.equal(moment(tests[i]).isValid(), false, tests[i] + ' should be invalid');\n            assert.equal(moment.utc(tests[i]).isValid(), false, tests[i] + ' should be invalid');\n        }\n    });\n\n    test('valid string iso 8601 + timezone', function (assert) {\n        var tests = [\n            '2010-01-01',\n            '2010-01-30',\n            '2010-01-30T23+00:00',\n            '2010-01-30T23:59+00:00',\n            '2010-01-30T23:59:59+00:00',\n            '2010-01-30T23:59:59.999+00:00',\n            '2010-01-30T23:59:59.999-07:00',\n            '2010-01-30T00:00:00.000+07:00',\n            '2010-01-30T00:00:00.000+07'\n        ], i;\n\n        for (i = 0; i < tests.length; i++) {\n            assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid');\n            assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid');\n        }\n    });\n\n    test('invalidAt', function (assert) {\n        assert.equal(moment([2000, 12]).invalidAt(), 1, 'month 12 is invalid: 0-11');\n        assert.equal(moment([2000, 1, 30]).invalidAt(), 2, '30 is not a valid february day');\n        assert.equal(moment([2000, 1, 29, 25]).invalidAt(), 3, '25 is invalid hour');\n        assert.equal(moment([2000, 1, 29, 24,  1]).invalidAt(), 3, '24:01 is invalid hour');\n        assert.equal(moment([2000, 1, 29, 23, 60]).invalidAt(), 4, '60 is invalid minute');\n        assert.equal(moment([2000, 1, 29, 23, 59, 60]).invalidAt(), 5, '60 is invalid second');\n        assert.equal(moment([2000, 1, 29, 23, 59, 59, 1000]).invalidAt(), 6, '1000 is invalid millisecond');\n        assert.equal(moment([2000, 1, 29, 23, 59, 59, 999]).invalidAt(), -1, '-1 if everything is fine');\n    });\n\n    test('valid Unix timestamp', function (assert) {\n        assert.equal(moment(1371065286, 'X').isValid(), true, 'number integer');\n        assert.equal(moment(1379066897.0, 'X').isValid(), true, 'number whole 1dp');\n        assert.equal(moment(1379066897.7, 'X').isValid(), true, 'number 1dp');\n        assert.equal(moment(1379066897.00, 'X').isValid(), true, 'number whole 2dp');\n        assert.equal(moment(1379066897.07, 'X').isValid(), true, 'number 2dp');\n        assert.equal(moment(1379066897.17, 'X').isValid(), true, 'number 2dp');\n        assert.equal(moment(1379066897.000, 'X').isValid(), true, 'number whole 3dp');\n        assert.equal(moment(1379066897.007, 'X').isValid(), true, 'number 3dp');\n        assert.equal(moment(1379066897.017, 'X').isValid(), true, 'number 3dp');\n        assert.equal(moment(1379066897.157, 'X').isValid(), true, 'number 3dp');\n        assert.equal(moment('1371065286', 'X').isValid(), true, 'string integer');\n        assert.equal(moment('1379066897.', 'X').isValid(), true, 'string trailing .');\n        assert.equal(moment('1379066897.0', 'X').isValid(), true, 'string whole 1dp');\n        assert.equal(moment('1379066897.7', 'X').isValid(), true, 'string 1dp');\n        assert.equal(moment('1379066897.00', 'X').isValid(), true, 'string whole 2dp');\n        assert.equal(moment('1379066897.07', 'X').isValid(), true, 'string 2dp');\n        assert.equal(moment('1379066897.17', 'X').isValid(), true, 'string 2dp');\n        assert.equal(moment('1379066897.000', 'X').isValid(), true, 'string whole 3dp');\n        assert.equal(moment('1379066897.007', 'X').isValid(), true, 'string 3dp');\n        assert.equal(moment('1379066897.017', 'X').isValid(), true, 'string 3dp');\n        assert.equal(moment('1379066897.157', 'X').isValid(), true, 'string 3dp');\n    });\n\n    test('invalid Unix timestamp', function (assert) {\n        assert.equal(moment(undefined, 'X').isValid(), false, 'undefined');\n        assert.equal(moment('undefined', 'X').isValid(), false, 'string undefined');\n        try {\n            assert.equal(moment(null, 'X').isValid(), false, 'null');\n        } catch (e) {\n            assert.ok(true, 'null');\n        }\n\n        assert.equal(moment('null', 'X').isValid(), false, 'string null');\n        assert.equal(moment([], 'X').isValid(), false, 'array');\n        assert.equal(moment('{}', 'X').isValid(), false, 'object');\n        try {\n            assert.equal(moment('', 'X').isValid(), false, 'string empty');\n        } catch (e) {\n            assert.ok(true, 'string empty');\n        }\n\n        assert.equal(moment(' ', 'X').isValid(), false, 'string space');\n    });\n\n    test('valid Unix offset milliseconds', function (assert) {\n        assert.equal(moment(1234567890123, 'x').isValid(), true, 'number integer');\n        assert.equal(moment('1234567890123', 'x').isValid(), true, 'string integer');\n    });\n\n    test('invalid Unix offset milliseconds', function (assert) {\n        assert.equal(moment(undefined, 'x').isValid(), false, 'undefined');\n        assert.equal(moment('undefined', 'x').isValid(), false, 'string undefined');\n        try {\n            assert.equal(moment(null, 'x').isValid(), false, 'null');\n        } catch (e) {\n            assert.ok(true, 'null');\n        }\n\n        assert.equal(moment('null', 'x').isValid(), false, 'string null');\n        assert.equal(moment([], 'x').isValid(), false, 'array');\n        assert.equal(moment('{}', 'x').isValid(), false, 'object');\n        try {\n            assert.equal(moment('', 'x').isValid(), false, 'string empty');\n        } catch (e) {\n            assert.ok(true, 'string empty');\n        }\n\n        assert.equal(moment(' ', 'x').isValid(), false, 'string space');\n    });\n\n    test('empty', function (assert) {\n        assert.equal(moment(null).isValid(), false, 'null');\n        assert.equal(moment('').isValid(), false, 'empty string');\n        assert.equal(moment(null, 'YYYY').isValid(), false, 'format + null');\n        assert.equal(moment('', 'YYYY').isValid(), false, 'format + empty string');\n        assert.equal(moment(' ', 'YYYY').isValid(), false, 'format + empty when trimmed');\n    });\n\n    test('days of the year', function (assert) {\n        assert.equal(moment('2010 300', 'YYYY DDDD').isValid(), true, 'day 300 of year valid');\n        assert.equal(moment('2010 365', 'YYYY DDDD').isValid(), true, 'day 365 of year valid');\n        assert.equal(moment('2010 366', 'YYYY DDDD').isValid(), false, 'day 366 of year invalid');\n        assert.equal(moment('2012 365', 'YYYY DDDD').isValid(), true, 'day 365 of leap year valid');\n        assert.equal(moment('2012 366', 'YYYY DDDD').isValid(), true, 'day 366 of leap year valid');\n        assert.equal(moment('2012 367', 'YYYY DDDD').isValid(), false, 'day 367 of leap year invalid');\n    });\n\n    test('24:00:00.000 is valid', function (assert) {\n        assert.equal(moment('2014-01-01 24', 'YYYY-MM-DD HH').isValid(), true, '24 is valid');\n        assert.equal(moment('2014-01-01 24:00', 'YYYY-MM-DD HH:mm').isValid(), true, '24:00 is valid');\n        assert.equal(moment('2014-01-01 24:01', 'YYYY-MM-DD HH:mm').isValid(), false, '24:01 is not valid');\n    });\n\n    test('oddball permissiveness', function (assert) {\n        //https://github.com/moment/moment/issues/1128\n        assert.ok(moment('2010-10-3199', ['MM/DD/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD']).isValid());\n\n        //https://github.com/moment/moment/issues/1122\n        assert.ok(moment('3:25', ['h:mma', 'hh:mma', 'H:mm', 'HH:mm']).isValid());\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('leap year');\n\n    test('leap year', function (assert) {\n        assert.equal(moment([2010, 0, 1]).isLeapYear(), false, '2010');\n        assert.equal(moment([2100, 0, 1]).isLeapYear(), false, '2100');\n        assert.equal(moment([2008, 0, 1]).isLeapYear(), true, '2008');\n        assert.equal(moment([2000, 0, 1]).isLeapYear(), true, '2000');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('listers');\n\n    test('default', function (assert) {\n        assert.deepEqual(moment.months(), ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);\n        assert.deepEqual(moment.monthsShort(), ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n        assert.deepEqual(moment.weekdays(), ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']);\n        assert.deepEqual(moment.weekdaysShort(), ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']);\n        assert.deepEqual(moment.weekdaysMin(), ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']);\n    });\n\n    test('index', function (assert) {\n        assert.equal(moment.months(0), 'January');\n        assert.equal(moment.months(2), 'March');\n        assert.equal(moment.monthsShort(0), 'Jan');\n        assert.equal(moment.monthsShort(2), 'Mar');\n        assert.equal(moment.weekdays(0), 'Sunday');\n        assert.equal(moment.weekdays(2), 'Tuesday');\n        assert.equal(moment.weekdaysShort(0), 'Sun');\n        assert.equal(moment.weekdaysShort(2), 'Tue');\n        assert.equal(moment.weekdaysMin(0), 'Su');\n        assert.equal(moment.weekdaysMin(2), 'Tu');\n    });\n\n    test('localized', function (assert) {\n        var months = 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_'),\n            monthsShort = 'on_tw_th_fo_fi_si_se_ei_ni_te_el_tw'.split('_'),\n            weekdays = 'one_two_three_four_five_six_seven'.split('_'),\n            weekdaysShort = 'on_tw_th_fo_fi_si_se'.split('_'),\n            weekdaysMin = '1_2_3_4_5_6_7'.split('_');\n\n        moment.locale('numerologists', {\n            months : months,\n            monthsShort : monthsShort,\n            weekdays : weekdays,\n            weekdaysShort: weekdaysShort,\n            weekdaysMin: weekdaysMin\n        });\n\n        assert.deepEqual(moment.months(), months);\n        assert.deepEqual(moment.monthsShort(), monthsShort);\n        assert.deepEqual(moment.weekdays(), weekdays);\n        assert.deepEqual(moment.weekdaysShort(), weekdaysShort);\n        assert.deepEqual(moment.weekdaysMin(), weekdaysMin);\n\n        assert.equal(moment.months(0), 'one');\n        assert.equal(moment.monthsShort(0), 'on');\n        assert.equal(moment.weekdays(0), 'one');\n        assert.equal(moment.weekdaysShort(0), 'on');\n        assert.equal(moment.weekdaysMin(0), '1');\n\n        assert.equal(moment.months(2), 'three');\n        assert.equal(moment.monthsShort(2), 'th');\n        assert.equal(moment.weekdays(2), 'three');\n        assert.equal(moment.weekdaysShort(2), 'th');\n        assert.equal(moment.weekdaysMin(2), '3');\n    });\n\n    test('with functions', function (assert) {\n        var monthsShort = 'one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve'.split('_'),\n            monthsShortWeird = 'onesy_twosy_threesy_foursy_fivesy_sixsy_sevensy_eightsy_ninesy_tensy_elevensy_twelvesy'.split('_');\n\n        moment.locale('difficult', {\n\n            monthsShort: function (m, format) {\n                var arr = format.match(/-MMM-/) ? monthsShortWeird : monthsShort;\n                return arr[m.month()];\n            }\n        });\n\n        assert.deepEqual(moment.monthsShort(), monthsShort);\n        assert.deepEqual(moment.monthsShort('MMM'), monthsShort);\n        assert.deepEqual(moment.monthsShort('-MMM-'), monthsShortWeird);\n\n        assert.deepEqual(moment.monthsShort('MMM', 2), 'three');\n        assert.deepEqual(moment.monthsShort('-MMM-', 2), 'threesy');\n        assert.deepEqual(moment.monthsShort(2), 'three');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function each(array, callback) {\n        var i;\n        for (i = 0; i < array.length; i++) {\n            callback(array[i], i, array);\n        }\n    }\n\n    var helpers_each = each;\n\n    module('locale', {\n        setup : function () {\n            // TODO: Remove once locales are switched to ES6\n            helpers_each([{\n                name: 'en-gb',\n                data: {}\n            }, {\n                name: 'en-ca',\n                data: {}\n            }, {\n                name: 'es',\n                data: {\n                    relativeTime: {past: 'hace %s', s: 'unos segundos', d: 'un día'},\n                    months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_')\n                }\n            }, {\n                name: 'fr',\n                data: {}\n            }, {\n                name: 'fr-ca',\n                data: {}\n            }, {\n                name: 'it',\n                data: {}\n            }, {\n                name: 'zh-cn',\n                data: {\n                    months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_')\n                }\n            }], function (locale) {\n                if (moment.locale(locale.name) !== locale.name) {\n                    moment.defineLocale(locale.name, locale.data);\n                }\n            });\n            moment.locale('en');\n        }\n    });\n\n    test('library getters and setters', function (assert) {\n        var r = moment.locale('en');\n\n        assert.equal(r, 'en', 'locale should return en by default');\n        assert.equal(moment.locale(), 'en', 'locale should return en by default');\n\n        moment.locale('fr');\n        assert.equal(moment.locale(), 'fr', 'locale should return the changed locale');\n\n        moment.locale('en-gb');\n        assert.equal(moment.locale(), 'en-gb', 'locale should return the changed locale');\n\n        moment.locale('en');\n        assert.equal(moment.locale(), 'en', 'locale should reset');\n\n        moment.locale('does-not-exist');\n        assert.equal(moment.locale(), 'en', 'locale should reset');\n\n        moment.locale('EN');\n        assert.equal(moment.locale(), 'en', 'Normalize locale key case');\n\n        moment.locale('EN_gb');\n        assert.equal(moment.locale(), 'en-gb', 'Normalize locale key underscore');\n    });\n\n    test('library setter array of locales', function (assert) {\n        assert.equal(moment.locale(['non-existent', 'fr', 'also-non-existent']), 'fr', 'passing an array uses the first valid locale');\n        assert.equal(moment.locale(['es', 'fr', 'also-non-existent']), 'es', 'passing an array uses the first valid locale');\n    });\n\n    test('library setter locale substrings', function (assert) {\n        assert.equal(moment.locale('fr-crap'), 'fr', 'use substrings');\n        assert.equal(moment.locale('fr-does-not-exist'), 'fr', 'uses deep substrings');\n        assert.equal(moment.locale('fr-CA-does-not-exist'), 'fr-ca', 'uses deepest substring');\n    });\n\n    test('library getter locale array and substrings', function (assert) {\n        assert.equal(moment.locale(['en-CH', 'fr']), 'en', 'prefer root locale to shallower ones');\n        assert.equal(moment.locale(['en-gb-leeds', 'en-CA']), 'en-gb', 'prefer root locale to shallower ones');\n        assert.equal(moment.locale(['en-fake', 'en-CA']), 'en-ca', 'prefer alternatives with shared roots');\n        assert.equal(moment.locale(['en-fake', 'en-fake2', 'en-ca']), 'en-ca', 'prefer alternatives with shared roots');\n        assert.equal(moment.locale(['fake-CA', 'fake-MX', 'fr']), 'fr', 'always find something if possible');\n        assert.equal(moment.locale(['fake-CA', 'fake-MX', 'fr']), 'fr', 'always find something if possible');\n        assert.equal(moment.locale(['fake-CA', 'fake-MX', 'fr-fake-fake-fake']), 'fr', 'always find something if possible');\n        assert.equal(moment.locale(['en', 'en-CA']), 'en', 'prefer earlier if it works');\n    });\n\n    test('library ensure inheritance', function (assert) {\n        moment.locale('made-up', {\n            // I put them out of order\n            months : 'February_March_April_May_June_July_August_September_October_November_December_January'.split('_')\n            // the rest of the properties should be inherited.\n        });\n\n        assert.equal(moment([2012, 5, 6]).format('MMMM'), 'July', 'Override some of the configs');\n        assert.equal(moment([2012, 5, 6]).format('MMM'), 'Jun', 'But not all of them');\n    });\n\n    test('library ensure inheritance LT L LL LLL LLLL', function (assert) {\n        var locale = 'test-inherit-lt';\n\n        moment.defineLocale(locale, {\n            longDateFormat : {\n                LT : '-[LT]-',\n                L : '-[L]-',\n                LL : '-[LL]-',\n                LLL : '-[LLL]-',\n                LLLL : '-[LLLL]-'\n            },\n            calendar : {\n                sameDay : '[sameDay] LT',\n                nextDay : '[nextDay] L',\n                nextWeek : '[nextWeek] LL',\n                lastDay : '[lastDay] LLL',\n                lastWeek : '[lastWeek] LLLL',\n                sameElse : 'L'\n            }\n        });\n\n        moment.locale('es');\n\n        assert.equal(moment().locale(locale).calendar(), 'sameDay -LT-', 'Should use instance locale in LT formatting');\n        assert.equal(moment().add(1, 'days').locale(locale).calendar(), 'nextDay -L-', 'Should use instance locale in L formatting');\n        assert.equal(moment().add(-1, 'days').locale(locale).calendar(), 'lastDay -LLL-', 'Should use instance locale in LL formatting');\n        assert.equal(moment().add(4, 'days').locale(locale).calendar(), 'nextWeek -LL-', 'Should use instance locale in LLL formatting');\n        assert.equal(moment().add(-4, 'days').locale(locale).calendar(), 'lastWeek -LLLL-', 'Should use instance locale in LLLL formatting');\n    });\n\n    test('library localeData', function (assert) {\n        moment.locale('en');\n\n        var jan = moment([2000, 0]);\n\n        assert.equal(moment.localeData().months(jan), 'January', 'no arguments returns global');\n        assert.equal(moment.localeData('zh-cn').months(jan), '一月', 'a string returns the locale based on key');\n        assert.equal(moment.localeData(moment().locale('es')).months(jan), 'enero', 'if you pass in a moment it uses the moment\\'s locale');\n    });\n\n    test('library deprecations', function (assert) {\n        moment.lang('dude', {months: ['Movember']});\n        assert.equal(moment.locale(), 'dude', 'setting the lang sets the locale');\n        assert.equal(moment.lang(), moment.locale());\n        assert.equal(moment.langData(), moment.localeData(), 'langData is localeData');\n    });\n\n    test('defineLocale', function (assert) {\n        moment.locale('en');\n        moment.defineLocale('dude', {months: ['Movember']});\n        assert.equal(moment().locale(), 'dude', 'defineLocale also sets it');\n        assert.equal(moment().locale('dude').locale(), 'dude', 'defineLocale defines a locale');\n    });\n\n    test('library convenience', function (assert) {\n        moment.locale('something', {week: {dow: 3}});\n        moment.locale('something');\n        assert.equal(moment.locale(), 'something', 'locale can be used to create the locale too');\n    });\n\n    test('firstDayOfWeek firstDayOfYear locale getters', function (assert) {\n        moment.locale('something', {week: {dow: 3, doy: 4}});\n        moment.locale('something');\n        assert.equal(moment.localeData().firstDayOfWeek(), 3, 'firstDayOfWeek');\n        assert.equal(moment.localeData().firstDayOfYear(), 4, 'firstDayOfYear');\n    });\n\n    test('instance locale method', function (assert) {\n        moment.locale('en');\n\n        assert.equal(moment([2012, 5, 6]).format('MMMM'), 'June', 'Normally default to global');\n        assert.equal(moment([2012, 5, 6]).locale('es').format('MMMM'), 'junio', 'Use the instance specific locale');\n        assert.equal(moment([2012, 5, 6]).format('MMMM'), 'June', 'Using an instance specific locale does not affect other moments');\n    });\n\n    test('instance locale method with array', function (assert) {\n        var m = moment().locale(['non-existent', 'fr', 'also-non-existent']);\n        assert.equal(m.locale(), 'fr', 'passing an array uses the first valid locale');\n        m = moment().locale(['es', 'fr', 'also-non-existent']);\n        assert.equal(m.locale(), 'es', 'passing an array uses the first valid locale');\n    });\n\n    test('instance getter locale substrings', function (assert) {\n        var m = moment();\n\n        m.locale('fr-crap');\n        assert.equal(m.locale(), 'fr', 'use substrings');\n\n        m.locale('fr-does-not-exist');\n        assert.equal(m.locale(), 'fr', 'uses deep substrings');\n    });\n\n    test('instance locale persists with manipulation', function (assert) {\n        moment.locale('en');\n\n        assert.equal(moment([2012, 5, 6]).locale('es').add({days: 1}).format('MMMM'), 'junio', 'With addition');\n        assert.equal(moment([2012, 5, 6]).locale('es').day(0).format('MMMM'), 'junio', 'With day getter');\n        assert.equal(moment([2012, 5, 6]).locale('es').endOf('day').format('MMMM'), 'junio', 'With endOf');\n    });\n\n    test('instance locale persists with cloning', function (assert) {\n        moment.locale('en');\n\n        var a = moment([2012, 5, 6]).locale('es'),\n            b = a.clone(),\n            c = moment(a);\n\n        assert.equal(b.format('MMMM'), 'junio', 'using moment.fn.clone()');\n        assert.equal(b.format('MMMM'), 'junio', 'using moment()');\n    });\n\n    test('duration locale method', function (assert) {\n        moment.locale('en');\n\n        assert.equal(moment.duration({seconds:  44}).humanize(), 'a few seconds', 'Normally default to global');\n        assert.equal(moment.duration({seconds:  44}).locale('es').humanize(), 'unos segundos', 'Use the instance specific locale');\n        assert.equal(moment.duration({seconds:  44}).humanize(), 'a few seconds', 'Using an instance specific locale does not affect other durations');\n    });\n\n    test('duration locale persists with cloning', function (assert) {\n        moment.locale('en');\n\n        var a = moment.duration({seconds:  44}).locale('es'),\n            b = moment.duration(a);\n\n        assert.equal(b.humanize(), 'unos segundos', 'using moment.duration()');\n    });\n\n    test('changing the global locale doesn\\'t affect existing duration instances', function (assert) {\n        var mom = moment.duration();\n        moment.locale('fr');\n        assert.equal('en', mom.locale());\n    });\n\n    test('duration deprecations', function (assert) {\n        assert.equal(moment.duration().lang(), moment.duration().localeData(), 'duration.lang is the same as duration.localeData');\n    });\n\n    test('from relative time future', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({s: 44})),  'in a few seconds', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({s: 45})),  'in a minute',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({s: 89})),  'in a minute',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({s: 90})),  'in 2 minutes',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({m: 44})),  'in 44 minutes',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({m: 45})),  'in an hour',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({m: 89})),  'in an hour',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({m: 90})),  'in 2 hours',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({h: 5})),   'in 5 hours',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({h: 21})),  'in 21 hours',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({h: 22})),  'in a day',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({h: 35})),  'in a day',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({h: 36})),  'in 2 days',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 1})),   'in a day',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 5})),   'in 5 days',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 25})),  'in 25 days',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 26})),  'in a month',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 30})),  'in a month',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 45})),  'in a month',       '45 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 47})),  'in 2 months',      '47 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 74})),  'in 2 months',      '74 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 78})),  'in 3 months',      '78 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({M: 1})),   'in a month',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({M: 5})),   'in 5 months',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 315})), 'in 10 months',     '315 days = 10 months');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 344})), 'in a year',        '344 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 345})), 'in a year',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({d: 548})), 'in 2 years',       '548 days = in 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({y: 1})),   'in a year',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).subtract({y: 5})),   'in 5 years',       '5 years = 5 years');\n    });\n\n    test('from relative time past', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 44})),  'a few seconds ago', '44 seconds = a few seconds');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 45})),  'a minute ago',      '45 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 89})),  'a minute ago',      '89 seconds = a minute');\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90})),  '2 minutes ago',     '90 seconds = 2 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 44})),  '44 minutes ago',    '44 minutes = 44 minutes');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 45})),  'an hour ago',       '45 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 89})),  'an hour ago',       '89 minutes = an hour');\n        assert.equal(start.from(moment([2007, 1, 28]).add({m: 90})),  '2 hours ago',       '90 minutes = 2 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 5})),   '5 hours ago',       '5 hours = 5 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 21})),  '21 hours ago',      '21 hours = 21 hours');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 22})),  'a day ago',         '22 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 35})),  'a day ago',         '35 hours = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({h: 36})),  '2 days ago',        '36 hours = 2 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 1})),   'a day ago',         '1 day = a day');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 5})),   '5 days ago',        '5 days = 5 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 25})),  '25 days ago',       '25 days = 25 days');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 26})),  'a month ago',       '26 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 30})),  'a month ago',       '30 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 43})),  'a month ago',       '43 days = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 46})),  '2 months ago',      '46 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 74})),  '2 months ago',      '75 days = 2 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 76})),  '3 months ago',      '76 days = 3 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 1})),   'a month ago',       '1 month = a month');\n        assert.equal(start.from(moment([2007, 1, 28]).add({M: 5})),   '5 months ago',      '5 months = 5 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 315})), '10 months ago',     '315 days = 10 months');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 344})), 'a year ago',        '344 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 345})), 'a year ago',        '345 days = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({d: 548})), '2 years ago',       '548 days = 2 years');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 1})),   'a year ago',        '1 year = a year');\n        assert.equal(start.from(moment([2007, 1, 28]).add({y: 5})),   '5 years ago',       '5 years = 5 years');\n    });\n\n    test('instance locale used with from', function (assert) {\n        moment.locale('en');\n\n        var a = moment([2012, 5, 6]).locale('es'),\n            b = moment([2012, 5, 7]);\n\n        assert.equal(a.from(b), 'hace un día', 'preserve locale of first moment');\n        assert.equal(b.from(a), 'in a day', 'do not preserve locale of second moment');\n    });\n\n    test('instance localeData', function (assert) {\n        moment.defineLocale('dude', {week: {dow: 3}});\n        assert.equal(moment().locale('dude').localeData()._week.dow, 3);\n    });\n\n    test('month name callback function', function (assert) {\n        function fakeReplace(m, format) {\n            if (/test/.test(format)) {\n                return 'test';\n            }\n            if (m.date() === 1) {\n                return 'date';\n            }\n            return 'default';\n        }\n\n        moment.locale('made-up-2', {\n            months : fakeReplace,\n            monthsShort : fakeReplace,\n            weekdays : fakeReplace,\n            weekdaysShort : fakeReplace,\n            weekdaysMin : fakeReplace\n        });\n\n        assert.equal(moment().format('[test] dd ddd dddd MMM MMMM'), 'test test test test test test', 'format month name function should be able to access the format string');\n        assert.equal(moment([2011, 0, 1]).format('dd ddd dddd MMM MMMM'), 'date date date date date', 'format month name function should be able to access the moment object');\n        assert.equal(moment([2011, 0, 2]).format('dd ddd dddd MMM MMMM'), 'default default default default default', 'format month name function should be able to access the moment object');\n    });\n\n    test('changing parts of a locale config', function (assert) {\n        moment.locale('partial-lang', {\n            months : 'a b c d e f g h i j k l'.split(' ')\n        });\n\n        assert.equal(moment([2011, 0, 1]).format('MMMM'), 'a', 'should be able to set locale values when creating the localeuage');\n\n        moment.locale('partial-lang', {\n            monthsShort : 'A B C D E F G H I J K L'.split(' ')\n        });\n\n        assert.equal(moment([2011, 0, 1]).format('MMMM MMM'), 'a A', 'should be able to set locale values after creating the localeuage');\n    });\n\n    test('start/endOf week feature for first-day-is-monday locales', function (assert) {\n        moment.locale('monday-lang', {\n            week : {\n                dow : 1 // Monday is the first day of the week\n            }\n        });\n\n        moment.locale('monday-lang');\n        assert.equal(moment([2013, 0, 1]).startOf('week').day(), 1, 'for locale monday-lang first day of the week should be monday');\n        assert.equal(moment([2013, 0, 1]).endOf('week').day(), 0, 'for locale monday-lang last day of the week should be sunday');\n    });\n\n    test('meridiem parsing', function (assert) {\n        moment.locale('meridiem-parsing', {\n            meridiemParse : /[bd]/i,\n            isPM : function (input) {\n                return input === 'b';\n            }\n        });\n\n        moment.locale('meridiem-parsing');\n        assert.equal(moment('2012-01-01 3b', 'YYYY-MM-DD ha').hour(), 15, 'Custom parsing of meridiem should work');\n        assert.equal(moment('2012-01-01 3d', 'YYYY-MM-DD ha').hour(), 3, 'Custom parsing of meridiem should work');\n    });\n\n    test('invalid date formatting', function (assert) {\n        moment.locale('has-invalid', {\n            invalidDate: 'KHAAAAAAAAAAAN!'\n        });\n\n        assert.equal(moment.invalid().format(), 'KHAAAAAAAAAAAN!');\n        assert.equal(moment.invalid().format('YYYY-MM-DD'), 'KHAAAAAAAAAAAN!');\n    });\n\n    test('return locale name', function (assert) {\n        var registered = moment.locale('return-this', {});\n\n        assert.equal(registered, 'return-this', 'returns the locale configured');\n    });\n\n    test('changing the global locale doesn\\'t affect existing instances', function (assert) {\n        var mom = moment();\n        moment.locale('fr');\n        assert.equal('en', mom.locale());\n    });\n\n    test('setting a language on instance returns the original moment for chaining', function (assert) {\n        var mom = moment();\n\n        assert.equal(mom.lang('fr'), mom, 'setting the language (lang) returns the original moment for chaining');\n        assert.equal(mom.locale('it'), mom, 'setting the language (locale) returns the original moment for chaining');\n    });\n\n    test('lang(key) changes the language of the instance', function (assert) {\n        var m = moment().month(0);\n        m.lang('fr');\n        assert.equal(m.locale(), 'fr', 'm.lang(key) changes instance locale');\n    });\n\n    test('moment#locale(false) resets to global locale', function (assert) {\n        var m = moment();\n\n        moment.locale('fr');\n        m.locale('it');\n\n        assert.equal(moment.locale(), 'fr', 'global locale is it');\n        assert.equal(m.locale(), 'it', 'instance locale is it');\n        m.locale(false);\n        assert.equal(m.locale(), 'fr', 'instance locale reset to global locale');\n    });\n\n    test('moment().locale with missing key doesn\\'t change locale', function (assert) {\n        assert.equal(moment().locale('boo').localeData(), moment.localeData(),\n                'preserve global locale in case of bad locale id');\n    });\n\n    test('moment().lang with missing key doesn\\'t change locale', function (assert) {\n        assert.equal(moment().lang('boo').localeData(), moment.localeData(),\n                'preserve global locale in case of bad locale id');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('min max');\n\n    test('min', function (assert) {\n        var now = moment(),\n            future = now.clone().add(1, 'month'),\n            past = now.clone().subtract(1, 'month');\n\n        assert.equal(moment.min(now, future, past), past, 'min(now, future, past)');\n        assert.equal(moment.min(future, now, past), past, 'min(future, now, past)');\n        assert.equal(moment.min(future, past, now), past, 'min(future, past, now)');\n        assert.equal(moment.min(past, future, now), past, 'min(past, future, now)');\n        assert.equal(moment.min(now, past), past, 'min(now, past)');\n        assert.equal(moment.min(past, now), past, 'min(past, now)');\n        assert.equal(moment.min(now), now, 'min(now, past)');\n\n        assert.equal(moment.min([now, future, past]), past, 'min([now, future, past])');\n        assert.equal(moment.min([now, past]), past, 'min(now, past)');\n        assert.equal(moment.min([now]), now, 'min(now)');\n    });\n\n    test('max', function (assert) {\n        var now = moment(),\n            future = now.clone().add(1, 'month'),\n            past = now.clone().subtract(1, 'month');\n\n        assert.equal(moment.max(now, future, past), future, 'max(now, future, past)');\n        assert.equal(moment.max(future, now, past), future, 'max(future, now, past)');\n        assert.equal(moment.max(future, past, now), future, 'max(future, past, now)');\n        assert.equal(moment.max(past, future, now), future, 'max(past, future, now)');\n        assert.equal(moment.max(now, past), now, 'max(now, past)');\n        assert.equal(moment.max(past, now), now, 'max(past, now)');\n        assert.equal(moment.max(now), now, 'max(now, past)');\n\n        assert.equal(moment.max([now, future, past]), future, 'max([now, future, past])');\n        assert.equal(moment.max([now, past]), now, 'max(now, past)');\n        assert.equal(moment.max([now]), now, 'max(now)');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('mutable');\n\n    test('manipulation methods', function (assert) {\n        var m = moment();\n\n        assert.equal(m, m.year(2011), 'year() should be mutable');\n        assert.equal(m, m.month(1), 'month() should be mutable');\n        assert.equal(m, m.hours(7), 'hours() should be mutable');\n        assert.equal(m, m.minutes(33), 'minutes() should be mutable');\n        assert.equal(m, m.seconds(44), 'seconds() should be mutable');\n        assert.equal(m, m.milliseconds(55), 'milliseconds() should be mutable');\n        assert.equal(m, m.day(2), 'day() should be mutable');\n        assert.equal(m, m.startOf('week'), 'startOf() should be mutable');\n        assert.equal(m, m.add(1, 'days'), 'add() should be mutable');\n        assert.equal(m, m.subtract(2, 'years'), 'subtract() should be mutable');\n        assert.equal(m, m.local(), 'local() should be mutable');\n        assert.equal(m, m.utc(), 'utc() should be mutable');\n    });\n\n    test('non mutable methods', function (assert) {\n        var m = moment();\n        assert.notEqual(m, m.clone(), 'clone() should not be mutable');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('normalize units');\n\n    test('normalize units', function (assert) {\n        var fullKeys = ['year', 'quarter', 'month', 'isoWeek', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', 'date', 'dayOfYear', 'weekday', 'isoWeekday', 'weekYear', 'isoWeekYear'],\n            aliases = ['y', 'Q', 'M', 'W', 'w', 'd', 'h', 'm', 's', 'ms', 'D', 'DDD', 'e', 'E', 'gg', 'GG'],\n            length = fullKeys.length,\n            fullKey,\n            fullKeyCaps,\n            fullKeyPlural,\n            fullKeyCapsPlural,\n            fullKeyLower,\n            alias,\n            index;\n\n        for (index = 0; index < length; index += 1) {\n            fullKey = fullKeys[index];\n            fullKeyCaps = fullKey.toUpperCase();\n            fullKeyLower = fullKey.toLowerCase();\n            fullKeyPlural = fullKey + 's';\n            fullKeyCapsPlural = fullKeyCaps + 's';\n            alias = aliases[index];\n            assert.equal(moment.normalizeUnits(fullKey), fullKey, 'Testing full key ' + fullKey);\n            assert.equal(moment.normalizeUnits(fullKeyCaps), fullKey, 'Testing full key capitalised ' + fullKey);\n            assert.equal(moment.normalizeUnits(fullKeyPlural), fullKey, 'Testing full key plural ' + fullKey);\n            assert.equal(moment.normalizeUnits(fullKeyCapsPlural), fullKey, 'Testing full key capitalised and plural ' + fullKey);\n            assert.equal(moment.normalizeUnits(alias), fullKey, 'Testing alias ' + fullKey);\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('parsing flags');\n\n    function flags () {\n        return moment.apply(null, arguments).parsingFlags();\n    }\n\n    test('overflow with array', function (assert) {\n        //months\n        assert.equal(flags([2010, 0]).overflow, -1, 'month 0 valid');\n        assert.equal(flags([2010, 1]).overflow, -1, 'month 1 valid');\n        assert.equal(flags([2010, -1]).overflow, 1, 'month -1 invalid');\n        assert.equal(flags([2100, 12]).overflow, 1, 'month 12 invalid');\n\n        //days\n        assert.equal(flags([2010, 1, 16]).overflow, -1, 'date valid');\n        assert.equal(flags([2010, 1, -1]).overflow, 2, 'date -1 invalid');\n        assert.equal(flags([2010, 1, 0]).overflow, 2, 'date 0 invalid');\n        assert.equal(flags([2010, 1, 32]).overflow, 2, 'date 32 invalid');\n        assert.equal(flags([2012, 1, 29]).overflow, -1, 'date leap year valid');\n        assert.equal(flags([2010, 1, 29]).overflow, 2, 'date leap year invalid');\n\n        //hours\n        assert.equal(flags([2010, 1, 1, 8]).overflow, -1, 'hour valid');\n        assert.equal(flags([2010, 1, 1, 0]).overflow, -1, 'hour 0 valid');\n        assert.equal(flags([2010, 1, 1, -1]).overflow, 3, 'hour -1 invalid');\n        assert.equal(flags([2010, 1, 1, 25]).overflow, 3, 'hour 25 invalid');\n        assert.equal(flags([2010, 1, 1, 24, 1]).overflow, 3, 'hour 24:01 invalid');\n\n        //minutes\n        assert.equal(flags([2010, 1, 1, 8, 15]).overflow, -1, 'minute valid');\n        assert.equal(flags([2010, 1, 1, 8, 0]).overflow, -1, 'minute 0 valid');\n        assert.equal(flags([2010, 1, 1, 8, -1]).overflow, 4, 'minute -1 invalid');\n        assert.equal(flags([2010, 1, 1, 8, 60]).overflow, 4, 'minute 60 invalid');\n\n        //seconds\n        assert.equal(flags([2010, 1, 1, 8, 15, 12]).overflow, -1, 'second valid');\n        assert.equal(flags([2010, 1, 1, 8, 15, 0]).overflow, -1, 'second 0 valid');\n        assert.equal(flags([2010, 1, 1, 8, 15, -1]).overflow, 5, 'second -1 invalid');\n        assert.equal(flags([2010, 1, 1, 8, 15, 60]).overflow, 5, 'second 60 invalid');\n\n        //milliseconds\n        assert.equal(flags([2010, 1, 1, 8, 15, 12, 345]).overflow, -1, 'millisecond valid');\n        assert.equal(flags([2010, 1, 1, 8, 15, 12, 0]).overflow, -1, 'millisecond 0 valid');\n        assert.equal(flags([2010, 1, 1, 8, 15, 12, -1]).overflow, 6, 'millisecond -1 invalid');\n        assert.equal(flags([2010, 1, 1, 8, 15, 12, 1000]).overflow, 6, 'millisecond 1000 invalid');\n\n        // 24 hrs\n        assert.equal(flags([2010, 1, 1, 24, 0, 0, 0]).overflow, -1, '24:00:00.000 is fine');\n        assert.equal(flags([2010, 1, 1, 24, 1, 0, 0]).overflow, 3, '24:01:00.000 is wrong hour');\n        assert.equal(flags([2010, 1, 1, 24, 0, 1, 0]).overflow, 3, '24:00:01.000 is wrong hour');\n        assert.equal(flags([2010, 1, 1, 24, 0, 0, 1]).overflow, 3, '24:00:00.001 is wrong hour');\n    });\n\n    test('overflow without format', function (assert) {\n        //months\n        assert.equal(flags('2001-01', 'YYYY-MM').overflow, -1, 'month 1 valid');\n        assert.equal(flags('2001-12', 'YYYY-MM').overflow, -1, 'month 12 valid');\n        assert.equal(flags('2001-13', 'YYYY-MM').overflow, 1, 'month 13 invalid');\n\n        //days\n        assert.equal(flags('2010-01-16', 'YYYY-MM-DD').overflow, -1, 'date 16 valid');\n        assert.equal(flags('2010-01-0',  'YYYY-MM-DD').overflow, 2, 'date 0 invalid');\n        assert.equal(flags('2010-01-32', 'YYYY-MM-DD').overflow, 2, 'date 32 invalid');\n        assert.equal(flags('2012-02-29', 'YYYY-MM-DD').overflow, -1, 'date leap year valid');\n        assert.equal(flags('2010-02-29', 'YYYY-MM-DD').overflow, 2, 'date leap year invalid');\n\n        //days of the year\n        assert.equal(flags('2010 300', 'YYYY DDDD').overflow, -1, 'day 300 of year valid');\n        assert.equal(flags('2010 365', 'YYYY DDDD').overflow, -1, 'day 365 of year valid');\n        assert.equal(flags('2010 366', 'YYYY DDDD').overflow, 2, 'day 366 of year invalid');\n        assert.equal(flags('2012 366', 'YYYY DDDD').overflow, -1, 'day 366 of leap year valid');\n        assert.equal(flags('2012 367', 'YYYY DDDD').overflow, 2, 'day 367 of leap year invalid');\n\n        //hours\n        assert.equal(flags('08', 'HH').overflow, -1, 'hour valid');\n        assert.equal(flags('00', 'HH').overflow, -1, 'hour 0 valid');\n        assert.equal(flags('25', 'HH').overflow, 3, 'hour 25 invalid');\n        assert.equal(flags('24:01', 'HH:mm').overflow, 3, 'hour 24:01 invalid');\n\n        //minutes\n        assert.equal(flags('08:15', 'HH:mm').overflow, -1, 'minute valid');\n        assert.equal(flags('08:00', 'HH:mm').overflow, -1, 'minute 0 valid');\n        assert.equal(flags('08:60', 'HH:mm').overflow, 4, 'minute 60 invalid');\n\n        //seconds\n        assert.equal(flags('08:15:12', 'HH:mm:ss').overflow, -1, 'second valid');\n        assert.equal(flags('08:15:00', 'HH:mm:ss').overflow, -1, 'second 0 valid');\n        assert.equal(flags('08:15:60', 'HH:mm:ss').overflow, 5, 'second 60 invalid');\n\n        //milliseconds\n        assert.equal(flags('08:15:12:345', 'HH:mm:ss:SSSS').overflow, -1, 'millisecond valid');\n        assert.equal(flags('08:15:12:000', 'HH:mm:ss:SSSS').overflow, -1, 'millisecond 0 valid');\n\n        //this is OK because we don't match the last digit, so it's 100 ms\n        assert.equal(flags('08:15:12:1000', 'HH:mm:ss:SSSS').overflow, -1, 'millisecond 1000 actually valid');\n    });\n\n    test('extra tokens', function (assert) {\n        assert.deepEqual(flags('1982-05-25', 'YYYY-MM-DD').unusedTokens, [], 'nothing extra');\n        assert.deepEqual(flags('1982-05', 'YYYY-MM-DD').unusedTokens, ['DD'], 'extra formatting token');\n        assert.deepEqual(flags('1982', 'YYYY-MM-DD').unusedTokens, ['MM', 'DD'], 'multiple extra formatting tokens');\n        assert.deepEqual(flags('1982-05', 'YYYY-MM-').unusedTokens, [], 'extra non-formatting token');\n        assert.deepEqual(flags('1982-05-', 'YYYY-MM-DD').unusedTokens, ['DD'], 'non-extra non-formatting token');\n        assert.deepEqual(flags('1982 05 1982', 'YYYY-MM-DD').unusedTokens, [], 'different non-formatting token');\n    });\n\n    test('extra tokens strict', function (assert) {\n        assert.deepEqual(flags('1982-05-25', 'YYYY-MM-DD', true).unusedTokens, [], 'nothing extra');\n        assert.deepEqual(flags('1982-05', 'YYYY-MM-DD', true).unusedTokens, ['-', 'DD'], 'extra formatting token');\n        assert.deepEqual(flags('1982', 'YYYY-MM-DD', true).unusedTokens, ['-', 'MM', '-', 'DD'], 'multiple extra formatting tokens');\n        assert.deepEqual(flags('1982-05', 'YYYY-MM-', true).unusedTokens, ['-'], 'extra non-formatting token');\n        assert.deepEqual(flags('1982-05-', 'YYYY-MM-DD', true).unusedTokens, ['DD'], 'non-extra non-formatting token');\n        assert.deepEqual(flags('1982 05 1982', 'YYYY-MM-DD', true).unusedTokens, ['-', '-'], 'different non-formatting token');\n    });\n\n    test('unused input', function (assert) {\n        assert.deepEqual(flags('1982-05-25', 'YYYY-MM-DD').unusedInput, [], 'normal input');\n        assert.deepEqual(flags('1982-05-25 this is more stuff', 'YYYY-MM-DD').unusedInput, [' this is more stuff'], 'trailing nonsense');\n        assert.deepEqual(flags('1982-05-25 09:30', 'YYYY-MM-DD').unusedInput, [' 09:30'], ['trailing legit-looking input']);\n        assert.deepEqual(flags('1982-05-25 some junk', 'YYYY-MM-DD [some junk]').unusedInput, [], 'junk that actually gets matched');\n        assert.deepEqual(flags('stuff at beginning 1982-05-25', 'YYYY-MM-DD').unusedInput, ['stuff at beginning '], 'leading junk');\n        assert.deepEqual(flags('junk 1982 more junk 05 yet more junk25', 'YYYY-MM-DD').unusedInput, ['junk ', ' more junk ', ' yet more junk'], 'interstitial junk');\n    });\n\n    test('unused input strict', function (assert) {\n        assert.deepEqual(flags('1982-05-25', 'YYYY-MM-DD', true).unusedInput, [], 'normal input');\n        assert.deepEqual(flags('1982-05-25 this is more stuff', 'YYYY-MM-DD', true).unusedInput, [' this is more stuff'], 'trailing nonsense');\n        assert.deepEqual(flags('1982-05-25 09:30', 'YYYY-MM-DD', true).unusedInput, [' 09:30'], ['trailing legit-looking input']);\n        assert.deepEqual(flags('1982-05-25 some junk', 'YYYY-MM-DD [some junk]', true).unusedInput, [], 'junk that actually gets matched');\n        assert.deepEqual(flags('stuff at beginning 1982-05-25', 'YYYY-MM-DD', true).unusedInput, ['stuff at beginning '], 'leading junk');\n        assert.deepEqual(flags('junk 1982 more junk 05 yet more junk25', 'YYYY-MM-DD', true).unusedInput, ['junk ', ' more junk ', ' yet more junk'], 'interstitial junk');\n    });\n\n    test('chars left over', function (assert) {\n        assert.equal(flags('1982-05-25', 'YYYY-MM-DD').charsLeftOver, 0, 'normal input');\n        assert.equal(flags('1982-05-25 this is more stuff', 'YYYY-MM-DD').charsLeftOver, ' this is more stuff'.length, 'trailing nonsense');\n        assert.equal(flags('1982-05-25 09:30', 'YYYY-MM-DD').charsLeftOver, ' 09:30'.length, 'trailing legit-looking input');\n        assert.equal(flags('stuff at beginning 1982-05-25', 'YYYY-MM-DD').charsLeftOver, 'stuff at beginning '.length, 'leading junk');\n        assert.equal(flags('1982 junk 05 more junk25', 'YYYY-MM-DD').charsLeftOver, [' junk ', ' more junk'].join('').length, 'interstitial junk');\n        assert.equal(flags('stuff at beginning 1982 junk 05 more junk25', 'YYYY-MM-DD').charsLeftOver, ['stuff at beginning ', ' junk ', ' more junk'].join('').length, 'leading and interstitial junk');\n    });\n\n    test('empty', function (assert) {\n        assert.equal(flags('1982-05-25', 'YYYY-MM-DD').empty, false, 'normal input');\n        assert.equal(flags('nothing here', 'YYYY-MM-DD').empty, true, 'pure garbage');\n        assert.equal(flags('junk but has the number 2000 in it', 'YYYY-MM-DD').empty, false, 'only mostly garbage');\n        assert.equal(flags('', 'YYYY-MM-DD').empty, true, 'empty string');\n        assert.equal(flags('', 'YYYY-MM-DD').empty, true, 'blank string');\n    });\n\n    test('null', function (assert) {\n        assert.equal(flags('1982-05-25', 'YYYY-MM-DD').nullInput, false, 'normal input');\n        assert.equal(flags(null).nullInput, true, 'just null');\n        assert.equal(flags(null, 'YYYY-MM-DD').nullInput, true, 'null with format');\n    });\n\n    test('invalid month', function (assert) {\n        assert.equal(flags('1982 May', 'YYYY MMMM').invalidMonth, null, 'normal input');\n        assert.equal(flags('1982 Laser', 'YYYY MMMM').invalidMonth, 'Laser', 'bad month name');\n    });\n\n    test('empty format array', function (assert) {\n        assert.equal(flags('1982 May', ['YYYY MMM']).invalidFormat, false, 'empty format array');\n        assert.equal(flags('1982 May', []).invalidFormat, true, 'empty format array');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    var symbolMap = {\n            '1': '!',\n            '2': '@',\n            '3': '#',\n            '4': '$',\n            '5': '%',\n            '6': '^',\n            '7': '&',\n            '8': '*',\n            '9': '(',\n            '0': ')'\n        },\n        numberMap = {\n            '!': '1',\n            '@': '2',\n            '#': '3',\n            '$': '4',\n            '%': '5',\n            '^': '6',\n            '&': '7',\n            '*': '8',\n            '(': '9',\n            ')': '0'\n        };\n\n    module('preparse and postformat', {\n        setup: function () {\n            moment.locale('symbol', {\n                preparse: function (string) {\n                    return string.replace(/[!@#$%\\^&*()]/g, function (match) {\n                        return numberMap[match];\n                    });\n                },\n\n                postformat: function (string) {\n                    return string.replace(/\\d/g, function (match) {\n                        return symbolMap[match];\n                    });\n                }\n            });\n        }\n    });\n\n    test('transform', function (assert) {\n        assert.equal(moment.utc('@)!@-)*-@&', 'YYYY-MM-DD').unix(), 1346025600, 'preparse string + format');\n        assert.equal(moment.utc('@)!@-)*-@&').unix(), 1346025600, 'preparse ISO8601 string');\n        assert.equal(moment.unix(1346025600).utc().format('YYYY-MM-DD'), '@)!@-)*-@&', 'postformat');\n    });\n\n    test('transform from', function (assert) {\n        var start = moment([2007, 1, 28]);\n\n        assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '@ minutes', 'postformat should work on moment.fn.from');\n        assert.equal(moment().add(6, 'd').fromNow(true), '^ days', 'postformat should work on moment.fn.fromNow');\n        assert.equal(moment.duration(10, 'h').humanize(), '!) hours', 'postformat should work on moment.duration.fn.humanize');\n    });\n\n    test('calendar day', function (assert) {\n        var a = moment().hours(2).minutes(0).seconds(0);\n\n        assert.equal(moment(a).calendar(),                   'Today at @:)) AM',     'today at the same time');\n        assert.equal(moment(a).add({m: 25}).calendar(),      'Today at @:@% AM',     'Now plus 25 min');\n        assert.equal(moment(a).add({h: 1}).calendar(),       'Today at #:)) AM',     'Now plus 1 hour');\n        assert.equal(moment(a).add({d: 1}).calendar(),       'Tomorrow at @:)) AM',  'tomorrow at the same time');\n        assert.equal(moment(a).subtract({h: 1}).calendar(),  'Today at !:)) AM',     'Now minus 1 hour');\n        assert.equal(moment(a).subtract({d: 1}).calendar(),  'Yesterday at @:)) AM', 'yesterday at the same time');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('quarter');\n\n    test('library quarter getter', function (assert) {\n        assert.equal(moment([1985,  1,  4]).quarter(), 1, 'Feb  4 1985 is Q1');\n        assert.equal(moment([2029,  8, 18]).quarter(), 3, 'Sep 18 2029 is Q3');\n        assert.equal(moment([2013,  3, 24]).quarter(), 2, 'Apr 24 2013 is Q2');\n        assert.equal(moment([2015,  2,  5]).quarter(), 1, 'Mar  5 2015 is Q1');\n        assert.equal(moment([1970,  0,  2]).quarter(), 1, 'Jan  2 1970 is Q1');\n        assert.equal(moment([2001, 11, 12]).quarter(), 4, 'Dec 12 2001 is Q4');\n        assert.equal(moment([2000,  0,  2]).quarter(), 1, 'Jan  2 2000 is Q1');\n    });\n\n    test('quarter setter singular', function (assert) {\n        var m = moment([2014, 4, 11]);\n        assert.equal(m.quarter(2).month(), 4, 'set same quarter');\n        assert.equal(m.quarter(3).month(), 7, 'set 3rd quarter');\n        assert.equal(m.quarter(1).month(), 1, 'set 1st quarter');\n        assert.equal(m.quarter(4).month(), 10, 'set 4th quarter');\n    });\n\n    test('quarter setter plural', function (assert) {\n        var m = moment([2014, 4, 11]);\n        assert.equal(m.quarters(2).month(), 4, 'set same quarter');\n        assert.equal(m.quarters(3).month(), 7, 'set 3rd quarter');\n        assert.equal(m.quarters(1).month(), 1, 'set 1st quarter');\n        assert.equal(m.quarters(4).month(), 10, 'set 4th quarter');\n    });\n\n    test('quarter setter programmatic', function (assert) {\n        var m = moment([2014, 4, 11]);\n        assert.equal(m.set('quarter', 2).month(), 4, 'set same quarter');\n        assert.equal(m.set('quarter', 3).month(), 7, 'set 3rd quarter');\n        assert.equal(m.set('quarter', 1).month(), 1, 'set 1st quarter');\n        assert.equal(m.set('quarter', 4).month(), 10, 'set 4th quarter');\n    });\n\n    test('quarter setter programmatic plural', function (assert) {\n        var m = moment([2014, 4, 11]);\n        assert.equal(m.set('quarters', 2).month(), 4, 'set same quarter');\n        assert.equal(m.set('quarters', 3).month(), 7, 'set 3rd quarter');\n        assert.equal(m.set('quarters', 1).month(), 1, 'set 1st quarter');\n        assert.equal(m.set('quarters', 4).month(), 10, 'set 4th quarter');\n    });\n\n    test('quarter setter programmatic abbr', function (assert) {\n        var m = moment([2014, 4, 11]);\n        assert.equal(m.set('Q', 2).month(), 4, 'set same quarter');\n        assert.equal(m.set('Q', 3).month(), 7, 'set 3rd quarter');\n        assert.equal(m.set('Q', 1).month(), 1, 'set 1st quarter');\n        assert.equal(m.set('Q', 4).month(), 10, 'set 4th quarter');\n    });\n\n    test('quarter setter only month changes', function (assert) {\n        var m = moment([2014, 4, 11, 1, 2, 3, 4]).quarter(4);\n        assert.equal(m.year(), 2014, 'keep year');\n        assert.equal(m.month(), 10, 'set month');\n        assert.equal(m.date(), 11, 'keep date');\n        assert.equal(m.hour(), 1, 'keep hour');\n        assert.equal(m.minute(), 2, 'keep minutes');\n        assert.equal(m.second(), 3, 'keep seconds');\n        assert.equal(m.millisecond(), 4, 'keep milliseconds');\n    });\n\n    test('quarter setter bubble to next year', function (assert) {\n        var m = moment([2014, 4, 11, 1, 2, 3, 4]).quarter(7);\n        assert.equal(m.year(), 2015, 'year bubbled');\n        assert.equal(m.month(), 7, 'set month');\n        assert.equal(m.date(), 11, 'keep date');\n        assert.equal(m.hour(), 1, 'keep hour');\n        assert.equal(m.minute(), 2, 'keep minutes');\n        assert.equal(m.second(), 3, 'keep seconds');\n        assert.equal(m.millisecond(), 4, 'keep milliseconds');\n    });\n\n    test('quarter diff', function (assert) {\n        assert.equal(moment('2014-01-01').diff(moment('2014-04-01'), 'quarter'),\n                -1, 'diff -1 quarter');\n        assert.equal(moment('2014-04-01').diff(moment('2014-01-01'), 'quarter'),\n                1, 'diff 1 quarter');\n        assert.equal(moment('2014-05-01').diff(moment('2014-01-01'), 'quarter'),\n                1, 'diff 1 quarter');\n        assert.ok(Math.abs((4 / 3) - moment('2014-05-01').diff(\n                        moment('2014-01-01'), 'quarter', true)) < 0.00001,\n                'diff 1 1/3 quarter');\n        assert.equal(moment('2015-01-01').diff(moment('2014-01-01'), 'quarter'),\n                4, 'diff 4 quarters');\n    });\n\n    test('quarter setter bubble to previous year', function (assert) {\n        var m = moment([2014, 4, 11, 1, 2, 3, 4]).quarter(-3);\n        assert.equal(m.year(), 2013, 'year bubbled');\n        assert.equal(m.month(), 1, 'set month');\n        assert.equal(m.date(), 11, 'keep date');\n        assert.equal(m.hour(), 1, 'keep hour');\n        assert.equal(m.minute(), 2, 'keep minutes');\n        assert.equal(m.second(), 3, 'keep seconds');\n        assert.equal(m.millisecond(), 4, 'keep milliseconds');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('relative time');\n\n    test('default thresholds', function (assert) {\n        var a = moment();\n\n        // Seconds to minutes threshold\n        a.subtract(44, 'seconds');\n        assert.equal(a.fromNow(), 'a few seconds ago', 'Below default seconds to minutes threshold');\n        a.subtract(1, 'seconds');\n        assert.equal(a.fromNow(), 'a minute ago', 'Above default seconds to minutes threshold');\n\n        // Minutes to hours threshold\n        a = moment();\n        a.subtract(44, 'minutes');\n        assert.equal(a.fromNow(), '44 minutes ago', 'Below default minute to hour threshold');\n        a.subtract(1, 'minutes');\n        assert.equal(a.fromNow(), 'an hour ago', 'Above default minute to hour threshold');\n\n        // Hours to days threshold\n        a = moment();\n        a.subtract(21, 'hours');\n        assert.equal(a.fromNow(), '21 hours ago', 'Below default hours to day threshold');\n        a.subtract(1, 'hours');\n        assert.equal(a.fromNow(), 'a day ago', 'Above default hours to day threshold');\n\n        // Days to month threshold\n        a = moment();\n        a.subtract(25, 'days');\n        assert.equal(a.fromNow(), '25 days ago', 'Below default days to month (singular) threshold');\n        a.subtract(1, 'days');\n        assert.equal(a.fromNow(), 'a month ago', 'Above default days to month (singular) threshold');\n\n        // months to year threshold\n        a = moment();\n        a.subtract(10, 'months');\n        assert.equal(a.fromNow(), '10 months ago', 'Below default days to years threshold');\n        a.subtract(1, 'month');\n        assert.equal(a.fromNow(), 'a year ago', 'Above default days to years threshold');\n    });\n\n    test('custom thresholds', function (assert) {\n        // Seconds to minutes threshold\n        moment.relativeTimeThreshold('s', 55);\n\n        var a = moment();\n        a.subtract(54, 'seconds');\n        assert.equal(a.fromNow(), 'a few seconds ago', 'Below custom seconds to minutes threshold');\n        a.subtract(1, 'seconds');\n        assert.equal(a.fromNow(), 'a minute ago', 'Above custom seconds to minutes threshold');\n\n        moment.relativeTimeThreshold('s', 45);\n\n        // Minutes to hours threshold\n        moment.relativeTimeThreshold('m', 55);\n        a = moment();\n        a.subtract(54, 'minutes');\n        assert.equal(a.fromNow(), '54 minutes ago', 'Below custom minutes to hours threshold');\n        a.subtract(1, 'minutes');\n        assert.equal(a.fromNow(), 'an hour ago', 'Above custom minutes to hours threshold');\n        moment.relativeTimeThreshold('m', 45);\n\n        // Hours to days threshold\n        moment.relativeTimeThreshold('h', 24);\n        a = moment();\n        a.subtract(23, 'hours');\n        assert.equal(a.fromNow(), '23 hours ago', 'Below custom hours to days threshold');\n        a.subtract(1, 'hours');\n        assert.equal(a.fromNow(), 'a day ago', 'Above custom hours to days threshold');\n        moment.relativeTimeThreshold('h', 22);\n\n        // Days to month threshold\n        moment.relativeTimeThreshold('d', 28);\n        a = moment();\n        a.subtract(27, 'days');\n        assert.equal(a.fromNow(), '27 days ago', 'Below custom days to month (singular) threshold');\n        a.subtract(1, 'days');\n        assert.equal(a.fromNow(), 'a month ago', 'Above custom days to month (singular) threshold');\n        moment.relativeTimeThreshold('d', 26);\n\n        // months to years threshold\n        moment.relativeTimeThreshold('M', 9);\n        a = moment();\n        a.subtract(8, 'months');\n        assert.equal(a.fromNow(), '8 months ago', 'Below custom days to years threshold');\n        a.subtract(1, 'months');\n        assert.equal(a.fromNow(), 'a year ago', 'Above custom days to years threshold');\n        moment.relativeTimeThreshold('M', 11);\n    });\n\n    test('retrive threshold settings', function (assert) {\n        moment.relativeTimeThreshold('m', 45);\n        var minuteThreshold = moment.relativeTimeThreshold('m');\n\n        assert.equal(minuteThreshold, 45, 'Can retrieve minute setting');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('start and end of units');\n\n    test('start of year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('year'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('years'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('y');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 0, 'strip out the month');\n        assert.equal(m.date(), 1, 'strip out the day');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of year', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('year'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('years'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('y');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 11, 'set the month');\n        assert.equal(m.date(), 31, 'set the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of quarter', function (assert) {\n        var m = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).startOf('quarter'),\n            ms = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).startOf('quarters'),\n            ma = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).startOf('Q');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.quarter(), 2, 'keep the quarter');\n        assert.equal(m.month(), 3, 'strip out the month');\n        assert.equal(m.date(), 1, 'strip out the day');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of quarter', function (assert) {\n        var m = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).endOf('quarter'),\n            ms = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).endOf('quarters'),\n            ma = moment(new Date(2011, 4, 2, 3, 4, 5, 6)).endOf('Q');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.quarter(), 2, 'keep the quarter');\n        assert.equal(m.month(), 5, 'set the month');\n        assert.equal(m.date(), 30, 'set the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of month', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('month'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('months'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('M');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 1, 'strip out the day');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of month', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('month'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('months'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('M');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 28, 'set the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of week', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('week'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('weeks'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('w');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 0, 'rolls back to January');\n        assert.equal(m.day(), 0, 'set day of week');\n        assert.equal(m.date(), 30, 'set correct date');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of week', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('week'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('weeks'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('weeks');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.day(), 6, 'set the day of the week');\n        assert.equal(m.date(), 5, 'set the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of iso-week', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('isoWeek'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('isoWeeks'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('W');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 0, 'rollback to January');\n        assert.equal(m.isoWeekday(), 1, 'set day of iso-week');\n        assert.equal(m.date(), 31, 'set correct date');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of iso-week', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('isoWeek'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('isoWeeks'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('W');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.isoWeekday(), 7, 'set the day of the week');\n        assert.equal(m.date(), 6, 'set the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of day', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('day'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('days'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('d');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 0, 'strip out the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of day', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('day'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('days'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('d');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 23, 'set the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of hour', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('hour'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('hours'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('h');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 0, 'strip out the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of hour', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('hour'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('hours'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('h');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 59, 'set the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of minute', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('minute'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('minutes'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('m');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 4, 'keep the minutes');\n        assert.equal(m.seconds(), 0, 'strip out the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of minute', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('minute'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('minutes'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('m');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 4, 'keep the minutes');\n        assert.equal(m.seconds(), 59, 'set the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('start of second', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('second'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('seconds'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('s');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 4, 'keep the minutes');\n        assert.equal(m.seconds(), 5, 'keep the the seconds');\n        assert.equal(m.milliseconds(), 0, 'strip out the milliseconds');\n    });\n\n    test('end of second', function (assert) {\n        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('second'),\n            ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('seconds'),\n            ma = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('s');\n        assert.equal(+m, +ms, 'Plural or singular should work');\n        assert.equal(+m, +ma, 'Full or abbreviated should work');\n        assert.equal(m.year(), 2011, 'keep the year');\n        assert.equal(m.month(), 1, 'keep the month');\n        assert.equal(m.date(), 2, 'keep the day');\n        assert.equal(m.hours(), 3, 'keep the hours');\n        assert.equal(m.minutes(), 4, 'keep the minutes');\n        assert.equal(m.seconds(), 5, 'keep the seconds');\n        assert.equal(m.milliseconds(), 999, 'set the seconds');\n    });\n\n    test('startOf across DST +1', function (assert) {\n        var oldUpdateOffset = moment.updateOffset,\n            // Based on a real story somewhere in America/Los_Angeles\n            dstAt = moment('2014-03-09T02:00:00-08:00').parseZone(),\n            m;\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.isBefore(dstAt)) {\n                mom.utcOffset(-8, keepTime);\n            } else {\n                mom.utcOffset(-7, keepTime);\n            }\n        };\n\n        m = moment('2014-03-15T00:00:00-07:00').parseZone();\n        m.startOf('M');\n        assert.equal(m.format(), '2014-03-01T00:00:00-08:00', 'startOf(\\'month\\') across +1');\n\n        m = moment('2014-03-09T09:00:00-07:00').parseZone();\n        m.startOf('d');\n        assert.equal(m.format(), '2014-03-09T00:00:00-08:00', 'startOf(\\'day\\') across +1');\n\n        m = moment('2014-03-09T03:05:00-07:00').parseZone();\n        m.startOf('h');\n        assert.equal(m.format(), '2014-03-09T03:00:00-07:00', 'startOf(\\'hour\\') after +1');\n\n        m = moment('2014-03-09T01:35:00-08:00').parseZone();\n        m.startOf('h');\n        assert.equal(m.format(), '2014-03-09T01:00:00-08:00', 'startOf(\\'hour\\') before +1');\n\n        // There is no such time as 2:30-7 to try startOf('hour') across that\n\n        moment.updateOffset = oldUpdateOffset;\n    });\n\n    test('startOf across DST -1', function (assert) {\n        var oldUpdateOffset = moment.updateOffset,\n            // Based on a real story somewhere in America/Los_Angeles\n            dstAt = moment('2014-11-02T02:00:00-07:00').parseZone(),\n            m;\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.isBefore(dstAt)) {\n                mom.utcOffset(-7, keepTime);\n            } else {\n                mom.utcOffset(-8, keepTime);\n            }\n        };\n\n        m = moment('2014-11-15T00:00:00-08:00').parseZone();\n        m.startOf('M');\n        assert.equal(m.format(), '2014-11-01T00:00:00-07:00', 'startOf(\\'month\\') across -1');\n\n        m = moment('2014-11-02T09:00:00-08:00').parseZone();\n        m.startOf('d');\n        assert.equal(m.format(), '2014-11-02T00:00:00-07:00', 'startOf(\\'day\\') across -1');\n\n        // note that utc offset is -8\n        m = moment('2014-11-02T01:30:00-08:00').parseZone();\n        m.startOf('h');\n        assert.equal(m.format(), '2014-11-02T01:00:00-08:00', 'startOf(\\'hour\\') after +1');\n\n        // note that utc offset is -7\n        m = moment('2014-11-02T01:30:00-07:00').parseZone();\n        m.startOf('h');\n        assert.equal(m.format(), '2014-11-02T01:00:00-07:00', 'startOf(\\'hour\\') before +1');\n\n        moment.updateOffset = oldUpdateOffset;\n    });\n\n    test('endOf millisecond and no-arg', function (assert) {\n        var m = moment();\n        assert.equal(+m, +m.clone().endOf(), 'endOf without argument should change time');\n        assert.equal(+m, +m.clone().endOf('ms'), 'endOf with ms argument should change time');\n        assert.equal(+m, +m.clone().endOf('millisecond'), 'endOf with millisecond argument should change time');\n        assert.equal(+m, +m.clone().endOf('milliseconds'), 'endOf with milliseconds argument should change time');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('string prototype');\n\n    test('string prototype overrides call', function (assert) {\n        var prior = String.prototype.call, b;\n        String.prototype.call = function () {\n            return null;\n        };\n\n        b = moment(new Date(2011, 7, 28, 15, 25, 50, 125));\n        assert.equal(b.format('MMMM Do YYYY, h:mm a'), 'August 28th 2011, 3:25 pm');\n\n        String.prototype.call = prior;\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('utc');\n\n    test('utc and local', function (assert) {\n        var m = moment(Date.UTC(2011, 1, 2, 3, 4, 5, 6)), offset, expected;\n        m.utc();\n        // utc\n        assert.equal(m.date(), 2, 'the day should be correct for utc');\n        assert.equal(m.day(), 3, 'the date should be correct for utc');\n        assert.equal(m.hours(), 3, 'the hours should be correct for utc');\n\n        // local\n        m.local();\n        if (m.zone() > 180) {\n            assert.equal(m.date(), 1, 'the date should be correct for local');\n            assert.equal(m.day(), 2, 'the day should be correct for local');\n        } else {\n            assert.equal(m.date(), 2, 'the date should be correct for local');\n            assert.equal(m.day(), 3, 'the day should be correct for local');\n        }\n        offset = Math.ceil(m.utcOffset() / 60);\n        expected = (24 + 3 + offset) % 24;\n        assert.equal(m.hours(), expected, 'the hours (' + m.hours() + ') should be correct for local');\n        assert.equal(moment().utc().utcOffset(), 0, 'timezone in utc should always be zero');\n    });\n\n    test('creating with utc and no arguments', function (assert) {\n        var startOfTest = new Date().valueOf(),\n            momentDefaultUtcTime = moment.utc().valueOf(),\n            afterMomentCreationTime = new Date().valueOf();\n\n        assert.ok(startOfTest <= momentDefaultUtcTime, 'moment UTC default time should be now, not in the past');\n        assert.ok(momentDefaultUtcTime <= afterMomentCreationTime, 'moment UTC default time should be now, not in the future');\n    });\n\n    test('creating with utc and a date parameter array', function (assert) {\n        var m = moment.utc([2011, 1, 2, 3, 4, 5, 6]);\n        assert.equal(m.date(), 2, 'the day should be correct for utc array');\n        assert.equal(m.hours(), 3, 'the hours should be correct for utc array');\n\n        m = moment.utc('2011-02-02 3:04:05', 'YYYY-MM-DD HH:mm:ss');\n        assert.equal(m.date(), 2, 'the day should be correct for utc parsing format');\n        assert.equal(m.hours(), 3, 'the hours should be correct for utc parsing format');\n\n        m = moment.utc('2011-02-02T03:04:05+00:00');\n        assert.equal(m.date(), 2, 'the day should be correct for utc parsing iso');\n        assert.equal(m.hours(), 3, 'the hours should be correct for utc parsing iso');\n    });\n\n    test('creating with utc without timezone', function (assert) {\n        var m = moment.utc('2012-01-02T08:20:00');\n        assert.equal(m.date(), 2, 'the day should be correct for utc parse without timezone');\n        assert.equal(m.hours(), 8, 'the hours should be correct for utc parse without timezone');\n\n        m = moment.utc('2012-01-02T08:20:00+09:00');\n        assert.equal(m.date(), 1, 'the day should be correct for utc parse with timezone');\n        assert.equal(m.hours(), 23, 'the hours should be correct for utc parse with timezone');\n    });\n\n    test('cloning with utc offset', function (assert) {\n        var m = moment.utc('2012-01-02T08:20:00');\n        assert.equal(moment.utc(m)._isUTC, true, 'the local offset should be converted to UTC');\n        assert.equal(moment.utc(m.clone().utc())._isUTC, true, 'the local offset should stay in UTC');\n\n        m.utcOffset(120);\n        assert.equal(moment.utc(m)._isUTC, true, 'the explicit utc offset should stay in UTC');\n        assert.equal(moment.utc(m).utcOffset(), 0, 'the explicit utc offset should have an offset of 0');\n    });\n\n    test('weekday with utc', function (assert) {\n        assert.equal(\n            moment('2013-09-15T00:00:00Z').utc().weekday(), // first minute of the day\n            moment('2013-09-15T23:59:00Z').utc().weekday(), // last minute of the day\n            'a UTC-moment\\'s .weekday() should not be affected by the local timezone'\n        );\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('utc offset');\n\n    test('setter / getter blackbox', function (assert) {\n        var m = moment([2010]);\n\n        assert.equal(m.clone().utcOffset(0).utcOffset(), 0, 'utcOffset 0');\n\n        assert.equal(m.clone().utcOffset(1).utcOffset(), 60, 'utcOffset 1 is 60');\n        assert.equal(m.clone().utcOffset(60).utcOffset(), 60, 'utcOffset 60');\n        assert.equal(m.clone().utcOffset('+01:00').utcOffset(), 60, 'utcOffset +01:00 is 60');\n        assert.equal(m.clone().utcOffset('+0100').utcOffset(), 60, 'utcOffset +0100 is 60');\n\n        assert.equal(m.clone().utcOffset(-1).utcOffset(), -60, 'utcOffset -1 is -60');\n        assert.equal(m.clone().utcOffset(-60).utcOffset(), -60, 'utcOffset -60');\n        assert.equal(m.clone().utcOffset('-01:00').utcOffset(), -60, 'utcOffset -01:00 is -60');\n        assert.equal(m.clone().utcOffset('-0100').utcOffset(), -60, 'utcOffset -0100 is -60');\n\n        assert.equal(m.clone().utcOffset(1.5).utcOffset(), 90, 'utcOffset 1.5 is 90');\n        assert.equal(m.clone().utcOffset(90).utcOffset(), 90, 'utcOffset 1.5 is 90');\n        assert.equal(m.clone().utcOffset('+01:30').utcOffset(), 90, 'utcOffset +01:30 is 90');\n        assert.equal(m.clone().utcOffset('+0130').utcOffset(), 90, 'utcOffset +0130 is 90');\n\n        assert.equal(m.clone().utcOffset(-1.5).utcOffset(), -90, 'utcOffset -1.5');\n        assert.equal(m.clone().utcOffset(-90).utcOffset(), -90, 'utcOffset -90');\n        assert.equal(m.clone().utcOffset('-01:30').utcOffset(), -90, 'utcOffset +01:30 is 90');\n        assert.equal(m.clone().utcOffset('-0130').utcOffset(), -90, 'utcOffset +0130 is 90');\n    });\n\n    test('utcOffset shorthand hours -> minutes', function (assert) {\n        var i;\n        for (i = -15; i <= 15; ++i) {\n            assert.equal(moment().utcOffset(i).utcOffset(), i * 60,\n                    '' + i + ' -> ' + i * 60);\n        }\n        assert.equal(moment().utcOffset(-16).utcOffset(), -16, '-16 -> -16');\n        assert.equal(moment().utcOffset(16).utcOffset(), 16, '16 -> 16');\n    });\n\n    test('isLocal, isUtc, isUtcOffset', function (assert) {\n        assert.ok(moment().isLocal(), 'moment() creates objects in local time');\n        assert.ok(!moment.utc().isLocal(), 'moment.utc creates objects NOT in local time');\n        assert.ok(moment.utc().local().isLocal(), 'moment.fn.local() converts to local time');\n        assert.ok(!moment().utcOffset(5).isLocal(), 'moment.fn.utcOffset(N) puts objects NOT in local time');\n        assert.ok(moment().utcOffset(5).local().isLocal(), 'moment.fn.local() converts to local time');\n\n        assert.ok(moment.utc().isUtc(), 'moment.utc() creates objects in utc time');\n        assert.ok(moment().utcOffset(0).isUtc(), 'utcOffset(0) is equivalent to utc mode');\n        assert.ok(!moment().utcOffset(1).isUtc(), 'utcOffset(1) is NOT equivalent to utc mode');\n\n        assert.ok(!moment().isUtcOffset(), 'moment() creates objects NOT in utc-offset mode');\n        assert.ok(moment.utc().isUtcOffset(), 'moment.utc() creates objects in utc-offset mode');\n        assert.ok(moment().utcOffset(3).isUtcOffset(), 'utcOffset(N != 0) creates objects in utc-offset mode');\n        assert.ok(moment().utcOffset(0).isUtcOffset(), 'utcOffset(0) creates objects in utc-offset mode');\n    });\n\n    test('isUTC', function (assert) {\n        assert.ok(moment.utc().isUTC(), 'moment.utc() creates objects in utc time');\n        assert.ok(moment().utcOffset(0).isUTC(), 'utcOffset(0) is equivalent to utc mode');\n        assert.ok(!moment().utcOffset(1).isUTC(), 'utcOffset(1) is NOT equivalent to utc mode');\n    });\n\n    test('change hours when changing the utc offset', function (assert) {\n        var m = moment.utc([2000, 0, 1, 6]);\n        assert.equal(m.hour(), 6, 'UTC 6AM should be 6AM at +0000');\n\n        // sanity check\n        m.utcOffset(0);\n        assert.equal(m.hour(), 6, 'UTC 6AM should be 6AM at +0000');\n\n        m.utcOffset(-60);\n        assert.equal(m.hour(), 5, 'UTC 6AM should be 5AM at -0100');\n\n        m.utcOffset(60);\n        assert.equal(m.hour(), 7, 'UTC 6AM should be 7AM at +0100');\n    });\n\n    test('change minutes when changing the utc offset', function (assert) {\n        var m = moment.utc([2000, 0, 1, 6, 31]);\n\n        m.utcOffset(0);\n        assert.equal(m.format('HH:mm'), '06:31', 'UTC 6:31AM should be 6:31AM at +0000');\n\n        m.utcOffset(-30);\n        assert.equal(m.format('HH:mm'), '06:01', 'UTC 6:31AM should be 6:01AM at -0030');\n\n        m.utcOffset(30);\n        assert.equal(m.format('HH:mm'), '07:01', 'UTC 6:31AM should be 7:01AM at +0030');\n\n        m.utcOffset(-1380);\n        assert.equal(m.format('HH:mm'), '07:31', 'UTC 6:31AM should be 7:31AM at +1380');\n    });\n\n    test('distance from the unix epoch', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA),\n            zoneC = moment(zoneA),\n            zoneD = moment(zoneA),\n            zoneE = moment(zoneA);\n\n        zoneB.utc();\n        assert.equal(+zoneA, +zoneB, 'moment should equal moment.utc');\n\n        zoneC.utcOffset(60);\n        assert.equal(+zoneA, +zoneC, 'moment should equal moment.utcOffset(60)');\n\n        zoneD.utcOffset(-480);\n        assert.equal(+zoneA, +zoneD,\n                'moment should equal moment.utcOffset(-480)');\n\n        zoneE.utcOffset(-1000);\n        assert.equal(+zoneA, +zoneE,\n                'moment should equal moment.utcOffset(-1000)');\n    });\n\n    test('update offset after changing any values', function (assert) {\n        var oldOffset = moment.updateOffset,\n            m = moment.utc([2000, 6, 1]);\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.__doChange) {\n                if (+mom > 962409600000) {\n                    mom.utcOffset(-120, keepTime);\n                } else {\n                    mom.utcOffset(-60, keepTime);\n                }\n            }\n        };\n\n        assert.equal(m.format('ZZ'), '+0000', 'should be at +0000');\n        assert.equal(m.format('HH:mm'), '00:00', 'should start 12AM at +0000 timezone');\n\n        m.__doChange = true;\n        m.add(1, 'h');\n\n        assert.equal(m.format('ZZ'), '-0200', 'should be at -0200');\n        assert.equal(m.format('HH:mm'), '23:00', '1AM at +0000 should be 11PM at -0200 timezone');\n\n        m.subtract(1, 'h');\n\n        assert.equal(m.format('ZZ'), '-0100', 'should be at -0100');\n        assert.equal(m.format('HH:mm'), '23:00', '12AM at +0000 should be 11PM at -0100 timezone');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    //////////////////\n    test('getters and setters', function (assert) {\n        var a = moment([2011, 5, 20]);\n\n        assert.equal(a.clone().utcOffset(-120).year(2012).year(), 2012, 'should get and set year correctly');\n        assert.equal(a.clone().utcOffset(-120).month(1).month(), 1, 'should get and set month correctly');\n        assert.equal(a.clone().utcOffset(-120).date(2).date(), 2, 'should get and set date correctly');\n        assert.equal(a.clone().utcOffset(-120).day(1).day(), 1, 'should get and set day correctly');\n        assert.equal(a.clone().utcOffset(-120).hour(1).hour(), 1, 'should get and set hour correctly');\n        assert.equal(a.clone().utcOffset(-120).minute(1).minute(), 1, 'should get and set minute correctly');\n    });\n\n    test('getters', function (assert) {\n        var a = moment.utc([2012, 0, 1, 0, 0, 0]);\n\n        assert.equal(a.clone().utcOffset(-120).year(),  2011, 'should get year correctly');\n        assert.equal(a.clone().utcOffset(-120).month(),   11, 'should get month correctly');\n        assert.equal(a.clone().utcOffset(-120).date(),    31, 'should get date correctly');\n        assert.equal(a.clone().utcOffset(-120).hour(),    22, 'should get hour correctly');\n        assert.equal(a.clone().utcOffset(-120).minute(),   0, 'should get minute correctly');\n\n        assert.equal(a.clone().utcOffset(120).year(),  2012, 'should get year correctly');\n        assert.equal(a.clone().utcOffset(120).month(),    0, 'should get month correctly');\n        assert.equal(a.clone().utcOffset(120).date(),     1, 'should get date correctly');\n        assert.equal(a.clone().utcOffset(120).hour(),     2, 'should get hour correctly');\n        assert.equal(a.clone().utcOffset(120).minute(),   0, 'should get minute correctly');\n\n        assert.equal(a.clone().utcOffset(90).year(),  2012, 'should get year correctly');\n        assert.equal(a.clone().utcOffset(90).month(),    0, 'should get month correctly');\n        assert.equal(a.clone().utcOffset(90).date(),     1, 'should get date correctly');\n        assert.equal(a.clone().utcOffset(90).hour(),     1, 'should get hour correctly');\n        assert.equal(a.clone().utcOffset(90).minute(),  30, 'should get minute correctly');\n    });\n\n    test('from', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).utcOffset(-720),\n            zoneC = moment(zoneA).utcOffset(-360),\n            zoneD = moment(zoneA).utcOffset(690),\n            other = moment(zoneA).add(35, 'm');\n\n        assert.equal(zoneA.from(other), zoneB.from(other), 'moment#from should be the same in all zones');\n        assert.equal(zoneA.from(other), zoneC.from(other), 'moment#from should be the same in all zones');\n        assert.equal(zoneA.from(other), zoneD.from(other), 'moment#from should be the same in all zones');\n    });\n\n    test('diff', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).utcOffset(-720),\n            zoneC = moment(zoneA).utcOffset(-360),\n            zoneD = moment(zoneA).utcOffset(690),\n            other = moment(zoneA).add(35, 'm');\n\n        assert.equal(zoneA.diff(other), zoneB.diff(other), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other), zoneC.diff(other), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other), zoneD.diff(other), 'moment#diff should be the same in all zones');\n\n        assert.equal(zoneA.diff(other, 'minute', true), zoneB.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'minute', true), zoneC.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'minute', true), zoneD.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n\n        assert.equal(zoneA.diff(other, 'hour', true), zoneB.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'hour', true), zoneC.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'hour', true), zoneD.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n    });\n\n    test('unix offset and timestamp', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).utcOffset(-720),\n            zoneC = moment(zoneA).utcOffset(-360),\n            zoneD = moment(zoneA).utcOffset(690);\n\n        assert.equal(zoneA.unix(), zoneB.unix(), 'moment#unix should be the same in all zones');\n        assert.equal(zoneA.unix(), zoneC.unix(), 'moment#unix should be the same in all zones');\n        assert.equal(zoneA.unix(), zoneD.unix(), 'moment#unix should be the same in all zones');\n\n        assert.equal(+zoneA, +zoneB, 'moment#valueOf should be the same in all zones');\n        assert.equal(+zoneA, +zoneC, 'moment#valueOf should be the same in all zones');\n        assert.equal(+zoneA, +zoneD, 'moment#valueOf should be the same in all zones');\n    });\n\n    test('cloning', function (assert) {\n        assert.equal(moment().utcOffset(-120).clone().utcOffset(), -120,\n                'explicit cloning should retain the offset');\n        assert.equal(moment().utcOffset(120).clone().utcOffset(), 120,\n                'explicit cloning should retain the offset');\n        assert.equal(moment(moment().utcOffset(-120)).utcOffset(), -120,\n                'implicit cloning should retain the offset');\n        assert.equal(moment(moment().utcOffset(120)).utcOffset(), 120,\n                'implicit cloning should retain the offset');\n    });\n\n    test('start of / end of', function (assert) {\n        var a = moment.utc([2010, 1, 2, 0, 0, 0]).utcOffset(-450);\n\n        assert.equal(a.clone().startOf('day').hour(), 0,\n                'start of day should work on moments with utc offset');\n        assert.equal(a.clone().startOf('day').minute(), 0,\n                'start of day should work on moments with utc offset');\n        assert.equal(a.clone().startOf('hour').minute(), 0,\n                'start of hour should work on moments with utc offset');\n\n        assert.equal(a.clone().endOf('day').hour(), 23,\n                'end of day should work on moments with utc offset');\n        assert.equal(a.clone().endOf('day').minute(), 59,\n                'end of day should work on moments with utc offset');\n        assert.equal(a.clone().endOf('hour').minute(), 59,\n                'end of hour should work on moments with utc offset');\n    });\n\n    test('reset offset with moment#utc', function (assert) {\n        var a = moment.utc([2012]).utcOffset(-480);\n\n        assert.equal(a.clone().hour(),      16, 'different utc offset should have different hour');\n        assert.equal(a.clone().utc().hour(), 0, 'calling moment#utc should reset the offset');\n    });\n\n    test('reset offset with moment#local', function (assert) {\n        var a = moment([2012]).utcOffset(-480);\n\n        assert.equal(a.clone().local().hour(), 0, 'calling moment#local should reset the offset');\n    });\n\n    test('toDate', function (assert) {\n        var zoneA = new Date(),\n            zoneB = moment(zoneA).utcOffset(-720).toDate(),\n            zoneC = moment(zoneA).utcOffset(-360).toDate(),\n            zoneD = moment(zoneA).utcOffset(690).toDate();\n\n        assert.equal(+zoneA, +zoneB, 'moment#toDate should output a date with the right unix timestamp');\n        assert.equal(+zoneA, +zoneC, 'moment#toDate should output a date with the right unix timestamp');\n        assert.equal(+zoneA, +zoneD, 'moment#toDate should output a date with the right unix timestamp');\n    });\n\n    test('same / before / after', function (assert) {\n        var zoneA = moment().utc(),\n            zoneB = moment(zoneA).utcOffset(-120),\n            zoneC = moment(zoneA).utcOffset(120);\n\n        assert.ok(zoneA.isSame(zoneB), 'two moments with different offsets should be the same');\n        assert.ok(zoneA.isSame(zoneC), 'two moments with different offsets should be the same');\n\n        assert.ok(zoneA.isSame(zoneB, 'hour'), 'two moments with different offsets should be the same hour');\n        assert.ok(zoneA.isSame(zoneC, 'hour'), 'two moments with different offsets should be the same hour');\n\n        zoneA.add(1, 'hour');\n\n        assert.ok(zoneA.isAfter(zoneB), 'isAfter should work with two moments with different offsets');\n        assert.ok(zoneA.isAfter(zoneC), 'isAfter should work with two moments with different offsets');\n\n        assert.ok(zoneA.isAfter(zoneB, 'hour'), 'isAfter:hour should work with two moments with different offsets');\n        assert.ok(zoneA.isAfter(zoneC, 'hour'), 'isAfter:hour should work with two moments with different offsets');\n\n        zoneA.subtract(2, 'hour');\n\n        assert.ok(zoneA.isBefore(zoneB), 'isBefore should work with two moments with different offsets');\n        assert.ok(zoneA.isBefore(zoneC), 'isBefore should work with two moments with different offsets');\n\n        assert.ok(zoneA.isBefore(zoneB, 'hour'), 'isBefore:hour should work with two moments with different offsets');\n        assert.ok(zoneA.isBefore(zoneC, 'hour'), 'isBefore:hour should work with two moments with different offsets');\n    });\n\n    test('add / subtract over dst', function (assert) {\n        var oldOffset = moment.updateOffset,\n            m = moment.utc([2000, 2, 31, 3]);\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.clone().utc().month() > 2) {\n                mom.utcOffset(60, keepTime);\n            } else {\n                mom.utcOffset(0, keepTime);\n            }\n        };\n\n        assert.equal(m.hour(), 3, 'should start at 00:00');\n\n        m.add(24, 'hour');\n\n        assert.equal(m.hour(), 4, 'adding 24 hours should disregard dst');\n\n        m.subtract(24, 'hour');\n\n        assert.equal(m.hour(), 3, 'subtracting 24 hours should disregard dst');\n\n        m.add(1, 'day');\n\n        assert.equal(m.hour(), 3, 'adding 1 day should have the same hour');\n\n        m.subtract(1, 'day');\n\n        assert.equal(m.hour(), 3, 'subtracting 1 day should have the same hour');\n\n        m.add(1, 'month');\n\n        assert.equal(m.hour(), 3, 'adding 1 month should have the same hour');\n\n        m.subtract(1, 'month');\n\n        assert.equal(m.hour(), 3, 'subtracting 1 month should have the same hour');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    test('isDST', function (assert) {\n        var oldOffset = moment.updateOffset;\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.month() > 2 && mom.month() < 9) {\n                mom.utcOffset(60, keepTime);\n            } else {\n                mom.utcOffset(0, keepTime);\n            }\n        };\n\n        assert.ok(!moment().month(0).isDST(),  'Jan should not be summer dst');\n        assert.ok(moment().month(6).isDST(),   'Jul should be summer dst');\n        assert.ok(!moment().month(11).isDST(), 'Dec should not be summer dst');\n\n        moment.updateOffset = function (mom) {\n            if (mom.month() > 2 && mom.month() < 9) {\n                mom.utcOffset(0);\n            } else {\n                mom.utcOffset(60);\n            }\n        };\n\n        assert.ok(moment().month(0).isDST(),  'Jan should be winter dst');\n        assert.ok(!moment().month(6).isDST(), 'Jul should not be winter dst');\n        assert.ok(moment().month(11).isDST(), 'Dec should be winter dst');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    test('zone names', function (assert) {\n        assert.equal(moment().zoneAbbr(),   '', 'Local zone abbr should be empty');\n        assert.equal(moment().format('z'),  '', 'Local zone formatted abbr should be empty');\n        assert.equal(moment().zoneName(),   '', 'Local zone name should be empty');\n        assert.equal(moment().format('zz'), '', 'Local zone formatted name should be empty');\n\n        assert.equal(moment.utc().zoneAbbr(),   'UTC', 'UTC zone abbr should be UTC');\n        assert.equal(moment.utc().format('z'),  'UTC', 'UTC zone formatted abbr should be UTC');\n        assert.equal(moment.utc().zoneName(),   'Coordinated Universal Time', 'UTC zone abbr should be Coordinated Universal Time');\n        assert.equal(moment.utc().format('zz'), 'Coordinated Universal Time', 'UTC zone formatted abbr should be Coordinated Universal Time');\n    });\n\n    test('hours alignment with UTC', function (assert) {\n        assert.equal(moment().utcOffset(-120).hasAlignedHourOffset(), true);\n        assert.equal(moment().utcOffset(180).hasAlignedHourOffset(), true);\n        assert.equal(moment().utcOffset(-90).hasAlignedHourOffset(), false);\n        assert.equal(moment().utcOffset(90).hasAlignedHourOffset(), false);\n    });\n\n    test('hours alignment with other zone', function (assert) {\n        var m = moment().utcOffset(-120);\n\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-90)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(90)), false);\n\n        m = moment().utcOffset(-90);\n\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-180)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(180)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-30)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(30)), true);\n\n        m = moment().utcOffset(60);\n\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-90)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(90)), false);\n\n        m = moment().utcOffset(-25);\n\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(35)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-85)), true);\n\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(-35)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().utcOffset(85)), false);\n    });\n\n    test('parse zone', function (assert) {\n        var m = moment('2013-01-01T00:00:00-13:00').parseZone();\n        assert.equal(m.utcOffset(), -13 * 60);\n        assert.equal(m.hours(), 0);\n    });\n\n    test('parse zone static', function (assert) {\n        var m = moment.parseZone('2013-01-01T00:00:00-13:00');\n        assert.equal(m.utcOffset(), -13 * 60);\n        assert.equal(m.hours(), 0);\n    });\n\n    test('parse zone with more arguments', function (assert) {\n        var m;\n        m = moment.parseZone('2013 01 01 05 -13:00', 'YYYY MM DD HH ZZ');\n        assert.equal(m.format(), '2013-01-01T05:00:00-13:00', 'accept input and format');\n        m = moment.parseZone('2013-01-01-13:00', 'YYYY MM DD ZZ', true);\n        assert.equal(m.isValid(), false, 'accept input, format and strict flag');\n        m = moment.parseZone('2013-01-01-13:00', ['DD MM YYYY ZZ', 'YYYY MM DD ZZ']);\n        assert.equal(m.format(), '2013-01-01T00:00:00-13:00', 'accept input and array of formats');\n    });\n\n    test('parse zone with a timezone from the format string', function (assert) {\n        var m = moment('11-12-2013 -0400 +1100', 'DD-MM-YYYY ZZ #####').parseZone();\n\n        assert.equal(m.utcOffset(), -4 * 60);\n    });\n\n    test('parse zone without a timezone included in the format string', function (assert) {\n        var m = moment('11-12-2013 -0400 +1100', 'DD-MM-YYYY').parseZone();\n\n        assert.equal(m.utcOffset(), 11 * 60);\n    });\n\n    test('timezone format', function (assert) {\n        assert.equal(moment().utcOffset(60).format('ZZ'), '+0100', '-60 -> +0100');\n        assert.equal(moment().utcOffset(90).format('ZZ'), '+0130', '-90 -> +0130');\n        assert.equal(moment().utcOffset(120).format('ZZ'), '+0200', '-120 -> +0200');\n\n        assert.equal(moment().utcOffset(-60).format('ZZ'), '-0100', '+60 -> -0100');\n        assert.equal(moment().utcOffset(-90).format('ZZ'), '-0130', '+90 -> -0130');\n        assert.equal(moment().utcOffset(-120).format('ZZ'), '-0200', '+120 -> -0200');\n    });\n\n    test('local to utc, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss';\n        assert.equal(m.clone().utc(true).format(fmt), m.format(fmt), 'local to utc failed to keep local time');\n    });\n\n    test('local to utc, keepLocalTime = false', function (assert) {\n        var m = moment();\n        assert.equal(m.clone().utc().valueOf(), m.valueOf(), 'local to utc failed to keep utc time (implicit)');\n        assert.equal(m.clone().utc(false).valueOf(), m.valueOf(), 'local to utc failed to keep utc time (explicit)');\n    });\n\n    test('local to zone, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss',\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            assert.equal(m.clone().utcOffset(z * 60, true).format(fmt),\n                    m.format(fmt),\n                    'local to utcOffset(' + z + ':00) failed to keep local time');\n        }\n    });\n\n    test('local to zone, keepLocalTime = false', function (assert) {\n        var m = moment(),\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            assert.equal(m.clone().utcOffset(z * 60).valueOf(),\n                    m.valueOf(),\n                    'local to utcOffset(' + z + ':00) failed to keep utc time (implicit)');\n            assert.equal(m.clone().utcOffset(z * 60, false).valueOf(),\n                    m.valueOf(),\n                    'local to utcOffset(' + z + ':00) failed to keep utc time (explicit)');\n        }\n    });\n\n    test('utc to local, keepLocalTime = true', function (assert) {\n        var um = moment.utc(),\n            fmt = 'YYYY-DD-MM HH:mm:ss';\n\n        assert.equal(um.clone().local(true).format(fmt), um.format(fmt), 'utc to local failed to keep local time');\n    });\n\n    test('utc to local, keepLocalTime = false', function (assert) {\n        var um = moment.utc();\n        assert.equal(um.clone().local().valueOf(), um.valueOf(), 'utc to local failed to keep utc time (implicit)');\n        assert.equal(um.clone().local(false).valueOf(), um.valueOf(), 'utc to local failed to keep utc time (explicit)');\n    });\n\n    test('zone to local, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss',\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            m.utcOffset(z * 60);\n\n            assert.equal(m.clone().local(true).format(fmt),\n                    m.format(fmt),\n                    'utcOffset(' + z + ':00) to local failed to keep local time');\n        }\n    });\n\n    test('zone to local, keepLocalTime = false', function (assert) {\n        var m = moment(),\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            m.utcOffset(z * 60);\n\n            assert.equal(m.clone().local(false).valueOf(), m.valueOf(),\n                    'utcOffset(' + z + ':00) to local failed to keep utc time (explicit)');\n            assert.equal(m.clone().local().valueOf(), m.valueOf(),\n                    'utcOffset(' + z + ':00) to local failed to keep utc time (implicit)');\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('week year');\n\n    test('iso week year', function (assert) {\n        // Some examples taken from http://en.wikipedia.org/wiki/ISO_week\n        assert.equal(moment([2005, 0, 1]).isoWeekYear(), 2004);\n        assert.equal(moment([2005, 0, 2]).isoWeekYear(), 2004);\n        assert.equal(moment([2005, 0, 3]).isoWeekYear(), 2005);\n        assert.equal(moment([2005, 11, 31]).isoWeekYear(), 2005);\n        assert.equal(moment([2006, 0, 1]).isoWeekYear(), 2005);\n        assert.equal(moment([2006, 0, 2]).isoWeekYear(), 2006);\n        assert.equal(moment([2007, 0, 1]).isoWeekYear(), 2007);\n        assert.equal(moment([2007, 11, 30]).isoWeekYear(), 2007);\n        assert.equal(moment([2007, 11, 31]).isoWeekYear(), 2008);\n        assert.equal(moment([2008, 0, 1]).isoWeekYear(), 2008);\n        assert.equal(moment([2008, 11, 28]).isoWeekYear(), 2008);\n        assert.equal(moment([2008, 11, 29]).isoWeekYear(), 2009);\n        assert.equal(moment([2008, 11, 30]).isoWeekYear(), 2009);\n        assert.equal(moment([2008, 11, 31]).isoWeekYear(), 2009);\n        assert.equal(moment([2009, 0, 1]).isoWeekYear(), 2009);\n        assert.equal(moment([2010, 0, 1]).isoWeekYear(), 2009);\n        assert.equal(moment([2010, 0, 2]).isoWeekYear(), 2009);\n        assert.equal(moment([2010, 0, 3]).isoWeekYear(), 2009);\n        assert.equal(moment([2010, 0, 4]).isoWeekYear(), 2010);\n    });\n\n    test('week year', function (assert) {\n        // Some examples taken from http://en.wikipedia.org/wiki/ISO_week\n        moment.locale('dow: 1,doy: 4', {week: {dow: 1, doy: 4}}); // like iso\n        assert.equal(moment([2005, 0, 1]).weekYear(), 2004);\n        assert.equal(moment([2005, 0, 2]).weekYear(), 2004);\n        assert.equal(moment([2005, 0, 3]).weekYear(), 2005);\n        assert.equal(moment([2005, 11, 31]).weekYear(), 2005);\n        assert.equal(moment([2006, 0, 1]).weekYear(), 2005);\n        assert.equal(moment([2006, 0, 2]).weekYear(), 2006);\n        assert.equal(moment([2007, 0, 1]).weekYear(), 2007);\n        assert.equal(moment([2007, 11, 30]).weekYear(), 2007);\n        assert.equal(moment([2007, 11, 31]).weekYear(), 2008);\n        assert.equal(moment([2008, 0, 1]).weekYear(), 2008);\n        assert.equal(moment([2008, 11, 28]).weekYear(), 2008);\n        assert.equal(moment([2008, 11, 29]).weekYear(), 2009);\n        assert.equal(moment([2008, 11, 30]).weekYear(), 2009);\n        assert.equal(moment([2008, 11, 31]).weekYear(), 2009);\n        assert.equal(moment([2009, 0, 1]).weekYear(), 2009);\n        assert.equal(moment([2010, 0, 1]).weekYear(), 2009);\n        assert.equal(moment([2010, 0, 2]).weekYear(), 2009);\n        assert.equal(moment([2010, 0, 3]).weekYear(), 2009);\n        assert.equal(moment([2010, 0, 4]).weekYear(), 2010);\n\n        moment.locale('dow: 1,doy: 7', {week: {dow: 1, doy: 7}});\n        assert.equal(moment([2004, 11, 26]).weekYear(), 2004);\n        assert.equal(moment([2004, 11, 27]).weekYear(), 2005);\n        assert.equal(moment([2005, 11, 25]).weekYear(), 2005);\n        assert.equal(moment([2005, 11, 26]).weekYear(), 2006);\n        assert.equal(moment([2006, 11, 31]).weekYear(), 2006);\n        assert.equal(moment([2007,  0,  1]).weekYear(), 2007);\n        assert.equal(moment([2007, 11, 30]).weekYear(), 2007);\n        assert.equal(moment([2007, 11, 31]).weekYear(), 2008);\n        assert.equal(moment([2008, 11, 28]).weekYear(), 2008);\n        assert.equal(moment([2008, 11, 29]).weekYear(), 2009);\n        assert.equal(moment([2009, 11, 27]).weekYear(), 2009);\n        assert.equal(moment([2009, 11, 28]).weekYear(), 2010);\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('week day');\n\n    test('iso weekday', function (assert) {\n        var i;\n\n        for (i = 0; i < 7; ++i) {\n            moment.locale('dow:' + i + ',doy: 6', {week: {dow: i, doy: 6}});\n            assert.equal(moment([1985, 1,  4]).isoWeekday(), 1, 'Feb  4 1985 is Monday    -- 1st day');\n            assert.equal(moment([2029, 8, 18]).isoWeekday(), 2, 'Sep 18 2029 is Tuesday   -- 2nd day');\n            assert.equal(moment([2013, 3, 24]).isoWeekday(), 3, 'Apr 24 2013 is Wednesday -- 3rd day');\n            assert.equal(moment([2015, 2,  5]).isoWeekday(), 4, 'Mar  5 2015 is Thursday  -- 4th day');\n            assert.equal(moment([1970, 0,  2]).isoWeekday(), 5, 'Jan  2 1970 is Friday    -- 5th day');\n            assert.equal(moment([2001, 4, 12]).isoWeekday(), 6, 'May 12 2001 is Saturday  -- 6th day');\n            assert.equal(moment([2000, 0,  2]).isoWeekday(), 7, 'Jan  2 2000 is Sunday    -- 7th day');\n        }\n    });\n\n    test('iso weekday setter', function (assert) {\n        var a = moment([2011, 0, 10]);\n        assert.equal(moment(a).isoWeekday(1).date(),  10, 'set from mon to mon');\n        assert.equal(moment(a).isoWeekday(4).date(),  13, 'set from mon to thu');\n        assert.equal(moment(a).isoWeekday(7).date(),  16, 'set from mon to sun');\n        assert.equal(moment(a).isoWeekday(-6).date(),  3, 'set from mon to last mon');\n        assert.equal(moment(a).isoWeekday(-3).date(),  6, 'set from mon to last thu');\n        assert.equal(moment(a).isoWeekday(0).date(),   9, 'set from mon to last sun');\n        assert.equal(moment(a).isoWeekday(8).date(),  17, 'set from mon to next mon');\n        assert.equal(moment(a).isoWeekday(11).date(), 20, 'set from mon to next thu');\n        assert.equal(moment(a).isoWeekday(14).date(), 23, 'set from mon to next sun');\n\n        a = moment([2011, 0, 13]);\n        assert.equal(moment(a).isoWeekday(1).date(), 10, 'set from thu to mon');\n        assert.equal(moment(a).isoWeekday(4).date(), 13, 'set from thu to thu');\n        assert.equal(moment(a).isoWeekday(7).date(), 16, 'set from thu to sun');\n        assert.equal(moment(a).isoWeekday(-6).date(),  3, 'set from thu to last mon');\n        assert.equal(moment(a).isoWeekday(-3).date(),  6, 'set from thu to last thu');\n        assert.equal(moment(a).isoWeekday(0).date(),   9, 'set from thu to last sun');\n        assert.equal(moment(a).isoWeekday(8).date(),  17, 'set from thu to next mon');\n        assert.equal(moment(a).isoWeekday(11).date(), 20, 'set from thu to next thu');\n        assert.equal(moment(a).isoWeekday(14).date(), 23, 'set from thu to next sun');\n\n        a = moment([2011, 0, 16]);\n        assert.equal(moment(a).isoWeekday(1).date(), 10, 'set from sun to mon');\n        assert.equal(moment(a).isoWeekday(4).date(), 13, 'set from sun to thu');\n        assert.equal(moment(a).isoWeekday(7).date(), 16, 'set from sun to sun');\n        assert.equal(moment(a).isoWeekday(-6).date(),  3, 'set from sun to last mon');\n        assert.equal(moment(a).isoWeekday(-3).date(),  6, 'set from sun to last thu');\n        assert.equal(moment(a).isoWeekday(0).date(),   9, 'set from sun to last sun');\n        assert.equal(moment(a).isoWeekday(8).date(),  17, 'set from sun to next mon');\n        assert.equal(moment(a).isoWeekday(11).date(), 20, 'set from sun to next thu');\n        assert.equal(moment(a).isoWeekday(14).date(), 23, 'set from sun to next sun');\n    });\n\n    test('weekday first day of week Sunday (dow 0)', function (assert) {\n        moment.locale('dow: 0,doy: 6', {week: {dow: 0, doy: 6}});\n        assert.equal(moment([1985, 1,  3]).weekday(), 0, 'Feb  3 1985 is Sunday    -- 0th day');\n        assert.equal(moment([2029, 8, 17]).weekday(), 1, 'Sep 17 2029 is Monday    -- 1st day');\n        assert.equal(moment([2013, 3, 23]).weekday(), 2, 'Apr 23 2013 is Tuesday   -- 2nd day');\n        assert.equal(moment([2015, 2,  4]).weekday(), 3, 'Mar  4 2015 is Wednesday -- 3nd day');\n        assert.equal(moment([1970, 0,  1]).weekday(), 4, 'Jan  1 1970 is Thursday  -- 4th day');\n        assert.equal(moment([2001, 4, 11]).weekday(), 5, 'May 11 2001 is Friday    -- 5th day');\n        assert.equal(moment([2000, 0,  1]).weekday(), 6, 'Jan  1 2000 is Saturday  -- 6th day');\n    });\n\n    test('weekday first day of week Monday (dow 1)', function (assert) {\n        moment.locale('dow: 1,doy: 6', {week: {dow: 1, doy: 6}});\n        assert.equal(moment([1985, 1,  4]).weekday(), 0, 'Feb  4 1985 is Monday    -- 0th day');\n        assert.equal(moment([2029, 8, 18]).weekday(), 1, 'Sep 18 2029 is Tuesday   -- 1st day');\n        assert.equal(moment([2013, 3, 24]).weekday(), 2, 'Apr 24 2013 is Wednesday -- 2nd day');\n        assert.equal(moment([2015, 2,  5]).weekday(), 3, 'Mar  5 2015 is Thursday  -- 3nd day');\n        assert.equal(moment([1970, 0,  2]).weekday(), 4, 'Jan  2 1970 is Friday    -- 4th day');\n        assert.equal(moment([2001, 4, 12]).weekday(), 5, 'May 12 2001 is Saturday  -- 5th day');\n        assert.equal(moment([2000, 0,  2]).weekday(), 6, 'Jan  2 2000 is Sunday    -- 6th day');\n    });\n\n    test('weekday first day of week Tuesday (dow 2)', function (assert) {\n        moment.locale('dow: 2,doy: 6', {week: {dow: 2, doy: 6}});\n        assert.equal(moment([1985, 1,  5]).weekday(), 0, 'Feb  5 1985 is Tuesday   -- 0th day');\n        assert.equal(moment([2029, 8, 19]).weekday(), 1, 'Sep 19 2029 is Wednesday -- 1st day');\n        assert.equal(moment([2013, 3, 25]).weekday(), 2, 'Apr 25 2013 is Thursday  -- 2nd day');\n        assert.equal(moment([2015, 2,  6]).weekday(), 3, 'Mar  6 2015 is Friday    -- 3nd day');\n        assert.equal(moment([1970, 0,  3]).weekday(), 4, 'Jan  3 1970 is Staturday -- 4th day');\n        assert.equal(moment([2001, 4, 13]).weekday(), 5, 'May 13 2001 is Sunday    -- 5th day');\n        assert.equal(moment([2000, 0,  3]).weekday(), 6, 'Jan  3 2000 is Monday    -- 6th day');\n    });\n\n    test('weekday first day of week Wednesday (dow 3)', function (assert) {\n        moment.locale('dow: 3,doy: 6', {week: {dow: 3, doy: 6}});\n        assert.equal(moment([1985, 1,  6]).weekday(), 0, 'Feb  6 1985 is Wednesday -- 0th day');\n        assert.equal(moment([2029, 8, 20]).weekday(), 1, 'Sep 20 2029 is Thursday  -- 1st day');\n        assert.equal(moment([2013, 3, 26]).weekday(), 2, 'Apr 26 2013 is Friday    -- 2nd day');\n        assert.equal(moment([2015, 2,  7]).weekday(), 3, 'Mar  7 2015 is Saturday  -- 3nd day');\n        assert.equal(moment([1970, 0,  4]).weekday(), 4, 'Jan  4 1970 is Sunday    -- 4th day');\n        assert.equal(moment([2001, 4, 14]).weekday(), 5, 'May 14 2001 is Monday    -- 5th day');\n        assert.equal(moment([2000, 0,  4]).weekday(), 6, 'Jan  4 2000 is Tuesday   -- 6th day');\n        moment.locale('dow:3,doy:6', null);\n    });\n\n    test('weekday first day of week Thursday (dow 4)', function (assert) {\n        moment.locale('dow: 4,doy: 6', {week: {dow: 4, doy: 6}});\n        assert.equal(moment([1985, 1,  7]).weekday(), 0, 'Feb  7 1985 is Thursday  -- 0th day');\n        assert.equal(moment([2029, 8, 21]).weekday(), 1, 'Sep 21 2029 is Friday    -- 1st day');\n        assert.equal(moment([2013, 3, 27]).weekday(), 2, 'Apr 27 2013 is Saturday  -- 2nd day');\n        assert.equal(moment([2015, 2,  8]).weekday(), 3, 'Mar  8 2015 is Sunday    -- 3nd day');\n        assert.equal(moment([1970, 0,  5]).weekday(), 4, 'Jan  5 1970 is Monday    -- 4th day');\n        assert.equal(moment([2001, 4, 15]).weekday(), 5, 'May 15 2001 is Tuesday   -- 5th day');\n        assert.equal(moment([2000, 0,  5]).weekday(), 6, 'Jan  5 2000 is Wednesday -- 6th day');\n    });\n\n    test('weekday first day of week Friday (dow 5)', function (assert) {\n        moment.locale('dow: 5,doy: 6', {week: {dow: 5, doy: 6}});\n        assert.equal(moment([1985, 1,  8]).weekday(), 0, 'Feb  8 1985 is Friday    -- 0th day');\n        assert.equal(moment([2029, 8, 22]).weekday(), 1, 'Sep 22 2029 is Staturday -- 1st day');\n        assert.equal(moment([2013, 3, 28]).weekday(), 2, 'Apr 28 2013 is Sunday    -- 2nd day');\n        assert.equal(moment([2015, 2,  9]).weekday(), 3, 'Mar  9 2015 is Monday    -- 3nd day');\n        assert.equal(moment([1970, 0,  6]).weekday(), 4, 'Jan  6 1970 is Tuesday   -- 4th day');\n        assert.equal(moment([2001, 4, 16]).weekday(), 5, 'May 16 2001 is Wednesday -- 5th day');\n        assert.equal(moment([2000, 0,  6]).weekday(), 6, 'Jan  6 2000 is Thursday  -- 6th day');\n    });\n\n    test('weekday first day of week Saturday (dow 6)', function (assert) {\n        moment.locale('dow: 6,doy: 6', {week: {dow: 6, doy: 6}});\n        assert.equal(moment([1985, 1,  9]).weekday(), 0, 'Feb  9 1985 is Staturday -- 0th day');\n        assert.equal(moment([2029, 8, 23]).weekday(), 1, 'Sep 23 2029 is Sunday    -- 1st day');\n        assert.equal(moment([2013, 3, 29]).weekday(), 2, 'Apr 29 2013 is Monday    -- 2nd day');\n        assert.equal(moment([2015, 2, 10]).weekday(), 3, 'Mar 10 2015 is Tuesday   -- 3nd day');\n        assert.equal(moment([1970, 0,  7]).weekday(), 4, 'Jan  7 1970 is Wednesday -- 4th day');\n        assert.equal(moment([2001, 4, 17]).weekday(), 5, 'May 17 2001 is Thursday  -- 5th day');\n        assert.equal(moment([2000, 0,  7]).weekday(), 6, 'Jan  7 2000 is Friday    -- 6th day');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('weeks');\n\n    test('day of year', function (assert) {\n        assert.equal(moment([2000,  0,  1]).dayOfYear(),   1, 'Jan  1 2000 should be day 1 of the year');\n        assert.equal(moment([2000,  1, 28]).dayOfYear(),  59, 'Feb 28 2000 should be day 59 of the year');\n        assert.equal(moment([2000,  1, 29]).dayOfYear(),  60, 'Feb 28 2000 should be day 60 of the year');\n        assert.equal(moment([2000, 11, 31]).dayOfYear(), 366, 'Dec 31 2000 should be day 366 of the year');\n        assert.equal(moment([2001,  0,  1]).dayOfYear(),   1, 'Jan  1 2001 should be day 1 of the year');\n        assert.equal(moment([2001,  1, 28]).dayOfYear(),  59, 'Feb 28 2001 should be day 59 of the year');\n        assert.equal(moment([2001,  2,  1]).dayOfYear(),  60, 'Mar  1 2001 should be day 60 of the year');\n        assert.equal(moment([2001, 11, 31]).dayOfYear(), 365, 'Dec 31 2001 should be day 365 of the year');\n    });\n\n    test('day of year setters', function (assert) {\n        assert.equal(moment([2000,  0,  1]).dayOfYear(200).dayOfYear(), 200, 'Setting Jan  1 2000 day of the year to 200 should work');\n        assert.equal(moment([2000,  1, 28]).dayOfYear(200).dayOfYear(), 200, 'Setting Feb 28 2000 day of the year to 200 should work');\n        assert.equal(moment([2000,  1, 29]).dayOfYear(200).dayOfYear(), 200, 'Setting Feb 28 2000 day of the year to 200 should work');\n        assert.equal(moment([2000, 11, 31]).dayOfYear(200).dayOfYear(), 200, 'Setting Dec 31 2000 day of the year to 200 should work');\n        assert.equal(moment().dayOfYear(1).dayOfYear(),   1, 'Setting day of the year to 1 should work');\n        assert.equal(moment().dayOfYear(59).dayOfYear(),  59, 'Setting day of the year to 59 should work');\n        assert.equal(moment().dayOfYear(60).dayOfYear(),  60, 'Setting day of the year to 60 should work');\n        assert.equal(moment().dayOfYear(365).dayOfYear(), 365, 'Setting day of the year to 365 should work');\n    });\n\n    test('iso weeks year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).isoWeek(), 52, 'Jan  1 2012 should be iso week 52');\n        assert.equal(moment([2012, 0, 2]).isoWeek(),  1, 'Jan  2 2012 should be iso week 1');\n        assert.equal(moment([2012, 0, 8]).isoWeek(),  1, 'Jan  8 2012 should be iso week 1');\n        assert.equal(moment([2012, 0, 9]).isoWeek(),  2, 'Jan  9 2012 should be iso week 2');\n        assert.equal(moment([2012, 0, 15]).isoWeek(), 2, 'Jan 15 2012 should be iso week 2');\n    });\n\n    test('iso weeks year starting monday', function (assert) {\n        assert.equal(moment([2007, 0, 1]).isoWeek(),  1, 'Jan  1 2007 should be iso week 1');\n        assert.equal(moment([2007, 0, 7]).isoWeek(),  1, 'Jan  7 2007 should be iso week 1');\n        assert.equal(moment([2007, 0, 8]).isoWeek(),  2, 'Jan  8 2007 should be iso week 2');\n        assert.equal(moment([2007, 0, 14]).isoWeek(), 2, 'Jan 14 2007 should be iso week 2');\n        assert.equal(moment([2007, 0, 15]).isoWeek(), 3, 'Jan 15 2007 should be iso week 3');\n    });\n\n    test('iso weeks year starting tuesday', function (assert) {\n        assert.equal(moment([2007, 11, 31]).isoWeek(), 1, 'Dec 31 2007 should be iso week 1');\n        assert.equal(moment([2008,  0,  1]).isoWeek(), 1, 'Jan  1 2008 should be iso week 1');\n        assert.equal(moment([2008,  0,  6]).isoWeek(), 1, 'Jan  6 2008 should be iso week 1');\n        assert.equal(moment([2008,  0,  7]).isoWeek(), 2, 'Jan  7 2008 should be iso week 2');\n        assert.equal(moment([2008,  0, 13]).isoWeek(), 2, 'Jan 13 2008 should be iso week 2');\n        assert.equal(moment([2008,  0, 14]).isoWeek(), 3, 'Jan 14 2008 should be iso week 3');\n    });\n\n    test('iso weeks year starting wednesday', function (assert) {\n        assert.equal(moment([2002, 11, 30]).isoWeek(), 1, 'Dec 30 2002 should be iso week 1');\n        assert.equal(moment([2003,  0,  1]).isoWeek(), 1, 'Jan  1 2003 should be iso week 1');\n        assert.equal(moment([2003,  0,  5]).isoWeek(), 1, 'Jan  5 2003 should be iso week 1');\n        assert.equal(moment([2003,  0,  6]).isoWeek(), 2, 'Jan  6 2003 should be iso week 2');\n        assert.equal(moment([2003,  0, 12]).isoWeek(), 2, 'Jan 12 2003 should be iso week 2');\n        assert.equal(moment([2003,  0, 13]).isoWeek(), 3, 'Jan 13 2003 should be iso week 3');\n    });\n\n    test('iso weeks year starting thursday', function (assert) {\n        assert.equal(moment([2008, 11, 29]).isoWeek(), 1, 'Dec 29 2008 should be iso week 1');\n        assert.equal(moment([2009,  0,  1]).isoWeek(), 1, 'Jan  1 2009 should be iso week 1');\n        assert.equal(moment([2009,  0,  4]).isoWeek(), 1, 'Jan  4 2009 should be iso week 1');\n        assert.equal(moment([2009,  0,  5]).isoWeek(), 2, 'Jan  5 2009 should be iso week 2');\n        assert.equal(moment([2009,  0, 11]).isoWeek(), 2, 'Jan 11 2009 should be iso week 2');\n        assert.equal(moment([2009,  0, 13]).isoWeek(), 3, 'Jan 12 2009 should be iso week 3');\n    });\n\n    test('iso weeks year starting friday', function (assert) {\n        assert.equal(moment([2009, 11, 28]).isoWeek(), 53, 'Dec 28 2009 should be iso week 53');\n        assert.equal(moment([2010,  0,  1]).isoWeek(), 53, 'Jan  1 2010 should be iso week 53');\n        assert.equal(moment([2010,  0,  3]).isoWeek(), 53, 'Jan  3 2010 should be iso week 53');\n        assert.equal(moment([2010,  0,  4]).isoWeek(),  1, 'Jan  4 2010 should be iso week 1');\n        assert.equal(moment([2010,  0, 10]).isoWeek(),  1, 'Jan 10 2010 should be iso week 1');\n        assert.equal(moment([2010,  0, 11]).isoWeek(),  2, 'Jan 11 2010 should be iso week 2');\n    });\n\n    test('iso weeks year starting saturday', function (assert) {\n        assert.equal(moment([2010, 11, 27]).isoWeek(), 52, 'Dec 27 2010 should be iso week 52');\n        assert.equal(moment([2011,  0,  1]).isoWeek(), 52, 'Jan  1 2011 should be iso week 52');\n        assert.equal(moment([2011,  0,  2]).isoWeek(), 52, 'Jan  2 2011 should be iso week 52');\n        assert.equal(moment([2011,  0,  3]).isoWeek(),  1, 'Jan  3 2011 should be iso week 1');\n        assert.equal(moment([2011,  0,  9]).isoWeek(),  1, 'Jan  9 2011 should be iso week 1');\n        assert.equal(moment([2011,  0, 10]).isoWeek(),  2, 'Jan 10 2011 should be iso week 2');\n    });\n\n    test('iso weeks year starting sunday formatted', function (assert) {\n        assert.equal(moment([2012, 0,  1]).format('W WW Wo'), '52 52 52nd', 'Jan  1 2012 should be iso week 52');\n        assert.equal(moment([2012, 0,  2]).format('W WW Wo'),   '1 01 1st', 'Jan  2 2012 should be iso week 1');\n        assert.equal(moment([2012, 0,  8]).format('W WW Wo'),   '1 01 1st', 'Jan  8 2012 should be iso week 1');\n        assert.equal(moment([2012, 0,  9]).format('W WW Wo'),   '2 02 2nd', 'Jan  9 2012 should be iso week 2');\n        assert.equal(moment([2012, 0, 15]).format('W WW Wo'),   '2 02 2nd', 'Jan 15 2012 should be iso week 2');\n    });\n\n    test('weeks plural year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0,  1]).weeks(), 1, 'Jan  1 2012 should be week 1');\n        assert.equal(moment([2012, 0,  7]).weeks(), 1, 'Jan  7 2012 should be week 1');\n        assert.equal(moment([2012, 0,  8]).weeks(), 2, 'Jan  8 2012 should be week 2');\n        assert.equal(moment([2012, 0, 14]).weeks(), 2, 'Jan 14 2012 should be week 2');\n        assert.equal(moment([2012, 0, 15]).weeks(), 3, 'Jan 15 2012 should be week 3');\n    });\n\n    test('iso weeks plural year starting sunday', function (assert) {\n        assert.equal(moment([2012, 0, 1]).isoWeeks(), 52, 'Jan  1 2012 should be iso week 52');\n        assert.equal(moment([2012, 0, 2]).isoWeeks(),  1, 'Jan  2 2012 should be iso week 1');\n        assert.equal(moment([2012, 0, 8]).isoWeeks(),  1, 'Jan  8 2012 should be iso week 1');\n        assert.equal(moment([2012, 0, 9]).isoWeeks(),  2, 'Jan  9 2012 should be iso week 2');\n        assert.equal(moment([2012, 0, 15]).isoWeeks(), 2, 'Jan 15 2012 should be iso week 2');\n    });\n\n    test('weeks setter', function (assert) {\n        assert.equal(moment([2012, 0,  1]).week(30).week(), 30, 'Setting Jan 1 2012 to week 30 should work');\n        assert.equal(moment([2012, 0,  7]).week(30).week(), 30, 'Setting Jan 7 2012 to week 30 should work');\n        assert.equal(moment([2012, 0,  8]).week(30).week(), 30, 'Setting Jan 8 2012 to week 30 should work');\n        assert.equal(moment([2012, 0, 14]).week(30).week(), 30, 'Setting Jan 14 2012 to week 30 should work');\n        assert.equal(moment([2012, 0, 15]).week(30).week(), 30, 'Setting Jan 15 2012 to week 30 should work');\n    });\n\n    test('iso weeks setter', function (assert) {\n        assert.equal(moment([2012, 0,  1]).isoWeeks(25).isoWeeks(), 25, 'Setting Jan  1 2012 to week 25 should work');\n        assert.equal(moment([2012, 0,  2]).isoWeeks(24).isoWeeks(), 24, 'Setting Jan  2 2012 to week 24 should work');\n        assert.equal(moment([2012, 0,  8]).isoWeeks(23).isoWeeks(), 23, 'Setting Jan  8 2012 to week 23 should work');\n        assert.equal(moment([2012, 0,  9]).isoWeeks(22).isoWeeks(), 22, 'Setting Jan  9 2012 to week 22 should work');\n        assert.equal(moment([2012, 0, 15]).isoWeeks(21).isoWeeks(), 21, 'Setting Jan 15 2012 to week 21 should work');\n    });\n\n    test('iso weeks setter day of year', function (assert) {\n        assert.equal(moment([2012, 0,  1]).isoWeek(1).dayOfYear(), 9, 'Setting Jan  1 2012 to week 1 should be day of year 8');\n        assert.equal(moment([2012, 0,  1]).isoWeek(1).year(),   2011, 'Setting Jan  1 2012 to week 1 should be year 2011');\n        assert.equal(moment([2012, 0,  2]).isoWeek(1).dayOfYear(), 2, 'Setting Jan  2 2012 to week 1 should be day of year 2');\n        assert.equal(moment([2012, 0,  8]).isoWeek(1).dayOfYear(), 8, 'Setting Jan  8 2012 to week 1 should be day of year 8');\n        assert.equal(moment([2012, 0,  9]).isoWeek(1).dayOfYear(), 2, 'Setting Jan  9 2012 to week 1 should be day of year 2');\n        assert.equal(moment([2012, 0, 15]).isoWeek(1).dayOfYear(), 8, 'Setting Jan 15 2012 to week 1 should be day of year 8');\n    });\n\n    test('years with iso week 53', function (assert) {\n        // Based on a table taken from http://en.wikipedia.org/wiki/ISO_week_date\n        // (as downloaded on 2014-01-06) listing the 71 years in a 400-year cycle\n        // that have 53 weeks; in this case reflecting the 2000 based cycle\n        assert.equal(moment([2004, 11, 31]).isoWeek(), 53, 'Dec 31 2004 should be iso week 53');\n        assert.equal(moment([2009, 11, 31]).isoWeek(), 53, 'Dec 31 2009 should be iso week 53');\n        assert.equal(moment([2015, 11, 31]).isoWeek(), 53, 'Dec 31 2015 should be iso week 53');\n        assert.equal(moment([2020, 11, 31]).isoWeek(), 53, 'Dec 31 2020 should be iso week 53');\n        assert.equal(moment([2026, 11, 31]).isoWeek(), 53, 'Dec 31 2026 should be iso week 53');\n        assert.equal(moment([2032, 11, 31]).isoWeek(), 53, 'Dec 31 2032 should be iso week 53');\n        assert.equal(moment([2037, 11, 31]).isoWeek(), 53, 'Dec 31 2037 should be iso week 53');\n        assert.equal(moment([2043, 11, 31]).isoWeek(), 53, 'Dec 31 2043 should be iso week 53');\n        assert.equal(moment([2048, 11, 31]).isoWeek(), 53, 'Dec 31 2048 should be iso week 53');\n        assert.equal(moment([2054, 11, 31]).isoWeek(), 53, 'Dec 31 2054 should be iso week 53');\n        assert.equal(moment([2060, 11, 31]).isoWeek(), 53, 'Dec 31 2060 should be iso week 53');\n        assert.equal(moment([2065, 11, 31]).isoWeek(), 53, 'Dec 31 2065 should be iso week 53');\n        assert.equal(moment([2071, 11, 31]).isoWeek(), 53, 'Dec 31 2071 should be iso week 53');\n        assert.equal(moment([2076, 11, 31]).isoWeek(), 53, 'Dec 31 2076 should be iso week 53');\n        assert.equal(moment([2082, 11, 31]).isoWeek(), 53, 'Dec 31 2082 should be iso week 53');\n        assert.equal(moment([2088, 11, 31]).isoWeek(), 53, 'Dec 31 2088 should be iso week 53');\n        assert.equal(moment([2093, 11, 31]).isoWeek(), 53, 'Dec 31 2093 should be iso week 53');\n        assert.equal(moment([2099, 11, 31]).isoWeek(), 53, 'Dec 31 2099 should be iso week 53');\n        assert.equal(moment([2105, 11, 31]).isoWeek(), 53, 'Dec 31 2105 should be iso week 53');\n        assert.equal(moment([2111, 11, 31]).isoWeek(), 53, 'Dec 31 2111 should be iso week 53');\n        assert.equal(moment([2116, 11, 31]).isoWeek(), 53, 'Dec 31 2116 should be iso week 53');\n        assert.equal(moment([2122, 11, 31]).isoWeek(), 53, 'Dec 31 2122 should be iso week 53');\n        assert.equal(moment([2128, 11, 31]).isoWeek(), 53, 'Dec 31 2128 should be iso week 53');\n        assert.equal(moment([2133, 11, 31]).isoWeek(), 53, 'Dec 31 2133 should be iso week 53');\n        assert.equal(moment([2139, 11, 31]).isoWeek(), 53, 'Dec 31 2139 should be iso week 53');\n        assert.equal(moment([2144, 11, 31]).isoWeek(), 53, 'Dec 31 2144 should be iso week 53');\n        assert.equal(moment([2150, 11, 31]).isoWeek(), 53, 'Dec 31 2150 should be iso week 53');\n        assert.equal(moment([2156, 11, 31]).isoWeek(), 53, 'Dec 31 2156 should be iso week 53');\n        assert.equal(moment([2161, 11, 31]).isoWeek(), 53, 'Dec 31 2161 should be iso week 53');\n        assert.equal(moment([2167, 11, 31]).isoWeek(), 53, 'Dec 31 2167 should be iso week 53');\n        assert.equal(moment([2172, 11, 31]).isoWeek(), 53, 'Dec 31 2172 should be iso week 53');\n        assert.equal(moment([2178, 11, 31]).isoWeek(), 53, 'Dec 31 2178 should be iso week 53');\n        assert.equal(moment([2184, 11, 31]).isoWeek(), 53, 'Dec 31 2184 should be iso week 53');\n        assert.equal(moment([2189, 11, 31]).isoWeek(), 53, 'Dec 31 2189 should be iso week 53');\n        assert.equal(moment([2195, 11, 31]).isoWeek(), 53, 'Dec 31 2195 should be iso week 53');\n        assert.equal(moment([2201, 11, 31]).isoWeek(), 53, 'Dec 31 2201 should be iso week 53');\n        assert.equal(moment([2207, 11, 31]).isoWeek(), 53, 'Dec 31 2207 should be iso week 53');\n        assert.equal(moment([2212, 11, 31]).isoWeek(), 53, 'Dec 31 2212 should be iso week 53');\n        assert.equal(moment([2218, 11, 31]).isoWeek(), 53, 'Dec 31 2218 should be iso week 53');\n        assert.equal(moment([2224, 11, 31]).isoWeek(), 53, 'Dec 31 2224 should be iso week 53');\n        assert.equal(moment([2229, 11, 31]).isoWeek(), 53, 'Dec 31 2229 should be iso week 53');\n        assert.equal(moment([2235, 11, 31]).isoWeek(), 53, 'Dec 31 2235 should be iso week 53');\n        assert.equal(moment([2240, 11, 31]).isoWeek(), 53, 'Dec 31 2240 should be iso week 53');\n        assert.equal(moment([2246, 11, 31]).isoWeek(), 53, 'Dec 31 2246 should be iso week 53');\n        assert.equal(moment([2252, 11, 31]).isoWeek(), 53, 'Dec 31 2252 should be iso week 53');\n        assert.equal(moment([2257, 11, 31]).isoWeek(), 53, 'Dec 31 2257 should be iso week 53');\n        assert.equal(moment([2263, 11, 31]).isoWeek(), 53, 'Dec 31 2263 should be iso week 53');\n        assert.equal(moment([2268, 11, 31]).isoWeek(), 53, 'Dec 31 2268 should be iso week 53');\n        assert.equal(moment([2274, 11, 31]).isoWeek(), 53, 'Dec 31 2274 should be iso week 53');\n        assert.equal(moment([2280, 11, 31]).isoWeek(), 53, 'Dec 31 2280 should be iso week 53');\n        assert.equal(moment([2285, 11, 31]).isoWeek(), 53, 'Dec 31 2285 should be iso week 53');\n        assert.equal(moment([2291, 11, 31]).isoWeek(), 53, 'Dec 31 2291 should be iso week 53');\n        assert.equal(moment([2296, 11, 31]).isoWeek(), 53, 'Dec 31 2296 should be iso week 53');\n        assert.equal(moment([2303, 11, 31]).isoWeek(), 53, 'Dec 31 2303 should be iso week 53');\n        assert.equal(moment([2308, 11, 31]).isoWeek(), 53, 'Dec 31 2308 should be iso week 53');\n        assert.equal(moment([2314, 11, 31]).isoWeek(), 53, 'Dec 31 2314 should be iso week 53');\n        assert.equal(moment([2320, 11, 31]).isoWeek(), 53, 'Dec 31 2320 should be iso week 53');\n        assert.equal(moment([2325, 11, 31]).isoWeek(), 53, 'Dec 31 2325 should be iso week 53');\n        assert.equal(moment([2331, 11, 31]).isoWeek(), 53, 'Dec 31 2331 should be iso week 53');\n        assert.equal(moment([2336, 11, 31]).isoWeek(), 53, 'Dec 31 2336 should be iso week 53');\n        assert.equal(moment([2342, 11, 31]).isoWeek(), 53, 'Dec 31 2342 should be iso week 53');\n        assert.equal(moment([2348, 11, 31]).isoWeek(), 53, 'Dec 31 2348 should be iso week 53');\n        assert.equal(moment([2353, 11, 31]).isoWeek(), 53, 'Dec 31 2353 should be iso week 53');\n        assert.equal(moment([2359, 11, 31]).isoWeek(), 53, 'Dec 31 2359 should be iso week 53');\n        assert.equal(moment([2364, 11, 31]).isoWeek(), 53, 'Dec 31 2364 should be iso week 53');\n        assert.equal(moment([2370, 11, 31]).isoWeek(), 53, 'Dec 31 2370 should be iso week 53');\n        assert.equal(moment([2376, 11, 31]).isoWeek(), 53, 'Dec 31 2376 should be iso week 53');\n        assert.equal(moment([2381, 11, 31]).isoWeek(), 53, 'Dec 31 2381 should be iso week 53');\n        assert.equal(moment([2387, 11, 31]).isoWeek(), 53, 'Dec 31 2387 should be iso week 53');\n        assert.equal(moment([2392, 11, 31]).isoWeek(), 53, 'Dec 31 2392 should be iso week 53');\n        assert.equal(moment([2398, 11, 31]).isoWeek(), 53, 'Dec 31 2398 should be iso week 53');\n    });\n\n    test('count years with iso week 53', function (assert) {\n        // Based on http://en.wikipedia.org/wiki/ISO_week_date (as seen on 2014-01-06)\n        // stating that there are 71 years in a 400-year cycle that have 53 weeks;\n        // in this case reflecting the 2000 based cycle\n        var count = 0, i;\n        for (i = 0; i < 400; i++) {\n            count += (moment([2000 + i, 11, 31]).isoWeek() === 53) ? 1 : 0;\n        }\n        assert.equal(count, 71, 'Should have 71 years in 400-year cycle with iso week 53');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('weeks in year');\n\n    test('isoWeeksInYear', function (assert) {\n        assert.equal(moment([2004]).isoWeeksInYear(), 53, '2004 has 53 iso weeks');\n        assert.equal(moment([2005]).isoWeeksInYear(), 52, '2005 has 53 iso weeks');\n        assert.equal(moment([2006]).isoWeeksInYear(), 52, '2006 has 53 iso weeks');\n        assert.equal(moment([2007]).isoWeeksInYear(), 52, '2007 has 52 iso weeks');\n        assert.equal(moment([2008]).isoWeeksInYear(), 52, '2008 has 53 iso weeks');\n        assert.equal(moment([2009]).isoWeeksInYear(), 53, '2009 has 53 iso weeks');\n        assert.equal(moment([2010]).isoWeeksInYear(), 52, '2010 has 52 iso weeks');\n        assert.equal(moment([2011]).isoWeeksInYear(), 52, '2011 has 52 iso weeks');\n        assert.equal(moment([2012]).isoWeeksInYear(), 52, '2012 has 52 iso weeks');\n        assert.equal(moment([2013]).isoWeeksInYear(), 52, '2013 has 52 iso weeks');\n        assert.equal(moment([2014]).isoWeeksInYear(), 52, '2014 has 52 iso weeks');\n        assert.equal(moment([2015]).isoWeeksInYear(), 53, '2015 has 53 iso weeks');\n    });\n\n    test('weeksInYear doy/dow = 1/4', function (assert) {\n        moment.locale('1/4', {week: {dow: 1, doy: 4}});\n\n        assert.equal(moment([2004]).weeksInYear(), 53, '2004 has 53 weeks');\n        assert.equal(moment([2005]).weeksInYear(), 52, '2005 has 53 weeks');\n        assert.equal(moment([2006]).weeksInYear(), 52, '2006 has 53 weeks');\n        assert.equal(moment([2007]).weeksInYear(), 52, '2007 has 52 weeks');\n        assert.equal(moment([2008]).weeksInYear(), 52, '2008 has 53 weeks');\n        assert.equal(moment([2009]).weeksInYear(), 53, '2009 has 53 weeks');\n        assert.equal(moment([2010]).weeksInYear(), 52, '2010 has 52 weeks');\n        assert.equal(moment([2011]).weeksInYear(), 52, '2011 has 52 weeks');\n        assert.equal(moment([2012]).weeksInYear(), 52, '2012 has 52 weeks');\n        assert.equal(moment([2013]).weeksInYear(), 52, '2013 has 52 weeks');\n        assert.equal(moment([2014]).weeksInYear(), 52, '2014 has 52 weeks');\n        assert.equal(moment([2015]).weeksInYear(), 53, '2015 has 53 weeks');\n    });\n\n    test('weeksInYear doy/dow = 6/12', function (assert) {\n        moment.locale('6/12', {week: {dow: 6, doy: 12}});\n\n        assert.equal(moment([2004]).weeksInYear(), 53, '2004 has 53 weeks');\n        assert.equal(moment([2005]).weeksInYear(), 52, '2005 has 53 weeks');\n        assert.equal(moment([2006]).weeksInYear(), 52, '2006 has 53 weeks');\n        assert.equal(moment([2007]).weeksInYear(), 52, '2007 has 52 weeks');\n        assert.equal(moment([2008]).weeksInYear(), 52, '2008 has 53 weeks');\n        assert.equal(moment([2009]).weeksInYear(), 52, '2009 has 53 weeks');\n        assert.equal(moment([2010]).weeksInYear(), 53, '2010 has 52 weeks');\n        assert.equal(moment([2011]).weeksInYear(), 52, '2011 has 52 weeks');\n        assert.equal(moment([2012]).weeksInYear(), 52, '2012 has 52 weeks');\n        assert.equal(moment([2013]).weeksInYear(), 52, '2013 has 52 weeks');\n        assert.equal(moment([2014]).weeksInYear(), 52, '2014 has 52 weeks');\n        assert.equal(moment([2015]).weeksInYear(), 52, '2015 has 53 weeks');\n    });\n\n    test('weeksInYear doy/dow = 1/7', function (assert) {\n        moment.locale('1/7', {week: {dow: 1, doy: 7}});\n\n        assert.equal(moment([2004]).weeksInYear(), 52, '2004 has 53 weeks');\n        assert.equal(moment([2005]).weeksInYear(), 52, '2005 has 53 weeks');\n        assert.equal(moment([2006]).weeksInYear(), 53, '2006 has 53 weeks');\n        assert.equal(moment([2007]).weeksInYear(), 52, '2007 has 52 weeks');\n        assert.equal(moment([2008]).weeksInYear(), 52, '2008 has 53 weeks');\n        assert.equal(moment([2009]).weeksInYear(), 52, '2009 has 53 weeks');\n        assert.equal(moment([2010]).weeksInYear(), 52, '2010 has 52 weeks');\n        assert.equal(moment([2011]).weeksInYear(), 52, '2011 has 52 weeks');\n        assert.equal(moment([2012]).weeksInYear(), 53, '2012 has 52 weeks');\n        assert.equal(moment([2013]).weeksInYear(), 52, '2013 has 52 weeks');\n        assert.equal(moment([2014]).weeksInYear(), 52, '2014 has 52 weeks');\n        assert.equal(moment([2015]).weeksInYear(), 52, '2015 has 53 weeks');\n    });\n\n    test('weeksInYear doy/dow = 0/6', function (assert) {\n        moment.locale('0/6', {week: {dow: 0, doy: 6}});\n\n        assert.equal(moment([2004]).weeksInYear(), 52, '2004 has 53 weeks');\n        assert.equal(moment([2005]).weeksInYear(), 53, '2005 has 53 weeks');\n        assert.equal(moment([2006]).weeksInYear(), 52, '2006 has 53 weeks');\n        assert.equal(moment([2007]).weeksInYear(), 52, '2007 has 52 weeks');\n        assert.equal(moment([2008]).weeksInYear(), 52, '2008 has 53 weeks');\n        assert.equal(moment([2009]).weeksInYear(), 52, '2009 has 53 weeks');\n        assert.equal(moment([2010]).weeksInYear(), 52, '2010 has 52 weeks');\n        assert.equal(moment([2011]).weeksInYear(), 53, '2011 has 52 weeks');\n        assert.equal(moment([2012]).weeksInYear(), 52, '2012 has 52 weeks');\n        assert.equal(moment([2013]).weeksInYear(), 52, '2013 has 52 weeks');\n        assert.equal(moment([2014]).weeksInYear(), 52, '2014 has 52 weeks');\n        assert.equal(moment([2015]).weeksInYear(), 52, '2015 has 53 weeks');\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('zone switching');\n\n    test('local to utc, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss';\n        assert.equal(m.clone().utc(true).format(fmt), m.format(fmt), 'local to utc failed to keep local time');\n    });\n\n    test('local to utc, keepLocalTime = false', function (assert) {\n        var m = moment();\n        assert.equal(m.clone().utc().valueOf(), m.valueOf(), 'local to utc failed to keep utc time (implicit)');\n        assert.equal(m.clone().utc(false).valueOf(), m.valueOf(), 'local to utc failed to keep utc time (explicit)');\n    });\n\n    test('local to zone, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss',\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            assert.equal(m.clone().zone(z * 60, true).format(fmt), m.format(fmt),\n                    'local to zone(' + z + ':00) failed to keep local time');\n        }\n    });\n\n    test('local to zone, keepLocalTime = false', function (assert) {\n        var m = moment(),\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            assert.equal(m.clone().zone(z * 60).valueOf(), m.valueOf(),\n                    'local to zone(' + z + ':00) failed to keep utc time (implicit)');\n            assert.equal(m.clone().zone(z * 60, false).valueOf(), m.valueOf(),\n                    'local to zone(' + z + ':00) failed to keep utc time (explicit)');\n        }\n    });\n\n    test('utc to local, keepLocalTime = true', function (assert) {\n        var um = moment.utc(),\n            fmt = 'YYYY-DD-MM HH:mm:ss';\n\n        assert.equal(um.clone().local(true).format(fmt), um.format(fmt), 'utc to local failed to keep local time');\n    });\n\n    test('utc to local, keepLocalTime = false', function (assert) {\n        var um = moment.utc();\n        assert.equal(um.clone().local().valueOf(), um.valueOf(), 'utc to local failed to keep utc time (implicit)');\n        assert.equal(um.clone().local(false).valueOf(), um.valueOf(), 'utc to local failed to keep utc time (explicit)');\n    });\n\n    test('zone to local, keepLocalTime = true', function (assert) {\n        var m = moment(),\n            fmt = 'YYYY-DD-MM HH:mm:ss',\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            m.zone(z * 60);\n\n            assert.equal(m.clone().local(true).format(fmt), m.format(fmt),\n                    'zone(' + z + ':00) to local failed to keep local time');\n        }\n    });\n\n    test('zone to local, keepLocalTime = false', function (assert) {\n        var m = moment(),\n            z;\n\n        // Apparently there is -12:00 and +14:00\n        // http://en.wikipedia.org/wiki/UTC+14:00\n        // http://en.wikipedia.org/wiki/UTC-12:00\n        for (z = -12; z <= 14; ++z) {\n            m.zone(z * 60);\n\n            assert.equal(m.clone().local(false).valueOf(), m.valueOf(),\n                    'zone(' + z + ':00) to local failed to keep utc time (explicit)');\n            assert.equal(m.clone().local().valueOf(), m.valueOf(),\n                    'zone(' + z + ':00) to local failed to keep utc time (implicit)');\n        }\n    });\n\n}));\n\n(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n\n    /*global QUnit:false*/\n\n    var test = QUnit.test;\n\n    function module (name, lifecycle) {\n        QUnit.module(name, {\n            setup : function () {\n                moment.locale('en');\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    function localeModule (name, lifecycle) {\n        QUnit.module('locale:' + name, {\n            setup : function () {\n                moment.locale(name);\n                moment.createFromInputFallback = function () {\n                    throw new Error('input not handled by moment');\n                };\n                if (lifecycle && lifecycle.setup) {\n                    lifecycle.setup();\n                }\n            },\n            teardown : function () {\n                moment.locale('en');\n                if (lifecycle && lifecycle.teardown) {\n                    lifecycle.teardown();\n                }\n            }\n        });\n    }\n\n    module('zones');\n\n    test('set zone', function (assert) {\n        var zone = moment();\n\n        zone.zone(0);\n        assert.equal(zone.zone(), 0, 'should be able to set the zone to 0');\n\n        zone.zone(60);\n        assert.equal(zone.zone(), 60, 'should be able to set the zone to 60');\n\n        zone.zone(-60);\n        assert.equal(zone.zone(), -60, 'should be able to set the zone to -60');\n    });\n\n    test('set zone shorthand', function (assert) {\n        var zone = moment();\n\n        zone.zone(1);\n        assert.equal(zone.zone(), 60, 'setting the zone to 1 should imply hours and convert to 60');\n\n        zone.zone(-1);\n        assert.equal(zone.zone(), -60, 'setting the zone to -1 should imply hours and convert to -60');\n\n        zone.zone(15);\n        assert.equal(zone.zone(), 900, 'setting the zone to 15 should imply hours and convert to 900');\n\n        zone.zone(-15);\n        assert.equal(zone.zone(), -900, 'setting the zone to -15 should imply hours and convert to -900');\n\n        zone.zone(16);\n        assert.equal(zone.zone(), 16, 'setting the zone to 16 should imply minutes');\n\n        zone.zone(-16);\n        assert.equal(zone.zone(), -16, 'setting the zone to -16 should imply minutes');\n    });\n\n    test('set zone with string', function (assert) {\n        var zone = moment();\n\n        zone.zone('+00:00');\n        assert.equal(zone.zone(), 0, 'set the zone with a timezone string');\n\n        zone.zone('2013-03-07T07:00:00-08:00');\n        assert.equal(zone.zone(), 480, 'set the zone with a string that does not begin with the timezone');\n\n        zone.zone('2013-03-07T07:00:00+0100');\n        assert.equal(zone.zone(), -60, 'set the zone with a string that uses the +0000 syntax');\n\n        zone.zone('03-07-2013T07:00:00-08:00');\n        assert.equal(zone.zone(), 480, 'set the zone with a string with a non-ISO 8601 date');\n    });\n\n    test('change hours when changing the zone', function (assert) {\n        var zone = moment.utc([2000, 0, 1, 6]);\n\n        zone.zone(0);\n        assert.equal(zone.hour(), 6, 'UTC 6AM should be 6AM at +0000');\n\n        zone.zone(60);\n        assert.equal(zone.hour(), 5, 'UTC 6AM should be 5AM at -0100');\n\n        zone.zone(-60);\n        assert.equal(zone.hour(), 7, 'UTC 6AM should be 7AM at +0100');\n    });\n\n    test('change minutes when changing the zone', function (assert) {\n        var zone = moment.utc([2000, 0, 1, 6, 31]);\n\n        zone.zone(0);\n        assert.equal(zone.format('HH:mm'), '06:31', 'UTC 6:31AM should be 6:31AM at +0000');\n\n        zone.zone(30);\n        assert.equal(zone.format('HH:mm'), '06:01', 'UTC 6:31AM should be 6:01AM at -0030');\n\n        zone.zone(-30);\n        assert.equal(zone.format('HH:mm'), '07:01', 'UTC 6:31AM should be 7:01AM at +0030');\n\n        zone.zone(1380);\n        assert.equal(zone.format('HH:mm'), '07:31', 'UTC 6:31AM should be 7:31AM at +1380');\n    });\n\n    test('distance from the unix epoch', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA),\n            zoneC = moment(zoneA),\n            zoneD = moment(zoneA),\n            zoneE = moment(zoneA);\n\n        zoneB.utc();\n        assert.equal(+zoneA, +zoneB, 'moment should equal moment.utc');\n\n        zoneC.zone(-60);\n        assert.equal(+zoneA, +zoneC, 'moment should equal moment.zone(-60)');\n\n        zoneD.zone(480);\n        assert.equal(+zoneA, +zoneD, 'moment should equal moment.zone(480)');\n\n        zoneE.zone(1000);\n        assert.equal(+zoneA, +zoneE, 'moment should equal moment.zone(1000)');\n    });\n\n    test('update offset after changing any values', function (assert) {\n        var oldOffset = moment.updateOffset,\n            m = moment.utc([2000, 6, 1]);\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.__doChange) {\n                if (+mom > 962409600000) {\n                    mom.zone(120, keepTime);\n                } else {\n                    mom.zone(60, keepTime);\n                }\n            }\n        };\n\n        assert.equal(m.format('ZZ'), '+0000', 'should be at +0000');\n        assert.equal(m.format('HH:mm'), '00:00', 'should start 12AM at +0000 timezone');\n\n        m.__doChange = true;\n        m.add(1, 'h');\n\n        assert.equal(m.format('ZZ'), '-0200', 'should be at -0200');\n        assert.equal(m.format('HH:mm'), '23:00', '1AM at +0000 should be 11PM at -0200 timezone');\n\n        m.subtract(1, 'h');\n\n        assert.equal(m.format('ZZ'), '-0100', 'should be at -0100');\n        assert.equal(m.format('HH:mm'), '23:00', '12AM at +0000 should be 11PM at -0100 timezone');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    test('getters and setters', function (assert) {\n        var a = moment([2011, 5, 20]);\n\n        assert.equal(a.clone().zone(120).year(2012).year(), 2012, 'should get and set year correctly');\n        assert.equal(a.clone().zone(120).month(1).month(), 1, 'should get and set month correctly');\n        assert.equal(a.clone().zone(120).date(2).date(), 2, 'should get and set date correctly');\n        assert.equal(a.clone().zone(120).day(1).day(), 1, 'should get and set day correctly');\n        assert.equal(a.clone().zone(120).hour(1).hour(), 1, 'should get and set hour correctly');\n        assert.equal(a.clone().zone(120).minute(1).minute(), 1, 'should get and set minute correctly');\n    });\n\n    test('getters', function (assert) {\n        var a = moment.utc([2012, 0, 1, 0, 0, 0]);\n\n        assert.equal(a.clone().zone(120).year(),  2011, 'should get year correctly');\n        assert.equal(a.clone().zone(120).month(),   11, 'should get month correctly');\n        assert.equal(a.clone().zone(120).date(),    31, 'should get date correctly');\n        assert.equal(a.clone().zone(120).hour(),    22, 'should get hour correctly');\n        assert.equal(a.clone().zone(120).minute(),   0, 'should get minute correctly');\n\n        assert.equal(a.clone().zone(-120).year(),  2012, 'should get year correctly');\n        assert.equal(a.clone().zone(-120).month(),    0, 'should get month correctly');\n        assert.equal(a.clone().zone(-120).date(),     1, 'should get date correctly');\n        assert.equal(a.clone().zone(-120).hour(),     2, 'should get hour correctly');\n        assert.equal(a.clone().zone(-120).minute(),   0, 'should get minute correctly');\n\n        assert.equal(a.clone().zone(-90).year(),  2012, 'should get year correctly');\n        assert.equal(a.clone().zone(-90).month(),    0, 'should get month correctly');\n        assert.equal(a.clone().zone(-90).date(),     1, 'should get date correctly');\n        assert.equal(a.clone().zone(-90).hour(),     1, 'should get hour correctly');\n        assert.equal(a.clone().zone(-90).minute(),  30, 'should get minute correctly');\n    });\n\n    test('from', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).zone(720),\n            zoneC = moment(zoneA).zone(360),\n            zoneD = moment(zoneA).zone(-690),\n            other = moment(zoneA).add(35, 'm');\n\n        assert.equal(zoneA.from(other), zoneB.from(other), 'moment#from should be the same in all zones');\n        assert.equal(zoneA.from(other), zoneC.from(other), 'moment#from should be the same in all zones');\n        assert.equal(zoneA.from(other), zoneD.from(other), 'moment#from should be the same in all zones');\n    });\n\n    test('diff', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).zone(720),\n            zoneC = moment(zoneA).zone(360),\n            zoneD = moment(zoneA).zone(-690),\n            other = moment(zoneA).add(35, 'm');\n\n        assert.equal(zoneA.diff(other), zoneB.diff(other), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other), zoneC.diff(other), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other), zoneD.diff(other), 'moment#diff should be the same in all zones');\n\n        assert.equal(zoneA.diff(other, 'minute', true), zoneB.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'minute', true), zoneC.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'minute', true), zoneD.diff(other, 'minute', true), 'moment#diff should be the same in all zones');\n\n        assert.equal(zoneA.diff(other, 'hour', true), zoneB.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'hour', true), zoneC.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n        assert.equal(zoneA.diff(other, 'hour', true), zoneD.diff(other, 'hour', true), 'moment#diff should be the same in all zones');\n    });\n\n    test('unix offset and timestamp', function (assert) {\n        var zoneA = moment(),\n            zoneB = moment(zoneA).zone(720),\n            zoneC = moment(zoneA).zone(360),\n            zoneD = moment(zoneA).zone(-690);\n\n        assert.equal(zoneA.unix(), zoneB.unix(), 'moment#unix should be the same in all zones');\n        assert.equal(zoneA.unix(), zoneC.unix(), 'moment#unix should be the same in all zones');\n        assert.equal(zoneA.unix(), zoneD.unix(), 'moment#unix should be the same in all zones');\n\n        assert.equal(+zoneA, +zoneB, 'moment#valueOf should be the same in all zones');\n        assert.equal(+zoneA, +zoneC, 'moment#valueOf should be the same in all zones');\n        assert.equal(+zoneA, +zoneD, 'moment#valueOf should be the same in all zones');\n    });\n\n    test('cloning', function (assert) {\n        assert.equal(moment().zone(120).clone().zone(),   120, 'explicit cloning should retain the zone');\n        assert.equal(moment().zone(-120).clone().zone(), -120, 'explicit cloning should retain the zone');\n        assert.equal(moment(moment().zone(120)).zone(),   120, 'implicit cloning should retain the zone');\n        assert.equal(moment(moment().zone(-120)).zone(), -120, 'implicit cloning should retain the zone');\n    });\n\n    test('start of / end of', function (assert) {\n        var a = moment.utc([2010, 1, 2, 0, 0, 0]).zone(450);\n\n        assert.equal(a.clone().startOf('day').hour(), 0, 'start of day should work on moments with a zone');\n        assert.equal(a.clone().startOf('day').minute(), 0, 'start of day should work on moments with a zone');\n        assert.equal(a.clone().startOf('hour').minute(), 0, 'start of hour should work on moments with a zone');\n\n        assert.equal(a.clone().endOf('day').hour(), 23, 'end of day should work on moments with a zone');\n        assert.equal(a.clone().endOf('day').minute(), 59, 'end of day should work on moments with a zone');\n        assert.equal(a.clone().endOf('hour').minute(), 59, 'end of hour should work on moments with a zone');\n    });\n\n    test('reset zone with moment#utc', function (assert) {\n        var a = moment.utc([2012]).zone(480);\n\n        assert.equal(a.clone().hour(),      16, 'different zone should have different hour');\n        assert.equal(a.clone().utc().hour(), 0, 'calling moment#utc should reset the offset');\n    });\n\n    test('reset zone with moment#local', function (assert) {\n        var a = moment([2012]).zone(480);\n\n        assert.equal(a.clone().local().hour(), 0, 'calling moment#local should reset the offset');\n    });\n\n    test('toDate', function (assert) {\n        var zoneA = new Date(),\n            zoneB = moment(zoneA).zone(720).toDate(),\n            zoneC = moment(zoneA).zone(360).toDate(),\n            zoneD = moment(zoneA).zone(-690).toDate();\n\n        assert.equal(+zoneA, +zoneB, 'moment#toDate should output a date with the right unix timestamp');\n        assert.equal(+zoneA, +zoneC, 'moment#toDate should output a date with the right unix timestamp');\n        assert.equal(+zoneA, +zoneD, 'moment#toDate should output a date with the right unix timestamp');\n    });\n\n    test('same / before / after', function (assert) {\n        var zoneA = moment().utc(),\n            zoneB = moment(zoneA).zone(120),\n            zoneC = moment(zoneA).zone(-120);\n\n        assert.ok(zoneA.isSame(zoneB), 'two moments with different offsets should be the same');\n        assert.ok(zoneA.isSame(zoneC), 'two moments with different offsets should be the same');\n\n        assert.ok(zoneA.isSame(zoneB, 'hour'), 'two moments with different offsets should be the same hour');\n        assert.ok(zoneA.isSame(zoneC, 'hour'), 'two moments with different offsets should be the same hour');\n\n        zoneA.add(1, 'hour');\n\n        assert.ok(zoneA.isAfter(zoneB), 'isAfter should work with two moments with different offsets');\n        assert.ok(zoneA.isAfter(zoneC), 'isAfter should work with two moments with different offsets');\n\n        assert.ok(zoneA.isAfter(zoneB, 'hour'), 'isAfter:hour should work with two moments with different offsets');\n        assert.ok(zoneA.isAfter(zoneC, 'hour'), 'isAfter:hour should work with two moments with different offsets');\n\n        zoneA.subtract(2, 'hour');\n\n        assert.ok(zoneA.isBefore(zoneB), 'isBefore should work with two moments with different offsets');\n        assert.ok(zoneA.isBefore(zoneC), 'isBefore should work with two moments with different offsets');\n\n        assert.ok(zoneA.isBefore(zoneB, 'hour'), 'isBefore:hour should work with two moments with different offsets');\n        assert.ok(zoneA.isBefore(zoneC, 'hour'), 'isBefore:hour should work with two moments with different offsets');\n    });\n\n    test('add / subtract over dst', function (assert) {\n        var oldOffset = moment.updateOffset,\n            m = moment.utc([2000, 2, 31, 3]);\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.clone().utc().month() > 2) {\n                mom.zone(-60, keepTime);\n            } else {\n                mom.zone(0, keepTime);\n            }\n        };\n\n        assert.equal(m.hour(), 3, 'should start at 00:00');\n\n        m.add(24, 'hour');\n\n        assert.equal(m.hour(), 4, 'adding 24 hours should disregard dst');\n\n        m.subtract(24, 'hour');\n\n        assert.equal(m.hour(), 3, 'subtracting 24 hours should disregard dst');\n\n        m.add(1, 'day');\n\n        assert.equal(m.hour(), 3, 'adding 1 day should have the same hour');\n\n        m.subtract(1, 'day');\n\n        assert.equal(m.hour(), 3, 'subtracting 1 day should have the same hour');\n\n        m.add(1, 'month');\n\n        assert.equal(m.hour(), 3, 'adding 1 month should have the same hour');\n\n        m.subtract(1, 'month');\n\n        assert.equal(m.hour(), 3, 'subtracting 1 month should have the same hour');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    test('isDST', function (assert) {\n        var oldOffset = moment.updateOffset;\n\n        moment.updateOffset = function (mom, keepTime) {\n            if (mom.month() > 2 && mom.month() < 9) {\n                mom.zone(-60, keepTime);\n            } else {\n                mom.zone(0, keepTime);\n            }\n        };\n\n        assert.ok(!moment().month(0).isDST(),  'Jan should not be summer dst');\n        assert.ok(moment().month(6).isDST(),   'Jul should be summer dst');\n        assert.ok(!moment().month(11).isDST(), 'Dec should not be summer dst');\n\n        moment.updateOffset = function (mom) {\n            if (mom.month() > 2 && mom.month() < 9) {\n                mom.zone(0);\n            } else {\n                mom.zone(-60);\n            }\n        };\n\n        assert.ok(moment().month(0).isDST(),  'Jan should be winter dst');\n        assert.ok(!moment().month(6).isDST(), 'Jul should not be winter dst');\n        assert.ok(moment().month(11).isDST(), 'Dec should be winter dst');\n\n        moment.updateOffset = oldOffset;\n    });\n\n    test('zone names', function (assert) {\n        assert.equal(moment().zoneAbbr(),   '', 'Local zone abbr should be empty');\n        assert.equal(moment().format('z'),  '', 'Local zone formatted abbr should be empty');\n        assert.equal(moment().zoneName(),   '', 'Local zone name should be empty');\n        assert.equal(moment().format('zz'), '', 'Local zone formatted name should be empty');\n\n        assert.equal(moment.utc().zoneAbbr(),   'UTC', 'UTC zone abbr should be UTC');\n        assert.equal(moment.utc().format('z'),  'UTC', 'UTC zone formatted abbr should be UTC');\n        assert.equal(moment.utc().zoneName(),   'Coordinated Universal Time', 'UTC zone abbr should be Coordinated Universal Time');\n        assert.equal(moment.utc().format('zz'), 'Coordinated Universal Time', 'UTC zone formatted abbr should be Coordinated Universal Time');\n    });\n\n    test('hours alignment with UTC', function (assert) {\n        assert.equal(moment().zone(120).hasAlignedHourOffset(), true);\n        assert.equal(moment().zone(-180).hasAlignedHourOffset(), true);\n        assert.equal(moment().zone(90).hasAlignedHourOffset(), false);\n        assert.equal(moment().zone(-90).hasAlignedHourOffset(), false);\n    });\n\n    test('hours alignment with other zone', function (assert) {\n        var m = moment().zone(120);\n\n        assert.equal(m.hasAlignedHourOffset(moment().zone(180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(90)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-90)), false);\n\n        m = moment().zone(90);\n\n        assert.equal(m.hasAlignedHourOffset(moment().zone(180)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-180)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(30)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-30)), true);\n\n        m = moment().zone(-60);\n\n        assert.equal(m.hasAlignedHourOffset(moment().zone(180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-180)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(90)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-90)), false);\n\n        m = moment().zone(25);\n\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-35)), true);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(85)), true);\n\n        assert.equal(m.hasAlignedHourOffset(moment().zone(35)), false);\n        assert.equal(m.hasAlignedHourOffset(moment().zone(-85)), false);\n    });\n\n    test('parse zone', function (assert) {\n        var m = moment('2013-01-01T00:00:00-13:00').parseZone();\n        assert.equal(m.zone(), 13 * 60);\n        assert.equal(m.hours(), 0);\n    });\n\n    test('parse zone static', function (assert) {\n        var m = moment.parseZone('2013-01-01T00:00:00-13:00');\n        assert.equal(m.zone(), 13 * 60);\n        assert.equal(m.hours(), 0);\n    });\n\n    test('parse zone with more arguments', function (assert) {\n        var m;\n        m = moment.parseZone('2013 01 01 05 -13:00', 'YYYY MM DD HH ZZ');\n        assert.equal(m.format(), '2013-01-01T05:00:00-13:00', 'accept input and format');\n        m = moment.parseZone('2013-01-01-13:00', 'YYYY MM DD ZZ', true);\n        assert.equal(m.isValid(), false, 'accept input, format and strict flag');\n        m = moment.parseZone('2013-01-01-13:00', ['DD MM YYYY ZZ', 'YYYY MM DD ZZ']);\n        assert.equal(m.format(), '2013-01-01T00:00:00-13:00', 'accept input and array of formats');\n    });\n\n    test('parse zone with a timezone from the format string', function (assert) {\n        var m = moment('11-12-2013 -0400 +1100', 'DD-MM-YYYY ZZ #####').parseZone();\n\n        assert.equal(m.zone(), 4 * 60);\n    });\n\n    test('parse zone without a timezone included in the format string', function (assert) {\n        var m = moment('11-12-2013 -0400 +1100', 'DD-MM-YYYY').parseZone();\n\n        assert.equal(m.zone(), -11 * 60);\n    });\n\n    test('timezone format', function (assert) {\n        assert.equal(moment().zone(-60).format('ZZ'), '+0100', '-60 -> +0100');\n        assert.equal(moment().zone(-90).format('ZZ'), '+0130', '-90 -> +0130');\n        assert.equal(moment().zone(-120).format('ZZ'), '+0200', '-120 -> +0200');\n\n        assert.equal(moment().zone(+60).format('ZZ'), '-0100', '+60 -> -0100');\n        assert.equal(moment().zone(+90).format('ZZ'), '-0130', '+90 -> -0130');\n        assert.equal(moment().zone(+120).format('ZZ'), '-0200', '+120 -> -0200');\n    });\n\n}));"
  },
  {
    "path": "www/lib/moment/moment.js",
    "content": "//! moment.js\n//! version : 2.10.2\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    global.moment = factory()\n}(this, function () { 'use strict';\n\n    var hookCallback;\n\n    function utils_hooks__hooks () {\n        return hookCallback.apply(null, arguments);\n    }\n\n    // This is done to register the method called with moment()\n    // without creating circular dependencies.\n    function setHookCallback (callback) {\n        hookCallback = callback;\n    }\n\n    function defaultParsingFlags() {\n        // We need to deep clone this object.\n        return {\n            empty           : false,\n            unusedTokens    : [],\n            unusedInput     : [],\n            overflow        : -2,\n            charsLeftOver   : 0,\n            nullInput       : false,\n            invalidMonth    : null,\n            invalidFormat   : false,\n            userInvalidated : false,\n            iso             : false\n        };\n    }\n\n    function isArray(input) {\n        return Object.prototype.toString.call(input) === '[object Array]';\n    }\n\n    function isDate(input) {\n        return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;\n    }\n\n    function map(arr, fn) {\n        var res = [], i;\n        for (i = 0; i < arr.length; ++i) {\n            res.push(fn(arr[i], i));\n        }\n        return res;\n    }\n\n    function hasOwnProp(a, b) {\n        return Object.prototype.hasOwnProperty.call(a, b);\n    }\n\n    function extend(a, b) {\n        for (var i in b) {\n            if (hasOwnProp(b, i)) {\n                a[i] = b[i];\n            }\n        }\n\n        if (hasOwnProp(b, 'toString')) {\n            a.toString = b.toString;\n        }\n\n        if (hasOwnProp(b, 'valueOf')) {\n            a.valueOf = b.valueOf;\n        }\n\n        return a;\n    }\n\n    function create_utc__createUTC (input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, true).utc();\n    }\n\n    function valid__isValid(m) {\n        if (m._isValid == null) {\n            m._isValid = !isNaN(m._d.getTime()) &&\n                m._pf.overflow < 0 &&\n                !m._pf.empty &&\n                !m._pf.invalidMonth &&\n                !m._pf.nullInput &&\n                !m._pf.invalidFormat &&\n                !m._pf.userInvalidated;\n\n            if (m._strict) {\n                m._isValid = m._isValid &&\n                    m._pf.charsLeftOver === 0 &&\n                    m._pf.unusedTokens.length === 0 &&\n                    m._pf.bigHour === undefined;\n            }\n        }\n        return m._isValid;\n    }\n\n    function valid__createInvalid (flags) {\n        var m = create_utc__createUTC(NaN);\n        if (flags != null) {\n            extend(m._pf, flags);\n        }\n        else {\n            m._pf.userInvalidated = true;\n        }\n\n        return m;\n    }\n\n    var momentProperties = utils_hooks__hooks.momentProperties = [];\n\n    function copyConfig(to, from) {\n        var i, prop, val;\n\n        if (typeof from._isAMomentObject !== 'undefined') {\n            to._isAMomentObject = from._isAMomentObject;\n        }\n        if (typeof from._i !== 'undefined') {\n            to._i = from._i;\n        }\n        if (typeof from._f !== 'undefined') {\n            to._f = from._f;\n        }\n        if (typeof from._l !== 'undefined') {\n            to._l = from._l;\n        }\n        if (typeof from._strict !== 'undefined') {\n            to._strict = from._strict;\n        }\n        if (typeof from._tzm !== 'undefined') {\n            to._tzm = from._tzm;\n        }\n        if (typeof from._isUTC !== 'undefined') {\n            to._isUTC = from._isUTC;\n        }\n        if (typeof from._offset !== 'undefined') {\n            to._offset = from._offset;\n        }\n        if (typeof from._pf !== 'undefined') {\n            to._pf = from._pf;\n        }\n        if (typeof from._locale !== 'undefined') {\n            to._locale = from._locale;\n        }\n\n        if (momentProperties.length > 0) {\n            for (i in momentProperties) {\n                prop = momentProperties[i];\n                val = from[prop];\n                if (typeof val !== 'undefined') {\n                    to[prop] = val;\n                }\n            }\n        }\n\n        return to;\n    }\n\n    var updateInProgress = false;\n\n    // Moment prototype object\n    function Moment(config) {\n        copyConfig(this, config);\n        this._d = new Date(+config._d);\n        // Prevent infinite loop in case updateOffset creates new moment\n        // objects.\n        if (updateInProgress === false) {\n            updateInProgress = true;\n            utils_hooks__hooks.updateOffset(this);\n            updateInProgress = false;\n        }\n    }\n\n    function isMoment (obj) {\n        return obj instanceof Moment || (obj != null && hasOwnProp(obj, '_isAMomentObject'));\n    }\n\n    function toInt(argumentForCoercion) {\n        var coercedNumber = +argumentForCoercion,\n            value = 0;\n\n        if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n            if (coercedNumber >= 0) {\n                value = Math.floor(coercedNumber);\n            } else {\n                value = Math.ceil(coercedNumber);\n            }\n        }\n\n        return value;\n    }\n\n    function compareArrays(array1, array2, dontConvert) {\n        var len = Math.min(array1.length, array2.length),\n            lengthDiff = Math.abs(array1.length - array2.length),\n            diffs = 0,\n            i;\n        for (i = 0; i < len; i++) {\n            if ((dontConvert && array1[i] !== array2[i]) ||\n                (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n                diffs++;\n            }\n        }\n        return diffs + lengthDiff;\n    }\n\n    function Locale() {\n    }\n\n    var locales = {};\n    var globalLocale;\n\n    function normalizeLocale(key) {\n        return key ? key.toLowerCase().replace('_', '-') : key;\n    }\n\n    // pick the locale from the array\n    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n    function chooseLocale(names) {\n        var i = 0, j, next, locale, split;\n\n        while (i < names.length) {\n            split = normalizeLocale(names[i]).split('-');\n            j = split.length;\n            next = normalizeLocale(names[i + 1]);\n            next = next ? next.split('-') : null;\n            while (j > 0) {\n                locale = loadLocale(split.slice(0, j).join('-'));\n                if (locale) {\n                    return locale;\n                }\n                if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n                    //the next array item is better than a shallower substring of this one\n                    break;\n                }\n                j--;\n            }\n            i++;\n        }\n        return null;\n    }\n\n    function loadLocale(name) {\n        var oldLocale = null;\n        // TODO: Find a better way to register and load all the locales in Node\n        if (!locales[name] && typeof module !== 'undefined' &&\n                module && module.exports) {\n            try {\n                oldLocale = globalLocale._abbr;\n                require('./locale/' + name);\n                // because defineLocale currently also sets the global locale, we\n                // want to undo that for lazy loaded locales\n                locale_locales__getSetGlobalLocale(oldLocale);\n            } catch (e) { }\n        }\n        return locales[name];\n    }\n\n    // This function will load locale and then set the global locale.  If\n    // no arguments are passed in, it will simply return the current global\n    // locale key.\n    function locale_locales__getSetGlobalLocale (key, values) {\n        var data;\n        if (key) {\n            if (typeof values === 'undefined') {\n                data = locale_locales__getLocale(key);\n            }\n            else {\n                data = defineLocale(key, values);\n            }\n\n            if (data) {\n                // moment.duration._locale = moment._locale = data;\n                globalLocale = data;\n            }\n        }\n\n        return globalLocale._abbr;\n    }\n\n    function defineLocale (name, values) {\n        if (values !== null) {\n            values.abbr = name;\n            if (!locales[name]) {\n                locales[name] = new Locale();\n            }\n            locales[name].set(values);\n\n            // backwards compat for now: also set the locale\n            locale_locales__getSetGlobalLocale(name);\n\n            return locales[name];\n        } else {\n            // useful for testing\n            delete locales[name];\n            return null;\n        }\n    }\n\n    // returns locale data\n    function locale_locales__getLocale (key) {\n        var locale;\n\n        if (key && key._locale && key._locale._abbr) {\n            key = key._locale._abbr;\n        }\n\n        if (!key) {\n            return globalLocale;\n        }\n\n        if (!isArray(key)) {\n            //short-circuit everything else\n            locale = loadLocale(key);\n            if (locale) {\n                return locale;\n            }\n            key = [key];\n        }\n\n        return chooseLocale(key);\n    }\n\n    var aliases = {};\n\n    function addUnitAlias (unit, shorthand) {\n        var lowerCase = unit.toLowerCase();\n        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n    }\n\n    function normalizeUnits(units) {\n        return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n    }\n\n    function normalizeObjectUnits(inputObject) {\n        var normalizedInput = {},\n            normalizedProp,\n            prop;\n\n        for (prop in inputObject) {\n            if (hasOwnProp(inputObject, prop)) {\n                normalizedProp = normalizeUnits(prop);\n                if (normalizedProp) {\n                    normalizedInput[normalizedProp] = inputObject[prop];\n                }\n            }\n        }\n\n        return normalizedInput;\n    }\n\n    function makeGetSet (unit, keepTime) {\n        return function (value) {\n            if (value != null) {\n                get_set__set(this, unit, value);\n                utils_hooks__hooks.updateOffset(this, keepTime);\n                return this;\n            } else {\n                return get_set__get(this, unit);\n            }\n        };\n    }\n\n    function get_set__get (mom, unit) {\n        return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();\n    }\n\n    function get_set__set (mom, unit, value) {\n        return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n    }\n\n    // MOMENTS\n\n    function getSet (units, value) {\n        var unit;\n        if (typeof units === 'object') {\n            for (unit in units) {\n                this.set(unit, units[unit]);\n            }\n        } else {\n            units = normalizeUnits(units);\n            if (typeof this[units] === 'function') {\n                return this[units](value);\n            }\n        }\n        return this;\n    }\n\n    function zeroFill(number, targetLength, forceSign) {\n        var output = '' + Math.abs(number),\n            sign = number >= 0;\n\n        while (output.length < targetLength) {\n            output = '0' + output;\n        }\n        return (sign ? (forceSign ? '+' : '') : '-') + output;\n    }\n\n    var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g;\n\n    var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n    var formatFunctions = {};\n\n    var formatTokenFunctions = {};\n\n    // token:    'M'\n    // padded:   ['MM', 2]\n    // ordinal:  'Mo'\n    // callback: function () { this.month() + 1 }\n    function addFormatToken (token, padded, ordinal, callback) {\n        var func = callback;\n        if (typeof callback === 'string') {\n            func = function () {\n                return this[callback]();\n            };\n        }\n        if (token) {\n            formatTokenFunctions[token] = func;\n        }\n        if (padded) {\n            formatTokenFunctions[padded[0]] = function () {\n                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n            };\n        }\n        if (ordinal) {\n            formatTokenFunctions[ordinal] = function () {\n                return this.localeData().ordinal(func.apply(this, arguments), token);\n            };\n        }\n    }\n\n    function removeFormattingTokens(input) {\n        if (input.match(/\\[[\\s\\S]/)) {\n            return input.replace(/^\\[|\\]$/g, '');\n        }\n        return input.replace(/\\\\/g, '');\n    }\n\n    function makeFormatFunction(format) {\n        var array = format.match(formattingTokens), i, length;\n\n        for (i = 0, length = array.length; i < length; i++) {\n            if (formatTokenFunctions[array[i]]) {\n                array[i] = formatTokenFunctions[array[i]];\n            } else {\n                array[i] = removeFormattingTokens(array[i]);\n            }\n        }\n\n        return function (mom) {\n            var output = '';\n            for (i = 0; i < length; i++) {\n                output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n            }\n            return output;\n        };\n    }\n\n    // format date using native date object\n    function formatMoment(m, format) {\n        if (!m.isValid()) {\n            return m.localeData().invalidDate();\n        }\n\n        format = expandFormat(format, m.localeData());\n\n        if (!formatFunctions[format]) {\n            formatFunctions[format] = makeFormatFunction(format);\n        }\n\n        return formatFunctions[format](m);\n    }\n\n    function expandFormat(format, locale) {\n        var i = 5;\n\n        function replaceLongDateFormatTokens(input) {\n            return locale.longDateFormat(input) || input;\n        }\n\n        localFormattingTokens.lastIndex = 0;\n        while (i >= 0 && localFormattingTokens.test(format)) {\n            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n            localFormattingTokens.lastIndex = 0;\n            i -= 1;\n        }\n\n        return format;\n    }\n\n    var match1         = /\\d/;            //       0 - 9\n    var match2         = /\\d\\d/;          //      00 - 99\n    var match3         = /\\d{3}/;         //     000 - 999\n    var match4         = /\\d{4}/;         //    0000 - 9999\n    var match6         = /[+-]?\\d{6}/;    // -999999 - 999999\n    var match1to2      = /\\d\\d?/;         //       0 - 99\n    var match1to3      = /\\d{1,3}/;       //       0 - 999\n    var match1to4      = /\\d{1,4}/;       //       0 - 9999\n    var match1to6      = /[+-]?\\d{1,6}/;  // -999999 - 999999\n\n    var matchUnsigned  = /\\d+/;           //       0 - inf\n    var matchSigned    = /[+-]?\\d+/;      //    -inf - inf\n\n    var matchOffset    = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\n    var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n    // any word (or two) characters or numbers including two/three word month in arabic.\n    var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n    var regexes = {};\n\n    function addRegexToken (token, regex, strictRegex) {\n        regexes[token] = typeof regex === 'function' ? regex : function (isStrict) {\n            return (isStrict && strictRegex) ? strictRegex : regex;\n        };\n    }\n\n    function getParseRegexForToken (token, config) {\n        if (!hasOwnProp(regexes, token)) {\n            return new RegExp(unescapeFormat(token));\n        }\n\n        return regexes[token](config._strict, config._locale);\n    }\n\n    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n    function unescapeFormat(s) {\n        return s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n            return p1 || p2 || p3 || p4;\n        }).replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n    }\n\n    var tokens = {};\n\n    function addParseToken (token, callback) {\n        var i, func = callback;\n        if (typeof token === 'string') {\n            token = [token];\n        }\n        if (typeof callback === 'number') {\n            func = function (input, array) {\n                array[callback] = toInt(input);\n            };\n        }\n        for (i = 0; i < token.length; i++) {\n            tokens[token[i]] = func;\n        }\n    }\n\n    function addWeekParseToken (token, callback) {\n        addParseToken(token, function (input, array, config, token) {\n            config._w = config._w || {};\n            callback(input, config._w, config, token);\n        });\n    }\n\n    function addTimeToArrayFromToken(token, input, config) {\n        if (input != null && hasOwnProp(tokens, token)) {\n            tokens[token](input, config._a, config, token);\n        }\n    }\n\n    var YEAR = 0;\n    var MONTH = 1;\n    var DATE = 2;\n    var HOUR = 3;\n    var MINUTE = 4;\n    var SECOND = 5;\n    var MILLISECOND = 6;\n\n    function daysInMonth(year, month) {\n        return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n    }\n\n    // FORMATTING\n\n    addFormatToken('M', ['MM', 2], 'Mo', function () {\n        return this.month() + 1;\n    });\n\n    addFormatToken('MMM', 0, 0, function (format) {\n        return this.localeData().monthsShort(this, format);\n    });\n\n    addFormatToken('MMMM', 0, 0, function (format) {\n        return this.localeData().months(this, format);\n    });\n\n    // ALIASES\n\n    addUnitAlias('month', 'M');\n\n    // PARSING\n\n    addRegexToken('M',    match1to2);\n    addRegexToken('MM',   match1to2, match2);\n    addRegexToken('MMM',  matchWord);\n    addRegexToken('MMMM', matchWord);\n\n    addParseToken(['M', 'MM'], function (input, array) {\n        array[MONTH] = toInt(input) - 1;\n    });\n\n    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n        var month = config._locale.monthsParse(input, token, config._strict);\n        // if we didn't find a month name, mark the date as invalid.\n        if (month != null) {\n            array[MONTH] = month;\n        } else {\n            config._pf.invalidMonth = input;\n        }\n    });\n\n    // LOCALES\n\n    var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n    function localeMonths (m) {\n        return this._months[m.month()];\n    }\n\n    var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n    function localeMonthsShort (m) {\n        return this._monthsShort[m.month()];\n    }\n\n    function localeMonthsParse (monthName, format, strict) {\n        var i, mom, regex;\n\n        if (!this._monthsParse) {\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n        }\n\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = create_utc__createUTC([2000, i]);\n            if (strict && !this._longMonthsParse[i]) {\n                this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n                this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n            }\n            if (!strict && !this._monthsParse[i]) {\n                regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n                return i;\n            } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n                return i;\n            } else if (!strict && this._monthsParse[i].test(monthName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function setMonth (mom, value) {\n        var dayOfMonth;\n\n        // TODO: Move this out of here!\n        if (typeof value === 'string') {\n            value = mom.localeData().monthsParse(value);\n            // TODO: Another silent failure?\n            if (typeof value !== 'number') {\n                return mom;\n            }\n        }\n\n        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n        return mom;\n    }\n\n    function getSetMonth (value) {\n        if (value != null) {\n            setMonth(this, value);\n            utils_hooks__hooks.updateOffset(this, true);\n            return this;\n        } else {\n            return get_set__get(this, 'Month');\n        }\n    }\n\n    function getDaysInMonth () {\n        return daysInMonth(this.year(), this.month());\n    }\n\n    function checkOverflow (m) {\n        var overflow;\n        var a = m._a;\n\n        if (a && m._pf.overflow === -2) {\n            overflow =\n                a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :\n                a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n                a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n                a[MINUTE]      < 0 || a[MINUTE]      > 59  ? MINUTE :\n                a[SECOND]      < 0 || a[SECOND]      > 59  ? SECOND :\n                a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n                -1;\n\n            if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n                overflow = DATE;\n            }\n\n            m._pf.overflow = overflow;\n        }\n\n        return m;\n    }\n\n    function warn(msg) {\n        if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n            console.warn('Deprecation warning: ' + msg);\n        }\n    }\n\n    function deprecate(msg, fn) {\n        var firstTime = true;\n        return extend(function () {\n            if (firstTime) {\n                warn(msg);\n                firstTime = false;\n            }\n            return fn.apply(this, arguments);\n        }, fn);\n    }\n\n    var deprecations = {};\n\n    function deprecateSimple(name, msg) {\n        if (!deprecations[name]) {\n            warn(msg);\n            deprecations[name] = true;\n        }\n    }\n\n    utils_hooks__hooks.suppressDeprecationWarnings = false;\n\n    var from_string__isoRegex = /^\\s*(?:[+-]\\d{6}|\\d{4})-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\n    var isoDates = [\n        ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d{2}-\\d{2}/],\n        ['YYYY-MM-DD', /\\d{4}-\\d{2}-\\d{2}/],\n        ['GGGG-[W]WW-E', /\\d{4}-W\\d{2}-\\d/],\n        ['GGGG-[W]WW', /\\d{4}-W\\d{2}/],\n        ['YYYY-DDD', /\\d{4}-\\d{3}/]\n    ];\n\n    // iso time formats and regexes\n    var isoTimes = [\n        ['HH:mm:ss.SSSS', /(T| )\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n        ['HH:mm:ss', /(T| )\\d\\d:\\d\\d:\\d\\d/],\n        ['HH:mm', /(T| )\\d\\d:\\d\\d/],\n        ['HH', /(T| )\\d\\d/]\n    ];\n\n    var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n    // date from iso format\n    function configFromISO(config) {\n        var i, l,\n            string = config._i,\n            match = from_string__isoRegex.exec(string);\n\n        if (match) {\n            config._pf.iso = true;\n            for (i = 0, l = isoDates.length; i < l; i++) {\n                if (isoDates[i][1].exec(string)) {\n                    // match[5] should be 'T' or undefined\n                    config._f = isoDates[i][0] + (match[6] || ' ');\n                    break;\n                }\n            }\n            for (i = 0, l = isoTimes.length; i < l; i++) {\n                if (isoTimes[i][1].exec(string)) {\n                    config._f += isoTimes[i][0];\n                    break;\n                }\n            }\n            if (string.match(matchOffset)) {\n                config._f += 'Z';\n            }\n            configFromStringAndFormat(config);\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    // date from iso format or fallback\n    function configFromString(config) {\n        var matched = aspNetJsonRegex.exec(config._i);\n\n        if (matched !== null) {\n            config._d = new Date(+matched[1]);\n            return;\n        }\n\n        configFromISO(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n            utils_hooks__hooks.createFromInputFallback(config);\n        }\n    }\n\n    utils_hooks__hooks.createFromInputFallback = deprecate(\n        'moment construction falls back to js Date. This is ' +\n        'discouraged and will be removed in upcoming major ' +\n        'release. Please refer to ' +\n        'https://github.com/moment/moment/issues/1407 for more info.',\n        function (config) {\n            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n        }\n    );\n\n    function createDate (y, m, d, h, M, s, ms) {\n        //can't just apply() to create a date:\n        //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n        var date = new Date(y, m, d, h, M, s, ms);\n\n        //the date constructor doesn't accept years < 1970\n        if (y < 1970) {\n            date.setFullYear(y);\n        }\n        return date;\n    }\n\n    function createUTCDate (y) {\n        var date = new Date(Date.UTC.apply(null, arguments));\n        if (y < 1970) {\n            date.setUTCFullYear(y);\n        }\n        return date;\n    }\n\n    addFormatToken(0, ['YY', 2], 0, function () {\n        return this.year() % 100;\n    });\n\n    addFormatToken(0, ['YYYY',   4],       0, 'year');\n    addFormatToken(0, ['YYYYY',  5],       0, 'year');\n    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n    // ALIASES\n\n    addUnitAlias('year', 'y');\n\n    // PARSING\n\n    addRegexToken('Y',      matchSigned);\n    addRegexToken('YY',     match1to2, match2);\n    addRegexToken('YYYY',   match1to4, match4);\n    addRegexToken('YYYYY',  match1to6, match6);\n    addRegexToken('YYYYYY', match1to6, match6);\n\n    addParseToken(['YYYY', 'YYYYY', 'YYYYYY'], YEAR);\n    addParseToken('YY', function (input, array) {\n        array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);\n    });\n\n    // HELPERS\n\n    function daysInYear(year) {\n        return isLeapYear(year) ? 366 : 365;\n    }\n\n    function isLeapYear(year) {\n        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n    }\n\n    // HOOKS\n\n    utils_hooks__hooks.parseTwoDigitYear = function (input) {\n        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n    };\n\n    // MOMENTS\n\n    var getSetYear = makeGetSet('FullYear', false);\n\n    function getIsLeapYear () {\n        return isLeapYear(this.year());\n    }\n\n    addFormatToken('w', ['ww', 2], 'wo', 'week');\n    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n    // ALIASES\n\n    addUnitAlias('week', 'w');\n    addUnitAlias('isoWeek', 'W');\n\n    // PARSING\n\n    addRegexToken('w',  match1to2);\n    addRegexToken('ww', match1to2, match2);\n    addRegexToken('W',  match1to2);\n    addRegexToken('WW', match1to2, match2);\n\n    addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n        week[token.substr(0, 1)] = toInt(input);\n    });\n\n    // HELPERS\n\n    // firstDayOfWeek       0 = sun, 6 = sat\n    //                      the day of the week that starts the week\n    //                      (usually sunday or monday)\n    // firstDayOfWeekOfYear 0 = sun, 6 = sat\n    //                      the first week is the week that contains the first\n    //                      of this day of the week\n    //                      (eg. ISO weeks use thursday (4))\n    function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n        var end = firstDayOfWeekOfYear - firstDayOfWeek,\n            daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),\n            adjustedMoment;\n\n\n        if (daysToDayOfWeek > end) {\n            daysToDayOfWeek -= 7;\n        }\n\n        if (daysToDayOfWeek < end - 7) {\n            daysToDayOfWeek += 7;\n        }\n\n        adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');\n        return {\n            week: Math.ceil(adjustedMoment.dayOfYear() / 7),\n            year: adjustedMoment.year()\n        };\n    }\n\n    // LOCALES\n\n    function localeWeek (mom) {\n        return weekOfYear(mom, this._week.dow, this._week.doy).week;\n    }\n\n    var defaultLocaleWeek = {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    };\n\n    function localeFirstDayOfWeek () {\n        return this._week.dow;\n    }\n\n    function localeFirstDayOfYear () {\n        return this._week.doy;\n    }\n\n    // MOMENTS\n\n    function getSetWeek (input) {\n        var week = this.localeData().week(this);\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    function getSetISOWeek (input) {\n        var week = weekOfYear(this, 1, 4).week;\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n    // ALIASES\n\n    addUnitAlias('dayOfYear', 'DDD');\n\n    // PARSING\n\n    addRegexToken('DDD',  match1to3);\n    addRegexToken('DDDD', match3);\n    addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n        config._dayOfYear = toInt(input);\n    });\n\n    // HELPERS\n\n    //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n    function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {\n        var d = createUTCDate(year, 0, 1).getUTCDay();\n        var daysToAdd;\n        var dayOfYear;\n\n        d = d === 0 ? 7 : d;\n        weekday = weekday != null ? weekday : firstDayOfWeek;\n        daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);\n        dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;\n\n        return {\n            year      : dayOfYear > 0 ? year      : year - 1,\n            dayOfYear : dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear\n        };\n    }\n\n    // MOMENTS\n\n    function getSetDayOfYear (input) {\n        var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n        return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n    }\n\n    // Pick the first defined of two or three arguments.\n    function defaults(a, b, c) {\n        if (a != null) {\n            return a;\n        }\n        if (b != null) {\n            return b;\n        }\n        return c;\n    }\n\n    function currentDateArray(config) {\n        var now = new Date();\n        if (config._useUTC) {\n            return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];\n        }\n        return [now.getFullYear(), now.getMonth(), now.getDate()];\n    }\n\n    // convert an array to a date.\n    // the array should mirror the parameters below\n    // note: all values past the year are optional and will default to the lowest possible value.\n    // [year, month, day , hour, minute, second, millisecond]\n    function configFromArray (config) {\n        var i, date, input = [], currentDate, yearToUse;\n\n        if (config._d) {\n            return;\n        }\n\n        currentDate = currentDateArray(config);\n\n        //compute day of the year from weeks and weekdays\n        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n            dayOfYearFromWeekInfo(config);\n        }\n\n        //if the day of the year is set, figure out what it is\n        if (config._dayOfYear) {\n            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n            if (config._dayOfYear > daysInYear(yearToUse)) {\n                config._pf._overflowDayOfYear = true;\n            }\n\n            date = createUTCDate(yearToUse, 0, config._dayOfYear);\n            config._a[MONTH] = date.getUTCMonth();\n            config._a[DATE] = date.getUTCDate();\n        }\n\n        // Default to current date.\n        // * if no year, month, day of month are given, default to today\n        // * if day of month is given, default month and year\n        // * if month is given, default only year\n        // * if year is given, don't default anything\n        for (i = 0; i < 3 && config._a[i] == null; ++i) {\n            config._a[i] = input[i] = currentDate[i];\n        }\n\n        // Zero out whatever was not defaulted, including time\n        for (; i < 7; i++) {\n            config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n        }\n\n        // Check for 24:00:00.000\n        if (config._a[HOUR] === 24 &&\n                config._a[MINUTE] === 0 &&\n                config._a[SECOND] === 0 &&\n                config._a[MILLISECOND] === 0) {\n            config._nextDay = true;\n            config._a[HOUR] = 0;\n        }\n\n        config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n        // Apply timezone offset from input. The actual utcOffset can be changed\n        // with parseZone.\n        if (config._tzm != null) {\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n        }\n\n        if (config._nextDay) {\n            config._a[HOUR] = 24;\n        }\n    }\n\n    function dayOfYearFromWeekInfo(config) {\n        var w, weekYear, week, weekday, dow, doy, temp;\n\n        w = config._w;\n        if (w.GG != null || w.W != null || w.E != null) {\n            dow = 1;\n            doy = 4;\n\n            // TODO: We need to take the current isoWeekYear, but that depends on\n            // how we interpret now (local, utc, fixed offset). So create\n            // a now version of current config (take local/utc/offset flags, and\n            // create now).\n            weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);\n            week = defaults(w.W, 1);\n            weekday = defaults(w.E, 1);\n        } else {\n            dow = config._locale._week.dow;\n            doy = config._locale._week.doy;\n\n            weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);\n            week = defaults(w.w, 1);\n\n            if (w.d != null) {\n                // weekday -- low day numbers are considered next week\n                weekday = w.d;\n                if (weekday < dow) {\n                    ++week;\n                }\n            } else if (w.e != null) {\n                // local weekday -- counting starts from begining of week\n                weekday = w.e + dow;\n            } else {\n                // default to begining of week\n                weekday = dow;\n            }\n        }\n        temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);\n\n        config._a[YEAR] = temp.year;\n        config._dayOfYear = temp.dayOfYear;\n    }\n\n    utils_hooks__hooks.ISO_8601 = function () {};\n\n    // date from string and format string\n    function configFromStringAndFormat(config) {\n        // TODO: Move this to another part of the creation flow to prevent circular deps\n        if (config._f === utils_hooks__hooks.ISO_8601) {\n            configFromISO(config);\n            return;\n        }\n\n        config._a = [];\n        config._pf.empty = true;\n\n        // This array is used to make a Date, either with `new Date` or `Date.UTC`\n        var string = '' + config._i,\n            i, parsedInput, tokens, token, skipped,\n            stringLength = string.length,\n            totalParsedInputLength = 0;\n\n        tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n        for (i = 0; i < tokens.length; i++) {\n            token = tokens[i];\n            parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n            if (parsedInput) {\n                skipped = string.substr(0, string.indexOf(parsedInput));\n                if (skipped.length > 0) {\n                    config._pf.unusedInput.push(skipped);\n                }\n                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n                totalParsedInputLength += parsedInput.length;\n            }\n            // don't parse if it's not a known token\n            if (formatTokenFunctions[token]) {\n                if (parsedInput) {\n                    config._pf.empty = false;\n                }\n                else {\n                    config._pf.unusedTokens.push(token);\n                }\n                addTimeToArrayFromToken(token, parsedInput, config);\n            }\n            else if (config._strict && !parsedInput) {\n                config._pf.unusedTokens.push(token);\n            }\n        }\n\n        // add remaining unparsed input length to the string\n        config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n        if (string.length > 0) {\n            config._pf.unusedInput.push(string);\n        }\n\n        // clear _12h flag if hour is <= 12\n        if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n            config._pf.bigHour = undefined;\n        }\n        // handle meridiem\n        config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n        configFromArray(config);\n        checkOverflow(config);\n    }\n\n\n    function meridiemFixWrap (locale, hour, meridiem) {\n        var isPm;\n\n        if (meridiem == null) {\n            // nothing to do\n            return hour;\n        }\n        if (locale.meridiemHour != null) {\n            return locale.meridiemHour(hour, meridiem);\n        } else if (locale.isPM != null) {\n            // Fallback\n            isPm = locale.isPM(meridiem);\n            if (isPm && hour < 12) {\n                hour += 12;\n            }\n            if (!isPm && hour === 12) {\n                hour = 0;\n            }\n            return hour;\n        } else {\n            // this is not supposed to happen\n            return hour;\n        }\n    }\n\n    function configFromStringAndArray(config) {\n        var tempConfig,\n            bestMoment,\n\n            scoreToBeat,\n            i,\n            currentScore;\n\n        if (config._f.length === 0) {\n            config._pf.invalidFormat = true;\n            config._d = new Date(NaN);\n            return;\n        }\n\n        for (i = 0; i < config._f.length; i++) {\n            currentScore = 0;\n            tempConfig = copyConfig({}, config);\n            if (config._useUTC != null) {\n                tempConfig._useUTC = config._useUTC;\n            }\n            tempConfig._pf = defaultParsingFlags();\n            tempConfig._f = config._f[i];\n            configFromStringAndFormat(tempConfig);\n\n            if (!valid__isValid(tempConfig)) {\n                continue;\n            }\n\n            // if there is any input that was not parsed add a penalty for that format\n            currentScore += tempConfig._pf.charsLeftOver;\n\n            //or tokens\n            currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n            tempConfig._pf.score = currentScore;\n\n            if (scoreToBeat == null || currentScore < scoreToBeat) {\n                scoreToBeat = currentScore;\n                bestMoment = tempConfig;\n            }\n        }\n\n        extend(config, bestMoment || tempConfig);\n    }\n\n    function configFromObject(config) {\n        if (config._d) {\n            return;\n        }\n\n        var i = normalizeObjectUnits(config._i);\n        config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];\n\n        configFromArray(config);\n    }\n\n    function createFromConfig (config) {\n        var input = config._i,\n            format = config._f,\n            res;\n\n        config._locale = config._locale || locale_locales__getLocale(config._l);\n\n        if (input === null || (format === undefined && input === '')) {\n            return valid__createInvalid({nullInput: true});\n        }\n\n        if (typeof input === 'string') {\n            config._i = input = config._locale.preparse(input);\n        }\n\n        if (isMoment(input)) {\n            return new Moment(checkOverflow(input));\n        } else if (isArray(format)) {\n            configFromStringAndArray(config);\n        } else if (format) {\n            configFromStringAndFormat(config);\n        } else {\n            configFromInput(config);\n        }\n\n        res = new Moment(checkOverflow(config));\n        if (res._nextDay) {\n            // Adding is smart enough around DST\n            res.add(1, 'd');\n            res._nextDay = undefined;\n        }\n\n        return res;\n    }\n\n    function configFromInput(config) {\n        var input = config._i;\n        if (input === undefined) {\n            config._d = new Date();\n        } else if (isDate(input)) {\n            config._d = new Date(+input);\n        } else if (typeof input === 'string') {\n            configFromString(config);\n        } else if (isArray(input)) {\n            config._a = map(input.slice(0), function (obj) {\n                return parseInt(obj, 10);\n            });\n            configFromArray(config);\n        } else if (typeof(input) === 'object') {\n            configFromObject(config);\n        } else if (typeof(input) === 'number') {\n            // from milliseconds\n            config._d = new Date(input);\n        } else {\n            utils_hooks__hooks.createFromInputFallback(config);\n        }\n    }\n\n    function createLocalOrUTC (input, format, locale, strict, isUTC) {\n        var c = {};\n\n        if (typeof(locale) === 'boolean') {\n            strict = locale;\n            locale = undefined;\n        }\n        // object construction must be done this way.\n        // https://github.com/moment/moment/issues/1423\n        c._isAMomentObject = true;\n        c._useUTC = c._isUTC = isUTC;\n        c._l = locale;\n        c._i = input;\n        c._f = format;\n        c._strict = strict;\n        c._pf = defaultParsingFlags();\n\n        return createFromConfig(c);\n    }\n\n    function local__createLocal (input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, false);\n    }\n\n    var prototypeMin = deprecate(\n         'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',\n         function () {\n             var other = local__createLocal.apply(null, arguments);\n             return other < this ? this : other;\n         }\n     );\n\n    var prototypeMax = deprecate(\n        'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',\n        function () {\n            var other = local__createLocal.apply(null, arguments);\n            return other > this ? this : other;\n        }\n    );\n\n    // Pick a moment m from moments so that m[fn](other) is true for all\n    // other. This relies on the function fn to be transitive.\n    //\n    // moments should either be an array of moment objects or an array, whose\n    // first element is an array of moment objects.\n    function pickBy(fn, moments) {\n        var res, i;\n        if (moments.length === 1 && isArray(moments[0])) {\n            moments = moments[0];\n        }\n        if (!moments.length) {\n            return local__createLocal();\n        }\n        res = moments[0];\n        for (i = 1; i < moments.length; ++i) {\n            if (moments[i][fn](res)) {\n                res = moments[i];\n            }\n        }\n        return res;\n    }\n\n    // TODO: Use [].sort instead?\n    function min () {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isBefore', args);\n    }\n\n    function max () {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isAfter', args);\n    }\n\n    function Duration (duration) {\n        var normalizedInput = normalizeObjectUnits(duration),\n            years = normalizedInput.year || 0,\n            quarters = normalizedInput.quarter || 0,\n            months = normalizedInput.month || 0,\n            weeks = normalizedInput.week || 0,\n            days = normalizedInput.day || 0,\n            hours = normalizedInput.hour || 0,\n            minutes = normalizedInput.minute || 0,\n            seconds = normalizedInput.second || 0,\n            milliseconds = normalizedInput.millisecond || 0;\n\n        // representation for dateAddRemove\n        this._milliseconds = +milliseconds +\n            seconds * 1e3 + // 1000\n            minutes * 6e4 + // 1000 * 60\n            hours * 36e5; // 1000 * 60 * 60\n        // Because of dateAddRemove treats 24 hours as different from a\n        // day when working around DST, we need to store them separately\n        this._days = +days +\n            weeks * 7;\n        // It is impossible translate months into days without knowing\n        // which months you are are talking about, so we have to store\n        // it separately.\n        this._months = +months +\n            quarters * 3 +\n            years * 12;\n\n        this._data = {};\n\n        this._locale = locale_locales__getLocale();\n\n        this._bubble();\n    }\n\n    function isDuration (obj) {\n        return obj instanceof Duration;\n    }\n\n    function offset (token, separator) {\n        addFormatToken(token, 0, 0, function () {\n            var offset = this.utcOffset();\n            var sign = '+';\n            if (offset < 0) {\n                offset = -offset;\n                sign = '-';\n            }\n            return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n        });\n    }\n\n    offset('Z', ':');\n    offset('ZZ', '');\n\n    // PARSING\n\n    addRegexToken('Z',  matchOffset);\n    addRegexToken('ZZ', matchOffset);\n    addParseToken(['Z', 'ZZ'], function (input, array, config) {\n        config._useUTC = true;\n        config._tzm = offsetFromString(input);\n    });\n\n    // HELPERS\n\n    // timezone chunker\n    // '+10:00' > ['10',  '00']\n    // '-1530'  > ['-15', '30']\n    var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n    function offsetFromString(string) {\n        var matches = ((string || '').match(matchOffset) || []);\n        var chunk   = matches[matches.length - 1] || [];\n        var parts   = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n        var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n        return parts[0] === '+' ? minutes : -minutes;\n    }\n\n    // Return a moment from input, that is local/utc/zone equivalent to model.\n    function cloneWithOffset(input, model) {\n        var res, diff;\n        if (model._isUTC) {\n            res = model.clone();\n            diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n            // Use low-level api, because this fn is low-level api.\n            res._d.setTime(+res._d + diff);\n            utils_hooks__hooks.updateOffset(res, false);\n            return res;\n        } else {\n            return local__createLocal(input).local();\n        }\n        return model._isUTC ? local__createLocal(input).zone(model._offset || 0) : local__createLocal(input).local();\n    }\n\n    function getDateOffset (m) {\n        // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n        // https://github.com/moment/moment/pull/1871\n        return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n    }\n\n    // HOOKS\n\n    // This function will be called whenever a moment is mutated.\n    // It is intended to keep the offset in sync with the timezone.\n    utils_hooks__hooks.updateOffset = function () {};\n\n    // MOMENTS\n\n    // keepLocalTime = true means only change the timezone, without\n    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n    // +0200, so we adjust the time as needed, to be valid.\n    //\n    // Keeping the time actually adds/subtracts (one hour)\n    // from the actual represented time. That is why we call updateOffset\n    // a second time. In case it wants us to change the offset again\n    // _changeInProgress == true case, then we have to adjust, because\n    // there is no such time in the given timezone.\n    function getSetOffset (input, keepLocalTime) {\n        var offset = this._offset || 0,\n            localAdjust;\n        if (input != null) {\n            if (typeof input === 'string') {\n                input = offsetFromString(input);\n            }\n            if (Math.abs(input) < 16) {\n                input = input * 60;\n            }\n            if (!this._isUTC && keepLocalTime) {\n                localAdjust = getDateOffset(this);\n            }\n            this._offset = input;\n            this._isUTC = true;\n            if (localAdjust != null) {\n                this.add(localAdjust, 'm');\n            }\n            if (offset !== input) {\n                if (!keepLocalTime || this._changeInProgress) {\n                    add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n                } else if (!this._changeInProgress) {\n                    this._changeInProgress = true;\n                    utils_hooks__hooks.updateOffset(this, true);\n                    this._changeInProgress = null;\n                }\n            }\n            return this;\n        } else {\n            return this._isUTC ? offset : getDateOffset(this);\n        }\n    }\n\n    function getSetZone (input, keepLocalTime) {\n        if (input != null) {\n            if (typeof input !== 'string') {\n                input = -input;\n            }\n\n            this.utcOffset(input, keepLocalTime);\n\n            return this;\n        } else {\n            return -this.utcOffset();\n        }\n    }\n\n    function setOffsetToUTC (keepLocalTime) {\n        return this.utcOffset(0, keepLocalTime);\n    }\n\n    function setOffsetToLocal (keepLocalTime) {\n        if (this._isUTC) {\n            this.utcOffset(0, keepLocalTime);\n            this._isUTC = false;\n\n            if (keepLocalTime) {\n                this.subtract(getDateOffset(this), 'm');\n            }\n        }\n        return this;\n    }\n\n    function setOffsetToParsedOffset () {\n        if (this._tzm) {\n            this.utcOffset(this._tzm);\n        } else if (typeof this._i === 'string') {\n            this.utcOffset(offsetFromString(this._i));\n        }\n        return this;\n    }\n\n    function hasAlignedHourOffset (input) {\n        if (!input) {\n            input = 0;\n        }\n        else {\n            input = local__createLocal(input).utcOffset();\n        }\n\n        return (this.utcOffset() - input) % 60 === 0;\n    }\n\n    function isDaylightSavingTime () {\n        return (\n            this.utcOffset() > this.clone().month(0).utcOffset() ||\n            this.utcOffset() > this.clone().month(5).utcOffset()\n        );\n    }\n\n    function isDaylightSavingTimeShifted () {\n        if (this._a) {\n            var other = this._isUTC ? create_utc__createUTC(this._a) : local__createLocal(this._a);\n            return this.isValid() && compareArrays(this._a, other.toArray()) > 0;\n        }\n\n        return false;\n    }\n\n    function isLocal () {\n        return !this._isUTC;\n    }\n\n    function isUtcOffset () {\n        return this._isUTC;\n    }\n\n    function isUtc () {\n        return this._isUTC && this._offset === 0;\n    }\n\n    var aspNetRegex = /(\\-)?(?:(\\d*)\\.)?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?)?/;\n\n    // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n    // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n    var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;\n\n    function create__createDuration (input, key) {\n        var duration = input,\n            // matching against regexp is expensive, do it on demand\n            match = null,\n            sign,\n            ret,\n            diffRes;\n\n        if (isDuration(input)) {\n            duration = {\n                ms : input._milliseconds,\n                d  : input._days,\n                M  : input._months\n            };\n        } else if (typeof input === 'number') {\n            duration = {};\n            if (key) {\n                duration[key] = input;\n            } else {\n                duration.milliseconds = input;\n            }\n        } else if (!!(match = aspNetRegex.exec(input))) {\n            sign = (match[1] === '-') ? -1 : 1;\n            duration = {\n                y  : 0,\n                d  : toInt(match[DATE])        * sign,\n                h  : toInt(match[HOUR])        * sign,\n                m  : toInt(match[MINUTE])      * sign,\n                s  : toInt(match[SECOND])      * sign,\n                ms : toInt(match[MILLISECOND]) * sign\n            };\n        } else if (!!(match = create__isoRegex.exec(input))) {\n            sign = (match[1] === '-') ? -1 : 1;\n            duration = {\n                y : parseIso(match[2], sign),\n                M : parseIso(match[3], sign),\n                d : parseIso(match[4], sign),\n                h : parseIso(match[5], sign),\n                m : parseIso(match[6], sign),\n                s : parseIso(match[7], sign),\n                w : parseIso(match[8], sign)\n            };\n        } else if (duration == null) {// checks for null or undefined\n            duration = {};\n        } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n            diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));\n\n            duration = {};\n            duration.ms = diffRes.milliseconds;\n            duration.M = diffRes.months;\n        }\n\n        ret = new Duration(duration);\n\n        if (isDuration(input) && hasOwnProp(input, '_locale')) {\n            ret._locale = input._locale;\n        }\n\n        return ret;\n    }\n\n    create__createDuration.fn = Duration.prototype;\n\n    function parseIso (inp, sign) {\n        // We'd normally use ~~inp for this, but unfortunately it also\n        // converts floats to ints.\n        // inp may be undefined, so careful calling replace on it.\n        var res = inp && parseFloat(inp.replace(',', '.'));\n        // apply sign while we're at it\n        return (isNaN(res) ? 0 : res) * sign;\n    }\n\n    function positiveMomentsDifference(base, other) {\n        var res = {milliseconds: 0, months: 0};\n\n        res.months = other.month() - base.month() +\n            (other.year() - base.year()) * 12;\n        if (base.clone().add(res.months, 'M').isAfter(other)) {\n            --res.months;\n        }\n\n        res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n        return res;\n    }\n\n    function momentsDifference(base, other) {\n        var res;\n        other = cloneWithOffset(other, base);\n        if (base.isBefore(other)) {\n            res = positiveMomentsDifference(base, other);\n        } else {\n            res = positiveMomentsDifference(other, base);\n            res.milliseconds = -res.milliseconds;\n            res.months = -res.months;\n        }\n\n        return res;\n    }\n\n    function createAdder(direction, name) {\n        return function (val, period) {\n            var dur, tmp;\n            //invert the arguments, but complain about it\n            if (period !== null && !isNaN(+period)) {\n                deprecateSimple(name, 'moment().' + name  + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n                tmp = val; val = period; period = tmp;\n            }\n\n            val = typeof val === 'string' ? +val : val;\n            dur = create__createDuration(val, period);\n            add_subtract__addSubtract(this, dur, direction);\n            return this;\n        };\n    }\n\n    function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {\n        var milliseconds = duration._milliseconds,\n            days = duration._days,\n            months = duration._months;\n        updateOffset = updateOffset == null ? true : updateOffset;\n\n        if (milliseconds) {\n            mom._d.setTime(+mom._d + milliseconds * isAdding);\n        }\n        if (days) {\n            get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);\n        }\n        if (months) {\n            setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);\n        }\n        if (updateOffset) {\n            utils_hooks__hooks.updateOffset(mom, days || months);\n        }\n    }\n\n    var add_subtract__add      = createAdder(1, 'add');\n    var add_subtract__subtract = createAdder(-1, 'subtract');\n\n    function moment_calendar__calendar (time) {\n        // We want to compare the start of today, vs this.\n        // Getting start-of-today depends on whether we're local/utc/offset or not.\n        var now = time || local__createLocal(),\n            sod = cloneWithOffset(now, this).startOf('day'),\n            diff = this.diff(sod, 'days', true),\n            format = diff < -6 ? 'sameElse' :\n                diff < -1 ? 'lastWeek' :\n                diff < 0 ? 'lastDay' :\n                diff < 1 ? 'sameDay' :\n                diff < 2 ? 'nextDay' :\n                diff < 7 ? 'nextWeek' : 'sameElse';\n        return this.format(this.localeData().calendar(format, this, local__createLocal(now)));\n    }\n\n    function clone () {\n        return new Moment(this);\n    }\n\n    function isAfter (input, units) {\n        var inputMs;\n        units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this > +input;\n        } else {\n            inputMs = isMoment(input) ? +input : +local__createLocal(input);\n            return inputMs < +this.clone().startOf(units);\n        }\n    }\n\n    function isBefore (input, units) {\n        var inputMs;\n        units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this < +input;\n        } else {\n            inputMs = isMoment(input) ? +input : +local__createLocal(input);\n            return +this.clone().endOf(units) < inputMs;\n        }\n    }\n\n    function isBetween (from, to, units) {\n        return this.isAfter(from, units) && this.isBefore(to, units);\n    }\n\n    function isSame (input, units) {\n        var inputMs;\n        units = normalizeUnits(units || 'millisecond');\n        if (units === 'millisecond') {\n            input = isMoment(input) ? input : local__createLocal(input);\n            return +this === +input;\n        } else {\n            inputMs = +local__createLocal(input);\n            return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));\n        }\n    }\n\n    function absFloor (number) {\n        if (number < 0) {\n            return Math.ceil(number);\n        } else {\n            return Math.floor(number);\n        }\n    }\n\n    function diff (input, units, asFloat) {\n        var that = cloneWithOffset(input, this),\n            zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,\n            delta, output;\n\n        units = normalizeUnits(units);\n\n        if (units === 'year' || units === 'month' || units === 'quarter') {\n            output = monthDiff(this, that);\n            if (units === 'quarter') {\n                output = output / 3;\n            } else if (units === 'year') {\n                output = output / 12;\n            }\n        } else {\n            delta = this - that;\n            output = units === 'second' ? delta / 1e3 : // 1000\n                units === 'minute' ? delta / 6e4 : // 1000 * 60\n                units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n                units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n                units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n                delta;\n        }\n        return asFloat ? output : absFloor(output);\n    }\n\n    function monthDiff (a, b) {\n        // difference in months\n        var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n            // b is in (anchor - 1 month, anchor + 1 month)\n            anchor = a.clone().add(wholeMonthDiff, 'months'),\n            anchor2, adjust;\n\n        if (b - anchor < 0) {\n            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor - anchor2);\n        } else {\n            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor2 - anchor);\n        }\n\n        return -(wholeMonthDiff + adjust);\n    }\n\n    utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n\n    function toString () {\n        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n    }\n\n    function moment_format__toISOString () {\n        var m = this.clone().utc();\n        if (0 < m.year() && m.year() <= 9999) {\n            if ('function' === typeof Date.prototype.toISOString) {\n                // native implementation is ~50x faster, use it when we can\n                return this.toDate().toISOString();\n            } else {\n                return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n            }\n        } else {\n            return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n        }\n    }\n\n    function format (inputString) {\n        var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);\n        return this.localeData().postformat(output);\n    }\n\n    function from (time, withoutSuffix) {\n        return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n    }\n\n    function fromNow (withoutSuffix) {\n        return this.from(local__createLocal(), withoutSuffix);\n    }\n\n    function locale (key) {\n        var newLocaleData;\n\n        if (key === undefined) {\n            return this._locale._abbr;\n        } else {\n            newLocaleData = locale_locales__getLocale(key);\n            if (newLocaleData != null) {\n                this._locale = newLocaleData;\n            }\n            return this;\n        }\n    }\n\n    var lang = deprecate(\n        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n        function (key) {\n            if (key === undefined) {\n                return this.localeData();\n            } else {\n                return this.locale(key);\n            }\n        }\n    );\n\n    function localeData () {\n        return this._locale;\n    }\n\n    function startOf (units) {\n        units = normalizeUnits(units);\n        // the following switch intentionally omits break keywords\n        // to utilize falling through the cases.\n        switch (units) {\n        case 'year':\n            this.month(0);\n            /* falls through */\n        case 'quarter':\n        case 'month':\n            this.date(1);\n            /* falls through */\n        case 'week':\n        case 'isoWeek':\n        case 'day':\n            this.hours(0);\n            /* falls through */\n        case 'hour':\n            this.minutes(0);\n            /* falls through */\n        case 'minute':\n            this.seconds(0);\n            /* falls through */\n        case 'second':\n            this.milliseconds(0);\n        }\n\n        // weeks are a special case\n        if (units === 'week') {\n            this.weekday(0);\n        }\n        if (units === 'isoWeek') {\n            this.isoWeekday(1);\n        }\n\n        // quarters are also special\n        if (units === 'quarter') {\n            this.month(Math.floor(this.month() / 3) * 3);\n        }\n\n        return this;\n    }\n\n    function endOf (units) {\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond') {\n            return this;\n        }\n        return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n    }\n\n    function to_type__valueOf () {\n        return +this._d - ((this._offset || 0) * 60000);\n    }\n\n    function unix () {\n        return Math.floor(+this / 1000);\n    }\n\n    function toDate () {\n        return this._offset ? new Date(+this) : this._d;\n    }\n\n    function toArray () {\n        var m = this;\n        return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n    }\n\n    function moment_valid__isValid () {\n        return valid__isValid(this);\n    }\n\n    function parsingFlags () {\n        return extend({}, this._pf);\n    }\n\n    function invalidAt () {\n        return this._pf.overflow;\n    }\n\n    addFormatToken(0, ['gg', 2], 0, function () {\n        return this.weekYear() % 100;\n    });\n\n    addFormatToken(0, ['GG', 2], 0, function () {\n        return this.isoWeekYear() % 100;\n    });\n\n    function addWeekYearFormatToken (token, getter) {\n        addFormatToken(0, [token, token.length], 0, getter);\n    }\n\n    addWeekYearFormatToken('gggg',     'weekYear');\n    addWeekYearFormatToken('ggggg',    'weekYear');\n    addWeekYearFormatToken('GGGG',  'isoWeekYear');\n    addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n    // ALIASES\n\n    addUnitAlias('weekYear', 'gg');\n    addUnitAlias('isoWeekYear', 'GG');\n\n    // PARSING\n\n    addRegexToken('G',      matchSigned);\n    addRegexToken('g',      matchSigned);\n    addRegexToken('GG',     match1to2, match2);\n    addRegexToken('gg',     match1to2, match2);\n    addRegexToken('GGGG',   match1to4, match4);\n    addRegexToken('gggg',   match1to4, match4);\n    addRegexToken('GGGGG',  match1to6, match6);\n    addRegexToken('ggggg',  match1to6, match6);\n\n    addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n        week[token.substr(0, 2)] = toInt(input);\n    });\n\n    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n        week[token] = utils_hooks__hooks.parseTwoDigitYear(input);\n    });\n\n    // HELPERS\n\n    function weeksInYear(year, dow, doy) {\n        return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;\n    }\n\n    // MOMENTS\n\n    function getSetWeekYear (input) {\n        var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;\n        return input == null ? year : this.add((input - year), 'y');\n    }\n\n    function getSetISOWeekYear (input) {\n        var year = weekOfYear(this, 1, 4).year;\n        return input == null ? year : this.add((input - year), 'y');\n    }\n\n    function getISOWeeksInYear () {\n        return weeksInYear(this.year(), 1, 4);\n    }\n\n    function getWeeksInYear () {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n    }\n\n    addFormatToken('Q', 0, 0, 'quarter');\n\n    // ALIASES\n\n    addUnitAlias('quarter', 'Q');\n\n    // PARSING\n\n    addRegexToken('Q', match1);\n    addParseToken('Q', function (input, array) {\n        array[MONTH] = (toInt(input) - 1) * 3;\n    });\n\n    // MOMENTS\n\n    function getSetQuarter (input) {\n        return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n    }\n\n    addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n    // ALIASES\n\n    addUnitAlias('date', 'D');\n\n    // PARSING\n\n    addRegexToken('D',  match1to2);\n    addRegexToken('DD', match1to2, match2);\n    addRegexToken('Do', function (isStrict, locale) {\n        return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n    });\n\n    addParseToken(['D', 'DD'], DATE);\n    addParseToken('Do', function (input, array) {\n        array[DATE] = toInt(input.match(match1to2)[0], 10);\n    });\n\n    // MOMENTS\n\n    var getSetDayOfMonth = makeGetSet('Date', true);\n\n    addFormatToken('d', 0, 'do', 'day');\n\n    addFormatToken('dd', 0, 0, function (format) {\n        return this.localeData().weekdaysMin(this, format);\n    });\n\n    addFormatToken('ddd', 0, 0, function (format) {\n        return this.localeData().weekdaysShort(this, format);\n    });\n\n    addFormatToken('dddd', 0, 0, function (format) {\n        return this.localeData().weekdays(this, format);\n    });\n\n    addFormatToken('e', 0, 0, 'weekday');\n    addFormatToken('E', 0, 0, 'isoWeekday');\n\n    // ALIASES\n\n    addUnitAlias('day', 'd');\n    addUnitAlias('weekday', 'e');\n    addUnitAlias('isoWeekday', 'E');\n\n    // PARSING\n\n    addRegexToken('d',    match1to2);\n    addRegexToken('e',    match1to2);\n    addRegexToken('E',    match1to2);\n    addRegexToken('dd',   matchWord);\n    addRegexToken('ddd',  matchWord);\n    addRegexToken('dddd', matchWord);\n\n    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {\n        var weekday = config._locale.weekdaysParse(input);\n        // if we didn't get a weekday name, mark the date as invalid\n        if (weekday != null) {\n            week.d = weekday;\n        } else {\n            config._pf.invalidWeekday = input;\n        }\n    });\n\n    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n        week[token] = toInt(input);\n    });\n\n    // HELPERS\n\n    function parseWeekday(input, locale) {\n        if (typeof input === 'string') {\n            if (!isNaN(input)) {\n                input = parseInt(input, 10);\n            }\n            else {\n                input = locale.weekdaysParse(input);\n                if (typeof input !== 'number') {\n                    return null;\n                }\n            }\n        }\n        return input;\n    }\n\n    // LOCALES\n\n    var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n    function localeWeekdays (m) {\n        return this._weekdays[m.day()];\n    }\n\n    var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n    function localeWeekdaysShort (m) {\n        return this._weekdaysShort[m.day()];\n    }\n\n    var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n    function localeWeekdaysMin (m) {\n        return this._weekdaysMin[m.day()];\n    }\n\n    function localeWeekdaysParse (weekdayName) {\n        var i, mom, regex;\n\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n        }\n\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n            if (!this._weekdaysParse[i]) {\n                mom = local__createLocal([2000, 1]).day(i);\n                regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (this._weekdaysParse[i].test(weekdayName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function getSetDayOfWeek (input) {\n        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n        if (input != null) {\n            input = parseWeekday(input, this.localeData());\n            return this.add(input - day, 'd');\n        } else {\n            return day;\n        }\n    }\n\n    function getSetLocaleDayOfWeek (input) {\n        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n        return input == null ? weekday : this.add(input - weekday, 'd');\n    }\n\n    function getSetISODayOfWeek (input) {\n        // behaves the same as moment#day except\n        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n        // as a setter, sunday should belong to the previous week.\n        return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);\n    }\n\n    addFormatToken('H', ['HH', 2], 0, 'hour');\n    addFormatToken('h', ['hh', 2], 0, function () {\n        return this.hours() % 12 || 12;\n    });\n\n    function meridiem (token, lowercase) {\n        addFormatToken(token, 0, 0, function () {\n            return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n        });\n    }\n\n    meridiem('a', true);\n    meridiem('A', false);\n\n    // ALIASES\n\n    addUnitAlias('hour', 'h');\n\n    // PARSING\n\n    function matchMeridiem (isStrict, locale) {\n        return locale._meridiemParse;\n    }\n\n    addRegexToken('a',  matchMeridiem);\n    addRegexToken('A',  matchMeridiem);\n    addRegexToken('H',  match1to2);\n    addRegexToken('h',  match1to2);\n    addRegexToken('HH', match1to2, match2);\n    addRegexToken('hh', match1to2, match2);\n\n    addParseToken(['H', 'HH'], HOUR);\n    addParseToken(['a', 'A'], function (input, array, config) {\n        config._isPm = config._locale.isPM(input);\n        config._meridiem = input;\n    });\n    addParseToken(['h', 'hh'], function (input, array, config) {\n        array[HOUR] = toInt(input);\n        config._pf.bigHour = true;\n    });\n\n    // LOCALES\n\n    function localeIsPM (input) {\n        // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n        // Using charAt should be more compatible.\n        return ((input + '').toLowerCase().charAt(0) === 'p');\n    }\n\n    var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n    function localeMeridiem (hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'pm' : 'PM';\n        } else {\n            return isLower ? 'am' : 'AM';\n        }\n    }\n\n\n    // MOMENTS\n\n    // Setting the hour should keep the time, because the user explicitly\n    // specified which hour he wants. So trying to maintain the same hour (in\n    // a new timezone) makes sense. Adding/subtracting hours does not follow\n    // this rule.\n    var getSetHour = makeGetSet('Hours', true);\n\n    addFormatToken('m', ['mm', 2], 0, 'minute');\n\n    // ALIASES\n\n    addUnitAlias('minute', 'm');\n\n    // PARSING\n\n    addRegexToken('m',  match1to2);\n    addRegexToken('mm', match1to2, match2);\n    addParseToken(['m', 'mm'], MINUTE);\n\n    // MOMENTS\n\n    var getSetMinute = makeGetSet('Minutes', false);\n\n    addFormatToken('s', ['ss', 2], 0, 'second');\n\n    // ALIASES\n\n    addUnitAlias('second', 's');\n\n    // PARSING\n\n    addRegexToken('s',  match1to2);\n    addRegexToken('ss', match1to2, match2);\n    addParseToken(['s', 'ss'], SECOND);\n\n    // MOMENTS\n\n    var getSetSecond = makeGetSet('Seconds', false);\n\n    addFormatToken('S', 0, 0, function () {\n        return ~~(this.millisecond() / 100);\n    });\n\n    addFormatToken(0, ['SS', 2], 0, function () {\n        return ~~(this.millisecond() / 10);\n    });\n\n    function millisecond__milliseconds (token) {\n        addFormatToken(0, [token, 3], 0, 'millisecond');\n    }\n\n    millisecond__milliseconds('SSS');\n    millisecond__milliseconds('SSSS');\n\n    // ALIASES\n\n    addUnitAlias('millisecond', 'ms');\n\n    // PARSING\n\n    addRegexToken('S',    match1to3, match1);\n    addRegexToken('SS',   match1to3, match2);\n    addRegexToken('SSS',  match1to3, match3);\n    addRegexToken('SSSS', matchUnsigned);\n    addParseToken(['S', 'SS', 'SSS', 'SSSS'], function (input, array) {\n        array[MILLISECOND] = toInt(('0.' + input) * 1000);\n    });\n\n    // MOMENTS\n\n    var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n    addFormatToken('z',  0, 0, 'zoneAbbr');\n    addFormatToken('zz', 0, 0, 'zoneName');\n\n    // MOMENTS\n\n    function getZoneAbbr () {\n        return this._isUTC ? 'UTC' : '';\n    }\n\n    function getZoneName () {\n        return this._isUTC ? 'Coordinated Universal Time' : '';\n    }\n\n    var momentPrototype__proto = Moment.prototype;\n\n    momentPrototype__proto.add          = add_subtract__add;\n    momentPrototype__proto.calendar     = moment_calendar__calendar;\n    momentPrototype__proto.clone        = clone;\n    momentPrototype__proto.diff         = diff;\n    momentPrototype__proto.endOf        = endOf;\n    momentPrototype__proto.format       = format;\n    momentPrototype__proto.from         = from;\n    momentPrototype__proto.fromNow      = fromNow;\n    momentPrototype__proto.get          = getSet;\n    momentPrototype__proto.invalidAt    = invalidAt;\n    momentPrototype__proto.isAfter      = isAfter;\n    momentPrototype__proto.isBefore     = isBefore;\n    momentPrototype__proto.isBetween    = isBetween;\n    momentPrototype__proto.isSame       = isSame;\n    momentPrototype__proto.isValid      = moment_valid__isValid;\n    momentPrototype__proto.lang         = lang;\n    momentPrototype__proto.locale       = locale;\n    momentPrototype__proto.localeData   = localeData;\n    momentPrototype__proto.max          = prototypeMax;\n    momentPrototype__proto.min          = prototypeMin;\n    momentPrototype__proto.parsingFlags = parsingFlags;\n    momentPrototype__proto.set          = getSet;\n    momentPrototype__proto.startOf      = startOf;\n    momentPrototype__proto.subtract     = add_subtract__subtract;\n    momentPrototype__proto.toArray      = toArray;\n    momentPrototype__proto.toDate       = toDate;\n    momentPrototype__proto.toISOString  = moment_format__toISOString;\n    momentPrototype__proto.toJSON       = moment_format__toISOString;\n    momentPrototype__proto.toString     = toString;\n    momentPrototype__proto.unix         = unix;\n    momentPrototype__proto.valueOf      = to_type__valueOf;\n\n    // Year\n    momentPrototype__proto.year       = getSetYear;\n    momentPrototype__proto.isLeapYear = getIsLeapYear;\n\n    // Week Year\n    momentPrototype__proto.weekYear    = getSetWeekYear;\n    momentPrototype__proto.isoWeekYear = getSetISOWeekYear;\n\n    // Quarter\n    momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;\n\n    // Month\n    momentPrototype__proto.month       = getSetMonth;\n    momentPrototype__proto.daysInMonth = getDaysInMonth;\n\n    // Week\n    momentPrototype__proto.week           = momentPrototype__proto.weeks        = getSetWeek;\n    momentPrototype__proto.isoWeek        = momentPrototype__proto.isoWeeks     = getSetISOWeek;\n    momentPrototype__proto.weeksInYear    = getWeeksInYear;\n    momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;\n\n    // Day\n    momentPrototype__proto.date       = getSetDayOfMonth;\n    momentPrototype__proto.day        = momentPrototype__proto.days             = getSetDayOfWeek;\n    momentPrototype__proto.weekday    = getSetLocaleDayOfWeek;\n    momentPrototype__proto.isoWeekday = getSetISODayOfWeek;\n    momentPrototype__proto.dayOfYear  = getSetDayOfYear;\n\n    // Hour\n    momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;\n\n    // Minute\n    momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;\n\n    // Second\n    momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;\n\n    // Millisecond\n    momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;\n\n    // Offset\n    momentPrototype__proto.utcOffset            = getSetOffset;\n    momentPrototype__proto.utc                  = setOffsetToUTC;\n    momentPrototype__proto.local                = setOffsetToLocal;\n    momentPrototype__proto.parseZone            = setOffsetToParsedOffset;\n    momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;\n    momentPrototype__proto.isDST                = isDaylightSavingTime;\n    momentPrototype__proto.isDSTShifted         = isDaylightSavingTimeShifted;\n    momentPrototype__proto.isLocal              = isLocal;\n    momentPrototype__proto.isUtcOffset          = isUtcOffset;\n    momentPrototype__proto.isUtc                = isUtc;\n    momentPrototype__proto.isUTC                = isUtc;\n\n    // Timezone\n    momentPrototype__proto.zoneAbbr = getZoneAbbr;\n    momentPrototype__proto.zoneName = getZoneName;\n\n    // Deprecations\n    momentPrototype__proto.dates  = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n    momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n    momentPrototype__proto.years  = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n    momentPrototype__proto.zone   = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);\n\n    var momentPrototype = momentPrototype__proto;\n\n    function moment__createUnix (input) {\n        return local__createLocal(input * 1000);\n    }\n\n    function moment__createInZone () {\n        return local__createLocal.apply(null, arguments).parseZone();\n    }\n\n    var defaultCalendar = {\n        sameDay : '[Today at] LT',\n        nextDay : '[Tomorrow at] LT',\n        nextWeek : 'dddd [at] LT',\n        lastDay : '[Yesterday at] LT',\n        lastWeek : '[Last] dddd [at] LT',\n        sameElse : 'L'\n    };\n\n    function locale_calendar__calendar (key, mom, now) {\n        var output = this._calendar[key];\n        return typeof output === 'function' ? output.call(mom, now) : output;\n    }\n\n    var defaultLongDateFormat = {\n        LTS  : 'h:mm:ss A',\n        LT   : 'h:mm A',\n        L    : 'MM/DD/YYYY',\n        LL   : 'MMMM D, YYYY',\n        LLL  : 'MMMM D, YYYY LT',\n        LLLL : 'dddd, MMMM D, YYYY LT'\n    };\n\n    function longDateFormat (key) {\n        var output = this._longDateFormat[key];\n        if (!output && this._longDateFormat[key.toUpperCase()]) {\n            output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {\n                return val.slice(1);\n            });\n            this._longDateFormat[key] = output;\n        }\n        return output;\n    }\n\n    var defaultInvalidDate = 'Invalid date';\n\n    function invalidDate () {\n        return this._invalidDate;\n    }\n\n    var defaultOrdinal = '%d';\n    var defaultOrdinalParse = /\\d{1,2}/;\n\n    function ordinal (number) {\n        return this._ordinal.replace('%d', number);\n    }\n\n    function preParsePostFormat (string) {\n        return string;\n    }\n\n    var defaultRelativeTime = {\n        future : 'in %s',\n        past   : '%s ago',\n        s  : 'a few seconds',\n        m  : 'a minute',\n        mm : '%d minutes',\n        h  : 'an hour',\n        hh : '%d hours',\n        d  : 'a day',\n        dd : '%d days',\n        M  : 'a month',\n        MM : '%d months',\n        y  : 'a year',\n        yy : '%d years'\n    };\n\n    function relative__relativeTime (number, withoutSuffix, string, isFuture) {\n        var output = this._relativeTime[string];\n        return (typeof output === 'function') ?\n            output(number, withoutSuffix, string, isFuture) :\n            output.replace(/%d/i, number);\n    }\n\n    function pastFuture (diff, output) {\n        var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n        return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);\n    }\n\n    function locale_set__set (config) {\n        var prop, i;\n        for (i in config) {\n            prop = config[i];\n            if (typeof prop === 'function') {\n                this[i] = prop;\n            } else {\n                this['_' + i] = prop;\n            }\n        }\n        // Lenient ordinal parsing accepts just a number in addition to\n        // number + (possibly) stuff coming from _ordinalParseLenient.\n        this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + /\\d{1,2}/.source);\n    }\n\n    var prototype__proto = Locale.prototype;\n\n    prototype__proto._calendar       = defaultCalendar;\n    prototype__proto.calendar        = locale_calendar__calendar;\n    prototype__proto._longDateFormat = defaultLongDateFormat;\n    prototype__proto.longDateFormat  = longDateFormat;\n    prototype__proto._invalidDate    = defaultInvalidDate;\n    prototype__proto.invalidDate     = invalidDate;\n    prototype__proto._ordinal        = defaultOrdinal;\n    prototype__proto.ordinal         = ordinal;\n    prototype__proto._ordinalParse   = defaultOrdinalParse;\n    prototype__proto.preparse        = preParsePostFormat;\n    prototype__proto.postformat      = preParsePostFormat;\n    prototype__proto._relativeTime   = defaultRelativeTime;\n    prototype__proto.relativeTime    = relative__relativeTime;\n    prototype__proto.pastFuture      = pastFuture;\n    prototype__proto.set             = locale_set__set;\n\n    // Month\n    prototype__proto.months       =        localeMonths;\n    prototype__proto._months      = defaultLocaleMonths;\n    prototype__proto.monthsShort  =        localeMonthsShort;\n    prototype__proto._monthsShort = defaultLocaleMonthsShort;\n    prototype__proto.monthsParse  =        localeMonthsParse;\n\n    // Week\n    prototype__proto.week = localeWeek;\n    prototype__proto._week = defaultLocaleWeek;\n    prototype__proto.firstDayOfYear = localeFirstDayOfYear;\n    prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;\n\n    // Day of Week\n    prototype__proto.weekdays       =        localeWeekdays;\n    prototype__proto._weekdays      = defaultLocaleWeekdays;\n    prototype__proto.weekdaysMin    =        localeWeekdaysMin;\n    prototype__proto._weekdaysMin   = defaultLocaleWeekdaysMin;\n    prototype__proto.weekdaysShort  =        localeWeekdaysShort;\n    prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;\n    prototype__proto.weekdaysParse  =        localeWeekdaysParse;\n\n    // Hours\n    prototype__proto.isPM = localeIsPM;\n    prototype__proto._meridiemParse = defaultLocaleMeridiemParse;\n    prototype__proto.meridiem = localeMeridiem;\n\n    function lists__get (format, index, field, setter) {\n        var locale = locale_locales__getLocale();\n        var utc = create_utc__createUTC().set(setter, index);\n        return locale[field](utc, format);\n    }\n\n    function list (format, index, field, count, setter) {\n        if (typeof format === 'number') {\n            index = format;\n            format = undefined;\n        }\n\n        format = format || '';\n\n        if (index != null) {\n            return lists__get(format, index, field, setter);\n        }\n\n        var i;\n        var out = [];\n        for (i = 0; i < count; i++) {\n            out[i] = lists__get(format, i, field, setter);\n        }\n        return out;\n    }\n\n    function lists__listMonths (format, index) {\n        return list(format, index, 'months', 12, 'month');\n    }\n\n    function lists__listMonthsShort (format, index) {\n        return list(format, index, 'monthsShort', 12, 'month');\n    }\n\n    function lists__listWeekdays (format, index) {\n        return list(format, index, 'weekdays', 7, 'day');\n    }\n\n    function lists__listWeekdaysShort (format, index) {\n        return list(format, index, 'weekdaysShort', 7, 'day');\n    }\n\n    function lists__listWeekdaysMin (format, index) {\n        return list(format, index, 'weekdaysMin', 7, 'day');\n    }\n\n    locale_locales__getSetGlobalLocale('en', {\n        ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal : function (number) {\n            var b = number % 10,\n                output = (toInt(number % 100 / 10) === 1) ? 'th' :\n                (b === 1) ? 'st' :\n                (b === 2) ? 'nd' :\n                (b === 3) ? 'rd' : 'th';\n            return number + output;\n        }\n    });\n\n    // Side effect imports\n    utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);\n    utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);\n\n    var mathAbs = Math.abs;\n\n    function duration_abs__abs () {\n        var data           = this._data;\n\n        this._milliseconds = mathAbs(this._milliseconds);\n        this._days         = mathAbs(this._days);\n        this._months       = mathAbs(this._months);\n\n        data.milliseconds  = mathAbs(data.milliseconds);\n        data.seconds       = mathAbs(data.seconds);\n        data.minutes       = mathAbs(data.minutes);\n        data.hours         = mathAbs(data.hours);\n        data.months        = mathAbs(data.months);\n        data.years         = mathAbs(data.years);\n\n        return this;\n    }\n\n    function duration_add_subtract__addSubtract (duration, input, value, direction) {\n        var other = create__createDuration(input, value);\n\n        duration._milliseconds += direction * other._milliseconds;\n        duration._days         += direction * other._days;\n        duration._months       += direction * other._months;\n\n        return duration._bubble();\n    }\n\n    // supports only 2.0-style add(1, 's') or add(duration)\n    function duration_add_subtract__add (input, value) {\n        return duration_add_subtract__addSubtract(this, input, value, 1);\n    }\n\n    // supports only 2.0-style subtract(1, 's') or subtract(duration)\n    function duration_add_subtract__subtract (input, value) {\n        return duration_add_subtract__addSubtract(this, input, value, -1);\n    }\n\n    function bubble () {\n        var milliseconds = this._milliseconds;\n        var days         = this._days;\n        var months       = this._months;\n        var data         = this._data;\n        var seconds, minutes, hours, years = 0;\n\n        // The following code bubbles up values, see the tests for\n        // examples of what that means.\n        data.milliseconds = milliseconds % 1000;\n\n        seconds           = absFloor(milliseconds / 1000);\n        data.seconds      = seconds % 60;\n\n        minutes           = absFloor(seconds / 60);\n        data.minutes      = minutes % 60;\n\n        hours             = absFloor(minutes / 60);\n        data.hours        = hours % 24;\n\n        days += absFloor(hours / 24);\n\n        // Accurately convert days to years, assume start from year 0.\n        years = absFloor(daysToYears(days));\n        days -= absFloor(yearsToDays(years));\n\n        // 30 days to a month\n        // TODO (iskren): Use anchor date (like 1st Jan) to compute this.\n        months += absFloor(days / 30);\n        days   %= 30;\n\n        // 12 months -> 1 year\n        years  += absFloor(months / 12);\n        months %= 12;\n\n        data.days   = days;\n        data.months = months;\n        data.years  = years;\n\n        return this;\n    }\n\n    function daysToYears (days) {\n        // 400 years have 146097 days (taking into account leap year rules)\n        return days * 400 / 146097;\n    }\n\n    function yearsToDays (years) {\n        // years * 365 + absFloor(years / 4) -\n        //     absFloor(years / 100) + absFloor(years / 400);\n        return years * 146097 / 400;\n    }\n\n    function as (units) {\n        var days;\n        var months;\n        var milliseconds = this._milliseconds;\n\n        units = normalizeUnits(units);\n\n        if (units === 'month' || units === 'year') {\n            days   = this._days   + milliseconds / 864e5;\n            months = this._months + daysToYears(days) * 12;\n            return units === 'month' ? months : months / 12;\n        } else {\n            // handle milliseconds separately because of floating point math errors (issue #1867)\n            days = this._days + Math.round(yearsToDays(this._months / 12));\n            switch (units) {\n                case 'week'   : return days / 7            + milliseconds / 6048e5;\n                case 'day'    : return days                + milliseconds / 864e5;\n                case 'hour'   : return days * 24           + milliseconds / 36e5;\n                case 'minute' : return days * 24 * 60      + milliseconds / 6e4;\n                case 'second' : return days * 24 * 60 * 60 + milliseconds / 1000;\n                // Math.floor prevents floating point math errors here\n                case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds;\n                default: throw new Error('Unknown unit ' + units);\n            }\n        }\n    }\n\n    // TODO: Use this.as('ms')?\n    function duration_as__valueOf () {\n        return (\n            this._milliseconds +\n            this._days * 864e5 +\n            (this._months % 12) * 2592e6 +\n            toInt(this._months / 12) * 31536e6\n        );\n    }\n\n    function makeAs (alias) {\n        return function () {\n            return this.as(alias);\n        };\n    }\n\n    var asMilliseconds = makeAs('ms');\n    var asSeconds      = makeAs('s');\n    var asMinutes      = makeAs('m');\n    var asHours        = makeAs('h');\n    var asDays         = makeAs('d');\n    var asWeeks        = makeAs('w');\n    var asMonths       = makeAs('M');\n    var asYears        = makeAs('y');\n\n    function duration_get__get (units) {\n        units = normalizeUnits(units);\n        return this[units + 's']();\n    }\n\n    function makeGetter(name) {\n        return function () {\n            return this._data[name];\n        };\n    }\n\n    var duration_get__milliseconds = makeGetter('milliseconds');\n    var seconds      = makeGetter('seconds');\n    var minutes      = makeGetter('minutes');\n    var hours        = makeGetter('hours');\n    var days         = makeGetter('days');\n    var months       = makeGetter('months');\n    var years        = makeGetter('years');\n\n    function weeks () {\n        return absFloor(this.days() / 7);\n    }\n\n    var round = Math.round;\n    var thresholds = {\n        s: 45,  // seconds to minute\n        m: 45,  // minutes to hour\n        h: 22,  // hours to day\n        d: 26,  // days to month\n        M: 11   // months to year\n    };\n\n    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n    }\n\n    function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {\n        var duration = create__createDuration(posNegDuration).abs();\n        var seconds  = round(duration.as('s'));\n        var minutes  = round(duration.as('m'));\n        var hours    = round(duration.as('h'));\n        var days     = round(duration.as('d'));\n        var months   = round(duration.as('M'));\n        var years    = round(duration.as('y'));\n\n        var a = seconds < thresholds.s && ['s', seconds]  ||\n                minutes === 1          && ['m']           ||\n                minutes < thresholds.m && ['mm', minutes] ||\n                hours   === 1          && ['h']           ||\n                hours   < thresholds.h && ['hh', hours]   ||\n                days    === 1          && ['d']           ||\n                days    < thresholds.d && ['dd', days]    ||\n                months  === 1          && ['M']           ||\n                months  < thresholds.M && ['MM', months]  ||\n                years   === 1          && ['y']           || ['yy', years];\n\n        a[2] = withoutSuffix;\n        a[3] = +posNegDuration > 0;\n        a[4] = locale;\n        return substituteTimeAgo.apply(null, a);\n    }\n\n    // This function allows you to set a threshold for relative time strings\n    function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n        if (thresholds[threshold] === undefined) {\n            return false;\n        }\n        if (limit === undefined) {\n            return thresholds[threshold];\n        }\n        thresholds[threshold] = limit;\n        return true;\n    }\n\n    function humanize (withSuffix) {\n        var locale = this.localeData();\n        var output = duration_humanize__relativeTime(this, !withSuffix, locale);\n\n        if (withSuffix) {\n            output = locale.pastFuture(+this, output);\n        }\n\n        return locale.postformat(output);\n    }\n\n    var iso_string__abs = Math.abs;\n\n    function iso_string__toISOString() {\n        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n        var Y = iso_string__abs(this.years());\n        var M = iso_string__abs(this.months());\n        var D = iso_string__abs(this.days());\n        var h = iso_string__abs(this.hours());\n        var m = iso_string__abs(this.minutes());\n        var s = iso_string__abs(this.seconds() + this.milliseconds() / 1000);\n        var total = this.asSeconds();\n\n        if (!total) {\n            // this is the same as C#'s (Noda) and python (isodate)...\n            // but not other JS (goog.date)\n            return 'P0D';\n        }\n\n        return (total < 0 ? '-' : '') +\n            'P' +\n            (Y ? Y + 'Y' : '') +\n            (M ? M + 'M' : '') +\n            (D ? D + 'D' : '') +\n            ((h || m || s) ? 'T' : '') +\n            (h ? h + 'H' : '') +\n            (m ? m + 'M' : '') +\n            (s ? s + 'S' : '');\n    }\n\n    var duration_prototype__proto = Duration.prototype;\n\n    duration_prototype__proto.abs            = duration_abs__abs;\n    duration_prototype__proto.add            = duration_add_subtract__add;\n    duration_prototype__proto.subtract       = duration_add_subtract__subtract;\n    duration_prototype__proto.as             = as;\n    duration_prototype__proto.asMilliseconds = asMilliseconds;\n    duration_prototype__proto.asSeconds      = asSeconds;\n    duration_prototype__proto.asMinutes      = asMinutes;\n    duration_prototype__proto.asHours        = asHours;\n    duration_prototype__proto.asDays         = asDays;\n    duration_prototype__proto.asWeeks        = asWeeks;\n    duration_prototype__proto.asMonths       = asMonths;\n    duration_prototype__proto.asYears        = asYears;\n    duration_prototype__proto.valueOf        = duration_as__valueOf;\n    duration_prototype__proto._bubble        = bubble;\n    duration_prototype__proto.get            = duration_get__get;\n    duration_prototype__proto.milliseconds   = duration_get__milliseconds;\n    duration_prototype__proto.seconds        = seconds;\n    duration_prototype__proto.minutes        = minutes;\n    duration_prototype__proto.hours          = hours;\n    duration_prototype__proto.days           = days;\n    duration_prototype__proto.weeks          = weeks;\n    duration_prototype__proto.months         = months;\n    duration_prototype__proto.years          = years;\n    duration_prototype__proto.humanize       = humanize;\n    duration_prototype__proto.toISOString    = iso_string__toISOString;\n    duration_prototype__proto.toString       = iso_string__toISOString;\n    duration_prototype__proto.toJSON         = iso_string__toISOString;\n    duration_prototype__proto.locale         = locale;\n    duration_prototype__proto.localeData     = localeData;\n\n    // Deprecations\n    duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);\n    duration_prototype__proto.lang = lang;\n\n    // Side effect imports\n\n    addFormatToken('X', 0, 0, 'unix');\n    addFormatToken('x', 0, 0, 'valueOf');\n\n    // PARSING\n\n    addRegexToken('x', matchSigned);\n    addRegexToken('X', matchTimestamp);\n    addParseToken('X', function (input, array, config) {\n        config._d = new Date(parseFloat(input, 10) * 1000);\n    });\n    addParseToken('x', function (input, array, config) {\n        config._d = new Date(toInt(input));\n    });\n\n    // Side effect imports\n\n\n    utils_hooks__hooks.version = '2.10.2';\n\n    setHookCallback(local__createLocal);\n\n    utils_hooks__hooks.fn                    = momentPrototype;\n    utils_hooks__hooks.min                   = min;\n    utils_hooks__hooks.max                   = max;\n    utils_hooks__hooks.utc                   = create_utc__createUTC;\n    utils_hooks__hooks.unix                  = moment__createUnix;\n    utils_hooks__hooks.months                = lists__listMonths;\n    utils_hooks__hooks.isDate                = isDate;\n    utils_hooks__hooks.locale                = locale_locales__getSetGlobalLocale;\n    utils_hooks__hooks.invalid               = valid__createInvalid;\n    utils_hooks__hooks.duration              = create__createDuration;\n    utils_hooks__hooks.isMoment              = isMoment;\n    utils_hooks__hooks.weekdays              = lists__listWeekdays;\n    utils_hooks__hooks.parseZone             = moment__createInZone;\n    utils_hooks__hooks.localeData            = locale_locales__getLocale;\n    utils_hooks__hooks.isDuration            = isDuration;\n    utils_hooks__hooks.monthsShort           = lists__listMonthsShort;\n    utils_hooks__hooks.weekdaysMin           = lists__listWeekdaysMin;\n    utils_hooks__hooks.defineLocale          = defineLocale;\n    utils_hooks__hooks.weekdaysShort         = lists__listWeekdaysShort;\n    utils_hooks__hooks.normalizeUnits        = normalizeUnits;\n    utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;\n\n    var _moment = utils_hooks__hooks;\n\n    return _moment;\n\n}));"
  },
  {
    "path": "www/lib/moment/src/lib/create/check-overflow.js",
    "content": "import { daysInMonth } from '../units/month';\nimport { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants';\n\nexport default function checkOverflow (m) {\n    var overflow;\n    var a = m._a;\n\n    if (a && m._pf.overflow === -2) {\n        overflow =\n            a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :\n            a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n            a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n            a[MINUTE]      < 0 || a[MINUTE]      > 59  ? MINUTE :\n            a[SECOND]      < 0 || a[SECOND]      > 59  ? SECOND :\n            a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n            -1;\n\n        if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n            overflow = DATE;\n        }\n\n        m._pf.overflow = overflow;\n    }\n\n    return m;\n}\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/date-from-array.js",
    "content": "export function createDate (y, m, d, h, M, s, ms) {\n    //can't just apply() to create a date:\n    //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n    var date = new Date(y, m, d, h, M, s, ms);\n\n    //the date constructor doesn't accept years < 1970\n    if (y < 1970) {\n        date.setFullYear(y);\n    }\n    return date;\n}\n\nexport function createUTCDate (y) {\n    var date = new Date(Date.UTC.apply(null, arguments));\n    if (y < 1970) {\n        date.setUTCFullYear(y);\n    }\n    return date;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/default-parsing-flags.js",
    "content": "export default function defaultParsingFlags() {\n    // We need to deep clone this object.\n    return {\n        empty           : false,\n        unusedTokens    : [],\n        unusedInput     : [],\n        overflow        : -2,\n        charsLeftOver   : 0,\n        nullInput       : false,\n        invalidMonth    : null,\n        invalidFormat   : false,\n        userInvalidated : false,\n        iso             : false\n    };\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-anything.js",
    "content": "import defaultParsingFlags from './default-parsing-flags';\nimport isArray from '../utils/is-array';\nimport isDate from '../utils/is-date';\nimport map from '../utils/map';\nimport { createInvalid } from './valid';\nimport { Moment, isMoment } from '../moment/constructor';\nimport { getLocale } from '../locale/locales';\nimport { hooks } from '../utils/hooks';\nimport checkOverflow from './check-overflow';\n\nimport { configFromStringAndArray }  from './from-string-and-array';\nimport { configFromStringAndFormat } from './from-string-and-format';\nimport { configFromString }          from './from-string';\nimport { configFromArray }           from './from-array';\nimport { configFromObject }          from './from-object';\n\nfunction createFromConfig (config) {\n    var input = config._i,\n        format = config._f,\n        res;\n\n    config._locale = config._locale || getLocale(config._l);\n\n    if (input === null || (format === undefined && input === '')) {\n        return createInvalid({nullInput: true});\n    }\n\n    if (typeof input === 'string') {\n        config._i = input = config._locale.preparse(input);\n    }\n\n    if (isMoment(input)) {\n        return new Moment(checkOverflow(input));\n    } else if (isArray(format)) {\n        configFromStringAndArray(config);\n    } else if (format) {\n        configFromStringAndFormat(config);\n    } else {\n        configFromInput(config);\n    }\n\n    res = new Moment(checkOverflow(config));\n    if (res._nextDay) {\n        // Adding is smart enough around DST\n        res.add(1, 'd');\n        res._nextDay = undefined;\n    }\n\n    return res;\n}\n\nfunction configFromInput(config) {\n    var input = config._i;\n    if (input === undefined) {\n        config._d = new Date();\n    } else if (isDate(input)) {\n        config._d = new Date(+input);\n    } else if (typeof input === 'string') {\n        configFromString(config);\n    } else if (isArray(input)) {\n        config._a = map(input.slice(0), function (obj) {\n            return parseInt(obj, 10);\n        });\n        configFromArray(config);\n    } else if (typeof(input) === 'object') {\n        configFromObject(config);\n    } else if (typeof(input) === 'number') {\n        // from milliseconds\n        config._d = new Date(input);\n    } else {\n        hooks.createFromInputFallback(config);\n    }\n}\n\nexport function createLocalOrUTC (input, format, locale, strict, isUTC) {\n    var c = {};\n\n    if (typeof(locale) === 'boolean') {\n        strict = locale;\n        locale = undefined;\n    }\n    // object construction must be done this way.\n    // https://github.com/moment/moment/issues/1423\n    c._isAMomentObject = true;\n    c._useUTC = c._isUTC = isUTC;\n    c._l = locale;\n    c._i = input;\n    c._f = format;\n    c._strict = strict;\n    c._pf = defaultParsingFlags();\n\n    return createFromConfig(c);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-array.js",
    "content": "import { createDate, createUTCDate } from './date-from-array';\nimport { daysInYear } from '../units/year';\nimport { weekOfYear } from '../units/week';\nimport { dayOfYearFromWeeks } from '../units/day-of-year';\nimport { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants';\nimport { createLocal } from './local';\nimport defaults from '../utils/defaults';\n\nfunction currentDateArray(config) {\n    var now = new Date();\n    if (config._useUTC) {\n        return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];\n    }\n    return [now.getFullYear(), now.getMonth(), now.getDate()];\n}\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\nexport function configFromArray (config) {\n    var i, date, input = [], currentDate, yearToUse;\n\n    if (config._d) {\n        return;\n    }\n\n    currentDate = currentDateArray(config);\n\n    //compute day of the year from weeks and weekdays\n    if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n        dayOfYearFromWeekInfo(config);\n    }\n\n    //if the day of the year is set, figure out what it is\n    if (config._dayOfYear) {\n        yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n        if (config._dayOfYear > daysInYear(yearToUse)) {\n            config._pf._overflowDayOfYear = true;\n        }\n\n        date = createUTCDate(yearToUse, 0, config._dayOfYear);\n        config._a[MONTH] = date.getUTCMonth();\n        config._a[DATE] = date.getUTCDate();\n    }\n\n    // Default to current date.\n    // * if no year, month, day of month are given, default to today\n    // * if day of month is given, default month and year\n    // * if month is given, default only year\n    // * if year is given, don't default anything\n    for (i = 0; i < 3 && config._a[i] == null; ++i) {\n        config._a[i] = input[i] = currentDate[i];\n    }\n\n    // Zero out whatever was not defaulted, including time\n    for (; i < 7; i++) {\n        config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n    }\n\n    // Check for 24:00:00.000\n    if (config._a[HOUR] === 24 &&\n            config._a[MINUTE] === 0 &&\n            config._a[SECOND] === 0 &&\n            config._a[MILLISECOND] === 0) {\n        config._nextDay = true;\n        config._a[HOUR] = 0;\n    }\n\n    config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n    // Apply timezone offset from input. The actual utcOffset can be changed\n    // with parseZone.\n    if (config._tzm != null) {\n        config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n    }\n\n    if (config._nextDay) {\n        config._a[HOUR] = 24;\n    }\n}\n\nfunction dayOfYearFromWeekInfo(config) {\n    var w, weekYear, week, weekday, dow, doy, temp;\n\n    w = config._w;\n    if (w.GG != null || w.W != null || w.E != null) {\n        dow = 1;\n        doy = 4;\n\n        // TODO: We need to take the current isoWeekYear, but that depends on\n        // how we interpret now (local, utc, fixed offset). So create\n        // a now version of current config (take local/utc/offset flags, and\n        // create now).\n        weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n        week = defaults(w.W, 1);\n        weekday = defaults(w.E, 1);\n    } else {\n        dow = config._locale._week.dow;\n        doy = config._locale._week.doy;\n\n        weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(createLocal(), dow, doy).year);\n        week = defaults(w.w, 1);\n\n        if (w.d != null) {\n            // weekday -- low day numbers are considered next week\n            weekday = w.d;\n            if (weekday < dow) {\n                ++week;\n            }\n        } else if (w.e != null) {\n            // local weekday -- counting starts from begining of week\n            weekday = w.e + dow;\n        } else {\n            // default to begining of week\n            weekday = dow;\n        }\n    }\n    temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);\n\n    config._a[YEAR] = temp.year;\n    config._dayOfYear = temp.dayOfYear;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-object.js",
    "content": "import { normalizeObjectUnits } from '../units/aliases';\nimport { configFromArray } from './from-array';\n\nexport function configFromObject(config) {\n    if (config._d) {\n        return;\n    }\n\n    var i = normalizeObjectUnits(config._i);\n    config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];\n\n    configFromArray(config);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-string-and-array.js",
    "content": "import { copyConfig } from '../moment/constructor';\nimport { configFromStringAndFormat } from './from-string-and-format';\nimport defaultParsingFlags from './default-parsing-flags';\nimport { isValid } from './valid';\nimport extend from '../utils/extend';\n\n// date from string and array of format strings\nexport function configFromStringAndArray(config) {\n    var tempConfig,\n        bestMoment,\n\n        scoreToBeat,\n        i,\n        currentScore;\n\n    if (config._f.length === 0) {\n        config._pf.invalidFormat = true;\n        config._d = new Date(NaN);\n        return;\n    }\n\n    for (i = 0; i < config._f.length; i++) {\n        currentScore = 0;\n        tempConfig = copyConfig({}, config);\n        if (config._useUTC != null) {\n            tempConfig._useUTC = config._useUTC;\n        }\n        tempConfig._pf = defaultParsingFlags();\n        tempConfig._f = config._f[i];\n        configFromStringAndFormat(tempConfig);\n\n        if (!isValid(tempConfig)) {\n            continue;\n        }\n\n        // if there is any input that was not parsed add a penalty for that format\n        currentScore += tempConfig._pf.charsLeftOver;\n\n        //or tokens\n        currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n        tempConfig._pf.score = currentScore;\n\n        if (scoreToBeat == null || currentScore < scoreToBeat) {\n            scoreToBeat = currentScore;\n            bestMoment = tempConfig;\n        }\n    }\n\n    extend(config, bestMoment || tempConfig);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-string-and-format.js",
    "content": "import { configFromISO } from './from-string';\nimport { configFromArray } from './from-array';\nimport { getParseRegexForToken }   from '../parse/regex';\nimport { addTimeToArrayFromToken } from '../parse/token';\nimport { expandFormat, formatTokenFunctions, formattingTokens } from '../format/format';\nimport checkOverflow from './check-overflow';\nimport { HOUR } from '../units/constants';\nimport { hooks } from '../utils/hooks';\n\n// constant that refers to the ISO standard\nhooks.ISO_8601 = function () {};\n\n// date from string and format string\nexport function configFromStringAndFormat(config) {\n    // TODO: Move this to another part of the creation flow to prevent circular deps\n    if (config._f === hooks.ISO_8601) {\n        configFromISO(config);\n        return;\n    }\n\n    config._a = [];\n    config._pf.empty = true;\n\n    // This array is used to make a Date, either with `new Date` or `Date.UTC`\n    var string = '' + config._i,\n        i, parsedInput, tokens, token, skipped,\n        stringLength = string.length,\n        totalParsedInputLength = 0;\n\n    tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n    for (i = 0; i < tokens.length; i++) {\n        token = tokens[i];\n        parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n        if (parsedInput) {\n            skipped = string.substr(0, string.indexOf(parsedInput));\n            if (skipped.length > 0) {\n                config._pf.unusedInput.push(skipped);\n            }\n            string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n            totalParsedInputLength += parsedInput.length;\n        }\n        // don't parse if it's not a known token\n        if (formatTokenFunctions[token]) {\n            if (parsedInput) {\n                config._pf.empty = false;\n            }\n            else {\n                config._pf.unusedTokens.push(token);\n            }\n            addTimeToArrayFromToken(token, parsedInput, config);\n        }\n        else if (config._strict && !parsedInput) {\n            config._pf.unusedTokens.push(token);\n        }\n    }\n\n    // add remaining unparsed input length to the string\n    config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n    if (string.length > 0) {\n        config._pf.unusedInput.push(string);\n    }\n\n    // clear _12h flag if hour is <= 12\n    if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n        config._pf.bigHour = undefined;\n    }\n    // handle meridiem\n    config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n    configFromArray(config);\n    checkOverflow(config);\n}\n\n\nfunction meridiemFixWrap (locale, hour, meridiem) {\n    var isPm;\n\n    if (meridiem == null) {\n        // nothing to do\n        return hour;\n    }\n    if (locale.meridiemHour != null) {\n        return locale.meridiemHour(hour, meridiem);\n    } else if (locale.isPM != null) {\n        // Fallback\n        isPm = locale.isPM(meridiem);\n        if (isPm && hour < 12) {\n            hour += 12;\n        }\n        if (!isPm && hour === 12) {\n            hour = 0;\n        }\n        return hour;\n    } else {\n        // this is not supposed to happen\n        return hour;\n    }\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/from-string.js",
    "content": "import { matchOffset } from '../parse/regex';\nimport { configFromStringAndFormat } from './from-string-and-format';\nimport { hooks } from '../utils/hooks';\nimport { deprecate } from '../utils/deprecate';\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\nvar isoRegex = /^\\s*(?:[+-]\\d{6}|\\d{4})-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\nvar isoDates = [\n    ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d{2}-\\d{2}/],\n    ['YYYY-MM-DD', /\\d{4}-\\d{2}-\\d{2}/],\n    ['GGGG-[W]WW-E', /\\d{4}-W\\d{2}-\\d/],\n    ['GGGG-[W]WW', /\\d{4}-W\\d{2}/],\n    ['YYYY-DDD', /\\d{4}-\\d{3}/]\n];\n\n// iso time formats and regexes\nvar isoTimes = [\n    ['HH:mm:ss.SSSS', /(T| )\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n    ['HH:mm:ss', /(T| )\\d\\d:\\d\\d:\\d\\d/],\n    ['HH:mm', /(T| )\\d\\d:\\d\\d/],\n    ['HH', /(T| )\\d\\d/]\n];\n\nvar aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n// date from iso format\nexport function configFromISO(config) {\n    var i, l,\n        string = config._i,\n        match = isoRegex.exec(string);\n\n    if (match) {\n        config._pf.iso = true;\n        for (i = 0, l = isoDates.length; i < l; i++) {\n            if (isoDates[i][1].exec(string)) {\n                // match[5] should be 'T' or undefined\n                config._f = isoDates[i][0] + (match[6] || ' ');\n                break;\n            }\n        }\n        for (i = 0, l = isoTimes.length; i < l; i++) {\n            if (isoTimes[i][1].exec(string)) {\n                config._f += isoTimes[i][0];\n                break;\n            }\n        }\n        if (string.match(matchOffset)) {\n            config._f += 'Z';\n        }\n        configFromStringAndFormat(config);\n    } else {\n        config._isValid = false;\n    }\n}\n\n// date from iso format or fallback\nexport function configFromString(config) {\n    var matched = aspNetJsonRegex.exec(config._i);\n\n    if (matched !== null) {\n        config._d = new Date(+matched[1]);\n        return;\n    }\n\n    configFromISO(config);\n    if (config._isValid === false) {\n        delete config._isValid;\n        hooks.createFromInputFallback(config);\n    }\n}\n\nhooks.createFromInputFallback = deprecate(\n    'moment construction falls back to js Date. This is ' +\n    'discouraged and will be removed in upcoming major ' +\n    'release. Please refer to ' +\n    'https://github.com/moment/moment/issues/1407 for more info.',\n    function (config) {\n        config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n    }\n);\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/local.js",
    "content": "import { createLocalOrUTC } from './from-anything';\n\nexport function createLocal (input, format, locale, strict) {\n    return createLocalOrUTC(input, format, locale, strict, false);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/utc.js",
    "content": "import { createLocalOrUTC } from './from-anything';\n\nexport function createUTC (input, format, locale, strict) {\n    return createLocalOrUTC(input, format, locale, strict, true).utc();\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/create/valid.js",
    "content": "import extend from '../utils/extend';\nimport { createUTC } from './utc';\n\nexport function isValid(m) {\n    if (m._isValid == null) {\n        m._isValid = !isNaN(m._d.getTime()) &&\n            m._pf.overflow < 0 &&\n            !m._pf.empty &&\n            !m._pf.invalidMonth &&\n            !m._pf.nullInput &&\n            !m._pf.invalidFormat &&\n            !m._pf.userInvalidated;\n\n        if (m._strict) {\n            m._isValid = m._isValid &&\n                m._pf.charsLeftOver === 0 &&\n                m._pf.unusedTokens.length === 0 &&\n                m._pf.bigHour === undefined;\n        }\n    }\n    return m._isValid;\n}\n\nexport function createInvalid (flags) {\n    var m = createUTC(NaN);\n    if (flags != null) {\n        extend(m._pf, flags);\n    }\n    else {\n        m._pf.userInvalidated = true;\n    }\n\n    return m;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/abs.js",
    "content": "var mathAbs = Math.abs;\n\nexport function abs () {\n    var data           = this._data;\n\n    this._milliseconds = mathAbs(this._milliseconds);\n    this._days         = mathAbs(this._days);\n    this._months       = mathAbs(this._months);\n\n    data.milliseconds  = mathAbs(data.milliseconds);\n    data.seconds       = mathAbs(data.seconds);\n    data.minutes       = mathAbs(data.minutes);\n    data.hours         = mathAbs(data.hours);\n    data.months        = mathAbs(data.months);\n    data.years         = mathAbs(data.years);\n\n    return this;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/add-subtract.js",
    "content": "import { createDuration } from './create';\n\nfunction addSubtract (duration, input, value, direction) {\n    var other = createDuration(input, value);\n\n    duration._milliseconds += direction * other._milliseconds;\n    duration._days         += direction * other._days;\n    duration._months       += direction * other._months;\n\n    return duration._bubble();\n}\n\n// supports only 2.0-style add(1, 's') or add(duration)\nexport function add (input, value) {\n    return addSubtract(this, input, value, 1);\n}\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\nexport function subtract (input, value) {\n    return addSubtract(this, input, value, -1);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/as.js",
    "content": "import { daysToYears, yearsToDays } from './bubble';\nimport { normalizeUnits } from '../units/aliases';\nimport toInt from '../utils/to-int';\n\nexport function as (units) {\n    var days;\n    var months;\n    var milliseconds = this._milliseconds;\n\n    units = normalizeUnits(units);\n\n    if (units === 'month' || units === 'year') {\n        days   = this._days   + milliseconds / 864e5;\n        months = this._months + daysToYears(days) * 12;\n        return units === 'month' ? months : months / 12;\n    } else {\n        // handle milliseconds separately because of floating point math errors (issue #1867)\n        days = this._days + Math.round(yearsToDays(this._months / 12));\n        switch (units) {\n            case 'week'   : return days / 7            + milliseconds / 6048e5;\n            case 'day'    : return days                + milliseconds / 864e5;\n            case 'hour'   : return days * 24           + milliseconds / 36e5;\n            case 'minute' : return days * 24 * 60      + milliseconds / 6e4;\n            case 'second' : return days * 24 * 60 * 60 + milliseconds / 1000;\n            // Math.floor prevents floating point math errors here\n            case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + milliseconds;\n            default: throw new Error('Unknown unit ' + units);\n        }\n    }\n}\n\n// TODO: Use this.as('ms')?\nexport function valueOf () {\n    return (\n        this._milliseconds +\n        this._days * 864e5 +\n        (this._months % 12) * 2592e6 +\n        toInt(this._months / 12) * 31536e6\n    );\n}\n\nfunction makeAs (alias) {\n    return function () {\n        return this.as(alias);\n    };\n}\n\nexport var asMilliseconds = makeAs('ms');\nexport var asSeconds      = makeAs('s');\nexport var asMinutes      = makeAs('m');\nexport var asHours        = makeAs('h');\nexport var asDays         = makeAs('d');\nexport var asWeeks        = makeAs('w');\nexport var asMonths       = makeAs('M');\nexport var asYears        = makeAs('y');\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/bubble.js",
    "content": "import absFloor from '../utils/abs-floor';\n\nexport function bubble () {\n    var milliseconds = this._milliseconds;\n    var days         = this._days;\n    var months       = this._months;\n    var data         = this._data;\n    var seconds, minutes, hours, years = 0;\n\n    // The following code bubbles up values, see the tests for\n    // examples of what that means.\n    data.milliseconds = milliseconds % 1000;\n\n    seconds           = absFloor(milliseconds / 1000);\n    data.seconds      = seconds % 60;\n\n    minutes           = absFloor(seconds / 60);\n    data.minutes      = minutes % 60;\n\n    hours             = absFloor(minutes / 60);\n    data.hours        = hours % 24;\n\n    days += absFloor(hours / 24);\n\n    // Accurately convert days to years, assume start from year 0.\n    years = absFloor(daysToYears(days));\n    days -= absFloor(yearsToDays(years));\n\n    // 30 days to a month\n    // TODO (iskren): Use anchor date (like 1st Jan) to compute this.\n    months += absFloor(days / 30);\n    days   %= 30;\n\n    // 12 months -> 1 year\n    years  += absFloor(months / 12);\n    months %= 12;\n\n    data.days   = days;\n    data.months = months;\n    data.years  = years;\n\n    return this;\n}\n\nexport function daysToYears (days) {\n    // 400 years have 146097 days (taking into account leap year rules)\n    return days * 400 / 146097;\n}\n\nexport function yearsToDays (years) {\n    // years * 365 + absFloor(years / 4) -\n    //     absFloor(years / 100) + absFloor(years / 400);\n    return years * 146097 / 400;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/constructor.js",
    "content": "import { normalizeObjectUnits } from '../units/aliases';\nimport { getLocale } from '../locale/locales';\n\nexport function Duration (duration) {\n    var normalizedInput = normalizeObjectUnits(duration),\n        years = normalizedInput.year || 0,\n        quarters = normalizedInput.quarter || 0,\n        months = normalizedInput.month || 0,\n        weeks = normalizedInput.week || 0,\n        days = normalizedInput.day || 0,\n        hours = normalizedInput.hour || 0,\n        minutes = normalizedInput.minute || 0,\n        seconds = normalizedInput.second || 0,\n        milliseconds = normalizedInput.millisecond || 0;\n\n    // representation for dateAddRemove\n    this._milliseconds = +milliseconds +\n        seconds * 1e3 + // 1000\n        minutes * 6e4 + // 1000 * 60\n        hours * 36e5; // 1000 * 60 * 60\n    // Because of dateAddRemove treats 24 hours as different from a\n    // day when working around DST, we need to store them separately\n    this._days = +days +\n        weeks * 7;\n    // It is impossible translate months into days without knowing\n    // which months you are are talking about, so we have to store\n    // it separately.\n    this._months = +months +\n        quarters * 3 +\n        years * 12;\n\n    this._data = {};\n\n    this._locale = getLocale();\n\n    this._bubble();\n}\n\nexport function isDuration (obj) {\n    return obj instanceof Duration;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/create.js",
    "content": "import { Duration, isDuration } from './constructor';\nimport toInt from '../utils/to-int';\nimport hasOwnProp from '../utils/has-own-prop';\nimport { DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants';\nimport { cloneWithOffset } from '../units/offset';\nimport { createLocal } from '../create/local';\n\n// ASP.NET json date format regex\nvar aspNetRegex = /(\\-)?(?:(\\d*)\\.)?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?)?/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\nvar isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;\n\nexport function createDuration (input, key) {\n    var duration = input,\n        // matching against regexp is expensive, do it on demand\n        match = null,\n        sign,\n        ret,\n        diffRes;\n\n    if (isDuration(input)) {\n        duration = {\n            ms : input._milliseconds,\n            d  : input._days,\n            M  : input._months\n        };\n    } else if (typeof input === 'number') {\n        duration = {};\n        if (key) {\n            duration[key] = input;\n        } else {\n            duration.milliseconds = input;\n        }\n    } else if (!!(match = aspNetRegex.exec(input))) {\n        sign = (match[1] === '-') ? -1 : 1;\n        duration = {\n            y  : 0,\n            d  : toInt(match[DATE])        * sign,\n            h  : toInt(match[HOUR])        * sign,\n            m  : toInt(match[MINUTE])      * sign,\n            s  : toInt(match[SECOND])      * sign,\n            ms : toInt(match[MILLISECOND]) * sign\n        };\n    } else if (!!(match = isoRegex.exec(input))) {\n        sign = (match[1] === '-') ? -1 : 1;\n        duration = {\n            y : parseIso(match[2], sign),\n            M : parseIso(match[3], sign),\n            d : parseIso(match[4], sign),\n            h : parseIso(match[5], sign),\n            m : parseIso(match[6], sign),\n            s : parseIso(match[7], sign),\n            w : parseIso(match[8], sign)\n        };\n    } else if (duration == null) {// checks for null or undefined\n        duration = {};\n    } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n        diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n        duration = {};\n        duration.ms = diffRes.milliseconds;\n        duration.M = diffRes.months;\n    }\n\n    ret = new Duration(duration);\n\n    if (isDuration(input) && hasOwnProp(input, '_locale')) {\n        ret._locale = input._locale;\n    }\n\n    return ret;\n}\n\ncreateDuration.fn = Duration.prototype;\n\nfunction parseIso (inp, sign) {\n    // We'd normally use ~~inp for this, but unfortunately it also\n    // converts floats to ints.\n    // inp may be undefined, so careful calling replace on it.\n    var res = inp && parseFloat(inp.replace(',', '.'));\n    // apply sign while we're at it\n    return (isNaN(res) ? 0 : res) * sign;\n}\n\nfunction positiveMomentsDifference(base, other) {\n    var res = {milliseconds: 0, months: 0};\n\n    res.months = other.month() - base.month() +\n        (other.year() - base.year()) * 12;\n    if (base.clone().add(res.months, 'M').isAfter(other)) {\n        --res.months;\n    }\n\n    res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n    return res;\n}\n\nfunction momentsDifference(base, other) {\n    var res;\n    other = cloneWithOffset(other, base);\n    if (base.isBefore(other)) {\n        res = positiveMomentsDifference(base, other);\n    } else {\n        res = positiveMomentsDifference(other, base);\n        res.milliseconds = -res.milliseconds;\n        res.months = -res.months;\n    }\n\n    return res;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/duration.js",
    "content": "// Side effect imports\nimport './prototype';\n\nimport { createDuration } from './create';\nimport { isDuration } from './constructor';\nimport { getSetRelativeTimeThreshold } from './humanize';\n\nexport {\n    createDuration,\n    isDuration,\n    getSetRelativeTimeThreshold\n};\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/get.js",
    "content": "import { normalizeUnits } from '../units/aliases';\nimport absFloor from '../utils/abs-floor';\n\nexport function get (units) {\n    units = normalizeUnits(units);\n    return this[units + 's']();\n}\n\nfunction makeGetter(name) {\n    return function () {\n        return this._data[name];\n    };\n}\n\nexport var milliseconds = makeGetter('milliseconds');\nexport var seconds      = makeGetter('seconds');\nexport var minutes      = makeGetter('minutes');\nexport var hours        = makeGetter('hours');\nexport var days         = makeGetter('days');\nexport var months       = makeGetter('months');\nexport var years        = makeGetter('years');\n\nexport function weeks () {\n    return absFloor(this.days() / 7);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/humanize.js",
    "content": "import { createDuration } from './create';\n\nvar round = Math.round;\nvar thresholds = {\n    s: 45,  // seconds to minute\n    m: 45,  // minutes to hour\n    h: 22,  // hours to day\n    d: 26,  // days to month\n    M: 11   // months to year\n};\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\nfunction substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n    return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n}\n\nfunction relativeTime (posNegDuration, withoutSuffix, locale) {\n    var duration = createDuration(posNegDuration).abs();\n    var seconds  = round(duration.as('s'));\n    var minutes  = round(duration.as('m'));\n    var hours    = round(duration.as('h'));\n    var days     = round(duration.as('d'));\n    var months   = round(duration.as('M'));\n    var years    = round(duration.as('y'));\n\n    var a = seconds < thresholds.s && ['s', seconds]  ||\n            minutes === 1          && ['m']           ||\n            minutes < thresholds.m && ['mm', minutes] ||\n            hours   === 1          && ['h']           ||\n            hours   < thresholds.h && ['hh', hours]   ||\n            days    === 1          && ['d']           ||\n            days    < thresholds.d && ['dd', days]    ||\n            months  === 1          && ['M']           ||\n            months  < thresholds.M && ['MM', months]  ||\n            years   === 1          && ['y']           || ['yy', years];\n\n    a[2] = withoutSuffix;\n    a[3] = +posNegDuration > 0;\n    a[4] = locale;\n    return substituteTimeAgo.apply(null, a);\n}\n\n// This function allows you to set a threshold for relative time strings\nexport function getSetRelativeTimeThreshold (threshold, limit) {\n    if (thresholds[threshold] === undefined) {\n        return false;\n    }\n    if (limit === undefined) {\n        return thresholds[threshold];\n    }\n    thresholds[threshold] = limit;\n    return true;\n}\n\nexport function humanize (withSuffix) {\n    var locale = this.localeData();\n    var output = relativeTime(this, !withSuffix, locale);\n\n    if (withSuffix) {\n        output = locale.pastFuture(+this, output);\n    }\n\n    return locale.postformat(output);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/iso-string.js",
    "content": "var abs = Math.abs;\n\nexport function toISOString() {\n    // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n    var Y = abs(this.years());\n    var M = abs(this.months());\n    var D = abs(this.days());\n    var h = abs(this.hours());\n    var m = abs(this.minutes());\n    var s = abs(this.seconds() + this.milliseconds() / 1000);\n    var total = this.asSeconds();\n\n    if (!total) {\n        // this is the same as C#'s (Noda) and python (isodate)...\n        // but not other JS (goog.date)\n        return 'P0D';\n    }\n\n    return (total < 0 ? '-' : '') +\n        'P' +\n        (Y ? Y + 'Y' : '') +\n        (M ? M + 'M' : '') +\n        (D ? D + 'D' : '') +\n        ((h || m || s) ? 'T' : '') +\n        (h ? h + 'H' : '') +\n        (m ? m + 'M' : '') +\n        (s ? s + 'S' : '');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/duration/prototype.js",
    "content": "import { Duration } from './constructor';\n\nvar proto = Duration.prototype;\n\nimport { abs } from './abs';\nimport { add, subtract } from './add-subtract';\nimport { as, asMilliseconds, asSeconds, asMinutes, asHours, asDays, asWeeks, asMonths, asYears, valueOf } from './as';\nimport { bubble } from './bubble';\nimport { get, milliseconds, seconds, minutes, hours, days, months, years, weeks } from './get';\nimport { humanize } from './humanize';\nimport { toISOString } from './iso-string';\nimport { lang, locale, localeData } from '../moment/locale';\n\nproto.abs            = abs;\nproto.add            = add;\nproto.subtract       = subtract;\nproto.as             = as;\nproto.asMilliseconds = asMilliseconds;\nproto.asSeconds      = asSeconds;\nproto.asMinutes      = asMinutes;\nproto.asHours        = asHours;\nproto.asDays         = asDays;\nproto.asWeeks        = asWeeks;\nproto.asMonths       = asMonths;\nproto.asYears        = asYears;\nproto.valueOf        = valueOf;\nproto._bubble        = bubble;\nproto.get            = get;\nproto.milliseconds   = milliseconds;\nproto.seconds        = seconds;\nproto.minutes        = minutes;\nproto.hours          = hours;\nproto.days           = days;\nproto.weeks          = weeks;\nproto.months         = months;\nproto.years          = years;\nproto.humanize       = humanize;\nproto.toISOString    = toISOString;\nproto.toString       = toISOString;\nproto.toJSON         = toISOString;\nproto.locale         = locale;\nproto.localeData     = localeData;\n\n// Deprecations\nimport { deprecate } from '../utils/deprecate';\n\nproto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString);\nproto.lang = lang;\n"
  },
  {
    "path": "www/lib/moment/src/lib/format/format.js",
    "content": "import zeroFill from '../utils/zero-fill';\n\nexport var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g;\n\nvar localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\nvar formatFunctions = {};\n\nexport var formatTokenFunctions = {};\n\n// token:    'M'\n// padded:   ['MM', 2]\n// ordinal:  'Mo'\n// callback: function () { this.month() + 1 }\nexport function addFormatToken (token, padded, ordinal, callback) {\n    var func = callback;\n    if (typeof callback === 'string') {\n        func = function () {\n            return this[callback]();\n        };\n    }\n    if (token) {\n        formatTokenFunctions[token] = func;\n    }\n    if (padded) {\n        formatTokenFunctions[padded[0]] = function () {\n            return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n        };\n    }\n    if (ordinal) {\n        formatTokenFunctions[ordinal] = function () {\n            return this.localeData().ordinal(func.apply(this, arguments), token);\n        };\n    }\n}\n\nfunction removeFormattingTokens(input) {\n    if (input.match(/\\[[\\s\\S]/)) {\n        return input.replace(/^\\[|\\]$/g, '');\n    }\n    return input.replace(/\\\\/g, '');\n}\n\nfunction makeFormatFunction(format) {\n    var array = format.match(formattingTokens), i, length;\n\n    for (i = 0, length = array.length; i < length; i++) {\n        if (formatTokenFunctions[array[i]]) {\n            array[i] = formatTokenFunctions[array[i]];\n        } else {\n            array[i] = removeFormattingTokens(array[i]);\n        }\n    }\n\n    return function (mom) {\n        var output = '';\n        for (i = 0; i < length; i++) {\n            output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n        }\n        return output;\n    };\n}\n\n// format date using native date object\nexport function formatMoment(m, format) {\n    if (!m.isValid()) {\n        return m.localeData().invalidDate();\n    }\n\n    format = expandFormat(format, m.localeData());\n\n    if (!formatFunctions[format]) {\n        formatFunctions[format] = makeFormatFunction(format);\n    }\n\n    return formatFunctions[format](m);\n}\n\nexport function expandFormat(format, locale) {\n    var i = 5;\n\n    function replaceLongDateFormatTokens(input) {\n        return locale.longDateFormat(input) || input;\n    }\n\n    localFormattingTokens.lastIndex = 0;\n    while (i >= 0 && localFormattingTokens.test(format)) {\n        format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n        localFormattingTokens.lastIndex = 0;\n        i -= 1;\n    }\n\n    return format;\n}\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/calendar.js",
    "content": "export var defaultCalendar = {\n    sameDay : '[Today at] LT',\n    nextDay : '[Tomorrow at] LT',\n    nextWeek : 'dddd [at] LT',\n    lastDay : '[Yesterday at] LT',\n    lastWeek : '[Last] dddd [at] LT',\n    sameElse : 'L'\n};\n\nexport function calendar (key, mom, now) {\n    var output = this._calendar[key];\n    return typeof output === 'function' ? output.call(mom, now) : output;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/constructor.js",
    "content": "export function Locale() {\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/en.js",
    "content": "import './prototype';\nimport { getSetGlobalLocale } from './locales';\nimport toInt from '../utils/to-int';\n\ngetSetGlobalLocale('en', {\n    ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n    ordinal : function (number) {\n        var b = number % 10,\n            output = (toInt(number % 100 / 10) === 1) ? 'th' :\n            (b === 1) ? 'st' :\n            (b === 2) ? 'nd' :\n            (b === 3) ? 'rd' : 'th';\n        return number + output;\n    }\n});\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/formats.js",
    "content": "export var defaultLongDateFormat = {\n    LTS  : 'h:mm:ss A',\n    LT   : 'h:mm A',\n    L    : 'MM/DD/YYYY',\n    LL   : 'MMMM D, YYYY',\n    LLL  : 'MMMM D, YYYY LT',\n    LLLL : 'dddd, MMMM D, YYYY LT'\n};\n\nexport function longDateFormat (key) {\n    var output = this._longDateFormat[key];\n    if (!output && this._longDateFormat[key.toUpperCase()]) {\n        output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) {\n            return val.slice(1);\n        });\n        this._longDateFormat[key] = output;\n    }\n    return output;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/invalid.js",
    "content": "export var defaultInvalidDate = 'Invalid date';\n\nexport function invalidDate () {\n    return this._invalidDate;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/lists.js",
    "content": "import { getLocale } from './locales';\nimport { createUTC } from '../create/utc';\n\nfunction get (format, index, field, setter) {\n    var locale = getLocale();\n    var utc = createUTC().set(setter, index);\n    return locale[field](utc, format);\n}\n\nfunction list (format, index, field, count, setter) {\n    if (typeof format === 'number') {\n        index = format;\n        format = undefined;\n    }\n\n    format = format || '';\n\n    if (index != null) {\n        return get(format, index, field, setter);\n    }\n\n    var i;\n    var out = [];\n    for (i = 0; i < count; i++) {\n        out[i] = get(format, i, field, setter);\n    }\n    return out;\n}\n\nexport function listMonths (format, index) {\n    return list(format, index, 'months', 12, 'month');\n}\n\nexport function listMonthsShort (format, index) {\n    return list(format, index, 'monthsShort', 12, 'month');\n}\n\nexport function listWeekdays (format, index) {\n    return list(format, index, 'weekdays', 7, 'day');\n}\n\nexport function listWeekdaysShort (format, index) {\n    return list(format, index, 'weekdaysShort', 7, 'day');\n}\n\nexport function listWeekdaysMin (format, index) {\n    return list(format, index, 'weekdaysMin', 7, 'day');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/locale.js",
    "content": "// Side effect imports\nimport './prototype';\n\nimport {\n    getSetGlobalLocale,\n    defineLocale,\n    getLocale\n} from './locales';\n\nimport {\n    listMonths,\n    listMonthsShort,\n    listWeekdays,\n    listWeekdaysShort,\n    listWeekdaysMin\n} from './lists';\n\nexport {\n    getSetGlobalLocale,\n    defineLocale,\n    getLocale,\n    listMonths,\n    listMonthsShort,\n    listWeekdays,\n    listWeekdaysShort,\n    listWeekdaysMin\n};\n\nimport { deprecate } from '../utils/deprecate';\nimport { hooks } from '../utils/hooks';\n\nhooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\nhooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\nimport './en';\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/locales.js",
    "content": "import isArray from '../utils/is-array';\nimport compareArrays from '../utils/compare-arrays';\nimport { Locale } from './constructor';\n\n// internal storage for locale config files\nvar locales = {};\nvar globalLocale;\n\nfunction normalizeLocale(key) {\n    return key ? key.toLowerCase().replace('_', '-') : key;\n}\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\nfunction chooseLocale(names) {\n    var i = 0, j, next, locale, split;\n\n    while (i < names.length) {\n        split = normalizeLocale(names[i]).split('-');\n        j = split.length;\n        next = normalizeLocale(names[i + 1]);\n        next = next ? next.split('-') : null;\n        while (j > 0) {\n            locale = loadLocale(split.slice(0, j).join('-'));\n            if (locale) {\n                return locale;\n            }\n            if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n                //the next array item is better than a shallower substring of this one\n                break;\n            }\n            j--;\n        }\n        i++;\n    }\n    return null;\n}\n\nfunction loadLocale(name) {\n    var oldLocale = null;\n    // TODO: Find a better way to register and load all the locales in Node\n    if (!locales[name] && typeof module !== 'undefined' &&\n            module && module.exports) {\n        try {\n            oldLocale = globalLocale._abbr;\n            require('./locale/' + name);\n            // because defineLocale currently also sets the global locale, we\n            // want to undo that for lazy loaded locales\n            getSetGlobalLocale(oldLocale);\n        } catch (e) { }\n    }\n    return locales[name];\n}\n\n// This function will load locale and then set the global locale.  If\n// no arguments are passed in, it will simply return the current global\n// locale key.\nexport function getSetGlobalLocale (key, values) {\n    var data;\n    if (key) {\n        if (typeof values === 'undefined') {\n            data = getLocale(key);\n        }\n        else {\n            data = defineLocale(key, values);\n        }\n\n        if (data) {\n            // moment.duration._locale = moment._locale = data;\n            globalLocale = data;\n        }\n    }\n\n    return globalLocale._abbr;\n}\n\nexport function defineLocale (name, values) {\n    if (values !== null) {\n        values.abbr = name;\n        if (!locales[name]) {\n            locales[name] = new Locale();\n        }\n        locales[name].set(values);\n\n        // backwards compat for now: also set the locale\n        getSetGlobalLocale(name);\n\n        return locales[name];\n    } else {\n        // useful for testing\n        delete locales[name];\n        return null;\n    }\n}\n\n// returns locale data\nexport function getLocale (key) {\n    var locale;\n\n    if (key && key._locale && key._locale._abbr) {\n        key = key._locale._abbr;\n    }\n\n    if (!key) {\n        return globalLocale;\n    }\n\n    if (!isArray(key)) {\n        //short-circuit everything else\n        locale = loadLocale(key);\n        if (locale) {\n            return locale;\n        }\n        key = [key];\n    }\n\n    return chooseLocale(key);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/ordinal.js",
    "content": "export var defaultOrdinal = '%d';\nexport var defaultOrdinalParse = /\\d{1,2}/;\n\nexport function ordinal (number) {\n    return this._ordinal.replace('%d', number);\n}\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/pre-post-format.js",
    "content": "export function preParsePostFormat (string) {\n    return string;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/prototype.js",
    "content": "import { Locale } from './constructor';\n\nvar proto = Locale.prototype;\n\nimport { defaultCalendar, calendar } from './calendar';\nimport { defaultLongDateFormat, longDateFormat } from './formats';\nimport { defaultInvalidDate, invalidDate } from './invalid';\nimport { defaultOrdinal, ordinal, defaultOrdinalParse } from './ordinal';\nimport { preParsePostFormat } from './pre-post-format';\nimport { defaultRelativeTime, relativeTime, pastFuture } from './relative';\nimport { set } from './set';\n\nproto._calendar       = defaultCalendar;\nproto.calendar        = calendar;\nproto._longDateFormat = defaultLongDateFormat;\nproto.longDateFormat  = longDateFormat;\nproto._invalidDate    = defaultInvalidDate;\nproto.invalidDate     = invalidDate;\nproto._ordinal        = defaultOrdinal;\nproto.ordinal         = ordinal;\nproto._ordinalParse   = defaultOrdinalParse;\nproto.preparse        = preParsePostFormat;\nproto.postformat      = preParsePostFormat;\nproto._relativeTime   = defaultRelativeTime;\nproto.relativeTime    = relativeTime;\nproto.pastFuture      = pastFuture;\nproto.set             = set;\n\n// Month\nimport {\n    localeMonthsParse,\n    defaultLocaleMonths,      localeMonths,\n    defaultLocaleMonthsShort, localeMonthsShort\n} from '../units/month';\n\nproto.months       =        localeMonths;\nproto._months      = defaultLocaleMonths;\nproto.monthsShort  =        localeMonthsShort;\nproto._monthsShort = defaultLocaleMonthsShort;\nproto.monthsParse  =        localeMonthsParse;\n\n// Week\nimport { localeWeek, defaultLocaleWeek, localeFirstDayOfYear, localeFirstDayOfWeek } from '../units/week';\nproto.week = localeWeek;\nproto._week = defaultLocaleWeek;\nproto.firstDayOfYear = localeFirstDayOfYear;\nproto.firstDayOfWeek = localeFirstDayOfWeek;\n\n// Day of Week\nimport {\n    localeWeekdaysParse,\n    defaultLocaleWeekdays,      localeWeekdays,\n    defaultLocaleWeekdaysMin,   localeWeekdaysMin,\n    defaultLocaleWeekdaysShort, localeWeekdaysShort\n} from '../units/day-of-week';\n\nproto.weekdays       =        localeWeekdays;\nproto._weekdays      = defaultLocaleWeekdays;\nproto.weekdaysMin    =        localeWeekdaysMin;\nproto._weekdaysMin   = defaultLocaleWeekdaysMin;\nproto.weekdaysShort  =        localeWeekdaysShort;\nproto._weekdaysShort = defaultLocaleWeekdaysShort;\nproto.weekdaysParse  =        localeWeekdaysParse;\n\n// Hours\nimport { localeIsPM, defaultLocaleMeridiemParse, localeMeridiem } from '../units/hour';\n\nproto.isPM = localeIsPM;\nproto._meridiemParse = defaultLocaleMeridiemParse;\nproto.meridiem = localeMeridiem;\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/relative.js",
    "content": "export var defaultRelativeTime = {\n    future : 'in %s',\n    past   : '%s ago',\n    s  : 'a few seconds',\n    m  : 'a minute',\n    mm : '%d minutes',\n    h  : 'an hour',\n    hh : '%d hours',\n    d  : 'a day',\n    dd : '%d days',\n    M  : 'a month',\n    MM : '%d months',\n    y  : 'a year',\n    yy : '%d years'\n};\n\nexport function relativeTime (number, withoutSuffix, string, isFuture) {\n    var output = this._relativeTime[string];\n    return (typeof output === 'function') ?\n        output(number, withoutSuffix, string, isFuture) :\n        output.replace(/%d/i, number);\n}\n\nexport function pastFuture (diff, output) {\n    var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n    return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/locale/set.js",
    "content": "export function set (config) {\n    var prop, i;\n    for (i in config) {\n        prop = config[i];\n        if (typeof prop === 'function') {\n            this[i] = prop;\n        } else {\n            this['_' + i] = prop;\n        }\n    }\n    // Lenient ordinal parsing accepts just a number in addition to\n    // number + (possibly) stuff coming from _ordinalParseLenient.\n    this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + /\\d{1,2}/.source);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/add-subtract.js",
    "content": "import { get, set } from './get-set';\nimport { setMonth } from '../units/month';\nimport { createDuration } from '../duration/create';\nimport { deprecateSimple } from '../utils/deprecate';\nimport { hooks } from '../utils/hooks';\n\n// TODO: remove 'name' arg after deprecation is removed\nfunction createAdder(direction, name) {\n    return function (val, period) {\n        var dur, tmp;\n        //invert the arguments, but complain about it\n        if (period !== null && !isNaN(+period)) {\n            deprecateSimple(name, 'moment().' + name  + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n            tmp = val; val = period; period = tmp;\n        }\n\n        val = typeof val === 'string' ? +val : val;\n        dur = createDuration(val, period);\n        addSubtract(this, dur, direction);\n        return this;\n    };\n}\n\nexport function addSubtract (mom, duration, isAdding, updateOffset) {\n    var milliseconds = duration._milliseconds,\n        days = duration._days,\n        months = duration._months;\n    updateOffset = updateOffset == null ? true : updateOffset;\n\n    if (milliseconds) {\n        mom._d.setTime(+mom._d + milliseconds * isAdding);\n    }\n    if (days) {\n        set(mom, 'Date', get(mom, 'Date') + days * isAdding);\n    }\n    if (months) {\n        setMonth(mom, get(mom, 'Month') + months * isAdding);\n    }\n    if (updateOffset) {\n        hooks.updateOffset(mom, days || months);\n    }\n}\n\nexport var add      = createAdder(1, 'add');\nexport var subtract = createAdder(-1, 'subtract');\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/calendar.js",
    "content": "import { createLocal } from '../create/local';\nimport { cloneWithOffset } from '../units/offset';\n\nexport function calendar (time) {\n    // We want to compare the start of today, vs this.\n    // Getting start-of-today depends on whether we're local/utc/offset or not.\n    var now = time || createLocal(),\n        sod = cloneWithOffset(now, this).startOf('day'),\n        diff = this.diff(sod, 'days', true),\n        format = diff < -6 ? 'sameElse' :\n            diff < -1 ? 'lastWeek' :\n            diff < 0 ? 'lastDay' :\n            diff < 1 ? 'sameDay' :\n            diff < 2 ? 'nextDay' :\n            diff < 7 ? 'nextWeek' : 'sameElse';\n    return this.format(this.localeData().calendar(format, this, createLocal(now)));\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/clone.js",
    "content": "import { Moment } from './constructor';\n\nexport function clone () {\n    return new Moment(this);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/compare.js",
    "content": "import { isMoment } from './constructor';\nimport { normalizeUnits } from '../units/aliases';\nimport { createLocal } from '../create/local';\n\nexport function isAfter (input, units) {\n    var inputMs;\n    units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n    if (units === 'millisecond') {\n        input = isMoment(input) ? input : createLocal(input);\n        return +this > +input;\n    } else {\n        inputMs = isMoment(input) ? +input : +createLocal(input);\n        return inputMs < +this.clone().startOf(units);\n    }\n}\n\nexport function isBefore (input, units) {\n    var inputMs;\n    units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n    if (units === 'millisecond') {\n        input = isMoment(input) ? input : createLocal(input);\n        return +this < +input;\n    } else {\n        inputMs = isMoment(input) ? +input : +createLocal(input);\n        return +this.clone().endOf(units) < inputMs;\n    }\n}\n\nexport function isBetween (from, to, units) {\n    return this.isAfter(from, units) && this.isBefore(to, units);\n}\n\nexport function isSame (input, units) {\n    var inputMs;\n    units = normalizeUnits(units || 'millisecond');\n    if (units === 'millisecond') {\n        input = isMoment(input) ? input : createLocal(input);\n        return +this === +input;\n    } else {\n        inputMs = +createLocal(input);\n        return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));\n    }\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/constructor.js",
    "content": "import { hooks } from '../utils/hooks';\nimport hasOwnProp from '../utils/has-own-prop';\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\nvar momentProperties = hooks.momentProperties = [];\n\nexport function copyConfig(to, from) {\n    var i, prop, val;\n\n    if (typeof from._isAMomentObject !== 'undefined') {\n        to._isAMomentObject = from._isAMomentObject;\n    }\n    if (typeof from._i !== 'undefined') {\n        to._i = from._i;\n    }\n    if (typeof from._f !== 'undefined') {\n        to._f = from._f;\n    }\n    if (typeof from._l !== 'undefined') {\n        to._l = from._l;\n    }\n    if (typeof from._strict !== 'undefined') {\n        to._strict = from._strict;\n    }\n    if (typeof from._tzm !== 'undefined') {\n        to._tzm = from._tzm;\n    }\n    if (typeof from._isUTC !== 'undefined') {\n        to._isUTC = from._isUTC;\n    }\n    if (typeof from._offset !== 'undefined') {\n        to._offset = from._offset;\n    }\n    if (typeof from._pf !== 'undefined') {\n        to._pf = from._pf;\n    }\n    if (typeof from._locale !== 'undefined') {\n        to._locale = from._locale;\n    }\n\n    if (momentProperties.length > 0) {\n        for (i in momentProperties) {\n            prop = momentProperties[i];\n            val = from[prop];\n            if (typeof val !== 'undefined') {\n                to[prop] = val;\n            }\n        }\n    }\n\n    return to;\n}\n\nvar updateInProgress = false;\n\n// Moment prototype object\nexport function Moment(config) {\n    copyConfig(this, config);\n    this._d = new Date(+config._d);\n    // Prevent infinite loop in case updateOffset creates new moment\n    // objects.\n    if (updateInProgress === false) {\n        updateInProgress = true;\n        hooks.updateOffset(this);\n        updateInProgress = false;\n    }\n}\n\nexport function isMoment (obj) {\n    return obj instanceof Moment || (obj != null && hasOwnProp(obj, '_isAMomentObject'));\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/diff.js",
    "content": "import absFloor from '../utils/abs-floor';\nimport { cloneWithOffset } from '../units/offset';\nimport { normalizeUnits } from '../units/aliases';\n\nexport function diff (input, units, asFloat) {\n    var that = cloneWithOffset(input, this),\n        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,\n        delta, output;\n\n    units = normalizeUnits(units);\n\n    if (units === 'year' || units === 'month' || units === 'quarter') {\n        output = monthDiff(this, that);\n        if (units === 'quarter') {\n            output = output / 3;\n        } else if (units === 'year') {\n            output = output / 12;\n        }\n    } else {\n        delta = this - that;\n        output = units === 'second' ? delta / 1e3 : // 1000\n            units === 'minute' ? delta / 6e4 : // 1000 * 60\n            units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n            units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n            units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n            delta;\n    }\n    return asFloat ? output : absFloor(output);\n}\n\nfunction monthDiff (a, b) {\n    // difference in months\n    var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n        // b is in (anchor - 1 month, anchor + 1 month)\n        anchor = a.clone().add(wholeMonthDiff, 'months'),\n        anchor2, adjust;\n\n    if (b - anchor < 0) {\n        anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n        // linear across the month\n        adjust = (b - anchor) / (anchor - anchor2);\n    } else {\n        anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n        // linear across the month\n        adjust = (b - anchor) / (anchor2 - anchor);\n    }\n\n    return -(wholeMonthDiff + adjust);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/format.js",
    "content": "import { formatMoment } from '../format/format';\nimport { hooks } from '../utils/hooks';\n\nhooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n\nexport function toString () {\n    return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n}\n\nexport function toISOString () {\n    var m = this.clone().utc();\n    if (0 < m.year() && m.year() <= 9999) {\n        if ('function' === typeof Date.prototype.toISOString) {\n            // native implementation is ~50x faster, use it when we can\n            return this.toDate().toISOString();\n        } else {\n            return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n        }\n    } else {\n        return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n    }\n}\n\nexport function format (inputString) {\n    var output = formatMoment(this, inputString || hooks.defaultFormat);\n    return this.localeData().postformat(output);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/from.js",
    "content": "import { createDuration } from '../duration/create';\nimport { createLocal } from '../create/local';\n\nexport function from (time, withoutSuffix) {\n    return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n}\n\nexport function fromNow (withoutSuffix) {\n    return this.from(createLocal(), withoutSuffix);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/get-set.js",
    "content": "import { normalizeUnits } from '../units/aliases';\nimport { hooks } from '../utils/hooks';\n\nexport function makeGetSet (unit, keepTime) {\n    return function (value) {\n        if (value != null) {\n            set(this, unit, value);\n            hooks.updateOffset(this, keepTime);\n            return this;\n        } else {\n            return get(this, unit);\n        }\n    };\n}\n\nexport function get (mom, unit) {\n    return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();\n}\n\nexport function set (mom, unit, value) {\n    return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n}\n\n// MOMENTS\n\nexport function getSet (units, value) {\n    var unit;\n    if (typeof units === 'object') {\n        for (unit in units) {\n            this.set(unit, units[unit]);\n        }\n    } else {\n        units = normalizeUnits(units);\n        if (typeof this[units] === 'function') {\n            return this[units](value);\n        }\n    }\n    return this;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/locale.js",
    "content": "import { getLocale } from '../locale/locales';\nimport { deprecate } from '../utils/deprecate';\n\n// If passed a locale key, it will set the locale for this\n// instance.  Otherwise, it will return the locale configuration\n// variables for this instance.\nexport function locale (key) {\n    var newLocaleData;\n\n    if (key === undefined) {\n        return this._locale._abbr;\n    } else {\n        newLocaleData = getLocale(key);\n        if (newLocaleData != null) {\n            this._locale = newLocaleData;\n        }\n        return this;\n    }\n}\n\nexport var lang = deprecate(\n    'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n    function (key) {\n        if (key === undefined) {\n            return this.localeData();\n        } else {\n            return this.locale(key);\n        }\n    }\n);\n\nexport function localeData () {\n    return this._locale;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/min-max.js",
    "content": "import { deprecate } from '../utils/deprecate';\nimport isArray from '../utils/is-array';\nimport { createLocal } from '../create/local';\n\nexport var prototypeMin = deprecate(\n     'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',\n     function () {\n         var other = createLocal.apply(null, arguments);\n         return other < this ? this : other;\n     }\n );\n\nexport var prototypeMax = deprecate(\n    'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',\n    function () {\n        var other = createLocal.apply(null, arguments);\n        return other > this ? this : other;\n    }\n);\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\nfunction pickBy(fn, moments) {\n    var res, i;\n    if (moments.length === 1 && isArray(moments[0])) {\n        moments = moments[0];\n    }\n    if (!moments.length) {\n        return createLocal();\n    }\n    res = moments[0];\n    for (i = 1; i < moments.length; ++i) {\n        if (moments[i][fn](res)) {\n            res = moments[i];\n        }\n    }\n    return res;\n}\n\n// TODO: Use [].sort instead?\nexport function min () {\n    var args = [].slice.call(arguments, 0);\n\n    return pickBy('isBefore', args);\n}\n\nexport function max () {\n    var args = [].slice.call(arguments, 0);\n\n    return pickBy('isAfter', args);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/moment.js",
    "content": "import { createLocal } from '../create/local';\nimport { createUTC } from '../create/utc';\nimport { createInvalid } from '../create/valid';\nimport { isMoment } from './constructor';\nimport { min, max } from './min-max';\nimport momentPrototype from './prototype';\n\nfunction createUnix (input) {\n    return createLocal(input * 1000);\n}\n\nfunction createInZone () {\n    return createLocal.apply(null, arguments).parseZone();\n}\n\nexport {\n    min,\n    max,\n    isMoment,\n    createUTC,\n    createUnix,\n    createLocal,\n    createInZone,\n    createInvalid,\n    momentPrototype\n};\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/prototype.js",
    "content": "import { Moment } from './constructor';\n\nvar proto = Moment.prototype;\n\nimport { add, subtract } from './add-subtract';\nimport { calendar } from './calendar';\nimport { clone } from './clone';\nimport { isBefore, isBetween, isSame, isAfter } from './compare';\nimport { diff } from './diff';\nimport { format, toString, toISOString } from './format';\nimport { from, fromNow } from './from';\nimport { getSet } from './get-set';\nimport { locale, localeData, lang } from './locale';\nimport { prototypeMin, prototypeMax } from './min-max';\nimport { startOf, endOf } from './start-end-of';\nimport { valueOf, toDate, toArray, unix } from './to-type';\nimport { isValid, parsingFlags, invalidAt } from './valid';\n\nproto.add          = add;\nproto.calendar     = calendar;\nproto.clone        = clone;\nproto.diff         = diff;\nproto.endOf        = endOf;\nproto.format       = format;\nproto.from         = from;\nproto.fromNow      = fromNow;\nproto.get          = getSet;\nproto.invalidAt    = invalidAt;\nproto.isAfter      = isAfter;\nproto.isBefore     = isBefore;\nproto.isBetween    = isBetween;\nproto.isSame       = isSame;\nproto.isValid      = isValid;\nproto.lang         = lang;\nproto.locale       = locale;\nproto.localeData   = localeData;\nproto.max          = prototypeMax;\nproto.min          = prototypeMin;\nproto.parsingFlags = parsingFlags;\nproto.set          = getSet;\nproto.startOf      = startOf;\nproto.subtract     = subtract;\nproto.toArray      = toArray;\nproto.toDate       = toDate;\nproto.toISOString  = toISOString;\nproto.toJSON       = toISOString;\nproto.toString     = toString;\nproto.unix         = unix;\nproto.valueOf      = valueOf;\n\n// Year\nimport { getSetYear, getIsLeapYear } from '../units/year';\nproto.year       = getSetYear;\nproto.isLeapYear = getIsLeapYear;\n\n// Week Year\nimport { getSetWeekYear, getSetISOWeekYear, getWeeksInYear, getISOWeeksInYear } from '../units/week-year';\nproto.weekYear    = getSetWeekYear;\nproto.isoWeekYear = getSetISOWeekYear;\n\n// Quarter\nimport { getSetQuarter } from '../units/quarter';\nproto.quarter = proto.quarters = getSetQuarter;\n\n// Month\nimport { getSetMonth, getDaysInMonth } from '../units/month';\nproto.month       = getSetMonth;\nproto.daysInMonth = getDaysInMonth;\n\n// Week\nimport { getSetWeek, getSetISOWeek } from '../units/week';\nproto.week           = proto.weeks        = getSetWeek;\nproto.isoWeek        = proto.isoWeeks     = getSetISOWeek;\nproto.weeksInYear    = getWeeksInYear;\nproto.isoWeeksInYear = getISOWeeksInYear;\n\n// Day\nimport { getSetDayOfMonth } from '../units/day-of-month';\nimport { getSetDayOfWeek, getSetISODayOfWeek, getSetLocaleDayOfWeek } from '../units/day-of-week';\nimport { getSetDayOfYear } from '../units/day-of-year';\nproto.date       = getSetDayOfMonth;\nproto.day        = proto.days             = getSetDayOfWeek;\nproto.weekday    = getSetLocaleDayOfWeek;\nproto.isoWeekday = getSetISODayOfWeek;\nproto.dayOfYear  = getSetDayOfYear;\n\n// Hour\nimport { getSetHour } from '../units/hour';\nproto.hour = proto.hours = getSetHour;\n\n// Minute\nimport { getSetMinute } from '../units/minute';\nproto.minute = proto.minutes = getSetMinute;\n\n// Second\nimport { getSetSecond } from '../units/second';\nproto.second = proto.seconds = getSetSecond;\n\n// Millisecond\nimport { getSetMillisecond } from '../units/millisecond';\nproto.millisecond = proto.milliseconds = getSetMillisecond;\n\n// Offset\nimport {\n    getSetOffset,\n    setOffsetToUTC,\n    setOffsetToLocal,\n    setOffsetToParsedOffset,\n    hasAlignedHourOffset,\n    isDaylightSavingTime,\n    isDaylightSavingTimeShifted,\n    getSetZone,\n    isLocal,\n    isUtcOffset,\n    isUtc\n} from '../units/offset';\nproto.utcOffset            = getSetOffset;\nproto.utc                  = setOffsetToUTC;\nproto.local                = setOffsetToLocal;\nproto.parseZone            = setOffsetToParsedOffset;\nproto.hasAlignedHourOffset = hasAlignedHourOffset;\nproto.isDST                = isDaylightSavingTime;\nproto.isDSTShifted         = isDaylightSavingTimeShifted;\nproto.isLocal              = isLocal;\nproto.isUtcOffset          = isUtcOffset;\nproto.isUtc                = isUtc;\nproto.isUTC                = isUtc;\n\n// Timezone\nimport { getZoneAbbr, getZoneName } from '../units/timezone';\nproto.zoneAbbr = getZoneAbbr;\nproto.zoneName = getZoneName;\n\n// Deprecations\nimport { deprecate } from '../utils/deprecate';\nproto.dates  = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\nproto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\nproto.years  = deprecate('years accessor is deprecated. Use year instead', getSetYear);\nproto.zone   = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);\n\nexport default proto;\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/start-end-of.js",
    "content": "import { normalizeUnits } from '../units/aliases';\n\nexport function startOf (units) {\n    units = normalizeUnits(units);\n    // the following switch intentionally omits break keywords\n    // to utilize falling through the cases.\n    switch (units) {\n    case 'year':\n        this.month(0);\n        /* falls through */\n    case 'quarter':\n    case 'month':\n        this.date(1);\n        /* falls through */\n    case 'week':\n    case 'isoWeek':\n    case 'day':\n        this.hours(0);\n        /* falls through */\n    case 'hour':\n        this.minutes(0);\n        /* falls through */\n    case 'minute':\n        this.seconds(0);\n        /* falls through */\n    case 'second':\n        this.milliseconds(0);\n    }\n\n    // weeks are a special case\n    if (units === 'week') {\n        this.weekday(0);\n    }\n    if (units === 'isoWeek') {\n        this.isoWeekday(1);\n    }\n\n    // quarters are also special\n    if (units === 'quarter') {\n        this.month(Math.floor(this.month() / 3) * 3);\n    }\n\n    return this;\n}\n\nexport function endOf (units) {\n    units = normalizeUnits(units);\n    if (units === undefined || units === 'millisecond') {\n        return this;\n    }\n    return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/to-type.js",
    "content": "export function valueOf () {\n    return +this._d - ((this._offset || 0) * 60000);\n}\n\nexport function unix () {\n    return Math.floor(+this / 1000);\n}\n\nexport function toDate () {\n    return this._offset ? new Date(+this) : this._d;\n}\n\nexport function toArray () {\n    var m = this;\n    return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/moment/valid.js",
    "content": "import { isValid as _isValid } from '../create/valid';\nimport extend from '../utils/extend';\n\nexport function isValid () {\n    return _isValid(this);\n}\n\nexport function parsingFlags () {\n    return extend({}, this._pf);\n}\n\nexport function invalidAt () {\n    return this._pf.overflow;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/parse/regex.js",
    "content": "export var match1         = /\\d/;            //       0 - 9\nexport var match2         = /\\d\\d/;          //      00 - 99\nexport var match3         = /\\d{3}/;         //     000 - 999\nexport var match4         = /\\d{4}/;         //    0000 - 9999\nexport var match6         = /[+-]?\\d{6}/;    // -999999 - 999999\nexport var match1to2      = /\\d\\d?/;         //       0 - 99\nexport var match1to3      = /\\d{1,3}/;       //       0 - 999\nexport var match1to4      = /\\d{1,4}/;       //       0 - 9999\nexport var match1to6      = /[+-]?\\d{1,6}/;  // -999999 - 999999\n\nexport var matchUnsigned  = /\\d+/;           //       0 - inf\nexport var matchSigned    = /[+-]?\\d+/;      //    -inf - inf\n\nexport var matchOffset    = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\nexport var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\nexport var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\nimport hasOwnProp from '../utils/has-own-prop';\n\nvar regexes = {};\n\nexport function addRegexToken (token, regex, strictRegex) {\n    regexes[token] = typeof regex === 'function' ? regex : function (isStrict) {\n        return (isStrict && strictRegex) ? strictRegex : regex;\n    };\n}\n\nexport function getParseRegexForToken (token, config) {\n    if (!hasOwnProp(regexes, token)) {\n        return new RegExp(unescapeFormat(token));\n    }\n\n    return regexes[token](config._strict, config._locale);\n}\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\nfunction unescapeFormat(s) {\n    return s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n        return p1 || p2 || p3 || p4;\n    }).replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/parse/token.js",
    "content": "import hasOwnProp from '../utils/has-own-prop';\nimport toInt from '../utils/to-int';\n\nvar tokens = {};\n\nexport function addParseToken (token, callback) {\n    var i, func = callback;\n    if (typeof token === 'string') {\n        token = [token];\n    }\n    if (typeof callback === 'number') {\n        func = function (input, array) {\n            array[callback] = toInt(input);\n        };\n    }\n    for (i = 0; i < token.length; i++) {\n        tokens[token[i]] = func;\n    }\n}\n\nexport function addWeekParseToken (token, callback) {\n    addParseToken(token, function (input, array, config, token) {\n        config._w = config._w || {};\n        callback(input, config._w, config, token);\n    });\n}\n\nexport function addTimeToArrayFromToken(token, input, config) {\n    if (input != null && hasOwnProp(tokens, token)) {\n        tokens[token](input, config._a, config, token);\n    }\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/aliases.js",
    "content": "import hasOwnProp from '../utils/has-own-prop';\n\nvar aliases = {};\n\nexport function addUnitAlias (unit, shorthand) {\n    var lowerCase = unit.toLowerCase();\n    aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n}\n\nexport function normalizeUnits(units) {\n    return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n}\n\nexport function normalizeObjectUnits(inputObject) {\n    var normalizedInput = {},\n        normalizedProp,\n        prop;\n\n    for (prop in inputObject) {\n        if (hasOwnProp(inputObject, prop)) {\n            normalizedProp = normalizeUnits(prop);\n            if (normalizedProp) {\n                normalizedInput[normalizedProp] = inputObject[prop];\n            }\n        }\n    }\n\n    return normalizedInput;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/constants.js",
    "content": "export var YEAR = 0;\nexport var MONTH = 1;\nexport var DATE = 2;\nexport var HOUR = 3;\nexport var MINUTE = 4;\nexport var SECOND = 5;\nexport var MILLISECOND = 6;\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/day-of-month.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { DATE } from './constants';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// ALIASES\n\naddUnitAlias('date', 'D');\n\n// PARSING\n\naddRegexToken('D',  match1to2);\naddRegexToken('DD', match1to2, match2);\naddRegexToken('Do', function (isStrict, locale) {\n    return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n});\n\naddParseToken(['D', 'DD'], DATE);\naddParseToken('Do', function (input, array) {\n    array[DATE] = toInt(input.match(match1to2)[0], 10);\n});\n\n// MOMENTS\n\nexport var getSetDayOfMonth = makeGetSet('Date', true);\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/day-of-week.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, matchWord } from '../parse/regex';\nimport { addWeekParseToken } from '../parse/token';\nimport toInt from '../utils/to-int';\nimport { createLocal } from '../create/local';\n\n// FORMATTING\n\naddFormatToken('d', 0, 'do', 'day');\n\naddFormatToken('dd', 0, 0, function (format) {\n    return this.localeData().weekdaysMin(this, format);\n});\n\naddFormatToken('ddd', 0, 0, function (format) {\n    return this.localeData().weekdaysShort(this, format);\n});\n\naddFormatToken('dddd', 0, 0, function (format) {\n    return this.localeData().weekdays(this, format);\n});\n\naddFormatToken('e', 0, 0, 'weekday');\naddFormatToken('E', 0, 0, 'isoWeekday');\n\n// ALIASES\n\naddUnitAlias('day', 'd');\naddUnitAlias('weekday', 'e');\naddUnitAlias('isoWeekday', 'E');\n\n// PARSING\n\naddRegexToken('d',    match1to2);\naddRegexToken('e',    match1to2);\naddRegexToken('E',    match1to2);\naddRegexToken('dd',   matchWord);\naddRegexToken('ddd',  matchWord);\naddRegexToken('dddd', matchWord);\n\naddWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {\n    var weekday = config._locale.weekdaysParse(input);\n    // if we didn't get a weekday name, mark the date as invalid\n    if (weekday != null) {\n        week.d = weekday;\n    } else {\n        config._pf.invalidWeekday = input;\n    }\n});\n\naddWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n    week[token] = toInt(input);\n});\n\n// HELPERS\n\nfunction parseWeekday(input, locale) {\n    if (typeof input === 'string') {\n        if (!isNaN(input)) {\n            input = parseInt(input, 10);\n        }\n        else {\n            input = locale.weekdaysParse(input);\n            if (typeof input !== 'number') {\n                return null;\n            }\n        }\n    }\n    return input;\n}\n\n// LOCALES\n\nexport var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\nexport function localeWeekdays (m) {\n    return this._weekdays[m.day()];\n}\n\nexport var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\nexport function localeWeekdaysShort (m) {\n    return this._weekdaysShort[m.day()];\n}\n\nexport var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\nexport function localeWeekdaysMin (m) {\n    return this._weekdaysMin[m.day()];\n}\n\nexport function localeWeekdaysParse (weekdayName) {\n    var i, mom, regex;\n\n    if (!this._weekdaysParse) {\n        this._weekdaysParse = [];\n    }\n\n    for (i = 0; i < 7; i++) {\n        // make the regex if we don't have it already\n        if (!this._weekdaysParse[i]) {\n            mom = createLocal([2000, 1]).day(i);\n            regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n            this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n        }\n        // test the regex\n        if (this._weekdaysParse[i].test(weekdayName)) {\n            return i;\n        }\n    }\n}\n\n// MOMENTS\n\nexport function getSetDayOfWeek (input) {\n    var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n    if (input != null) {\n        input = parseWeekday(input, this.localeData());\n        return this.add(input - day, 'd');\n    } else {\n        return day;\n    }\n}\n\nexport function getSetLocaleDayOfWeek (input) {\n    var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n    return input == null ? weekday : this.add(input - weekday, 'd');\n}\n\nexport function getSetISODayOfWeek (input) {\n    // behaves the same as moment#day except\n    // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n    // as a setter, sunday should belong to the previous week.\n    return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/day-of-year.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match3, match1to3 } from '../parse/regex';\nimport { daysInYear } from './year';\nimport { createUTCDate } from '../create/date-from-array';\nimport { addParseToken } from '../parse/token';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// ALIASES\n\naddUnitAlias('dayOfYear', 'DDD');\n\n// PARSING\n\naddRegexToken('DDD',  match1to3);\naddRegexToken('DDDD', match3);\naddParseToken(['DDD', 'DDDD'], function (input, array, config) {\n    config._dayOfYear = toInt(input);\n});\n\n// HELPERS\n\n//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\nexport function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {\n    var d = createUTCDate(year, 0, 1).getUTCDay();\n    var daysToAdd;\n    var dayOfYear;\n\n    d = d === 0 ? 7 : d;\n    weekday = weekday != null ? weekday : firstDayOfWeek;\n    daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);\n    dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;\n\n    return {\n        year      : dayOfYear > 0 ? year      : year - 1,\n        dayOfYear : dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear\n    };\n}\n\n// MOMENTS\n\nexport function getSetDayOfYear (input) {\n    var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n    return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/hour.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { HOUR } from './constants';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('H', ['HH', 2], 0, 'hour');\naddFormatToken('h', ['hh', 2], 0, function () {\n    return this.hours() % 12 || 12;\n});\n\nfunction meridiem (token, lowercase) {\n    addFormatToken(token, 0, 0, function () {\n        return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n    });\n}\n\nmeridiem('a', true);\nmeridiem('A', false);\n\n// ALIASES\n\naddUnitAlias('hour', 'h');\n\n// PARSING\n\nfunction matchMeridiem (isStrict, locale) {\n    return locale._meridiemParse;\n}\n\naddRegexToken('a',  matchMeridiem);\naddRegexToken('A',  matchMeridiem);\naddRegexToken('H',  match1to2);\naddRegexToken('h',  match1to2);\naddRegexToken('HH', match1to2, match2);\naddRegexToken('hh', match1to2, match2);\n\naddParseToken(['H', 'HH'], HOUR);\naddParseToken(['a', 'A'], function (input, array, config) {\n    config._isPm = config._locale.isPM(input);\n    config._meridiem = input;\n});\naddParseToken(['h', 'hh'], function (input, array, config) {\n    array[HOUR] = toInt(input);\n    config._pf.bigHour = true;\n});\n\n// LOCALES\n\nexport function localeIsPM (input) {\n    // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n    // Using charAt should be more compatible.\n    return ((input + '').toLowerCase().charAt(0) === 'p');\n}\n\nexport var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\nexport function localeMeridiem (hours, minutes, isLower) {\n    if (hours > 11) {\n        return isLower ? 'pm' : 'PM';\n    } else {\n        return isLower ? 'am' : 'AM';\n    }\n}\n\n\n// MOMENTS\n\n// Setting the hour should keep the time, because the user explicitly\n// specified which hour he wants. So trying to maintain the same hour (in\n// a new timezone) makes sense. Adding/subtracting hours does not follow\n// this rule.\nexport var getSetHour = makeGetSet('Hours', true);\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/millisecond.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1, match2, match3, match1to3, matchUnsigned } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MILLISECOND } from './constants';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('S', 0, 0, function () {\n    return ~~(this.millisecond() / 100);\n});\n\naddFormatToken(0, ['SS', 2], 0, function () {\n    return ~~(this.millisecond() / 10);\n});\n\nfunction milliseconds (token) {\n    addFormatToken(0, [token, 3], 0, 'millisecond');\n}\n\nmilliseconds('SSS');\nmilliseconds('SSSS');\n\n// ALIASES\n\naddUnitAlias('millisecond', 'ms');\n\n// PARSING\n\naddRegexToken('S',    match1to3, match1);\naddRegexToken('SS',   match1to3, match2);\naddRegexToken('SSS',  match1to3, match3);\naddRegexToken('SSSS', matchUnsigned);\naddParseToken(['S', 'SS', 'SSS', 'SSSS'], function (input, array) {\n    array[MILLISECOND] = toInt(('0.' + input) * 1000);\n});\n\n// MOMENTS\n\nexport var getSetMillisecond = makeGetSet('Milliseconds', false);\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/minute.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MINUTE } from './constants';\n\n// FORMATTING\n\naddFormatToken('m', ['mm', 2], 0, 'minute');\n\n// ALIASES\n\naddUnitAlias('minute', 'm');\n\n// PARSING\n\naddRegexToken('m',  match1to2);\naddRegexToken('mm', match1to2, match2);\naddParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\nexport var getSetMinute = makeGetSet('Minutes', false);\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/month.js",
    "content": "import { get } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2, matchWord } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { hooks } from '../utils/hooks';\nimport { MONTH } from './constants';\nimport toInt from '../utils/to-int';\nimport { createUTC } from '../create/utc';\n\nexport function daysInMonth(year, month) {\n    return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n}\n\n// FORMATTING\n\naddFormatToken('M', ['MM', 2], 'Mo', function () {\n    return this.month() + 1;\n});\n\naddFormatToken('MMM', 0, 0, function (format) {\n    return this.localeData().monthsShort(this, format);\n});\n\naddFormatToken('MMMM', 0, 0, function (format) {\n    return this.localeData().months(this, format);\n});\n\n// ALIASES\n\naddUnitAlias('month', 'M');\n\n// PARSING\n\naddRegexToken('M',    match1to2);\naddRegexToken('MM',   match1to2, match2);\naddRegexToken('MMM',  matchWord);\naddRegexToken('MMMM', matchWord);\n\naddParseToken(['M', 'MM'], function (input, array) {\n    array[MONTH] = toInt(input) - 1;\n});\n\naddParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n    var month = config._locale.monthsParse(input, token, config._strict);\n    // if we didn't find a month name, mark the date as invalid.\n    if (month != null) {\n        array[MONTH] = month;\n    } else {\n        config._pf.invalidMonth = input;\n    }\n});\n\n// LOCALES\n\nexport var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\nexport function localeMonths (m) {\n    return this._months[m.month()];\n}\n\nexport var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\nexport function localeMonthsShort (m) {\n    return this._monthsShort[m.month()];\n}\n\nexport function localeMonthsParse (monthName, format, strict) {\n    var i, mom, regex;\n\n    if (!this._monthsParse) {\n        this._monthsParse = [];\n        this._longMonthsParse = [];\n        this._shortMonthsParse = [];\n    }\n\n    for (i = 0; i < 12; i++) {\n        // make the regex if we don't have it already\n        mom = createUTC([2000, i]);\n        if (strict && !this._longMonthsParse[i]) {\n            this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n            this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n        }\n        if (!strict && !this._monthsParse[i]) {\n            regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n            this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n        }\n        // test the regex\n        if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n            return i;\n        } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n            return i;\n        } else if (!strict && this._monthsParse[i].test(monthName)) {\n            return i;\n        }\n    }\n}\n\n// MOMENTS\n\nexport function setMonth (mom, value) {\n    var dayOfMonth;\n\n    // TODO: Move this out of here!\n    if (typeof value === 'string') {\n        value = mom.localeData().monthsParse(value);\n        // TODO: Another silent failure?\n        if (typeof value !== 'number') {\n            return mom;\n        }\n    }\n\n    dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n    mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n    return mom;\n}\n\nexport function getSetMonth (value) {\n    if (value != null) {\n        setMonth(this, value);\n        hooks.updateOffset(this, true);\n        return this;\n    } else {\n        return get(this, 'Month');\n    }\n}\n\nexport function getDaysInMonth () {\n    return daysInMonth(this.year(), this.month());\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/offset.js",
    "content": "import zeroFill from '../utils/zero-fill';\nimport { createDuration } from '../duration/create';\nimport { addSubtract } from '../moment/add-subtract';\nimport { isMoment } from '../moment/constructor';\nimport { addFormatToken } from '../format/format';\nimport { addRegexToken, matchOffset } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { createLocal } from '../create/local';\nimport { createUTC } from '../create/utc';\nimport isDate from '../utils/is-date';\nimport toInt from '../utils/to-int';\nimport compareArrays from '../utils/compare-arrays';\nimport { hooks } from '../utils/hooks';\n\n// FORMATTING\n\nfunction offset (token, separator) {\n    addFormatToken(token, 0, 0, function () {\n        var offset = this.utcOffset();\n        var sign = '+';\n        if (offset < 0) {\n            offset = -offset;\n            sign = '-';\n        }\n        return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n    });\n}\n\noffset('Z', ':');\noffset('ZZ', '');\n\n// PARSING\n\naddRegexToken('Z',  matchOffset);\naddRegexToken('ZZ', matchOffset);\naddParseToken(['Z', 'ZZ'], function (input, array, config) {\n    config._useUTC = true;\n    config._tzm = offsetFromString(input);\n});\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10',  '00']\n// '-1530'  > ['-15', '30']\nvar chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\nfunction offsetFromString(string) {\n    var matches = ((string || '').match(matchOffset) || []);\n    var chunk   = matches[matches.length - 1] || [];\n    var parts   = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n    var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n    return parts[0] === '+' ? minutes : -minutes;\n}\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\nexport function cloneWithOffset(input, model) {\n    var res, diff;\n    if (model._isUTC) {\n        res = model.clone();\n        diff = (isMoment(input) || isDate(input) ? +input : +createLocal(input)) - (+res);\n        // Use low-level api, because this fn is low-level api.\n        res._d.setTime(+res._d + diff);\n        hooks.updateOffset(res, false);\n        return res;\n    } else {\n        return createLocal(input).local();\n    }\n    return model._isUTC ? createLocal(input).zone(model._offset || 0) : createLocal(input).local();\n}\n\nfunction getDateOffset (m) {\n    // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n    // https://github.com/moment/moment/pull/1871\n    return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n}\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\nhooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\nexport function getSetOffset (input, keepLocalTime) {\n    var offset = this._offset || 0,\n        localAdjust;\n    if (input != null) {\n        if (typeof input === 'string') {\n            input = offsetFromString(input);\n        }\n        if (Math.abs(input) < 16) {\n            input = input * 60;\n        }\n        if (!this._isUTC && keepLocalTime) {\n            localAdjust = getDateOffset(this);\n        }\n        this._offset = input;\n        this._isUTC = true;\n        if (localAdjust != null) {\n            this.add(localAdjust, 'm');\n        }\n        if (offset !== input) {\n            if (!keepLocalTime || this._changeInProgress) {\n                addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n            } else if (!this._changeInProgress) {\n                this._changeInProgress = true;\n                hooks.updateOffset(this, true);\n                this._changeInProgress = null;\n            }\n        }\n        return this;\n    } else {\n        return this._isUTC ? offset : getDateOffset(this);\n    }\n}\n\nexport function getSetZone (input, keepLocalTime) {\n    if (input != null) {\n        if (typeof input !== 'string') {\n            input = -input;\n        }\n\n        this.utcOffset(input, keepLocalTime);\n\n        return this;\n    } else {\n        return -this.utcOffset();\n    }\n}\n\nexport function setOffsetToUTC (keepLocalTime) {\n    return this.utcOffset(0, keepLocalTime);\n}\n\nexport function setOffsetToLocal (keepLocalTime) {\n    if (this._isUTC) {\n        this.utcOffset(0, keepLocalTime);\n        this._isUTC = false;\n\n        if (keepLocalTime) {\n            this.subtract(getDateOffset(this), 'm');\n        }\n    }\n    return this;\n}\n\nexport function setOffsetToParsedOffset () {\n    if (this._tzm) {\n        this.utcOffset(this._tzm);\n    } else if (typeof this._i === 'string') {\n        this.utcOffset(offsetFromString(this._i));\n    }\n    return this;\n}\n\nexport function hasAlignedHourOffset (input) {\n    if (!input) {\n        input = 0;\n    }\n    else {\n        input = createLocal(input).utcOffset();\n    }\n\n    return (this.utcOffset() - input) % 60 === 0;\n}\n\nexport function isDaylightSavingTime () {\n    return (\n        this.utcOffset() > this.clone().month(0).utcOffset() ||\n        this.utcOffset() > this.clone().month(5).utcOffset()\n    );\n}\n\nexport function isDaylightSavingTimeShifted () {\n    if (this._a) {\n        var other = this._isUTC ? createUTC(this._a) : createLocal(this._a);\n        return this.isValid() && compareArrays(this._a, other.toArray()) > 0;\n    }\n\n    return false;\n}\n\nexport function isLocal () {\n    return !this._isUTC;\n}\n\nexport function isUtcOffset () {\n    return this._isUTC;\n}\n\nexport function isUtc () {\n    return this._isUTC && this._offset === 0;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/quarter.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MONTH } from './constants';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('Q', 0, 0, 'quarter');\n\n// ALIASES\n\naddUnitAlias('quarter', 'Q');\n\n// PARSING\n\naddRegexToken('Q', match1);\naddParseToken('Q', function (input, array) {\n    array[MONTH] = (toInt(input) - 1) * 3;\n});\n\n// MOMENTS\n\nexport function getSetQuarter (input) {\n    return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/second.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { SECOND } from './constants';\n\n// FORMATTING\n\naddFormatToken('s', ['ss', 2], 0, 'second');\n\n// ALIASES\n\naddUnitAlias('second', 's');\n\n// PARSING\n\naddRegexToken('s',  match1to2);\naddRegexToken('ss', match1to2, match2);\naddParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\nexport var getSetSecond = makeGetSet('Seconds', false);\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/timestamp.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addRegexToken, matchTimestamp, matchSigned } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken('X', 0, 0, 'unix');\naddFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\naddRegexToken('x', matchSigned);\naddRegexToken('X', matchTimestamp);\naddParseToken('X', function (input, array, config) {\n    config._d = new Date(parseFloat(input, 10) * 1000);\n});\naddParseToken('x', function (input, array, config) {\n    config._d = new Date(toInt(input));\n});\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/timezone.js",
    "content": "import { addFormatToken } from '../format/format';\n\n// FORMATTING\n\naddFormatToken('z',  0, 0, 'zoneAbbr');\naddFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\nexport function getZoneAbbr () {\n    return this._isUTC ? 'UTC' : '';\n}\n\nexport function getZoneName () {\n    return this._isUTC ? 'Coordinated Universal Time' : '';\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/units.js",
    "content": "// Side effect imports\nimport './day-of-month';\nimport './day-of-week';\nimport './day-of-year';\nimport './hour';\nimport './millisecond';\nimport './minute';\nimport './month';\nimport './offset';\nimport './quarter';\nimport './second';\nimport './timestamp';\nimport './timezone';\nimport './week-year';\nimport './week';\nimport './year';\n\nimport { normalizeUnits } from './aliases';\n\nexport { normalizeUnits };\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/week-year.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';\nimport { addWeekParseToken } from '../parse/token';\nimport { weekOfYear } from './week';\nimport toInt from '../utils/to-int';\nimport { hooks } from '../utils/hooks';\nimport { createLocal } from '../create/local';\n\n// FORMATTING\n\naddFormatToken(0, ['gg', 2], 0, function () {\n    return this.weekYear() % 100;\n});\n\naddFormatToken(0, ['GG', 2], 0, function () {\n    return this.isoWeekYear() % 100;\n});\n\nfunction addWeekYearFormatToken (token, getter) {\n    addFormatToken(0, [token, token.length], 0, getter);\n}\n\naddWeekYearFormatToken('gggg',     'weekYear');\naddWeekYearFormatToken('ggggg',    'weekYear');\naddWeekYearFormatToken('GGGG',  'isoWeekYear');\naddWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\naddUnitAlias('weekYear', 'gg');\naddUnitAlias('isoWeekYear', 'GG');\n\n// PARSING\n\naddRegexToken('G',      matchSigned);\naddRegexToken('g',      matchSigned);\naddRegexToken('GG',     match1to2, match2);\naddRegexToken('gg',     match1to2, match2);\naddRegexToken('GGGG',   match1to4, match4);\naddRegexToken('gggg',   match1to4, match4);\naddRegexToken('GGGGG',  match1to6, match6);\naddRegexToken('ggggg',  match1to6, match6);\n\naddWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n    week[token.substr(0, 2)] = toInt(input);\n});\n\naddWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n    week[token] = hooks.parseTwoDigitYear(input);\n});\n\n// HELPERS\n\nfunction weeksInYear(year, dow, doy) {\n    return weekOfYear(createLocal([year, 11, 31 + dow - doy]), dow, doy).week;\n}\n\n// MOMENTS\n\nexport function getSetWeekYear (input) {\n    var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;\n    return input == null ? year : this.add((input - year), 'y');\n}\n\nexport function getSetISOWeekYear (input) {\n    var year = weekOfYear(this, 1, 4).year;\n    return input == null ? year : this.add((input - year), 'y');\n}\n\nexport function getISOWeeksInYear () {\n    return weeksInYear(this.year(), 1, 4);\n}\n\nexport function getWeeksInYear () {\n    var weekInfo = this.localeData()._week;\n    return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/week.js",
    "content": "import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addWeekParseToken } from '../parse/token';\nimport toInt from '../utils/to-int';\nimport { createLocal } from '../create/local';\n\n// FORMATTING\n\naddFormatToken('w', ['ww', 2], 'wo', 'week');\naddFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// ALIASES\n\naddUnitAlias('week', 'w');\naddUnitAlias('isoWeek', 'W');\n\n// PARSING\n\naddRegexToken('w',  match1to2);\naddRegexToken('ww', match1to2, match2);\naddRegexToken('W',  match1to2);\naddRegexToken('WW', match1to2, match2);\n\naddWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n    week[token.substr(0, 1)] = toInt(input);\n});\n\n// HELPERS\n\n// firstDayOfWeek       0 = sun, 6 = sat\n//                      the day of the week that starts the week\n//                      (usually sunday or monday)\n// firstDayOfWeekOfYear 0 = sun, 6 = sat\n//                      the first week is the week that contains the first\n//                      of this day of the week\n//                      (eg. ISO weeks use thursday (4))\nexport function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n    var end = firstDayOfWeekOfYear - firstDayOfWeek,\n        daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),\n        adjustedMoment;\n\n\n    if (daysToDayOfWeek > end) {\n        daysToDayOfWeek -= 7;\n    }\n\n    if (daysToDayOfWeek < end - 7) {\n        daysToDayOfWeek += 7;\n    }\n\n    adjustedMoment = createLocal(mom).add(daysToDayOfWeek, 'd');\n    return {\n        week: Math.ceil(adjustedMoment.dayOfYear() / 7),\n        year: adjustedMoment.year()\n    };\n}\n\n// LOCALES\n\nexport function localeWeek (mom) {\n    return weekOfYear(mom, this._week.dow, this._week.doy).week;\n}\n\nexport var defaultLocaleWeek = {\n    dow : 0, // Sunday is the first day of the week.\n    doy : 6  // The week that contains Jan 1st is the first week of the year.\n};\n\nexport function localeFirstDayOfWeek () {\n    return this._week.dow;\n}\n\nexport function localeFirstDayOfYear () {\n    return this._week.doy;\n}\n\n// MOMENTS\n\nexport function getSetWeek (input) {\n    var week = this.localeData().week(this);\n    return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\nexport function getSetISOWeek (input) {\n    var week = weekOfYear(this, 1, 4).week;\n    return input == null ? week : this.add((input - week) * 7, 'd');\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/units/year.js",
    "content": "import { makeGetSet } from '../moment/get-set';\nimport { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { hooks } from '../utils/hooks';\nimport { YEAR } from './constants';\nimport toInt from '../utils/to-int';\n\n// FORMATTING\n\naddFormatToken(0, ['YY', 2], 0, function () {\n    return this.year() % 100;\n});\n\naddFormatToken(0, ['YYYY',   4],       0, 'year');\naddFormatToken(0, ['YYYYY',  5],       0, 'year');\naddFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// ALIASES\n\naddUnitAlias('year', 'y');\n\n// PARSING\n\naddRegexToken('Y',      matchSigned);\naddRegexToken('YY',     match1to2, match2);\naddRegexToken('YYYY',   match1to4, match4);\naddRegexToken('YYYYY',  match1to6, match6);\naddRegexToken('YYYYYY', match1to6, match6);\n\naddParseToken(['YYYY', 'YYYYY', 'YYYYYY'], YEAR);\naddParseToken('YY', function (input, array) {\n    array[YEAR] = hooks.parseTwoDigitYear(input);\n});\n\n// HELPERS\n\nexport function daysInYear(year) {\n    return isLeapYear(year) ? 366 : 365;\n}\n\nfunction isLeapYear(year) {\n    return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\n// HOOKS\n\nhooks.parseTwoDigitYear = function (input) {\n    return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n};\n\n// MOMENTS\n\nexport var getSetYear = makeGetSet('FullYear', false);\n\nexport function getIsLeapYear () {\n    return isLeapYear(this.year());\n}\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/abs-floor.js",
    "content": "export default function absFloor (number) {\n    if (number < 0) {\n        return Math.ceil(number);\n    } else {\n        return Math.floor(number);\n    }\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/compare-arrays.js",
    "content": "import toInt from './to-int';\n\n// compare two arrays, return the number of differences\nexport default function compareArrays(array1, array2, dontConvert) {\n    var len = Math.min(array1.length, array2.length),\n        lengthDiff = Math.abs(array1.length - array2.length),\n        diffs = 0,\n        i;\n    for (i = 0; i < len; i++) {\n        if ((dontConvert && array1[i] !== array2[i]) ||\n            (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n            diffs++;\n        }\n    }\n    return diffs + lengthDiff;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/defaults.js",
    "content": "// Pick the first defined of two or three arguments.\nexport default function defaults(a, b, c) {\n    if (a != null) {\n        return a;\n    }\n    if (b != null) {\n        return b;\n    }\n    return c;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/deprecate.js",
    "content": "import extend from './extend';\nimport { hooks } from './hooks';\n\nfunction warn(msg) {\n    if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n        console.warn('Deprecation warning: ' + msg);\n    }\n}\n\nexport function deprecate(msg, fn) {\n    var firstTime = true;\n    return extend(function () {\n        if (firstTime) {\n            warn(msg);\n            firstTime = false;\n        }\n        return fn.apply(this, arguments);\n    }, fn);\n}\n\nvar deprecations = {};\n\nexport function deprecateSimple(name, msg) {\n    if (!deprecations[name]) {\n        warn(msg);\n        deprecations[name] = true;\n    }\n}\n\nhooks.suppressDeprecationWarnings = false;\n\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/extend.js",
    "content": "import hasOwnProp from './has-own-prop';\n\nexport default function extend(a, b) {\n    for (var i in b) {\n        if (hasOwnProp(b, i)) {\n            a[i] = b[i];\n        }\n    }\n\n    if (hasOwnProp(b, 'toString')) {\n        a.toString = b.toString;\n    }\n\n    if (hasOwnProp(b, 'valueOf')) {\n        a.valueOf = b.valueOf;\n    }\n\n    return a;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/has-own-prop.js",
    "content": "export default function hasOwnProp(a, b) {\n    return Object.prototype.hasOwnProperty.call(a, b);\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/hooks.js",
    "content": "export { hooks, setHookCallback };\n\nvar hookCallback;\n\nfunction hooks () {\n    return hookCallback.apply(null, arguments);\n}\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\nfunction setHookCallback (callback) {\n    hookCallback = callback;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/is-array.js",
    "content": "export default function isArray(input) {\n    return Object.prototype.toString.call(input) === '[object Array]';\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/is-date.js",
    "content": "export default function isDate(input) {\n    return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/map.js",
    "content": "export default function map(arr, fn) {\n    var res = [], i;\n    for (i = 0; i < arr.length; ++i) {\n        res.push(fn(arr[i], i));\n    }\n    return res;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/to-int.js",
    "content": "export default function toInt(argumentForCoercion) {\n    var coercedNumber = +argumentForCoercion,\n        value = 0;\n\n    if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n        if (coercedNumber >= 0) {\n            value = Math.floor(coercedNumber);\n        } else {\n            value = Math.ceil(coercedNumber);\n        }\n    }\n\n    return value;\n}\n"
  },
  {
    "path": "www/lib/moment/src/lib/utils/zero-fill.js",
    "content": "export default function zeroFill(number, targetLength, forceSign) {\n    var output = '' + Math.abs(number),\n        sign = number >= 0;\n\n    while (output.length < targetLength) {\n        output = '0' + output;\n    }\n    return (sign ? (forceSign ? '+' : '') : '-') + output;\n}\n"
  },
  {
    "path": "www/lib/moment/src/locale/af.js",
    "content": "//! moment.js locale configuration\n//! locale : afrikaans (af)\n//! author : Werner Mollentze : https://github.com/wernerm\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('af', {\n    months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),\n    monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n    weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),\n    weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n    weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n    meridiemParse: /vm|nm/i,\n    isPM : function (input) {\n        return /^nm$/i.test(input);\n    },\n    meridiem : function (hours, minutes, isLower) {\n        if (hours < 12) {\n            return isLower ? 'vm' : 'VM';\n        } else {\n            return isLower ? 'nm' : 'NM';\n        }\n    },\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Vandag om] LT',\n        nextDay : '[Môre om] LT',\n        nextWeek : 'dddd [om] LT',\n        lastDay : '[Gister om] LT',\n        lastWeek : '[Laas] dddd [om] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'oor %s',\n        past : '%s gelede',\n        s : '\\'n paar sekondes',\n        m : '\\'n minuut',\n        mm : '%d minute',\n        h : '\\'n uur',\n        hh : '%d ure',\n        d : '\\'n dag',\n        dd : '%d dae',\n        M : '\\'n maand',\n        MM : '%d maande',\n        y : '\\'n jaar',\n        yy : '%d jaar'\n    },\n    ordinalParse: /\\d{1,2}(ste|de)/,\n    ordinal : function (number) {\n        return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter\n    },\n    week : {\n        dow : 1, // Maandag is die eerste dag van die week.\n        doy : 4  // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n    }\n});\n"
  },
  {
    "path": "www/lib/moment/src/locale/ar-ma.js",
    "content": "//! moment.js locale configuration\n//! locale : Moroccan Arabic (ar-ma)\n//! author : ElFadili Yassine : https://github.com/ElFadiliY\n//! author : Abdel Said : https://github.com/abdelsaid\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ar-ma', {\n    months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n    monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n    weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n    weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n    weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[اليوم على الساعة] LT',\n        nextDay: '[غدا على الساعة] LT',\n        nextWeek: 'dddd [على الساعة] LT',\n        lastDay: '[أمس على الساعة] LT',\n        lastWeek: 'dddd [على الساعة] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'في %s',\n        past : 'منذ %s',\n        s : 'ثوان',\n        m : 'دقيقة',\n        mm : '%d دقائق',\n        h : 'ساعة',\n        hh : '%d ساعات',\n        d : 'يوم',\n        dd : '%d أيام',\n        M : 'شهر',\n        MM : '%d أشهر',\n        y : 'سنة',\n        yy : '%d سنوات'\n    },\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ar-sa.js",
    "content": "//! moment.js locale configuration\n//! locale : Arabic Saudi Arabia (ar-sa)\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '١',\n    '2': '٢',\n    '3': '٣',\n    '4': '٤',\n    '5': '٥',\n    '6': '٦',\n    '7': '٧',\n    '8': '٨',\n    '9': '٩',\n    '0': '٠'\n}, numberMap = {\n    '١': '1',\n    '٢': '2',\n    '٣': '3',\n    '٤': '4',\n    '٥': '5',\n    '٦': '6',\n    '٧': '7',\n    '٨': '8',\n    '٩': '9',\n    '٠': '0'\n};\n\nexport default moment.defineLocale('ar-sa', {\n    months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n    monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n    weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n    weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n    weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'HH:mm:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    meridiemParse: /ص|م/,\n    isPM : function (input) {\n        return 'م' === input;\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 12) {\n            return 'ص';\n        } else {\n            return 'م';\n        }\n    },\n    calendar : {\n        sameDay: '[اليوم على الساعة] LT',\n        nextDay: '[غدا على الساعة] LT',\n        nextWeek: 'dddd [على الساعة] LT',\n        lastDay: '[أمس على الساعة] LT',\n        lastWeek: 'dddd [على الساعة] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'في %s',\n        past : 'منذ %s',\n        s : 'ثوان',\n        m : 'دقيقة',\n        mm : '%d دقائق',\n        h : 'ساعة',\n        hh : '%d ساعات',\n        d : 'يوم',\n        dd : '%d أيام',\n        M : 'شهر',\n        MM : '%d أشهر',\n        y : 'سنة',\n        yy : '%d سنوات'\n    },\n    preparse: function (string) {\n        return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n            return numberMap[match];\n        }).replace(/،/g, ',');\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        }).replace(/,/g, '،');\n    },\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ar-tn.js",
    "content": "//! moment.js locale configuration\n//! locale  : Tunisian Arabic (ar-tn)\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ar-tn', {\n    months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n    monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n    weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n    weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n    weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n    longDateFormat: {\n        LT: 'HH:mm',\n        LTS: 'LT:ss',\n        L: 'DD/MM/YYYY',\n        LL: 'D MMMM YYYY',\n        LLL: 'D MMMM YYYY LT',\n        LLLL: 'dddd D MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[اليوم على الساعة] LT',\n        nextDay: '[غدا على الساعة] LT',\n        nextWeek: 'dddd [على الساعة] LT',\n        lastDay: '[أمس على الساعة] LT',\n        lastWeek: 'dddd [على الساعة] LT',\n        sameElse: 'L'\n    },\n    relativeTime: {\n        future: 'في %s',\n        past: 'منذ %s',\n        s: 'ثوان',\n        m: 'دقيقة',\n        mm: '%d دقائق',\n        h: 'ساعة',\n        hh: '%d ساعات',\n        d: 'يوم',\n        dd: '%d أيام',\n        M: 'شهر',\n        MM: '%d أشهر',\n        y: 'سنة',\n        yy: '%d سنوات'\n    },\n    week: {\n        dow: 1, // Monday is the first day of the week.\n        doy: 4 // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ar.js",
    "content": "//! moment.js locale configuration\n//! Locale: Arabic (ar)\n//! Author: Abdel Said: https://github.com/abdelsaid\n//! Changes in months, weekdays: Ahmed Elkhatib\n//! Native plural forms: forabi https://github.com/forabi\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '١',\n    '2': '٢',\n    '3': '٣',\n    '4': '٤',\n    '5': '٥',\n    '6': '٦',\n    '7': '٧',\n    '8': '٨',\n    '9': '٩',\n    '0': '٠'\n}, numberMap = {\n    '١': '1',\n    '٢': '2',\n    '٣': '3',\n    '٤': '4',\n    '٥': '5',\n    '٦': '6',\n    '٧': '7',\n    '٨': '8',\n    '٩': '9',\n    '٠': '0'\n}, pluralForm = function (n) {\n    return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;\n}, plurals = {\n    s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n    m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n    h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n    d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n    M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n    y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n}, pluralize = function (u) {\n    return function (number, withoutSuffix, string, isFuture) {\n        var f = pluralForm(number),\n            str = plurals[u][pluralForm(number)];\n        if (f === 2) {\n            str = str[withoutSuffix ? 0 : 1];\n        }\n        return str.replace(/%d/i, number);\n    };\n}, months = [\n    'كانون الثاني يناير',\n    'شباط فبراير',\n    'آذار مارس',\n    'نيسان أبريل',\n    'أيار مايو',\n    'حزيران يونيو',\n    'تموز يوليو',\n    'آب أغسطس',\n    'أيلول سبتمبر',\n    'تشرين الأول أكتوبر',\n    'تشرين الثاني نوفمبر',\n    'كانون الأول ديسمبر'\n];\n\nexport default moment.defineLocale('ar', {\n    months : months,\n    monthsShort : months,\n    weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n    weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n    weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'HH:mm:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    meridiemParse: /ص|م/,\n    isPM : function (input) {\n        return 'م' === input;\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 12) {\n            return 'ص';\n        } else {\n            return 'م';\n        }\n    },\n    calendar : {\n        sameDay: '[اليوم عند الساعة] LT',\n        nextDay: '[غدًا عند الساعة] LT',\n        nextWeek: 'dddd [عند الساعة] LT',\n        lastDay: '[أمس عند الساعة] LT',\n        lastWeek: 'dddd [عند الساعة] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'بعد %s',\n        past : 'منذ %s',\n        s : pluralize('s'),\n        m : pluralize('m'),\n        mm : pluralize('m'),\n        h : pluralize('h'),\n        hh : pluralize('h'),\n        d : pluralize('d'),\n        dd : pluralize('d'),\n        M : pluralize('M'),\n        MM : pluralize('M'),\n        y : pluralize('y'),\n        yy : pluralize('y')\n    },\n    preparse: function (string) {\n        return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n            return numberMap[match];\n        }).replace(/،/g, ',');\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        }).replace(/,/g, '،');\n    },\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/az.js",
    "content": "//! moment.js locale configuration\n//! locale : azerbaijani (az)\n//! author : topchiyev : https://github.com/topchiyev\n\nimport moment from '../moment';\n\nvar suffixes = {\n    1: '-inci',\n    5: '-inci',\n    8: '-inci',\n    70: '-inci',\n    80: '-inci',\n    2: '-nci',\n    7: '-nci',\n    20: '-nci',\n    50: '-nci',\n    3: '-üncü',\n    4: '-üncü',\n    100: '-üncü',\n    6: '-ncı',\n    9: '-uncu',\n    10: '-uncu',\n    30: '-uncu',\n    60: '-ıncı',\n    90: '-ıncı'\n};\n\nexport default moment.defineLocale('az', {\n    months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),\n    monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n    weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),\n    weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n    weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[bugün saat] LT',\n        nextDay : '[sabah saat] LT',\n        nextWeek : '[gələn həftə] dddd [saat] LT',\n        lastDay : '[dünən] LT',\n        lastWeek : '[keçən həftə] dddd [saat] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s sonra',\n        past : '%s əvvəl',\n        s : 'birneçə saniyyə',\n        m : 'bir dəqiqə',\n        mm : '%d dəqiqə',\n        h : 'bir saat',\n        hh : '%d saat',\n        d : 'bir gün',\n        dd : '%d gün',\n        M : 'bir ay',\n        MM : '%d ay',\n        y : 'bir il',\n        yy : '%d il'\n    },\n    meridiemParse: /gecə|səhər|gündüz|axşam/,\n    isPM : function (input) {\n        return /^(gündüz|axşam)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'gecə';\n        } else if (hour < 12) {\n            return 'səhər';\n        } else if (hour < 17) {\n            return 'gündüz';\n        } else {\n            return 'axşam';\n        }\n    },\n    ordinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n    ordinal : function (number) {\n        if (number === 0) {  // special case for zero\n            return number + '-ıncı';\n        }\n        var a = number % 10,\n            b = number % 100 - a,\n            c = number >= 100 ? 100 : null;\n        return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/be.js",
    "content": "//! moment.js locale configuration\n//! locale : belarusian (be)\n//! author : Dmitry Demidov : https://github.com/demidov91\n//! author: Praleska: http://praleska.pro/\n//! Author : Menelion Elensúle : https://github.com/Oire\n\nimport moment from '../moment';\n\nfunction plural(word, num) {\n    var forms = word.split('_');\n    return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n}\nfunction relativeTimeWithPlural(number, withoutSuffix, key) {\n    var format = {\n        'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n        'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n        'dd': 'дзень_дні_дзён',\n        'MM': 'месяц_месяцы_месяцаў',\n        'yy': 'год_гады_гадоў'\n    };\n    if (key === 'm') {\n        return withoutSuffix ? 'хвіліна' : 'хвіліну';\n    }\n    else if (key === 'h') {\n        return withoutSuffix ? 'гадзіна' : 'гадзіну';\n    }\n    else {\n        return number + ' ' + plural(format[key], +number);\n    }\n}\nfunction monthsCaseReplace(m, format) {\n    var months = {\n        'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),\n        'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')\n    },\n    nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return months[nounCase][m.month()];\n}\nfunction weekdaysCaseReplace(m, format) {\n    var weekdays = {\n        'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),\n        'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')\n    },\n    nounCase = (/\\[ ?[Вв] ?(?:мінулую|наступную)? ?\\] ?dddd/).test(format) ?\n        'accusative' :\n        'nominative';\n    return weekdays[nounCase][m.day()];\n}\n\nexport default moment.defineLocale('be', {\n    months : monthsCaseReplace,\n    monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n    weekdays : weekdaysCaseReplace,\n    weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n    weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY г.',\n        LLL : 'D MMMM YYYY г., LT',\n        LLLL : 'dddd, D MMMM YYYY г., LT'\n    },\n    calendar : {\n        sameDay: '[Сёння ў] LT',\n        nextDay: '[Заўтра ў] LT',\n        lastDay: '[Учора ў] LT',\n        nextWeek: function () {\n            return '[У] dddd [ў] LT';\n        },\n        lastWeek: function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n            case 5:\n            case 6:\n                return '[У мінулую] dddd [ў] LT';\n            case 1:\n            case 2:\n            case 4:\n                return '[У мінулы] dddd [ў] LT';\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'праз %s',\n        past : '%s таму',\n        s : 'некалькі секунд',\n        m : relativeTimeWithPlural,\n        mm : relativeTimeWithPlural,\n        h : relativeTimeWithPlural,\n        hh : relativeTimeWithPlural,\n        d : 'дзень',\n        dd : relativeTimeWithPlural,\n        M : 'месяц',\n        MM : relativeTimeWithPlural,\n        y : 'год',\n        yy : relativeTimeWithPlural\n    },\n    meridiemParse: /ночы|раніцы|дня|вечара/,\n    isPM : function (input) {\n        return /^(дня|вечара)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'ночы';\n        } else if (hour < 12) {\n            return 'раніцы';\n        } else if (hour < 17) {\n            return 'дня';\n        } else {\n            return 'вечара';\n        }\n    },\n    ordinalParse: /\\d{1,2}-(і|ы|га)/,\n    ordinal: function (number, period) {\n        switch (period) {\n        case 'M':\n        case 'd':\n        case 'DDD':\n        case 'w':\n        case 'W':\n            return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';\n        case 'D':\n            return number + '-га';\n        default:\n            return number;\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/bg.js",
    "content": "//! moment.js locale configuration\n//! locale : bulgarian (bg)\n//! author : Krasen Borisov : https://github.com/kraz\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('bg', {\n    months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),\n    monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n    weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),\n    weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n    weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'D.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Днес в] LT',\n        nextDay : '[Утре в] LT',\n        nextWeek : 'dddd [в] LT',\n        lastDay : '[Вчера в] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[В изминалата] dddd [в] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[В изминалия] dddd [в] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'след %s',\n        past : 'преди %s',\n        s : 'няколко секунди',\n        m : 'минута',\n        mm : '%d минути',\n        h : 'час',\n        hh : '%d часа',\n        d : 'ден',\n        dd : '%d дни',\n        M : 'месец',\n        MM : '%d месеца',\n        y : 'година',\n        yy : '%d години'\n    },\n    ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n    ordinal : function (number) {\n        var lastDigit = number % 10,\n            last2Digits = number % 100;\n        if (number === 0) {\n            return number + '-ев';\n        } else if (last2Digits === 0) {\n            return number + '-ен';\n        } else if (last2Digits > 10 && last2Digits < 20) {\n            return number + '-ти';\n        } else if (lastDigit === 1) {\n            return number + '-ви';\n        } else if (lastDigit === 2) {\n            return number + '-ри';\n        } else if (lastDigit === 7 || lastDigit === 8) {\n            return number + '-ми';\n        } else {\n            return number + '-ти';\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/bn.js",
    "content": "//! moment.js locale configuration\n//! locale : Bengali (bn)\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '১',\n    '2': '২',\n    '3': '৩',\n    '4': '৪',\n    '5': '৫',\n    '6': '৬',\n    '7': '৭',\n    '8': '৮',\n    '9': '৯',\n    '0': '০'\n},\nnumberMap = {\n    '১': '1',\n    '২': '2',\n    '৩': '3',\n    '৪': '4',\n    '৫': '5',\n    '৬': '6',\n    '৭': '7',\n    '৮': '8',\n    '৯': '9',\n    '০': '0'\n};\n\nexport default moment.defineLocale('bn', {\n    months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),\n    monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),\n    weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'),\n    weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'),\n    weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),\n    longDateFormat : {\n        LT : 'A h:mm সময়',\n        LTS : 'A h:mm:ss সময়',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[আজ] LT',\n        nextDay : '[আগামীকাল] LT',\n        nextWeek : 'dddd, LT',\n        lastDay : '[গতকাল] LT',\n        lastWeek : '[গত] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s পরে',\n        past : '%s আগে',\n        s : 'কএক সেকেন্ড',\n        m : 'এক মিনিট',\n        mm : '%d মিনিট',\n        h : 'এক ঘন্টা',\n        hh : '%d ঘন্টা',\n        d : 'এক দিন',\n        dd : '%d দিন',\n        M : 'এক মাস',\n        MM : '%d মাস',\n        y : 'এক বছর',\n        yy : '%d বছর'\n    },\n    preparse: function (string) {\n        return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    meridiemParse: /রাত|শকাল|দুপুর|বিকেল|রাত/,\n    isPM: function (input) {\n        return /^(দুপুর|বিকেল|রাত)$/.test(input);\n    },\n    //Bengali is a vast language its spoken\n    //in different forms in various parts of the world.\n    //I have just generalized with most common one used\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'রাত';\n        } else if (hour < 10) {\n            return 'শকাল';\n        } else if (hour < 17) {\n            return 'দুপুর';\n        } else if (hour < 20) {\n            return 'বিকেল';\n        } else {\n            return 'রাত';\n        }\n    },\n    week : {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/bo.js",
    "content": "//! moment.js locale configuration\n//! locale : tibetan (bo)\n//! author : Thupten N. Chakrishar : https://github.com/vajradog\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '༡',\n    '2': '༢',\n    '3': '༣',\n    '4': '༤',\n    '5': '༥',\n    '6': '༦',\n    '7': '༧',\n    '8': '༨',\n    '9': '༩',\n    '0': '༠'\n},\nnumberMap = {\n    '༡': '1',\n    '༢': '2',\n    '༣': '3',\n    '༤': '4',\n    '༥': '5',\n    '༦': '6',\n    '༧': '7',\n    '༨': '8',\n    '༩': '9',\n    '༠': '0'\n};\n\nexport default moment.defineLocale('bo', {\n    months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n    monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n    weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),\n    weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n    weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n    longDateFormat : {\n        LT : 'A h:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[དི་རིང] LT',\n        nextDay : '[སང་ཉིན] LT',\n        nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',\n        lastDay : '[ཁ་སང] LT',\n        lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s ལ་',\n        past : '%s སྔན་ལ',\n        s : 'ལམ་སང',\n        m : 'སྐར་མ་གཅིག',\n        mm : '%d སྐར་མ',\n        h : 'ཆུ་ཚོད་གཅིག',\n        hh : '%d ཆུ་ཚོད',\n        d : 'ཉིན་གཅིག',\n        dd : '%d ཉིན་',\n        M : 'ཟླ་བ་གཅིག',\n        MM : '%d ཟླ་བ',\n        y : 'ལོ་གཅིག',\n        yy : '%d ལོ'\n    },\n    preparse: function (string) {\n        return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n    isPM: function (input) {\n        return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'མཚན་མོ';\n        } else if (hour < 10) {\n            return 'ཞོགས་ཀས';\n        } else if (hour < 17) {\n            return 'ཉིན་གུང';\n        } else if (hour < 20) {\n            return 'དགོང་དག';\n        } else {\n            return 'མཚན་མོ';\n        }\n    },\n    week : {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/br.js",
    "content": "//! moment.js locale configuration\n//! locale : breton (br)\n//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\nimport moment from '../moment';\n\nfunction relativeTimeWithMutation(number, withoutSuffix, key) {\n    var format = {\n        'mm': 'munutenn',\n        'MM': 'miz',\n        'dd': 'devezh'\n    };\n    return number + ' ' + mutation(format[key], number);\n}\nfunction specialMutationForYears(number) {\n    switch (lastNumber(number)) {\n    case 1:\n    case 3:\n    case 4:\n    case 5:\n    case 9:\n        return number + ' bloaz';\n    default:\n        return number + ' vloaz';\n    }\n}\nfunction lastNumber(number) {\n    if (number > 9) {\n        return lastNumber(number % 10);\n    }\n    return number;\n}\nfunction mutation(text, number) {\n    if (number === 2) {\n        return softMutation(text);\n    }\n    return text;\n}\nfunction softMutation(text) {\n    var mutationTable = {\n        'm': 'v',\n        'b': 'v',\n        'd': 'z'\n    };\n    if (mutationTable[text.charAt(0)] === undefined) {\n        return text;\n    }\n    return mutationTable[text.charAt(0)] + text.substring(1);\n}\n\nexport default moment.defineLocale('br', {\n    months : 'Genver_C\\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),\n    monthsShort : 'Gen_C\\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n    weekdays : 'Sul_Lun_Meurzh_Merc\\'her_Yaou_Gwener_Sadorn'.split('_'),\n    weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n    weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'h[e]mm A',\n        LTS : 'h[e]mm:ss A',\n        L : 'DD/MM/YYYY',\n        LL : 'D [a viz] MMMM YYYY',\n        LLL : 'D [a viz] MMMM YYYY LT',\n        LLLL : 'dddd, D [a viz] MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Hiziv da] LT',\n        nextDay : '[Warc\\'hoazh da] LT',\n        nextWeek : 'dddd [da] LT',\n        lastDay : '[Dec\\'h da] LT',\n        lastWeek : 'dddd [paset da] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'a-benn %s',\n        past : '%s \\'zo',\n        s : 'un nebeud segondennoù',\n        m : 'ur vunutenn',\n        mm : relativeTimeWithMutation,\n        h : 'un eur',\n        hh : '%d eur',\n        d : 'un devezh',\n        dd : relativeTimeWithMutation,\n        M : 'ur miz',\n        MM : relativeTimeWithMutation,\n        y : 'ur bloaz',\n        yy : specialMutationForYears\n    },\n    ordinalParse: /\\d{1,2}(añ|vet)/,\n    ordinal : function (number) {\n        var output = (number === 1) ? 'añ' : 'vet';\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/bs.js",
    "content": "//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n\nimport moment from '../moment';\n\nfunction translate(number, withoutSuffix, key) {\n    var result = number + ' ';\n    switch (key) {\n    case 'm':\n        return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n    case 'mm':\n        if (number === 1) {\n            result += 'minuta';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'minute';\n        } else {\n            result += 'minuta';\n        }\n        return result;\n    case 'h':\n        return withoutSuffix ? 'jedan sat' : 'jednog sata';\n    case 'hh':\n        if (number === 1) {\n            result += 'sat';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'sata';\n        } else {\n            result += 'sati';\n        }\n        return result;\n    case 'dd':\n        if (number === 1) {\n            result += 'dan';\n        } else {\n            result += 'dana';\n        }\n        return result;\n    case 'MM':\n        if (number === 1) {\n            result += 'mjesec';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'mjeseca';\n        } else {\n            result += 'mjeseci';\n        }\n        return result;\n    case 'yy':\n        if (number === 1) {\n            result += 'godina';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'godine';\n        } else {\n            result += 'godina';\n        }\n        return result;\n    }\n}\n\nexport default moment.defineLocale('bs', {\n    months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),\n    monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n    weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n    weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n    weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD. MM. YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay  : '[danas u] LT',\n        nextDay  : '[sutra u] LT',\n        nextWeek : function () {\n            switch (this.day()) {\n            case 0:\n                return '[u] [nedjelju] [u] LT';\n            case 3:\n                return '[u] [srijedu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        },\n        lastDay  : '[jučer u] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n                return '[prošlu] dddd [u] LT';\n            case 6:\n                return '[prošle] [subote] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prošli] dddd [u] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past   : 'prije %s',\n        s      : 'par sekundi',\n        m      : translate,\n        mm     : translate,\n        h      : translate,\n        hh     : translate,\n        d      : 'dan',\n        dd     : translate,\n        M      : 'mjesec',\n        MM     : translate,\n        y      : 'godinu',\n        yy     : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ca.js",
    "content": "//! moment.js locale configuration\n//! locale : catalan (ca)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ca', {\n    months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n    monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),\n    weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n    weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n    weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : function () {\n            return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n        },\n        nextDay : function () {\n            return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n        },\n        nextWeek : function () {\n            return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n        },\n        lastDay : function () {\n            return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n        },\n        lastWeek : function () {\n            return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'en %s',\n        past : 'fa %s',\n        s : 'uns segons',\n        m : 'un minut',\n        mm : '%d minuts',\n        h : 'una hora',\n        hh : '%d hores',\n        d : 'un dia',\n        dd : '%d dies',\n        M : 'un mes',\n        MM : '%d mesos',\n        y : 'un any',\n        yy : '%d anys'\n    },\n    ordinalParse: /\\d{1,2}(r|n|t|è|a)/,\n    ordinal : function (number, period) {\n        var output = (number === 1) ? 'r' :\n            (number === 2) ? 'n' :\n            (number === 3) ? 'r' :\n            (number === 4) ? 't' : 'è';\n        if (period === 'w' || period === 'W') {\n            output = 'a';\n        }\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/cs.js",
    "content": "//! moment.js locale configuration\n//! locale : czech (cs)\n//! author : petrbela : https://github.com/petrbela\n\nimport moment from '../moment';\n\nvar months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),\n    monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');\nfunction plural(n) {\n    return (n > 1) && (n < 5) && (~~(n / 10) !== 1);\n}\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var result = number + ' ';\n    switch (key) {\n    case 's':  // a few seconds / in a few seconds / a few seconds ago\n        return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n    case 'm':  // a minute / in a minute / a minute ago\n        return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n    case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'minuty' : 'minut');\n        } else {\n            return result + 'minutami';\n        }\n        break;\n    case 'h':  // an hour / in an hour / an hour ago\n        return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n    case 'hh': // 9 hours / in 9 hours / 9 hours ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'hodiny' : 'hodin');\n        } else {\n            return result + 'hodinami';\n        }\n        break;\n    case 'd':  // a day / in a day / a day ago\n        return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n    case 'dd': // 9 days / in 9 days / 9 days ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'dny' : 'dní');\n        } else {\n            return result + 'dny';\n        }\n        break;\n    case 'M':  // a month / in a month / a month ago\n        return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';\n    case 'MM': // 9 months / in 9 months / 9 months ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'měsíce' : 'měsíců');\n        } else {\n            return result + 'měsíci';\n        }\n        break;\n    case 'y':  // a year / in a year / a year ago\n        return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n    case 'yy': // 9 years / in 9 years / 9 years ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'roky' : 'let');\n        } else {\n            return result + 'lety';\n        }\n        break;\n    }\n}\n\nexport default moment.defineLocale('cs', {\n    months : months,\n    monthsShort : monthsShort,\n    monthsParse : (function (months, monthsShort) {\n        var i, _monthsParse = [];\n        for (i = 0; i < 12; i++) {\n            // use custom parser to solve problem with July (červenec)\n            _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n        }\n        return _monthsParse;\n    }(months, monthsShort)),\n    weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n    weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),\n    weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),\n    longDateFormat : {\n        LT: 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[dnes v] LT',\n        nextDay: '[zítra v] LT',\n        nextWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[v neděli v] LT';\n            case 1:\n            case 2:\n                return '[v] dddd [v] LT';\n            case 3:\n                return '[ve středu v] LT';\n            case 4:\n                return '[ve čtvrtek v] LT';\n            case 5:\n                return '[v pátek v] LT';\n            case 6:\n                return '[v sobotu v] LT';\n            }\n        },\n        lastDay: '[včera v] LT',\n        lastWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[minulou neděli v] LT';\n            case 1:\n            case 2:\n                return '[minulé] dddd [v] LT';\n            case 3:\n                return '[minulou středu v] LT';\n            case 4:\n            case 5:\n                return '[minulý] dddd [v] LT';\n            case 6:\n                return '[minulou sobotu v] LT';\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past : 'před %s',\n        s : translate,\n        m : translate,\n        mm : translate,\n        h : translate,\n        hh : translate,\n        d : translate,\n        dd : translate,\n        M : translate,\n        MM : translate,\n        y : translate,\n        yy : translate\n    },\n    ordinalParse : /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/cv.js",
    "content": "//! moment.js locale configuration\n//! locale : chuvash (cv)\n//! author : Anatoly Mironov : https://github.com/mirontoli\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('cv', {\n    months : 'кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав'.split('_'),\n    monthsShort : 'кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш'.split('_'),\n    weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун'.split('_'),\n    weekdaysShort : 'выр_тун_ытл_юн_кĕç_эрн_шăм'.split('_'),\n    weekdaysMin : 'вр_тн_ыт_юн_кç_эр_шм'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD-MM-YYYY',\n        LL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]',\n        LLL : 'YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT',\n        LLLL : 'dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT'\n    },\n    calendar : {\n        sameDay: '[Паян] LT [сехетре]',\n        nextDay: '[Ыран] LT [сехетре]',\n        lastDay: '[Ĕнер] LT [сехетре]',\n        nextWeek: '[Çитес] dddd LT [сехетре]',\n        lastWeek: '[Иртнĕ] dddd LT [сехетре]',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : function (output) {\n            var affix = /сехет$/i.exec(output) ? 'рен' : /çул$/i.exec(output) ? 'тан' : 'ран';\n            return output + affix;\n        },\n        past : '%s каялла',\n        s : 'пĕр-ик çеккунт',\n        m : 'пĕр минут',\n        mm : '%d минут',\n        h : 'пĕр сехет',\n        hh : '%d сехет',\n        d : 'пĕр кун',\n        dd : '%d кун',\n        M : 'пĕр уйăх',\n        MM : '%d уйăх',\n        y : 'пĕр çул',\n        yy : '%d çул'\n    },\n    ordinalParse: /\\d{1,2}-мĕш/,\n    ordinal : '%d-мĕш',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/cy.js",
    "content": "//! moment.js locale configuration\n//! locale : Welsh (cy)\n//! author : Robert Allen\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('cy', {\n    months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),\n    monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),\n    weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),\n    weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n    weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n    // time formats are the same as en-gb\n    longDateFormat: {\n        LT: 'HH:mm',\n        LTS : 'LT:ss',\n        L: 'DD/MM/YYYY',\n        LL: 'D MMMM YYYY',\n        LLL: 'D MMMM YYYY LT',\n        LLLL: 'dddd, D MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[Heddiw am] LT',\n        nextDay: '[Yfory am] LT',\n        nextWeek: 'dddd [am] LT',\n        lastDay: '[Ddoe am] LT',\n        lastWeek: 'dddd [diwethaf am] LT',\n        sameElse: 'L'\n    },\n    relativeTime: {\n        future: 'mewn %s',\n        past: '%s yn ôl',\n        s: 'ychydig eiliadau',\n        m: 'munud',\n        mm: '%d munud',\n        h: 'awr',\n        hh: '%d awr',\n        d: 'diwrnod',\n        dd: '%d diwrnod',\n        M: 'mis',\n        MM: '%d mis',\n        y: 'blwyddyn',\n        yy: '%d flynedd'\n    },\n    ordinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n    // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n    ordinal: function (number) {\n        var b = number,\n            output = '',\n            lookup = [\n                '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed\n                'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed\n            ];\n        if (b > 20) {\n            if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                output = 'fed'; // not 30ain, 70ain or 90ain\n            } else {\n                output = 'ain';\n            }\n        } else if (b > 0) {\n            output = lookup[b];\n        }\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/da.js",
    "content": "//! moment.js locale configuration\n//! locale : danish (da)\n//! author : Ulrik Nielsen : https://github.com/mrbase\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('da', {\n    months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n    weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n    weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n    weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd [d.] D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[I dag kl.] LT',\n        nextDay : '[I morgen kl.] LT',\n        nextWeek : 'dddd [kl.] LT',\n        lastDay : '[I går kl.] LT',\n        lastWeek : '[sidste] dddd [kl] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'om %s',\n        past : '%s siden',\n        s : 'få sekunder',\n        m : 'et minut',\n        mm : '%d minutter',\n        h : 'en time',\n        hh : '%d timer',\n        d : 'en dag',\n        dd : '%d dage',\n        M : 'en måned',\n        MM : '%d måneder',\n        y : 'et år',\n        yy : '%d år'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/de-at.js",
    "content": "//! moment.js locale configuration\n//! locale : austrian german (de-at)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n\nimport moment from '../moment';\n\nfunction processRelativeTime(number, withoutSuffix, key, isFuture) {\n    var format = {\n        'm': ['eine Minute', 'einer Minute'],\n        'h': ['eine Stunde', 'einer Stunde'],\n        'd': ['ein Tag', 'einem Tag'],\n        'dd': [number + ' Tage', number + ' Tagen'],\n        'M': ['ein Monat', 'einem Monat'],\n        'MM': [number + ' Monate', number + ' Monaten'],\n        'y': ['ein Jahr', 'einem Jahr'],\n        'yy': [number + ' Jahre', number + ' Jahren']\n    };\n    return withoutSuffix ? format[key][0] : format[key][1];\n}\n\nexport default moment.defineLocale('de-at', {\n    months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n    monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n    weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n    weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n    weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n    longDateFormat : {\n        LT: 'HH:mm',\n        LTS: 'HH:mm:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Heute um] LT [Uhr]',\n        sameElse: 'L',\n        nextDay: '[Morgen um] LT [Uhr]',\n        nextWeek: 'dddd [um] LT [Uhr]',\n        lastDay: '[Gestern um] LT [Uhr]',\n        lastWeek: '[letzten] dddd [um] LT [Uhr]'\n    },\n    relativeTime : {\n        future : 'in %s',\n        past : 'vor %s',\n        s : 'ein paar Sekunden',\n        m : processRelativeTime,\n        mm : '%d Minuten',\n        h : processRelativeTime,\n        hh : '%d Stunden',\n        d : processRelativeTime,\n        dd : processRelativeTime,\n        M : processRelativeTime,\n        MM : processRelativeTime,\n        y : processRelativeTime,\n        yy : processRelativeTime\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/de.js",
    "content": "//! moment.js locale configuration\n//! locale : german (de)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n\nimport moment from '../moment';\n\nfunction processRelativeTime(number, withoutSuffix, key, isFuture) {\n    var format = {\n        'm': ['eine Minute', 'einer Minute'],\n        'h': ['eine Stunde', 'einer Stunde'],\n        'd': ['ein Tag', 'einem Tag'],\n        'dd': [number + ' Tage', number + ' Tagen'],\n        'M': ['ein Monat', 'einem Monat'],\n        'MM': [number + ' Monate', number + ' Monaten'],\n        'y': ['ein Jahr', 'einem Jahr'],\n        'yy': [number + ' Jahre', number + ' Jahren']\n    };\n    return withoutSuffix ? format[key][0] : format[key][1];\n}\n\nexport default moment.defineLocale('de', {\n    months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n    monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n    weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n    weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n    weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n    longDateFormat : {\n        LT: 'HH:mm',\n        LTS: 'HH:mm:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Heute um] LT [Uhr]',\n        sameElse: 'L',\n        nextDay: '[Morgen um] LT [Uhr]',\n        nextWeek: 'dddd [um] LT [Uhr]',\n        lastDay: '[Gestern um] LT [Uhr]',\n        lastWeek: '[letzten] dddd [um] LT [Uhr]'\n    },\n    relativeTime : {\n        future : 'in %s',\n        past : 'vor %s',\n        s : 'ein paar Sekunden',\n        m : processRelativeTime,\n        mm : '%d Minuten',\n        h : processRelativeTime,\n        hh : '%d Stunden',\n        d : processRelativeTime,\n        dd : processRelativeTime,\n        M : processRelativeTime,\n        MM : processRelativeTime,\n        y : processRelativeTime,\n        yy : processRelativeTime\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/el.js",
    "content": "//! moment.js locale configuration\n//! locale : modern greek (el)\n//! author : Aggelos Karalias : https://github.com/mehiel\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('el', {\n    monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),\n    monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),\n    months : function (momentToFormat, format) {\n        if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'\n            return this._monthsGenitiveEl[momentToFormat.month()];\n        } else {\n            return this._monthsNominativeEl[momentToFormat.month()];\n        }\n    },\n    monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n    weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),\n    weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n    weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n    meridiem : function (hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'μμ' : 'ΜΜ';\n        } else {\n            return isLower ? 'πμ' : 'ΠΜ';\n        }\n    },\n    isPM : function (input) {\n        return ((input + '').toLowerCase()[0] === 'μ');\n    },\n    meridiemParse : /[ΠΜ]\\.?Μ?\\.?/i,\n    longDateFormat : {\n        LT : 'h:mm A',\n        LTS : 'h:mm:ss A',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendarEl : {\n        sameDay : '[Σήμερα {}] LT',\n        nextDay : '[Αύριο {}] LT',\n        nextWeek : 'dddd [{}] LT',\n        lastDay : '[Χθες {}] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n                case 6:\n                    return '[το προηγούμενο] dddd [{}] LT';\n                default:\n                    return '[την προηγούμενη] dddd [{}] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    calendar : function (key, mom) {\n        var output = this._calendarEl[key],\n            hours = mom && mom.hours();\n        if (typeof output === 'function') {\n            output = output.apply(mom);\n        }\n        return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));\n    },\n    relativeTime : {\n        future : 'σε %s',\n        past : '%s πριν',\n        s : 'λίγα δευτερόλεπτα',\n        m : 'ένα λεπτό',\n        mm : '%d λεπτά',\n        h : 'μία ώρα',\n        hh : '%d ώρες',\n        d : 'μία μέρα',\n        dd : '%d μέρες',\n        M : 'ένας μήνας',\n        MM : '%d μήνες',\n        y : 'ένας χρόνος',\n        yy : '%d χρόνια'\n    },\n    ordinalParse: /\\d{1,2}η/,\n    ordinal: '%dη',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/en-au.js",
    "content": "//! moment.js locale configuration\n//! locale : australian english (en-au)\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('en-au', {\n    months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n    monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n    weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n    weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n    weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'h:mm A',\n        LTS : 'h:mm:ss A',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Today at] LT',\n        nextDay : '[Tomorrow at] LT',\n        nextWeek : 'dddd [at] LT',\n        lastDay : '[Yesterday at] LT',\n        lastWeek : '[Last] dddd [at] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'in %s',\n        past : '%s ago',\n        s : 'a few seconds',\n        m : 'a minute',\n        mm : '%d minutes',\n        h : 'an hour',\n        hh : '%d hours',\n        d : 'a day',\n        dd : '%d days',\n        M : 'a month',\n        MM : '%d months',\n        y : 'a year',\n        yy : '%d years'\n    },\n    ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n    ordinal : function (number) {\n        var b = number % 10,\n            output = (~~(number % 100 / 10) === 1) ? 'th' :\n            (b === 1) ? 'st' :\n            (b === 2) ? 'nd' :\n            (b === 3) ? 'rd' : 'th';\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/en-ca.js",
    "content": "//! moment.js locale configuration\n//! locale : canadian english (en-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('en-ca', {\n    months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n    monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n    weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n    weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n    weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'h:mm A',\n        LTS : 'h:mm:ss A',\n        L : 'YYYY-MM-DD',\n        LL : 'D MMMM, YYYY',\n        LLL : 'D MMMM, YYYY LT',\n        LLLL : 'dddd, D MMMM, YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Today at] LT',\n        nextDay : '[Tomorrow at] LT',\n        nextWeek : 'dddd [at] LT',\n        lastDay : '[Yesterday at] LT',\n        lastWeek : '[Last] dddd [at] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'in %s',\n        past : '%s ago',\n        s : 'a few seconds',\n        m : 'a minute',\n        mm : '%d minutes',\n        h : 'an hour',\n        hh : '%d hours',\n        d : 'a day',\n        dd : '%d days',\n        M : 'a month',\n        MM : '%d months',\n        y : 'a year',\n        yy : '%d years'\n    },\n    ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n    ordinal : function (number) {\n        var b = number % 10,\n            output = (~~(number % 100 / 10) === 1) ? 'th' :\n            (b === 1) ? 'st' :\n            (b === 2) ? 'nd' :\n            (b === 3) ? 'rd' : 'th';\n        return number + output;\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/en-gb.js",
    "content": "//! moment.js locale configuration\n//! locale : great britain english (en-gb)\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('en-gb', {\n    months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n    monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n    weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n    weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n    weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'HH:mm:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Today at] LT',\n        nextDay : '[Tomorrow at] LT',\n        nextWeek : 'dddd [at] LT',\n        lastDay : '[Yesterday at] LT',\n        lastWeek : '[Last] dddd [at] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'in %s',\n        past : '%s ago',\n        s : 'a few seconds',\n        m : 'a minute',\n        mm : '%d minutes',\n        h : 'an hour',\n        hh : '%d hours',\n        d : 'a day',\n        dd : '%d days',\n        M : 'a month',\n        MM : '%d months',\n        y : 'a year',\n        yy : '%d years'\n    },\n    ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n    ordinal : function (number) {\n        var b = number % 10,\n            output = (~~(number % 100 / 10) === 1) ? 'th' :\n            (b === 1) ? 'st' :\n            (b === 2) ? 'nd' :\n            (b === 3) ? 'rd' : 'th';\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/eo.js",
    "content": "//! moment.js locale configuration\n//! locale : esperanto (eo)\n//! author : Colin Dean : https://github.com/colindean\n//! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.\n//!          Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('eo', {\n    months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),\n    weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),\n    weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),\n    weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY-MM-DD',\n        LL : 'D[-an de] MMMM, YYYY',\n        LLL : 'D[-an de] MMMM, YYYY LT',\n        LLLL : 'dddd, [la] D[-an de] MMMM, YYYY LT'\n    },\n    meridiemParse: /[ap]\\.t\\.m/i,\n    isPM: function (input) {\n        return input.charAt(0).toLowerCase() === 'p';\n    },\n    meridiem : function (hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'p.t.m.' : 'P.T.M.';\n        } else {\n            return isLower ? 'a.t.m.' : 'A.T.M.';\n        }\n    },\n    calendar : {\n        sameDay : '[Hodiaŭ je] LT',\n        nextDay : '[Morgaŭ je] LT',\n        nextWeek : 'dddd [je] LT',\n        lastDay : '[Hieraŭ je] LT',\n        lastWeek : '[pasinta] dddd [je] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'je %s',\n        past : 'antaŭ %s',\n        s : 'sekundoj',\n        m : 'minuto',\n        mm : '%d minutoj',\n        h : 'horo',\n        hh : '%d horoj',\n        d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo\n        dd : '%d tagoj',\n        M : 'monato',\n        MM : '%d monatoj',\n        y : 'jaro',\n        yy : '%d jaroj'\n    },\n    ordinalParse: /\\d{1,2}a/,\n    ordinal : '%da',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/es.js",
    "content": "//! moment.js locale configuration\n//! locale : spanish (es)\n//! author : Julio Napurí : https://github.com/julionc\n\nimport moment from '../moment';\n\nvar monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n    monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\nexport default moment.defineLocale('es', {\n    months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n    monthsShort : function (m, format) {\n        if (/-MMM-/.test(format)) {\n            return monthsShort[m.month()];\n        } else {\n            return monthsShortDot[m.month()];\n        }\n    },\n    weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n    weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n    weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D [de] MMMM [de] YYYY',\n        LLL : 'D [de] MMMM [de] YYYY LT',\n        LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n    },\n    calendar : {\n        sameDay : function () {\n            return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n        },\n        nextDay : function () {\n            return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n        },\n        nextWeek : function () {\n            return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n        },\n        lastDay : function () {\n            return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n        },\n        lastWeek : function () {\n            return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'en %s',\n        past : 'hace %s',\n        s : 'unos segundos',\n        m : 'un minuto',\n        mm : '%d minutos',\n        h : 'una hora',\n        hh : '%d horas',\n        d : 'un día',\n        dd : '%d días',\n        M : 'un mes',\n        MM : '%d meses',\n        y : 'un año',\n        yy : '%d años'\n    },\n    ordinalParse : /\\d{1,2}º/,\n    ordinal : '%dº',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/et.js",
    "content": "//! moment.js locale configuration\n//! locale : estonian (et)\n//! author : Henry Kehlmann : https://github.com/madhenry\n//! improvements : Illimar Tambek : https://github.com/ragulka\n\nimport moment from '../moment';\n\nfunction processRelativeTime(number, withoutSuffix, key, isFuture) {\n    var format = {\n        's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n        'm' : ['ühe minuti', 'üks minut'],\n        'mm': [number + ' minuti', number + ' minutit'],\n        'h' : ['ühe tunni', 'tund aega', 'üks tund'],\n        'hh': [number + ' tunni', number + ' tundi'],\n        'd' : ['ühe päeva', 'üks päev'],\n        'M' : ['kuu aja', 'kuu aega', 'üks kuu'],\n        'MM': [number + ' kuu', number + ' kuud'],\n        'y' : ['ühe aasta', 'aasta', 'üks aasta'],\n        'yy': [number + ' aasta', number + ' aastat']\n    };\n    if (withoutSuffix) {\n        return format[key][2] ? format[key][2] : format[key][1];\n    }\n    return isFuture ? format[key][0] : format[key][1];\n}\n\nexport default moment.defineLocale('et', {\n    months        : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n    monthsShort   : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n    weekdays      : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n    weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),\n    weekdaysMin   : 'P_E_T_K_N_R_L'.split('_'),\n    longDateFormat : {\n        LT   : 'H:mm',\n        LTS : 'LT:ss',\n        L    : 'DD.MM.YYYY',\n        LL   : 'D. MMMM YYYY',\n        LLL  : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay  : '[Täna,] LT',\n        nextDay  : '[Homme,] LT',\n        nextWeek : '[Järgmine] dddd LT',\n        lastDay  : '[Eile,] LT',\n        lastWeek : '[Eelmine] dddd LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s pärast',\n        past   : '%s tagasi',\n        s      : processRelativeTime,\n        m      : processRelativeTime,\n        mm     : processRelativeTime,\n        h      : processRelativeTime,\n        hh     : processRelativeTime,\n        d      : processRelativeTime,\n        dd     : '%d päeva',\n        M      : processRelativeTime,\n        MM     : processRelativeTime,\n        y      : processRelativeTime,\n        yy     : processRelativeTime\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/eu.js",
    "content": "//! moment.js locale configuration\n//! locale : euskara (eu)\n//! author : Eneko Illarramendi : https://github.com/eillarra\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('eu', {\n    months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),\n    monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),\n    weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),\n    weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),\n    weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY-MM-DD',\n        LL : 'YYYY[ko] MMMM[ren] D[a]',\n        LLL : 'YYYY[ko] MMMM[ren] D[a] LT',\n        LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] LT',\n        l : 'YYYY-M-D',\n        ll : 'YYYY[ko] MMM D[a]',\n        lll : 'YYYY[ko] MMM D[a] LT',\n        llll : 'ddd, YYYY[ko] MMM D[a] LT'\n    },\n    calendar : {\n        sameDay : '[gaur] LT[etan]',\n        nextDay : '[bihar] LT[etan]',\n        nextWeek : 'dddd LT[etan]',\n        lastDay : '[atzo] LT[etan]',\n        lastWeek : '[aurreko] dddd LT[etan]',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s barru',\n        past : 'duela %s',\n        s : 'segundo batzuk',\n        m : 'minutu bat',\n        mm : '%d minutu',\n        h : 'ordu bat',\n        hh : '%d ordu',\n        d : 'egun bat',\n        dd : '%d egun',\n        M : 'hilabete bat',\n        MM : '%d hilabete',\n        y : 'urte bat',\n        yy : '%d urte'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fa.js",
    "content": "//! moment.js locale configuration\n//! locale : Persian (fa)\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '۱',\n    '2': '۲',\n    '3': '۳',\n    '4': '۴',\n    '5': '۵',\n    '6': '۶',\n    '7': '۷',\n    '8': '۸',\n    '9': '۹',\n    '0': '۰'\n}, numberMap = {\n    '۱': '1',\n    '۲': '2',\n    '۳': '3',\n    '۴': '4',\n    '۵': '5',\n    '۶': '6',\n    '۷': '7',\n    '۸': '8',\n    '۹': '9',\n    '۰': '0'\n};\n\nexport default moment.defineLocale('fa', {\n    months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n    monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n    weekdays : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n    weekdaysShort : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n    weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    meridiemParse: /قبل از ظهر|بعد از ظهر/,\n    isPM: function (input) {\n        return /بعد از ظهر/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 12) {\n            return 'قبل از ظهر';\n        } else {\n            return 'بعد از ظهر';\n        }\n    },\n    calendar : {\n        sameDay : '[امروز ساعت] LT',\n        nextDay : '[فردا ساعت] LT',\n        nextWeek : 'dddd [ساعت] LT',\n        lastDay : '[دیروز ساعت] LT',\n        lastWeek : 'dddd [پیش] [ساعت] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'در %s',\n        past : '%s پیش',\n        s : 'چندین ثانیه',\n        m : 'یک دقیقه',\n        mm : '%d دقیقه',\n        h : 'یک ساعت',\n        hh : '%d ساعت',\n        d : 'یک روز',\n        dd : '%d روز',\n        M : 'یک ماه',\n        MM : '%d ماه',\n        y : 'یک سال',\n        yy : '%d سال'\n    },\n    preparse: function (string) {\n        return string.replace(/[۰-۹]/g, function (match) {\n            return numberMap[match];\n        }).replace(/،/g, ',');\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        }).replace(/,/g, '،');\n    },\n    ordinalParse: /\\d{1,2}م/,\n    ordinal : '%dم',\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12 // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fi.js",
    "content": "//! moment.js locale configuration\n//! locale : finnish (fi)\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\nimport moment from '../moment';\n\nvar numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n    numbersFuture = [\n        'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n        numbersPast[7], numbersPast[8], numbersPast[9]\n    ];\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var result = '';\n    switch (key) {\n    case 's':\n        return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n    case 'm':\n        return isFuture ? 'minuutin' : 'minuutti';\n    case 'mm':\n        result = isFuture ? 'minuutin' : 'minuuttia';\n        break;\n    case 'h':\n        return isFuture ? 'tunnin' : 'tunti';\n    case 'hh':\n        result = isFuture ? 'tunnin' : 'tuntia';\n        break;\n    case 'd':\n        return isFuture ? 'päivän' : 'päivä';\n    case 'dd':\n        result = isFuture ? 'päivän' : 'päivää';\n        break;\n    case 'M':\n        return isFuture ? 'kuukauden' : 'kuukausi';\n    case 'MM':\n        result = isFuture ? 'kuukauden' : 'kuukautta';\n        break;\n    case 'y':\n        return isFuture ? 'vuoden' : 'vuosi';\n    case 'yy':\n        result = isFuture ? 'vuoden' : 'vuotta';\n        break;\n    }\n    result = verbalNumber(number, isFuture) + ' ' + result;\n    return result;\n}\nfunction verbalNumber(number, isFuture) {\n    return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;\n}\n\nexport default moment.defineLocale('fi', {\n    months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n    monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n    weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n    weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),\n    weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),\n    longDateFormat : {\n        LT : 'HH.mm',\n        LTS : 'HH.mm.ss',\n        L : 'DD.MM.YYYY',\n        LL : 'Do MMMM[ta] YYYY',\n        LLL : 'Do MMMM[ta] YYYY, [klo] LT',\n        LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] LT',\n        l : 'D.M.YYYY',\n        ll : 'Do MMM YYYY',\n        lll : 'Do MMM YYYY, [klo] LT',\n        llll : 'ddd, Do MMM YYYY, [klo] LT'\n    },\n    calendar : {\n        sameDay : '[tänään] [klo] LT',\n        nextDay : '[huomenna] [klo] LT',\n        nextWeek : 'dddd [klo] LT',\n        lastDay : '[eilen] [klo] LT',\n        lastWeek : '[viime] dddd[na] [klo] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s päästä',\n        past : '%s sitten',\n        s : translate,\n        m : translate,\n        mm : translate,\n        h : translate,\n        hh : translate,\n        d : translate,\n        dd : translate,\n        M : translate,\n        MM : translate,\n        y : translate,\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fo.js",
    "content": "//! moment.js locale configuration\n//! locale : faroese (fo)\n//! author : Ragnar Johannesen : https://github.com/ragnar123\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('fo', {\n    months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n    weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),\n    weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n    weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D. MMMM, YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Í dag kl.] LT',\n        nextDay : '[Í morgin kl.] LT',\n        nextWeek : 'dddd [kl.] LT',\n        lastDay : '[Í gjár kl.] LT',\n        lastWeek : '[síðstu] dddd [kl] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'um %s',\n        past : '%s síðani',\n        s : 'fá sekund',\n        m : 'ein minutt',\n        mm : '%d minuttir',\n        h : 'ein tími',\n        hh : '%d tímar',\n        d : 'ein dagur',\n        dd : '%d dagar',\n        M : 'ein mánaði',\n        MM : '%d mánaðir',\n        y : 'eitt ár',\n        yy : '%d ár'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fr-ca.js",
    "content": "//! moment.js locale configuration\n//! locale : canadian french (fr-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('fr-ca', {\n    months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n    monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n    weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n    weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n    weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY-MM-DD',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Aujourd\\'hui à] LT',\n        nextDay: '[Demain à] LT',\n        nextWeek: 'dddd [à] LT',\n        lastDay: '[Hier à] LT',\n        lastWeek: 'dddd [dernier à] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'dans %s',\n        past : 'il y a %s',\n        s : 'quelques secondes',\n        m : 'une minute',\n        mm : '%d minutes',\n        h : 'une heure',\n        hh : '%d heures',\n        d : 'un jour',\n        dd : '%d jours',\n        M : 'un mois',\n        MM : '%d mois',\n        y : 'un an',\n        yy : '%d ans'\n    },\n    ordinalParse: /\\d{1,2}(er|)/,\n    ordinal : function (number) {\n        return number + (number === 1 ? 'er' : '');\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fr.js",
    "content": "//! moment.js locale configuration\n//! locale : french (fr)\n//! author : John Fischer : https://github.com/jfroffice\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('fr', {\n    months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n    monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n    weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n    weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n    weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Aujourd\\'hui à] LT',\n        nextDay: '[Demain à] LT',\n        nextWeek: 'dddd [à] LT',\n        lastDay: '[Hier à] LT',\n        lastWeek: 'dddd [dernier à] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'dans %s',\n        past : 'il y a %s',\n        s : 'quelques secondes',\n        m : 'une minute',\n        mm : '%d minutes',\n        h : 'une heure',\n        hh : '%d heures',\n        d : 'un jour',\n        dd : '%d jours',\n        M : 'un mois',\n        MM : '%d mois',\n        y : 'un an',\n        yy : '%d ans'\n    },\n    ordinalParse: /\\d{1,2}(er|)/,\n    ordinal : function (number) {\n        return number + (number === 1 ? 'er' : '');\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/fy.js",
    "content": "//! moment.js locale configuration\n//! locale : frisian (fy)\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\nimport moment from '../moment';\n\nvar monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n    monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\nexport default moment.defineLocale('fy', {\n    months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),\n    monthsShort : function (m, format) {\n        if (/-MMM-/.test(format)) {\n            return monthsShortWithoutDots[m.month()];\n        } else {\n            return monthsShortWithDots[m.month()];\n        }\n    },\n    weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),\n    weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),\n    weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD-MM-YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[hjoed om] LT',\n        nextDay: '[moarn om] LT',\n        nextWeek: 'dddd [om] LT',\n        lastDay: '[juster om] LT',\n        lastWeek: '[ôfrûne] dddd [om] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'oer %s',\n        past : '%s lyn',\n        s : 'in pear sekonden',\n        m : 'ien minút',\n        mm : '%d minuten',\n        h : 'ien oere',\n        hh : '%d oeren',\n        d : 'ien dei',\n        dd : '%d dagen',\n        M : 'ien moanne',\n        MM : '%d moannen',\n        y : 'ien jier',\n        yy : '%d jierren'\n    },\n    ordinalParse: /\\d{1,2}(ste|de)/,\n    ordinal : function (number) {\n        return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/gl.js",
    "content": "//! moment.js locale configuration\n//! locale : galician (gl)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('gl', {\n    months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),\n    monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),\n    weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),\n    weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),\n    weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : function () {\n            return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n        },\n        nextDay : function () {\n            return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n        },\n        nextWeek : function () {\n            return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n        },\n        lastDay : function () {\n            return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';\n        },\n        lastWeek : function () {\n            return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : function (str) {\n            if (str === 'uns segundos') {\n                return 'nuns segundos';\n            }\n            return 'en ' + str;\n        },\n        past : 'hai %s',\n        s : 'uns segundos',\n        m : 'un minuto',\n        mm : '%d minutos',\n        h : 'unha hora',\n        hh : '%d horas',\n        d : 'un día',\n        dd : '%d días',\n        M : 'un mes',\n        MM : '%d meses',\n        y : 'un ano',\n        yy : '%d anos'\n    },\n    ordinalParse : /\\d{1,2}º/,\n    ordinal : '%dº',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/he.js",
    "content": "//! moment.js locale configuration\n//! locale : Hebrew (he)\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('he', {\n    months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),\n    monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n    weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n    weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n    weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D [ב]MMMM YYYY',\n        LLL : 'D [ב]MMMM YYYY LT',\n        LLLL : 'dddd, D [ב]MMMM YYYY LT',\n        l : 'D/M/YYYY',\n        ll : 'D MMM YYYY',\n        lll : 'D MMM YYYY LT',\n        llll : 'ddd, D MMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[היום ב־]LT',\n        nextDay : '[מחר ב־]LT',\n        nextWeek : 'dddd [בשעה] LT',\n        lastDay : '[אתמול ב־]LT',\n        lastWeek : '[ביום] dddd [האחרון בשעה] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'בעוד %s',\n        past : 'לפני %s',\n        s : 'מספר שניות',\n        m : 'דקה',\n        mm : '%d דקות',\n        h : 'שעה',\n        hh : function (number) {\n            if (number === 2) {\n                return 'שעתיים';\n            }\n            return number + ' שעות';\n        },\n        d : 'יום',\n        dd : function (number) {\n            if (number === 2) {\n                return 'יומיים';\n            }\n            return number + ' ימים';\n        },\n        M : 'חודש',\n        MM : function (number) {\n            if (number === 2) {\n                return 'חודשיים';\n            }\n            return number + ' חודשים';\n        },\n        y : 'שנה',\n        yy : function (number) {\n            if (number === 2) {\n                return 'שנתיים';\n            } else if (number % 10 === 0 && number !== 10) {\n                return number + ' שנה';\n            }\n            return number + ' שנים';\n        }\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/hi.js",
    "content": "//! moment.js locale configuration\n//! locale : hindi (hi)\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '१',\n    '2': '२',\n    '3': '३',\n    '4': '४',\n    '5': '५',\n    '6': '६',\n    '7': '७',\n    '8': '८',\n    '9': '९',\n    '0': '०'\n},\nnumberMap = {\n    '१': '1',\n    '२': '2',\n    '३': '3',\n    '४': '4',\n    '५': '5',\n    '६': '6',\n    '७': '7',\n    '८': '8',\n    '९': '9',\n    '०': '0'\n};\n\nexport default moment.defineLocale('hi', {\n    months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),\n    monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n    weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n    weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n    weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n    longDateFormat : {\n        LT : 'A h:mm बजे',\n        LTS : 'A h:mm:ss बजे',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[आज] LT',\n        nextDay : '[कल] LT',\n        nextWeek : 'dddd, LT',\n        lastDay : '[कल] LT',\n        lastWeek : '[पिछले] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s में',\n        past : '%s पहले',\n        s : 'कुछ ही क्षण',\n        m : 'एक मिनट',\n        mm : '%d मिनट',\n        h : 'एक घंटा',\n        hh : '%d घंटे',\n        d : 'एक दिन',\n        dd : '%d दिन',\n        M : 'एक महीने',\n        MM : '%d महीने',\n        y : 'एक वर्ष',\n        yy : '%d वर्ष'\n    },\n    preparse: function (string) {\n        return string.replace(/[१२३४५६७८९०]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n    // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n    meridiemParse: /रात|सुबह|दोपहर|शाम/,\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'रात') {\n            return hour < 4 ? hour : hour + 12;\n        } else if (meridiem === 'सुबह') {\n            return hour;\n        } else if (meridiem === 'दोपहर') {\n            return hour >= 10 ? hour : hour + 12;\n        } else if (meridiem === 'शाम') {\n            return hour + 12;\n        }\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'रात';\n        } else if (hour < 10) {\n            return 'सुबह';\n        } else if (hour < 17) {\n            return 'दोपहर';\n        } else if (hour < 20) {\n            return 'शाम';\n        } else {\n            return 'रात';\n        }\n    },\n    week : {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/hr.js",
    "content": "//! moment.js locale configuration\n//! locale : hrvatski (hr)\n//! author : Bojan Marković : https://github.com/bmarkovic\n\nimport moment from '../moment';\n\nfunction translate(number, withoutSuffix, key) {\n    var result = number + ' ';\n    switch (key) {\n    case 'm':\n        return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n    case 'mm':\n        if (number === 1) {\n            result += 'minuta';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'minute';\n        } else {\n            result += 'minuta';\n        }\n        return result;\n    case 'h':\n        return withoutSuffix ? 'jedan sat' : 'jednog sata';\n    case 'hh':\n        if (number === 1) {\n            result += 'sat';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'sata';\n        } else {\n            result += 'sati';\n        }\n        return result;\n    case 'dd':\n        if (number === 1) {\n            result += 'dan';\n        } else {\n            result += 'dana';\n        }\n        return result;\n    case 'MM':\n        if (number === 1) {\n            result += 'mjesec';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'mjeseca';\n        } else {\n            result += 'mjeseci';\n        }\n        return result;\n    case 'yy':\n        if (number === 1) {\n            result += 'godina';\n        } else if (number === 2 || number === 3 || number === 4) {\n            result += 'godine';\n        } else {\n            result += 'godina';\n        }\n        return result;\n    }\n}\n\nexport default moment.defineLocale('hr', {\n    months : 'sječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),\n    monthsShort : 'sje._vel._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),\n    weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n    weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n    weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD. MM. YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay  : '[danas u] LT',\n        nextDay  : '[sutra u] LT',\n        nextWeek : function () {\n            switch (this.day()) {\n            case 0:\n                return '[u] [nedjelju] [u] LT';\n            case 3:\n                return '[u] [srijedu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        },\n        lastDay  : '[jučer u] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n                return '[prošlu] dddd [u] LT';\n            case 6:\n                return '[prošle] [subote] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prošli] dddd [u] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past   : 'prije %s',\n        s      : 'par sekundi',\n        m      : translate,\n        mm     : translate,\n        h      : translate,\n        hh     : translate,\n        d      : 'dan',\n        dd     : translate,\n        M      : 'mjesec',\n        MM     : translate,\n        y      : 'godinu',\n        yy     : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/hu.js",
    "content": "//! moment.js locale configuration\n//! locale : hungarian (hu)\n//! author : Adam Brunner : https://github.com/adambrunner\n\nimport moment from '../moment';\n\nvar weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var num = number,\n        suffix;\n    switch (key) {\n    case 's':\n        return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n    case 'm':\n        return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n    case 'mm':\n        return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n    case 'h':\n        return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n    case 'hh':\n        return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n    case 'd':\n        return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n    case 'dd':\n        return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n    case 'M':\n        return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n    case 'MM':\n        return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n    case 'y':\n        return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n    case 'yy':\n        return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n    }\n    return '';\n}\nfunction week(isFuture) {\n    return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';\n}\n\nexport default moment.defineLocale('hu', {\n    months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n    monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n    weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n    weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n    weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY.MM.DD.',\n        LL : 'YYYY. MMMM D.',\n        LLL : 'YYYY. MMMM D., LT',\n        LLLL : 'YYYY. MMMM D., dddd LT'\n    },\n    meridiemParse: /de|du/i,\n    isPM: function (input) {\n        return input.charAt(1).toLowerCase() === 'u';\n    },\n    meridiem : function (hours, minutes, isLower) {\n        if (hours < 12) {\n            return isLower === true ? 'de' : 'DE';\n        } else {\n            return isLower === true ? 'du' : 'DU';\n        }\n    },\n    calendar : {\n        sameDay : '[ma] LT[-kor]',\n        nextDay : '[holnap] LT[-kor]',\n        nextWeek : function () {\n            return week.call(this, true);\n        },\n        lastDay : '[tegnap] LT[-kor]',\n        lastWeek : function () {\n            return week.call(this, false);\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s múlva',\n        past : '%s',\n        s : translate,\n        m : translate,\n        mm : translate,\n        h : translate,\n        hh : translate,\n        d : translate,\n        dd : translate,\n        M : translate,\n        MM : translate,\n        y : translate,\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/hy-am.js",
    "content": "//! moment.js locale configuration\n//! locale : Armenian (hy-am)\n//! author : Armendarabyan : https://github.com/armendarabyan\n\nimport moment from '../moment';\n\nfunction monthsCaseReplace(m, format) {\n    var months = {\n        'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),\n        'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')\n    },\n    nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return months[nounCase][m.month()];\n}\nfunction monthsShortCaseReplace(m, format) {\n    var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');\n    return monthsShort[m.month()];\n}\nfunction weekdaysCaseReplace(m, format) {\n    var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');\n    return weekdays[m.day()];\n}\n\nexport default moment.defineLocale('hy-am', {\n    months : monthsCaseReplace,\n    monthsShort : monthsShortCaseReplace,\n    weekdays : weekdaysCaseReplace,\n    weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n    weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY թ.',\n        LLL : 'D MMMM YYYY թ., LT',\n        LLLL : 'dddd, D MMMM YYYY թ., LT'\n    },\n    calendar : {\n        sameDay: '[այսօր] LT',\n        nextDay: '[վաղը] LT',\n        lastDay: '[երեկ] LT',\n        nextWeek: function () {\n            return 'dddd [օրը ժամը] LT';\n        },\n        lastWeek: function () {\n            return '[անցած] dddd [օրը ժամը] LT';\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : '%s հետո',\n        past : '%s առաջ',\n        s : 'մի քանի վայրկյան',\n        m : 'րոպե',\n        mm : '%d րոպե',\n        h : 'ժամ',\n        hh : '%d ժամ',\n        d : 'օր',\n        dd : '%d օր',\n        M : 'ամիս',\n        MM : '%d ամիս',\n        y : 'տարի',\n        yy : '%d տարի'\n    },\n    meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n    isPM: function (input) {\n        return /^(ցերեկվա|երեկոյան)$/.test(input);\n    },\n    meridiem : function (hour) {\n        if (hour < 4) {\n            return 'գիշերվա';\n        } else if (hour < 12) {\n            return 'առավոտվա';\n        } else if (hour < 17) {\n            return 'ցերեկվա';\n        } else {\n            return 'երեկոյան';\n        }\n    },\n    ordinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n    ordinal: function (number, period) {\n        switch (period) {\n        case 'DDD':\n        case 'w':\n        case 'W':\n        case 'DDDo':\n            if (number === 1) {\n                return number + '-ին';\n            }\n            return number + '-րդ';\n        default:\n            return number;\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/id.js",
    "content": "//! moment.js locale configuration\n//! locale : Bahasa Indonesia (id)\n//! author : Mohammad Satrio Utomo : https://github.com/tyok\n//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('id', {\n    months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n    monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n    weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n    weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n    weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n    longDateFormat : {\n        LT : 'HH.mm',\n        LTS : 'LT.ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY [pukul] LT',\n        LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n    },\n    meridiemParse: /pagi|siang|sore|malam/,\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'pagi') {\n            return hour;\n        } else if (meridiem === 'siang') {\n            return hour >= 11 ? hour : hour + 12;\n        } else if (meridiem === 'sore' || meridiem === 'malam') {\n            return hour + 12;\n        }\n    },\n    meridiem : function (hours, minutes, isLower) {\n        if (hours < 11) {\n            return 'pagi';\n        } else if (hours < 15) {\n            return 'siang';\n        } else if (hours < 19) {\n            return 'sore';\n        } else {\n            return 'malam';\n        }\n    },\n    calendar : {\n        sameDay : '[Hari ini pukul] LT',\n        nextDay : '[Besok pukul] LT',\n        nextWeek : 'dddd [pukul] LT',\n        lastDay : '[Kemarin pukul] LT',\n        lastWeek : 'dddd [lalu pukul] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'dalam %s',\n        past : '%s yang lalu',\n        s : 'beberapa detik',\n        m : 'semenit',\n        mm : '%d menit',\n        h : 'sejam',\n        hh : '%d jam',\n        d : 'sehari',\n        dd : '%d hari',\n        M : 'sebulan',\n        MM : '%d bulan',\n        y : 'setahun',\n        yy : '%d tahun'\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/is.js",
    "content": "//! moment.js locale configuration\n//! locale : icelandic (is)\n//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\nimport moment from '../moment';\n\nfunction plural(n) {\n    if (n % 100 === 11) {\n        return true;\n    } else if (n % 10 === 1) {\n        return false;\n    }\n    return true;\n}\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var result = number + ' ';\n    switch (key) {\n    case 's':\n        return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';\n    case 'm':\n        return withoutSuffix ? 'mínúta' : 'mínútu';\n    case 'mm':\n        if (plural(number)) {\n            return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');\n        } else if (withoutSuffix) {\n            return result + 'mínúta';\n        }\n        return result + 'mínútu';\n    case 'hh':\n        if (plural(number)) {\n            return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');\n        }\n        return result + 'klukkustund';\n    case 'd':\n        if (withoutSuffix) {\n            return 'dagur';\n        }\n        return isFuture ? 'dag' : 'degi';\n    case 'dd':\n        if (plural(number)) {\n            if (withoutSuffix) {\n                return result + 'dagar';\n            }\n            return result + (isFuture ? 'daga' : 'dögum');\n        } else if (withoutSuffix) {\n            return result + 'dagur';\n        }\n        return result + (isFuture ? 'dag' : 'degi');\n    case 'M':\n        if (withoutSuffix) {\n            return 'mánuður';\n        }\n        return isFuture ? 'mánuð' : 'mánuði';\n    case 'MM':\n        if (plural(number)) {\n            if (withoutSuffix) {\n                return result + 'mánuðir';\n            }\n            return result + (isFuture ? 'mánuði' : 'mánuðum');\n        } else if (withoutSuffix) {\n            return result + 'mánuður';\n        }\n        return result + (isFuture ? 'mánuð' : 'mánuði');\n    case 'y':\n        return withoutSuffix || isFuture ? 'ár' : 'ári';\n    case 'yy':\n        if (plural(number)) {\n            return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n        }\n        return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n    }\n}\n\nexport default moment.defineLocale('is', {\n    months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n    weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),\n    weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n    weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY [kl.] LT',\n        LLLL : 'dddd, D. MMMM YYYY [kl.] LT'\n    },\n    calendar : {\n        sameDay : '[í dag kl.] LT',\n        nextDay : '[á morgun kl.] LT',\n        nextWeek : 'dddd [kl.] LT',\n        lastDay : '[í gær kl.] LT',\n        lastWeek : '[síðasta] dddd [kl.] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'eftir %s',\n        past : 'fyrir %s síðan',\n        s : translate,\n        m : translate,\n        mm : translate,\n        h : 'klukkustund',\n        hh : translate,\n        d : translate,\n        dd : translate,\n        M : translate,\n        MM : translate,\n        y : translate,\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/it.js",
    "content": "//! moment.js locale configuration\n//! locale : italian (it)\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('it', {\n    months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n    monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n    weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),\n    weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),\n    weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Oggi alle] LT',\n        nextDay: '[Domani alle] LT',\n        nextWeek: 'dddd [alle] LT',\n        lastDay: '[Ieri alle] LT',\n        lastWeek: function () {\n            switch (this.day()) {\n                case 0:\n                    return '[la scorsa] dddd [alle] LT';\n                default:\n                    return '[lo scorso] dddd [alle] LT';\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : function (s) {\n            return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n        },\n        past : '%s fa',\n        s : 'alcuni secondi',\n        m : 'un minuto',\n        mm : '%d minuti',\n        h : 'un\\'ora',\n        hh : '%d ore',\n        d : 'un giorno',\n        dd : '%d giorni',\n        M : 'un mese',\n        MM : '%d mesi',\n        y : 'un anno',\n        yy : '%d anni'\n    },\n    ordinalParse : /\\d{1,2}º/,\n    ordinal: '%dº',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ja.js",
    "content": "//! moment.js locale configuration\n//! locale : japanese (ja)\n//! author : LI Long : https://github.com/baryon\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ja', {\n    months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n    monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n    weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n    weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n    weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n    longDateFormat : {\n        LT : 'Ah時m分',\n        LTS : 'LTs秒',\n        L : 'YYYY/MM/DD',\n        LL : 'YYYY年M月D日',\n        LLL : 'YYYY年M月D日LT',\n        LLLL : 'YYYY年M月D日LT dddd'\n    },\n    meridiemParse: /午前|午後/i,\n    isPM : function (input) {\n        return input === '午後';\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 12) {\n            return '午前';\n        } else {\n            return '午後';\n        }\n    },\n    calendar : {\n        sameDay : '[今日] LT',\n        nextDay : '[明日] LT',\n        nextWeek : '[来週]dddd LT',\n        lastDay : '[昨日] LT',\n        lastWeek : '[前週]dddd LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s後',\n        past : '%s前',\n        s : '数秒',\n        m : '1分',\n        mm : '%d分',\n        h : '1時間',\n        hh : '%d時間',\n        d : '1日',\n        dd : '%d日',\n        M : '1ヶ月',\n        MM : '%dヶ月',\n        y : '1年',\n        yy : '%d年'\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ka.js",
    "content": "//! moment.js locale configuration\n//! locale : Georgian (ka)\n//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n\nimport moment from '../moment';\n\nfunction monthsCaseReplace(m, format) {\n    var months = {\n        'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n        'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n    },\n    nounCase = (/D[oD] *MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return months[nounCase][m.month()];\n}\nfunction weekdaysCaseReplace(m, format) {\n    var weekdays = {\n        'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),\n        'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_')\n    },\n    nounCase = (/(წინა|შემდეგ)/).test(format) ?\n        'accusative' :\n        'nominative';\n    return weekdays[nounCase][m.day()];\n}\n\nexport default moment.defineLocale('ka', {\n    months : monthsCaseReplace,\n    monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n    weekdays : weekdaysCaseReplace,\n    weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n    weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n    longDateFormat : {\n        LT : 'h:mm A',\n        LTS : 'h:mm:ss A',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[დღეს] LT[-ზე]',\n        nextDay : '[ხვალ] LT[-ზე]',\n        lastDay : '[გუშინ] LT[-ზე]',\n        nextWeek : '[შემდეგ] dddd LT[-ზე]',\n        lastWeek : '[წინა] dddd LT-ზე',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : function (s) {\n            return (/(წამი|წუთი|საათი|წელი)/).test(s) ?\n                s.replace(/ი$/, 'ში') :\n                s + 'ში';\n        },\n        past : function (s) {\n            if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {\n                return s.replace(/(ი|ე)$/, 'ის წინ');\n            }\n            if ((/წელი/).test(s)) {\n                return s.replace(/წელი$/, 'წლის წინ');\n            }\n        },\n        s : 'რამდენიმე წამი',\n        m : 'წუთი',\n        mm : '%d წუთი',\n        h : 'საათი',\n        hh : '%d საათი',\n        d : 'დღე',\n        dd : '%d დღე',\n        M : 'თვე',\n        MM : '%d თვე',\n        y : 'წელი',\n        yy : '%d წელი'\n    },\n    ordinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n    ordinal : function (number) {\n        if (number === 0) {\n            return number;\n        }\n        if (number === 1) {\n            return number + '-ლი';\n        }\n        if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {\n            return 'მე-' + number;\n        }\n        return number + '-ე';\n    },\n    week : {\n        dow : 1,\n        doy : 7\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/km.js",
    "content": "//! moment.js locale configuration\n//! locale : khmer (km)\n//! author : Kruy Vanna : https://github.com/kruyvanna\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('km', {\n    months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n    monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n    weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n    weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n    weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n    longDateFormat: {\n        LT: 'HH:mm',\n        LTS : 'LT:ss',\n        L: 'DD/MM/YYYY',\n        LL: 'D MMMM YYYY',\n        LLL: 'D MMMM YYYY LT',\n        LLLL: 'dddd, D MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[ថ្ងៃនៈ ម៉ោង] LT',\n        nextDay: '[ស្អែក ម៉ោង] LT',\n        nextWeek: 'dddd [ម៉ោង] LT',\n        lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n        lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n        sameElse: 'L'\n    },\n    relativeTime: {\n        future: '%sទៀត',\n        past: '%sមុន',\n        s: 'ប៉ុន្មានវិនាទី',\n        m: 'មួយនាទី',\n        mm: '%d នាទី',\n        h: 'មួយម៉ោង',\n        hh: '%d ម៉ោង',\n        d: 'មួយថ្ងៃ',\n        dd: '%d ថ្ងៃ',\n        M: 'មួយខែ',\n        MM: '%d ខែ',\n        y: 'មួយឆ្នាំ',\n        yy: '%d ឆ្នាំ'\n    },\n    week: {\n        dow: 1, // Monday is the first day of the week.\n        doy: 4 // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ko.js",
    "content": "//! moment.js locale configuration\n//! locale : korean (ko)\n//!\n//! authors\n//!\n//! - Kyungwook, Park : https://github.com/kyungw00k\n//! - Jeeeyul Lee <jeeeyul@gmail.com>\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ko', {\n    months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n    monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n    weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n    weekdaysShort : '일_월_화_수_목_금_토'.split('_'),\n    weekdaysMin : '일_월_화_수_목_금_토'.split('_'),\n    longDateFormat : {\n        LT : 'A h시 m분',\n        LTS : 'A h시 m분 s초',\n        L : 'YYYY.MM.DD',\n        LL : 'YYYY년 MMMM D일',\n        LLL : 'YYYY년 MMMM D일 LT',\n        LLLL : 'YYYY년 MMMM D일 dddd LT'\n    },\n    calendar : {\n        sameDay : '오늘 LT',\n        nextDay : '내일 LT',\n        nextWeek : 'dddd LT',\n        lastDay : '어제 LT',\n        lastWeek : '지난주 dddd LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s 후',\n        past : '%s 전',\n        s : '몇초',\n        ss : '%d초',\n        m : '일분',\n        mm : '%d분',\n        h : '한시간',\n        hh : '%d시간',\n        d : '하루',\n        dd : '%d일',\n        M : '한달',\n        MM : '%d달',\n        y : '일년',\n        yy : '%d년'\n    },\n    ordinalParse : /\\d{1,2}일/,\n    ordinal : '%d일',\n    meridiemParse : /오전|오후/,\n    isPM : function (token) {\n        return token === '오후';\n    },\n    meridiem : function (hour, minute, isUpper) {\n        return hour < 12 ? '오전' : '오후';\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/lb.js",
    "content": "//! moment.js locale configuration\n//! locale : Luxembourgish (lb)\n//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz\n\nimport moment from '../moment';\n\nfunction processRelativeTime(number, withoutSuffix, key, isFuture) {\n    var format = {\n        'm': ['eng Minutt', 'enger Minutt'],\n        'h': ['eng Stonn', 'enger Stonn'],\n        'd': ['een Dag', 'engem Dag'],\n        'M': ['ee Mount', 'engem Mount'],\n        'y': ['ee Joer', 'engem Joer']\n    };\n    return withoutSuffix ? format[key][0] : format[key][1];\n}\nfunction processFutureTime(string) {\n    var number = string.substr(0, string.indexOf(' '));\n    if (eifelerRegelAppliesToNumber(number)) {\n        return 'a ' + string;\n    }\n    return 'an ' + string;\n}\nfunction processPastTime(string) {\n    var number = string.substr(0, string.indexOf(' '));\n    if (eifelerRegelAppliesToNumber(number)) {\n        return 'viru ' + string;\n    }\n    return 'virun ' + string;\n}\n/**\n * Returns true if the word before the given number loses the '-n' ending.\n * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n *\n * @param number {integer}\n * @returns {boolean}\n */\nfunction eifelerRegelAppliesToNumber(number) {\n    number = parseInt(number, 10);\n    if (isNaN(number)) {\n        return false;\n    }\n    if (number < 0) {\n        // Negative Number --> always true\n        return true;\n    } else if (number < 10) {\n        // Only 1 digit\n        if (4 <= number && number <= 7) {\n            return true;\n        }\n        return false;\n    } else if (number < 100) {\n        // 2 digits\n        var lastDigit = number % 10, firstDigit = number / 10;\n        if (lastDigit === 0) {\n            return eifelerRegelAppliesToNumber(firstDigit);\n        }\n        return eifelerRegelAppliesToNumber(lastDigit);\n    } else if (number < 10000) {\n        // 3 or 4 digits --> recursively check first digit\n        while (number >= 10) {\n            number = number / 10;\n        }\n        return eifelerRegelAppliesToNumber(number);\n    } else {\n        // Anything larger than 4 digits: recursively check first n-3 digits\n        number = number / 1000;\n        return eifelerRegelAppliesToNumber(number);\n    }\n}\n\nexport default moment.defineLocale('lb', {\n    months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n    monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n    weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),\n    weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n    weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n    longDateFormat: {\n        LT: 'H:mm [Auer]',\n        LTS: 'H:mm:ss [Auer]',\n        L: 'DD.MM.YYYY',\n        LL: 'D. MMMM YYYY',\n        LLL: 'D. MMMM YYYY LT',\n        LLLL: 'dddd, D. MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[Haut um] LT',\n        sameElse: 'L',\n        nextDay: '[Muer um] LT',\n        nextWeek: 'dddd [um] LT',\n        lastDay: '[Gëschter um] LT',\n        lastWeek: function () {\n            // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n            switch (this.day()) {\n                case 2:\n                case 4:\n                    return '[Leschten] dddd [um] LT';\n                default:\n                    return '[Leschte] dddd [um] LT';\n            }\n        }\n    },\n    relativeTime : {\n        future : processFutureTime,\n        past : processPastTime,\n        s : 'e puer Sekonnen',\n        m : processRelativeTime,\n        mm : '%d Minutten',\n        h : processRelativeTime,\n        hh : '%d Stonnen',\n        d : processRelativeTime,\n        dd : '%d Deeg',\n        M : processRelativeTime,\n        MM : '%d Méint',\n        y : processRelativeTime,\n        yy : '%d Joer'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal: '%d.',\n    week: {\n        dow: 1, // Monday is the first day of the week.\n        doy: 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/lt.js",
    "content": "//! moment.js locale configuration\n//! locale : Lithuanian (lt)\n//! author : Mindaugas Mozūras : https://github.com/mmozuras\n\nimport moment from '../moment';\n\nvar units = {\n    'm' : 'minutė_minutės_minutę',\n    'mm': 'minutės_minučių_minutes',\n    'h' : 'valanda_valandos_valandą',\n    'hh': 'valandos_valandų_valandas',\n    'd' : 'diena_dienos_dieną',\n    'dd': 'dienos_dienų_dienas',\n    'M' : 'mėnuo_mėnesio_mėnesį',\n    'MM': 'mėnesiai_mėnesių_mėnesius',\n    'y' : 'metai_metų_metus',\n    'yy': 'metai_metų_metus'\n},\nweekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');\nfunction translateSeconds(number, withoutSuffix, key, isFuture) {\n    if (withoutSuffix) {\n        return 'kelios sekundės';\n    } else {\n        return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n    }\n}\nfunction translateSingular(number, withoutSuffix, key, isFuture) {\n    return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n}\nfunction special(number) {\n    return number % 10 === 0 || (number > 10 && number < 20);\n}\nfunction forms(key) {\n    return units[key].split('_');\n}\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var result = number + ' ';\n    if (number === 1) {\n        return result + translateSingular(number, withoutSuffix, key[0], isFuture);\n    } else if (withoutSuffix) {\n        return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n    } else {\n        if (isFuture) {\n            return result + forms(key)[1];\n        } else {\n            return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n        }\n    }\n}\nfunction relativeWeekDay(moment, format) {\n    var nominative = format.indexOf('dddd HH:mm') === -1,\n        weekDay = weekDays[moment.day()];\n    return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';\n}\n\nexport default moment.defineLocale('lt', {\n    months : 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),\n    monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n    weekdays : relativeWeekDay,\n    weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n    weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY-MM-DD',\n        LL : 'YYYY [m.] MMMM D [d.]',\n        LLL : 'YYYY [m.] MMMM D [d.], LT [val.]',\n        LLLL : 'YYYY [m.] MMMM D [d.], dddd, LT [val.]',\n        l : 'YYYY-MM-DD',\n        ll : 'YYYY [m.] MMMM D [d.]',\n        lll : 'YYYY [m.] MMMM D [d.], LT [val.]',\n        llll : 'YYYY [m.] MMMM D [d.], ddd, LT [val.]'\n    },\n    calendar : {\n        sameDay : '[Šiandien] LT',\n        nextDay : '[Rytoj] LT',\n        nextWeek : 'dddd LT',\n        lastDay : '[Vakar] LT',\n        lastWeek : '[Praėjusį] dddd LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'po %s',\n        past : 'prieš %s',\n        s : translateSeconds,\n        m : translateSingular,\n        mm : translate,\n        h : translateSingular,\n        hh : translate,\n        d : translateSingular,\n        dd : translate,\n        M : translateSingular,\n        MM : translate,\n        y : translateSingular,\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}-oji/,\n    ordinal : function (number) {\n        return number + '-oji';\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/lv.js",
    "content": "//! moment.js locale configuration\n//! locale : latvian (lv)\n//! author : Kristaps Karlsons : https://github.com/skakri\n\nimport moment from '../moment';\n\nvar units = {\n    'mm': 'minūti_minūtes_minūte_minūtes',\n    'hh': 'stundu_stundas_stunda_stundas',\n    'dd': 'dienu_dienas_diena_dienas',\n    'MM': 'mēnesi_mēnešus_mēnesis_mēneši',\n    'yy': 'gadu_gadus_gads_gadi'\n};\nfunction format(word, number, withoutSuffix) {\n    var forms = word.split('_');\n    if (withoutSuffix) {\n        return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];\n    } else {\n        return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];\n    }\n}\nfunction relativeTimeWithPlural(number, withoutSuffix, key) {\n    return number + ' ' + format(units[key], number, withoutSuffix);\n}\n\nexport default moment.defineLocale('lv', {\n    months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n    weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),\n    weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),\n    weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'YYYY. [gada] D. MMMM',\n        LLL : 'YYYY. [gada] D. MMMM, LT',\n        LLLL : 'YYYY. [gada] D. MMMM, dddd, LT'\n    },\n    calendar : {\n        sameDay : '[Šodien pulksten] LT',\n        nextDay : '[Rīt pulksten] LT',\n        nextWeek : 'dddd [pulksten] LT',\n        lastDay : '[Vakar pulksten] LT',\n        lastWeek : '[Pagājušā] dddd [pulksten] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s vēlāk',\n        past : '%s agrāk',\n        s : 'dažas sekundes',\n        m : 'minūti',\n        mm : relativeTimeWithPlural,\n        h : 'stundu',\n        hh : relativeTimeWithPlural,\n        d : 'dienu',\n        dd : relativeTimeWithPlural,\n        M : 'mēnesi',\n        MM : relativeTimeWithPlural,\n        y : 'gadu',\n        yy : relativeTimeWithPlural\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/mk.js",
    "content": "//! moment.js locale configuration\n//! locale : macedonian (mk)\n//! author : Borislav Mickov : https://github.com/B0k0\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('mk', {\n    months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),\n    monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n    weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),\n    weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n    weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'D.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Денес во] LT',\n        nextDay : '[Утре во] LT',\n        nextWeek : 'dddd [во] LT',\n        lastDay : '[Вчера во] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[Во изминатата] dddd [во] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[Во изминатиот] dddd [во] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'после %s',\n        past : 'пред %s',\n        s : 'неколку секунди',\n        m : 'минута',\n        mm : '%d минути',\n        h : 'час',\n        hh : '%d часа',\n        d : 'ден',\n        dd : '%d дена',\n        M : 'месец',\n        MM : '%d месеци',\n        y : 'година',\n        yy : '%d години'\n    },\n    ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n    ordinal : function (number) {\n        var lastDigit = number % 10,\n            last2Digits = number % 100;\n        if (number === 0) {\n            return number + '-ев';\n        } else if (last2Digits === 0) {\n            return number + '-ен';\n        } else if (last2Digits > 10 && last2Digits < 20) {\n            return number + '-ти';\n        } else if (lastDigit === 1) {\n            return number + '-ви';\n        } else if (lastDigit === 2) {\n            return number + '-ри';\n        } else if (lastDigit === 7 || lastDigit === 8) {\n            return number + '-ми';\n        } else {\n            return number + '-ти';\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ml.js",
    "content": "//! moment.js locale configuration\n//! locale : malayalam (ml)\n//! author : Floyd Pink : https://github.com/floydpink\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ml', {\n    months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),\n    monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),\n    weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),\n    weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n    weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n    longDateFormat : {\n        LT : 'A h:mm -നു',\n        LTS : 'A h:mm:ss -നു',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[ഇന്ന്] LT',\n        nextDay : '[നാളെ] LT',\n        nextWeek : 'dddd, LT',\n        lastDay : '[ഇന്നലെ] LT',\n        lastWeek : '[കഴിഞ്ഞ] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s കഴിഞ്ഞ്',\n        past : '%s മുൻപ്',\n        s : 'അൽപ നിമിഷങ്ങൾ',\n        m : 'ഒരു മിനിറ്റ്',\n        mm : '%d മിനിറ്റ്',\n        h : 'ഒരു മണിക്കൂർ',\n        hh : '%d മണിക്കൂർ',\n        d : 'ഒരു ദിവസം',\n        dd : '%d ദിവസം',\n        M : 'ഒരു മാസം',\n        MM : '%d മാസം',\n        y : 'ഒരു വർഷം',\n        yy : '%d വർഷം'\n    },\n    meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n    isPM : function (input) {\n        return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'രാത്രി';\n        } else if (hour < 12) {\n            return 'രാവിലെ';\n        } else if (hour < 17) {\n            return 'ഉച്ച കഴിഞ്ഞ്';\n        } else if (hour < 20) {\n            return 'വൈകുന്നേരം';\n        } else {\n            return 'രാത്രി';\n        }\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/mr.js",
    "content": "//! moment.js locale configuration\n//! locale : Marathi (mr)\n//! author : Harshad Kale : https://github.com/kalehv\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '१',\n    '2': '२',\n    '3': '३',\n    '4': '४',\n    '5': '५',\n    '6': '६',\n    '7': '७',\n    '8': '८',\n    '9': '९',\n    '0': '०'\n},\nnumberMap = {\n    '१': '1',\n    '२': '2',\n    '३': '3',\n    '४': '4',\n    '५': '5',\n    '६': '6',\n    '७': '7',\n    '८': '8',\n    '९': '9',\n    '०': '0'\n};\n\nexport default moment.defineLocale('mr', {\n    months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),\n    monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),\n    weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n    weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n    weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n    longDateFormat : {\n        LT : 'A h:mm वाजता',\n        LTS : 'A h:mm:ss वाजता',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[आज] LT',\n        nextDay : '[उद्या] LT',\n        nextWeek : 'dddd, LT',\n        lastDay : '[काल] LT',\n        lastWeek: '[मागील] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s नंतर',\n        past : '%s पूर्वी',\n        s : 'सेकंद',\n        m: 'एक मिनिट',\n        mm: '%d मिनिटे',\n        h : 'एक तास',\n        hh : '%d तास',\n        d : 'एक दिवस',\n        dd : '%d दिवस',\n        M : 'एक महिना',\n        MM : '%d महिने',\n        y : 'एक वर्ष',\n        yy : '%d वर्षे'\n    },\n    preparse: function (string) {\n        return string.replace(/[१२३४५६७८९०]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'रात्री') {\n            return hour < 4 ? hour : hour + 12;\n        } else if (meridiem === 'सकाळी') {\n            return hour;\n        } else if (meridiem === 'दुपारी') {\n            return hour >= 10 ? hour : hour + 12;\n        } else if (meridiem === 'सायंकाळी') {\n            return hour + 12;\n        }\n    },\n    meridiem: function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'रात्री';\n        } else if (hour < 10) {\n            return 'सकाळी';\n        } else if (hour < 17) {\n            return 'दुपारी';\n        } else if (hour < 20) {\n            return 'सायंकाळी';\n        } else {\n            return 'रात्री';\n        }\n    },\n    week : {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ms-my.js",
    "content": "//! moment.js locale configuration\n//! locale : Bahasa Malaysia (ms-MY)\n//! author : Weldan Jamili : https://github.com/weldan\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ms-my', {\n    months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n    monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n    weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n    weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n    weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n    longDateFormat : {\n        LT : 'HH.mm',\n        LTS : 'LT.ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY [pukul] LT',\n        LLLL : 'dddd, D MMMM YYYY [pukul] LT'\n    },\n    meridiemParse: /pagi|tengahari|petang|malam/,\n    meridiemHour: function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'pagi') {\n            return hour;\n        } else if (meridiem === 'tengahari') {\n            return hour >= 11 ? hour : hour + 12;\n        } else if (meridiem === 'petang' || meridiem === 'malam') {\n            return hour + 12;\n        }\n    },\n    meridiem : function (hours, minutes, isLower) {\n        if (hours < 11) {\n            return 'pagi';\n        } else if (hours < 15) {\n            return 'tengahari';\n        } else if (hours < 19) {\n            return 'petang';\n        } else {\n            return 'malam';\n        }\n    },\n    calendar : {\n        sameDay : '[Hari ini pukul] LT',\n        nextDay : '[Esok pukul] LT',\n        nextWeek : 'dddd [pukul] LT',\n        lastDay : '[Kelmarin pukul] LT',\n        lastWeek : 'dddd [lepas pukul] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'dalam %s',\n        past : '%s yang lepas',\n        s : 'beberapa saat',\n        m : 'seminit',\n        mm : '%d minit',\n        h : 'sejam',\n        hh : '%d jam',\n        d : 'sehari',\n        dd : '%d hari',\n        M : 'sebulan',\n        MM : '%d bulan',\n        y : 'setahun',\n        yy : '%d tahun'\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/my.js",
    "content": "//! moment.js locale configuration\n//! locale : Burmese (my)\n//! author : Squar team, mysquar.com\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '၁',\n    '2': '၂',\n    '3': '၃',\n    '4': '၄',\n    '5': '၅',\n    '6': '၆',\n    '7': '၇',\n    '8': '၈',\n    '9': '၉',\n    '0': '၀'\n}, numberMap = {\n    '၁': '1',\n    '၂': '2',\n    '၃': '3',\n    '၄': '4',\n    '၅': '5',\n    '၆': '6',\n    '၇': '7',\n    '၈': '8',\n    '၉': '9',\n    '၀': '0'\n};\n\nexport default moment.defineLocale('my', {\n    months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),\n    monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n    weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),\n    weekdaysShort: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n    weekdaysMin: 'နွေ_လာ_င်္ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n    longDateFormat: {\n        LT: 'HH:mm',\n        LTS: 'HH:mm:ss',\n        L: 'DD/MM/YYYY',\n        LL: 'D MMMM YYYY',\n        LLL: 'D MMMM YYYY LT',\n        LLLL: 'dddd D MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[ယနေ.] LT [မှာ]',\n        nextDay: '[မနက်ဖြန်] LT [မှာ]',\n        nextWeek: 'dddd LT [မှာ]',\n        lastDay: '[မနေ.က] LT [မှာ]',\n        lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n        sameElse: 'L'\n    },\n    relativeTime: {\n        future: 'လာမည့် %s မှာ',\n        past: 'လွန်ခဲ့သော %s က',\n        s: 'စက္ကန်.အနည်းငယ်',\n        m: 'တစ်မိနစ်',\n        mm: '%d မိနစ်',\n        h: 'တစ်နာရီ',\n        hh: '%d နာရီ',\n        d: 'တစ်ရက်',\n        dd: '%d ရက်',\n        M: 'တစ်လ',\n        MM: '%d လ',\n        y: 'တစ်နှစ်',\n        yy: '%d နှစ်'\n    },\n    preparse: function (string) {\n        return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    week: {\n        dow: 1, // Monday is the first day of the week.\n        doy: 4 // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/nb.js",
    "content": "//! moment.js locale configuration\n//! locale : norwegian bokmål (nb)\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//!           Sigurd Gartmann : https://github.com/sigurdga\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('nb', {\n    months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n    weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n    weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'),\n    weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n    longDateFormat : {\n        LT : 'H.mm',\n        LTS : 'LT.ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY [kl.] LT',\n        LLLL : 'dddd D. MMMM YYYY [kl.] LT'\n    },\n    calendar : {\n        sameDay: '[i dag kl.] LT',\n        nextDay: '[i morgen kl.] LT',\n        nextWeek: 'dddd [kl.] LT',\n        lastDay: '[i går kl.] LT',\n        lastWeek: '[forrige] dddd [kl.] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'om %s',\n        past : 'for %s siden',\n        s : 'noen sekunder',\n        m : 'ett minutt',\n        mm : '%d minutter',\n        h : 'en time',\n        hh : '%d timer',\n        d : 'en dag',\n        dd : '%d dager',\n        M : 'en måned',\n        MM : '%d måneder',\n        y : 'ett år',\n        yy : '%d år'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ne.js",
    "content": "//! moment.js locale configuration\n//! locale : nepali/nepalese\n//! author : suvash : https://github.com/suvash\n\nimport moment from '../moment';\n\nvar symbolMap = {\n    '1': '१',\n    '2': '२',\n    '3': '३',\n    '4': '४',\n    '5': '५',\n    '6': '६',\n    '7': '७',\n    '8': '८',\n    '9': '९',\n    '0': '०'\n},\nnumberMap = {\n    '१': '1',\n    '२': '2',\n    '३': '3',\n    '४': '4',\n    '५': '5',\n    '६': '6',\n    '७': '7',\n    '८': '8',\n    '९': '9',\n    '०': '0'\n};\n\nexport default moment.defineLocale('ne', {\n    months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),\n    monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),\n    weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),\n    weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n    weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'),\n    longDateFormat : {\n        LT : 'Aको h:mm बजे',\n        LTS : 'Aको h:mm:ss बजे',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    preparse: function (string) {\n        return string.replace(/[१२३४५६७८९०]/g, function (match) {\n            return numberMap[match];\n        });\n    },\n    postformat: function (string) {\n        return string.replace(/\\d/g, function (match) {\n            return symbolMap[match];\n        });\n    },\n    meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'राती') {\n            return hour < 3 ? hour : hour + 12;\n        } else if (meridiem === 'बिहान') {\n            return hour;\n        } else if (meridiem === 'दिउँसो') {\n            return hour >= 10 ? hour : hour + 12;\n        } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {\n            return hour + 12;\n        }\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 3) {\n            return 'राती';\n        } else if (hour < 10) {\n            return 'बिहान';\n        } else if (hour < 15) {\n            return 'दिउँसो';\n        } else if (hour < 18) {\n            return 'बेलुका';\n        } else if (hour < 20) {\n            return 'साँझ';\n        } else {\n            return 'राती';\n        }\n    },\n    calendar : {\n        sameDay : '[आज] LT',\n        nextDay : '[भोली] LT',\n        nextWeek : '[आउँदो] dddd[,] LT',\n        lastDay : '[हिजो] LT',\n        lastWeek : '[गएको] dddd[,] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%sमा',\n        past : '%s अगाडी',\n        s : 'केही समय',\n        m : 'एक मिनेट',\n        mm : '%d मिनेट',\n        h : 'एक घण्टा',\n        hh : '%d घण्टा',\n        d : 'एक दिन',\n        dd : '%d दिन',\n        M : 'एक महिना',\n        MM : '%d महिना',\n        y : 'एक बर्ष',\n        yy : '%d बर्ष'\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/nl.js",
    "content": "//! moment.js locale configuration\n//! locale : dutch (nl)\n//! author : Joris Röling : https://github.com/jjupiter\n\nimport moment from '../moment';\n\nvar monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n    monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\nexport default moment.defineLocale('nl', {\n    months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n    monthsShort : function (m, format) {\n        if (/-MMM-/.test(format)) {\n            return monthsShortWithoutDots[m.month()];\n        } else {\n            return monthsShortWithDots[m.month()];\n        }\n    },\n    weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n    weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n    weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD-MM-YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[vandaag om] LT',\n        nextDay: '[morgen om] LT',\n        nextWeek: 'dddd [om] LT',\n        lastDay: '[gisteren om] LT',\n        lastWeek: '[afgelopen] dddd [om] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'over %s',\n        past : '%s geleden',\n        s : 'een paar seconden',\n        m : 'één minuut',\n        mm : '%d minuten',\n        h : 'één uur',\n        hh : '%d uur',\n        d : 'één dag',\n        dd : '%d dagen',\n        M : 'één maand',\n        MM : '%d maanden',\n        y : 'één jaar',\n        yy : '%d jaar'\n    },\n    ordinalParse: /\\d{1,2}(ste|de)/,\n    ordinal : function (number) {\n        return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/nn.js",
    "content": "//! moment.js locale configuration\n//! locale : norwegian nynorsk (nn)\n//! author : https://github.com/mechuwind\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('nn', {\n    months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n    weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n    weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),\n    weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[I dag klokka] LT',\n        nextDay: '[I morgon klokka] LT',\n        nextWeek: 'dddd [klokka] LT',\n        lastDay: '[I går klokka] LT',\n        lastWeek: '[Føregåande] dddd [klokka] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'om %s',\n        past : 'for %s sidan',\n        s : 'nokre sekund',\n        m : 'eit minutt',\n        mm : '%d minutt',\n        h : 'ein time',\n        hh : '%d timar',\n        d : 'ein dag',\n        dd : '%d dagar',\n        M : 'ein månad',\n        MM : '%d månader',\n        y : 'eit år',\n        yy : '%d år'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/pl.js",
    "content": "//! moment.js locale configuration\n//! locale : polish (pl)\n//! author : Rafal Hirsz : https://github.com/evoL\n\nimport moment from '../moment';\n\nvar monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),\n    monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');\nfunction plural(n) {\n    return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);\n}\nfunction translate(number, withoutSuffix, key) {\n    var result = number + ' ';\n    switch (key) {\n    case 'm':\n        return withoutSuffix ? 'minuta' : 'minutę';\n    case 'mm':\n        return result + (plural(number) ? 'minuty' : 'minut');\n    case 'h':\n        return withoutSuffix  ? 'godzina'  : 'godzinę';\n    case 'hh':\n        return result + (plural(number) ? 'godziny' : 'godzin');\n    case 'MM':\n        return result + (plural(number) ? 'miesiące' : 'miesięcy');\n    case 'yy':\n        return result + (plural(number) ? 'lata' : 'lat');\n    }\n}\n\nexport default moment.defineLocale('pl', {\n    months : function (momentToFormat, format) {\n        if (/D MMMM/.test(format)) {\n            return monthsSubjective[momentToFormat.month()];\n        } else {\n            return monthsNominative[momentToFormat.month()];\n        }\n    },\n    monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n    weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n    weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),\n    weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Dziś o] LT',\n        nextDay: '[Jutro o] LT',\n        nextWeek: '[W] dddd [o] LT',\n        lastDay: '[Wczoraj o] LT',\n        lastWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[W zeszłą niedzielę o] LT';\n            case 3:\n                return '[W zeszłą środę o] LT';\n            case 6:\n                return '[W zeszłą sobotę o] LT';\n            default:\n                return '[W zeszły] dddd [o] LT';\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past : '%s temu',\n        s : 'kilka sekund',\n        m : translate,\n        mm : translate,\n        h : translate,\n        hh : translate,\n        d : '1 dzień',\n        dd : '%d dni',\n        M : 'miesiąc',\n        MM : translate,\n        y : 'rok',\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/pt-br.js",
    "content": "//! moment.js locale configuration\n//! locale : brazilian portuguese (pt-br)\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('pt-br', {\n    months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n    monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n    weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n    weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n    weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D [de] MMMM [de] YYYY',\n        LLL : 'D [de] MMMM [de] YYYY [às] LT',\n        LLLL : 'dddd, D [de] MMMM [de] YYYY [às] LT'\n    },\n    calendar : {\n        sameDay: '[Hoje às] LT',\n        nextDay: '[Amanhã às] LT',\n        nextWeek: 'dddd [às] LT',\n        lastDay: '[Ontem às] LT',\n        lastWeek: function () {\n            return (this.day() === 0 || this.day() === 6) ?\n                '[Último] dddd [às] LT' : // Saturday + Sunday\n                '[Última] dddd [às] LT'; // Monday - Friday\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'em %s',\n        past : '%s atrás',\n        s : 'segundos',\n        m : 'um minuto',\n        mm : '%d minutos',\n        h : 'uma hora',\n        hh : '%d horas',\n        d : 'um dia',\n        dd : '%d dias',\n        M : 'um mês',\n        MM : '%d meses',\n        y : 'um ano',\n        yy : '%d anos'\n    },\n    ordinalParse: /\\d{1,2}º/,\n    ordinal : '%dº'\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/pt.js",
    "content": "//! moment.js locale configuration\n//! locale : portuguese (pt)\n//! author : Jefferson : https://github.com/jalex79\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('pt', {\n    months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),\n    monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n    weekdays : 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'),\n    weekdaysShort : 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n    weekdaysMin : 'dom_2ª_3ª_4ª_5ª_6ª_sáb'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D [de] MMMM [de] YYYY',\n        LLL : 'D [de] MMMM [de] YYYY LT',\n        LLLL : 'dddd, D [de] MMMM [de] YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Hoje às] LT',\n        nextDay: '[Amanhã às] LT',\n        nextWeek: 'dddd [às] LT',\n        lastDay: '[Ontem às] LT',\n        lastWeek: function () {\n            return (this.day() === 0 || this.day() === 6) ?\n                '[Último] dddd [às] LT' : // Saturday + Sunday\n                '[Última] dddd [às] LT'; // Monday - Friday\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'em %s',\n        past : 'há %s',\n        s : 'segundos',\n        m : 'um minuto',\n        mm : '%d minutos',\n        h : 'uma hora',\n        hh : '%d horas',\n        d : 'um dia',\n        dd : '%d dias',\n        M : 'um mês',\n        MM : '%d meses',\n        y : 'um ano',\n        yy : '%d anos'\n    },\n    ordinalParse: /\\d{1,2}º/,\n    ordinal : '%dº',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ro.js",
    "content": "//! moment.js locale configuration\n//! locale : romanian (ro)\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n\nimport moment from '../moment';\n\nfunction relativeTimeWithPlural(number, withoutSuffix, key) {\n    var format = {\n            'mm': 'minute',\n            'hh': 'ore',\n            'dd': 'zile',\n            'MM': 'luni',\n            'yy': 'ani'\n        },\n        separator = ' ';\n    if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n        separator = ' de ';\n    }\n    return number + separator + format[key];\n}\n\nexport default moment.defineLocale('ro', {\n    months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n    monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n    weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n    weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n    weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY H:mm',\n        LLLL : 'dddd, D MMMM YYYY H:mm'\n    },\n    calendar : {\n        sameDay: '[azi la] LT',\n        nextDay: '[mâine la] LT',\n        nextWeek: 'dddd [la] LT',\n        lastDay: '[ieri la] LT',\n        lastWeek: '[fosta] dddd [la] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'peste %s',\n        past : '%s în urmă',\n        s : 'câteva secunde',\n        m : 'un minut',\n        mm : relativeTimeWithPlural,\n        h : 'o oră',\n        hh : relativeTimeWithPlural,\n        d : 'o zi',\n        dd : relativeTimeWithPlural,\n        M : 'o lună',\n        MM : relativeTimeWithPlural,\n        y : 'un an',\n        yy : relativeTimeWithPlural\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ru.js",
    "content": "//! moment.js locale configuration\n//! locale : russian (ru)\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n\nimport moment from '../moment';\n\nfunction plural(word, num) {\n    var forms = word.split('_');\n    return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n}\nfunction relativeTimeWithPlural(number, withoutSuffix, key) {\n    var format = {\n        'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n        'hh': 'час_часа_часов',\n        'dd': 'день_дня_дней',\n        'MM': 'месяц_месяца_месяцев',\n        'yy': 'год_года_лет'\n    };\n    if (key === 'm') {\n        return withoutSuffix ? 'минута' : 'минуту';\n    }\n    else {\n        return number + ' ' + plural(format[key], +number);\n    }\n}\nfunction monthsCaseReplace(m, format) {\n    var months = {\n        'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n        'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')\n    },\n    nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return months[nounCase][m.month()];\n}\nfunction monthsShortCaseReplace(m, format) {\n    var monthsShort = {\n        'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n        'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')\n    },\n    nounCase = (/D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return monthsShort[nounCase][m.month()];\n}\nfunction weekdaysCaseReplace(m, format) {\n    var weekdays = {\n        'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n        'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')\n    },\n    nounCase = (/\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/).test(format) ?\n        'accusative' :\n        'nominative';\n    return weekdays[nounCase][m.day()];\n}\n\nexport default moment.defineLocale('ru', {\n    months : monthsCaseReplace,\n    monthsShort : monthsShortCaseReplace,\n    weekdays : weekdaysCaseReplace,\n    weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n    weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n    monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY г.',\n        LLL : 'D MMMM YYYY г., LT',\n        LLLL : 'dddd, D MMMM YYYY г., LT'\n    },\n    calendar : {\n        sameDay: '[Сегодня в] LT',\n        nextDay: '[Завтра в] LT',\n        lastDay: '[Вчера в] LT',\n        nextWeek: function () {\n            return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';\n        },\n        lastWeek: function (now) {\n            if (now.week() !== this.week()) {\n                switch (this.day()) {\n                case 0:\n                    return '[В прошлое] dddd [в] LT';\n                case 1:\n                case 2:\n                case 4:\n                    return '[В прошлый] dddd [в] LT';\n                case 3:\n                case 5:\n                case 6:\n                    return '[В прошлую] dddd [в] LT';\n                }\n            } else {\n                if (this.day() === 2) {\n                    return '[Во] dddd [в] LT';\n                } else {\n                    return '[В] dddd [в] LT';\n                }\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'через %s',\n        past : '%s назад',\n        s : 'несколько секунд',\n        m : relativeTimeWithPlural,\n        mm : relativeTimeWithPlural,\n        h : 'час',\n        hh : relativeTimeWithPlural,\n        d : 'день',\n        dd : relativeTimeWithPlural,\n        M : 'месяц',\n        MM : relativeTimeWithPlural,\n        y : 'год',\n        yy : relativeTimeWithPlural\n    },\n    meridiemParse: /ночи|утра|дня|вечера/i,\n    isPM : function (input) {\n        return /^(дня|вечера)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'ночи';\n        } else if (hour < 12) {\n            return 'утра';\n        } else if (hour < 17) {\n            return 'дня';\n        } else {\n            return 'вечера';\n        }\n    },\n    ordinalParse: /\\d{1,2}-(й|го|я)/,\n    ordinal: function (number, period) {\n        switch (period) {\n        case 'M':\n        case 'd':\n        case 'DDD':\n            return number + '-й';\n        case 'D':\n            return number + '-го';\n        case 'w':\n        case 'W':\n            return number + '-я';\n        default:\n            return number;\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sk.js",
    "content": "//! moment.js locale configuration\n//! locale : slovak (sk)\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\nimport moment from '../moment';\n\nvar months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),\n    monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\nfunction plural(n) {\n    return (n > 1) && (n < 5);\n}\nfunction translate(number, withoutSuffix, key, isFuture) {\n    var result = number + ' ';\n    switch (key) {\n    case 's':  // a few seconds / in a few seconds / a few seconds ago\n        return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n    case 'm':  // a minute / in a minute / a minute ago\n        return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n    case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'minúty' : 'minút');\n        } else {\n            return result + 'minútami';\n        }\n        break;\n    case 'h':  // an hour / in an hour / an hour ago\n        return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n    case 'hh': // 9 hours / in 9 hours / 9 hours ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'hodiny' : 'hodín');\n        } else {\n            return result + 'hodinami';\n        }\n        break;\n    case 'd':  // a day / in a day / a day ago\n        return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n    case 'dd': // 9 days / in 9 days / 9 days ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'dni' : 'dní');\n        } else {\n            return result + 'dňami';\n        }\n        break;\n    case 'M':  // a month / in a month / a month ago\n        return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n    case 'MM': // 9 months / in 9 months / 9 months ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'mesiace' : 'mesiacov');\n        } else {\n            return result + 'mesiacmi';\n        }\n        break;\n    case 'y':  // a year / in a year / a year ago\n        return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n    case 'yy': // 9 years / in 9 years / 9 years ago\n        if (withoutSuffix || isFuture) {\n            return result + (plural(number) ? 'roky' : 'rokov');\n        } else {\n            return result + 'rokmi';\n        }\n        break;\n    }\n}\n\nexport default moment.defineLocale('sk', {\n    months : months,\n    monthsShort : monthsShort,\n    monthsParse : (function (months, monthsShort) {\n        var i, _monthsParse = [];\n        for (i = 0; i < 12; i++) {\n            // use custom parser to solve problem with July (červenec)\n            _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n        }\n        return _monthsParse;\n    }(months, monthsShort)),\n    weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n    weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),\n    weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),\n    longDateFormat : {\n        LT: 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[dnes o] LT',\n        nextDay: '[zajtra o] LT',\n        nextWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[v nedeľu o] LT';\n            case 1:\n            case 2:\n                return '[v] dddd [o] LT';\n            case 3:\n                return '[v stredu o] LT';\n            case 4:\n                return '[vo štvrtok o] LT';\n            case 5:\n                return '[v piatok o] LT';\n            case 6:\n                return '[v sobotu o] LT';\n            }\n        },\n        lastDay: '[včera o] LT',\n        lastWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[minulú nedeľu o] LT';\n            case 1:\n            case 2:\n                return '[minulý] dddd [o] LT';\n            case 3:\n                return '[minulú stredu o] LT';\n            case 4:\n            case 5:\n                return '[minulý] dddd [o] LT';\n            case 6:\n                return '[minulú sobotu o] LT';\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past : 'pred %s',\n        s : translate,\n        m : translate,\n        mm : translate,\n        h : translate,\n        hh : translate,\n        d : translate,\n        dd : translate,\n        M : translate,\n        MM : translate,\n        y : translate,\n        yy : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sl.js",
    "content": "//! moment.js locale configuration\n//! locale : slovenian (sl)\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\nimport moment from '../moment';\n\nfunction translate(number, withoutSuffix, key) {\n    var result = number + ' ';\n    switch (key) {\n    case 'm':\n        return withoutSuffix ? 'ena minuta' : 'eno minuto';\n    case 'mm':\n        if (number === 1) {\n            result += 'minuta';\n        } else if (number === 2) {\n            result += 'minuti';\n        } else if (number === 3 || number === 4) {\n            result += 'minute';\n        } else {\n            result += 'minut';\n        }\n        return result;\n    case 'h':\n        return withoutSuffix ? 'ena ura' : 'eno uro';\n    case 'hh':\n        if (number === 1) {\n            result += 'ura';\n        } else if (number === 2) {\n            result += 'uri';\n        } else if (number === 3 || number === 4) {\n            result += 'ure';\n        } else {\n            result += 'ur';\n        }\n        return result;\n    case 'dd':\n        if (number === 1) {\n            result += 'dan';\n        } else {\n            result += 'dni';\n        }\n        return result;\n    case 'MM':\n        if (number === 1) {\n            result += 'mesec';\n        } else if (number === 2) {\n            result += 'meseca';\n        } else if (number === 3 || number === 4) {\n            result += 'mesece';\n        } else {\n            result += 'mesecev';\n        }\n        return result;\n    case 'yy':\n        if (number === 1) {\n            result += 'leto';\n        } else if (number === 2) {\n            result += 'leti';\n        } else if (number === 3 || number === 4) {\n            result += 'leta';\n        } else {\n            result += 'let';\n        }\n        return result;\n    }\n}\n\nexport default moment.defineLocale('sl', {\n    months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n    monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n    weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n    weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n    weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),\n    longDateFormat : {\n        LT : 'H:mm',\n        LTS : 'LT:ss',\n        L : 'DD. MM. YYYY',\n        LL : 'D. MMMM YYYY',\n        LLL : 'D. MMMM YYYY LT',\n        LLLL : 'dddd, D. MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay  : '[danes ob] LT',\n        nextDay  : '[jutri ob] LT',\n        nextWeek : function () {\n            switch (this.day()) {\n            case 0:\n                return '[v] [nedeljo] [ob] LT';\n            case 3:\n                return '[v] [sredo] [ob] LT';\n            case 6:\n                return '[v] [soboto] [ob] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[v] dddd [ob] LT';\n            }\n        },\n        lastDay  : '[včeraj ob] LT',\n        lastWeek : function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n            case 6:\n                return '[prejšnja] dddd [ob] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[prejšnji] dddd [ob] LT';\n            }\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'čez %s',\n        past   : '%s nazaj',\n        s      : 'nekaj sekund',\n        m      : translate,\n        mm     : translate,\n        h      : translate,\n        hh     : translate,\n        d      : 'en dan',\n        dd     : translate,\n        M      : 'en mesec',\n        MM     : translate,\n        y      : 'eno leto',\n        yy     : translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sq.js",
    "content": "//! moment.js locale configuration\n//! locale : Albanian (sq)\n//! author : Flakërim Ismani : https://github.com/flakerimi\n//! author: Menelion Elensúle: https://github.com/Oire (tests)\n//! author : Oerd Cukalla : https://github.com/oerd (fixes)\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('sq', {\n    months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n    monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n    weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n    weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n    weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),\n    meridiemParse: /PD|MD/,\n    isPM: function (input) {\n        return input.charAt(0) === 'M';\n    },\n    meridiem : function (hours, minutes, isLower) {\n        return hours < 12 ? 'PD' : 'MD';\n    },\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[Sot në] LT',\n        nextDay : '[Nesër në] LT',\n        nextWeek : 'dddd [në] LT',\n        lastDay : '[Dje në] LT',\n        lastWeek : 'dddd [e kaluar në] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'në %s',\n        past : '%s më parë',\n        s : 'disa sekonda',\n        m : 'një minutë',\n        mm : '%d minuta',\n        h : 'një orë',\n        hh : '%d orë',\n        d : 'një ditë',\n        dd : '%d ditë',\n        M : 'një muaj',\n        MM : '%d muaj',\n        y : 'një vit',\n        yy : '%d vite'\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sr-cyrl.js",
    "content": "//! moment.js locale configuration\n//! locale : Serbian-cyrillic (sr-cyrl)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\nimport moment from '../moment';\n\nvar translator = {\n    words: { //Different grammatical cases\n        m: ['један минут', 'једне минуте'],\n        mm: ['минут', 'минуте', 'минута'],\n        h: ['један сат', 'једног сата'],\n        hh: ['сат', 'сата', 'сати'],\n        dd: ['дан', 'дана', 'дана'],\n        MM: ['месец', 'месеца', 'месеци'],\n        yy: ['година', 'године', 'година']\n    },\n    correctGrammaticalCase: function (number, wordKey) {\n        return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n    },\n    translate: function (number, withoutSuffix, key) {\n        var wordKey = translator.words[key];\n        if (key.length === 1) {\n            return withoutSuffix ? wordKey[0] : wordKey[1];\n        } else {\n            return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n        }\n    }\n};\n\nexport default moment.defineLocale('sr-cyrl', {\n    months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],\n    monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],\n    weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],\n    weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],\n    weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],\n    longDateFormat: {\n        LT: 'H:mm',\n        LTS : 'LT:ss',\n        L: 'DD. MM. YYYY',\n        LL: 'D. MMMM YYYY',\n        LLL: 'D. MMMM YYYY LT',\n        LLLL: 'dddd, D. MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[данас у] LT',\n        nextDay: '[сутра у] LT',\n        nextWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[у] [недељу] [у] LT';\n            case 3:\n                return '[у] [среду] [у] LT';\n            case 6:\n                return '[у] [суботу] [у] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[у] dddd [у] LT';\n            }\n        },\n        lastDay  : '[јуче у] LT',\n        lastWeek : function () {\n            var lastWeekDays = [\n                '[прошле] [недеље] [у] LT',\n                '[прошлог] [понедељка] [у] LT',\n                '[прошлог] [уторка] [у] LT',\n                '[прошле] [среде] [у] LT',\n                '[прошлог] [четвртка] [у] LT',\n                '[прошлог] [петка] [у] LT',\n                '[прошле] [суботе] [у] LT'\n            ];\n            return lastWeekDays[this.day()];\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'за %s',\n        past   : 'пре %s',\n        s      : 'неколико секунди',\n        m      : translator.translate,\n        mm     : translator.translate,\n        h      : translator.translate,\n        hh     : translator.translate,\n        d      : 'дан',\n        dd     : translator.translate,\n        M      : 'месец',\n        MM     : translator.translate,\n        y      : 'годину',\n        yy     : translator.translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sr.js",
    "content": "//! moment.js locale configuration\n//! locale : Serbian-latin (sr)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\nimport moment from '../moment';\n\nvar translator = {\n    words: { //Different grammatical cases\n        m: ['jedan minut', 'jedne minute'],\n        mm: ['minut', 'minute', 'minuta'],\n        h: ['jedan sat', 'jednog sata'],\n        hh: ['sat', 'sata', 'sati'],\n        dd: ['dan', 'dana', 'dana'],\n        MM: ['mesec', 'meseca', 'meseci'],\n        yy: ['godina', 'godine', 'godina']\n    },\n    correctGrammaticalCase: function (number, wordKey) {\n        return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n    },\n    translate: function (number, withoutSuffix, key) {\n        var wordKey = translator.words[key];\n        if (key.length === 1) {\n            return withoutSuffix ? wordKey[0] : wordKey[1];\n        } else {\n            return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n        }\n    }\n};\n\nexport default moment.defineLocale('sr', {\n    months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],\n    monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],\n    weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],\n    weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],\n    weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],\n    longDateFormat: {\n        LT: 'H:mm',\n        LTS : 'LT:ss',\n        L: 'DD. MM. YYYY',\n        LL: 'D. MMMM YYYY',\n        LLL: 'D. MMMM YYYY LT',\n        LLLL: 'dddd, D. MMMM YYYY LT'\n    },\n    calendar: {\n        sameDay: '[danas u] LT',\n        nextDay: '[sutra u] LT',\n        nextWeek: function () {\n            switch (this.day()) {\n            case 0:\n                return '[u] [nedelju] [u] LT';\n            case 3:\n                return '[u] [sredu] [u] LT';\n            case 6:\n                return '[u] [subotu] [u] LT';\n            case 1:\n            case 2:\n            case 4:\n            case 5:\n                return '[u] dddd [u] LT';\n            }\n        },\n        lastDay  : '[juče u] LT',\n        lastWeek : function () {\n            var lastWeekDays = [\n                '[prošle] [nedelje] [u] LT',\n                '[prošlog] [ponedeljka] [u] LT',\n                '[prošlog] [utorka] [u] LT',\n                '[prošle] [srede] [u] LT',\n                '[prošlog] [četvrtka] [u] LT',\n                '[prošlog] [petka] [u] LT',\n                '[prošle] [subote] [u] LT'\n            ];\n            return lastWeekDays[this.day()];\n        },\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'za %s',\n        past   : 'pre %s',\n        s      : 'nekoliko sekundi',\n        m      : translator.translate,\n        mm     : translator.translate,\n        h      : translator.translate,\n        hh     : translator.translate,\n        d      : 'dan',\n        dd     : translator.translate,\n        M      : 'mesec',\n        MM     : translator.translate,\n        y      : 'godinu',\n        yy     : translator.translate\n    },\n    ordinalParse: /\\d{1,2}\\./,\n    ordinal : '%d.',\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/sv.js",
    "content": "//! moment.js locale configuration\n//! locale : swedish (sv)\n//! author : Jens Alm : https://github.com/ulmus\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('sv', {\n    months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n    monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n    weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n    weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n    weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'YYYY-MM-DD',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Idag] LT',\n        nextDay: '[Imorgon] LT',\n        lastDay: '[Igår] LT',\n        nextWeek: 'dddd LT',\n        lastWeek: '[Förra] dddd[en] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'om %s',\n        past : 'för %s sedan',\n        s : 'några sekunder',\n        m : 'en minut',\n        mm : '%d minuter',\n        h : 'en timme',\n        hh : '%d timmar',\n        d : 'en dag',\n        dd : '%d dagar',\n        M : 'en månad',\n        MM : '%d månader',\n        y : 'ett år',\n        yy : '%d år'\n    },\n    ordinalParse: /\\d{1,2}(e|a)/,\n    ordinal : function (number) {\n        var b = number % 10,\n            output = (~~(number % 100 / 10) === 1) ? 'e' :\n            (b === 1) ? 'a' :\n            (b === 2) ? 'a' :\n            (b === 3) ? 'e' : 'e';\n        return number + output;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/ta.js",
    "content": "//! moment.js locale configuration\n//! locale : tamil (ta)\n//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('ta', {\n    months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n    monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n    weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),\n    weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),\n    weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY, LT',\n        LLLL : 'dddd, D MMMM YYYY, LT'\n    },\n    calendar : {\n        sameDay : '[இன்று] LT',\n        nextDay : '[நாளை] LT',\n        nextWeek : 'dddd, LT',\n        lastDay : '[நேற்று] LT',\n        lastWeek : '[கடந்த வாரம்] dddd, LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s இல்',\n        past : '%s முன்',\n        s : 'ஒரு சில விநாடிகள்',\n        m : 'ஒரு நிமிடம்',\n        mm : '%d நிமிடங்கள்',\n        h : 'ஒரு மணி நேரம்',\n        hh : '%d மணி நேரம்',\n        d : 'ஒரு நாள்',\n        dd : '%d நாட்கள்',\n        M : 'ஒரு மாதம்',\n        MM : '%d மாதங்கள்',\n        y : 'ஒரு வருடம்',\n        yy : '%d ஆண்டுகள்'\n    },\n    ordinalParse: /\\d{1,2}வது/,\n    ordinal : function (number) {\n        return number + 'வது';\n    },\n    // refer http://ta.wikipedia.org/s/1er1\n    meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 2) {\n            return ' யாமம்';\n        } else if (hour < 6) {\n            return ' வைகறை';  // வைகறை\n        } else if (hour < 10) {\n            return ' காலை'; // காலை\n        } else if (hour < 14) {\n            return ' நண்பகல்'; // நண்பகல்\n        } else if (hour < 18) {\n            return ' எற்பாடு'; // எற்பாடு\n        } else if (hour < 22) {\n            return ' மாலை'; // மாலை\n        } else {\n            return ' யாமம்';\n        }\n    },\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === 'யாமம்') {\n            return hour < 2 ? hour : hour + 12;\n        } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n            return hour;\n        } else if (meridiem === 'நண்பகல்') {\n            return hour >= 10 ? hour : hour + 12;\n        } else {\n            return hour + 12;\n        }\n    },\n    week : {\n        dow : 0, // Sunday is the first day of the week.\n        doy : 6  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/th.js",
    "content": "//! moment.js locale configuration\n//! locale : thai (th)\n//! author : Kridsada Thanabulpong : https://github.com/sirn\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('th', {\n    months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),\n    monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),\n    weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n    weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n    weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n    longDateFormat : {\n        LT : 'H นาฬิกา m นาที',\n        LTS : 'LT s วินาที',\n        L : 'YYYY/MM/DD',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY เวลา LT',\n        LLLL : 'วันddddที่ D MMMM YYYY เวลา LT'\n    },\n    meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n    isPM: function (input) {\n        return input === 'หลังเที่ยง';\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 12) {\n            return 'ก่อนเที่ยง';\n        } else {\n            return 'หลังเที่ยง';\n        }\n    },\n    calendar : {\n        sameDay : '[วันนี้ เวลา] LT',\n        nextDay : '[พรุ่งนี้ เวลา] LT',\n        nextWeek : 'dddd[หน้า เวลา] LT',\n        lastDay : '[เมื่อวานนี้ เวลา] LT',\n        lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'อีก %s',\n        past : '%sที่แล้ว',\n        s : 'ไม่กี่วินาที',\n        m : '1 นาที',\n        mm : '%d นาที',\n        h : '1 ชั่วโมง',\n        hh : '%d ชั่วโมง',\n        d : '1 วัน',\n        dd : '%d วัน',\n        M : '1 เดือน',\n        MM : '%d เดือน',\n        y : '1 ปี',\n        yy : '%d ปี'\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/tl-ph.js",
    "content": "//! moment.js locale configuration\n//! locale : Tagalog/Filipino (tl-ph)\n//! author : Dan Hagman\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('tl-ph', {\n    months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),\n    monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n    weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),\n    weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n    weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'MM/D/YYYY',\n        LL : 'MMMM D, YYYY',\n        LLL : 'MMMM D, YYYY LT',\n        LLLL : 'dddd, MMMM DD, YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Ngayon sa] LT',\n        nextDay: '[Bukas sa] LT',\n        nextWeek: 'dddd [sa] LT',\n        lastDay: '[Kahapon sa] LT',\n        lastWeek: 'dddd [huling linggo] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'sa loob ng %s',\n        past : '%s ang nakalipas',\n        s : 'ilang segundo',\n        m : 'isang minuto',\n        mm : '%d minuto',\n        h : 'isang oras',\n        hh : '%d oras',\n        d : 'isang araw',\n        dd : '%d araw',\n        M : 'isang buwan',\n        MM : '%d buwan',\n        y : 'isang taon',\n        yy : '%d taon'\n    },\n    ordinalParse: /\\d{1,2}/,\n    ordinal : function (number) {\n        return number;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/tr.js",
    "content": "//! moment.js locale configuration\n//! locale : turkish (tr)\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//!           Burak Yiğit Kaya: https://github.com/BYK\n\nimport moment from '../moment';\n\nvar suffixes = {\n    1: '\\'inci',\n    5: '\\'inci',\n    8: '\\'inci',\n    70: '\\'inci',\n    80: '\\'inci',\n    2: '\\'nci',\n    7: '\\'nci',\n    20: '\\'nci',\n    50: '\\'nci',\n    3: '\\'üncü',\n    4: '\\'üncü',\n    100: '\\'üncü',\n    6: '\\'ncı',\n    9: '\\'uncu',\n    10: '\\'uncu',\n    30: '\\'uncu',\n    60: '\\'ıncı',\n    90: '\\'ıncı'\n};\n\nexport default moment.defineLocale('tr', {\n    months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n    monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n    weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),\n    weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n    weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd, D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay : '[bugün saat] LT',\n        nextDay : '[yarın saat] LT',\n        nextWeek : '[haftaya] dddd [saat] LT',\n        lastDay : '[dün] LT',\n        lastWeek : '[geçen hafta] dddd [saat] LT',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : '%s sonra',\n        past : '%s önce',\n        s : 'birkaç saniye',\n        m : 'bir dakika',\n        mm : '%d dakika',\n        h : 'bir saat',\n        hh : '%d saat',\n        d : 'bir gün',\n        dd : '%d gün',\n        M : 'bir ay',\n        MM : '%d ay',\n        y : 'bir yıl',\n        yy : '%d yıl'\n    },\n    ordinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n    ordinal : function (number) {\n        if (number === 0) {  // special case for zero\n            return number + '\\'ıncı';\n        }\n        var a = number % 10,\n            b = number % 100 - a,\n            c = number >= 100 ? 100 : null;\n        return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/tzm-latn.js",
    "content": "//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\n//! author : Abdel Said : https://github.com/abdelsaid\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('tzm-latn', {\n    months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n    monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n    weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n    weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n    weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[asdkh g] LT',\n        nextDay: '[aska g] LT',\n        nextWeek: 'dddd [g] LT',\n        lastDay: '[assant g] LT',\n        lastWeek: 'dddd [g] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'dadkh s yan %s',\n        past : 'yan %s',\n        s : 'imik',\n        m : 'minuḍ',\n        mm : '%d minuḍ',\n        h : 'saɛa',\n        hh : '%d tassaɛin',\n        d : 'ass',\n        dd : '%d ossan',\n        M : 'ayowr',\n        MM : '%d iyyirn',\n        y : 'asgas',\n        yy : '%d isgasn'\n    },\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/tzm.js",
    "content": "//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt (tzm)\n//! author : Abdel Said : https://github.com/abdelsaid\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('tzm', {\n    months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n    monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n    weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n    weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n    weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS: 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'dddd D MMMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n        nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n        nextWeek: 'dddd [ⴴ] LT',\n        lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n        lastWeek: 'dddd [ⴴ] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n        past : 'ⵢⴰⵏ %s',\n        s : 'ⵉⵎⵉⴽ',\n        m : 'ⵎⵉⵏⵓⴺ',\n        mm : '%d ⵎⵉⵏⵓⴺ',\n        h : 'ⵙⴰⵄⴰ',\n        hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n        d : 'ⴰⵙⵙ',\n        dd : '%d oⵙⵙⴰⵏ',\n        M : 'ⴰⵢoⵓⵔ',\n        MM : '%d ⵉⵢⵢⵉⵔⵏ',\n        y : 'ⴰⵙⴳⴰⵙ',\n        yy : '%d ⵉⵙⴳⴰⵙⵏ'\n    },\n    week : {\n        dow : 6, // Saturday is the first day of the week.\n        doy : 12  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/uk.js",
    "content": "//! moment.js locale configuration\n//! locale : ukrainian (uk)\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\nimport moment from '../moment';\n\nfunction plural(word, num) {\n    var forms = word.split('_');\n    return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n}\nfunction relativeTimeWithPlural(number, withoutSuffix, key) {\n    var format = {\n        'mm': 'хвилина_хвилини_хвилин',\n        'hh': 'година_години_годин',\n        'dd': 'день_дні_днів',\n        'MM': 'місяць_місяці_місяців',\n        'yy': 'рік_роки_років'\n    };\n    if (key === 'm') {\n        return withoutSuffix ? 'хвилина' : 'хвилину';\n    }\n    else if (key === 'h') {\n        return withoutSuffix ? 'година' : 'годину';\n    }\n    else {\n        return number + ' ' + plural(format[key], +number);\n    }\n}\nfunction monthsCaseReplace(m, format) {\n    var months = {\n        'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),\n        'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')\n    },\n    nounCase = (/D[oD]? *MMMM?/).test(format) ?\n        'accusative' :\n        'nominative';\n    return months[nounCase][m.month()];\n}\nfunction weekdaysCaseReplace(m, format) {\n    var weekdays = {\n        'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n        'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n        'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n    },\n    nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n        'accusative' :\n        ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n            'genitive' :\n            'nominative');\n    return weekdays[nounCase][m.day()];\n}\nfunction processHoursFunction(str) {\n    return function () {\n        return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n    };\n}\n\nexport default moment.defineLocale('uk', {\n    months : monthsCaseReplace,\n    monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n    weekdays : weekdaysCaseReplace,\n    weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n    weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD.MM.YYYY',\n        LL : 'D MMMM YYYY р.',\n        LLL : 'D MMMM YYYY р., LT',\n        LLLL : 'dddd, D MMMM YYYY р., LT'\n    },\n    calendar : {\n        sameDay: processHoursFunction('[Сьогодні '),\n        nextDay: processHoursFunction('[Завтра '),\n        lastDay: processHoursFunction('[Вчора '),\n        nextWeek: processHoursFunction('[У] dddd ['),\n        lastWeek: function () {\n            switch (this.day()) {\n            case 0:\n            case 3:\n            case 5:\n            case 6:\n                return processHoursFunction('[Минулої] dddd [').call(this);\n            case 1:\n            case 2:\n            case 4:\n                return processHoursFunction('[Минулого] dddd [').call(this);\n            }\n        },\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : 'за %s',\n        past : '%s тому',\n        s : 'декілька секунд',\n        m : relativeTimeWithPlural,\n        mm : relativeTimeWithPlural,\n        h : 'годину',\n        hh : relativeTimeWithPlural,\n        d : 'день',\n        dd : relativeTimeWithPlural,\n        M : 'місяць',\n        MM : relativeTimeWithPlural,\n        y : 'рік',\n        yy : relativeTimeWithPlural\n    },\n    // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n    meridiemParse: /ночі|ранку|дня|вечора/,\n    isPM: function (input) {\n        return /^(дня|вечора)$/.test(input);\n    },\n    meridiem : function (hour, minute, isLower) {\n        if (hour < 4) {\n            return 'ночі';\n        } else if (hour < 12) {\n            return 'ранку';\n        } else if (hour < 17) {\n            return 'дня';\n        } else {\n            return 'вечора';\n        }\n    },\n    ordinalParse: /\\d{1,2}-(й|го)/,\n    ordinal: function (number, period) {\n        switch (period) {\n        case 'M':\n        case 'd':\n        case 'DDD':\n        case 'w':\n        case 'W':\n            return number + '-й';\n        case 'D':\n            return number + '-го';\n        default:\n            return number;\n        }\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 1st is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/uz.js",
    "content": "//! moment.js locale configuration\n//! locale : uzbek (uz)\n//! author : Sardor Muminov : https://github.com/muminoff\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('uz', {\n    months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n    monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n    weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n    weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n    weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM YYYY',\n        LLL : 'D MMMM YYYY LT',\n        LLLL : 'D MMMM YYYY, dddd LT'\n    },\n    calendar : {\n        sameDay : '[Бугун соат] LT [да]',\n        nextDay : '[Эртага] LT [да]',\n        nextWeek : 'dddd [куни соат] LT [да]',\n        lastDay : '[Кеча соат] LT [да]',\n        lastWeek : '[Утган] dddd [куни соат] LT [да]',\n        sameElse : 'L'\n    },\n    relativeTime : {\n        future : 'Якин %s ичида',\n        past : 'Бир неча %s олдин',\n        s : 'фурсат',\n        m : 'бир дакика',\n        mm : '%d дакика',\n        h : 'бир соат',\n        hh : '%d соат',\n        d : 'бир кун',\n        dd : '%d кун',\n        M : 'бир ой',\n        MM : '%d ой',\n        y : 'бир йил',\n        yy : '%d йил'\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 7  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/vi.js",
    "content": "//! moment.js locale configuration\n//! locale : vietnamese (vi)\n//! author : Bang Nguyen : https://github.com/bangnk\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('vi', {\n    months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n    monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n    weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),\n    weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n    weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n    longDateFormat : {\n        LT : 'HH:mm',\n        LTS : 'LT:ss',\n        L : 'DD/MM/YYYY',\n        LL : 'D MMMM [năm] YYYY',\n        LLL : 'D MMMM [năm] YYYY LT',\n        LLLL : 'dddd, D MMMM [năm] YYYY LT',\n        l : 'DD/M/YYYY',\n        ll : 'D MMM YYYY',\n        lll : 'D MMM YYYY LT',\n        llll : 'ddd, D MMM YYYY LT'\n    },\n    calendar : {\n        sameDay: '[Hôm nay lúc] LT',\n        nextDay: '[Ngày mai lúc] LT',\n        nextWeek: 'dddd [tuần tới lúc] LT',\n        lastDay: '[Hôm qua lúc] LT',\n        lastWeek: 'dddd [tuần rồi lúc] LT',\n        sameElse: 'L'\n    },\n    relativeTime : {\n        future : '%s tới',\n        past : '%s trước',\n        s : 'vài giây',\n        m : 'một phút',\n        mm : '%d phút',\n        h : 'một giờ',\n        hh : '%d giờ',\n        d : 'một ngày',\n        dd : '%d ngày',\n        M : 'một tháng',\n        MM : '%d tháng',\n        y : 'một năm',\n        yy : '%d năm'\n    },\n    ordinalParse: /\\d{1,2}/,\n    ordinal : function (number) {\n        return number;\n    },\n    week : {\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/zh-cn.js",
    "content": "//! moment.js locale configuration\n//! locale : chinese (zh-cn)\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('zh-cn', {\n    months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n    monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n    weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n    weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n    weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n    longDateFormat : {\n        LT : 'Ah点mm',\n        LTS : 'Ah点m分s秒',\n        L : 'YYYY-MM-DD',\n        LL : 'YYYY年MMMD日',\n        LLL : 'YYYY年MMMD日LT',\n        LLLL : 'YYYY年MMMD日ddddLT',\n        l : 'YYYY-MM-DD',\n        ll : 'YYYY年MMMD日',\n        lll : 'YYYY年MMMD日LT',\n        llll : 'YYYY年MMMD日ddddLT'\n    },\n    meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n    meridiemHour: function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === '凌晨' || meridiem === '早上' ||\n                meridiem === '上午') {\n            return hour;\n        } else if (meridiem === '下午' || meridiem === '晚上') {\n            return hour + 12;\n        } else {\n            // '中午'\n            return hour >= 11 ? hour : hour + 12;\n        }\n    },\n    meridiem : function (hour, minute, isLower) {\n        var hm = hour * 100 + minute;\n        if (hm < 600) {\n            return '凌晨';\n        } else if (hm < 900) {\n            return '早上';\n        } else if (hm < 1130) {\n            return '上午';\n        } else if (hm < 1230) {\n            return '中午';\n        } else if (hm < 1800) {\n            return '下午';\n        } else {\n            return '晚上';\n        }\n    },\n    calendar : {\n        sameDay : function () {\n            return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';\n        },\n        nextDay : function () {\n            return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';\n        },\n        lastDay : function () {\n            return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';\n        },\n        nextWeek : function () {\n            var startOfWeek, prefix;\n            startOfWeek = moment().startOf('week');\n            prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';\n            return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n        },\n        lastWeek : function () {\n            var startOfWeek, prefix;\n            startOfWeek = moment().startOf('week');\n            prefix = this.unix() < startOfWeek.unix()  ? '[上]' : '[本]';\n            return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n        },\n        sameElse : 'LL'\n    },\n    ordinalParse: /\\d{1,2}(日|月|周)/,\n    ordinal : function (number, period) {\n        switch (period) {\n        case 'd':\n        case 'D':\n        case 'DDD':\n            return number + '日';\n        case 'M':\n            return number + '月';\n        case 'w':\n        case 'W':\n            return number + '周';\n        default:\n            return number;\n        }\n    },\n    relativeTime : {\n        future : '%s内',\n        past : '%s前',\n        s : '几秒',\n        m : '1分钟',\n        mm : '%d分钟',\n        h : '1小时',\n        hh : '%d小时',\n        d : '1天',\n        dd : '%d天',\n        M : '1个月',\n        MM : '%d个月',\n        y : '1年',\n        yy : '%d年'\n    },\n    week : {\n        // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n        dow : 1, // Monday is the first day of the week.\n        doy : 4  // The week that contains Jan 4th is the first week of the year.\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/locale/zh-tw.js",
    "content": "//! moment.js locale configuration\n//! locale : traditional chinese (zh-tw)\n//! author : Ben : https://github.com/ben-lin\n\nimport moment from '../moment';\n\nexport default moment.defineLocale('zh-tw', {\n    months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n    monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n    weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n    weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n    weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n    longDateFormat : {\n        LT : 'Ah點mm',\n        LTS : 'Ah點m分s秒',\n        L : 'YYYY年MMMD日',\n        LL : 'YYYY年MMMD日',\n        LLL : 'YYYY年MMMD日LT',\n        LLLL : 'YYYY年MMMD日ddddLT',\n        l : 'YYYY年MMMD日',\n        ll : 'YYYY年MMMD日',\n        lll : 'YYYY年MMMD日LT',\n        llll : 'YYYY年MMMD日ddddLT'\n    },\n    meridiemParse: /早上|上午|中午|下午|晚上/,\n    meridiemHour : function (hour, meridiem) {\n        if (hour === 12) {\n            hour = 0;\n        }\n        if (meridiem === '早上' || meridiem === '上午') {\n            return hour;\n        } else if (meridiem === '中午') {\n            return hour >= 11 ? hour : hour + 12;\n        } else if (meridiem === '下午' || meridiem === '晚上') {\n            return hour + 12;\n        }\n    },\n    meridiem : function (hour, minute, isLower) {\n        var hm = hour * 100 + minute;\n        if (hm < 900) {\n            return '早上';\n        } else if (hm < 1130) {\n            return '上午';\n        } else if (hm < 1230) {\n            return '中午';\n        } else if (hm < 1800) {\n            return '下午';\n        } else {\n            return '晚上';\n        }\n    },\n    calendar : {\n        sameDay : '[今天]LT',\n        nextDay : '[明天]LT',\n        nextWeek : '[下]ddddLT',\n        lastDay : '[昨天]LT',\n        lastWeek : '[上]ddddLT',\n        sameElse : 'L'\n    },\n    ordinalParse: /\\d{1,2}(日|月|週)/,\n    ordinal : function (number, period) {\n        switch (period) {\n        case 'd' :\n        case 'D' :\n        case 'DDD' :\n            return number + '日';\n        case 'M' :\n            return number + '月';\n        case 'w' :\n        case 'W' :\n            return number + '週';\n        default :\n            return number;\n        }\n    },\n    relativeTime : {\n        future : '%s內',\n        past : '%s前',\n        s : '幾秒',\n        m : '一分鐘',\n        mm : '%d分鐘',\n        h : '一小時',\n        hh : '%d小時',\n        d : '一天',\n        dd : '%d天',\n        M : '一個月',\n        MM : '%d個月',\n        y : '一年',\n        yy : '%d年'\n    }\n});\n\n"
  },
  {
    "path": "www/lib/moment/src/moment.js",
    "content": "//! moment.js\n//! version : 2.10.2\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\nimport { hooks as moment, setHookCallback } from './lib/utils/hooks';\n\nmoment.version = '2.10.2';\n\nimport {\n    min,\n    max,\n    isMoment,\n    momentPrototype as fn,\n    createUTC       as utc,\n    createUnix      as unix,\n    createLocal     as local,\n    createInvalid   as invalid,\n    createInZone    as parseZone\n} from './lib/moment/moment';\n\nimport {\n    defineLocale,\n    getSetGlobalLocale as locale,\n    getLocale          as localeData,\n    listMonths         as months,\n    listMonthsShort    as monthsShort,\n    listWeekdays       as weekdays,\n    listWeekdaysMin    as weekdaysMin,\n    listWeekdaysShort  as weekdaysShort\n} from './lib/locale/locale';\n\nimport {\n    isDuration,\n    createDuration as duration,\n    getSetRelativeTimeThreshold as relativeTimeThreshold\n} from './lib/duration/duration';\n\nimport { normalizeUnits } from './lib/units/units';\n\nimport isDate from './lib/utils/is-date';\n\nsetHookCallback(local);\n\nmoment.fn                    = fn;\nmoment.min                   = min;\nmoment.max                   = max;\nmoment.utc                   = utc;\nmoment.unix                  = unix;\nmoment.months                = months;\nmoment.isDate                = isDate;\nmoment.locale                = locale;\nmoment.invalid               = invalid;\nmoment.duration              = duration;\nmoment.isMoment              = isMoment;\nmoment.weekdays              = weekdays;\nmoment.parseZone             = parseZone;\nmoment.localeData            = localeData;\nmoment.isDuration            = isDuration;\nmoment.monthsShort           = monthsShort;\nmoment.weekdaysMin           = weekdaysMin;\nmoment.defineLocale          = defineLocale;\nmoment.weekdaysShort         = weekdaysShort;\nmoment.normalizeUnits        = normalizeUnits;\nmoment.relativeTimeThreshold = relativeTimeThreshold;\n\nexport default moment;\n"
  },
  {
    "path": "www/lib/moment/templates/amd-named.js",
    "content": "/*global define:false*/\n\nimport moment from \"./moment\";\n\ndefine(\"moment\", [], function () {\n    return moment;\n});\n"
  },
  {
    "path": "www/lib/moment/templates/amd.js",
    "content": "/*global define:false*/\n\nimport moment from \"./moment\";\n\ndefine([], function () {\n    return moment;\n});\n"
  },
  {
    "path": "www/lib/moment/templates/globals.js",
    "content": "/*global window:false*/\n\nimport moment from \"./moment\";\n\nwindow.moment = moment;\n"
  },
  {
    "path": "www/lib/moment/templates/locale-header.js",
    "content": "(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n"
  },
  {
    "path": "www/lib/moment/templates/test-header.js",
    "content": "(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../moment')) :\n   typeof define === 'function' && define.amd ? define(['../../moment'], factory) :\n   factory(global.moment)\n}(this, function (moment) { 'use strict';\n"
  },
  {
    "path": "www/lib/ngCordova/.bower.json",
    "content": "{\n  \"name\": \"ngCordova\",\n  \"version\": \"0.1.14-alpha\",\n  \"homepage\": \"http://ngCordova.com/\",\n  \"authors\": [\n    \"Max Lynch <max@drifty.com>\",\n    \"Paolo Bernasconi <paolo.enrico.bernasconi@gmail.com>\",\n    \"Chad Campbell <chad.campbell@ecofic.com>\"\n  ],\n  \"description\": \"AngularJS Cordova wrappers for common Cordova plugins.\",\n  \"main\": [\n    \"./dist/ng-cordova.js\"\n  ],\n  \"ignore\": [\n    \"**/.*\",\n    \"gulpfile.js\",\n    \"test\",\n    \"src\",\n    \"config\",\n    \"demo\",\n    \"CONTRIBUTING.md\"\n  ],\n  \"dependencies\": {\n    \"angular\": \">= 1.2.23\"\n  },\n  \"keywords\": [\n    \"ngCordova\",\n    \"ng-cordova\",\n    \"ngcordova\",\n    \"ng cordova\",\n    \"cordova\",\n    \"phonegap\",\n    \"angular\",\n    \"angularjs\",\n    \"ionic\",\n    \"cordova plugin\"\n  ],\n  \"license\": \"MIT\",\n  \"private\": false,\n  \"devDependencies\": {\n    \"angular\": \">= 1.2.23\",\n    \"angular-mocks\": \">= 1.2.23\",\n    \"jquery\": \"~2.1.1\"\n  },\n  \"_release\": \"0.1.14-alpha\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"v0.1.14-alpha\",\n    \"commit\": \"b0a043dcab9aabf94c22d2e60e4c285c4457987d\"\n  },\n  \"_source\": \"git://github.com/driftyco/ng-cordova.git\",\n  \"_target\": \"~0.1.14-alpha\",\n  \"_originalSource\": \"ngCordova\",\n  \"_direct\": true\n}"
  },
  {
    "path": "www/lib/ngCordova/CHANGELOG.md",
    "content": "# 0.1.11-alpha (01-15-2014)\n\n### New\n- **NPM** - deploy new versions using Travis 081a23f\n- **FileOpener2 plugin** - created module and factory for fileOpener2 plugin 08970d0\n- **inAppBrowser plugin** - refractor into a provider to set default options + override default options in `open()` method daeedd1 8d9e7fb\n- **File Transfer plugin** - refractor out FileTransfer plugin from **File plugin** into its own module 11717fc\n- **Local Notification** - added ` registerPermission()` method for iOS 8 742d961cfd91a19998029aa51d25602387cb4e29\n- **OAuth** -Magento, ADFS, Vkontakte support   8bb4198\n\n\n### Fix\n- **ProgressIndicator** - add the `show()` method that exists for android. show expects one parameter which is the indicator message 67f5f0d f5b220f\n- **OAuth** - fix promise resolve #544 e0b2457\n- **OAuth** -  `close()` browser only after login promise is complete 8bb4198\n- **Push Notification** - `onNotification` check + replace `$rootscope.$apply()` with `$timeout` to avoid '$digest already in progress' error 1cb428a\n- **Network** -  improve eventListener auto initialized the eventListeners for `offline`, `online`. 8272f28 0c8c0fd 579c18f\n- **Network** -  replace `$apply()` with `$timeout()` for online and offline events d0028aa\n- **Social Sharing** -add `shareViaFacebookWithPasteMessageHint` method a5df9db\n- **localNotification** - replace `$rootscope.$apply()` with `$timeout()` to avoid $digest error for events 743ce58\n- **Battery Status** - remove isolated `$rootScope.$new()` and replace with DI injection + check if plugin is installed. If installed, start EventListeners 0c6de57\n- **Battery Status** - refractor out anonymous functions for better memory management + wrap `$broadcast` calls in a `$timeout` function to ensure `$rootscope.$apply()` occurs 600b30e\n\n\n### Demo\n- **Facebook** - FB variables to init.sh d0575a7\n- **Contacts** - add contacts da92644\n- **localNotification** - add detailed localNotification  da92644\n\n\n### Breaking Changes\n- **Network** - standardise $broadcast naming 3566b7b\n- **Push Notification** - standardise $broadcast naming dda9e80\n- **Battery Status** - standardise $broadcast naming 6b6739f\n- **Local Notifications** -standardize $broadcast naming 742d961\n- **InAppBrowser** - rename `loadstart`, `loadstop`, `loaderror`, `exit` to `$cordovaInAppBrowser:[event]` for standardisation + refractor to `$rootScope.$broadcast()` to avoid new isolated scope dea2b8e\n- **InAppBrowser** - remove `init()` function - refractor into `$cordovaInAppBrowserProvider.setDefaultOptions(options)` dea2b8e\n\n##### Network\nBefore\n```javascript\n$rootScope.$on('networkOffline', function(e,state));\n$rootScope.$on('networkOnline', function(e,state));\n```\n\nNow\n```javascript\n$rootScope.$on('$cordovaNetwork:offline', function(e,state));\n$rootScope.$on('$cordovaNetwork:online', function(e,state));\n```\n\n\n##### Push Notifications\nBefore\n```javascript\n$rootScope.$on('pushNotificationReceived', function(e,state));\n```\n\nNow\n```javascript\n$rootScope.$on('$cordovaPush:notificationReceived', function(e,notification));\n```\n\n##### Battery Status\nBefore\n```javascript\n$cordovaBatteryStatus.$on('batterystatus', function(e,status));\n$cordovaBatteryStatus.$on('batterycritical', function(e,status));\n$cordovaBatteryStatus.$on('batterylow', function(e,status));\n```\n\nNow\n```javascript\n$rootScope.$on('$cordovaBatteryStatus:status', function(e,status));\n$rootScope.$on('$cordovaBatteryStatus:critical', function(e,status));\n$rootScope.$on('$cordovaBatteryStatus:low', function(e,status));\n```\n\n##### Local Notification\nBefore\n```javascript\n$rootScope.$on(\"localNotification:canceled\", function(e,notification));\n$rootScope.$on(\"localNotification:clicked\", function(e,notification));\n$rootScope.$on(\"localNotification:triggered\", function(e,notification));\n$rootScope.$on(\"localNotification:added\", function(e,notification));\n```\n\nNow\n```javascript\n$rootScope.$on(\"$cordovaLocalNotification:canceled\", function(e,notification));\n$rootScope.$on(\"$cordovaLocalNotification:clicked\", function(e,notification));\n$rootScope.$on(\"$cordovaLocalNotification:triggered\", function(e,notification));\n$rootScope.$on(\"$cordovaLocalNotification:added\", function(e,notification));\n```\n\n##### In App Browser\nBefore\n```javascript\ninApp.$on('loadstart', function(e, event));\ninApp.$on('loadstop', function(e, event));\ninApp.$on('loaderror', function(e, event));\ninApp.$on('exit', function(e, event));\n\n$cordovaInAppBrowser.init(options);\n```\n\nNow\n```javascript\n$rootScope.$on('$cordovaInAppBrowser:loadstart', function(e, event));\n$rootScope.$on('$cordovaInAppBrowser:loadstop', function(e, event));\n$rootScope.$on('$cordovaInAppBrowser:loaderror', function(e, event));\n$rootScope.$on('$cordovaInAppBrowser:exit', function(e, event));\n\n$cordovaInAppBrowserProvider.setDefaultOptions(options);\n```\n\n##### File Plugin\nBefore\n```javascript\n$cordovaFile.uploadFile(...)\n$cordovaFile.downloadFile(...)\n```\n\nNow\n```javascript\n$cordovaFileTransfer.upload(...)\n$cordovaFileTransfer.download(...)\n```\n\n\n# 0.1.10-alpha (01-4-2014)\n\nThis is a relatively small release to reflect more changes to the **FB plugin**. Important additions were made the **network plugin**, which now provides the ability to watch for `online` and `offline` events.\n\n> NOTE: **ngCordova** is arriving at a very stable level and we hope to release the first **BETA** version in the next few weeks, after we complete some important fixes to the **file plugin**, **push notifications** and **local notifications** plugins. Expect 1 - 2 more **ALPHA** releases with changes made to these plugins, and send me an email  @ paolo.enrico.bernasconi@gmail.com if you would like to help test these plugins.\n\n### NEW\n\n- **Network Plugin** : adding `$on('online')`, `$on('offline')` events 3cccfe409b44710e9677a3d9434b3efe346e6379\n- **0Auth** : salesforce + strava support e0795ce \n- **Facebook** : make more compliant with original plugin and remove unnecessary `init()` from login method. 64b5aa8036d23dd768a2b47c21e760871feb94dd  2218c4d\n- **mocks** : better file plugin 2404142 78e9410  8bac9eb\n- **docs**: ability to search plugins\n\n### Fix\n- **0Auth** : add code to handle cancel / exit events in the oauth browser flow  4d93e12\n- **Keychain** : check if keychain exists before instantiating  7684643\n\n\n### Breaking Changes\n\n**Facebook Plugin:** (only relevant for browser testing)\n\n**Before**\n```\n.config(function () {\n  $cordovaFacebookProvider.setAppID(appID, version);\n});\n\n```\n\n**After**\n```\n.config(function () {\n  $cordovaFacebookProvider. browserInit(12345678, \"v2.0\")\n});\n```\n\n\n\n\n# 0.1.9-alpha (12-22-2014)\n\nA new release to reflect a few changes made to the docs and code respectively. Mainly `v0.1.9-alpha` has been released to fix the AngularJS dependency issue, which now resolves to anything higher than `v1.2.23`.\n\n### NEW\n\n- **MAJOR docs refractor**\n- **Brightness** plugin\n- **App Version** plugin\n- **ActionSheet** plugin\n- **Email Composer** plugin\n- **Image Picker** plugin\n\n\n### Fix\n- **App** Rate plugin: add dep injection\n- **Media** plugin: reduce promisifcation\n- **StatusBar** : `isVisible` is not a method, but a value\n- **Bower** -- update dependency to `>= 1.2.23`\n\n\n# 0.1.8-alpha (12-11-2014)\n\n### NEW\n- **App Rate** plugin\n- **In App Browser** plugin\n- **HTTPd** plugin\n- **Video Capture Plus** plugin\n- **GoogleAds** plugin\n- **FacebookAds** plugin\n- **FlurryAds** plugin\n- **iAd** plugin\n- **mMediaAds** plugin\n- **mobfoxAds** plugin\n- **mopubAds** plugin\n- **0Auth** - twitter, reddit, foresquare support\n- **Date Picker** - Insert default options on datePicker\n\n### FIXES\n- **Module** - add zip plugin injection dependency\n- **Push Notification** - \twrapping $broadcast in an $apply() statement to bring notification into scope\n- **Local Notification** -  Updated localNotification wrapper with hasPermission and promptForPermission methods\n- **Bluetooth Serial** - fix callback from `resolve` to `notify` for constant updates\n- **File** - add timeout option to upload\n\n### Breaking Changes\n\nChanges were made to the promisification of `geolocation`, `deviceOrientation` and `deviceMotion` plugin `watch` methods.\n\n**Before**:\n```\nwatch = $cordovaDeviceMotion.watchAcceleration(options);\n\nwatch.promise.then(\n     function() {/* unused */},\n     function(err) {},\n     function(acceleration) {\n});\n\n$cordovaDeviceMotion.clearWatch(watch.watchID);\n```\n\n**Now**:\n```\nwatch = $cordovaDeviceMotion.watchAcceleration(options).then(\n     function() {/* unused */},\n     function(err) {},\n     function(acceleration) {\n});\n\nwatch.clear();\n// or\n$cordovaDeviceMotion.clearWatch(watch);\n```\n\nThe same goes for `geolocation` and `DeviceOrientation`.\n\n\n\n\n\n\n# 0.1.7-alpha (11-05-2014)\n\nThis is a micro-release to fix the issue with `bower` installing `v0.1.5-alpha`, resolving #418.\n\n### New\n- **Demo** - FB web-dev api is now working ec053ad  71d3961\n- **PushNotifications** - \tAngular event broadcast for push notifications  da0ef69\n- **Contact* - new `pickContact` method 01319b853da56eeb7893abc93fb1ebbb2bb9fbe7\n\n### Fixes\n- **Printer** - fix `isAvailable` method + promise for `print` method  ef452ed\n\n\n\n\n# 0.1.6-alpha (10-30-2014)\n\nThis is a small release to reflect a few fixes in the **Facebook plugin**. The docs at [ngcordova.com/docs](http://ngcordova.com/docs) are now aligned with the fixes made.\n\n### New\n\n- [Bluetooth Low Energy plugin]() 7540bf2\n- [Badge plugin](https://github.com/katzer/cordova-plugin-badge) 69fe14f\n- AuthO plugin (web based) c775650\n- AppRating plugin (still in development) 9aead73\n\n\n### Fixes\n\n- **Facebook** - refractor appID 48cb327\n- **Facebook** - add version parameter to setAppID method\t 0e6f7b1\n- **Flashlight** - add toggle method 0e24273\n- **Spinner Dialog** -  add `fixed` parameter to stop touch from removing spinner dialog d1a01df\n\n\n# 0.1.5-alpha (10-17-2014)\n\nThe Facebook Plugin is now supported with many new plugins added and bugs fixed!\n\n### Highlights\n\n**FB plugin** - The highly demanded Facebook plugin now has docs and a working example in the demo file of ngCordova.\n\n**TouchID** - Add iOS TouchID authentication to your apps easily with the touchid plugin. See the demo app for a working example.\n\n**Travis CI testing** - We've integrated ngCordova into TravisCI, and have builds tested on each commit.\n\n### New\n\n- [TouchID plugin](https://github.com/leecrossley/cordova-plugin-touchid)\n- [ZIP plugin](https://github.com/MobileChromeApps/zip)\n- [Calendar plugin](https://github.com/apache/cordova-plugin-contacts)\n- [Google Analytics plugin](https://github.com/phonegap-build/GAPlugin)\n- Date Picker now has promises\n- PinDialog now has promises\n- Replacing javascript `window` with angular `$window`\n- Testing for many plugins (check the /test folder)\n\n### Fix\n\n- Dialogs plugin : fixed prompt and confirm methods to return button index and input (if exists)\n- Keychain : fix issue where keychain is not initialized properly\n- StatusBar : fix the method overlaysWebView to honour the boolean param\n- Remove ngCordova.min.js from bower for better grunt integration\n- Fixes to the File Plugin (more fixes coming soon)\n\n\n\n\n# 0.1.4-alpha (09-08-2014)\n\n### New\n\n- [Progress Indicator plugin](http://pbernasconi.github.io/cordova-progressIndicator/)  d70f387\n- [Clipboard plugin](https://github.com/VersoSolutions/CordovaClipboard) f54bdc8\n- [SMS plugin](https://github.com/aharris88/phonegap-sms-plugin)\n- [Bluetooth Serial plugin](https://github.com/don/BluetoothSerial)\n- [AdMob Plugin](https://github.com/floatinghotpot/cordova-plugin-admob)\n- [Background Geolocation Plugin](https://github.com/christocracy/cordova-plugin-background-geolocation)\n- [Facebook Connect Plugin](https://github.com/Wizcorp/phonegap-facebook-plugin)\n- [Printer Plugin](https://github.com/katzer/cordova-plugin-printer)\n- [Native Audio Plugin](https://github.com/SidneyS/cordova-plugin-nativeaudio) 96f4570\n- [Media plugin](https://github.com/apache/cordova-plugin-media) a235517\n- [Battery Status plugin](org.apache.cordova.battery-status) 897dd65\n- [Keychain plugin](https://github.com/shazron/KeychainPlugin)\n- [Date Picker plugin](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker)\n\n\n\n### Fixes\n\n- **Dialogs** - Adding promise support\n- **Device Orientation** - Fixed compass.clearWatch missing the watchID parameter 9367bcf\n- **Globalization** - Added more methods and endpoints 786ec67\n- **Globalization** - Fixed unnecessary options parameter 4379b81e791c8aefa71ba84fe65cb6ef70b62a7c\n- **File** - Adding writeFile logic for \"file\" plugin 46bd8b7\n- **File** - Added relative path and filename\tfbd2e9d\n- **File** - New methods for ReasAs [text, DataURL, BinaryString, ArrayBuffer] 0b30ba1\n- **Printer** - Adding promise support\n-  **Social Sharing** - Added the (most important) `share` function\n-  **Social Sharing** - Renamed SMS phonenr param to indicate you can pass multiple by separating by a comma\n-  **Social Sharing** - Renamed all image params to file, because any file can be shared\n-  **Social Sharing** - Fixed `shareViaEmail`, because it was an unadjusted copy-paste of `shareViaSMS`\n-  **Social Sharing** - Added `shareVia`\n-  **Social Sharing** - Added `canShareViaEmail`\n-  **Social Sharing** - Fixed `canShareVia` (subject was missing)\n-  **Social Sharing** - Removed some now obsolete TODO's/notes\n\n### New\n\n- A new side-menu for quick navigation\n\n- Flashlight plugin\n- Progress Indicator plugin\n- AdMob plugin\n- AppAvailability plugin\n- Battery Status plugin\n- Clipboard plugin\n- Keychain plugin\n- Media plugin\n- Printer Plugin\n- Contributing guidelines\n- CHANGELOG.md\n\n### Demo\n- **Completely new demos** with many new plugins 49d991f\n- Quick-view the source code in the app\n- Flashlight plugin\n- Statusbar plugin\n- Preferences plugin\n- Barcode Scanner plugin\n\n### Other\n- **ng-cordova-mocks** - Mock are now in ngCordova! Documentation is **coming soon**, with examples in the demo too\n- Adding js-lint testing in gulp 72e513b\n- Adding .editorconfig for better contributing\n- Fix bower.js file and bower install ngCordova\n\n\n\n# 0.1.3-alpha (06-11-2014)\n\n### NEW\n - API Change for Geolocation, DeviceMotion, and DeviceOrientation plugins. They now return an object of the form:\n```javascript\n{\n  promise: deferrable,\n  watchId: watchId\n}\n```\n\nWhere promise is the internal promise, and watchId is the watchId that can be used to clear the watch later.\n\n - [Capture](https://github.com/apache/cordova-plugin-media-capture) plugin\n - [Flashlight](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin) plugin\n - [AppAvailability](https://github.com/ohh2ahh/AppAvailability) plugin\n - Cordova preferences plugin\n\nAnd lots of fixes!\n\n\n\n# 0.1.2-alpha (06-11-2014)\n\n### NEW\n\n- Bower support\n- File Plugin\n- Globalization plugin.\n- Google Analytics plugin\n- Local Notifications Plugin\n- Pin Dialog plugin\n- Push Notifications plugin\n- Social Sharing plugin\n- Spinner Dialog plugin\n- SQLite Plugin\n- Toast Plugin\n\n\n### FEATURES\n\n- Progress event to **File Plugin** `upload()` + `download()`\n- More commands in **Push Notification plugin**\n- Handle `Connection.NONE` in **Network Information Plugin**  for is`Offline()`\n- Use `notify` not `resolve` with `watchHeading`\n\n\n### FIXES\n\n- Remove options in **BarcodeScanner** : `scan()`\n- Remove options in **Device Motion** : `getCurrentAcceleration()`\n\n\n\n\n# 0.1.1-alpha (06-03-2014)\n\n### NEW\n- StatusBar\n\n### FIXES\n- Renamed Accelerometer and Compass to deviceMotion and deviceOrientation, respectively\n\n\n\n# 0.1.0-alpha (06-03-2014)\n\nngCordova is ready for some bleeding edge testing. So far we support the following Cordova plugins:\n\n- org.apache.cordova.console\n- org.apache.cordova.device\n- org.apache.cordova.camera\n- org.apache.cordova.vibration\n- org.apache.cordova.network-information\n- org.apache.cordova.geolocation\n- org.apache.cordova.dialogs\n- org.apache.cordova.device-motion\n- org.apache.cordova.splashscreen\n- org.apache.cordova.device-orientation\n- org.apache.cordova.contacts\n- https://github.com/driftyco/ionic-plugins-keyboard\n- https://github.com/wildabeast/BarcodeScanner\n\n\nGive it a try, and please report lots of issues and contribute PRs. :icecream:\n"
  },
  {
    "path": "www/lib/ngCordova/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Drifty\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 all\ncopies 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 THE\nSOFTWARE."
  },
  {
    "path": "www/lib/ngCordova/README.md",
    "content": "[ngCordova](http://ngcordova.com/)\n==========\n\n[![Travis](http://img.shields.io/travis/driftyco/ng-cordova.svg?style=flat)](https://travis-ci.org/driftyco/ng-cordova) [![Bower](http://img.shields.io/badge/bower-ngCordova-FFCC2F.svg?style=flat)](http://bower.io/search/?q=ngCordova)\n\n### Cordova with AngularJS Goodness\n\n\n[<img src=\"http://ionicframework.com/img/ngcordova-context-logo.png\" alt=\"ngCordova Logo\" width=\"210px\" height=\"210px\" />](http://ngcordova.com/)\n\n\nngCordova gives you simple AngularJS wrappers for a massive amount of Cordova plugins. Check out the list below for all of the available plugins, and create an issue for a new request.\n\nCreated by the [Ionic Framework](http://ionicframework.com/) team and the community.\n\n| RESOURCE | LINK |\n|------------|---------|\n| **Website** | [ngCordova.com](http://ngcordova.com/) |\n| **Docs** | [ngCordova.com/docs](http://ngcordova.com/docs) |\n| **Requirements** | [AngularJS](https://github.com/angular/angular.js),  [Cordova](http://cordova.apache.org/) |\n| **Install** | `bower install ngCordova` or [download zip file](https://github.com/driftyco/ng-cordova/archive/master.zip) |\n| **Custom build** | [ngCordova.com/build](http://ngcordova.com/build/) |\n\n\n## Installation\n\nInstall manually, or from bower:\n\n```bash\n$ bower install ngCordova\n```\n\n## Plugins `(63+)`\n\n- [Action Sheet](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet)\n- [AdMob](https://github.com/floatinghotpot/cordova-plugin-admob)\n- [App Availability](https://github.com/ohh2ahh/AppAvailability)\n- [App Preferences](https://github.com/dferrell/plugins-application-preferences)\n- [App Rate](https://github.com/pushandplay/cordova-plugin-apprate)\n- [App Version](https://github.com/whiteoctober/cordova-plugin-app-version)\n- [Background Geolocation](https://github.com/christocracy/cordova-plugin-background-geolocation)\n- [Badge](https://github.com/katzer/cordova-plugin-badge)\n- [Barcode Scanner](https://github.com/wildabeast/BarcodeScanner)\n- [Battery Status](https://github.com/apache/cordova-plugin-battery-status) *\n- [Bluetooth Low Energy](https://github.com/evothings/cordova-ble)\n- [Bluetooth Serial](https://github.com/don/BluetoothSerial)\n- [Brightness](https://github.com/fiscal-cliff/phonegap-plugin-brightness)\n- [Calendar](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin)\n- [Camera](https://github.com/apache/cordova-plugin-camera) *\n- [Clipboard](https://github.com/VersoSolutions/CordovaClipboard)\n- [Console](https://github.com/apache/cordova-plugin-console) *\n- [Contacts](https://github.com/apache/cordova-plugin-contacts) *\n- [Date Picker](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker)\n- [Device Motion](https://github.com/apache/cordova-plugin-device-motion) *\n- [Device Orientation](https://github.com/apache/cordova-plugin-device-orientation) *\n- [Device](https://github.com/apache/cordova-plugin-device) *\n- [Dialogs](https://github.com/apache/cordova-plugin-dialogs) *\n- [Email Composer](https://github.com/katzer/cordova-plugin-email-composer)\n- [Facebook Connect](https://github.com/Wizcorp/phonegap-facebook-plugin)\n- [Facebook AudienceNetwork Ads](https://github.com/floatinghotpot/cordova-plugin-facebookads)\n- [File](https://github.com/apache/cordova-plugin-file) *\n- [File Transfer](https://github.com/apache/cordova-plugin-file-transfer) *\n- [Flashlight](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin)\n- [Flurry Ads](https://github.com/floatinghotpot/cordova-plugin-flurry)\n- [Geolocation](https://github.com/apache/cordova-plugin-geolocation) *\n- [Globalization](https://github.com/apache/cordova-plugin-globalization) *\n- [Google Ads](https://github.com/floatinghotpot/cordova-admob-pro)\n- [Google Analytics](https://github.com/danwilson/google-analytics-plugin)\n- [Google Maps]()\n- [HealthKit for iOS](https://github.com/Telerik-Verified-Plugins/HealthKit)\n- [Httpd (Web Server)](https://github.com/floatinghotpot/cordova-httpd)\n- [Apple iAd](https://github.com/floatinghotpot/cordova-iad-pro)\n- [Image Picker](https://github.com/wymsee/cordova-imagePicker)\n- [InAppBrowser](https://github.com/apache/cordova-plugin-inappbrowser)*\n- [Keyboard](https://github.com/driftyco/ionic-plugins-keyboard)\n- [Keychain](https://github.com/shazron/KeychainPlugin)\n- [Local Notifications](https://github.com/katzer/cordova-plugin-local-notifications/)\n- [Media Capture](https://github.com/apache/cordova-plugin-media-capture)\n- [Media](https://github.com/apache/cordova-plugin-media) *\n- [MillennialMedia Ads](https://github.com/floatinghotpot/cordova-plugin-mmedia)\n- [MobFox Ads](https://github.com/floatinghotpot/cordova-mobfox-pro)\n- [MoPub Ads](https://github.com/floatinghotpot/cordova-plugin-mopub)\n- [Native Audio](https://github.com/SidneyS/cordova-plugin-nativeaudio)\n- [Network Information](https://github.com/apache/cordova-plugin-network-information) *\n- [Oauth](https://github.com/nraboy/ng-cordova-oauth)\n- [Pin Dialog](https://github.com/Paldom/PinDialog)\n- [Printer](https://github.com/katzer/cordova-plugin-printer)\n- [Progress Indicator](https://github.com/pbernasconi/cordova-progressIndicator)\n- [Push Notifications](https://github.com/phonegap-build/PushPlugin)\n- [SMS](https://github.com/aharris88/phonegap-sms-plugin)\n- [Social Sharing](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin)\n- [Spinner Dialog](https://github.com/Paldom/SpinnerDialog)\n- [Splashscreen](https://github.com/apache/cordova-plugin-splashscreen) *\n- [SQLite](https://github.com/brodysoft/Cordova-SQLitePlugin)\n- [StatusBar](https://github.com/apache/cordova-plugin-statusbar) *\n- [Toast](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin)\n- [Touchid](https://github.com/leecrossley/cordova-plugin-touchid)\n- [Vibration](https://github.com/apache/cordova-plugin-vibration) *\n- [Video Capture Plus](https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin) *\n- [Zip](https://github.com/MobileChromeApps/zip)\n\n`* official Apache Cordova Plugin`\n\n## Authors\n\n#### Max Lynch\n\n- https://twitter.com/maxlynch\n- https://github.com/mlynch\n\n#### Paolo Bernasconi\n\n- https://twitter.com/paolobernasconi\n- https://github.com/pbernasconi\n\n\n## LICENSE\n\nngCordova is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.\n"
  },
  {
    "path": "www/lib/ngCordova/bower.json",
    "content": "{\n  \"name\": \"ngCordova\",\n  \"version\": \"0.1.12-alpha\",\n  \"homepage\": \"http://ngCordova.com/\",\n  \"authors\": [\n    \"Max Lynch <max@drifty.com>\",\n    \"Paolo Bernasconi <paolo.enrico.bernasconi@gmail.com>\",\n    \"Chad Campbell <chad.campbell@ecofic.com>\"\n  ],\n  \"description\": \"AngularJS Cordova wrappers for common Cordova plugins.\",\n  \"main\": [\n    \"./dist/ng-cordova.js\"\n  ],\n  \"ignore\": [\n    \"**/.*\",\n    \"gulpfile.js\",\n    \"test\",\n    \"src\",\n    \"config\",\n    \"demo\",\n    \"CONTRIBUTING.md\"\n  ],\n  \"dependencies\": {\n    \"angular\": \">= 1.2.23\"\n  },\n  \"keywords\": [\n    \"ngCordova\",\n    \"ng-cordova\",\n    \"ngcordova\",\n    \"ng cordova\",\n    \"cordova\",\n    \"phonegap\",\n    \"angular\",\n    \"angularjs\",\n    \"ionic\",\n    \"cordova plugin\"\n  ],\n  \"license\": \"MIT\",\n  \"private\": false,\n  \"devDependencies\": {\n    \"angular\": \">= 1.2.23\",\n    \"angular-mocks\": \">= 1.2.23\",\n    \"jquery\": \"~2.1.1\"\n  }\n}\n"
  },
  {
    "path": "www/lib/ngCordova/dist/ng-cordova-mocks.js",
    "content": "/*!\n * ngCordova\n * v0.1.12-alpha\n * Copyright 2014 Drifty Co. http://drifty.com/\n * See LICENSE in this repository for license information\n */\n(function(){\nvar ngCordovaMocks = angular.module('ngCordovaMocks', []);\nngCordovaMocks.factory('$cordovaAppVersion', ['$q', function($q) {\n  var throwsError = false;\n  return {\n    throwsError: throwsError,\n    getAppVersion: function() {\n      var defer = $q.defer();\n      defer.resolve('mock v');\n      return defer.promise;\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaBarcodeScanner\n *\n * @description\n * A service for testing barcode scanner features\n * in an app build with ngCordova.\n**/ \nngCordovaMocks.factory('$cordovaBarcodeScanner', ['$q', function($q) {\n\tvar throwsError = false;\n\n\tvar scannedText = '';\n\tvar scannedFormat = '';\n\tvar wasCancelled = false;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaBarcodeScanner\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name scannedText\n\t\t * @propertyOf ngCordovaMocks.cordovaBarcodeScanner\n\t\t *\n\t\t * @description\n\t\t * Used to simulate the result.text property of a\n\t\t * successful scan. For more information, see the text at \n\t\t * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tscannedText: scannedText,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name scannedFormat\n\t\t * @propertyOf ngCordovaMocks.cordovaBarcodeScanner\n\t\t *\n\t\t * @description\n\t\t * Used to simulate the result.format property of a\n\t\t * successful scan. For more information, see the text at \n\t\t * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tscannedFormat: scannedFormat,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name wasCancelled\n\t\t * @propertyOf ngCordovaMocks.cordovaBarcodeScanner\n\t\t *\n\t\t * @description\n\t\t * Used to simulate the result.cancelled property of a\n\t\t * successful scan. For more information, see the text at \n\t\t * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\twasCancelled: wasCancelled,\n\n\t\tscan: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error scanning.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve({text: this.scannedText, format: this.scannedFormat, cancelled: this.wasCancelled });\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tencode: function(type, data) {\n\t\t\tthis.scannedFormat = type;\n\t\t\tthis.scannedText = data;\n\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error encoding the data.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\t\t\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaCamera\n *\n * @description\n * A service for testing camera features\n * in an app build with ngCordova.\n**/ \nngCordovaMocks.factory('$cordovaCamera', ['$q', function($q) {\n\tvar throwsError = false;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaCamera\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tthrowsError: throwsError,\n\n\t\tgetPicture: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the picture.');\n\t\t\t} else {\n\t\t\t\tif (options) {\n\t\t\t\t\toptions = options;\t// This is just to get by JSHint.\n\t\t\t\t}\n\n\t\t\t\tdefer.resolve();\t\t\t\t\t\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaCapture\n *\n * @description\n * A service for testing media capture\n * in an app build with ngCordova.\n *\n * @example\n */ \nngCordovaMocks.factory('$cordovaCapture', ['$q', function($q) {\n\tvar throwsError = false;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaCapture\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tthrowsError: throwsError,\n\n\t\tcaptureAudio : function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error capturing the audio.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tcaptureImage: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error capturing the image.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tcaptureVideo: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error capturing the video.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaContacts\n *\n * @description\n * A service for testing features related with contacts\n * in an app build with ngCordova.\n**/  \nngCordovaMocks.factory('$cordovaContacts', ['$q', function($q) {\n\tvar throwsError = false;\n\tvar contacts = [];\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaContacts\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc contacts\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaContacts\n\t\t *\n\t\t * @description\n\t\t * An in-memory collection of contacts.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tcontacts: contacts,\n\n\t\tsave: function(contact) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error saving the contact.');\n\t\t\t} else {\n\t\t\t\tvar existingIndex = null;\n\t\t\t\tfor (var i=0; i<this.contacts.length; i++) {\n\t\t\t\t\t// The actual implementation relies on the entire object match.\n\t\t\t\t\t// we're gong to rely on the ID.\n\t\t\t\t\tif (this.contacts[i].id === contact.id) {\n\t\t\t\t\t\texistingIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (existingIndex === null) {\n\t\t\t\t\tthis.contacts.push(contact);\n\t\t\t\t\tdefer.resolve();\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tdefer.reject('Contact already exists.');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tremove: function(contact) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error saving the contact.');\n\t\t\t} else {\n\t\t\t\tvar toRemove = null;\n\t\t\t\tfor (var i=0; i<this.contacts.length; i++) {\n\t\t\t\t\t// The actual implementation relies on the entire object match.\n\t\t\t\t\t// we're gong to rely on the ID.\n\t\t\t\t\tif (this.contacts[i].id === contact.id) {\n\t\t\t\t\t\ttoRemove = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (toRemove === null) {\n\t\t\t\t\tdefer.reject('Unable to find contact.');\n\t\t\t\t} else {\n\t\t\t\t\tthis.contacts.splice(toRemove, 1);\n\t\t\t\t\tdefer.resolve();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tfind: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error finding the contact.');\n\t\t\t} else {\n\t\t\t\tvar fields = options.fields || ['id', 'displayName'];\n\t\t\t\tdelete options.fields;\t\t\t\t\n\n\t\t\t\tif (!fields) {\n\t\t\t\t\tdefer.reject('ContactError.INVALID_ARGUMENT_ERROR');\n\t\t\t\t} else {\n\t\t\t\t\tif (fields === '*') {\n\t\t\t\t\t\tdefer.resolve(this.contacts);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Implement a very rudimentary search approach for testing purposes.\n\t\t\t\t\t\t// This is NOT exhaustive.\n\t\t\t\t\t\tvar results = [];\n\t\t\t\t\t\tfor (var i=0; i<this.contacts.length; i++) {\n\t\t\t\t\t\t\tfor(var key in this.contacts[i]) {\n\t\t\t\t\t\t\t\tvar propertyValue = this.contacts[i][key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// TODO: Search by individual fields\n\t\t\t\t\t\tdefer.resolve(results);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t}\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDatePicker\n *\n * @description\n * A service for testing datepicker features\n * in an app build with ngCordova.\n */\nngCordovaMocks.factory('$cordovaDatePicker', ['$q', function ($q) {\n  return {\n    show: function (options) {\n      var q = $q.defer();\n      options = options || {date: new Date(), mode: 'date'};\n      q.resolve(options.date);\n      return q.promise;\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDevice\n *\n * @description\n * A service for testing device information\n * in an app build with ngCordova.\n**/  \nngCordovaMocks.factory('$cordovaDevice', function () {\n\tvar device = '';\n\tvar cordova = '';\n\tvar model = '';\n\tvar platform = '';\n\tvar uuid = '';\n\tvar version = '';\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name device\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The name of the 'device'. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tdevice: device,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name cordova\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The version of cordova in use.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\n\t\tcordova: cordova,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name model\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The model of the device using the app.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tmodel: model,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name platform\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The name of the operating system in use.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tplatform: platform,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name uuid\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The unique identifier of a device.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tuuid: uuid,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name version\n\t\t * @propertyOf ngCordovaMocks.cordovaDevice\n\t\t *\n\t\t * @description\n\t\t * The version of the operating system.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tversion: version,\n\n\t\tgetDevice: function () {\n\t\t\treturn this.device;\n\t\t},\n\n\t\tgetCordova: function () {\n\t\t\treturn this.cordova;\n\t\t},\n\n\t\tgetModel: function () {\n\t\t\treturn this.model;\n\t\t},\n\n\t\tgetPlatform: function() {\n\t\t\treturn this.platform;\n\t\t},\n\n\t\tgetUUID: function() {\n\t\t\treturn this.uuid;\n\t\t},\n\n\t\tgetVersion: function() {\n\t\t\treturn this.version;\n\t\t}\n\t};\n});\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDeviceMotion\n *\n * @description\n * A service for mocking the accelerometer\n * in an app build with ngCordova.\n**/  \nngCordovaMocks.factory('$cordovaDeviceMotion', ['$interval', '$q', function ($interval, $q) {\n\tvar currentAcceleration = null;\n\tvar throwsError = false;\n\tvar positions = [];\n\tvar watchIntervals = [];\n\n\treturn {\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name currentAcceleration\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceMotion\n\t\t *\n\t\t * @description\n\t\t * The current acceleration. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\n\t\tcurrentAcceleration: currentAcceleration,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceMotion\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name positions\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceMotion\n\t\t *\n\t\t * @description\n\t\t * The collection of 'positions' that have been logged.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tpositions: positions,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name watchIntervals\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceMotion\n\t\t *\n\t\t * @description\n\t\t * The collection of watchers that are currently active.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\twatchIntervals: watchIntervals,\n\n\t\tgetCurrentAcceleration: function () {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the current acceleration.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve(this.currentAcceleration);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\twatchAcceleration : function (options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tvar watchId = Math.floor((Math.random() * 1000000) + 1);\n\n\t\t\tthis.positions = [];\n\t\t\tself = this;\n\t\t\t\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error watching the current acceleration.');\n\t\t\t} else {\n\t\t\t\tvar delay = 10000;\t\t// The default based on https://github.com/apache/cordova-plugin-device-motion/blob/master/doc/index.md\n\t\t\t\tif (options && options.frequency) {\n\t\t\t\t\tdelay = options.frequency;\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\tthis.watchIntervals.push($interval(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tif (self.throwsError) {\n\t\t\t\t\t\t\tdefer.reject('There was an error watching the acceleration.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Generate a random position\n\t\t\t\t\t\tvar randomX = Math.floor((Math.random() * 100) + 1);\n\t\t\t\t\t\tvar randomY = Math.floor((Math.random() * 100) + 1);\n\t\t\t\t\t\tvar randomZ = Math.floor((Math.random() * 100) + 1);\n\t\t\t\t\t\tvar result = { x: randomX, y: randomY, z:randomZ, timestamp:Date.now() };\n\n\t\t\t\t\t\tself.positions.push(result);\n\t\t\t\t\t\tdefer.notify(result);\t\n\t\t\t\t\t}, \n\t\t\t\t\tdelay\n\t\t\t\t));\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\twatchId: watchId,\n\t\t\t\tpromise: defer.promise\n\t\t\t};\n\t\t},\n\n\t\tclearWatch: function (watchId) {\n\t\t\tvar defer = $q.defer();\t\t\t\n\t\t\tif (watchId) {\n\t\t\t\tif (this.throwsError) {\n\t\t\t\t\tdefer.reject('Unable to clear watch.');\n\t\t\t\t} else {\n\t\t\t\t\tvar removed = -1;\n\t\t\t\t\tfor (var i=0; i<this.watchIntervals.length; i++) {\n\t\t\t\t\t\tif (this.watchIntervals[i].watchId === watchId) {\n\t\t\t\t\t\t\t$interval.cancel(watchIntervals[i].interval);\n\t\t\t\t\t\t\tremoved = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (removed !== -1) {\n\t\t\t\t\t\tthis.watchIntervals.splice(removed, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdefer.reject('Unable to clear watch. No watch ID provided.');\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n /**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDeviceOrientation\n *\n * @description\n * A service for testing compass fetures\n * in an app build with ngCordova.\n */\nngCordovaMocks.factory('$cordovaDeviceOrientation', ['$interval', '$q', function ($interval, $q) {\n\tvar currentHeading = null;\n\tvar throwsError = false;\n\tvar readings = [];\n\tvar watchIntervals = [];\n\n\treturn {\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name currentHeading\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceOrientation\n\t\t *\n\t\t * @description\n\t\t * The current heading.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tcurrentHeading: currentHeading,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceOrientation\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name positions\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceOrientation\n\t\t *\n\t\t * @description\n\t\t * The collection of compass 'readings' that have been logged.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\treadings: readings,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name watchIntervals\n\t\t * @propertyOf ngCordovaMocks.cordovaDeviceOrientation\n\t\t *\n\t\t * @description\n\t\t * The collection of watchers that are currently active.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\twatchIntervals: watchIntervals,\n\n\t\tgetCurrentHeading: function () {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the current heading.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve(this.currentHeading);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\twatchHeading: function (options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tvar watchID = Math.floor((Math.random() * 1000000) + 1);\n\t\t\tvar self = this;\n\n\t\t\tself.readings = [];\n\n\t\t\tif (self.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the compass heading.');\n\t\t\t} else {\n\t\t\t\tvar delay = 100;\t\t// The default based on https://github.com/apache/cordova-plugin-device-orientation/blob/master/doc/index.md\n\t\t\t\tif (options && options.frequency) {\n\t\t\t\t\tdelay = options.frequency;\n\t\t\t\t}\n\n\t\t\t\tself.watchIntervals.push({\n\t\t\t\t\twatchID: watchID,\n\t\t\t\t\tinterval: $interval(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif (self.throwsError) {\n\t\t\t\t\t\t\t\tdefer.reject('There was an error watching the acceleration.');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Generate a random position\n\t\t\t\t\t\t\tvar magneticHeading = (Math.random() * 359.99) + 1;\n\t\t\t\t\t\t\tvar trueHeading = (Math.random() * 359.99) + 1;\n\t\t\t\t\t\t\tvar headingAccuracy = Math.floor((Math.random() * 360) + 1);\n\t\t\t\t\t\t\tvar result = { magneticHeading: magneticHeading, trueHeading: trueHeading, headingAccuracy:headingAccuracy, timestamp:Date.now() };\n\n\t\t\t\t\t\t\tself.readings.push(result);\n\t\t\t\t\t\t\tdefer.notify(result);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdelay\n\t\t\t\t\t)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvar cancel = function(id) {\n\t\t\t\tvar removed = -1;\n\t\t\t\tfor (var i=0; i<self.watchIntervals.length; i++) {\n\t\t\t\t\tif (self.watchIntervals[i].watchID === id) {\n\t\t\t\t\t\t$interval.cancel(watchIntervals[i].interval);\n\t\t\t\t\t\tremoved = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (removed !== -1) {\n\t\t\t\t\tself.watchIntervals.splice(removed, 1);\n\t\t\t\t}\n\t\t\t};\n\n      defer.promise.cancel = function() {\n      \tcancel(watchID);\n      };\n\n      defer.promise.clearWatch = function(id) {\n      \tcancel(id || watchID);\n      };\n\n      defer.promise.watchID = watchID;\n\n      return defer.promise;\n\t\t},\n\n\t\tclearWatch: function (watchId) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (watchId) {\n\t\t\t\tif (this.throwsError) {\n\t\t\t\t\tdefer.reject('Unable to clear watch.');\n\t\t\t\t} else {\n\t\t\t\t\tvar removed = -1;\n\t\t\t\t\tfor (var i=0; i<this.watchIntervals.length; i++) {\n\t\t\t\t\t\tif (this.watchIntervals[i].watchId === watchId) {\n\t\t\t\t\t\t\t$interval.cancel(watchIntervals[i].interval);\n\t\t\t\t\t\t\tremoved = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (removed !== -1) {\n\t\t\t\t\t\tthis.watchIntervals.splice(removed, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdefer.reject('Unable to clear watch. No watch ID provided.');\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaDialogs\n *\n * @description\n * A service for testing dialogs\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaDialogs', ['$q', function ($q) {\n\tvar dialogText = false;\n\tvar dialogTitle = '';\n\tvar defaultValue = '';\n\tvar promptResponse = '';\n\tvar beepCount = 0;\n\tvar useHostAbilities = true;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name dialogText\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * The main content in the dialog.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tdialogText: dialogText,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name dialogTitle\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * The title of the dialog.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tdialogTitle: dialogTitle,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name defaultValue\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * The default value to be used in a prompt.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tdefaultValue: defaultValue,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name promptResponse\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * Used to simulate a user's response to a prompt.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tpromptResponse: promptResponse,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name buttonLabels\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * An array of the text of each button in the dialog.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tbuttonLabels: [],\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name beepCount\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * The number of times a beep has occurred.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tbeepCount: beepCount,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name useHostAbilities\n\t\t * @propertyOf ngCordovaMocks.cordovaDialogs\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether or not to try and use the host's \n\t\t * (browser or otherwise) prompting capabilities.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tuseHostAbilities: useHostAbilities,\t\t\n\n\t\talert: function(message, title, buttonName) {\n\t\t\tvar d = $q.defer();\n\n\t\t\tif (this.useHostAbilities) {\n\t\t\t\t// NOTE: The window.alert method doesn't support a title or callbacks.\t\t\t\t\n\t\t\t\talert(message);\n\t\t\t\td.resolve();\n\t\t\t} else {\n\t\t\t\tthis.dialogText = message;\n\t\t\t\tthis.dialogTitle = title;\n\t\t\t\tthis.buttonLabels.push(buttonName);\t\t\t\t\n\t\t\t\td.resolve();\n\t\t\t}\n\t\t\t\n\t\t\treturn d.promise;\n\t\t},\n\n\t\tconfirm: function(message, title, buttonName) {\n\t\t\tvar d = $q.defer();\n\n\t\t\tif (this.useHostAbilities) {\n\t\t\t\t// NOTE: The window.confirm method doesn't support a title or custom button naming.\n\t\t\t\tvar result = confirm(message);\n\t\t\t\td.resolve(result ? 2 : 1);\n\t\t\t} else {\n\t\t\t\tthis.dialogText = message;\n\t\t\t\tthis.dialogTitle = title;\n\t\t\t\tthis.buttonLabels.push(buttonName);\t\t\t\t\n\t\t\t\td.resolve(0);\n\t\t\t}\n\n\t\t\treturn d.promise;\n\t\t},\n\n\t\tprompt: function(message, title, buttonLabels, defaultText) {\n\t\t\tvar d = $q.defer();\n\n\t\t\tif (this.useHostAbilities) {\n\t\t\t\t// NOTE: The window.prompt method doesn't support a title or custom button naming.\n\t\t\t\tvar result = prompt(message, defaultText);\n\t\t\t\td.resolve(result);\n\t\t\t} else {\n\t\t\t\tthis.dialogText = message;\n\t\t\t\tthis.dialogTitle = title;\n\t\t\t\tthis.defaultValue = defaultText;\n\n\t\t\t\tfor (var i=0; i<buttonLabels.length; i++) {\n\t\t\t\t\tthis.buttonLabels.push(buttonLabels[i]);\n\t\t\t\t}\n\n\t\t\t\td.resolve(this.promptResponse);\n\t\t\t}\n\n\t\t\treturn d.promise;\n\t\t},\n\n\t\tbeep: function(times) {\n\t\t\tthis.beepCount = times;\n\t\t}\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaFile\n *\n * @description\n * A service for testing interaction with device directories and files\n * in an app build with ngCordova.\n */\nngCordovaMocks.factory('$cordovaFile', ['$q', function($q) {\n\tvar throwsError = false;\n\tvar fileSystem = {};\n    var shouldMockFiles = false;\n    var files = {};\n\n\tvar mockIt = function(errorMessage) {\n\t\tvar defer = $q.defer();\n\t\tif (this.throwsError) {\n\t\t\tdefer.reject(errorMessage);\n\t\t} else {\n\t\t\tdefer.resolve();\n\t\t}\n\t\treturn defer.promise;\n\t};\n\n\treturn {\n    /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaFile\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not.\n\t\t * This property should only be used in automated tests.\n\t\t **/\n\t\tthrowsError: throwsError,\n\n    /**\n\t\t * @ngdoc property\n\t\t * @name fileSystem\n\t\t * @propertyOf ngCordovaMocks.cordovaFile\n\t\t *\n\t\t * @description\n\t\t * A fake, in-memory file system. This is incomplete at this time.\n\t\t * This property should only be used in automated tests.\n\t\t **/\t\t\n\t\tfileSystem: fileSystem,\n\n        /**\n         * @ngdoc property\n         * @name shouldMockFiles\n         * @propertyOf ngCordovaMocks.cordovaFile\n         *\n         * @description\n         * A flag that signals whether one wish to mock files.\n         * This is useful if you need mocks specific file scenarios.\n         * This property should only be used in automated tests.\n         **/\n        shouldMockFiles: shouldMockFiles,\n\n        /**\n         * @ngdoc property\n         * @name files\n         * @propertyOf ngCordovaMocks.cordovaFile\n         *\n         * @description\n         * An object that may be used for mocking files on the device.\n         * This property should only be used in automated tests.\n         *\n         * **/\n        files : files,\n\n        checkDir: function(directory) {\n            if(this.shouldMockFiles){\n                var defer = $q.defer();\n                if(this.files[directory] && !this.files[directory].isFile){\n                    defer.resolve();\n                }\n                else{\n                    defer.reject();\n                }\n                return defer.promise;\n            }\n\n            return mockIt.call(this, 'There was an error checking the directory.');\n        },\n\n        createDir: function(directory, overwrite) {\n            if(this.shouldMockFiles ){\n                var defer = $q.defer();\n                this.files[directory] = { isFile : false};\n                defer.resolve();\n                return defer.promise;\n            }\n            return mockIt.call(this, 'There was an error creating the directory.');\n        },\n\n\t\tlistDir: function(filePath) {\n\t\t \treturn mockIt.call(this, 'There was an error listing the directory');\n\t\t},\n\n        checkFile: function(filePath) {\n            if(this.shouldMockFiles){\n                var defer = $q.defer();\n                if(this.files[filePath] && this.files[filePath].isFile){\n                    defer.resolve();\n                }\n                else{\n                    defer.reject();\n                }\n                return defer.promise;\n            }\n            return mockIt.call(this, 'There was an error checking for the file.');\n        },\n\n\n        createFile: function(filePath,overwrite) {\n            if(this.shouldMockFiles){\n                var defer = $q.defer();\n                this.files[filePath] = {\n                    isFile : true,\n                    fileContent : ''\n                };\n                defer.resolve();\n                return defer.promise;\n            }\n\n            return mockIt.call(this, 'There was an error creating the file.');\n        },\n\n\t\tremoveFile: function(directory, file) {\n\t\t\treturn mockIt.call(this,'There was an error removng the file.');\t\n\t\t},\n\n        writeFile: function(filePath,data,options) {\n            if(this.shouldMockFiles && filePath && data){\n                this.files[filePath] = {\n                    isFile : true,\n                    fileContent : data\n                };\n            }\n            return mockIt.call(this,'There was an error writing the file.');\n        },\n\n        readFile: function(filePath) {\n            return this.readAsText(filePath);\n        },\n\n        readAsText: function (filePath) {\n            if(this.shouldMockFiles){\n                var defer = $q.defer();\n                if(files[filePath] && files[filePath].isFile){\n                    defer.resolve(files[filePath].fileContent);\n                }\n                else{\n                    defer.reject();\n                }\n                return defer.promise;\n            }\n            return mockIt.call(this, 'There was an error reading the file as text.');\n        },\n\n\t\treadAsDataURL: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file as a data url.');\n\t\t},\n\n\t\treadAsBinaryString: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file as a binary string.');\n\t\t},\n\n\t\treadAsArrayBuffer: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file as an array buffer.');\n\t\t},\n\n\t\treadFileMetadata: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file metadata');\n\t\t},\n\n\t\treadFileAbsolute: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file from the absolute path');\n\t\t},\n\n\t\treadFileMetadataAbsolute: function (filePath) {\n\t\t\treturn mockIt.call(this, 'There was an error reading the file metadta from the absolute path');\n\t\t},\n\n\t\tdownloadFile: function(source, filePath, trust, options) {\n\t\t\treturn mockIt.call(this, 'There was an error downloading the file.');\t\n\t\t},\n\n\t\tuploadFile: function(server, filePath, options) {\n\t\t\treturn mockIt.call(this, 'There was an error uploading the file.');\t\n\t\t}\t\t\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaFileOpener2\n *\n * @description\n * A service for testing fileOpener2\n * in an app build with ngCordova.\n */\nngCordovaMocks.factory('$cordovaFileOpener2', ['$q', function ($q) {\n\n  var throwsError = false;\n\n  return {\n\n    /**\n     * @ngdoc property\n     * @name throwsError\n     * @propertyOf ngCordovaMocks.cordovaFileOpener2\n     *\n     * @description\n     * A flag that signals whether a promise should be rejected or not.\n     * This property should only be used in automated tests.\n     **/\n    throwsError: throwsError,\n\n    open: function (file, type) {\n\n      var defer = $q.defer();\n\n      if(this.throwError) {\n        defer.reject({\n          status: 0,\n          message: 'There was an error capturing the file.'\n        });\n      } else {\n        defer.resolve();\n      }\n\n      return defer.promise;\n\n    },\n\n    uninstall: function (pack) {\n\n      var defer = $q.defer();\n\n      if(this.throwError) {\n        defer.reject({\n          status: 0,\n          message: 'There was an error capturing the packageId.'\n        });\n      } else {\n        defer.resolve();\n      }\n\n      return defer.promise;\n\n    },\n\n    appIsInstalled: function (pack) {\n\n      var defer = $q.defer();\n\n      if(this.throwError) {\n        defer.reject({\n          status: 0,\n          message: 'There was an error capturing the packageId.'\n        });\n      } else {\n        defer.resolve();\n      }\n\n      return defer.promise;\n\n    }\n\n  };\n\n}]);\n\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaGeolocation\n *\n * @description\n * A service for testing location services\n * in an app build with ngCordova.\n */\nngCordovaMocks.factory('$cordovaGeolocation', ['$interval', '$q', function($interval, $q) {\n\tvar throwsError = false;\n\tvar useHostAbilities = true;\n\n\tvar watchIntervals = [];\n\tvar locations = [];\n\tvar currentPosition = null;\n\tvar nextPosition = null;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name watchIntervals\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * The collection of watchers that are currently active.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\twatchIntervals: watchIntervals,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name locations\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * The collection of 'locations' that have been logged.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tlocations: locations,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name currentPosition\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * The last location logged.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tcurrentPosition: currentPosition,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name nextPosition\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * The position to be logged the next time that a watcher\n\t\t * gets the location.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tnextPosition: nextPosition,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name useHostAbilities\n\t\t * @propertyOf ngCordovaMocks.cordovaGeolocation\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether or not to try and use the host's\n\t\t * (browser or otherwise) geolocation capabilities.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tuseHostAbilities: useHostAbilities,\n\n\t\tgetCurrentPosition: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the location.');\n\t\t\t} else {\n\t\t\t\tif (options) {\n\t\t\t\t\toptions = options;\t// This is just to get by JSHint.\n\t\t\t\t}\n\n\t\t\t\tif (this.useHostAbilities) {\n\t\t\t\t\tif (navigator.geolocation) {\n\t\t\t\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t\t\t\tfunction(position) {\n\t\t\t\t\t\t\t\tthis.currentPosition = position;\n\t\t\t\t\t\t\t\tdefer.resolve(this.currentPosition);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\t\tdefer.reject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdefer.reject('Geolocation is not supported by this browser.');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdefer.resolve(this.currentPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\twatchPosition: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tvar watchID = Math.floor((Math.random() * 1000000) + 1);\n\t\t\tvar self = this;\n\n\t\t\tself.locations = [];\n\n\t\t\tif (self.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the geolocation.');\n\t\t\t} else {\n\t\t\t\tvar delay = 1000;\n\t\t\t\tif (options && options.timeout) {\n\t\t\t\t\tdelay = options.timeout;\n\t\t\t\t}\n\n\t\t\t\tself.watchIntervals.push({\n\t\t\t\t\twatchID: watchID,\n\t\t\t\t\tinterval: $interval(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif (self.throwsError) {\n\t\t\t\t\t\t\t\tdefer.reject('There was an error watching the geolocation.');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Attempt to use nextPosition.\n\t\t\t\t\t\t\tvar result = self.nextPosition;\n\t\t\t\t\t\t\tif (result === null) {\n\t\t\t\t\t\t\t\t// Determine whether to use the host's geolocation capabilities or not\n\t\t\t\t\t\t\t\tif (self.useHostAbilities) {\n\t\t\t\t\t\t\t\t\tif (navigator.geolocation) {\n\t\t\t\t\t\t\t\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t\t\t\t\t\t\t\tfunction(position) {\n\t\t\t\t\t\t\t\t\t\t\t\tself.currentPosition = position;\n\t\t\t\t\t\t\t\t\t\t\t\tself.locations.push(position);\n\t\t\t\t\t\t\t\t\t\t\t\tdefer.resolve(position);\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\t\t\t\t\t\tdefer.reject(error);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdefer.reject('Geolocation is not supported by this browser.');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresult = {\n\t\t\t\t\t\t\t\t\t\tcoords: {\n\t\t\t\t\t\t\t\t\t\t\tlatitude: ((Math.random() * 180) + 1) - 90,\n\t\t\t\t\t\t\t\t\t\t\tlongitude: ((Math.random() * 360) + 1) - 180,\n\t\t\t\t\t\t\t\t\t\t\taltitude: ((Math.random() * 100) + 1),\n\n\t\t\t\t\t\t\t\t\t\t\taccuracy: ((Math.random() * 10) + 1),\n\t\t\t\t\t\t\t\t\t\t\taltitudeAccuracy: ((Math.random() * 10) + 1),\n\t\t\t\t\t\t\t\t\t\t\theading: ((Math.random() * 360) + 1),\n\t\t\t\t\t\t\t\t\t\t\tspeed: ((Math.random() * 100) + 1)\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tself.currentPosition = result;\n\t\t\t\t\t\t\t\t\tself.locations.push(result);\n\t\t\t\t\t\t\t\t\tdefer.notify(result);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdelay\n\t\t\t\t\t)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvar cancel = function(id) {\n\t\t\t\tvar removed = -1;\n\t\t\t\tfor (var i=0; i<self.watchIntervals.length; i++) {\n\t\t\t\t\tif (self.watchIntervals[i].watchID === id) {\n\t\t\t\t\t\t$interval.cancel(watchIntervals[i].interval);\n\t\t\t\t\t\tremoved = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (removed !== -1) {\n\t\t\t\t\tself.watchIntervals.splice(removed, 1);\n\t\t\t\t}\n\t\t\t};\n\n      defer.promise.cancel = function() {\n      \tcancel(watchID);\n      };\n\n      defer.promise.clearWatch = function(id) {\n      \tcancel(id || watchID);\n      };\n\n      defer.promise.watchID = watchID;\n\n      return defer.promise;\n\t\t},\n\n\t\tclearWatch: function (watchID) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (watchID) {\n\t\t\t\tif (this.throwsError) {\n\t\t\t\t\tdefer.reject('Unable to clear watch.');\n\t\t\t\t} else {\n\t\t\t\t\tvar removed = -1;\n\t\t\t\t\tfor (var i=0; i<this.watchIntervals.length; i++) {\n\t\t\t\t\t\tif (this.watchIntervals[i].watchID === watchID) {\n\t\t\t\t\t\t\t$interval.cancel(watchIntervals[i].interval);\n\t\t\t\t\t\t\tremoved = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (removed !== -1) {\n\t\t\t\t\t\tthis.watchIntervals.splice(removed, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdefer.reject('Unable to clear watch. No watch ID provided.');\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaGlobalization\n *\n * @description\n * A service for testing features related to a user's locale and timezone.\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaGlobalization', ['$q', function($q) {\n\tvar throwsError = false;\n    var language = (navigator.language) ?  navigator.language : \"en-US\";\n\tvar preferredLanguage = {value: language};\n\tvar firstDayOfWeek = 'Sunday';\n\tvar localeName = {value: language};\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaGlobalization\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name preferredLanguage\n\t\t * @propertyOf ngCordovaMocks.cordovaGlobalization\n\t\t *\n\t\t * @description\n\t\t * The user's preferred language.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\t\t\n\t\tpreferredLanguage: preferredLanguage,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name localeName\n\t\t * @propertyOf ngCordovaMocks.cordovaGlobalization\n\t\t *\n\t\t * @description\n\t\t * The name of the user's locale.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\n\t\tlocaleName: localeName,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name firstDayOfWeek\n\t\t * @propertyOf ngCordovaMocks.cordovaGlobalization\n\t\t *\n\t\t * @description\n\t\t * The first day of the week based on the user's locale.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\t\n\t\tfirstDayOfWeek: firstDayOfWeek,\n\n\t\tgetPreferredLanguage: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the preferred language.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve(this.preferredLanguage);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tgetLocaleName: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the locale name.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve(this.localeName);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tgetFirstDayOfWeek: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the first day of week.');\n\t\t\t} else {\n\t\t\t\tdefer.resolve(this.firstDayOfWeek);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tdateToString: function(date, options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the string from the date.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\tdate = date;\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tstringToDate: function(dateString, options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the date from the string.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\tdateString = dateString;\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\t\n\n\t\tgetDatePattern: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the date pattern.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tgetDateNames: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting the date names.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tisDayLightSavingsTime: function(date) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error getting if this is in daylight savings time mode.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\tdate = date;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tnumberToString: function(number, options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error convertng the number to a string.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\tnumber = number;\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tstringToNumber: function(numberString, options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error convertng the string to a number.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tgetNumberPattern: function(options) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error convertng the string to a number.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\toptions = options;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tgetCurrencyPattern: function(currencyCode) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error convertng the string to a number.');\n\t\t\t} else {\n\t\t\t\tvar result = '';\n\n\t\t\t\t// TODO: Review\n\t\t\t\tcurrencyCode = currencyCode;\n\t\t\t\t// END TODO: Review\n\n\t\t\t\tdefer.resolve(result);\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t}\t\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaKeyboard\n *\n * @description\n * A service for testing device keyboard features\n * in an app build with ngCordova.\n**/ \nngCordovaMocks.factory('$cordovaKeyboard', function() {\n  var isVisible=false;\n\t\n\treturn {\n    hideAccessoryBar: function (bool) {\n    },\n\n    close: function () {\n      isVisible = false;\n    },\n\n    show: function () {\n      isVisible = true;\n    },\n\n    disableScroll: function (bool) {\n    },\n   \n    isVisible: function () {\n      return isVisible;\n    }\n\n\t};\n});\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaNetwork\n *\n * @description\n * A service for testing networked fetures\n * in an app build with ngCordova.\n */  \nngCordovaMocks.factory('$cordovaNetwork', function () {\n\tvar connectionType = 'WiFi connection';\n\tvar isConnected = true;\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name connectionType\n\t\t * @propertyOf ngCordovaMocks.cordovaNetwork\n\t\t *\n\t\t * @description\n\t\t * They type of connection. Values should match those found at\n\t\t * https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\n\t\tconnectionType: connectionType,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name isConnected\n\t\t * @propertyOf ngCordovaMocks.cordovaNetwork\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether the app is connected to a network. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\n\t\tisConnected: isConnected,\n\n\t\tgetNetwork: function () {\n\t\t\treturn this.connectionType;\n\t\t},\n\n\t\tisOnline: function () {\n\t\t\treturn this.isConnected;\n\t\t},\n\n\t\tisOffline: function () {\n\t\t\treturn !this.isConnected;\n\t\t}\n\t};\n});\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaSocialSharing\n *\n * @description\n * A service for testing via social services\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaSocialSharing', ['$q', function($q) {\n\tvar throwsError = false;\n\tvar message = '';\n\tvar image = '';\n\tvar link = '';\n\tvar number = '';\n\n\tvar socialService = '';\n\tvar subject = '';\n\tvar toAddresses = [];\n\tvar bccAddresses = [];\n\tvar attachments = [];\n\n\treturn {\n        /**\n\t\t * @ngdoc property\n\t\t * @name throwsError\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether a promise should be rejected or not. \n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tthrowsError: throwsError,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name message\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * The message to be shared via a social service. \n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tmessage: message,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name image\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * An image to be shared via a social service. \n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\timage: image,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name link\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * A link to be shared via a social service.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tlink: link,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name number\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * A comma-delimited list of phone numbers to send a social message to.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tnumber: number,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name subject\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * The subject of an email.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tsubject: subject,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name toAddresses\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * An array of email addresses to send an email to.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\ttoAddresses: toAddresses,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name bccAddresses\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * An array of email addresses to blind carbon-copy an email to.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tbccAddresses: bccAddresses,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name socialService\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * The name of a social service to share content through.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tsocialService: socialService,\n\n        /**\n\t\t * @ngdoc property\n\t\t * @name attachments\n\t\t * @propertyOf ngCordovaMocks.cordovaSocialSharing\n\t\t *\n\t\t * @description\n\t\t * An array of attachments to include with an email to be sent.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tattachments: attachments,\n\n\t\tshareViaTwitter: function(message, image, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via Twitter.');\n\t\t\t} else {\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.image = image;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tshareViaWhatsApp: function(message, image, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via WhatsApp.');\n\t\t\t} else {\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.image = image;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tshareViaFacebook: function(message, image, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via Facebook.');\n\t\t\t} else {\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.image = image;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tshareViaSMS: function(message, number) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via SMS.');\n\t\t\t} else {\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.number = number;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tshareViaEmail: function(message, subject, toArr, bccArr, file) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via SMS.');\n\t\t\t} else {\n\t\t\t\t// These are added to get by JSHINT for now\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.subject = subject;\n\t\t\t\tthis.toAddresses = toArr;\n\t\t\t\tthis.bccAddressesc = bccArr;\n\t\t\t\tthis.attachments = file;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tcanShareViaEmail: function() {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject(false);\n\t\t\t} else {\n\t\t\t\tdefer.resolve(true);\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tcanShareVia: function(via, message, subject, file, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via SMS.');\n\t\t\t} else {\n\t\t\t\t// These are added to get by JSHINT for now\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.socialService = via;\n\t\t\t\tthis.subject = subject;\n\t\t\t\tthis.attachments = file;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\t\t\t\n\t\t},\n\n\t\tshareVia: function(via, message, subject, file, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via SMS.');\n\t\t\t} else {\n\t\t\t\tthis.socialService = via;\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.subject = subject;\n\t\t\t\tthis.attachments = file;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t},\n\n\t\tshare: function(message, subject, file, link) {\n\t\t\tvar defer = $q.defer();\n\t\t\tif (this.throwsError) {\n\t\t\t\tdefer.reject('There was an error sharing via SMS.');\n\t\t\t} else {\n\t\t\t\tthis.message = message;\n\t\t\t\tthis.subject = subject;\n\t\t\t\tthis.attachments = file;\n\t\t\t\tthis.link = link;\n\n\t\t\t\tdefer.resolve();\n\t\t\t}\n\t\t\treturn defer.promise;\n\t\t}\n\t};\n}]);\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaSplashscreen\n *\n * @description\n * A service for testing the splash screen\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaSplashscreen', function() {\n\tvar isVisible = false;\n\n\treturn {\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name isVisible\n\t\t * @propertyOf ngCordovaMocks.cordovaSplashscreen\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether the splash screen is visible or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tisVisible: isVisible,\n\n\t\thide: function() {\n\t\t\t// do nothing. everything happens behind the scenes in this case.\n\t\t\t// its a stub that is present for completeness.\n\t\t\tthis.isVisible = false;\n\t\t\treturn true;\n\t\t},\n\t\tshow: function() {\n\t\t\t// do nothing. everything happens behind the scenes in this case.\n\t\t\t// its a stub that is present for completeness.\n\t\t\tthis.isVisible = true;\n\t\t\treturn true;\n\t\t}\n\t};\n});\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaStatusbar\n *\n * @description\n * A service for testing the status bar\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaStatusbar', function() {\n\tvar isStatusBarVisible = true;\n\tvar canOverlayWebView = true;\n\n\treturn {\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name isStatusBarVisible\n\t\t * @propertyOf ngCordovaMocks.cordovaStatusbar\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether the status bar is visible or not.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\n\t\tisStatusBarVisible: isStatusBarVisible,\n\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name canOverlayWebView\n\t\t * @propertyOf ngCordovaMocks.cordovaStatusbar\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether the status bar can overlay the web view.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\n\t\tcanOverlayWebView: canOverlayWebView,\n\n\t\toverlaysWebView: function(bool) {\n\t\t\tthis.canOverlayWebView = bool;\n\t\t},\n\n\t\tstyle: function(style) {\n\t\t\t// TODO: Review\n\t\t\treturn style;\n\t\t},\n\n\t\tstyleHex: function(colorHex) {\n\t\t\t// TODO: review\n\t\t\treturn colorHex;\n\t\t},\n\n\t\tstyleColor: function(color) {\n\t\t\t// TODO: review\n\t\t\treturn color;\n\t\t},\n\n\t\thide: function() {\n\t\t\tthis.isStatusBarVisible = false;\n\t\t},\n\n\t\tshow: function() {\n\t\t\tthis.isStatusBarVisible = true;\n\t\t},\n\n\t\tisVisible: function () {\n\t\t\treturn this.isStatusBarVisible;\n\t\t}\n\t};\n});\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaToast\n *\n * @description\n * A service for testing toasts\n * in an app build with ngCordova.\n *\n * @example\n */\nngCordovaMocks.factory('$cordovaToast', ['$q', function ($q) {\n  var throwsError = false;\n\n  return {\n    /**\n     * @ngdoc property\n     * @name throwsError\n     * @propertyOf ngCordovaMocks.cordovaToast\n     *\n     * @description\n     * A flag that signals whether a promise should be rejected or not.\n     * This property should only be used in automated tests.\n     **/\n    throwsError: throwsError,\n\n    showShortTop: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    showShortCenter: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    showShortBottom: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    showLongTop: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    showLongCenter: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    showLongBottom: function (message) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    },\n    show: function (message, duration, position) {\n      var defer = $q.defer();\n      if (this.throwsError) {\n        defer.reject('There was an error showing the toast.');\n      } else {\n        defer.resolve();\n      }\n      return defer.promise;\n    }\n  };\n}]);\n\n/**\n * @ngdoc service\n * @name ngCordovaMocks.cordovaVibration\n *\n * @description\n * A service for testing vibration\n * in an app build with ngCordova.\n */ \nngCordovaMocks.factory('$cordovaVibration', ['$timeout', function($timeout) {\n\tvar isVibrating = false;\n\tvar vibrateTimer = null;\n\n\treturn {\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name vibrateTimer\n\t\t * @propertyOf ngCordovaMocks.cordovaVibration\n\t\t *\n\t\t * @description\n\t\t * Access to the timer associated with vibration.\n\t\t * This property should only be used in automated tests.\n\t\t**/\n\t\tvibrateTimer: vibrateTimer,\n\n\t\t/**\n\t\t * @ngdoc property\n\t\t * @name isVibrating\n\t\t * @propertyOf ngCordovaMocks.cordovaVibration\n\t\t *\n\t\t * @description\n\t\t * A flag that signals whether vibration is active.\n\t\t * This property should only be used in automated tests.\n\t\t**/\t\t\t\t\n\t\tisVibrating: isVibrating,\n\n\t\tvibrate: function(time) {\n\t\t\tif (time > 0) {\n\t\t\t\tthis.isVibrating = true;\n\t\t\t\tself = this;\n\n\t\t\t\tif (time instanceof Array) {\n\t\t\t\t\t// TODO: Implement pattern here.\n\t\t\t\t\t// The following is a temporary timer that just looks at the first value\n\t\t\t\t\tthis.vibrateTimer = $timeout(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tself.isVibrating = false;\n\t\t\t\t\t\t\tself.vibrateTimer = null;\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttime[0]\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tthis.vibrateTimer = $timeout(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tself.isVibrating = false;\n\t\t\t\t\t\t\tself.vibrateTimer = null;\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttime\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/* jshint ignore:start */\n\t\tvibrateWithPattern: function(pattern, repeat) {\n\t\t\t// Based on the documentation (https://github.com/apache/cordova-plugin-vibration/blob/master/doc/index.md)\n\t\t\t// This method is deprecated. For that reason, this isn't implemented at this time.\n\t\t},\n\t\t/* jshint ignore:end */\n\n\t\tcancelVibration: function() {\n\t\t\tif (this.vibrateTimer !== null) {\n\t\t\t\tif (this.isVibrating === true) {\n\t\t\t\t\t$timeout.cancel(this.vibrateTimer);\n\t\t\t\t\tthis.isVibrating = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}]);\n})();"
  },
  {
    "path": "www/lib/ngCordova/dist/ng-cordova.js",
    "content": "/*!\n * ngCordova\n * v0.1.12-alpha\n * Copyright 2014 Drifty Co. http://drifty.com/\n * See LICENSE in this repository for license information\n */\n(function(){\n\nangular.module('ngCordova', [\n  'ngCordova.plugins'\n]);\n\n// install  :     cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-actionsheet.git\n// link     :     https://github.com/EddyVerbruggen/cordova-plugin-actionsheet\n\nangular.module('ngCordova.plugins.actionSheet', [])\n\n  .factory('$cordovaActionSheet', ['$q', '$window', function ($q, $window) {\n\n    return {\n      show: function (options) {\n        var q = $q.defer();\n\n        $window.plugins.actionsheet.show(options, function (result) {\n          q.resolve(result);\n        });\n\n        return q.promise;\n      },\n\n      hide: function () {\n        return $window.plugins.actionsheet.hide();\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-admob.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-admob\n\nangular.module('ngCordova.plugins.adMob', [])\n\n  .factory('$cordovaAdMob', ['$q', '$window', function ($q, $window) {\n\n    return {\n      createBannerView: function (options) {\n        var d = $q.defer();\n\n        $window.plugins.AdMob.createBannerView(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createInterstitialView: function (options) {\n        var d = $q.defer();\n\n        $window.plugins.AdMob.createInterstitialView(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      requestAd: function (options) {\n        var d = $q.defer();\n\n        $window.plugins.AdMob.requestAd(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showAd: function (options) {\n        var d = $q.defer();\n\n        $window.plugins.AdMob.showAd(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      requestInterstitialAd: function (options) {\n        var d = $q.defer();\n\n        $window.plugins.AdMob.requestInterstitialAd(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/ohh2ahh/AppAvailability.git\n// link     :     https://github.com/ohh2ahh/AppAvailability\n\nangular.module('ngCordova.plugins.appAvailability', [])\n\n  .factory('$cordovaAppAvailability', ['$q', function ($q) {\n\n    return {\n      check: function (urlScheme) {\n        var q = $q.defer();\n\n        appAvailability.check(urlScheme, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/pushandplay/cordova-plugin-apprate.git\n// link     :     https://github.com/pushandplay/cordova-plugin-apprate\n\nangular.module('ngCordova.plugins.appRate', [])\n\n  .provider(\"$cordovaAppRate\", [function () {\n\n\n    this.setPreferences = function (defaults) {\n      if (!defaults || !angular.isObject(defaults)) {\n        return;\n      }\n\n      AppRate.preferences.useLanguage = defaults.language || null;\n      AppRate.preferences.displayAppName = defaults.appName || \"\";\n      AppRate.preferences.promptAgainForEachNewVersion = defaults.promptForNewVersion || true;\n      AppRate.preferences.openStoreInApp = defaults.openStoreInApp || false;\n      AppRate.preferences.usesUntilPrompt = defaults.usesUntilPrompt || 3;\n      AppRate.preferences.useCustomRateDialog = defaults.useCustomRateDialog || false;\n      AppRate.preferences.storeAppURL.ios = defaults.iosURL || null;\n      AppRate.preferences.storeAppURL.android = defaults.androidURL || null;\n      AppRate.preferences.storeAppURL.blackberry = defaults.blackberryURL || null;\n      AppRate.preferences.storeAppURL.windows8 = defaults.windowsURL || null;\n    };\n\n\n    this.setCustomLocale = function (customObj) {\n      var strings = {\n        title: 'Rate %@',\n        message: 'If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!',\n        cancelButtonLabel: 'No, Thanks',\n        laterButtonLabel: 'Remind Me Later',\n        rateButtonLabel: 'Rate It Now'\n      };\n\n      strings = angular.extend(strings, customObj);\n\n      AppRate.preferences.customLocale = strings;\n    };\n\n    this.$get = ['$q', function ($q) {\n      return {\n        promptForRating: function (immediate) {\n          var q = $q.defer();\n          var prompt = AppRate.promptForRating(immediate);\n          q.resolve(prompt);\n\n          return q.promise;\n        },\n\n        navigateToAppStore: function () {\n          var q = $q.defer();\n          var navigate = AppRate.navigateToAppStore();\n          q.resolve(navigate);\n\n          return q.promise;\n        },\n\n        onButtonClicked: function (cb) {\n          AppRate.onButtonClicked = function (buttonIndex) {\n            cb.call(this, buttonIndex);\n          };\n        },\n\n        onRateDialogShow: function (cb) {\n          AppRate.onRateDialogShow = cb();\n        }\n      };\n    }];\n  }]);\n\n// install   :     cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git\n// link      :     https://github.com/whiteoctober/cordova-plugin-app-version\n\nangular.module('ngCordova.plugins.appVersion', [])\n\n  .factory('$cordovaAppVersion', ['$q', function ($q) {\n\n    return {\n      getAppVersion: function () {\n        var q = $q.defer();\n        cordova.getAppVersion(function (version) {\n          q.resolve(version);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add https://github.com/christocracy/cordova-plugin-background-geolocation.git\n// link      :     https://github.com/christocracy/cordova-plugin-background-geolocation\n\nangular.module('ngCordova.plugins.backgroundGeolocation', [])\n\n  .factory('$cordovaBackgroundGeolocation', ['$q', '$window', function ($q, $window) {\n\n    return {\n\n      init: function () {\n        $window.navigator.geolocation.getCurrentPosition(function (location) {\n          return location;\n        });\n      },\n\n      configure: function (options) {\n\n        this.init();\n        var q = $q.defer();\n\n        $window.plugins.backgroundGeoLocation.configure(\n          function (result) {\n            q.notify(result);\n            $window.plugins.backgroundGeoLocation.finish();\n          },\n          function (err) {\n            q.reject(err);\n          }, options);\n\n        this.start();\n\n        return q.promise;\n      },\n\n      start: function () {\n        var q = $q.defer();\n\n        $window.plugins.backgroundGeoLocation.start(\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n\n        return q.promise;\n      },\n\n      stop: function () {\n        var q = $q.defer();\n\n        $window.plugins.backgroundGeoLocation.stop(\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n\n        return q.promise;\n      }\n    };\n  }\n  ]);\n\n// install  :     cordova plugin add de.appplant.cordova.plugin.badge\n// link     :     https://github.com/katzer/cordova-plugin-badge\n\nangular.module('ngCordova.plugins.badge', [])\n\n  .factory('$cordovaBadge', ['$q', function ($q) {\n\n    return {\n      hasPermission: function () {\n        var q = $q.defer();\n        cordova.plugins.notification.badge.hasPermission(function (permission) {\n          if (permission) {\n            q.resolve(true);\n          }\n          else {\n            q.reject(\"You do not have permission\");\n          }\n        });\n\n        return q.promise;\n      },\n\n      promptForPermission: function () {\n        return cordova.plugins.notification.badge.promptForPermission();\n      },\n\n      set: function (number) {\n        var q = $q.defer();\n\n        cordova.plugins.notification.badge.hasPermission(function (permission) {\n          if (permission) {\n            q.resolve(cordova.plugins.notification.badge.set(number));\n          }\n          else {\n            q.reject(\"You do not have permission to set Badge\");\n          }\n        });\n        return q.promise;\n      },\n\n      get: function () {\n        var q = $q.defer();\n        cordova.plugins.notification.badge.hasPermission(function (permission) {\n          if (permission) {\n            cordova.plugins.notification.badge.get(function (badge) {\n              q.resolve(badge);\n            });\n          } else {\n            q.reject(\"You do not have permission to get Badge\");\n          }\n        });\n\n        return q.promise;\n      },\n\n      clear: function () {\n        var q = $q.defer();\n\n        cordova.plugins.notification.badge.hasPermission(function (permission) {\n          if (permission) {\n            q.resolve(cordova.plugins.notification.badge.clear());\n          }\n          else {\n            q.reject(\"You do not have permission to clear Badge\");\n          }\n        });\n        return q.promise;\n      },\n\n      configure: function (config) {\n        return cordova.plugins.notification.badge.configure(config);\n      }\n    };\n  }]);\n\n// install  :    cordova plugin add https://github.com/wildabeast/BarcodeScanner.git\n// link     :    https://github.com/wildabeast/BarcodeScanner/#using-the-plugin\n\nangular.module('ngCordova.plugins.barcodeScanner', [])\n\n  .factory('$cordovaBarcodeScanner', ['$q', function ($q) {\n\n    return {\n      scan: function () {\n        var q = $q.defer();\n\n        cordova.plugins.barcodeScanner.scan(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      encode: function (type, data) {\n        var q = $q.defer();\n        type = type || \"TEXT_TYPE\";\n\n        cordova.plugins.barcodeScanner.encode(type, data, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n//  install   :   cordova plugin add org.apache.cordova.battery-status\n//  link      :   https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.batteryStatus', [])\n\n  .factory('$cordovaBatteryStatus', ['$rootScope', '$window', '$timeout', function ($rootScope, $window, $timeout) {\n\n    var batteryStatus = function (status) {\n      $timeout(function () {\n        $rootScope.$broadcast('$cordovaBatteryStatus:status', status);\n      });\n    };\n\n    var batteryCritical = function (status) {\n      $timeout(function () {\n        $rootScope.$broadcast('$cordovaBatteryStatus:critical', status);\n      });\n    };\n\n    var batteryLow = function (status) {\n      $timeout(function () {\n        $rootScope.$broadcast('$cordovaBatteryStatus:low', status);\n      });\n    };\n\n    document.addEventListener(\"deviceready\", function () {\n      if (navigator.battery) {\n        $window.addEventListener('batterystatus', batteryStatus, false);\n        $window.addEventListener('batterycritical', batteryCritical, false);\n        $window.addEventListener('batterylow', batteryLow, false);\n\n      }\n    }, false);\n    return true;\n  }])\n  .run(['$cordovaBatteryStatus', function ($cordovaBatteryStatus) {\n  }]);\n\n//  install   :   cordova plugin add https://github.com/don/cordova-plugin-ble-central#:/plugin\n//  link      :   https://github.com/don/cordova-plugin-ble-central\n\nangular.module('ngCordova.plugins.ble', [])\n\n  .factory('$cordovaBLE', ['$q', function ($q) {\n\n    return {\n      scan: function (services, seconds) {\n        var q = $q.defer();\n        ble.scan(services, seconds, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      connect: function (deviceID) {\n        var q = $q.defer();\n        ble.connect(deviceID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      disconnect: function (deviceID) {\n        var q = $q.defer();\n        ble.disconnect(deviceID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      read: function (deviceID, serviceUUID, characteristicUUID) {\n        var q = $q.defer();\n        ble.read(deviceID, serviceUUID, characteristicUUID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      write: function (deviceID, serviceUUID, characteristicUUID, data) {\n        var q = $q.defer();\n        ble.write(deviceID, serviceUUID, characteristicUUID, data, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      writeCommand: function (deviceID, serviceUUID, characteristicUUID, data) {\n        var q = $q.defer();\n        ble.writeCommand(deviceID, serviceUUID, characteristicUUID, data, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      notify: function (deviceID, serviceUUID, characteristicUUID) {\n        var q = $q.defer();\n        ble.notify(deviceID, serviceUUID, characteristicUUID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      indicate: function (deviceID, serviceUUID, characteristicUUID) {\n        var q = $q.defer();\n        ble.indicate(deviceID, serviceUUID, characteristicUUID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      isConnected: function (deviceID) {\n        var q = $q.defer();\n        ble.isConnected(deviceID, function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      isEnabled: function () {\n        var q = $q.defer();\n        ble.isEnabled(function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add com.megster.cordova.bluetoothserial\n// link      :     https://github.com/don/BluetoothSerial\n\nangular.module('ngCordova.plugins.bluetoothSerial', [])\n\n  .factory('$cordovaBluetoothSerial', ['$q', '$window', function ($q, $window) {\n\n    return {\n      connect: function (address) {\n        var q = $q.defer();\n        $window.bluetoothSerial.connect(address, function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      // not supported on iOS\n      connectInsecure: function (address) {\n        var q = $q.defer();\n        $window.bluetoothSerial.connectInsecure(address, function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      disconnect: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.disconnect(function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      list: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.list(function (data) {\n          q.resolve(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      isEnabled: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.isEnabled(function () {\n          q.resolve();\n        }, function () {\n          q.reject();\n        });\n        return q.promise;\n      },\n\n\n      isConnected: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.isConnected(function () {\n          q.resolve();\n        }, function () {\n          q.reject();\n        });\n        return q.promise;\n      },\n\n\n      available: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.available(function (data) {\n          q.resolve(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      read: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.read(function (data) {\n          q.resolve(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      readUntil: function (delimiter) {\n        var q = $q.defer();\n        $window.bluetoothSerial.readUntil(delimiter, function (data) {\n          q.resolve(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      write: function (data) {\n        var q = $q.defer();\n        $window.bluetoothSerial.write(data, function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      subscribe: function (delimiter) {\n        var q = $q.defer();\n        $window.bluetoothSerial.subscribe(delimiter, function (data) {\n          q.notify(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      subscribeRawData: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.subscribeRawData(function (data) {\n          q.notify(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      unsubscribe: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.unsubscribe(function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      unsubscribeRawData: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.unsubscribeRawData(function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      clear: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.clear(function () {\n          q.resolve();\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      readRSSI: function () {\n        var q = $q.defer();\n        $window.bluetoothSerial.readRSSI(function (data) {\n          q.resolve(data);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install  :    cordova plugin add https://github.com/fiscal-cliff/phonegap-plugin-brightness.git\n// link     :    https://github.com/fiscal-cliff/phonegap-plugin-brightness\n\nangular.module('ngCordova.plugins.brightness', [])\n\n  .factory('$cordovaBrightness', ['$q', '$window', function ($q, $window) {\n\n    return {\n      get: function () {\n        var q = $q.defer();\n\n        $window.cordova.plugins.brightness.getBrightness(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      set: function (data) {\n        var q = $q.defer();\n\n        $window.cordova.plugins.brightness.setBrightness(data, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      setKeepScreenOn: function (bool) {\n        var q = $q.defer();\n\n        $window.cordova.plugins.brightness.setKeepScreenOn(bool, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n\n\n\n// install  :     cordova plugin add https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin.git\n// link     :     https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin\n\nangular.module('ngCordova.plugins.calendar', [])\n\n  .factory('$cordovaCalendar', ['$q', '$window', function ($q, $window) {\n    return {\n      createCalendar: function (options) {\n        var d = $q.defer(),\n          createCalOptions = $window.plugins.calendar.getCreateCalendarOptions();\n\n        if (typeof options === 'string') {\n          createCalOptions.calendarName = options;\n        } else {\n          createCalOptions = angular.extend(createCalOptions, options);\n        }\n\n        $window.plugins.calendar.createCalendar(createCalOptions, function (message) {\n          d.resolve(message);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      deleteCalendar: function (calendarName) {\n        var d = $q.defer();\n\n        $window.plugins.calendar.deleteCalendar(calendarName, function (message) {\n          d.resolve(message);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      createEvent: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.createEvent(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      createEventWithOptions: function (options) {\n        var d = $q.defer(),\n          defaultOptionKeys = [],\n          calOptions = window.plugins.calendar.getCalendarOptions(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null\n          };\n\n        defaultOptionKeys = Object.keys(defaultOptions);\n\n        for (var key in options) {\n          if (defaultOptionKeys.indexOf(key) === -1) {\n            calOptions[key] = options[key];\n          } else {\n            defaultOptions[key] = options[key];\n          }\n        }\n\n        $window.plugins.calendar.createEventWithOptions(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          calOptions,\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      createEventInteractively: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.createEventInteractively(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      createEventInNamedCalendar: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null,\n            calendarName: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.createEventInNamedCalendar(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          defaultOptions.calendarName,\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      findEvent: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.findEvent(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          function (foundEvent) {\n            d.resolve(foundEvent);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      listEventsInRange: function (startDate, endDate) {\n        var d = $q.defer();\n\n        $window.plugins.calendar.listEventsInRange(startDate, endDate, function (events) {\n          d.resolve(events);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      listCalendars: function () {\n        var d = $q.defer();\n\n        $window.plugins.calendar.listCalendars(function (calendars) {\n          d.resolve(calendars);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      findAllEventsInNamedCalendar: function (calendarName) {\n        var d = $q.defer();\n\n        $window.plugins.calendar.findAllEventsInNamedCalendar(calendarName, function (events) {\n          d.resolve(events);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      modifyEvent: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            title: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null,\n            newTitle: null,\n            newLocation: null,\n            newNotes: null,\n            newStartDate: null,\n            newEndDate: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.modifyEvent(\n          defaultOptions.title,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          defaultOptions.newTitle,\n          defaultOptions.newLocation,\n          defaultOptions.newNotes,\n          new Date(defaultOptions.newStartDate),\n          new Date(defaultOptions.newEndDate),\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      },\n\n      deleteEvent: function (options) {\n        var d = $q.defer(),\n          defaultOptions = {\n            newTitle: null,\n            location: null,\n            notes: null,\n            startDate: null,\n            endDate: null\n          };\n\n        defaultOptions = angular.extend(defaultOptions, options);\n\n        $window.plugins.calendar.deleteEvent(\n          defaultOptions.newTitle,\n          defaultOptions.location,\n          defaultOptions.notes,\n          new Date(defaultOptions.startDate),\n          new Date(defaultOptions.endDate),\n          function (message) {\n            d.resolve(message);\n          }, function (error) {\n            d.reject(error);\n          }\n        );\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :   cordova plugin add org.apache.cordova.camera\n// link      :   https://github.com/apache/cordova-plugin-camera/blob/master/doc/index.md#orgapachecordovacamera\n\nangular.module('ngCordova.plugins.camera', [])\n\n  .factory('$cordovaCamera', ['$q', function ($q) {\n\n    return {\n      getPicture: function (options) {\n        var q = $q.defer();\n\n        if (!navigator.camera) {\n          q.resolve(null);\n          return q.promise;\n        }\n\n        navigator.camera.getPicture(function (imageData) {\n          q.resolve(imageData);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      },\n\n      cleanup: function () {\n        var q = $q.defer();\n\n        navigator.camera.cleanup(function () {\n          q.resolve();\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :    cordova plugin add org.apache.cordova.media-capture\n// link      :    https://github.com/apache/cordova-plugin-media-capture/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.capture', [])\n\n  .factory('$cordovaCapture', ['$q', function ($q) {\n\n    return {\n      captureAudio: function (options) {\n        var q = $q.defer();\n\n        if (!navigator.device.capture) {\n          q.resolve(null);\n          return q.promise;\n        }\n\n        navigator.device.capture.captureAudio(function (audioData) {\n          q.resolve(audioData);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      },\n      captureImage: function (options) {\n        var q = $q.defer();\n\n        if (!navigator.device.capture) {\n          q.resolve(null);\n          return q.promise;\n        }\n\n        navigator.device.capture.captureImage(function (imageData) {\n          q.resolve(imageData);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      },\n      captureVideo: function (options) {\n        var q = $q.defer();\n\n        if (!navigator.device.capture) {\n          q.resolve(null);\n          return q.promise;\n        }\n\n        navigator.device.capture.captureVideo(function (videoData) {\n          q.resolve(videoData);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add https://github.com/VersoSolutions/CordovaClipboard\n// link      :     https://github.com/VersoSolutions/CordovaClipboard\n\nangular.module('ngCordova.plugins.clipboard', [])\n\n  .factory('$cordovaClipboard', ['$q', '$window', function ($q, $window) {\n\n    return {\n      copy: function (text) {\n        var q = $q.defer();\n\n        $window.cordova.plugins.clipboard.copy(text,\n          function () {\n            q.resolve();\n          }, function () {\n            q.reject();\n          });\n\n        return q.promise;\n      },\n\n      paste: function () {\n        var q = $q.defer();\n\n        $window.cordova.plugins.clipboard.paste(function (text) {\n          q.resolve(text);\n        }, function () {\n          q.reject();\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.contacts\n// link      :     https://github.com/apache/cordova-plugin-contacts/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.contacts', [])\n\n  .factory('$cordovaContacts', ['$q', function ($q) {\n\n    return {\n      save: function (contact) {\n        var q = $q.defer();\n        var deviceContact = navigator.contacts.create(contact);\n\n        deviceContact.save(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n        return q.promise;\n      },\n\n      remove: function (contact) {\n        var q = $q.defer();\n        var deviceContact = navigator.contacts.create(contact);\n\n        deviceContact.remove(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n        return q.promise;\n      },\n\n      clone: function (contact) {\n        var deviceContact = navigator.contacts.create(contact);\n        return deviceContact.clone(contact);\n      },\n\n      find: function (options) {\n        var q = $q.defer();\n        var fields = options.fields || ['id', 'displayName'];\n        delete options.fields;\n\n        navigator.contacts.find(fields, function (results) {\n          q.resolve(results);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      },\n\n      pickContact: function () {\n        var q = $q.defer();\n\n        navigator.contacts.pickContact(function (contact) {\n          q.resolve(contact);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n\n      // TODO: method to set / get ContactAddress\n      // TODO: method to set / get ContactError\n      // TODO: method to set / get ContactField\n      // TODO: method to set / get ContactName\n      // TODO: method to set / get ContactOrganization\n    };\n  }]);\n\n// install   :      cordova plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git\n// link      :      https://github.com/VitaliiBlagodir/cordova-plugin-datepicker\n\nangular.module('ngCordova.plugins.datePicker', [])\n  .factory('$cordovaDatePicker', ['$window', '$q', function ($window, $q) {\n    return {\n      show: function (options) {\n        var q = $q.defer();\n        options = options || {date: new Date(), mode: 'date'};\n        $window.datePicker.show(options, function (date) {\n          q.resolve(date);\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.device\n// link      :     https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.device', [])\n\n  .factory('$cordovaDevice', [function () {\n\n    return {\n      /**\n       * Returns the whole device object.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md\n       * @returns {Object} The device object.\n       */\n      getDevice: function () {\n        return device;\n      },\n\n      /**\n       * Returns the Cordova version.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#devicecordova\n       * @returns {String} The Cordova version.\n       */\n      getCordova: function () {\n        return device.cordova;\n      },\n\n      /**\n       * Returns the name of the device's model or product.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#devicemodel\n       * @returns {String} The name of the device's model or product.\n       */\n      getModel: function () {\n        return device.model;\n      },\n\n      /**\n       * @deprecated device.name is deprecated as of version 2.3.0. Use device.model instead.\n       * @returns {String}\n       */\n      getName: function () {\n        return device.name;\n      },\n\n      /**\n       * Returns the device's operating system name.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceplatform\n       * @returns {String} The device's operating system name.\n       */\n      getPlatform: function () {\n        return device.platform;\n      },\n\n      /**\n       * Returns the device's Universally Unique Identifier.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceuuid\n       * @returns {String} The device's Universally Unique Identifier\n       */\n      getUUID: function () {\n        return device.uuid;\n      },\n\n      /**\n       * Returns the operating system version.\n       * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceversion\n       * @returns {String}\n       */\n      getVersion: function () {\n        return device.version;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.device-motion\n// link      :     https://github.com/apache/cordova-plugin-device-motion/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.deviceMotion', [])\n\n  .factory('$cordovaDeviceMotion', ['$q', function ($q) {\n\n    return {\n      getCurrentAcceleration: function () {\n        var q = $q.defer();\n\n        navigator.accelerometer.getCurrentAcceleration(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      watchAcceleration: function (options) {\n        var q = $q.defer();\n\n        var watchID = navigator.accelerometer.watchAcceleration(function (result) {\n          q.notify(result);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        q.promise.cancel = function () {\n          navigator.accelerometer.clearWatch(watchID);\n        };\n\n        q.promise.clearWatch = function (id) {\n          navigator.accelerometer.clearWatch(id || watchID);\n        };\n\n        q.promise.watchID = watchID;\n\n        return q.promise;\n      },\n\n      clearWatch: function (watchID) {\n        return navigator.accelerometer.clearWatch(watchID);\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.device-orientation\n// link      :     https://github.com/apache/cordova-plugin-device-orientation/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.deviceOrientation', [])\n\n  .factory('$cordovaDeviceOrientation', ['$q', function ($q) {\n\n    return {\n      getCurrentHeading: function () {\n        var q = $q.defer();\n\n        navigator.compass.getCurrentHeading(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      watchHeading: function (options) {\n        var q = $q.defer();\n\n        var watchID = navigator.compass.watchHeading(function (result) {\n          q.notify(result);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        q.promise.cancel = function () {\n          navigator.compass.clearWatch(watchID);\n        };\n\n        q.promise.clearWatch = function (id) {\n          navigator.compass.clearWatch(id || watchID);\n        };\n\n        q.promise.watchID = watchID;\n\n        return q.promise;\n      },\n\n      clearWatch: function (watchID) {\n        return navigator.compass.clearWatch(watchID);\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.dialogs\n// link      :     https://github.com/apache/cordova-plugin-dialogs/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.dialogs', [])\n\n  .factory('$cordovaDialogs', ['$q', '$window', function ($q, $window) {\n\n    return {\n      alert: function (message, title, buttonName) {\n        var q = $q.defer();\n\n        if (!$window.navigator.notification) {\n          $window.alert(message);\n          q.resolve();\n        }\n        else {\n          navigator.notification.alert(message, function () {\n            q.resolve();\n          }, title, buttonName);\n        }\n\n        return q.promise;\n      },\n\n      confirm: function (message, title, buttonLabels) {\n        var q = $q.defer();\n\n        if (!$window.navigator.notification) {\n          if ($window.confirm(message)) {\n            q.resolve(1);\n          }\n          else {\n            q.resolve(2);\n          }\n        }\n        else {\n          navigator.notification.confirm(message, function (buttonIndex) {\n            q.resolve(buttonIndex);\n          }, title, buttonLabels);\n        }\n\n        return q.promise;\n      },\n\n      prompt: function (message, title, buttonLabels, defaultText) {\n        var q = $q.defer();\n\n        if (!$window.navigator.notification) {\n          var res = $window.prompt(message, defaultText);\n          if (res !== null) {\n            q.resolve({input1: res, buttonIndex: 1});\n          }\n          else {\n            q.resolve({input1: res, buttonIndex: 2});\n          }\n        }\n        else {\n          navigator.notification.prompt(message, function (result) {\n            q.resolve(result);\n          }, title, buttonLabels, defaultText);\n        }\n        return q.promise;\n      },\n\n      beep: function (times) {\n        return navigator.notification.beep(times);\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git@0.8.2\n// link     :     https://github.com/katzer/cordova-plugin-email-composer\n\nangular.module('ngCordova.plugins.emailComposer', [])\n\n  .factory('$cordovaEmailComposer', ['$q', function ($q) {\n\n    return {\n      isAvailable: function () {\n        var q = $q.defer();\n\n        cordova.plugins.email.isAvailable(function (isAvailable) {\n          isAvailable ? q.resolve() : q.reject();\n        });\n\n        return q.promise;\n      },\n\n      open: function (properties) {\n        var q = $q.defer();\n\n        cordova.plugins.email.open(properties, function () {\n          q.reject(); // user closed email composer\n        });\n\n        return q.promise;\n      },\n\n      addAlias: function (app, schema) {\n        cordova.plugins.email.addAlias(app, schema);\n      }\n    };\n  }]);\n\n// install   :   cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID=\"123456789\" --variable APP_NAME=\"myApplication\"\n// link      :   https://github.com/Wizcorp/phonegap-facebook-plugin\n\nangular.module('ngCordova.plugins.facebook', [])\n\n  .provider('$cordovaFacebook', [function () {\n\n    this.browserInit = function (id, version) {\n      this.appID = id;\n      this.appVersion = version || \"v2.0\";\n      facebookConnectPlugin.browserInit(this.appID, this.appVersion);\n    };\n\n    this.$get = ['$q', function ($q) {\n      return {\n        login: function (permissions) {\n          var q = $q.defer();\n          facebookConnectPlugin.login(permissions, function (res) {\n            q.resolve(res);\n          }, function (res) {\n            q.reject(res);\n          });\n\n          return q.promise;\n        },\n\n        showDialog: function (options) {\n          var q = $q.defer();\n          facebookConnectPlugin.showDialog(options, function (res) {\n            q.resolve(res);\n          }, function (err) {\n            q.reject(err);\n          });\n          return q.promise;\n        },\n\n        api: function (path, permissions) {\n          var q = $q.defer();\n          facebookConnectPlugin.api(path, permissions, function (res) {\n            q.resolve(res);\n          }, function (err) {\n            q.reject(err);\n          });\n          return q.promise;\n        },\n\n        getAccessToken: function () {\n          var q = $q.defer();\n          facebookConnectPlugin.getAccessToken(function (res) {\n            q.resolve(res);\n          }, function (err) {\n            q.reject(err);\n          });\n          return q.promise;\n        },\n\n        getLoginStatus: function () {\n          var q = $q.defer();\n          facebookConnectPlugin.getLoginStatus(function (res) {\n            q.resolve(res);\n          }, function (err) {\n            q.reject(err);\n          });\n          return q.promise;\n        },\n\n        logout: function () {\n          var q = $q.defer();\n          facebookConnectPlugin.logout(function (res) {\n            q.resolve(res);\n          }, function (err) {\n            q.reject(err);\n          });\n          return q.promise;\n        }\n      };\n    }];\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-facebookads.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-facebookads\n\nangular.module('ngCordova.plugins.facebookAds', [])\n  .factory('$cordovaFacebookAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.FacebookAds.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.FacebookAds.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.FacebookAds.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.FacebookAds.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.FacebookAds.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.FacebookAds.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.FacebookAds.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.FacebookAds.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.file\n// link      :     https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.file', [])\n\n  .constant(\"$cordovaFileError\", {\n    1: 'NOT_FOUND_ERR',\n    2: 'SECURITY_ERR',\n    3: 'ABORT_ERR',\n    4: 'NOT_READABLE_ERR',\n    5: 'ENCODING_ERR',\n    6: 'NO_MODIFICATION_ALLOWED_ERR',\n    7: 'INVALID_STATE_ERR',\n    8: 'SYNTAX_ERR',\n    9: 'INVALID_MODIFICATION_ERR',\n    10: 'QUOTA_EXCEEDED_ERR',\n    11: 'TYPE_MISMATCH_ERR',\n    12: 'PATH_EXISTS_ERR'\n  })\n\n  .provider('$cordovaFile', [function () {\n\n    this.$get = ['$q', '$window', '$cordovaFileError', function ($q, $window, $cordovaFileError) {\n\n      return {\n\n        getFreeDiskSpace: function() {\n            var q = $q.defer();\n            cordova.exec(function(result) {\n                q.resolve(result);\n            }, function(error) {\n                q.reject(error);\n            }, \"File\", \"getFreeDiskSpace\", []);\n            return q.promise;\n        },\n\n        checkDir: function (path, dir) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(dir))) {\n            q.reject(\"directory cannot start with \\/\")\n          }\n\n          try {\n            var directory = path + dir;\n            $window.resolveLocalFileSystemURL(directory, function (fileSystem) {\n              if (fileSystem.isDirectory === true) {\n                q.resolve(fileSystem);\n              } else {\n                q.reject({code: 13, message: \"input is not a directory\"});\n              }\n            }, function (error) {\n              error.message = $cordovaFileError[error.code];\n              q.reject(error);\n            });\n          } catch (err) {\n            err.message = $cordovaFileError[err.code];\n            q.reject(err);\n          }\n\n          return q.promise;\n        },\n\n\n        checkFile: function (path, file) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(file))) {\n            q.reject(\"directory cannot start with \\/\")\n          }\n\n          try {\n            var directory = path + file;\n            $window.resolveLocalFileSystemURL(directory, function (fileSystem) {\n              if (fileSystem.isFile === true) {\n                q.resolve(fileSystem);\n              } else {\n                q.reject({code: 13, message: \"input is not a file\"});\n              }\n            }, function (error) {\n              error.message = $cordovaFileError[error.code];\n              q.reject(error);\n            });\n          } catch (err) {\n            err.message = $cordovaFileError[err.code];\n            q.reject(err);\n          }\n\n          return q.promise;\n        },\n\n        createDir: function (path, dirName, replaceBool) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(dirName))) {\n            q.reject(\"directory cannot start with \\/\")\n          }\n\n          replaceBool = replaceBool ? false : true;\n\n          var options = {\n            create: true,\n            exclusive: replaceBool\n          };\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getDirectory(dirName, options, function (result) {\n                q.resolve(result);\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n        createFile: function (path, fileName, replaceBool) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(fileName))) {\n            q.reject(\"file-name cannot start with \\/\")\n          }\n\n          replaceBool = replaceBool ? false : true;\n\n          var options = {\n            create: true,\n            exclusive: replaceBool\n          };\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, options, function (result) {\n                q.resolve(result);\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n\n        removeDir: function (path, dirName) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(dirName))) {\n            q.reject(\"file-name cannot start with \\/\")\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getDirectory(dirName, {create: false}, function (dirEntry) {\n                dirEntry.remove(function () {\n                  q.resolve({success: true, fileRemoved: dirEntry});\n                }, function (error) {\n                  error.message = $cordovaFileError[error.code];\n                  q.reject(error);\n                });\n              }, function (err) {\n                err.message = $cordovaFileError[err.code];\n                q.reject(err);\n              });\n            }, function (er) {\n              er.message = $cordovaFileError[er.code];\n              q.reject(er);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n        removeFile: function (path, fileName) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(fileName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, {create: false}, function (fileEntry) {\n                fileEntry.remove(function () {\n                  q.resolve({success: true, fileRemoved: fileEntry});\n                }, function (error) {\n                  error.message = $cordovaFileError[error.code];\n                  q.reject(error);\n                });\n              }, function (err) {\n                err.message = $cordovaFileError[err.code];\n                q.reject(err);\n              });\n            }, function (er) {\n              er.message = $cordovaFileError[er.code];\n              q.reject(er);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n        removeRecursively: function (path, dirName) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(dirName))) {\n            q.reject(\"file-name cannot start with \\/\")\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getDirectory(dirName, {create: false}, function (dirEntry) {\n                dirEntry.removeRecursively(function () {\n                  q.resolve({success: true, fileRemoved: dirEntry});\n                }, function (error) {\n                  error.message = $cordovaFileError[error.code];\n                  q.reject(error);\n                });\n              }, function (err) {\n                err.message = $cordovaFileError[err.code];\n                q.reject(err);\n              });\n            }, function (er) {\n              er.message = $cordovaFileError[er.code];\n              q.reject(er);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n        writeFile: function (path, fileName, text, replaceBool) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(fileName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          replaceBool = replaceBool ? false : true;\n\n          var options = {\n            create: true,\n            exclusive: replaceBool\n          };\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, options, function (fileEntry) {\n                fileEntry.createWriter(function (writer) {\n                  if (options.append === true) {\n                    writer.seek(writer.length);\n                  }\n\n                  if (options.truncate) {\n                    writer.truncate(options.truncate);\n                  }\n\n                  writer.onwriteend = function (evt) {\n                    if (this.error) {\n                      q.reject(this.error);\n                    }\n                    else {\n                      q.resolve(evt);\n                    }\n                  };\n\n                  writer.write(text);\n\n                  q.promise.abort = function () {\n                    writer.abort();\n                  };\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n\n        writeExistingFile: function (path, fileName, text) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(fileName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, {create: false}, function (fileEntry) {\n                fileEntry.createWriter(function (writer) {\n                  writer.seek(writer.length);\n\n                  writer.onwriteend = function (evt) {\n                    if (this.error) {\n                      q.reject(this.error);\n                    }\n                    else {\n                      q.resolve(evt);\n                    }\n                  };\n\n                  writer.write(text);\n\n                  q.promise.abort = function () {\n                    writer.abort();\n                  };\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n\n        readAsText: function (path, file) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(file))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(file, {create: false}, function (fileEntry) {\n                fileEntry.file(function (fileData) {\n                  var reader = new FileReader();\n\n                  reader.onloadend = function (evt) {\n                    if (evt.target._result !== undefined || evt.target._result !== null) {\n                      q.resolve(evt.target._result);\n                    }\n                    else if (evt.target._error !== undefined || evt.target._error !== null) {\n                      q.reject(evt.target._error);\n                    }\n                    else {\n                      q.reject({code: null, message: 'READER_ONLOADEND_ERR'});\n                    }\n                  };\n\n                  reader.readAsText(fileData);\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n\n        readAsDataURL: function (path, file) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(file))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(file, {create: false}, function (fileEntry) {\n                fileEntry.file(function (fileData) {\n                  var reader = new FileReader();\n                  reader.onloadend = function (evt) {\n                    if (evt.target._result !== undefined || evt.target._result !== null) {\n                      q.resolve(evt.target._result);\n                    }\n                    else if (evt.target._error !== undefined || evt.target._error !== null) {\n                      q.reject(evt.target._error);\n                    }\n                    else {\n                      q.reject({code: null, message: 'READER_ONLOADEND_ERR'});\n                    }\n                  };\n                  reader.readAsDataURL(fileData);\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n        readAsBinaryString: function (path, file) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(file))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(file, {create: false}, function (fileEntry) {\n                fileEntry.file(function (fileData) {\n                  var reader = new FileReader();\n                  reader.onloadend = function (evt) {\n                    if (evt.target._result !== undefined || evt.target._result !== null) {\n                      q.resolve(evt.target._result);\n                    }\n                    else if (evt.target._error !== undefined || evt.target._error !== null) {\n                      q.reject(evt.target._error);\n                    }\n                    else {\n                      q.reject({code: null, message: 'READER_ONLOADEND_ERR'});\n                    }\n                  };\n                  reader.readAsBinaryString(fileData);\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n        readAsArrayBuffer: function (path, file) {\n          var q = $q.defer();\n\n          if ((/^\\//.test(file))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(file, {create: false}, function (fileEntry) {\n                fileEntry.file(function (fileData) {\n                  var reader = new FileReader();\n                  reader.onloadend = function (evt) {\n                    if (evt.target._result !== undefined || evt.target._result !== null) {\n                      q.resolve(evt.target._result);\n                    }\n                    else if (evt.target._error !== undefined || evt.target._error !== null) {\n                      q.reject(evt.target._error);\n                    }\n                    else {\n                      q.reject({code: null, message: 'READER_ONLOADEND_ERR'});\n                    }\n                  };\n                  reader.readAsArrayBuffer(fileData);\n                });\n              }, function (error) {\n                error.message = $cordovaFileError[error.code];\n                q.reject(error);\n              });\n            }, function (err) {\n              err.message = $cordovaFileError[err.code];\n              q.reject(err);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n\n          return q.promise;\n        },\n\n\n        moveFile: function (path, fileName, newPath, newFileName) {\n          var q = $q.defer();\n\n          newFileName = newFileName || fileName;\n\n          if ((/^\\//.test(fileName)) || (/^\\//.test(newFileName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, {create: false}, function (fileEntry) {\n                $window.resolveLocalFileSystemURL(newPath, function (newFileEntry) {\n                  fileEntry.moveTo(newFileEntry, newFileName, function (result) {\n                    q.resolve(result);\n                  }, function (error) {\n                    q.reject(error);\n                  });\n                }, function (err) {\n                  q.reject(err);\n                });\n              }, function (err) {\n                q.reject(err);\n              });\n            }, function (er) {\n              q.reject(er);\n            });\n          } catch (e) {\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n        moveDir: function (path, dirName, newPath, newDirName) {\n          var q = $q.defer();\n\n          newDirName = newDirName || dirName;\n\n          if (/^\\//.test(dirName) || (/^\\//.test(newDirName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getDirectory(dirName, {create: false}, function (dirEntry) {\n                $window.resolveLocalFileSystemURL(newPath, function (newDirEntry) {\n                  dirEntry.moveTo(newDirEntry, newDirName, function (result) {\n                    q.resolve(result);\n                  }, function (error) {\n                    q.reject(error);\n                  });\n                }, function (erro) {\n                  q.reject(erro);\n                });\n              }, function (err) {\n                q.reject(err);\n              });\n            }, function (er) {\n              q.reject(er);\n            });\n          } catch (e) {\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n\n        copyDir: function (path, dirName, newPath, newDirName) {\n          var q = $q.defer();\n\n          newDirName = newDirName || dirName;\n\n          if (/^\\//.test(dirName) || (/^\\//.test(newDirName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getDirectory(dirName, {create: false, exclusive: false}, function (dirEntry) {\n\n                $window.resolveLocalFileSystemURL(newPath, function (newDirEntry) {\n                  dirEntry.copyTo(newDirEntry, newDirName, function (result) {\n                    q.resolve(result);\n                  }, function (error) {\n                    error.message = $cordovaFileError[error.code];\n                    q.reject(error);\n                  });\n                }, function (erro) {\n                  erro.message = $cordovaFileError[erro.code];\n                  q.reject(erro);\n                });\n              }, function (err) {\n                err.message = $cordovaFileError[err.code];\n                q.reject(err);\n              });\n            }, function (er) {\n              er.message = $cordovaFileError[er.code];\n              q.reject(er);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        },\n\n        copyFile: function (path, fileName, newPath, newFileName) {\n          var q = $q.defer();\n\n          newFileName = newFileName || fileName;\n\n          if ((/^\\//.test(fileName))) {\n            q.reject(\"file-name cannot start with \\/\");\n          }\n\n          try {\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n              fileSystem.getFile(fileName, {create: false, exclusive: false}, function (fileEntry) {\n\n                $window.resolveLocalFileSystemURL(newPath, function (newFileEntry) {\n                  fileEntry.copyTo(newFileEntry, newFileName, function (result) {\n                    q.resolve(result);\n                  }, function (error) {\n                    error.message = $cordovaFileError[error.code];\n                    q.reject(error);\n                  });\n                }, function (erro) {\n                  erro.message = $cordovaFileError[erro.code];\n                  q.reject(erro);\n                });\n              }, function (err) {\n                err.message = $cordovaFileError[err.code];\n                q.reject(err);\n              });\n            }, function (er) {\n              er.message = $cordovaFileError[er.code];\n              q.reject(er);\n            });\n          } catch (e) {\n            e.message = $cordovaFileError[e.code];\n            q.reject(e);\n          }\n          return q.promise;\n        }\n\n        /*\n         listFiles: function (path, dir) {\n\n         },\n\n         listDir: function (path, dirName) {\n         var q = $q.defer();\n\n         try {\n         $window.resolveLocalFileSystemURL(path, function (fileSystem) {\n         fileSystem.getDirectory(dirName, options, function (parent) {\n         var reader = parent.createReader();\n         reader.readEntries(function (entries) {\n         q.resolve(entries);\n         }, function () {\n         q.reject('DIR_READ_ERROR : ' + path + dirName);\n         });\n         }, function (error) {\n         error.message = $cordovaFileError[error.code];\n         q.reject(error);\n         });\n         }, function (err) {\n         err.message = $cordovaFileError[err.code];\n         q.reject(err);\n         });\n         } catch (e) {\n         e.message = $cordovaFileError[e.code];\n         q.reject(e);\n         }\n\n         return q.promise;\n         },\n\n         readFileMetadata: function (filePath) {\n         //return getFile(filePath, {create: false});\n         }\n         */\n      };\n\n    }];\n  }]);\n\n// install   :      cordova plugin add https://github.com/pwlin/cordova-plugin-file-opener2\n// link      :      https://github.com/pwlin/cordova-plugin-file-opener2\n\nangular.module('ngCordova.plugins.fileOpener2', [])\n\n  .factory('$cordovaFileOpener2', ['$q', function ($q) {\n\n    return {\n      open: function (file, type) {\n        var q = $q.defer();\n        cordova.plugins.fileOpener2.open(file, type, {\n          error: function (e) {\n            q.reject(e);\n          }, success: function () {\n            q.resolve();\n          }\n        });\n        return q.promise;\n      },\n\n      uninstall: function (pack) {\n        var q = $q.defer();\n        cordova.plugins.fileOpener2.uninstall(pack, {\n          error: function (e) {\n            q.reject(e);\n          }, success: function () {\n            q.resolve();\n          }\n        });\n        return q.promise;\n      },\n\n      appIsInstalled: function (pack) {\n        var q = $q.defer();\n        cordova.plugins.fileOpener2.appIsInstalled(pack, {\n          success: function (res) {\n            q.resolve(res);\n          }\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.file-transfer\n// link      :     https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.fileTransfer', [])\n\n  .factory('$cordovaFileTransfer', ['$q', '$timeout', function ($q, $timeout) {\n    return {\n      download: function (source, filePath, options, trustAllHosts) {\n        var q = $q.defer();\n        var ft = new FileTransfer();\n        var uri = (options && options.encodeURI === false) ? source : encodeURI(source);\n\n        if (options && options.timeout !== undefined && options.timeout !== null) {\n          $timeout(function () {\n            ft.abort();\n          }, options.timeout);\n          options.timeout = null;\n        }\n\n        ft.onprogress = function (progress) {\n          q.notify(progress);\n        };\n\n        q.promise.abort = function () {\n          ft.abort();\n        };\n\n        ft.download(uri, filePath, q.resolve, q.reject, trustAllHosts, options);\n        return q.promise;\n      },\n\n      upload: function (server, filePath, options, trustAllHosts) {\n        var q = $q.defer();\n        var ft = new FileTransfer();\n        var uri = (options && options.encodeURI === false) ? server : encodeURI(server);\n\n        if (options && options.timeout !== undefined && options.timeout !== null) {\n          $timeout(function () {\n            ft.abort();\n          }, options.timeout);\n          options.timeout = null;\n        }\n\n        ft.onprogress = function (progress) {\n          q.notify(progress);\n        };\n\n        q.promise.abort = function () {\n          ft.abort();\n        };\n\n        ft.upload(filePath, uri, q.resolve, q.reject, options, trustAllHosts);\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git\n// link      :     https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin\n\nangular.module('ngCordova.plugins.flashlight', [])\n\n  .factory('$cordovaFlashlight', ['$q', '$window', function ($q, $window) {\n\n    return {\n      available: function () {\n        var q = $q.defer();\n        $window.plugins.flashlight.available(function (isAvailable) {\n          q.resolve(isAvailable);\n        });\n        return q.promise;\n      },\n\n      switchOn: function () {\n        var q = $q.defer();\n        $window.plugins.flashlight.switchOn(function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      switchOff: function () {\n        var q = $q.defer();\n        $window.plugins.flashlight.switchOff(function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      toggle: function () {\n        var q = $q.defer();\n        $window.plugins.flashlight.toggle(function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-flurry.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-flurry\n\nangular.module('ngCordova.plugins.flurryAds', [])\n  .factory('$cordovaFlurryAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.FlurryAds.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.FlurryAds.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.FlurryAds.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.FlurryAds.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.FlurryAds.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.FlurryAds.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.FlurryAds.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.FlurryAds.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add https://github.com/phonegap-build/GAPlugin.git\n// link      :     https://github.com/phonegap-build/GAPlugin\n\nangular.module('ngCordova.plugins.ga', [])\n\n  .factory('$cordovaGA', ['$q', '$window', function ($q, $window) {\n\n    return {\n      init: function (id, mingap) {\n        var q = $q.defer();\n        mingap = (mingap >= 0) ? mingap : 10;\n        $window.plugins.gaPlugin.init(function (result) {\n            q.resolve(result);\n          },\n          function (error) {\n            q.reject(error);\n          },\n          id, mingap);\n        return q.promise;\n      },\n\n      trackEvent: function (success, fail, category, eventAction, eventLabel, eventValue) {\n        var q = $q.defer();\n        $window.plugins.gaPlugin.trackEvent(function (result) {\n            q.resolve(result);\n          },\n          function (error) {\n            q.reject(error);\n          },\n          category, eventAction, eventLabel, eventValue);\n        return q.promise;\n      },\n\n      trackPage: function (success, fail, pageURL) {\n        var q = $q.defer();\n        $window.plugins.gaPlugin.trackPage(function (result) {\n            q.resolve(result);\n          },\n          function (error) {\n            q.reject(error);\n          },\n          pageURL);\n        return q.promise;\n      },\n\n      setVariable: function (success, fail, index, value) {\n        var q = $q.defer();\n        $window.plugins.gaPlugin.setVariable(function (result) {\n            q.resolve(result);\n          },\n          function (error) {\n            q.reject(error);\n          },\n          index, value);\n        return q.promise;\n      },\n\n      exit: function (success, fail) {\n        var q = $q.defer();\n        $window.plugins.gaPlugin.exit(function (result) {\n            q.resolve(result);\n          },\n          function (error) {\n            q.reject(error);\n          });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.geolocation\n// link      :     https://github.com/apache/cordova-plugin-geolocation/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.geolocation', [])\n\n  .factory('$cordovaGeolocation', ['$q', function ($q) {\n\n    return {\n      getCurrentPosition: function (options) {\n        var q = $q.defer();\n\n        navigator.geolocation.getCurrentPosition(function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        return q.promise;\n      },\n\n      watchPosition: function (options) {\n        var q = $q.defer();\n\n        var watchID = navigator.geolocation.watchPosition(function (result) {\n          q.notify(result);\n        }, function (err) {\n          q.reject(err);\n        }, options);\n\n        q.promise.cancel = function () {\n          navigator.geolocation.clearWatch(watchID);\n        };\n\n        q.promise.clearWatch = function (id) {\n          navigator.geolocation.clearWatch(id || watchID);\n        };\n\n        q.promise.watchID = watchID;\n\n        return q.promise;\n      },\n\n      clearWatch: function (watchID) {\n        return navigator.geolocation.clearWatch(watchID);\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.globalization\n// link      :      https://github.com/apache/cordova-plugin-globalization/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.globalization', [])\n\n  .factory('$cordovaGlobalization', ['$q', function ($q) {\n\n    return {\n      getPreferredLanguage: function () {\n        var q = $q.defer();\n\n        navigator.globalization.getPreferredLanguage(function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n        return q.promise;\n      },\n\n      getLocaleName: function () {\n        var q = $q.defer();\n\n        navigator.globalization.getLocaleName(function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n        return q.promise;\n      },\n\n      getFirstDayOfWeek: function () {\n        var q = $q.defer();\n\n        navigator.globalization.getFirstDayOfWeek(function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n        return q.promise;\n      },\n\n      // \"date\" parameter must be a JavaScript Date Object.\n      dateToString: function (date, options) {\n        var q = $q.defer();\n\n        navigator.globalization.dateToString(\n          date,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      stringToDate: function (dateString, options) {\n        var q = $q.defer();\n\n        navigator.globalization.stringToDate(\n          dateString,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      getDatePattern: function (options) {\n        var q = $q.defer();\n\n        navigator.globalization.getDatePattern(\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      getDateNames: function (options) {\n        var q = $q.defer();\n\n        navigator.globalization.getDateNames(\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      // \"date\" parameter must be a JavaScript Date Object.\n      isDayLightSavingsTime: function (date) {\n        var q = $q.defer();\n\n        navigator.globalization.isDayLightSavingsTime(\n          date,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n        return q.promise;\n      },\n\n      numberToString: function (number, options) {\n        var q = $q.defer();\n\n        navigator.globalization.numberToString(\n          number,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      stringToNumber: function (numberString, options) {\n        var q = $q.defer();\n\n        navigator.globalization.stringToNumber(\n          numberString,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      getNumberPattern: function (options) {\n        var q = $q.defer();\n\n        navigator.globalization.getNumberPattern(\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          },\n          options);\n        return q.promise;\n      },\n\n      getCurrencyPattern: function (currencyCode) {\n        var q = $q.defer();\n\n        navigator.globalization.getCurrencyPattern(\n          currencyCode,\n          function (result) {\n            q.resolve(result);\n          },\n          function (err) {\n            q.reject(err);\n          });\n        return q.promise;\n      }\n\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-admob-pro.git\n// link     :     https://github.com/floatinghotpot/cordova-admob-pro\n\nangular.module('ngCordova.plugins.googleAds', [])\n  .factory('$cordovaGoogleAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.AdMob.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.AdMob.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.AdMob.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.AdMob.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.AdMob.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.AdMob.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.AdMob.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.AdMob.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add https://github.com/danwilson/google-analytics-plugin.git\n// link      :     https://github.com/danwilson/google-analytics-plugin\n\nangular.module('ngCordova.plugins.googleAnalytics', [])\n\n  .factory('$cordovaGoogleAnalytics', ['$q', '$window', function ($q, $window) {\n\n    return {\n      startTrackerWithId: function (id) {\n        var d = $q.defer();\n\n        $window.analytics.startTrackerWithId(id, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      setUserId: function (id) {\n        var d = $q.defer();\n\n        $window.analytics.setUserId(id, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      debugMode: function () {\n        var d = $q.defer();\n\n        $window.analytics.debugMode(function (response) {\n          d.resolve(response);\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      trackView: function (screenName) {\n        var d = $q.defer();\n\n        $window.analytics.trackView(screenName, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      addCustomDimension: function (key, value) {\n        var d = $q.defer();\n\n        $window.analytics.addCustomDimension(key, value, function () {\n          d.resolve();\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      trackEvent: function (category, action, label, value) {\n        var d = $q.defer();\n\n        $window.analytics.trackEvent(category, action, label, value, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      addTransaction: function (transactionId, affiliation, revenue, tax, shipping, currencyCode) {\n        var d = $q.defer();\n\n        $window.analytics.addTransaction(transactionId, affiliation, revenue, tax, shipping, currencyCode, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      },\n\n      addTransactionItem: function (transactionId, name, sku, category, price, quantity, currencyCode) {\n        var d = $q.defer();\n\n        $window.analytics.addTransactionItem(transactionId, name, sku, category, price, quantity, currencyCode, function (response) {\n          d.resolve(response);\n        }, function (error) {\n          d.reject(error);\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :\n// link      :\n\n// Google Maps needs ALOT of work!\n// Not for production use\n\nangular.module('ngCordova.plugins.googleMap', [])\n\n  .factory('$cordovaGoogleMap', ['$q', '$window', function ($q, $window) {\n\n    var map = null;\n\n    return {\n      getMap: function (options) {\n        var q = $q.defer();\n\n        if (!$window.plugin.google.maps) {\n          q.reject(null);\n        }\n        else {\n          var div = document.getElementById(\"map_canvas\");\n          map = $window.plugin.google.maps.Map.getMap(options);\n          map.setDiv(div);\n          q.resolve(map);\n        }\n        return q.promise;\n      },\n\n\n      isMapLoaded: function () { // check if an instance of the map exists\n        return !!map;\n      },\n      addMarker: function (markerOptions) { // add a marker to the map with given markerOptions\n        var q = $q.defer();\n        map.addMarker(markerOptions, function (marker) {\n          q.resolve(marker);\n        });\n\n        return q.promise;\n      },\n      getMapTypeIds: function () {\n        return $window.plugin.google.maps.mapTypeId;\n      },\n      setVisible: function (isVisible) {\n        var q = $q.defer();\n        map.setVisible(isVisible);\n        return q.promise;\n      },\n      // I don't know how to deallocate te map and the google map plugin.\n      cleanup: function () {\n        map = null;\n        // delete map;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add nl.x-services.plugins.googleplus\n// link     :     https://github.com/EddyVerbruggen/cordova-plugin-googleplus\n\n  angular.module('ngCordova.plugins.googleplus', [])\n\n  .factory('$cordovaGooglePlus', ['$q', '$window', function ($q, $window) {\n\n    return {\n      login: function(iosKey){\n          if(iosKey === undefined){\n            iosKey = {};\n          }\n          var q = $q.defer();\n          $window.plugins.googleplus.login(\n          {\n            'iOSApiKey': iosKey\n            // there is no API key for Android; you app is wired to the Google+ API by \n            //listing your package name in the google dev console and signing your apk\n          },\n          function (response) {\n            q.resolve(response)\n          },\n          function (error) {\n           q.reject(error)\n          }\n        );\n\n        return q.promise;\n      },\n\n      silentLogin: function(iosKey){\n\n        if(iosKey === undefined){\n            iosKey = {};\n          }\n          var q = $q.defer();\n          $window.plugins.googleplus.trySilentLogin(\n          {\n            'iOSApiKey': iosKey\n            // there is no API key for Android; you app is wired to the Google+ API by \n            //listing your package name in the google dev console and signing your apk\n          },\n          function (response) {\n            q.resolve(response)\n          },\n          function (error) {\n           q.reject(error)\n          }\n        );\n\n        return q.promise;\n      },\n\n      logout: function(){\n        var q = $q.defer();\n        $window.plugins.googleplus.logout(\n          function (response) {\n            q.resolve(response);\n          }\n        );\n      },\n\n      disconnect: function(){\n        var q = $q.defer();\n        $window.plugins.googleplus.disconnect(\n          function (response) {\n            q.resolve(response);\n          }\n        );\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/Telerik-Verified-Plugins/HealthKit\n// link      :      https://github.com/Telerik-Verified-Plugins/HealthKit\n\nangular.module('ngCordova.plugins.healthKit', [])\n\n  .factory('$cordovaHealthKit', ['$q', '$window', function ($q, $window) {\n\n    return {\n      isAvailable: function () {\n        var q = $q.defer();\n\n        $window.plugins.healthkit.available(function (success) {\n          q.resolve(success);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      /**\n       * Request authorization to access HealthKit data. See the full HealthKit constants\n       * reference for possible read and write types:\n       * https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Constants/\n       */\n      requestAuthorization: function (readTypes, writeTypes) {\n        var q = $q.defer();\n\n        readTypes = readTypes || [\n          'HKCharacteristicTypeIdentifierDateOfBirth', 'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight'\n        ];\n        writeTypes = writeTypes || [\n          'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight', 'HKQuantityTypeIdentifierDistanceCycling'\n        ];\n\n        $window.plugins.healthkit.requestAuthorization({\n          'readTypes': readTypes,\n          'writeTypes': writeTypes\n        }, function (success) {\n          q.resolve(success);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      readDateOfBirth: function () {\n        var q = $q.defer();\n        $window.plugins.healthkit.readDateOfBirth(\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n\n        return q.promise;\n      },\n\n      readGender: function () {\n        var q = $q.defer();\n        $window.plugins.healthkit.readGender(\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n\n        return q.promise;\n      },\n\n      saveWeight: function (value, units, date) {\n        var q = $q.defer();\n        $window.plugins.healthkit.saveWeight({\n            'unit': units || 'lb',\n            'amount': value,\n            'date': date || new Date()\n          },\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n        return q.promise;\n      },\n\n      readWeight: function (units) {\n        var q = $q.defer();\n        $window.plugins.healthkit.readWeight({\n            'unit': units || 'lb'\n          },\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n\n        return q.promise;\n      },\n      saveHeight: function (value, units, date) {\n        var q = $q.defer();\n        $window.plugins.healthkit.saveHeight({\n            'unit': units || 'in',\n            'amount': value,\n            'date': date || new Date()\n          },\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n        return q.promise;\n      },\n      readHeight: function (units) {\n        var q = $q.defer();\n        $window.plugins.healthkit.readHeight({\n            'unit': units || 'in'\n          },\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n\n        return q.promise;\n      },\n\n      findWorkouts: function () {\n        var q = $q.defer();\n        $window.plugins.healthkit.findWorkouts({},\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n        return q.promise;\n      },\n\n      /**\n       * Save a workout.\n       *\n       * Workout param should be of the format:\n       {\n         'activityType': 'HKWorkoutActivityTypeCycling', // HKWorkoutActivityType constant (https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType)\n         'quantityType': 'HKQuantityTypeIdentifierDistanceCycling',\n         'startDate': new Date(), // mandatory\n         'endDate': null, // optional, use either this or duration\n         'duration': 3600, // in seconds, optional, use either this or endDate\n         'energy': 300, //\n         'energyUnit': 'kcal', // J|cal|kcal\n         'distance': 11, // optional\n         'distanceUnit': 'km' // probably useful with the former param\n         // 'extraData': \"\", // Not sure how necessary this is\n       },\n       */\n      saveWorkout: function (workout) {\n        var q = $q.defer();\n        $window.plugins.healthkit.saveWorkout(workout,\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n        return q.promise;\n      },\n\n      /**\n       * Sample any kind of health data through a given date range.\n       * sampleQuery of the format:\n       {\n\t\t\t\t\t\t\t\t\t'startDate': yesterday, // mandatory\n\t\t\t\t\t\t\t\t\t'endDate': tomorrow, // mandatory\n\t\t\t\t\t\t\t\t\t'sampleType': 'HKQuantityTypeIdentifierHeight',\n\t\t\t\t\t\t\t\t\t'unit' : 'cm'\n\t\t\t\t\t\t\t},\n       */\n      querySampleType: function (sampleQuery) {\n        var q = $q.defer();\n        $window.plugins.healthkit.querySampleType(sampleQuery,\n          function (success) {\n            q.resolve(success);\n          },\n          function (err) {\n            q.resolve(err);\n          }\n        );\n        return q.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-httpd.git\n// link     :     https://github.com/floatinghotpot/cordova-httpd\n\nangular.module('ngCordova.plugins.httpd', [])\n  .factory('$cordovaHttpd', ['$q', function ($q) {\n\n    return {\n      startServer: function (options) {\n        var d = $q.defer();\n\n        cordova.plugins.CorHttpd.startServer(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      stopServer: function () {\n        var d = $q.defer();\n\n        cordova.plugins.CorHttpd.stopServer(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      getURL: function () {\n        var d = $q.defer();\n\n        cordova.plugins.CorHttpd.getURL(function (url) {\n          d.resolve(url);\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      getLocalPath: function () {\n        var d = $q.defer();\n\n        cordova.plugins.CorHttpd.getLocalPath(function (path) {\n          d.resolve(path);\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-iad.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-iad\n\nangular.module('ngCordova.plugins.iAd', [])\n  .factory('$cordovaiAd', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.iAd.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.iAd.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.iAd.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.iAd.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.iAd.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.iAd.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.iAd.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.iAd.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/wymsee/cordova-imagePicker.git\n// link     :     https://github.com/wymsee/cordova-imagePicker\n\nangular.module('ngCordova.plugins.imagePicker', [])\n\n  .factory('$cordovaImagePicker', ['$q', '$window', function ($q, $window) {\n\n    return {\n      getPictures: function (options) {\n        var q = $q.defer();\n\n        $window.imagePicker.getPictures(function (results) {\n          q.resolve(results);\n        }, function (error) {\n          q.reject(error);\n        }, options);\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :     cordova plugin add org.apache.cordova.inappbrowser\n// link      :     https://github.com/apache/cordova-plugin-inappbrowser/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.inAppBrowser', [])\n\n  .provider('$cordovaInAppBrowser', [function () {\n\n    var ref;\n    var defaultOptions = this.defaultOptions = {};\n\n    this.setDefaultOptions = function (config) {\n      defaultOptions = angular.extend(defaultOptions, config);\n    };\n\n    this.$get = ['$rootScope', '$q', '$window', '$timeout', function ($rootScope, $q, $window, $timeout) {\n      return {\n        open: function (url, target, requestOptions) {\n          var q = $q.defer();\n\n          if (requestOptions && !angular.isObject(requestOptions)) {\n            q.reject(\"options must be an object\");\n            return q.promise;\n          }\n\n          var options = angular.extend({}, defaultOptions, requestOptions);\n\n          var opt = [];\n          angular.forEach(options, function (value, key) {\n            opt.push(key + '=' + value);\n          });\n          var optionsString = opt.join();\n\n          ref = $window.open(url, target, optionsString);\n\n          ref.addEventListener('loadstart', function (event) {\n            $timeout(function () {\n              $rootScope.$broadcast('$cordovaInAppBrowser:loadstart', event);\n            });\n          }, false);\n\n          ref.addEventListener('loadstop', function (event) {\n            q.resolve(event);\n            $timeout(function () {\n              $rootScope.$broadcast('$cordovaInAppBrowser:loadstop', event);\n            });\n          }, false);\n\n          ref.addEventListener('loaderror', function (event) {\n            q.reject(event);\n            $timeout(function () {\n              $rootScope.$broadcast('$cordovaInAppBrowser:loaderror', event);\n            });\n          }, false);\n\n          ref.addEventListener('exit', function (event) {\n            $timeout(function () {\n              $rootScope.$broadcast('$cordovaInAppBrowser:exit', event);\n            });\n          }, false);\n\n          return q.promise;\n        },\n\n        close: function () {\n          ref.close();\n          ref = null;\n        },\n\n        show: function () {\n          ref.show();\n        },\n\n        executeScript: function (details) {\n          var q = $q.defer();\n\n          ref.executeScript(details, function (result) {\n            q.resolve(result);\n          });\n\n          return q.promise;\n        },\n\n        insertCSS: function (details) {\n          var q = $q.defer();\n\n          ref.insertCSS(details, function (result) {\n            q.resolve(result);\n          });\n\n          return q.promise;\n        }\n      };\n    }];\n  }]);\n\n// install  :     cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git\n// link     :     https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin\nangular.module('ngCordova.plugins.insomnia', [])\n\n  .factory('$cordovaInsomnia', ['$window', function ($window) {\n\n    return {\n      keepAwake: function () {\n        return $window.plugins.insomnia.keepAwake();\n      },\n      allowSleepAgain: function () {\n        return $window.plugins.insomnia.allowSleepAgain();\n      }\n    }\n\n  }]);\n// install   :   cordova plugins add https://github.com/vstirbu/InstagramPlugin\n// link      :   https://github.com/vstirbu/InstagramPlugin\n\nangular.module('ngCordova.plugins.instagram', [])\n\n.factory('$cordovaInstagram', ['$q', function ($q) {\n\n  return {\n    share: function (options) {\n      var q = $q.defer();\n\n      if (!window.Instagram) {\n        console.error('Tried to call Instagram.share but the Instagram plugin isn\\'t installed!');\n        q.resolve(null);\n        return q.promise;\n      }\n\n      Instagram.share(options.image, options.caption, function(err) {\n        if(err) {\n          q.reject(err);\n        } else {\n          q.resolve(true);\n        }\n      });\n      return q.promise;\n    }\n  };\n}]);\n\n// install   :      cordova plugin add https://github.com/driftyco/ionic-plugins-keyboard.git\n// link      :      https://github.com/driftyco/ionic-plugins-keyboard\n\n//TODO: add support for native.keyboardshow + native.keyboardhide\n\nangular.module('ngCordova.plugins.keyboard', [])\n\n  .factory('$cordovaKeyboard', [function () {\n\n    return {\n      hideAccessoryBar: function (bool) {\n        return cordova.plugins.Keyboard.hideKeyboardAccessoryBar(bool);\n      },\n\n      close: function () {\n        return cordova.plugins.Keyboard.close();\n      },\n\n      disableScroll: function (bool) {\n        return cordova.plugins.Keyboard.disableScroll(bool);\n      },\n\n      isVisible: function () {\n        return cordova.plugins.Keyboard.isVisible;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add https://github.com/shazron/KeychainPlugin.git\n// link      :      https://github.com/shazron/KeychainPlugin\n\nangular.module('ngCordova.plugins.keychain', [])\n\n  .factory('$cordovaKeychain', ['$q', '$window', function ($q, $window) {\n\n    if ('Keychain' in $window) {\n      var kc = new Keychain();\n    }\n\n    return {\n      getForKey: function (key, serviceName) {\n        var defer = $q.defer();\n\n        kc.getForKey(defer.resolve, defer.reject, key, serviceName);\n\n        return defer.promise;\n      },\n\n      setForKey: function (key, serviceName, value) {\n        var defer = $q.defer();\n\n        kc.setForKey(defer.resolve, defer.reject, key, serviceName, value);\n\n        return defer.promise;\n      },\n\n      removeForKey: function (key, serviceName) {\n        var defer = $q.defer();\n\n        kc.removeForKey(defer.resolve, defer.reject, key, serviceName);\n\n        return defer.promise;\n      }\n    };\n  }]);\n\n// install   :  cordova plugin add de.appplant.cordova.plugin.local-notification\n// link      :  https://github.com/katzer/cordova-plugin-local-notifications/\n\nangular.module('ngCordova.plugins.localNotification', [])\n\n  .factory('$cordovaLocalNotification', ['$q', '$window', '$rootScope', '$timeout', function ($q, $window, $rootScope, $timeout) {\n    document.addEventListener(\"deviceready\", function () {\n      if ($window.plugin && $window.plugin.notification) {\n        $window.plugin.notification.local.oncancel = function (id, state, json) {\n          var notification = {\n            id: id,\n            state: state,\n            json: json\n          };\n          $timeout(function () {\n            $rootScope.$broadcast(\"$cordovaLocalNotification:canceled\", notification);\n          });\n        };\n\n        $window.plugin.notification.local.onclick = function (id, state, json) {\n          var notification = {\n            id: id,\n            state: state,\n            json: json\n          };\n          $timeout(function () {\n            $rootScope.$broadcast(\"$cordovaLocalNotification:clicked\", notification);\n          });\n        };\n\n        $window.plugin.notification.local.ontrigger = function (id, state, json) {\n          var notification = {\n            id: id,\n            state: state,\n            json: json\n          };\n          $timeout(function () {\n            $rootScope.$broadcast(\"$cordovaLocalNotification:triggered\", notification);\n          });\n        };\n\n        $window.plugin.notification.local.onadd = function (id, state, json) {\n          var notification = {\n            id: id,\n            state: state,\n            json: json\n          };\n          $timeout(function () {\n            $rootScope.$broadcast(\"$cordovaLocalNotification:added\", notification);\n          });\n        };\n      }\n    }, false);\n    return {\n      add: function (options, scope) {\n        var q = $q.defer();\n        scope = scope || null;\n        $window.plugin.notification.local.add(options, function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      cancel: function (id, scope) {\n        var q = $q.defer();\n        scope = scope || null;\n        $window.plugin.notification.local.cancel(id, function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      cancelAll: function (scope) {\n        var q = $q.defer();\n        scope = scope || null;\n        $window.plugin.notification.local.cancelAll(function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      isScheduled: function (id, scope) {\n        var q = $q.defer();\n        scope = scope || null;\n        $window.plugin.notification.local.isScheduled(id, function (result) {\n          q.resolve(result);\n        }, scope);\n\n        return q.promise;\n      },\n\n      hasPermission: function (scope) {\n        var q = $q.defer();\n        $window.plugin.notification.local.hasPermission(function (result) {\n          result ? q.resolve(result) : q.reject(result);\n        }, scope);\n        return q.promise;\n      },\n\n      promptForPermission: function () {\n        var q = $q.defer();\n        $window.plugin.notification.local.promptForPermission(function (result) {\n          result ? q.resolve(result) : q.reject(result);\n        });\n        return q.promise;\n      },\n\n      registerPermission: function () {\n        var q = $q.defer();\n        $window.plugin.notification.local.registerPermission(function (result) {\n          result ? q.resolve(result) : q.reject(result);\n        });\n        return q.promise;\n      },\n\n      getScheduledIds: function (scope) {\n        var q = $q.defer();\n        $window.plugin.notification.local.getScheduledIds(function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      isTriggered: function (id, scope) {\n        var q = $q.defer();\n        $window.plugin.notification.local.isTriggered(id, function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      getTriggeredIds: function (scope) {\n        var q = $q.defer();\n        $window.plugin.notification.local.getTriggeredIds(function (result) {\n          q.resolve(result);\n        }, scope);\n        return q.promise;\n      },\n\n      getDefaults: function () {\n        return $window.plugin.notification.local.getDefaults();\n      },\n\n      setDefaults: function (Object) {\n        $window.plugin.notification.local.setDefaults(Object);\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-mmedia.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-mmedia\n\nangular.module('ngCordova.plugins.mMediaAds', [])\n  .factory('$cordovaMMediaAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.mMedia.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.mMedia.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.mMedia.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.mMedia.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.mMedia.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.mMedia.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.mMedia.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.mMedia.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.media\n// link      :      https://github.com/apache/cordova-plugin-media\n\nangular.module('ngCordova.plugins.media', [])\n\n  .factory('$cordovaMedia', ['$q', function ($q) {\n\n    return {\n      newMedia: function (src) {\n        var q = $q.defer();\n        var mediaStatus = null;\n        var media;\n\n        media = new Media(src,\n          function (success) {\n            q.resolve(success);\n          }, function (error) {\n            q.reject(error);\n          }, function (status) {\n            mediaStatus = status;\n          });\n\n        // getCurrentPosition NOT WORKING!\n        q.promise.getCurrentPosition = function () {\n          media.getCurrentPosition(function (success) {\n          }, function (error) {\n          });\n        };\n\n        q.promise.getDuration = function () {\n          media.getDuration();\n        };\n\n        // iOS quirks :\n        // -  myMedia.play({ numberOfLoops: 2 }) -> looping\n        // -  myMedia.play({ playAudioWhenScreenIsLocked : false })\n        q.promise.play = function (options) {\n          if (typeof options !== \"object\") {\n            options = {};\n          }\n          media.play(options);\n        };\n\n        q.promise.pause = function () {\n          media.pause();\n        };\n\n        q.promise.stop = function () {\n          media.stop();\n        };\n\n        q.promise.release = function () {\n          media.release();\n        };\n\n        q.promise.seekTo = function (timing) {\n          media.seekTo(timing);\n        };\n\n        q.promise.setVolume = function (volume) {\n          media.setVolume(volume);\n        };\n\n        q.promise.startRecord = function () {\n          media.startRecord();\n        };\n\n        q.promise.stopRecord = function () {\n          media.stopRecord();\n        };\n\n        q.promise.media = media;\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-mobfox-pro.git\n// link     :     https://github.com/floatinghotpot/cordova-mobfox-pro\n\nangular.module('ngCordova.plugins.mobfoxAds', [])\n  .factory('$cordovaMobFoxAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.MobFox.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.MobFox.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.MobFox.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.MobFox.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.MobFox.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.MobFox.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.MobFox.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.MobFox.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\nangular.module('ngCordova.plugins', [\n  'ngCordova.plugins.actionSheet',\n  'ngCordova.plugins.adMob',\n  'ngCordova.plugins.appAvailability',\n  'ngCordova.plugins.appRate',\n  'ngCordova.plugins.appVersion',\n  'ngCordova.plugins.backgroundGeolocation',\n  'ngCordova.plugins.badge',\n  'ngCordova.plugins.barcodeScanner',\n  'ngCordova.plugins.batteryStatus',\n  'ngCordova.plugins.ble',\n  'ngCordova.plugins.bluetoothSerial',\n  'ngCordova.plugins.brightness',\n  'ngCordova.plugins.calendar',\n  'ngCordova.plugins.camera',\n  'ngCordova.plugins.capture',\n  'ngCordova.plugins.clipboard',\n  'ngCordova.plugins.contacts',\n  'ngCordova.plugins.datePicker',\n  'ngCordova.plugins.device',\n  'ngCordova.plugins.deviceMotion',\n  'ngCordova.plugins.deviceOrientation',\n  'ngCordova.plugins.dialogs',\n  'ngCordova.plugins.emailComposer',\n  'ngCordova.plugins.facebook',\n  'ngCordova.plugins.facebookAds',\n  'ngCordova.plugins.file',\n  'ngCordova.plugins.fileTransfer',\n  'ngCordova.plugins.fileOpener2',\n  'ngCordova.plugins.flashlight',\n  'ngCordova.plugins.flurryAds',\n  'ngCordova.plugins.ga',\n  'ngCordova.plugins.geolocation',\n  'ngCordova.plugins.globalization',\n  'ngCordova.plugins.googleAds',\n  'ngCordova.plugins.googleAnalytics',\n  'ngCordova.plugins.googleMap',\n  'ngCordova.plugins.healthKit',\n  'ngCordova.plugins.httpd',\n  'ngCordova.plugins.iAd',\n  'ngCordova.plugins.imagePicker',\n  'ngCordova.plugins.inAppBrowser',\n  'ngCordova.plugins.keyboard',\n  'ngCordova.plugins.keychain',\n  'ngCordova.plugins.localNotification',\n  'ngCordova.plugins.media',\n  'ngCordova.plugins.mMediaAds',\n  'ngCordova.plugins.mobfoxAds',\n  'ngCordova.plugins.mopubAds',\n  'ngCordova.plugins.nativeAudio',\n  'ngCordova.plugins.network',\n  'ngCordova.plugins.oauth',\n  'ngCordova.plugins.oauthUtility',\n  'ngCordova.plugins.pinDialog',\n  'ngCordova.plugins.prefs',\n  'ngCordova.plugins.printer',\n  'ngCordova.plugins.progressIndicator',\n  'ngCordova.plugins.push',\n  'ngCordova.plugins.sms',\n  'ngCordova.plugins.socialSharing',\n  'ngCordova.plugins.spinnerDialog',\n  'ngCordova.plugins.splashscreen',\n  'ngCordova.plugins.sqlite',\n  'ngCordova.plugins.statusbar',\n  'ngCordova.plugins.toast',\n  'ngCordova.plugins.touchid',\n  'ngCordova.plugins.vibration',\n  'ngCordova.plugins.videoCapturePlus',\n  'ngCordova.plugins.zip',\n  'ngCordova.plugins.insomnia'\n]);\n\n// install  :     cordova plugin add https://github.com/floatinghotpot/cordova-plugin-mopub.git\n// link     :     https://github.com/floatinghotpot/cordova-plugin-mopub\n\nangular.module('ngCordova.plugins.mopubAds', [])\n  .factory('$cordovaMoPubAds', ['$q', '$window', function ($q, $window) {\n\n    return {\n      setOptions: function (options) {\n        var d = $q.defer();\n\n        $window.MoPub.setOptions(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      createBanner: function (options) {\n        var d = $q.defer();\n\n        $window.MoPub.createBanner(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      removeBanner: function () {\n        var d = $q.defer();\n\n        $window.MoPub.removeBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBanner: function (position) {\n        var d = $q.defer();\n\n        $window.MoPub.showBanner(position, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showBannerAtXY: function (x, y) {\n        var d = $q.defer();\n\n        $window.MoPub.showBannerAtXY(x, y, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      hideBanner: function () {\n        var d = $q.defer();\n\n        $window.MoPub.hideBanner(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      prepareInterstitial: function (options) {\n        var d = $q.defer();\n\n        $window.MoPub.prepareInterstitial(options, function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      },\n\n      showInterstitial: function () {\n        var d = $q.defer();\n\n        $window.MoPub.showInterstitial(function () {\n          d.resolve();\n        }, function () {\n          d.reject();\n        });\n\n        return d.promise;\n      }\n    };\n  }]);\n\n// install   : cordova plugin add https://github.com/sidneys/cordova-plugin-nativeaudio.git\n// link      : https://github.com/sidneys/cordova-plugin-nativeaudio\n\nangular.module('ngCordova.plugins.nativeAudio', [])\n\n  .factory('$cordovaNativeAudio', ['$q', '$window', function ($q, $window) {\n\n    return {\n      preloadSimple: function (id, assetPath) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.preloadSimple(id, assetPath, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      preloadComplex: function (id, assetPath, volume, voices) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.preloadComplex(id, assetPath, volume, voices, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      play: function (id, completeCallback) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.play(id, completeCallback, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      stop: function (id) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.stop(id, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n        return q.promise;\n      },\n\n      loop: function (id) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.loop(id, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      unload: function (id) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.unload(id, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      setVolumeForComplexAsset: function (id, volume) {\n        var q = $q.defer();\n        $window.plugins.NativeAudio.setVolumeForComplexAsset(id, volume, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.network-information\n// link      :      https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.network', [])\n\n  .factory('$cordovaNetwork', ['$rootScope', '$timeout', function ($rootScope, $timeout) {\n\n    var offlineEvent = function () {\n      var networkState = navigator.connection.type;\n      $timeout(function () {\n        $rootScope.$broadcast('$cordovaNetwork:offline', networkState);\n      });\n    };\n\n    var onlineEvent = function () {\n      var networkState = navigator.connection.type;\n      $timeout(function () {\n        $rootScope.$broadcast('$cordovaNetwork:online', networkState);\n      });\n    };\n\n    document.addEventListener(\"deviceready\", function () {\n      if (navigator.connection) {\n        document.addEventListener(\"offline\", offlineEvent, false);\n        document.addEventListener(\"online\", onlineEvent, false);\n      }\n    });\n\n    return {\n      getNetwork: function () {\n        return navigator.connection.type;\n      },\n\n      isOnline: function () {\n        var networkState = navigator.connection.type;\n        return networkState !== Connection.UNKNOWN && networkState !== Connection.NONE;\n      },\n\n      isOffline: function () {\n        var networkState = navigator.connection.type;\n        return networkState === Connection.UNKNOWN || networkState === Connection.NONE;\n      },\n\n      clearOfflineWatch: function () {\n        document.removeEventListener(\"offline\", offlineEvent);\n        $rootScope.$$listeners[\"$cordovaNetwork:offline\"] = [];\n      },\n\n      clearOnlineWatch: function () {\n        document.removeEventListener(\"online\", offlineEvent);\n        $rootScope.$$listeners[\"$cordovaNetwork:online\"] = [];\n      }\n    };\n  }])\n  .run(['$cordovaNetwork', function ($cordovaNetwork) {\n  }]);\n\n/* Created by Nic Raboy\n * http://www.nraboy.com\n *\n * DESCRIPTION: Use Oauth sign in for various web services.\n *\n * REQUIRES:  Apache Cordova 3.5+, Apache InAppBrowser Plugin, jsSHA (Twitter, Magento only)\n *\n * SUPPORTS:\n *    Dropbox\n *    Digital Ocean\n *    Google\n *    GitHub\n *    Facebook\n *    LinkedIn\n *    Instagram\n *    Box\n *    Reddit\n *    Twitter\n *    Meetup\n *    Foursquare\n *    Salesforce\n *    Strava\n *    Magento\n *    vkontakte\n *    ADFS\n *    Imgur\n */\n\nangular.module(\"ngCordova.plugins.oauth\", [\"ngCordova.plugins.oauthUtility\"])\n\n  .factory('$cordovaOauth', ['$q', '$http', '$cordovaOauthUtility', function ($q, $http, $cordovaOauthUtility) {\n\n    return {\n\n        /*\n        * Sign into the ADFS service (ADFS 3.0 onwards)\n        *\n        * @param    string clientId (client registered in ADFS, with redirect_uri configured to: http://localhost/callback)\n        * @param\t string adfsServer (url of the ADFS Server)\n        * @param\t string relyingPartyId (url of the Relying Party (resource relying on ADFS for authentication) configured in ADFS)\n        * @return   promise\n        */\n        adfs: function(clientId, adfsServer, relyingPartyId) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open(adfsServer + '/adfs/oauth2/authorize?response_type=code&client_id=' + clientId +'&redirect_uri=http://localhost/callback&resource=' + relyingPartyId, '_blank', 'location=no');\n\n                    browserRef.addEventListener(\"loadstart\", function(event) {\n                        if((event.url).indexOf('http://localhost/callback') === 0) {\n                            var requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http({method: \"post\", url: adfsServer + \"/adfs/oauth2/token\", data: \"client_id=\" + clientId + \"&code=\" + requestToken + \"&redirect_uri=http://localhost/callback&grant_type=authorization_code\"  })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Dropbox service\n        *\n        * @param    string appKey\n        * @return   promise\n        */\n        dropbox: function(appKey) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open(\"https://www.dropbox.com/1/oauth2/authorize?client_id=\" + appKey + \"&redirect_uri=http://localhost/callback\" + \"&response_type=token\", \"_blank\", \"location=no,clearsessioncache=yes,clearcache=yes\");\n                    browserRef.addEventListener(\"loadstart\", function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var callbackResponse = (event.url).split(\"#\")[1];\n                            var responseParameters = (callbackResponse).split(\"&\");\n                            var parameterMap = [];\n                            for(var i = 0; i < responseParameters.length; i++) {\n                                parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                            }\n                            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, uid: parameterMap.uid });\n                            } else {\n                                deferred.reject(\"Problem authenticating\");\n                            }\n                            setTimeout(function() {\n                                browserRef.close();\n                            }, 10);\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Digital Ocean service\n        *\n        * @param    string clientId\n        * @param    string clientSecret\n        * @return   promise\n        */\n        digitalOcean: function(clientId, clientSecret) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open(\"https://cloud.digitalocean.com/v1/oauth/authorize?client_id=\" + clientId + \"&redirect_uri=http://localhost/callback&response_type=code&scope=read%20write\", \"_blank\", \"location=no,clearsessioncache=yes,clearcache=yes\");\n                    browserRef.addEventListener(\"loadstart\", function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http({method: \"post\", url: \"https://cloud.digitalocean.com/v1/oauth/token\", data: \"client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&redirect_uri=http://localhost/callback\" + \"&grant_type=authorization_code\" + \"&code=\" + requestToken })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Google service\n        *\n        * @param    string clientId\n        * @param    array appScope\n        * @return   promise\n        */\n        google: function(clientId, appScope) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://accounts.google.com/o/oauth2/auth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(\" \") + '&approval_prompt=force&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener(\"loadstart\", function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var callbackResponse = (event.url).split(\"#\")[1];\n                            var responseParameters = (callbackResponse).split(\"&\");\n                            var parameterMap = [];\n                            for(var i = 0; i < responseParameters.length; i++) {\n                                parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                            }\n                            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, expires_in: parameterMap.expires_in });\n                            } else {\n                                deferred.reject(\"Problem authenticating\");\n                            }\n                            setTimeout(function() {\n                                browserRef.close();\n                            }, 10);\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the GitHub service\n        *\n        * @param    string clientId\n        * @param    string clientSecret\n        * @param    array appScope\n        * @return   promise\n        */\n        github: function(clientId, clientSecret, appScope) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://github.com/login/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(\",\"), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http.defaults.headers.post.accept = 'application/json';\n                            $http({method: \"post\", url: \"https://github.com/login/oauth/access_token\", data: \"client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&redirect_uri=http://localhost/callback\" + \"&code=\" + requestToken })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Facebook service\n        *\n        * @param    string clientId\n        * @param    array appScope\n        * @return   promise\n        */\n        facebook: function(clientId, appScope) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://www.facebook.com/dialog/oauth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token&scope=' + appScope.join(\",\"), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var callbackResponse = (event.url).split(\"#\")[1];\n                            var responseParameters = (callbackResponse).split(\"&\");\n                            var parameterMap = [];\n                            for(var i = 0; i < responseParameters.length; i++) {\n                                parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                            }\n                            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in });\n                            } else {\n                                deferred.reject(\"Problem authenticating\");\n                            }\n                            setTimeout(function() {\n                                browserRef.close();\n                            }, 10);\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the LinkedIn service\n        *\n        * @param    string clientId\n        * @param    string clientSecret\n        * @param    array appScope\n        * @param    string state\n        * @return   promise\n        */\n        linkedin: function(clientId, clientSecret, appScope, state) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(\" \") + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http({method: \"post\", url: \"https://www.linkedin.com/uas/oauth2/accessToken\", data: \"client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&redirect_uri=http://localhost/callback\" + \"&grant_type=authorization_code\" + \"&code=\" + requestToken })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Instagram service\n        *\n        * @param    string clientId\n        * @param    array appScope\n        * @return   promise\n        */\n        instagram: function(clientId, appScope) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://api.instagram.com/oauth/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(\" \") + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var callbackResponse = (event.url).split(\"#\")[1];\n                            var responseParameters = (callbackResponse).split(\"&\");\n                            var parameterMap = [];\n                            for(var i = 0; i < responseParameters.length; i++) {\n                                parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                            }\n                            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                deferred.resolve({ access_token: parameterMap.access_token });\n                            } else {\n                                deferred.reject(\"Problem authenticating\");\n                            }\n                            setTimeout(function() {\n                                browserRef.close();\n                            }, 10);\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Box service\n        *\n        * @param    string clientId\n        * @param    string clientSecret\n        * @param    string appState\n        * @return   promise\n        */\n        box: function(clientId, clientSecret, appState) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://app.box.com/api/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&state=' + appState + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http({method: \"post\", url: \"https://app.box.com/api/oauth2/token\", data: \"client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&redirect_uri=http://localhost/callback\" + \"&grant_type=authorization_code\" + \"&code=\" + requestToken })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Reddit service\n        *\n        * @param    string clientId\n        * @param    string clientSecret\n        * @param    array appScope\n        * @return   promise\n        */\n        reddit: function(clientId, clientSecret, appScope) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://ssl.reddit.com/api/v1/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&duration=permanent&state=ngcordovaoauth&scope=' + appScope.join(\",\") + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            requestToken = (event.url).split(\"code=\")[1];\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http.defaults.headers.post.Authorization = 'Basic ' + btoa(clientId + \":\" + clientSecret);\n                            $http({method: \"post\", url: \"https://ssl.reddit.com/api/v1/access_token\", data: \"redirect_uri=http://localhost/callback\" + \"&grant_type=authorization_code\" + \"&code=\" + requestToken })\n                            .success(function(data) {\n                                deferred.resolve(data);\n                            })\n                            .error(function(data, status) {\n                                deferred.reject(\"Problem authenticating\");\n                            })\n                            .finally(function() {\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            });\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n         * Sign into the Twitter service\n         * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures\n         *\n         * @param    string clientId\n         * @param    string clientSecret\n         * @return   promise\n         */\n        twitter: function(clientId, clientSecret) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    if(typeof jsSHA !== \"undefined\") {\n                        var oauthObject = {\n                            oauth_consumer_key: clientId,\n                            oauth_nonce: $cordovaOauthUtility.createNonce(10),\n                            oauth_signature_method: \"HMAC-SHA1\",\n                            oauth_timestamp: Math.round((new Date()).getTime() / 1000.0),\n                            oauth_version: \"1.0\"\n                        };\n                        var signatureObj = $cordovaOauthUtility.createSignature(\"POST\", \"https://api.twitter.com/oauth/request_token\", oauthObject,  { oauth_callback: \"http://localhost/callback\" }, clientSecret);\n                        $http({\n                            method: \"post\",\n                            url: \"https://api.twitter.com/oauth/request_token\",\n                            headers: {\n                                \"Authorization\": signatureObj.authorization_header,\n                                \"Content-Type\": \"application/x-www-form-urlencoded\"\n                            },\n                            data: \"oauth_callback=\" + encodeURIComponent(\"http://localhost/callback\")\n                        })\n                            .success(function(requestTokenResult) {\n                                var requestTokenParameters = (requestTokenResult).split(\"&\");\n                                var parameterMap = {};\n                                for(var i = 0; i < requestTokenParameters.length; i++) {\n                                    parameterMap[requestTokenParameters[i].split(\"=\")[0]] = requestTokenParameters[i].split(\"=\")[1];\n                                }\n                                if(parameterMap.hasOwnProperty(\"oauth_token\") === false) {\n                                    deferred.reject(\"Oauth request token was not received\");\n                                }\n                                var browserRef = window.open('https://api.twitter.com/oauth/authenticate?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                                browserRef.addEventListener('loadstart', function(event) {\n                                    if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                                        var callbackResponse = (event.url).split(\"?\")[1];\n                                        var responseParameters = (callbackResponse).split(\"&\");\n                                        var parameterMap = {};\n                                        for(var i = 0; i < responseParameters.length; i++) {\n                                            parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                                        }\n                                        if(parameterMap.hasOwnProperty(\"oauth_verifier\") === false) {\n                                            deferred.reject(\"Browser authentication failed to complete.  No oauth_verifier was returned\");\n                                        }\n                                        delete oauthObject.oauth_signature;\n                                        oauthObject.oauth_token = parameterMap.oauth_token;\n                                        var signatureObj = $cordovaOauthUtility.createSignature(\"POST\", \"https://api.twitter.com/oauth/access_token\", oauthObject,  { oauth_verifier: parameterMap.oauth_verifier }, clientSecret);\n                                        $http({\n                                            method: \"post\",\n                                            url: \"https://api.twitter.com/oauth/access_token\",\n                                            headers: {\n                                                \"Authorization\": signatureObj.authorization_header\n                                            },\n                                            params: {\n                                                \"oauth_verifier\": parameterMap.oauth_verifier\n                                            }\n                                        })\n                                            .success(function(result) {\n                                                var accessTokenParameters = result.split(\"&\");\n                                                var parameterMap = {};\n                                                for(var i = 0; i < accessTokenParameters.length; i++) {\n                                                    parameterMap[accessTokenParameters[i].split(\"=\")[0]] = accessTokenParameters[i].split(\"=\")[1];\n                                                }\n                                                if(parameterMap.hasOwnProperty(\"oauth_token_secret\") === false) {\n                                                    deferred.reject(\"Oauth access token was not received\");\n                                                }\n                                                deferred.resolve(parameterMap);\n                                            })\n                                            .error(function(error) {\n                                                deferred.reject(error);\n                                            })\n                                            .finally(function() {\n                                                setTimeout(function() {\n                                                    browserRef.close();\n                                                }, 10);\n                                            });\n                                    }\n                                });\n                                browserRef.addEventListener('exit', function(event) {\n                                    deferred.reject(\"The sign in flow was canceled\");\n                                });\n                            })\n                            .error(function(error) {\n                                deferred.reject(error);\n                            });\n                    } else {\n                        deferred.reject(\"Missing jsSHA JavaScript library\");\n                    }\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Meetup service\n        *\n        * @param    string clientId\n        * @return   promise\n        */\n        meetup: function(clientId) {\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open('https://secure.meetup.com/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                    browserRef.addEventListener('loadstart', function(event) {\n                        if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            var callbackResponse = (event.url).split(\"#\")[1];\n                            var responseParameters = (callbackResponse).split(\"&\");\n                            var parameterMap = {};\n                            for(var i = 0; i < responseParameters.length; i++) {\n                                parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                            }\n                            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                deferred.resolve(parameterMap);\n                            } else {\n                                deferred.reject(\"Problem authenticating\");\n                            }\n                            setTimeout(function() {\n                                browserRef.close();\n                            }, 10);\n                        }\n                    });\n                    browserRef.addEventListener('exit', function(event) {\n                        deferred.reject(\"The sign in flow was canceled\");\n                    });\n                } else {\n                    deferred.reject(\"Could not find InAppBrowser plugin\");\n                }\n            } else {\n                deferred.reject(\"Cannot authenticate via a web browser\");\n            }\n            return deferred.promise;\n        },\n\n        /*\n        * Sign into the Salesforce service\n        *\n        * Suggestion: use salesforce oauth with forcetk.js(as SDK)\n        *\n        * @param    string loginUrl (such as: https://login.salesforce.com ; please notice community login)\n        * @param    string clientId (copy from connection app info)\n        * @param    string redirectUri (callback url in connection app info)\n        * @return   promise\n        */\n        salesforce: function (loginUrl, clientId) {\n            var redirectUri = 'http://localhost/callback';\n            var getAuthorizeUrl = function (loginUrl, clientId, redirectUri) {\n                return loginUrl+'services/oauth2/authorize?display=touch'+\n                '&response_type=token&client_id='+escape(clientId)+\n                '&redirect_uri='+escape(redirectUri);\n            };\n            var startWith = function(string, str) {\n                return (string.substr(0, str.length) === str);\n            };\n            var deferred = $q.defer();\n            if(window.cordova) {\n                var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                    var browserRef = window.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), \"_blank\", \"location=no,clearsessioncache=yes,clearcache=yes\");\n                    browserRef.addEventListener(\"loadstart\", function(event) {\n                        if(startWith(event.url, redirectUri)) {\n                            var oauthResponse = {};\n\n                            var fragment = (event.url).split('#')[1];\n\n                            if (fragment) {\n                                var nvps = fragment.split('&');\n                                for (var nvp in nvps) {\n                                    var parts = nvps[nvp].split('=');\n                                    oauthResponse[parts[0]] = unescape(parts[1]);\n                                }\n                            }\n\n                            if (typeof oauthResponse === 'undefined' ||\n                                typeof oauthResponse.access_token === 'undefined') {\n                                    deferred.reject(\"Problem authenticating\");\n                                } else {\n                                    deferred.resolve(oauthResponse);\n                                }\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            }\n                        });\n                        browserRef.addEventListener('exit', function(event) {\n                            deferred.reject(\"The sign in flow was canceled\");\n                        });\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            },\n\n            /*\n            * Sign into the Strava service\n            *\n            * @param    string clientId\n            * @param    string clientSecret\n            * @param    array appScope\n            * @return   promise\n            */\n            strava: function(clientId, clientSecret, appScope) {\n                var deferred = $q.defer();\n                if(window.cordova) {\n                    var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                    if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                        var browserRef = window.open('https://www.strava.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(\",\") + '&response_type=code&approval_prompt=force', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                        browserRef.addEventListener('loadstart', function(event) {\n                            if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                                requestToken = (event.url).split(\"code=\")[1];\n                                $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                                $http({method: \"post\", url: \"https://www.strava.com/oauth/token\", data: \"client_id=\" + clientId + \"&client_secret=\" + clientSecret + \"&code=\" + requestToken })\n                                .success(function(data) {\n                                    deferred.resolve(data);\n                                })\n                                .error(function(data, status) {\n                                    deferred.reject(\"Problem authenticating\");\n                                })\n                                .finally(function() {\n                                    setTimeout(function() {\n                                        browserRef.close();\n                                    }, 10);\n                                });\n                            }\n                        });\n                        browserRef.addEventListener('exit', function(event) {\n                            deferred.reject(\"The sign in flow was canceled\");\n                        });\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            },\n\n            /*\n            * Sign into the Foursquare service\n            *\n            * @param    string clientId\n            * @return   promise\n            */\n            foursquare: function(clientId) {\n                var deferred = $q.defer();\n                if (window.cordova) {\n                    var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                    if (cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                        var browserRef = window.open('https://foursquare.com/oauth2/authenticate?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                        browserRef.addEventListener('loadstart', function (event) {\n                            if ((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                                var callbackResponse = (event.url).split(\"#\")[1];\n                                var responseParameters = (callbackResponse).split(\"&\");\n                                var parameterMap = [];\n                                for (var i = 0; i < responseParameters.length; i++) {\n                                    parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                                }\n                                if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                    var promiseResponse = {\n                                        access_token: parameterMap.access_token,\n                                        expires_in: parameterMap.expires_in\n                                    };\n                                    deferred.resolve(promiseResponse);\n                                } else {\n                                    deferred.reject(\"Problem authenticating\");\n                                }\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            }\n                        });\n                        browserRef.addEventListener('exit', function(event) {\n                            deferred.reject(\"The sign in flow was canceled\");\n                        });\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            },\n\n            /*\n            * Sign into the Magento service\n            * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures\n            *\n            * @param    string baseUrl\n            * @param    string clientId\n            * @param    string clientSecret\n            * @return   promise\n            */\n            magento: function(baseUrl, clientId, clientSecret) {\n                var deferred = $q.defer();\n                if(window.cordova) {\n                    var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                    if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                        if(typeof jsSHA !== \"undefined\") {\n                            var oauthObject = {\n                                oauth_callback: \"http://localhost/callback\",\n                                oauth_consumer_key: clientId,\n                                oauth_nonce: $cordovaOauthUtility.createNonce(5),\n                                oauth_signature_method: \"HMAC-SHA1\",\n                                oauth_timestamp: Math.round((new Date()).getTime() / 1000.0),\n                                oauth_version: \"1.0\"\n                            };\n                            var signatureObj = $cordovaOauthUtility.createSignature(\"POST\", baseUrl + \"/oauth/initiate\", oauthObject,  { oauth_callback: \"http://localhost/callback\" }, clientSecret);\n                            $http.defaults.headers.post.Authorization = signatureObj.authorization_header;\n                            $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                            $http({method: \"post\", url: baseUrl + \"/oauth/initiate\", data: \"oauth_callback=http://localhost/callback\" })\n                            .success(function(requestTokenResult) {\n                                var requestTokenParameters = (requestTokenResult).split(\"&\");\n                                var parameterMap = {};\n                                for(var i = 0; i < requestTokenParameters.length; i++) {\n                                    parameterMap[requestTokenParameters[i].split(\"=\")[0]] = requestTokenParameters[i].split(\"=\")[1];\n                                }\n                                if(parameterMap.hasOwnProperty(\"oauth_token\") === false) {\n                                    deferred.reject(\"Oauth request token was not received\");\n                                }\n                                var tokenSecret = parameterMap.oauth_token_secret;\n                                var browserRef = window.open(baseUrl + '/oauth/authorize?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                                browserRef.addEventListener('loadstart', function(event) {\n                                    if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                                        var callbackResponse = (event.url).split(\"?\")[1];\n                                        var responseParameters = (callbackResponse).split(\"&\");\n                                        var parameterMap = {};\n                                        for(var i = 0; i < responseParameters.length; i++) {\n                                            parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                                        }\n                                        if(parameterMap.hasOwnProperty(\"oauth_verifier\") === false) {\n                                            deferred.reject(\"Browser authentication failed to complete.  No oauth_verifier was returned\");\n                                        }\n                                        delete oauthObject.oauth_signature;\n                                        delete oauthObject.oauth_callback;\n                                        oauthObject.oauth_token = parameterMap.oauth_token;\n                                        oauthObject.oauth_nonce = $cordovaOauthUtility.createNonce(5);\n                                        oauthObject.oauth_verifier = parameterMap.oauth_verifier;\n                                        var signatureObj = $cordovaOauthUtility.createSignature(\"POST\", baseUrl + \"/oauth/token\", oauthObject,  {}, clientSecret, tokenSecret);\n                                        $http.defaults.headers.post.Authorization = signatureObj.authorization_header;\n                                        $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n                                        $http({method: \"post\", url: baseUrl + \"/oauth/token\" })\n                                        .success(function(result) {\n                                            var accessTokenParameters = result.split(\"&\");\n                                            var parameterMap = {};\n                                            for(var i = 0; i < accessTokenParameters.length; i++) {\n                                                parameterMap[accessTokenParameters[i].split(\"=\")[0]] = accessTokenParameters[i].split(\"=\")[1];\n                                            }\n                                            if(parameterMap.hasOwnProperty(\"oauth_token_secret\") === false) {\n                                                deferred.reject(\"Oauth access token was not received\");\n                                            }\n                                            deferred.resolve(parameterMap);\n                                        })\n                                        .error(function(error) {\n                                            deferred.reject(error);\n                                        })\n                                        .finally(function() {\n                                            setTimeout(function() {\n                                                browserRef.close();\n                                            }, 10);\n                                        });\n                                    }\n                                });\n                                browserRef.addEventListener('exit', function(event) {\n                                    deferred.reject(\"The sign in flow was canceled\");\n                                });\n                            })\n                            .error(function(error) {\n                                deferred.reject(error);\n                            });\n                        } else {\n                            deferred.reject(\"Missing jsSHA JavaScript library\");\n                        }\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            },\n\n            /*\n            * Sign into the Vkontakte service\n            *\n            * @param    string clientId\n            * @param    array appScope (for example: \"friends,wall,photos,messages\")\n            * @return   promise\n            */\n            vkontakte: function(clientId, appScope) {\n                var deferred = $q.defer();\n                if(window.cordova) {\n                    var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                    if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                        var browserRef = window.open('https://oauth.vk.com/authorize?client_id=' + clientId + '&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope=' + appScope.join(\",\") + '&display=touch&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                        browserRef.addEventListener('loadstart', function(event) {\n                            var tmp = (event.url).split(\"#\");\n                            if (tmp[0] == 'https://oauth.vk.com/blank.html' || tmp[0] == 'http://oauth.vk.com/blank.html') {\n                                var callbackResponse = (event.url).split(\"#\")[1];\n                                var responseParameters = (callbackResponse).split(\"&\");\n                                var parameterMap = [];\n                                for(var i = 0; i < responseParameters.length; i++) {\n                                    parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                                }\n                                if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                    deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, user_id: parameterMap.user_id });\n                                } else {\n                                    deferred.reject(\"Problem authenticating\");\n                                }\n                                setTimeout(function() {\n                                    browserRef.close();\n                                }, 10);\n                            }\n                        });\n                        browserRef.addEventListener('exit', function(event) {\n                            deferred.reject(\"The sign in flow was canceled\");\n                        });\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            },\n\n            /*\n             * Sign into the Imgur service\n             *\n             * @param    string clientId\n             * @return   promise\n             */\n            imgur: function(clientId) {\n                var deferred = $q.defer();\n                if(window.cordova) {\n                    var cordovaMetadata = cordova.require(\"cordova/plugin_list\").metadata;\n                    if(cordovaMetadata.hasOwnProperty(\"org.apache.cordova.inappbrowser\") === true) {\n                        var browserRef = window.open('https://api.imgur.com/oauth2/authorize?client_id=' + clientId + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');\n                        browserRef.addEventListener('loadstart', function(event) {\n                            if((event.url).indexOf(\"http://localhost/callback\") === 0) {\n                            \tbrowserRef.removeEventListener(\"exit\",function(event){});\n                            \tbrowserRef.close();\n                                var callbackResponse = (event.url).split(\"#\")[1];\n                                var responseParameters = (callbackResponse).split(\"&\");\n                                var parameterMap = [];\n                                for(var i = 0; i < responseParameters.length; i++) {\n                                    parameterMap[responseParameters[i].split(\"=\")[0]] = responseParameters[i].split(\"=\")[1];\n                                }\n                                if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {\n                                    deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, account_username: parameterMap.account_username });\n                                } else {\n                                    deferred.reject(\"Problem authenticating\");\n                                }\n                            }\n                        });\n                        browserRef.addEventListener('exit', function(event) {\n                            deferred.reject(\"The sign in flow was canceled\");\n                        });\n                    } else {\n                        deferred.reject(\"Could not find InAppBrowser plugin\");\n                    }\n                } else {\n                    deferred.reject(\"Cannot authenticate via a web browser\");\n                }\n                return deferred.promise;\n            }\n\n    };\n  }]);\n\nangular.module(\"ngCordova.plugins.oauthUtility\", [])\n\n  .factory('$cordovaOauthUtility', ['$q', function ($q) {\n\n    return {\n\n      /*\n       * Sign an Oauth 1.0 request\n       *\n       * @param    string method\n       * @param    string endPoint\n       * @param    object headerParameters\n       * @param    object bodyParameters\n       * @param    string secretKey\n       * @return   object\n       */\n       createSignature: function(method, endPoint, headerParameters, bodyParameters, secretKey, tokenSecret) {\n           if(typeof jsSHA !== \"undefined\") {\n               var headerAndBodyParameters = angular.copy(headerParameters);\n               var bodyParameterKeys = Object.keys(bodyParameters);\n               for(var i = 0; i < bodyParameterKeys.length; i++) {\n                   headerAndBodyParameters[bodyParameterKeys[i]] = encodeURIComponent(bodyParameters[bodyParameterKeys[i]]);\n               }\n               var signatureBaseString = method + \"&\" + encodeURIComponent(endPoint) + \"&\";\n               var headerAndBodyParameterKeys = (Object.keys(headerAndBodyParameters)).sort();\n               for(i = 0; i < headerAndBodyParameterKeys.length; i++) {\n                   if(i == headerAndBodyParameterKeys.length - 1) {\n                       signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + \"=\" + headerAndBodyParameters[headerAndBodyParameterKeys[i]]);\n                   } else {\n                       signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + \"=\" + headerAndBodyParameters[headerAndBodyParameterKeys[i]] + \"&\");\n                   }\n               }\n               var oauthSignatureObject = new jsSHA(signatureBaseString, \"TEXT\");\n\n               var encodedTokenSecret = '';\n               if (tokenSecret) {\n                   encodedTokenSecret = encodeURIComponent(tokenSecret);\n               }\n\n               headerParameters.oauth_signature = encodeURIComponent(oauthSignatureObject.getHMAC(encodeURIComponent(secretKey) + \"&\" + encodedTokenSecret, \"TEXT\", \"SHA-1\", \"B64\"));\n               var headerParameterKeys = Object.keys(headerParameters);\n               var authorizationHeader = 'OAuth ';\n               for(i = 0; i < headerParameterKeys.length; i++) {\n                   if(i == headerParameterKeys.length - 1) {\n                       authorizationHeader += headerParameterKeys[i] + '=\"' + headerParameters[headerParameterKeys[i]] + '\"';\n                   } else {\n                       authorizationHeader += headerParameterKeys[i] + '=\"' + headerParameters[headerParameterKeys[i]] + '\",';\n                   }\n               }\n               return { signature_base_string: signatureBaseString, authorization_header: authorizationHeader, signature: headerParameters.oauth_signature };\n           } else {\n               return \"Missing jsSHA JavaScript library\";\n           }\n       },\n\n    /*\n    * Create Random String Nonce\n    *\n    * @param    integer length\n    * @return   string\n    */\n    createNonce: function(length) {\n        var text = \"\";\n        var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n        for(var i = 0; i < length; i++) {\n            text += possible.charAt(Math.floor(Math.random() * possible.length));\n        }\n        return text;\n    }\n\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/Paldom/PinDialog.git\n// link      :      https://github.com/Paldom/PinDialog\n\nangular.module('ngCordova.plugins.pinDialog', [])\n\n  .factory('$cordovaPinDialog', ['$q', '$window', function ($q, $window) {\n\n    return {\n      prompt: function (message, title, buttons) {\n        var q = $q.defer();\n\n        $window.plugins.pinDialog.prompt(message, function (res) {\n          q.resolve(res);\n        }, title, buttons);\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :\n// link      :\n\nangular.module('ngCordova.plugins.prefs', [])\n\n  .factory('$cordovaPreferences', ['$window', '$q', function ($window, $q) {\n\n    return {\n\n      set: function (key, value) {\n        var q = $q.defer();\n\n        $window.appgiraffe.plugins.applicationPreferences.set(key, value, function (result) {\n          q.resolve(result);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      },\n\n      get: function (key) {\n        var q = $q.defer();\n\n        $window.appgiraffe.plugins.applicationPreferences.get(key, function (value) {\n          q.resolve(value);\n        }, function (err) {\n          q.reject(err);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   : cordova plugin add de.appplant.cordova.plugin.printer\n// link      : https://github.com/katzer/cordova-plugin-printer\n\nangular.module('ngCordova.plugins.printer', [])\n\n  .factory('$cordovaPrinter', ['$q', '$window', function ($q, $window) {\n\n    return {\n      isAvailable: function () {\n        var q = $q.defer();\n\n        $window.plugin.printer.isAvailable(function (isAvailable) {\n          q.resolve(isAvailable);\n        });\n\n        return q.promise;\n      },\n\n      print: function (doc, options) {\n        var q = $q.defer();\n        $window.plugin.printer.print(doc, options, function () {\n          q.resolve();\n        });\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.pbernasconi.progressindicator\n// link      :      http://pbernasconi.github.io/cordova-progressIndicator/\n\nangular.module('ngCordova.plugins.progressIndicator', [])\n\n  .factory('$cordovaProgress', ['$q', function ($q) {\n\n    return {\n      show: function(_message) {\n        var message = _message || \"Please wait...\";\n        return ProgressIndicator.show(message);\n      },\n\n      showSimple: function (_dim) {\n        var dim = _dim || false;\n        return ProgressIndicator.showSimple(dim);\n      },\n\n      showSimpleWithLabel: function (_dim, _label) {\n        var dim = _dim || false;\n        var label = _label || \"Loading...\";\n        return ProgressIndicator.showSimpleWithLabel(dim, label);\n      },\n\n      showSimpleWithLabelDetail: function (_dim, _label, _detail) {\n        var dim = _dim || false;\n        var label = _label || \"Loading...\";\n        var detail = _detail || \"Please wait\";\n        return ProgressIndicator.showSimpleWithLabelDetail(dim, label, detail);\n      },\n\n      showDeterminate: function (_dim, _timeout) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        return ProgressIndicator.showDeterminate(dim, timeout);\n      },\n\n      showDeterminateWithLabel: function (_dim, _timeout, _label) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        var label = _label || \"Loading...\";\n\n        return ProgressIndicator.showDeterminateWithLabel(dim, timeout, label);\n      },\n\n      showAnnular: function (_dim, _timeout) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        return ProgressIndicator.showAnnular(dim, timeout);\n      },\n\n      showAnnularWithLabel: function (_dim, _timeout, _label) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        var label = _label || \"Loading...\";\n        return ProgressIndicator.showAnnularWithLabel(dim, timeout, label);\n      },\n\n      showBar: function (_dim, _timeout) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        return ProgressIndicator.showBar(dim, timeout);\n      },\n\n      showBarWithLabel: function (_dim, _timeout, _label) {\n        var dim = _dim || false;\n        var timeout = _timeout || 50000;\n        var label = _label || \"Loading...\";\n        return ProgressIndicator.showBarWithLabel(dim, timeout, label);\n      },\n\n      showSuccess: function (_dim, _label) {\n        var dim = _dim || false;\n        var label = _label || \"Success\";\n        return ProgressIndicator.showSuccess(dim, label);\n      },\n\n      showText: function (_dim, _text, _position) {\n        var dim = _dim || false;\n        var text = _text || \"Warning\";\n        var position = _position || \"center\";\n        return ProgressIndicator.showText(dim, text, position);\n      },\n\n      hide: function () {\n        return ProgressIndicator.hide();\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/phonegap-build/PushPlugin.git\n// link      :      https://github.com/phonegap-build/PushPlugin\n\nangular.module('ngCordova.plugins.push', [])\n\n  .factory('$cordovaPush', ['$q', '$window', '$rootScope', '$timeout', function ($q, $window, $rootScope, $timeout) {\n    return {\n      onNotification: function (notification) {\n        $timeout(function () {\n          $rootScope.$broadcast('$cordovaPush:notificationReceived', notification);\n        });\n      },\n\n      register: function (config) {\n        var q = $q.defer();\n        var injector;\n        if (config !== undefined && config.ecb === undefined) {\n          if (document.querySelector('[ng-app]') == null) {\n            injector = \"document.body\";\n          }\n          else {\n            injector = \"document.querySelector('[ng-app]')\";\n          }\n          config.ecb = \"angular.element(\" + injector + \").injector().get('$cordovaPush').onNotification\";\n        }\n\n        $window.plugins.pushNotification.register(function (token) {\n          q.resolve(token);\n        }, function (error) {\n          q.reject(error);\n        }, config);\n\n        return q.promise;\n      },\n\n      unregister: function (options) {\n        var q = $q.defer();\n        $window.plugins.pushNotification.unregister(function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        }, options);\n\n        return q.promise;\n      },\n\n      // iOS only\n      setBadgeNumber: function (number) {\n        var q = $q.defer();\n        $window.plugins.pushNotification.setApplicationIconBadgeNumber(function (result) {\n          q.resolve(result);\n        }, function (error) {\n          q.reject(error);\n        }, number);\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add https://github.com/aharris88/phonegap-sms-plugin.git\n// link      :      https://github.com/aharris88/phonegap-sms-plugin\n\nangular.module('ngCordova.plugins.sms', [])\n\n  .factory('$cordovaSms', ['$q', function ($q) {\n\n    return {\n      send: function (number, message, intent) {\n        var q = $q.defer();\n        sms.send(number, message, intent, function (res) {\n          q.resolve(res);\n        }, function (err) {\n          q.reject(err);\n        });\n        return q.promise;\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git\n// link      :      https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin\n\n// NOTE: shareViaEmail -> if user cancels sharing email, success is still called\n// TODO: add support for iPad\n\nangular.module('ngCordova.plugins.socialSharing', [])\n\n  .factory('$cordovaSocialSharing', ['$q', '$window', function ($q, $window) {\n\n    return {\n      share: function (message, subject, file, link) {\n        var q = $q.defer();\n        subject = subject || null;\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.share(message, subject, file, link, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaTwitter: function (message, file, link) {\n        var q = $q.defer();\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.shareViaTwitter(message, file, link, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaWhatsApp: function (message, file, link) {\n        var q = $q.defer();\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.shareViaWhatsApp(message, file, link, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaFacebook: function (message, file, link) {\n        var q = $q.defer();\n        message = message || null;\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.shareViaFacebook(message, file, link, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaFacebookWithPasteMessageHint: function (message, file, link, pasteMessageHint) {\n        var q = $q.defer();\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.shareViaFacebookWithPasteMessageHint(message, file, link, pasteMessageHint, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaSMS: function (message, commaSeparatedPhoneNumbers) {\n        var q = $q.defer();\n        $window.plugins.socialsharing.shareViaSMS(message, commaSeparatedPhoneNumbers, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareViaEmail: function (message, subject, toArr, ccArr, bccArr, fileArr) {\n        var q = $q.defer();\n        toArr = toArr || null;\n        ccArr = ccArr || null;\n        bccArr = bccArr || null;\n        fileArr = fileArr || null;\n        $window.plugins.socialsharing.shareViaEmail(message, subject, toArr, ccArr, bccArr, fileArr, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      shareVia: function (via, message, subject, file, link) {\n        var q = $q.defer();\n        message = message || null;\n        subject = subject || null;\n        file = file || null;\n        link = link || null;\n        $window.plugins.socialsharing.shareVia(via, message, subject, file, link, function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      canShareViaEmail: function () {\n        var q = $q.defer();\n        $window.plugins.socialsharing.canShareViaEmail(function () {\n          q.resolve(true);\n        }, function () {\n          q.reject(false);\n        });\n        return q.promise;\n      },\n\n      canShareVia: function (via, message, subject, file, link) {\n        var q = $q.defer();\n        $window.plugins.socialsharing.canShareVia(via, message, subject, file, link, function (success) {\n          q.resolve(success);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      available: function () {\n        var q = $q.defer();\n        window.plugins.socialsharing.available(function (isAvailable) {\n          if (isAvailable) {\n            q.resolve();\n          }\n          else {\n            q.reject();\n          }\n        });\n      }\n    };\n  }]);\n\n// install   :       cordova plugin add https://github.com/Paldom/SpinnerDialog.git\n// link      :       https://github.com/Paldom/SpinnerDialog\n\nangular.module('ngCordova.plugins.spinnerDialog', [])\n\n  .factory('$cordovaSpinnerDialog', ['$window', function ($window) {\n\n    return {\n      show: function (title, message, fixed) {\n        fixed = fixed || false;\n        return $window.plugins.spinnerDialog.show(title, message, fixed);\n      },\n      hide: function () {\n        return $window.plugins.spinnerDialog.hide();\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.splashscreen\n// link      :      https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.splashscreen', [])\n\n  .factory('$cordovaSplashscreen', [function () {\n\n    return {\n      hide: function () {\n        return navigator.splashscreen.hide();\n      },\n\n      show: function () {\n        return navigator.splashscreen.show();\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git\n// link      :      https://github.com/brodysoft/Cordova-SQLitePlugin/blob/master/README.md\n\nangular.module('ngCordova.plugins.sqlite', [])\n\n  .factory('$cordovaSQLite', ['$q', '$window', function ($q, $window) {\n\n    return {\n      openDB: function (dbName, background) {\n\n        if (typeof background === 'undefined') {\n          background = 0;\n        }\n\n        return $window.sqlitePlugin.openDatabase({\n          name: dbName,\n          bgType: background\n        });\n      },\n\n      execute: function (db, query, binding) {\n        var q = $q.defer();\n        db.transaction(function (tx) {\n          tx.executeSql(query, binding, function (tx, result) {\n              q.resolve(result);\n            },\n            function (transaction, error) {\n              q.reject(error);\n            });\n        });\n        return q.promise;\n      },\n\n      insertCollection: function (db, query, bindings) {\n        var q = $q.defer();\n        var coll = bindings.slice(0); // clone collection\n\n        db.transaction(function (tx) {\n          (function insertOne() {\n            var record = coll.splice(0, 1)[0]; // get the first record of coll and reduce coll by one\n            try {\n              tx.executeSql(query, record, function (tx, result) {\n                if (coll.length === 0) {\n                  q.resolve(result);\n                } else {\n                  insertOne();\n                }\n              }, function (transaction, error) {\n                q.reject(error);\n                return;\n              });\n            } catch (exception) {\n              q.reject(exception);\n            }\n          })();\n        });\n        return q.promise;\n      },\n\n      nestedExecute: function (db, query1, query2, binding1, binding2) {\n        var q = $q.defer();\n\n        db.transaction(function (tx) {\n            tx.executeSql(query1, binding1, function (tx, result) {\n              q.resolve(result);\n              tx.executeSql(query2, binding2, function (tx, res) {\n                q.resolve(res);\n              });\n            });\n          },\n          function (transaction, error) {\n            q.reject(error);\n          });\n\n        return q.promise;\n      },\n\n      deleteDB: function (dbName) {\n        var q = $q.defer();\n\n        $window.sqlitePlugin.deleteDatabase(dbName, function (success) {\n          q.resolve(success);\n        }, function (error) {\n          q.reject(error);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.statusbar\n// link      :      https://github.com/apache/cordova-plugin-statusbar/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.statusbar', [])\n\n  .factory('$cordovaStatusbar', [function () {\n\n    return {\n      overlaysWebView: function (bool) {\n        return StatusBar.overlaysWebView(!!bool);\n      },\n\n      style: function (style) {\n        switch (style) {\n          // Default\n          case 0:\n            return StatusBar.styleDefault();\n\n          // LightContent\n          case 1:\n            return StatusBar.styleLightContent();\n\n          // BlackTranslucent\n          case 2:\n            return StatusBar.styleBlackTranslucent();\n\n          // BlackOpaque\n          case 3:\n            return StatusBar.styleBlackOpaque();\n\n          default:\n            return StatusBar.styleDefault();\n        }\n      },\n\n      // supported names:\n      // black, darkGray, lightGray, white, gray, red, green,\n      // blue, cyan, yellow, magenta, orange, purple, brown\n      styleColor: function (color) {\n        return StatusBar.backgroundColorByName(color);\n      },\n\n      styleHex: function (colorHex) {\n        return StatusBar.backgroundColorByHexString(colorHex);\n      },\n\n      hide: function () {\n        return StatusBar.hide();\n      },\n\n      show: function () {\n        return StatusBar.show();\n      },\n\n      isVisible: function () {\n        return StatusBar.isVisible;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git\n// link      :      https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin\n\nangular.module('ngCordova.plugins.toast', [])\n\n  .factory('$cordovaToast', ['$q', '$window', function ($q, $window) {\n\n    return {\n      showShortTop: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showShortTop(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      showShortCenter: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showShortCenter(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      showShortBottom: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showShortBottom(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      showLongTop: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showLongTop(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      showLongCenter: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showLongCenter(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n      showLongBottom: function (message) {\n        var q = $q.defer();\n        $window.plugins.toast.showLongBottom(message, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      },\n\n\n      show: function (message, duration, position) {\n        var q = $q.defer();\n        $window.plugins.toast.show(message, duration, position, function (response) {\n          q.resolve(response);\n        }, function (error) {\n          q.reject(error);\n        });\n        return q.promise;\n      }\n    };\n\n  }]);\n\n// install   :      cordova plugin add https://github.com/leecrossley/cordova-plugin-touchid.git\n// link      :      https://github.com/leecrossley/cordova-plugin-touchid\n\nangular.module('ngCordova.plugins.touchid', [])\n\n  .factory('$cordovaTouchID', ['$q', function ($q) {\n\n    return {\n      checkSupport: function () {\n        var defer = $q.defer();\n        if (!window.cordova) {\n          defer.reject(\"Not supported without cordova.js\");\n        } else {\n          touchid.checkSupport(function (value) {\n            defer.resolve(value);\n          }, function (err) {\n            defer.reject(err);\n          });\n        }\n\n        return defer.promise;\n      },\n\n      authenticate: function (auth_reason_text) {\n        var defer = $q.defer();\n        if (!window.cordova) {\n          defer.reject(\"Not supported without cordova.js\");\n        } else {\n          touchid.authenticate(function (value) {\n            defer.resolve(value);\n          }, function (err) {\n            defer.reject(err);\n          }, auth_reason_text);\n        }\n\n        return defer.promise;\n      }\n    };\n  }]);\n\n// install   :      cordova plugin add org.apache.cordova.vibration\n// link      :      https://github.com/apache/cordova-plugin-vibration/blob/master/doc/index.md\n\nangular.module('ngCordova.plugins.vibration', [])\n\n  .factory('$cordovaVibration', [function () {\n\n    return {\n      vibrate: function (times) {\n        return navigator.notification.vibrate(times);\n      },\n      vibrateWithPattern: function (pattern, repeat) {\n        return navigator.notification.vibrateWithPattern(pattern, repeat);\n      },\n      cancelVibration: function () {\n        return navigator.notification.cancelVibration();\n      }\n    };\n  }]);\n\n// install   :    cordova plugin add https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin.git\n// link      :    https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin\n\nangular.module('ngCordova.plugins.videoCapturePlus', [])\n\n  .provider('$cordovaVideoCapturePlus', [function () {\n\n    var defaultOptions = {};\n\n\n    /**\n     * the nr of videos to record, default 1 (on iOS always 1)\n     *\n     * @param limit\n     */\n    this.setLimit = function setLimit(limit) {\n      defaultOptions.limit = limit;\n    };\n\n\n    /**\n     * max duration in seconds, default 0, which is 'forever'\n     *\n     * @param seconds\n     */\n    this.setMaxDuration = function setMaxDuration(seconds) {\n      defaultOptions.duration = seconds;\n    };\n\n\n    /**\n     * set to true to override the default low quality setting\n     *\n     * @param {Boolean} highquality\n     */\n    this.setHighQuality = function setHighQuality(highquality) {\n      defaultOptions.highquality = highquality;\n    };\n\n    /**\n     * you'll want to sniff the user-Agent/device and pass the best overlay based on that..\n     * set to true to override the default backfacing camera setting. iOS: works fine, Android: YMMV (#18)\n     *\n     * @param {Boolean} frontcamera\n     */\n    this.useFrontCamera = function useFrontCamera(frontcamera) {\n      defaultOptions.frontcamera = frontcamera;\n    };\n\n\n    /**\n     * put the png in your www folder\n     *\n     * @param {String} imageUrl\n     */\n    this.setPortraitOverlay = function setPortraitOverlay(imageUrl) {\n      defaultOptions.portraitOverlay = imageUrl;\n    };\n\n\n    /**\n     *\n     * @param {String} imageUrl\n     */\n    this.setLandscapeOverlay = function setLandscapeOverlay(imageUrl) {\n      defaultOptions.landscapeOverlay = imageUrl;\n    };\n\n\n    /**\n     * iOS only\n     *\n     * @param text\n     */\n    this.setOverlayText = function setOverlayText(text) {\n      defaultOptions.overlayText = text;\n    };\n\n\n    this.$get = ['$q', '$window', function ($q, $window) {\n      return {\n        captureVideo: function (options) {\n          var q = $q.defer();\n\n          if (!$window.plugins.videocaptureplus) {\n            q.resolve(null);\n            return q.promise;\n          }\n\n          $window.plugins.videocaptureplus.captureVideo(q.resolve, q.reject,\n            angular.extend({}, defaultOptions, options));\n\n          return q.promise;\n        }\n      };\n    }];\n  }]);\n\n// install  :     cordova plugin add https://github.com/MobileChromeApps/zip.git\n// link     :     https://github.com/MobileChromeApps/zip\n\nangular.module('ngCordova.plugins.zip', [])\n\n  .factory('$cordovaZip', ['$q', '$window', function ($q, $window) {\n\n    return {\n      unzip: function (source, destination) {\n        var q = $q.defer();\n\n        $window.zip.unzip(source, destination, function (isError) {\n          if (isError === 0) {\n            q.resolve();\n          } else {\n            q.reject();\n          }\n        }, function (progressEvent) {\n          q.notify(progressEvent);\n        });\n\n        return q.promise;\n      }\n    };\n  }]);\n\n})();"
  },
  {
    "path": "www/lib/ngCordova/package.json",
    "content": "{\n  \"name\": \"ng-cordova\",\n  \"private\": false,\n  \"main\": \"dist/ng-cordova\",\n  \"version\": \"0.1.12-alpha\",\n  \"repository\": {\n    \"url\": \"git://github.com/driftyco/ng-cordova.git\"\n  },\n  \"devDependencies\": {\n    \"gulp\": \"^3.7.0\",\n    \"gulp-concat\": \"^2.2.0\",\n    \"gulp-footer\": \"^1.0.4\",\n    \"gulp-header\": \"^1.0.2\",\n    \"gulp-jshint\": \"^1.6.1\",\n    \"gulp-prettify\": \"^0.3.0\",\n    \"gulp-rename\": \"^1.2.0\",\n    \"gulp-shell\": \"^0.2.10\",\n    \"gulp-uglify\": \"^0.2.1\",\n    \"jshint-stylish\": \"^0.4.0\",\n    \"karma\": \"^0.12.16\",\n    \"karma-chrome-launcher\": \"~0.1.2\",\n    \"karma-coverage\": \"~0.2.6\",\n    \"karma-jasmine\": \"~0.1.5\",\n    \"karma-phantomjs-launcher\": \"~0.1.2\",\n    \"minimist\": \"^0.1.0\"\n  },\n  \"licenses\": [\n    {\n      \"type\": \"MIT\"\n    }\n  ],\n  \"scripts\": {\n    \"test\": \"gulp karma --browsers=PhantomJS --reporters=progress\"\n  },\n  \"dependencies\": {\n    \"conventional-changelog\": \"0.0.11\",\n    \"fs\": \"0.0.2\",\n    \"q\": \"^1.1.2\"\n  }\n}\n"
  },
  {
    "path": "www/views/explore/explore.html",
    "content": "<ion-view view-title=\"探索\">\n  <ion-content class=\"center\">\n    即将到来！\n\n  </ion-content>\n</ion-view>\n"
  },
  {
    "path": "www/views/explore/explore.js",
    "content": "angular.module('ioniclub')\n\n.controller('ExploreCtrl', function($scope, $timeout, $cordovaGoogleAnalytics) {\n  console.log(\"enter Explore ctrl\");\n\n\n\n  $scope.$on('$ionicView.afterEnter', function() {\n\n\n    document.addEventListener(\"deviceready\", function() {\n      // trackView\n      $cordovaGoogleAnalytics.trackView('explore view');\n    }, false);\n\n  });\n\n\n\n});\n"
  },
  {
    "path": "www/views/my/messages.html",
    "content": "<ion-view view-title=\"消息\">\n  <ion-content class=\"has-header\">\n    <ion-list>\n      <ion-item class=\"item-divider\">\n        未读消息\n      </ion-item>\n      <ion-item ng-repeat=\"message in messages.hasnot_read_messages\">\n        <p ng-if=\"message.type == 'reply'\">\n          <a href=\"#/user/{{message.author.loginname}}\">{{message.author.loginname}}</a>\n          在\n          <a href=\"#/tab/my/messages-topic/{{message.topic.id}}\">{{message.topic.title}}</a>\n          中@了你\n        </p>\n        <p ng-if=\"message.type == 'at'\">\n          <a href=\"#/user/{{message.author.loginname}}\">{{message.author.loginname}}</a>\n          回复了\n          <a href=\"#/tab/my/messages-topic/{{message.topic.id}}\">{{message.topic.title}}</a>\n        </p>\n      </ion-item>\n      <ion-item class=\"item-divider\">\n        已读消息\n      </ion-item>\n      <ion-item ng-repeat=\"message in messages.has_read_messages\">\n        <p ng-if=\"message.type == 'reply'\">\n          <a href=\"#/user/{{message.author.loginname}}\">{{message.author.loginname}}</a>\n          在\n          <a href=\"#/tab/my/messages-topic/{{message.topic.id}}\">{{message.topic.title}}</a>\n          中@了你\n        </p>\n        <p ng-if=\"message.type == 'at'\">\n          <a href=\"#/user/{{message.author.loginname}}\">{{message.author.loginname}}</a>\n          回复了\n          <a href=\"#/tab/my/messages-topic/{{message.topic.id}}\">{{message.topic.title}}</a>\n        </p>\n      </ion-item>\n    </ion-list>\n  </ion-content>\n</ion-view>\n"
  },
  {
    "path": "www/views/my/my.html",
    "content": "<ion-view view-title=\"我\">\n  <ion-content class=\"setting\">\n\n\n\n    <ion-list>\n      <ion-item class=\"item-divider item-gap\">\n      </ion-item>\n\n      <ion-item class=\"login\" on-hold=\"onHoldLogin()\" ng-click=\"login()\" ng-if=\"!loginName\">\n\n        <img src=\"img/commentfailure.png\" class=\"avatar\">\n        <br>\n        <br>\n\n        <p ng-if=\"!processing\">立即登录</p>\n        <ion-spinner icon=\"ripple\" ng-if=\"processing\"></ion-spinner>\n      </ion-item>\n\n      <ion-item class=\"item-avatar item-icon-right\" ng-if=\"loginName\" href=\"#/tab/my/personal\">\n\n\n        <img ng-src=\"{{currentUser.avatar_url|avatarFilter}}\" reset-img>\n        <h2>{{loginName}}</h2>\n        <p>积分：{{currentUser.score}}</p>\n        <!-- <i class=\"icon ion-ios-arrow-right\"></i> -->\n        <i class=\"icon ion-chevron-right icon-accessory\"></i>\n\n      </ion-item>\n\n\n\n      <div class=\"button-bar bar-light\">\n\n        <a class=\"button  icon-left\" ng-click=\"collectList()\"><i class=\"icon ion-android-star-outline\"></i> 收藏</a>\n        <a class=\"button  icon-left\" ng-click=\"messageList()\"><i class=\"icon ion-email\"></i> 消息\n          <span ng-if=\"messagesCount\" class=\"badge badge-assertive messagesCount\">\n            {{messagesCount > 9 ? 'N' : messagesCount}}\n          </span></a>\n        <!-- <a class=\"button\">Third</a> -->\n      </div>\n\n      <ion-item class=\"item-divider item-gap\">\n      </ion-item>\n\n      <!-- <ion-toggle ng-model=\"settings.showAvatar\" ng-change=\"settingsChange()\">\n        显示头像\n      </ion-toggle> -->\n      <ion-toggle ng-model=\"settings.sendFrom\" ng-change=\"settingsChange()\">\n        显示消息后缀\n      </ion-toggle>\n\n      <!--   <ion-item class=\"item-toggle\">\n      仅在Wi-Fi下显示头像\n      <label class=\"toggle toggle-positive\">\n        <input type=\"checkbox\" ng-checked=\"settings.saverMode\" ng-model=\"settings.saverMode\">\n        <div class=\"track\">\n          <div class=\"handle\"></div>\n        </div>\n      </label>\n    </ion-item>\n      <div class=\"item\">\n        <pre ng-bind=\"settings.saverMode | json\"></pre>\n        {{settings}}\n      </div>-->\n      <ion-item class=\"item-divider\">\n        关于\n      </ion-item>\n      <ion-item>\n        当前版本\n        <span class=\"item-note\">\n          {{settings.version}}\n        </span>\n      </ion-item>\n      <ion-item ng-click=\"feedback()\">\n        意见反馈\n        <span class=\"item-note\">\n          Email:v@ionichina.com\n        </span>\n      </ion-item>\n      <ion-item onclick=\"window.open('itms-apps://itunes.apple.com/app/id996999423', '_system')\" ng-if=\"platform.isIOS()\">\n        评分鼓励\n      </ion-item>\n      <ion-item onclick=\"window.open('http://donghongfei.com', '_blank', 'location=yes')\">\n        关于作者\n      </ion-item>\n      <ion-item onclick=\"window.open('http://ionichina.com/about', '_blank', 'location=yes')\">\n        关于Ionichina社区\n      </ion-item>\n    </ion-list>\n    <div id=\"copyright\">\n      &copy; {{now | date:'yyyy'}} 小学生·董宏飞\n\n    </div>\n  </ion-content>\n</ion-view>\n"
  },
  {
    "path": "www/views/my/my.js",
    "content": "angular.module('ioniclub')\n\n.controller('MyCtrl', function($scope, $state, $rootScope, $timeout,\n    $cordovaClipboard, $cordovaEmailComposer, $cordovaGoogleAnalytics,\n    $ionicHistory, $ionicLoading, $ionicPopup, $log, ENV, User, My) {\n    console.log(\"enter My ctrl\");\n\n\n\n\n    $scope.$on('$ionicView.beforeEnter', function() {\n\n      $scope.ENV = ENV;\n      $rootScope.hideTabs = '';\n    });\n\n    $scope.$on('$ionicView.afterEnter', function() {\n\n      document.addEventListener(\"deviceready\", function() {\n        // trackView\n        $cordovaGoogleAnalytics.trackView('my view');\n      }, false);\n\n\n\n    });\n\n    $scope.$on('$ionicView.beforeLeave', function() {\n      // $rootScope.hideTabs = '';\n    });\n\n    $scope.now = new Date();\n    $scope.settings = My.getSettings();\n    $scope.platform = ionic.Platform;\n\n    // mail feedback\n    var feedbackMailAddr = 'v@ionichina.com';\n    var feedbackMailSubject = 'Ioniclub Feedback v' + $scope.settings.version;\n    var device = ionic.Platform.device();\n    var feedbackMailBody = '<br><br>' + device.platform + ' ' + device.version + ' | ' + device.model;\n    $scope.feedback = function() {\n\n      document.addEventListener(\"deviceready\", function() {\n\n        $cordovaEmailComposer.isAvailable().then(function() {\n          // is available\n        }, function() {\n          // not available\n          window.open('mailto:' + feedbackMailAddr + '?subject=' + feedbackMailSubject);\n        });\n\n        var email = {\n          to: feedbackMailAddr,\n          subject: feedbackMailSubject,\n          body: feedbackMailBody\n        };\n\n        $cordovaEmailComposer.open(email).then(null, function() {\n          // user cancelled email\n        });\n\n      }, false);\n\n\n\n\n\n\n\n      // if (window.cordova && window.cordova.plugins.email) {\n      //   window.cordova.plugins.email.open({\n      //     to: feedbackMailAddr,\n      //     subject: feedbackMailSubject,\n      //     body: feedbackMailBody\n      //   });\n      // } else {\n      //   window.open('mailto:' + feedbackMailAddr + '?subject=' + feedbackMailSubject);\n      // }\n    };\n\n\n    $scope.settingsChange = function() {\n      My.save($scope.settings);\n      $rootScope.$broadcast('ioniclub.settingUpdate');\n      // $rootScope.$broadcast('ioniclub.settingUpdate',$scope.settings);\n      console.log('ioniclub.settingUpdate');\n      // console.log('Push Notification Change', $scope.settings.saverMode);\n    };\n\n    // get current user\n    var currentUser = User.getCurrentUser();\n    $scope.loginName = currentUser.loginname || null;\n    $scope.currentUser = currentUser;\n    if ($scope.loginName !== null) {\n      // $rootScope.getMessageCount();\n    }\n\n    // login action callback\n    var loginCallback = function(response) {\n      $ionicLoading.hide();\n      $scope.loginName = response.loginname;\n      // $rootScope.getMessageCount();\n    };\n\n    // on hold login action\n    $scope.onHoldLogin = function() {\n\n\n      document.addEventListener(\"deviceready\", function() {\n        $scope.processing = true;\n        $cordovaClipboard\n          .paste()\n          .then(function(result) {\n            // success, use result\n\n            if (result) {\n              $log.log('get Access Token', result);\n              $ionicLoading.show();\n              User.login(result).$promise.then(loginCallback, $rootScope.requestErrorHandler());\n            } else {\n              $ionicLoading.show({\n                noBackdrop: true,\n                template: '粘贴板无内容',\n                duration: 1000\n              });\n\n            }\n\n            $timeout(function() {\n              $scope.processing = false;\n            }, 1000);\n\n\n\n\n          }, function() {\n            // error\n            console.log(\"no clipboad plugin\");\n\n            $ionicLoading.show({\n              noBackdrop: true,\n              template: '粘贴板无内容',\n              duration: 1000\n            });\n          });\n      }, false);\n\n\n    };\n\n\n    // do login\n    $scope.login = function() {\n      if ($scope.processing) {\n        return;\n      }\n\n      if (window.cordova && window.cordova.plugins.barcodeScanner) {\n        var loginPrompt = $ionicPopup.show({\n          template: 'PC端登录 http://ionichina.com 后，扫描设置页面的Access Token二维码即可完成登录',\n          title: '扫码登录',\n          scope: $scope,\n          buttons: [{\n            text: '<b>我知道了</b>',\n            type: 'button-positive',\n            onTap: function(e) {\n              e.preventDefault();\n              loginPrompt.close();\n              dologin();\n            }\n          }]\n        });\n      } else {\n        // auto login if in debug mode\n        if (ENV.debug) {\n          $ionicLoading.show();\n          User.login(ENV.accessToken).$promise.then(loginCallback, $rootScope.requestErrorHandler());\n        } else {\n          $scope.data = {};\n          // show login popup if no barcodeScanner in pc browser\n          var loginPopup = $ionicPopup.show({\n            template: '<input type=\"text\" ng-model=\"data.token\">',\n            title: '输入Access Token',\n            subTitle: 'PC端登录 http://ionichina.com 后，在设置页可以找到Access Token',\n            scope: $scope,\n            buttons: [{\n              text: '取消'\n            }, {\n              text: '<b>提交</b>',\n              type: 'button-positive',\n              onTap: function(e) {\n                e.preventDefault();\n                if ($scope.data.token) {\n                  User.login($scope.data.token).$promise.then(function(response) {\n                    loginPopup.close();\n                    loginCallback(response);\n                  }, $rootScope.requestErrorHandler());\n                }\n              }\n            }]\n          });\n        }\n      }\n    };\n    var dologin = function() {\n      $scope.processing = true;\n      $timeout(function() {\n        $scope.processing = false;\n      }, 1000);\n      cordova.plugins.barcodeScanner.scan(\n        function(result) {\n          $scope.processing = false;\n          if (!result.cancelled) {\n            $log.log('get Access Token', result.text);\n            $ionicLoading.show();\n            User.login(result.text).$promise.then(loginCallback, $rootScope.requestErrorHandler());\n          }\n        },\n        function(error) {\n          $scope.processing = false;\n          $ionicLoading.show({\n            noBackdrop: true,\n            template: 'Scanning failed: ' + error,\n            duration: 1000\n          });\n        }\n      );\n\n      // track event\n      if (window.analytics) {\n        window.analytics.trackEvent('User', 'scan login');\n      }\n    };\n\n    // logout\n    $rootScope.$on('ioniclub.logout', function() {\n      $log.debug('logout broadcast handle');\n      $scope.loginName = null;\n      $scope.messagesCount = 0;\n      // setBadge(0);\n      // 清空历史记录\n\n      // $ionicHistory.clearHistory();\n      // $ionicHistory.clearCache();\n    });\n\n    // save settings on destroy\n    // $scope.$on('$stateChangeStart', function() {\n    //   $log.debug('settings controller on $stateChangeStart');\n    //   My.save();\n    // });\n\n    $scope.collectList = function() {\n      var alertPopup = $ionicPopup.alert({\n\n        template: '该功能暂无！',\n        okText: '确定'\n      });\n      alertPopup.then(function(res) {\n        console.log('Thank you for not eating my delicious ice cream cone');\n      });\n    };\n\n\n    $scope.messageList = function() {\n      if ($scope.loginName) {\n        $state.go('tab.my-messages');\n        return;\n      }\n\n\n      var alertPopup = $ionicPopup.confirm({\n\n        template: '登录后继续操作',\n        cancelText: '取消',\n        okText: '确定'\n      });\n      alertPopup.then(function(res) {\n        if (res) {\n          $scope.login();\n        } else {\n          console.log('cancel');\n          // console.log('You are not sure');\n\n        }\n      });\n    };\n\n\n\n  })\n  .controller('PersonalCtrl', function($scope, $rootScope, $state, $timeout, $ionicActionSheet,\n    $ionicHistory, $cordovaGoogleAnalytics,\n    $log, User) {\n    $log.log(\"Personal ctrl\");\n    // get current user\n    var currentUser = User.getCurrentUser();\n    $scope.loginName = currentUser.loginname || null;\n    $scope.currentUser = currentUser;\n\n    // before enter view event\n    $scope.$on('$ionicView.beforeEnter', function() {\n\n      $rootScope.hideTabs = 'tabs-item-hide';\n\n    });\n\n    $scope.$on('$ionicView.afterEnter', function() {\n\n\n      document.addEventListener(\"deviceready\", function() {\n        // trackView\n        $cordovaGoogleAnalytics.trackView('personal view');\n      }, false);\n\n\n\n    });\n\n\n\n    $scope.$on('$ionicView.beforeLeave', function() {\n      $rootScope.hideTabs = '';\n    });\n\n\n\n    $scope.logout = function() {\n      console.log('logout');\n      // Show the action sheet\n      var hideSheet = $ionicActionSheet.show({\n\n        destructiveText: '退出登录',\n        titleText: '确定退出当前登录账号么？',\n        cancelText: '取消',\n        cancel: function() {\n          // add cancel code..\n        },\n        destructiveButtonClicked: function() {\n          logout();\n          return true;\n        }\n      });\n\n      // For example's sake, hide the sheet after two seconds\n      $timeout(function() {\n        // hideSheet();\n      }, 2000);\n    };\n\n\n    // logout action\n    var logout = function() {\n      $log.debug('logout button action');\n      User.logout();\n      $rootScope.$broadcast('ioniclub.logout');\n\n      // track event\n      if (window.analytics) {\n        window.analytics.trackEvent('User', 'logout');\n      }\n      // 刷新页面\n      // $ionicHistory.clearHistory();\n      // $ionicHistory.clearCache();\n      $state.go('tab.my');\n\n      // $state.go(\"tab.setting\", {}, {\n      //   reload: true\n      // });\n\n\n    };\n\n\n  })\n  .controller('MessagesCtrl', function($scope, $log, $stateParams, $rootScope, $cordovaGoogleAnalytics, Messages) {\n    $log.log('messages ctrl');\n\n    // before enter view event\n    $scope.$on('$ionicView.beforeEnter', function() {\n      // track view\n      if (window.analytics) {\n        window.analytics.trackView('messages view');\n      }\n\n      $rootScope.hideTabs = 'tabs-item-hide';\n\n      // load messages\n      loadMessages();\n    });\n\n    $scope.$on('$ionicView.afterEnter', function() {\n\n      document.addEventListener(\"deviceready\", function() {\n        // trackView\n        $cordovaGoogleAnalytics.trackView('messages view');\n      }, false);\n\n\n\n    });\n\n\n    $scope.$on('$ionicView.beforeLeave', function() {\n      // $rootScope.hideTabs = '';\n    });\n\n\n\n    var loadMessages = function() {\n      Messages.getMessages().$promise.then(function(response) {\n        $scope.messages = response.data;\n        if ($scope.messages.hasnot_read_messages.length === 0) {\n          $rootScope.$broadcast('messagesMarkedAsRead');\n        } else {\n          Messages.markAll().$promise.then(function(response) {\n            $log.debug('mark all response:', response);\n            if (response.success) {\n              $rootScope.$broadcast('messagesMarkedAsRead');\n            }\n          }, function(response) {\n            $log.debug('mark all response error:', response);\n          });\n        }\n      }, function(response) {\n        $log.debug('get messages response error:', response);\n      });\n    };\n  })\n\n.factory('User', function(ENV, $resource, $log, $q, Storage, Push) {\n    var storageKey = 'user';\n    var resource = $resource(ENV.api + '/accesstoken');\n    var userResource = $resource(ENV.api + '/user/:loginname', {\n      loginname: ''\n    });\n    var user = Storage.get(storageKey) || {};\n    return {\n      login: function(accesstoken) {\n        var $this = this;\n        return resource.save({\n          accesstoken: accesstoken\n        }, null, function(response) {\n          $log.debug('post accesstoken:', response);\n          user.accesstoken = accesstoken;\n          $this.getByLoginName(response.loginname).$promise.then(function(r) {\n            user = r.data;\n            user.id = response.id;\n            user.accesstoken = accesstoken;\n\n            // set alias for jpush\n            Push.setAlias(user.id);\n\n            Storage.set(storageKey, user);\n          });\n          user.loginname = response.loginname;\n        });\n      },\n      logout: function() {\n        user = {};\n        Storage.remove(storageKey);\n\n        // unset alias for jpush\n        Push.setAlias('');\n      },\n      getCurrentUser: function() {\n        $log.debug('current user:', user);\n        return user;\n      },\n      getByLoginName: function(loginName) {\n        if (user && loginName === user.loginname) {\n          var userDefer = $q.defer();\n          $log.debug('get user info from storage:', user);\n          userDefer.resolve({\n            data: user\n          });\n          return {\n            $promise: userDefer.promise\n          };\n        }\n        return this.get(loginName);\n      },\n      get: function(loginName) {\n        return userResource.get({\n          loginname: loginName\n        }, function(response) {\n          $log.debug('get user info:', response);\n          if (user && user.loginname === loginName) {\n            angular.extend(user, response.data);\n\n            Storage.set(storageKey, user);\n          }\n        });\n      }\n    };\n  })\n  .factory('Messages', function(ENV, $resource, $log, User) {\n    var messages = {};\n    var messagesCount = 0;\n    var resource = $resource(ENV.api + '/messages', null, {\n      count: {\n        method: 'get',\n        url: ENV.api + '/message/count'\n      },\n      markAll: {\n        method: 'post',\n        url: ENV.api + '/message/mark_all'\n      }\n    });\n    return {\n      currentMessageCount: function() {\n        return messagesCount;\n      },\n      getMessageCount: function() {\n        $log.debug('get messages count');\n        var currentUser = User.getCurrentUser();\n        return resource.count({\n          accesstoken: currentUser.accesstoken\n        });\n      },\n      getMessages: function() {\n        $log.debug('get messages');\n        var currentUser = User.getCurrentUser();\n        return resource.get({\n          accesstoken: currentUser.accesstoken\n        });\n        // return messages;\n      },\n      markAll: function() {\n        $log.debug('mark all as read');\n        var currentUser = User.getCurrentUser();\n        return resource.markAll({\n          accesstoken: currentUser.accesstoken\n        }, function(response) {\n          $log.debug('marked messages as read:', response);\n          messagesCount = 0;\n        });\n      }\n    };\n  })\n  .factory('My', function(ENV, $resource, $log, Storage) {\n    var storageKey = 'settings';\n    var settings = Storage.get(storageKey) || {\n      sendFrom: true,\n      showAvatar: true,\n      version: ENV.version\n    };\n    return {\n      getSettings: function() {\n        $log.debug('get settings', settings);\n        return settings;\n      },\n      setSettings: function(key, value) {\n        settings[key] = value;\n        // return settings;\n        $log.debug('set settings', settings);\n      },\n      save: function(settings) {\n        $log.debug('save settings', settings);\n        Storage.set(storageKey, settings);\n      }\n    };\n  });\n"
  },
  {
    "path": "www/views/my/personal.html",
    "content": "<ion-view view-title=\"个人信息\">\n  <ion-content class=\"setting\">\n\n\n\n    <ion-list>\n      <ion-item class=\"item-divider item-gap\">\n      </ion-item>\n\n      <ion-item class=\"item-avatar item-icon-right\">\n\n\n        <img ng-src=\"{{currentUser.avatar_url|avatarFilter}}\" reset-img> {{currentUser.loginname}}\n\n      </ion-item>\n      <ion-item>\n        积分\n        <span class=\"item-note\">\n          {{currentUser.score}}\n        </span>\n      </ion-item>\n      <ion-item>\n        注册日期\n        <span class=\"item-note\">\n          {{currentUser.create_at | amDateFormat:'MMMM Do YYYY, h:mm:ss'}}\n        </span>\n      </ion-item>\n\n\n\n        <button class=\"button button-block button-light\"  ng-click=\"logout()\">\n          退出当前账号\n        </button>\n\n\n\n  </ion-content>\n</ion-view>\n"
  },
  {
    "path": "www/views/tabs.html",
    "content": "<!--\nCreate tabs with an icon and label, using the tabs-positive style.\nEach tab's child <ion-nav-view> directive will have its own\nnavigation history that also transitions its views in and out.\n-->\n<!-- <ion-tabs delegate-handle=\"topic-category\" class=\"tabs-striped tabs-top tabs-background-stable tabs-color-assertive\" ng-class=\"$root.tabsHidden\">\n  <ion-tab title=\"分享\" on-select=\"onTabSelected()\"></ion-tab>\n  <ion-tab title=\"问答\" on-select=\"onTabSelected()\"></ion-tab>\n  <ion-tab title=\"招聘\" on-select=\"onTabSelected()\"></ion-tab>\n  <ion-tab title=\"吐槽\" on-select=\"onTabSelected()\"></ion-tab>\n</ion-tabs> -->\n\n\n\n<ion-tabs class=\"tabs-icon-top tabs-stable tabs-color-positive {{hideTabs}} \">\n\n  <!-- Dashboard Tab -->\n  <ion-tab title=\"话题\" icon-off=\"ion-ios-chatbubble-outline\" icon-on=\"ion-ios-chatbubble\" href=\"#/tab/topics\">\n    <ion-nav-view name=\"tab-topics\"></ion-nav-view>\n  </ion-tab>\n\n  <!-- Dashboard Tab -->\n  <ion-tab title=\"探索\" icon-off=\"ion-ios-ionic-outline\" icon-on=\"ion-ionic\" href=\"#/tab/explore\">\n    <ion-nav-view name=\"tab-explore\"></ion-nav-view>\n  </ion-tab>\n\n\n\n  <!-- Account Tab -->\n  <ion-tab title=\"我\" icon-off=\"ion-ios-person-outline\" icon-on=\"ion-ios-person\" href=\"#/tab/my\">\n    <ion-nav-view name=\"tab-my\"></ion-nav-view>\n  </ion-tab>\n\n\n</ion-tabs>\n"
  },
  {
    "path": "www/views/topic/newTopic.html",
    "content": "<div class=\"modal\">\n  <ion-header-bar>\n    <div class=\"buttons\">\n      <button class=\"button button-clear\" ng-click=\"closeNewTopicModal()\">关闭</button>\n    </div>\n    <h1 class=\"title\">发布话题</h1>\n    <div class=\"buttons\">\n      <button class=\"button button-clear button-positive\" ng-click=\"saveNewTopic()\" ng-disabled=\"newTopicData.title.length < 10 || newTopicData.content == ''\">提交</button>\n    </div>\n  </ion-header-bar>\n  <ion-content class=\"topic-create\">\n    <form>\n      <div class=\"list\">\n        <label class=\"item item-input item-select\">\n          <select ng-model=\"newTopicData.tab\" class=\"topic-tabs\">\n            <option ng-if=\"tab.value != undefined && tab.value != 'all'\" ng-repeat=\"tab in tabs\" value=\"{{tab.value}}\">{{tab.label}}</option>\n          </select>\n        </label>\n        <label class=\"item item-input\">\n          <input type=\"text\" ng-model=\"newTopicData.title\" placeholder=\"标题10字以上\">\n        </label>\n        <label class=\"item item-input\">\n          <textarea placeholder=\"内容\" ng-model=\"newTopicData.content\" rows=\"5\" class=\"content\"></textarea>\n        </label>\n      </div>\n    </form>\n  </ion-content>\n</div>\n"
  },
  {
    "path": "www/views/topic/popover.html",
    "content": "<ion-popover-view>\n  <ion-content>\n\n\n    <ion-list>\n      <ion-item ng-repeat=\"tab in tabs\" ng-click=\"changeTab(tab.value)\">\n        {{tab.label}}\n      </ion-item>\n    </ion-list>\n\n\n  </ion-content>\n</ion-popover-view>\n"
  },
  {
    "path": "www/views/topic/topic.html",
    "content": "<ion-view view-title='' cache-view='false'>\n  <!--   <ion-nav-buttons side=\"left\">\n  <a class=\"button button-icon button-clear ion-ios-arrow-back\" href=\"#/tab/topics\"></a>\n\n</ion-nav-buttons> -->\n\n  <ion-nav-buttons side=\"right\">\n\n    <button class=\"button button-icon icon ion-android-star-outline\" ng-click=\"collect(topic)\"></button>&nbsp;&nbsp;&nbsp;&nbsp;\n    <button class=\"button button-icon icon ion-share\" ng-click=\"share(topic)\"></button>\n  </ion-nav-buttons>\n  <ion-content class=\"has-header\" >\n\n\n\n\n\n    <div class=\"row topic\" ng-if=\"finished\">\n      <div class=\"col col90\">\n        <h4 class=\"title\">{{topic.title}}</h4>\n        <div class=\"summary\">\n          <strong>\n            <a href=\"#/user/{{topic.author.loginname}}\">\n              <img ng-src=\"{{topic.author.avatar_url | avatarFilter}}\"  class=\"avatar\" reset-img>\n              <!-- <img ng-src=\"{{topic.author.avatar_url  | protocol}}\" class=\"avatar\" />  -->\n              {{topic.author.loginname}}\n            </a>\n          </strong>\n          <span class=\"item-note\" am-time-ago=\"topic.last_reply_at\"></span>\n        </div>\n        <div class=\"topic-content\" ng-bind-html=\"topic.content | link\">\n        </div>\n      </div>\n    </div>\n    <ion-list class=\"replies\" ng-if=\"finished\">\n      <ion-item ng-if=\"topic.replies.length == 0\">\n        暂无评论\n      </ion-item>\n      <ion-item class=\"item-avatar\" ng-repeat=\"reply in topic.replies\" ng-click=\"showActions(reply)\">\n        <img ng-src=\"{{reply.author.avatar_url | avatarFilter}}\"  reset-img>\n        <p>\n          <a href=\"#/user/{{reply.author.loginname}}\" ng-class=\"{'bold': reply.author.loginname == topic.author.loginname}\">\n            {{reply.author.loginname}}\n          </a>\n          <span class=\"item-note\" am-time-ago=\"reply.create_at\">\n          </span>\n          <span class=\"item-note cnode\" ng-if=\"reply.ups.length > 0\">\n            <i class=\"icon ion-thumbsup\"></i> {{reply.ups.length}} &nbsp;\n          </span>\n        </p>\n        <div class=\"reply-content\" ng-bind-html=\"reply.content  | link\"></div>\n      </ion-item>\n    </ion-list>\n    <br />\n\n\n\n    <ion-spinner class=\"topic-spinner ng-hide\" ng-show=\"!finished\" ng-style=\"{'top':getHalfHeight()+'px'}\"></ion-spinner>\n\n\n\n  </ion-content>\n  <ion-footer-bar align-title=\"left\" class=\"bar-light reply-new\" keyboard-attach>\n    <label class=\"item-input-wrapper\">\n      <input type=\"text\" placeholder=\"回复\" ng-model=\"replyData.content\" ng-disabled=\"loginName == null\">\n    </label>\n    <button class=\"button button-small button-clear button-positive\" ng-click=\"saveReply()\" ng-class=\"{'disabled':loginName == null || replyData.content == ''}\">\n      提交\n    </button>\n  </ion-footer-bar>\n</ion-view>\n"
  },
  {
    "path": "www/views/topic/topics.html",
    "content": "<!-- <ion-header-bar class=\"bar-positive\">\n  <button class=\"button button-icon icon ion-navicon\"></button>\n  <div class=\"h1 title\">Header Buttons</div>\n  <button class=\"button button-clear\">Edit</button>\n</ion-header-bar> -->\n\n<ion-view view-title=\"{{currentTab|tabName}}\"  >\n  <ion-nav-buttons side=\"left\">\n    <button class=\"button button-clear button-light\" ng-click=\"openPopover($event)\">类别</button>\n  </ion-nav-buttons>\n  <ion-nav-buttons side=\"right\">\n    <button class=\"button button-icon icon ion-compose\" ng-click=\"showNewTopicModal()\" ng-disabled=\"loginName == null\"></button>\n  </ion-nav-buttons>\n\n\n  <ion-content class=\"has-tabs has-header\"   >\n    <ion-refresher pulling-text=\"下拉刷新...\" on-refresh=\"doRefresh()\">\n    </ion-refresher>\n    <ion-list class=\"topics\">\n      <ion-item class=\"item-avatar\" collection-repeat=\"topic in topics\" href=\"#/tab/topics/{{topic.id}}\"\n      collection-item-width=\"'100%'\" collection-item-height=\"65px\">\n        <img ng-src=\"{{topic.author.avatar_url|avatarFilter}}\"   reset-img>\n        <h2>{{topic.title}}</h2>\n        <p class=\"summary\">\n          <span ng-if=\"!topic.top && !topic.good\" class=\"tab\">{{topic.tab|tabName}}</span>\n          <span ng-if=\"topic.top\" class=\"tab hl\">置顶</span>\n          <span ng-if=\"topic.good && !topic.top\" class=\"tab hl\">精华</span>\n          {{topic.author.loginname}}\n          <span class=\"item-note ago\" am-time-ago=\"topic.last_reply_at\">\n          </span>\n        </p>\n      </ion-item>\n    </ion-list>\n    <ion-infinite-scroll on-infinite=\"loadMore()\" distance=\"1%\" ng-if=\"moreDataCanBeLoaded()\"></ion-infinite-scroll>\n\n    <ion-spinner class=\"topic-spinner ng-hide\" ng-show=\"!topics\" ng-style=\"{'top':getHalfHeight()+'px'}\"></ion-spinner>\n  </ion-content>\n</ion-view>\n"
  },
  {
    "path": "www/views/topic/topics.js",
    "content": "angular.module('ioniclub')\n\n.controller('TopicsCtrl', function($scope, $rootScope, $log, $timeout,\n    $ionicTabsDelegate, $ionicPopover, $ionicModal, $ionicLoading,\n    $location, $state,\n    $cordovaNetwork, $cordovaGoogleAnalytics,\n    Topics, Tabs, My, User, ENV) {\n    console.log(\"enter topics ctrl\");\n\n    // get current user\n    var currentUser = User.getCurrentUser();\n    $scope.loginName = currentUser.loginname || null;\n\n    $scope.$on('$ionicView.beforeEnter', function() {\n      // get user settings\n      $scope.settings = My.getSettings();\n      $rootScope.hideTabs = '';\n    });\n\n\n    $scope.$on('$ionicView.afterEnter', function() {\n\n      document.addEventListener(\"deviceready\", function() {\n        // trackView\n        $cordovaGoogleAnalytics.trackView('topics view');\n      }, false);\n\n\n      $timeout(function() {\n        $scope.topics = Topics.getTopics();\n      }, 100);\n    });\n\n\n\n\n    // $scope.title = \"全部话题\";\n    // assign tabs\n    $scope.tabs = Tabs;\n    $scope.currentTab = Topics.getCurrentTab();\n\n\n\n\n    // .fromTemplateUrl() method\n    $ionicPopover.fromTemplateUrl('views/topic/popover.html', {\n      scope: $scope\n    }).then(function(popover) {\n      $scope.popover = popover;\n    });\n\n    $scope.openPopover = function($event) {\n      // console.log('show popover');\n      $scope.popover.show($event);\n    };\n\n    $scope.changeTab = function(tab) {\n      Topics.setCurrentTab(tab);\n      $scope.currentTab = Topics.getCurrentTab();\n      $scope.popover.hide();\n    };\n\n\n    // $topicCategory = $ionicTabsDelegate.$getByHandle('topic-category');\n    // var category = TabCategory.get($topicCategory.selectedIndex());\n    // var category = \"all\";\n    Topics.fetchTopStories();\n\n\n\n\n\n    $scope.$on('ioniclub.topicsUpdated', function() {\n      // $timeout(function() {\n      $scope.topics = Topics.getTopics();\n      $scope.$broadcast('scroll.refreshComplete');\n      // }, 100);\n    });\n\n    // logout\n    $rootScope.$on('ioniclub.logout', function() {\n      $log.debug('logout broadcast handle');\n      $scope.loginName = null;\n      $scope.messagesCount = 0;\n      // setBadge(0);\n    });\n\n\n\n\n\n\n    // $scope.onTabSelected = function() {\n    //   // category = TabCategory.get($topicCategory.selectedIndex());\n    //   Topics.setCurrentTab(category);\n    //   Topics.fetchTopStories();\n    //   $scope.topics = Topics.getTopics();\n    //   // console.log(category);\n    // };\n\n    $scope.doRefresh = function() {\n      Topics.fetchTopStories();\n    };\n\n\n    $scope.loadMore = function() {\n      // console.log(\"loadMore\");\n      Topics.increaseNewTopicsCount(15);\n      $scope.$broadcast('scroll.infiniteScrollComplete');\n    };\n\n    $scope.moreDataCanBeLoaded = function() {\n      // console.log(Topics.hasNextPage());\n      return Topics.hasNextPage();\n    };\n\n    // Create the new topic modal that we will use later\n    $ionicModal.fromTemplateUrl('views/topic/newTopic.html', {\n      tabs: Tabs,\n      scope: $scope\n    }).then(function(modal) {\n      $scope.newTopicModal = modal;\n    });\n\n    $scope.newTopicData = {\n      tab: 'share',\n      title: '',\n      content: ''\n    };\n    $scope.newTopicId = null;\n\n    // save new topic\n    $scope.saveNewTopic = function() {\n      $log.debug('new topic data:', $scope.newTopicData);\n      $ionicLoading.show();\n      Topics.saveNewTopic($scope.newTopicData).$promise.then(function(response) {\n        $ionicLoading.hide();\n        $scope.newTopicId = response.topic_id;\n        $scope.closeNewTopicModal();\n        $timeout(function() {\n          $state.go('tab.topic-detail', {\n            id: $scope.newTopicId\n          });\n          $timeout(function() {\n            $scope.doRefresh();\n          }, 300);\n        }, 300);\n      }, $rootScope.requestErrorHandler);\n    };\n    $scope.$on('modal.hidden', function() {\n      // Execute action\n      if ($scope.newTopicId) {\n        $timeout(function() {\n          $location.path('#/tab/topics/' + $scope.newTopicId);\n        }, 300);\n      }\n    });\n    // show new topic modal\n    $scope.showNewTopicModal = function() {\n\n      // track view\n      if (window.analytics) {\n        window.analytics.trackView('new topic view');\n      }\n\n      if (window.StatusBar) {\n        StatusBar.styleDefault();\n      }\n      $scope.newTopicModal.show();\n    };\n\n    // close new topic modal\n    $scope.closeNewTopicModal = function() {\n      if (window.StatusBar) {\n        StatusBar.styleLightContent();\n      }\n      $scope.newTopicModal.hide();\n    };\n\n\n\n  })\n  .controller('TopicCtrl', function($scope, $rootScope, $state, $timeout, $log,\n    $ionicTabsDelegate, $stateParams, $ionicLoading,\n    $ionicScrollDelegate, $ionicActionSheet,\n    $cordovaSocialSharing, $cordovaGoogleAnalytics,\n    Topic, User) {\n\n    // console.table($ionicHistory.viewHistory());\n\n    $scope.finished = false;\n    // get current user\n    var currentUser = User.getCurrentUser();\n    $scope.loginName = currentUser.loginname || null;\n\n\n    $scope.$on('$ionicView.afterEnter', function() {\n      // $rootScope.hideTabs = 'tabs-item-hide';\n\n\n      document.addEventListener(\"deviceready\", function() {\n        // trackView\n        $cordovaGoogleAnalytics.trackView('topic view');\n      }, false);\n    });\n\n    $scope.$on('$ionicView.beforeEnter', function() {\n      $rootScope.hideTabs = 'tabs-item-hide';\n    });\n\n    $scope.$on('$ionicView.beforeLeave', function() {\n      // $rootScope.hideTabs = '';\n    });\n\n\n\n\n    // $ionicLoading.show({\n    //   template: 'Loading...',\n    //   noBackdrop: true\n    // });\n\n    var halfHeight = null;\n    $scope.getHalfHeight = function() {\n      if (ionic.Platform.isAndroid()) return 0;\n      if (!halfHeight) {\n        halfHeight = (document.documentElement.clientHeight / 2) - 200;\n      }\n      // console.log(\"halfHeight:\"+halfHeight);\n      return halfHeight;\n\n    };\n\n    var id = $stateParams.id;\n\n    Topic.getById(id).$promise.then(function(r) {\n      // var topic = Topic.getById(id);\n\n      $scope.finished = true;\n      $scope.topic = r.data;\n\n\n\n\n      // console.log(r.data);\n\n    });\n\n\n    // load topic data\n    $scope.loadTopic = function(reload) {\n      var topicResource;\n      if (reload === true) {\n        topicResource = Topic.get(id);\n      } else {\n        topicResource = Topic.getById(id);\n      }\n      return topicResource.$promise.then(function(response) {\n        $scope.topic = response.data;\n      }, $rootScope.requestErrorHandler({\n        noBackdrop: true\n      }, function() {\n        $scope.loadError = true;\n      }));\n    };\n    $scope.loadTopic();\n\n    $scope.replyData = {\n      content: ''\n    };\n\n    $scope.collect = function(topic) {\n      // console.log(topic);\n      Topic.collect(topic.id).$promise.then(function(response) {\n        if (response.success) {\n          $ionicLoading.show({\n            noBackdrop: true,\n            template: '收藏成功',\n            duration: 1000\n          });\n        }\n      }, $rootScope.requestErrorHandler);\n\n\n    };\n\n    $scope.share = function(topic) {\n      var message = \"测试分享内容\",\n        subject = topic.title,\n        file = null,\n        link = \"http://ionichina.com/topic/\" + topic.id;\n\n      document.addEventListener(\"deviceready\", function() {\n        $cordovaSocialSharing\n          .share(message, subject, file, link) // Share via native share sheet\n          .then(function(result) {\n            console.log('result:' + result);\n            // Success!\n          }, function(err) {\n            console.log('err:' + err);\n            // An error occured. Show a message to the user\n          });\n      }, false);\n    };\n\n    // save reply\n    $scope.saveReply = function() {\n      $log.debug('new reply data:', $scope.replyData);\n      $ionicLoading.show();\n      Topic.saveReply(id, $scope.replyData).$promise.then(function(response) {\n        $ionicLoading.hide();\n        $scope.replyData.content = '';\n        $log.debug('post reply response:', response);\n        $scope.loadTopic(true).then(function() {\n          $ionicScrollDelegate.scrollBottom();\n        });\n      }, $rootScope.requestErrorHandler);\n    };\n\n    // show actions\n    $scope.showActions = function(reply) {\n\n      var currentUser = User.getCurrentUser();\n      console.log('currentUser.loginname:' + currentUser.loginname + '   reply.author.loginname:' + reply.author.loginname);\n      if (currentUser.loginname === undefined || currentUser.loginname === reply.author.loginname) {\n        return;\n      }\n      $log.debug('action reply:', reply);\n      var upLabel = '赞';\n      // detect if current user already do up\n      if (reply.ups.indexOf(currentUser.id) !== -1) {\n        upLabel = '已赞';\n      }\n      var replyContent = '@' + reply.author.loginname;\n      $ionicActionSheet.show({\n        buttons: [{\n          text: '回复'\n        }, {\n          text: upLabel\n        }],\n        titleText: replyContent,\n        cancel: function() {},\n        buttonClicked: function(index) {\n\n          // reply to someone\n          if (index === 0) {\n            $scope.replyData.content = replyContent + ' ';\n            $scope.replyData.reply_id = reply.id;\n            $timeout(function() {\n              document.querySelector('.reply-new input').focus();\n            }, 1);\n          }\n\n          // up reply\n          if (index === 1) {\n            Topic.upReply(reply.id).$promise.then(function(response) {\n              $log.debug('up reply response:', response);\n              $ionicLoading.show({\n                noBackdrop: true,\n                template: response.action === 'up' ? '点赞成功' : '点赞已取消',\n                duration: 1000\n              });\n            }, $rootScope.requestErrorHandler({\n              noBackdrop: true,\n            }));\n          }\n          return true;\n        }\n      });\n    };\n\n  })\n\n.factory('Topics', function($resource, $rootScope, Storage, User, ENV) {\n    var APIUrl = ENV.api + '/topics',\n      // 用来存储话题类别的数据结构，包含了下一页、是否有下一页等属性\n      topics = {},\n      currentTab = \"all\";\n\n\n\n    var resource = $resource(APIUrl, {}, {\n      query: {\n        method: 'get',\n        params: {\n          tab: '@tab',\n          page: 1,\n          limit: 20,\n          mdrender: true\n        },\n        timeout: 20000\n      }\n    });\n\n\n    return {\n      fetchTopStories: function() {\n        // console.log(\"currentTab: \" + currentTab);\n        var hasNextPage = true;\n        resource.query({\n          tab: currentTab\n        }, function(r) {\n          // console.log(r);\n          if (r.data.length < 20) {\n            hasNextPage = false;\n          }\n          topics[currentTab] = {\n            'nextPage': 2,\n            'hasNextPage': hasNextPage,\n            'data': r.data\n          };\n          // topics[currentTab] = r.data;\n          $rootScope.$broadcast('ioniclub.topicsUpdated', topics[currentTab].data);\n          // console.table(topics);\n\n        });\n\n      },\n      getTopics: function() {\n        return topics[currentTab].data;\n      },\n      setCurrentTab: function(tab) {\n        currentTab = tab;\n        this.fetchTopStories();\n        // $rootScope.$broadcast('ioniclub.topicsUpdated', topics[currentTab]);\n      },\n      getCurrentTab: function() {\n        return currentTab;\n      },\n      increaseNewTopicsCount: function() {\n        var nextPage = topics[currentTab].nextPage;\n        var hasNextPage = topics[currentTab].hasNextPage;\n        var topicsData = topics[currentTab].data;\n        resource.query({\n          tab: currentTab,\n          page: nextPage,\n          limit: 20,\n          mdrender: true\n\n        }, function(r) {\n          // console.log(r);\n          nextPage++;\n          if (r.data.length < 20) {\n            hasNextPage = false;\n          }\n          topicsData = topicsData.concat(r.data);\n          topics[currentTab] = {\n            'nextPage': nextPage,\n            'hasNextPage': hasNextPage,\n            'data': topicsData\n          };\n          // topics[currentTab] = r.data;\n          $rootScope.$broadcast('ioniclub.topicsUpdated', topics[currentTab]);\n          // console.table(topics);\n\n        });\n      },\n      hasNextPage: function() {\n        if (topics[currentTab] === undefined) {\n          return false;\n        }\n        return topics[currentTab].hasNextPage;\n      },\n      saveNewTopic: function(newTopicData) {\n        var currentUser = User.getCurrentUser();\n        return resource.save({\n          accesstoken: currentUser.accesstoken\n        }, newTopicData);\n      }\n\n    };\n\n\n  })\n  .factory('Topic', function($resource, $rootScope, $q, Storage, User, My, ENV) {\n    var APIUrl = ENV.api + '/topic/:id',\n      topic,\n      currentTab = \"all\";\n    var resource = $resource(ENV.api + '/topic/:id', {\n      id: '@id',\n    }, {\n      reply: {\n        method: 'post',\n        url: ENV.api + '/topic/:topicId/replies'\n      },\n      upReply: {\n        method: 'post',\n        url: ENV.api + '/reply/:replyId/ups'\n      },\n      collect: {\n        method: 'post',\n        url: ENV.api + '/topic/collect'\n      },\n      de_collect: {\n        method: 'post',\n        url: ENV.api + '/topic/de_collect'\n      }\n    });\n    return {\n      getById: function(id) {\n        // console.log(\"id:\" + id + \"   topic:\" + topic);\n        if (topic !== undefined && topic.id === id) {\n          var topicDefer = $q.defer();\n          topicDefer.resolve({\n            data: topic\n          });\n          return {\n            $promise: topicDefer.promise\n          };\n        }\n        return this.get(id);\n      },\n      get: function(id) {\n        return resource.get({\n          id: id\n        }, function(response) {\n          topic = response.data;\n        });\n\n      },\n      saveReply: function(topicId, replyData) {\n        var reply = angular.extend({}, replyData);\n        var currentUser = User.getCurrentUser();\n        // add send from\n        if (My.getSettings().sendFrom) {\n          reply.content = replyData.content + '\\n<br/> 发自 [Ioniclub](https://github.com/IonicChina/ioniclub)';\n        }\n        return resource.reply({\n          topicId: topicId,\n          accesstoken: currentUser.accesstoken\n        }, reply);\n      },\n      upReply: function(replyId) {\n        var currentUser = User.getCurrentUser();\n        return resource.upReply({\n          replyId: replyId,\n          accesstoken: currentUser.accesstoken\n        }, null, function(response) {\n          if (response.success) {\n            angular.forEach(topic.replies, function(reply, key) {\n              if (reply.id === replyId) {\n                if (response.action === 'up') {\n                  reply.ups.push(currentUser.id);\n                } else {\n                  reply.ups.pop();\n                }\n              }\n            });\n          }\n        });\n      },\n      collect: function(topicId) {\n        var currentUser = User.getCurrentUser();\n        return resource.collect({\n          topic_id: topicId,\n          accesstoken: currentUser.accesstoken\n        });\n      },\n      de_collect: function(topicId) {\n        var currentUser = User.getCurrentUser();\n        return resource.de_collect({\n          topic_id: topicId,\n          accesstoken: currentUser.accesstoken\n        });\n      }\n    };\n\n  });\n"
  }
]